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-15 23:02+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 #: ../inspector/virt-inspector.pl:31 ../tools/virt-edit.pl:30
23 #: ../tools/virt-win-reg.pl:33 ../tools/virt-df.pl:32 ../tools/virt-ls.pl:30
24 #: ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28
25 #: ../tools/virt-tar.pl:29 ../tools/virt-rescue.pl:29
26 #: ../tools/virt-make-fs.pl:33 ../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 #: ../inspector/virt-inspector.pl:33 ../tools/virt-edit.pl:32
34 #: ../tools/virt-win-reg.pl:35 ../tools/virt-df.pl:34 ../tools/virt-ls.pl:32
35 #: ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30
36 #: ../tools/virt-tar.pl:31 ../tools/virt-rescue.pl:31
37 #: ../tools/virt-make-fs.pl:35 ../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 #: ../inspector/virt-inspector.pl:37 ../tools/virt-edit.pl:36
50 #: ../tools/virt-win-reg.pl:39 ../tools/virt-df.pl:38 ../tools/virt-ls.pl:36
51 #: ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34
52 #: ../tools/virt-tar.pl:35 ../tools/virt-rescue.pl:35
53 #: ../tools/virt-make-fs.pl:39 ../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 #: ../inspector/virt-inspector.pl:43 ../tools/virt-edit.pl:50
94 #: ../tools/virt-win-reg.pl:63 ../tools/virt-df.pl:46 ../tools/virt-ls.pl:42
95 #: ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40
96 #: ../tools/virt-tar.pl:72 ../tools/virt-rescue.pl:51
97 #: ../tools/virt-make-fs.pl:47 ../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:1521 ../src/guestfs.pod:1526 ../src/guestfs.pod:1530
787 #: ../src/guestfs.pod:1640 ../src/guestfs.pod:1645 ../src/guestfs.pod:1649
788 #: ../src/guestfs.pod:1993 ../src/guestfs.pod:1999 ../src/guestfs.pod:2004
789 #: ../src/guestfs.pod:2010 ../src/guestfs.pod:2117 ../src/guestfs.pod:2121
790 #: ../src/guestfs.pod:2125 ../src/guestfs.pod:2129
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 #: ../inspector/virt-inspector.pl:466 ../inspector/virt-inspector.pl:470
817 #: ../tools/virt-df.pl:161 ../tools/virt-df.pl:167 ../tools/virt-resize.pl:348
818 #: ../tools/virt-resize.pl:353 ../tools/virt-resize.pl:363
823 #: ../src/guestfs.pod:362
825 "The kernel version that the command runs under will be different from what "
830 #: ../src/guestfs.pod:367
832 "If the command needs to communicate with daemons, then most likely they "
837 #: ../src/guestfs.pod:372
838 msgid "The command will be running in limited memory."
842 #: ../src/guestfs.pod:376
844 "The network may not be available unless you enable it (see L</"
845 "guestfs_set_network>)."
849 #: ../src/guestfs.pod:381
850 msgid "Only supports Linux guests (not Windows, BSD, etc)."
854 #: ../src/guestfs.pod:385
856 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
860 #: ../src/guestfs.pod:390
862 "For SELinux guests, you may need to enable SELinux and load policy first. "
863 "See L</SELINUX> in this manpage."
867 #: ../src/guestfs.pod:395
869 "I<Security:> It is not safe to run commands from untrusted, possibly "
870 "malicious guests. These commands may attempt to exploit your program by "
871 "sending unexpected output. They could also try to exploit the Linux kernel "
872 "or qemu provided by the libguestfs appliance. They could use the network "
873 "provided by the libguestfs appliance to bypass ordinary network partitions "
874 "and firewalls. They could use the elevated privileges or different SELinux "
875 "context of your program to their advantage."
879 #: ../src/guestfs.pod:404
881 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
882 "(a script which runs when the guest next boots normally), and to have this "
883 "script run the commands you want in the normal context of the running guest, "
884 "network security and so on. For information about other security issues, "
889 #: ../src/guestfs.pod:412
891 "The two main API calls to run commands are L</guestfs_command> and L</"
892 "guestfs_sh> (there are also variations)."
896 #: ../src/guestfs.pod:415
898 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
899 "shell globs, redirections, etc will work."
903 #: ../src/guestfs.pod:418
904 msgid "CONFIGURATION FILES"
908 #: ../src/guestfs.pod:420
910 "To read and write configuration files in Linux guest filesystems, we "
911 "strongly recommend using Augeas. For example, Augeas understands how to "
912 "read and write, say, a Linux shadow password file or X.org configuration "
913 "file, and so avoids you having to write that code."
917 #: ../src/guestfs.pod:425
919 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
920 "document Augeas itself here because there is excellent documentation on the "
921 "L<http://augeas.net/> website."
925 #: ../src/guestfs.pod:429
927 "If you don't want to use Augeas (you fool!) then try calling L</"
928 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
933 #: ../src/guestfs.pod:433
938 #: ../src/guestfs.pod:435
940 "We support SELinux guests. To ensure that labeling happens correctly in "
941 "SELinux guests, you need to enable SELinux and load the guest's policy:"
945 #: ../src/guestfs.pod:441 ../src/guestfs.pod:1142 ../src/guestfs.pod:1273
950 #: ../src/guestfs.pod:443
951 msgid "Before launching, do:"
955 #: ../src/guestfs.pod:445
958 " guestfs_set_selinux (g, 1);\n"
963 #: ../src/guestfs.pod:447 ../src/guestfs.pod:1146 ../src/guestfs.pod:1277
968 #: ../src/guestfs.pod:449
970 "After mounting the guest's filesystem(s), load the policy. This is best "
971 "done by running the L<load_policy(8)> command in the guest itself:"
975 #: ../src/guestfs.pod:453
978 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
983 #: ../src/guestfs.pod:455
985 "(Older versions of C<load_policy> require you to specify the name of the "
990 #: ../src/guestfs.pod:458 ../src/guestfs.pod:1283
995 #: ../src/guestfs.pod:460
997 "Optionally, set the security context for the API. The correct security "
998 "context to use can only be known by inspecting the guest. As an example:"
1002 #: ../src/guestfs.pod:464
1005 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1010 #: ../src/guestfs.pod:468
1011 msgid "This will work for running commands and editing existing files."
1015 #: ../src/guestfs.pod:470
1017 "When new files are created, you may need to label them explicitly, for "
1018 "example by running the external command C<restorecon pathname>."
1022 #: ../src/guestfs.pod:474
1027 #: ../src/guestfs.pod:476
1029 "Certain calls are affected by the current file mode creation mask (the "
1030 "\"umask\"). In particular ones which create files or directories, such as "
1031 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1032 "either the default mode that the file is created with or modifies the mode "
1037 #: ../src/guestfs.pod:482
1039 "The default umask is C<022>, so files are created with modes such as C<0644> "
1040 "and directories with C<0755>."
1044 #: ../src/guestfs.pod:485
1046 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1047 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1048 "guestfs_chmod> after creating each file or directory."
1052 #: ../src/guestfs.pod:489
1053 msgid "For more information about umask, see L<umask(2)>."
1057 #: ../src/guestfs.pod:491 ../fish/guestfish.pod:669
1058 msgid "ENCRYPTED DISKS"
1062 #: ../src/guestfs.pod:493
1064 "Libguestfs allows you to access Linux guests which have been encrypted using "
1065 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1066 "standard. This includes nearly all whole disk encryption systems used by "
1067 "modern Linux guests."
1071 #: ../src/guestfs.pod:499
1073 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1074 "returns the string C<crypto_LUKS>)."
1078 #: ../src/guestfs.pod:502
1080 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1081 "will require the passphrase!"
1085 #: ../src/guestfs.pod:505
1087 "Opening a LUKS device creates a new device mapper device called C</dev/"
1088 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1089 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1090 "from and encrypted to the underlying block device respectively."
1094 #: ../src/guestfs.pod:511
1096 "LVM volume groups on the device can be made visible by calling L</"
1097 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1098 "(s) can now be mounted in the usual way."
1102 #: ../src/guestfs.pod:515
1104 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1105 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1106 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1107 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1108 "underlying encrypted block device)."
1112 #: ../src/guestfs.pod:522
1117 #: ../src/guestfs.pod:524
1119 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1120 "contains operating systems. (These APIs used to be in a separate Perl-only "
1121 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1122 "frequently used part of this library has been rewritten in C and moved into "
1127 #: ../src/guestfs.pod:530
1129 "Add all disks belonging to the unknown virtual machine and call L</"
1130 "guestfs_launch> in the usual way."
1134 #: ../src/guestfs.pod:533
1136 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1137 "and certain heuristics, and returns a list of operating systems that were "
1138 "found. An empty list means none were found. A single element is the root "
1139 "filesystem of the operating system. For dual- or multi-boot guests, "
1140 "multiple roots can be returned, each one corresponding to a separate "
1141 "operating system. (Multi-boot virtual machines are extremely rare in the "
1142 "world of virtualization, but since this scenario can happen, we have built "
1143 "libguestfs to deal with it.)"
1147 #: ../src/guestfs.pod:542
1149 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1150 "to get additional details about that operating system. For example, call L</"
1151 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1152 "Windows and Linux-based operating systems respectively."
1156 #: ../src/guestfs.pod:548
1158 "Un*x-like and Linux-based operating systems usually consist of several "
1159 "filesystems which are mounted at boot time (for example, a separate boot "
1160 "partition mounted on C</boot>). The inspection rules are able to detect how "
1161 "filesystems correspond to mount points. Call "
1162 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1163 "hash table like this example:"
1167 #: ../src/guestfs.pod:555
1170 " /boot => /dev/sda1\n"
1171 " / => /dev/vg_guest/lv_root\n"
1172 " /usr => /dev/vg_guest/lv_usr\n"
1177 #: ../src/guestfs.pod:559
1179 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1180 "filesystems as suggested."
1184 #: ../src/guestfs.pod:562
1186 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1187 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1191 #: ../src/guestfs.pod:566
1193 "Inspection currently only works for some common operating systems. "
1194 "Contributors are welcome to send patches for other operating systems that we "
1195 "currently cannot detect."
1199 #: ../src/guestfs.pod:570
1201 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1202 "for more details. The L</guestfs_inspect_os> function just ignores any "
1203 "encrypted devices."
1207 #: ../src/guestfs.pod:574
1209 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1210 "inspection and caches the results in the guest handle. Subsequent calls to "
1211 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1212 "read the disks. If you change the content of the guest disks, you can redo "
1213 "inspection by calling L</guestfs_inspect_os> again. (L</"
1214 "guestfs_inspect_list_applications> works a little differently from the other "
1215 "calls and does read the disks. See documentation for that function for "
1220 #: ../src/guestfs.pod:583
1221 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1225 #: ../src/guestfs.pod:585
1227 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1228 "ntfs-3g.org/> driver."
1232 #: ../src/guestfs.pod:588
1234 "DOS and Windows still use drive letters, and the filesystems are always "
1235 "treated as case insensitive by Windows itself, and therefore you might find "
1236 "a Windows configuration file referring to a path like C<c:\\windows"
1237 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1238 "might be referred to as C</WINDOWS/System32>."
1242 #: ../src/guestfs.pod:594
1244 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1245 "libguestfs to read the appropriate Windows Registry and configuration files, "
1246 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1251 #: ../src/guestfs.pod:599
1253 "Replacing backslash characters with forward slash characters is also outside "
1254 "the scope of libguestfs, but something that you can easily do."
1258 #: ../src/guestfs.pod:602
1260 "Where we can help is in resolving the case insensitivity of paths. For "
1261 "this, call L</guestfs_case_sensitive_path>."
1265 #: ../src/guestfs.pod:605
1267 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1268 "files, through the library C<hivex> which is part of the libguestfs project "
1269 "although ships as a separate tarball. You have to locate and download the "
1270 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1271 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1272 "reg(1)> for more help on this issue."
1276 #: ../src/guestfs.pod:613
1277 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1281 #: ../src/guestfs.pod:615
1283 "Although we don't want to discourage you from using the C API, we will "
1284 "mention here that the same API is also available in other languages."
1288 #: ../src/guestfs.pod:618
1290 "The API is broadly identical in all supported languages. This means that "
1291 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1292 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1293 "words, a straightforward, predictable isomorphism between each language."
1297 #: ../src/guestfs.pod:624
1299 "Error messages are automatically transformed into exceptions if the language "
1304 #: ../src/guestfs.pod:627
1306 "We don't try to \"object orientify\" parts of the API in OO languages, "
1307 "although contributors are welcome to write higher level APIs above what we "
1308 "provide in their favourite languages if they wish."
1312 #: ../src/guestfs.pod:633
1317 #: ../src/guestfs.pod:635
1319 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1320 "identical to the C API. C++ classes and exceptions are not used."
1324 #: ../src/guestfs.pod:639
1329 #: ../src/guestfs.pod:641
1331 "The C# bindings are highly experimental. Please read the warnings at the "
1332 "top of C<csharp/Libguestfs.cs>."
1336 #: ../src/guestfs.pod:644
1341 #: ../src/guestfs.pod:646
1343 "This is the only language binding that is working but incomplete. Only "
1344 "calls which return simple integers have been bound in Haskell, and we are "
1345 "looking for help to complete this binding."
1349 #: ../src/guestfs.pod:650
1354 #: ../src/guestfs.pod:652
1356 "Full documentation is contained in the Javadoc which is distributed with "
1361 #: ../src/guestfs.pod:655
1366 #: ../src/guestfs.pod:657
1367 msgid "For documentation see the file C<guestfs.mli>."
1371 #: ../src/guestfs.pod:659
1376 #: ../src/guestfs.pod:661
1377 msgid "For documentation see L<Sys::Guestfs(3)>."
1381 #: ../src/guestfs.pod:663
1386 #: ../src/guestfs.pod:665
1388 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1389 "the php-libguestfs package for your distribution."
1393 #: ../src/guestfs.pod:668
1394 msgid "The PHP binding only works correctly on 64 bit machines."
1398 #: ../src/guestfs.pod:670
1403 #: ../src/guestfs.pod:672
1404 msgid "For documentation do:"
1408 #: ../src/guestfs.pod:674
1412 " >>> import guestfs\n"
1413 " >>> help (guestfs)\n"
1418 #: ../src/guestfs.pod:678
1423 #: ../src/guestfs.pod:680
1425 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1426 "can find examples written in Ruby in the libguestfs source."
1430 #: ../src/guestfs.pod:683
1431 msgid "B<shell scripts>"
1435 #: ../src/guestfs.pod:685
1436 msgid "For documentation see L<guestfish(1)>."
1440 #: ../src/guestfs.pod:689
1441 msgid "LIBGUESTFS GOTCHAS"
1445 #: ../src/guestfs.pod:691
1447 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1448 "system [...] that works in the way it is documented but is counterintuitive "
1449 "and almost invites mistakes.\""
1453 #: ../src/guestfs.pod:695
1455 "Since we developed libguestfs and the associated tools, there are several "
1456 "things we would have designed differently, but are now stuck with for "
1457 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1458 "release, you can expect these to change. Beware of them."
1462 #: ../src/guestfs.pod:703
1463 msgid "Autosync / forgetting to sync."
1467 #: ../src/guestfs.pod:705
1469 "When modifying a filesystem from C or another language, you B<must> unmount "
1470 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1471 "libguestfs handle. You can also call:"
1475 #: ../src/guestfs.pod:709
1478 " guestfs_set_autosync (g, 1);\n"
1483 #: ../src/guestfs.pod:711
1485 "to have the unmount/sync done automatically for you when the handle 'g' is "
1486 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1490 #: ../src/guestfs.pod:715
1492 "If you forget to do this, then it is entirely possible that your changes "
1493 "won't be written out, or will be partially written, or (very rarely) that "
1494 "you'll get disk corruption."
1498 #: ../src/guestfs.pod:719
1500 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1501 "guestfish scripts that forget to sync will work just fine, which can make "
1502 "this very puzzling if you are trying to debug a problem."
1506 #: ../src/guestfs.pod:723
1508 "Update: Autosync is enabled by default for all API users starting from "
1509 "libguestfs 1.5.24."
1513 #: ../src/guestfs.pod:726
1514 msgid "Mount option C<-o sync> should not be the default."
1518 #: ../src/guestfs.pod:728
1520 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1521 "However C<-o sync> does not add any reliability benefit, but does have a "
1522 "very large performance impact."
1526 #: ../src/guestfs.pod:732
1528 "The work around is to use L</guestfs_mount_options> and set the mount "
1529 "options that you actually want to use."
1533 #: ../src/guestfs.pod:735
1534 msgid "Read-only should be the default."
1538 #: ../src/guestfs.pod:737
1540 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1541 "specify I<--rw> if you want to make changes to the image."
1545 #: ../src/guestfs.pod:740
1546 msgid "This would reduce the potential to corrupt live VM images."
1550 #: ../src/guestfs.pod:742
1552 "Note that many filesystems change the disk when you just mount and unmount, "
1553 "even if you didn't perform any writes. You need to use L</"
1554 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1558 #: ../src/guestfs.pod:746
1559 msgid "guestfish command line is hard to use."
1563 #: ../src/guestfs.pod:748
1565 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1566 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1567 "exist, so it fails. In earlier versions of guestfish the error message was "
1568 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1569 "we should have used C<guestfish -c command> to run commands."
1573 #: ../src/guestfs.pod:755
1574 msgid "guestfish megabyte modifiers don't work right on all commands"
1578 #: ../src/guestfs.pod:757
1580 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1581 "other modifiers). What guestfish actually does is to multiply the number "
1582 "part by the modifier part and pass the result to the C API. However this "
1583 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1584 "expecting some other unit (eg. megabytes)."
1588 #: ../src/guestfs.pod:764
1589 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1593 #: ../src/guestfs.pod:766
1596 " lvcreate LV VG 100M\n"
1601 #: ../src/guestfs.pod:768
1603 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1604 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1605 "megabytes * megabytes) logical volume. The error message you get from this "
1606 "is also a little obscure."
1610 #: ../src/guestfs.pod:773
1612 "This could be fixed in the generator by specially marking parameters and "
1613 "return values which take bytes or other units."
1617 #: ../src/guestfs.pod:776
1618 msgid "Ambiguity between devices and paths"
1622 #: ../src/guestfs.pod:778
1624 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1625 "sdb2>) and a similar pathname. A file might just happen to be called "
1626 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1630 #: ../src/guestfs.pod:783
1632 "In the current API we usually resolve this ambiguity by having two separate "
1633 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1634 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1635 "detecting if the path supplied begins with C</dev/>."
1639 #: ../src/guestfs.pod:789
1641 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1642 "make paths/devices into structured names. One way to do this would be to "
1643 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1644 "aspect of grub. Another way would be to use a structured type, equivalent "
1645 "to this OCaml type:"
1649 #: ../src/guestfs.pod:795
1652 " type path = Path of string | Device of int | Partition of int * int\n"
1657 #: ../src/guestfs.pod:797
1658 msgid "which would allow you to pass arguments like:"
1662 #: ../src/guestfs.pod:799
1665 " Path \"/foo/bar\"\n"
1666 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1667 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1668 " Path \"/dev/sdb2\" (* not a device *)\n"
1673 #: ../src/guestfs.pod:804
1675 "As you can see there are still problems to resolve even with this "
1676 "representation. Also consider how it might work in guestfish."
1680 #: ../src/guestfs.pod:809
1681 msgid "PROTOCOL LIMITS"
1685 #: ../src/guestfs.pod:811
1687 "Internally libguestfs uses a message-based protocol to pass API calls and "
1688 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1689 "plenty more detail about this). The maximum message size used by the "
1690 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1691 "aware of this limit. The API calls which may be affected are individually "
1692 "documented, with a link back to this section of the documentation."
1696 #: ../src/guestfs.pod:819
1698 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1699 "a simple string. Because this string is at some point internally encoded as "
1700 "a message, the maximum size that it can return is slightly under 4 MB. If "
1701 "the requested file is larger than this then you will get an error."
1705 #: ../src/guestfs.pod:825
1707 "In order to transfer large files into and out of the guest filesystem, you "
1708 "need to use particular calls that support this. The sections L</UPLOADING> "
1709 "and L</DOWNLOADING> document how to do this."
1713 #: ../src/guestfs.pod:829
1715 "You might also consider mounting the disk image using our FUSE filesystem "
1716 "support (L<guestmount(1)>)."
1720 #: ../src/guestfs.pod:832
1721 msgid "KEYS AND PASSPHRASES"
1725 #: ../src/guestfs.pod:834
1727 "Certain libguestfs calls take a parameter that contains sensitive key "
1728 "material, passed in as a C string."
1732 #: ../src/guestfs.pod:837
1734 "In the future we would hope to change the libguestfs implementation so that "
1735 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1736 "swap. However this is I<not> done at the moment, because of the complexity "
1737 "of such an implementation."
1741 #: ../src/guestfs.pod:842
1743 "Therefore you should be aware that any key parameter you pass to libguestfs "
1744 "might end up being written out to the swap partition. If this is a concern, "
1745 "scrub the swap partition or don't use libguestfs on encrypted devices."
1749 #: ../src/guestfs.pod:847
1750 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1754 #: ../src/guestfs.pod:849
1756 "All high-level libguestfs actions are synchronous. If you want to use "
1757 "libguestfs asynchronously then you must create a thread."
1761 #: ../src/guestfs.pod:852
1763 "Only use the handle from a single thread. Either use the handle exclusively "
1764 "from one thread, or provide your own mutex so that two threads cannot issue "
1765 "calls on the same handle at the same time."
1769 #: ../src/guestfs.pod:856
1771 "See the graphical program guestfs-browser for one possible architecture for "
1772 "multithreaded programs using libvirt and libguestfs."
1776 #: ../src/guestfs.pod:859
1781 #: ../src/guestfs.pod:861
1783 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1788 #: ../src/guestfs.pod:864
1790 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1791 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1795 #: ../src/guestfs.pod:867
1797 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1798 "to change the directories that libguestfs will search in. The value is a "
1799 "colon-separated list of paths. The current directory is I<not> searched "
1800 "unless the path contains an empty element or C<.>. For example "
1801 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1802 "then C</usr/lib/guestfs>."
1806 #: ../src/guestfs.pod:874
1807 msgid "QEMU WRAPPERS"
1811 #: ../src/guestfs.pod:876
1813 "If you want to compile your own qemu, run qemu from a non-standard location, "
1814 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1819 #: ../src/guestfs.pod:880
1821 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1822 "last command in the shell script (so that qemu replaces the shell and "
1823 "becomes the direct child of the libguestfs-using program). If you don't do "
1824 "this, then the qemu process won't be cleaned up correctly."
1828 #: ../src/guestfs.pod:885
1830 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1835 #: ../src/guestfs.pod:888
1839 " qemudir=/home/rjones/d/qemu\n"
1840 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1845 #: ../src/guestfs.pod:892
1847 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1848 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1853 #: ../src/guestfs.pod:896
1856 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1861 #: ../src/guestfs.pod:898
1863 "Note that libguestfs also calls qemu with the -help and -version options in "
1864 "order to determine features."
1868 #: ../src/guestfs.pod:901
1869 msgid "ABI GUARANTEE"
1873 #: ../src/guestfs.pod:903
1875 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1876 "actions as outlined in this section. Although we will deprecate some "
1877 "actions, for example if they get replaced by newer calls, we will keep the "
1878 "old actions forever. This allows you the developer to program in confidence "
1879 "against the libguestfs API."
1883 #: ../src/guestfs.pod:909
1884 msgid "BLOCK DEVICE NAMING"
1888 #: ../src/guestfs.pod:911
1890 "In the kernel there is now quite a profusion of schemata for naming block "
1891 "devices (in this context, by I<block device> I mean a physical or virtual "
1892 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1893 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1894 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1895 "for the old IDE driver (particularly for SATA devices) those devices also "
1896 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1897 "paravirtualized drivers. This has created several different naming systems, "
1898 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
1902 #: ../src/guestfs.pod:923
1904 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1905 "Linux kernel to access block devices. We can run a variety of appliances "
1906 "based on a variety of Linux kernels."
1910 #: ../src/guestfs.pod:927
1912 "This causes a problem for libguestfs because many API calls use device or "
1913 "partition names. Working scripts and the recipe (example) scripts that we "
1914 "make available over the internet could fail if the naming scheme changes."
1918 #: ../src/guestfs.pod:932
1920 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1921 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1922 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1923 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1927 #: ../src/guestfs.pod:938
1929 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1930 "L</guestfs_list_partitions> and similar calls return the true names of the "
1931 "devices and partitions as known to the appliance."
1935 #: ../src/guestfs.pod:943
1936 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1940 #: ../src/guestfs.pod:945
1942 "Usually this translation is transparent. However in some (very rare) cases "
1943 "you may need to know the exact algorithm. Such cases include where you use "
1944 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
1945 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
1949 #: ../src/guestfs.pod:951
1951 "The algorithm is applied only to I<parameters> which are known to be either "
1952 "device or partition names. Return values from functions such as L</"
1953 "guestfs_list_devices> are never changed."
1957 #: ../src/guestfs.pod:959
1958 msgid "Is the string a parameter which is a device or partition name?"
1962 #: ../src/guestfs.pod:963
1963 msgid "Does the string begin with C</dev/sd>?"
1967 #: ../src/guestfs.pod:967
1969 "Does the named device exist? If so, we use that device. However if I<not> "
1970 "then we continue with this algorithm."
1974 #: ../src/guestfs.pod:972
1975 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
1979 #: ../src/guestfs.pod:974
1980 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
1984 #: ../src/guestfs.pod:976
1985 msgid "If that named device exists, use it. If not, continue."
1989 #: ../src/guestfs.pod:980
1990 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
1994 #: ../src/guestfs.pod:982
1995 msgid "If that named device exists, use it. If not, return an error."
1999 #: ../src/guestfs.pod:986
2000 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2004 #: ../src/guestfs.pod:988
2006 "Although the standard naming scheme and automatic translation is useful for "
2007 "simple programs and guestfish scripts, for larger programs it is best not to "
2008 "rely on this mechanism."
2012 #: ../src/guestfs.pod:992
2014 "Where possible for maximum future portability programs using libguestfs "
2015 "should use these future-proof techniques:"
2019 #: ../src/guestfs.pod:999
2021 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2022 "device names, and then use those names directly."
2026 #: ../src/guestfs.pod:1002
2028 "Since those device names exist by definition, they will never be translated."
2032 #: ../src/guestfs.pod:1007
2034 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2035 "filesystem labels."
2039 #: ../src/guestfs.pod:1012
2044 #: ../src/guestfs.pod:1014
2046 "This section discusses security implications of using libguestfs, "
2047 "particularly with untrusted or malicious guests or disk images."
2051 #: ../src/guestfs.pod:1017
2052 msgid "GENERAL SECURITY CONSIDERATIONS"
2056 #: ../src/guestfs.pod:1019
2058 "Be careful with any files or data that you download from a guest (by "
2059 "\"download\" we mean not just the L</guestfs_download> command but any "
2060 "command that reads files, filenames, directories or anything else from a "
2061 "disk image). An attacker could manipulate the data to fool your program "
2062 "into doing the wrong thing. Consider cases such as:"
2066 #: ../src/guestfs.pod:1029
2067 msgid "the data (file etc) not being present"
2071 #: ../src/guestfs.pod:1033
2072 msgid "being present but empty"
2076 #: ../src/guestfs.pod:1037
2077 msgid "being much larger than normal"
2081 #: ../src/guestfs.pod:1041
2082 msgid "containing arbitrary 8 bit data"
2086 #: ../src/guestfs.pod:1045
2087 msgid "being in an unexpected character encoding"
2091 #: ../src/guestfs.pod:1049
2092 msgid "containing homoglyphs."
2096 #: ../src/guestfs.pod:1053
2097 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2101 #: ../src/guestfs.pod:1055
2103 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2104 "(VFS) module can sometimes be escalated into exploits by deliberately "
2105 "creating a malicious, malformed filesystem. These exploits are very severe "
2106 "for two reasons. Firstly there are very many filesystem drivers in the "
2107 "kernel, and many of them are infrequently used and not much developer "
2108 "attention has been paid to the code. Linux userspace helps potential "
2109 "crackers by detecting the filesystem type and automatically choosing the "
2110 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2111 "the administrator. Secondly, a kernel-level exploit is like a local root "
2112 "exploit (worse in some ways), giving immediate and total access to the "
2113 "system right down to the hardware level."
2117 #: ../src/guestfs.pod:1068
2119 "That explains why you should never mount a filesystem from an untrusted "
2120 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2121 "inside a qemu virtual machine, usually running as a non-root user. The "
2122 "attacker would need to write a filesystem which first exploited the kernel, "
2123 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2124 "the libguestfs protocol, and finally to be as serious as the host kernel "
2125 "exploit it would need to escalate its privileges to root. This multi-step "
2126 "escalation, performed by a static piece of data, is thought to be extremely "
2127 "hard to do, although we never say 'never' about security issues."
2131 #: ../src/guestfs.pod:1079
2133 "In any case callers can reduce the attack surface by forcing the filesystem "
2134 "type when mounting (use L</guestfs_mount_vfs>)."
2138 #: ../src/guestfs.pod:1082
2139 msgid "PROTOCOL SECURITY"
2143 #: ../src/guestfs.pod:1084
2145 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2146 "defined upper message size. However a program that uses libguestfs must "
2147 "also take care - for example you can write a program that downloads a binary "
2148 "from a disk image and executes it locally, and no amount of protocol "
2149 "security will save you from the consequences."
2153 #: ../src/guestfs.pod:1090
2154 msgid "INSPECTION SECURITY"
2158 #: ../src/guestfs.pod:1092
2160 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2161 "directly from the guest, and these could contain any 8 bit data. Callers "
2162 "should be careful to escape these before printing them to a structured file "
2163 "(for example, use HTML escaping if creating a web page)."
2167 #: ../src/guestfs.pod:1098
2169 "The inspection API parses guest configuration using two external libraries: "
2170 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2171 "designed to be robust in the face of malicious data, although denial of "
2172 "service attacks are still possible, for example with oversized configuration "
2177 #: ../src/guestfs.pod:1104
2178 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2182 #: ../src/guestfs.pod:1106
2184 "Be very cautious about running commands from the guest. By running a "
2185 "command in the guest, you are giving CPU time to a binary that you do not "
2186 "control, under the same user account as the library, albeit wrapped in qemu "
2187 "virtualization. More information and alternatives can be found in the "
2188 "section L</RUNNING COMMANDS>."
2192 #: ../src/guestfs.pod:1112
2193 msgid "CVE-2010-3851"
2197 #: ../src/guestfs.pod:1114
2198 msgid "https://bugzilla.redhat.com/642934"
2202 #: ../src/guestfs.pod:1116
2204 "This security bug concerns the automatic disk format detection that qemu "
2205 "does on disk images."
2209 #: ../src/guestfs.pod:1119
2211 "A raw disk image is just the raw bytes, there is no header. Other disk "
2212 "images like qcow2 contain a special header. Qemu deals with this by looking "
2213 "for one of the known headers, and if none is found then assuming the disk "
2214 "image must be raw."
2218 #: ../src/guestfs.pod:1124
2220 "This allows a guest which has been given a raw disk image to write some "
2221 "other header. At next boot (or when the disk image is accessed by "
2222 "libguestfs) qemu would do autodetection and think the disk image format was, "
2223 "say, qcow2 based on the header written by the guest."
2227 #: ../src/guestfs.pod:1129
2229 "This in itself would not be a problem, but qcow2 offers many features, one "
2230 "of which is to allow a disk image to refer to another image (called the "
2231 "\"backing disk\"). It does this by placing the path to the backing disk "
2232 "into the qcow2 header. This path is not validated and could point to any "
2233 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2234 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2235 "control of the attacker."
2239 #: ../src/guestfs.pod:1137
2241 "In libguestfs this is rather hard to exploit except under two circumstances:"
2245 #: ../src/guestfs.pod:1144
2246 msgid "You have enabled the network or have opened the disk in write mode."
2250 #: ../src/guestfs.pod:1148
2252 "You are also running untrusted code from the guest (see L</RUNNING "
2257 #: ../src/guestfs.pod:1153
2259 "The way to avoid this is to specify the expected disk format when adding "
2260 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2261 "should always do this if the disk is raw format, and it's a good idea for "
2266 #: ../src/guestfs.pod:1158
2268 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2269 "format is fetched from libvirt and passed through."
2273 #: ../src/guestfs.pod:1161
2275 "For libguestfs tools, use the I<--format> command line parameter as "
2280 #: ../src/guestfs.pod:1164
2281 msgid "CONNECTION MANAGEMENT"
2285 #: ../src/guestfs.pod:1166
2290 #: ../src/guestfs.pod:1168
2292 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2293 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2294 "handle and release all resources used."
2298 #: ../src/guestfs.pod:1172
2300 "For information on using multiple handles and threads, see the section L</"
2301 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2305 #: ../src/guestfs.pod:1175
2306 msgid "guestfs_create"
2310 #: ../src/guestfs.pod:1177
2313 " guestfs_h *guestfs_create (void);\n"
2318 #: ../src/guestfs.pod:1179
2319 msgid "Create a connection handle."
2323 #: ../src/guestfs.pod:1181
2325 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2326 "on the handle at least once."
2330 #: ../src/guestfs.pod:1184
2332 "This function returns a non-NULL pointer to a handle on success or NULL on "
2337 #: ../src/guestfs.pod:1187
2338 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2342 #: ../src/guestfs.pod:1189
2344 "You may also want to configure error handling for the handle. See L</ERROR "
2345 "HANDLING> section below."
2349 #: ../src/guestfs.pod:1192
2350 msgid "guestfs_close"
2354 #: ../src/guestfs.pod:1194
2357 " void guestfs_close (guestfs_h *g);\n"
2362 #: ../src/guestfs.pod:1196
2363 msgid "This closes the connection handle and frees up all resources used."
2367 #: ../src/guestfs.pod:1198
2368 msgid "ERROR HANDLING"
2372 #: ../src/guestfs.pod:1200
2374 "API functions can return errors. For example, almost all functions that "
2375 "return C<int> will return C<-1> to indicate an error."
2379 #: ../src/guestfs.pod:1203
2381 "Additional information is available for errors: an error message string and "
2382 "optionally an error number (errno) if the thing that failed was a system "
2387 #: ../src/guestfs.pod:1207
2389 "You can get at the additional information about the last error on the handle "
2390 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2391 "up an error handler with L</guestfs_set_error_handler>."
2395 #: ../src/guestfs.pod:1212
2397 "When the handle is created, a default error handler is installed which "
2398 "prints the error message string to C<stderr>. For small short-running "
2399 "command line programs it is sufficient to do:"
2403 #: ../src/guestfs.pod:1216
2406 " if (guestfs_launch (g) == -1)\n"
2407 " exit (EXIT_FAILURE);\n"
2412 #: ../src/guestfs.pod:1219
2414 "since the default error handler will ensure that an error message has been "
2415 "printed to C<stderr> before the program exits."
2419 #: ../src/guestfs.pod:1222
2421 "For other programs the caller will almost certainly want to install an "
2422 "alternate error handler or do error handling in-line like this:"
2426 #: ../src/guestfs.pod:1225
2429 " g = guestfs_create ();\n"
2434 #: ../src/guestfs.pod:1227
2437 " /* This disables the default behaviour of printing errors\n"
2439 " guestfs_set_error_handler (g, NULL, NULL);\n"
2444 #: ../src/guestfs.pod:1231
2447 " if (guestfs_launch (g) == -1) {\n"
2448 " /* Examine the error message and print it etc. */\n"
2449 " char *msg = guestfs_last_error (g);\n"
2450 " int errnum = guestfs_last_errno (g);\n"
2451 " fprintf (stderr, \"%s\\n\", msg);\n"
2458 #: ../src/guestfs.pod:1239
2460 "Out of memory errors are handled differently. The default action is to call "
2461 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2462 "guestfs_set_out_of_memory_handler>."
2466 #: ../src/guestfs.pod:1243
2468 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2469 "because there is no handle if this happens there is no way to get additional "
2470 "error information. However L</guestfs_create> is supposed to be a "
2471 "lightweight operation which can only fail because of insufficient memory (it "
2472 "returns NULL in this case)."
2476 #: ../src/guestfs.pod:1249
2477 msgid "guestfs_last_error"
2481 #: ../src/guestfs.pod:1251
2484 " const char *guestfs_last_error (guestfs_h *g);\n"
2489 #: ../src/guestfs.pod:1253
2491 "This returns the last error message that happened on C<g>. If there has not "
2492 "been an error since the handle was created, then this returns C<NULL>."
2496 #: ../src/guestfs.pod:1257
2498 "The lifetime of the returned string is until the next error occurs, or L</"
2499 "guestfs_close> is called."
2503 #: ../src/guestfs.pod:1260
2504 msgid "guestfs_last_errno"
2508 #: ../src/guestfs.pod:1262
2511 " int guestfs_last_errno (guestfs_h *g);\n"
2516 #: ../src/guestfs.pod:1264
2517 msgid "This returns the last error number (errno) that happened on C<g>."
2521 #: ../src/guestfs.pod:1266
2522 msgid "If successful, an errno integer not equal to zero is returned."
2526 #: ../src/guestfs.pod:1268
2528 "If no error, this returns 0. This call can return 0 in three situations:"
2532 #: ../src/guestfs.pod:1275
2533 msgid "There has not been any error on the handle."
2537 #: ../src/guestfs.pod:1279
2539 "There has been an error but the errno was meaningless. This corresponds to "
2540 "the case where the error did not come from a failed system call, but for "
2541 "some other reason."
2545 #: ../src/guestfs.pod:1285
2547 "There was an error from a failed system call, but for some reason the errno "
2548 "was not captured and returned. This usually indicates a bug in libguestfs."
2552 #: ../src/guestfs.pod:1291
2554 "Libguestfs tries to convert the errno from inside the applicance into a "
2555 "corresponding errno for the caller (not entirely trivial: the appliance "
2556 "might be running a completely different operating system from the library "
2557 "and error numbers are not standardized across Un*xen). If this could not be "
2558 "done, then the error is translated to C<EINVAL>. In practice this should "
2559 "only happen in very rare circumstances."
2563 #: ../src/guestfs.pod:1299
2564 msgid "guestfs_set_error_handler"
2568 #: ../src/guestfs.pod:1301
2571 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2573 " const char *msg);\n"
2574 " void guestfs_set_error_handler (guestfs_h *g,\n"
2575 " guestfs_error_handler_cb cb,\n"
2581 #: ../src/guestfs.pod:1308
2583 "The callback C<cb> will be called if there is an error. The parameters "
2584 "passed to the callback are an opaque data pointer and the error message "
2589 #: ../src/guestfs.pod:1312
2591 "C<errno> is not passed to the callback. To get that the callback must call "
2592 "L</guestfs_last_errno>."
2596 #: ../src/guestfs.pod:1315
2598 "Note that the message string C<msg> is freed as soon as the callback "
2599 "function returns, so if you want to stash it somewhere you must make your "
2604 #: ../src/guestfs.pod:1319
2605 msgid "The default handler prints messages on C<stderr>."
2609 #: ../src/guestfs.pod:1321
2610 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2614 #: ../src/guestfs.pod:1323
2615 msgid "guestfs_get_error_handler"
2619 #: ../src/guestfs.pod:1325
2622 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2623 " void **opaque_rtn);\n"
2628 #: ../src/guestfs.pod:1328
2629 msgid "Returns the current error handler callback."
2633 #: ../src/guestfs.pod:1330
2634 msgid "guestfs_set_out_of_memory_handler"
2638 #: ../src/guestfs.pod:1332
2641 " typedef void (*guestfs_abort_cb) (void);\n"
2642 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2643 " guestfs_abort_cb);\n"
2648 #: ../src/guestfs.pod:1336
2650 "The callback C<cb> will be called if there is an out of memory situation. "
2651 "I<Note this callback must not return>."
2655 #: ../src/guestfs.pod:1339
2656 msgid "The default is to call L<abort(3)>."
2660 #: ../src/guestfs.pod:1341
2662 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2666 #: ../src/guestfs.pod:1344
2667 msgid "guestfs_get_out_of_memory_handler"
2671 #: ../src/guestfs.pod:1346
2674 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2679 #: ../src/guestfs.pod:1348
2680 msgid "This returns the current out of memory handler."
2684 #: ../src/guestfs.pod:1350
2689 #: ../src/guestfs.pod:1352 ../fish/guestfish.pod:907
2694 #: ../src/guestfs.pod:1354
2699 #: ../src/guestfs.pod:1356
2704 #: ../src/guestfs.pod:1358
2705 msgid "AVAILABILITY"
2709 #: ../src/guestfs.pod:1360
2710 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2714 #: ../src/guestfs.pod:1362
2716 "Using L</guestfs_available> you can test availability of the following "
2717 "groups of functions. This test queries the appliance to see if the "
2718 "appliance you are currently using supports the functionality."
2722 #: ../src/guestfs.pod:1367
2723 msgid "@AVAILABILITY@"
2727 #: ../src/guestfs.pod:1369
2728 msgid "GUESTFISH supported COMMAND"
2732 #: ../src/guestfs.pod:1371
2734 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2735 "prints out the available groups and whether they are supported by this build "
2736 "of libguestfs. Note however that you have to do C<run> first."
2740 #: ../src/guestfs.pod:1376
2741 msgid "SINGLE CALLS AT COMPILE TIME"
2745 #: ../src/guestfs.pod:1378
2747 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2748 "function, such as:"
2752 #: ../src/guestfs.pod:1381
2755 " #define LIBGUESTFS_HAVE_DD 1\n"
2760 #: ../src/guestfs.pod:1383
2761 msgid "if L</guestfs_dd> is available."
2765 #: ../src/guestfs.pod:1385
2767 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2768 "function is available at compile time, we recommended using build tools such "
2769 "as autoconf or cmake. For example in autotools you could use:"
2773 #: ../src/guestfs.pod:1390
2776 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2777 " AC_CHECK_FUNCS([guestfs_dd])\n"
2782 #: ../src/guestfs.pod:1393
2784 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2789 #: ../src/guestfs.pod:1396
2790 msgid "SINGLE CALLS AT RUN TIME"
2794 #: ../src/guestfs.pod:1398
2796 "Testing at compile time doesn't guarantee that a function really exists in "
2797 "the library. The reason is that you might be dynamically linked against a "
2798 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2799 "This situation unfortunately results in a segmentation fault, which is a "
2800 "shortcoming of the C dynamic linking system itself."
2804 #: ../src/guestfs.pod:1405
2806 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2807 "in this example program (note that you still need the compile time check as "
2812 #: ../src/guestfs.pod:1409
2815 " #include <stdio.h>\n"
2816 " #include <stdlib.h>\n"
2817 " #include <unistd.h>\n"
2818 " #include <dlfcn.h>\n"
2819 " #include <guestfs.h>\n"
2824 #: ../src/guestfs.pod:1415
2829 " #ifdef LIBGUESTFS_HAVE_DD\n"
2831 " int has_function;\n"
2836 #: ../src/guestfs.pod:1421
2839 " /* Test if the function guestfs_dd is really available. */\n"
2840 " dl = dlopen (NULL, RTLD_LAZY);\n"
2842 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2843 " exit (EXIT_FAILURE);\n"
2845 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2851 #: ../src/guestfs.pod:1430
2854 " if (!has_function)\n"
2855 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2857 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2858 " /* Now it's safe to call\n"
2859 " guestfs_dd (g, \"foo\", \"bar\");\n"
2863 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2870 #: ../src/guestfs.pod:1443
2872 "You may think the above is an awful lot of hassle, and it is. There are "
2873 "other ways outside of the C linking system to ensure that this kind of "
2874 "incompatibility never arises, such as using package versioning:"
2878 #: ../src/guestfs.pod:1448
2881 " Requires: libguestfs >= 1.0.80\n"
2886 #: ../src/guestfs.pod:1450
2887 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2891 #: ../src/guestfs.pod:1452
2893 "A recent feature of the API is the introduction of calls which take optional "
2894 "arguments. In C these are declared 3 ways. The main way is as a call which "
2895 "takes variable arguments (ie. C<...>), as in this example:"
2899 #: ../src/guestfs.pod:1457
2902 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2907 #: ../src/guestfs.pod:1459
2909 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2910 "call with no optional arguments specified:"
2914 #: ../src/guestfs.pod:1462
2917 " guestfs_add_drive_opts (g, filename, -1);\n"
2922 #: ../src/guestfs.pod:1464
2923 msgid "With a single optional argument:"
2927 #: ../src/guestfs.pod:1466
2930 " guestfs_add_drive_opts (g, filename,\n"
2931 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2937 #: ../src/guestfs.pod:1470
2942 #: ../src/guestfs.pod:1472
2945 " guestfs_add_drive_opts (g, filename,\n"
2946 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2947 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2953 #: ../src/guestfs.pod:1477
2955 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2960 #: ../src/guestfs.pod:1480
2961 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2965 #: ../src/guestfs.pod:1482
2967 "The second variant has the same name with the suffix C<_va>, which works the "
2968 "same way but takes a C<va_list>. See the C manual for details. For the "
2969 "example function, this is declared:"
2973 #: ../src/guestfs.pod:1486
2976 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2982 #: ../src/guestfs.pod:1489
2983 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2987 #: ../src/guestfs.pod:1491
2989 "The third variant is useful where you need to construct these calls. You "
2990 "pass in a structure where you fill in the optional fields. The structure "
2991 "has a bitmask as the first element which you must set to indicate which "
2992 "fields you have filled in. For our example function the structure and call "
2997 #: ../src/guestfs.pod:1497
3000 " struct guestfs_add_drive_opts_argv {\n"
3001 " uint64_t bitmask;\n"
3003 " const char *format;\n"
3006 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3007 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3012 #: ../src/guestfs.pod:1506
3013 msgid "You could call it like this:"
3017 #: ../src/guestfs.pod:1508
3020 " struct guestfs_add_drive_opts_argv optargs = {\n"
3021 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3022 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3024 " .format = \"qcow2\"\n"
3030 #: ../src/guestfs.pod:1515
3033 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3038 #: ../src/guestfs.pod:1517 ../src/guestfs-actions.pod:11
3039 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9
3040 #: ../fish/guestfish-actions.pod:1255
3045 #: ../src/guestfs.pod:1523
3046 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3050 #: ../src/guestfs.pod:1528
3051 msgid "You do not need to fill in all fields of the structure."
3055 #: ../src/guestfs.pod:1532
3057 "There must be a one-to-one correspondence between fields of the structure "
3058 "that are filled in, and bits set in the bitmask."
3062 #: ../src/guestfs.pod:1537
3063 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3067 #: ../src/guestfs.pod:1539
3069 "In other languages, optional arguments are expressed in the way that is "
3070 "natural for that language. We refer you to the language-specific "
3071 "documentation for more details on that."
3075 #: ../src/guestfs.pod:1543
3076 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3080 #: ../src/guestfs.pod:1545
3081 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3085 #: ../src/guestfs.pod:1547
3087 "The child process generates events in some situations. Current events "
3088 "include: receiving a log message, the child process exits."
3092 #: ../src/guestfs.pod:1550
3094 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3099 #: ../src/guestfs.pod:1553
3101 "Only I<one callback of each type> can be registered for each handle. "
3102 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3103 "that type. Cancel all callbacks of this type by calling this function with "
3104 "C<cb> set to C<NULL>."
3108 #: ../src/guestfs.pod:1558
3109 msgid "guestfs_set_log_message_callback"
3113 #: ../src/guestfs.pod:1560
3116 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3117 " char *buf, int len);\n"
3118 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3119 " guestfs_log_message_cb cb,\n"
3125 #: ../src/guestfs.pod:1566
3127 "The callback function C<cb> will be called whenever qemu or the guest writes "
3128 "anything to the console."
3132 #: ../src/guestfs.pod:1569
3133 msgid "Use this function to capture kernel messages and similar."
3137 #: ../src/guestfs.pod:1571
3139 "Normally there is no log message handler, and log messages are just "
3144 #: ../src/guestfs.pod:1574
3145 msgid "guestfs_set_subprocess_quit_callback"
3149 #: ../src/guestfs.pod:1576
3152 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3153 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3154 " guestfs_subprocess_quit_cb cb,\n"
3160 #: ../src/guestfs.pod:1581
3162 "The callback function C<cb> will be called when the child process quits, "
3163 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3164 "corresponds to a transition from any state to the CONFIG state)."
3168 #: ../src/guestfs.pod:1586
3169 msgid "guestfs_set_launch_done_callback"
3173 #: ../src/guestfs.pod:1588
3176 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3177 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3178 " guestfs_launch_done_cb cb,\n"
3184 #: ../src/guestfs.pod:1593
3186 "The callback function C<cb> will be called when the child process becomes "
3187 "ready first time after it has been launched. (This corresponds to a "
3188 "transition from LAUNCHING to the READY state)."
3192 #: ../src/guestfs.pod:1597
3193 msgid "guestfs_set_close_callback"
3197 #: ../src/guestfs.pod:1599
3200 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3201 " void guestfs_set_close_callback (guestfs_h *g,\n"
3202 " guestfs_close_cb cb,\n"
3208 #: ../src/guestfs.pod:1604
3210 "The callback function C<cb> will be called while the handle is being closed "
3211 "(synchronously from L</guestfs_close>)."
3215 #: ../src/guestfs.pod:1607
3217 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3218 "handles that are open when the program exits. This means that this callback "
3219 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3220 "problems in higher-level languages (eg. if your HLL interpreter has already "
3221 "been cleaned up by the time this is called, and if your callback then jumps "
3222 "into some HLL function)."
3226 #: ../src/guestfs.pod:1615
3227 msgid "guestfs_set_progress_callback"
3231 #: ../src/guestfs.pod:1617
3234 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3235 " int proc_nr, int serial,\n"
3236 " uint64_t position, uint64_t total);\n"
3237 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3238 " guestfs_progress_cb cb,\n"
3244 #: ../src/guestfs.pod:1624
3246 "Some long-running operations can generate progress messages. If this "
3247 "callback is registered, then it will be called each time a progress message "
3248 "is generated (usually two seconds after the operation started, and three "
3249 "times per second thereafter until it completes, although the frequency may "
3250 "change in future versions)."
3254 #: ../src/guestfs.pod:1630
3256 "The callback receives two numbers: C<position> and C<total>. The units of "
3257 "C<total> are not defined, although for some operations C<total> may relate "
3258 "in some way to the amount of data to be transferred (eg. in bytes or "
3259 "megabytes), and C<position> may be the portion which has been transferred."
3263 #: ../src/guestfs.pod:1636
3264 msgid "The only defined and stable parts of the API are:"
3268 #: ../src/guestfs.pod:1642
3270 "The callback can display to the user some type of progress bar or indicator "
3271 "which shows the ratio of C<position>:C<total>."
3275 #: ../src/guestfs.pod:1647
3276 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3280 #: ../src/guestfs.pod:1651
3282 "If any progress notification is sent during a call, then a final progress "
3283 "notification is always sent when C<position> = C<total>."
3287 #: ../src/guestfs.pod:1654
3289 "This is to simplify caller code, so callers can easily set the progress "
3290 "indicator to \"100%\" at the end of the operation, without requiring special "
3291 "code to detect this case."
3295 #: ../src/guestfs.pod:1660
3297 "The callback also receives the procedure number and serial number of the "
3298 "call. These are only useful for debugging protocol issues, and the callback "
3299 "can normally ignore them. The callback may want to print these numbers in "
3300 "error messages or debugging messages."
3304 #: ../src/guestfs.pod:1665
3305 msgid "PRIVATE DATA AREA"
3309 #: ../src/guestfs.pod:1667
3311 "You can attach named pieces of private data to the libguestfs handle, and "
3312 "fetch them by name for the lifetime of the handle. This is called the "
3313 "private data area and is only available from the C API."
3317 #: ../src/guestfs.pod:1671
3318 msgid "To attach a named piece of data, use the following call:"
3322 #: ../src/guestfs.pod:1673
3325 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3330 #: ../src/guestfs.pod:1675
3332 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3333 "pointer (which can be C<NULL>). Any previous item with the same name is "
3338 #: ../src/guestfs.pod:1679
3340 "You can use any C<key> you want, but names beginning with an underscore "
3341 "character are reserved for internal libguestfs purposes (for implementing "
3342 "language bindings). It is recommended to prefix the name with some unique "
3343 "string to avoid collisions with other users."
3347 #: ../src/guestfs.pod:1684
3348 msgid "To retrieve the pointer, use:"
3352 #: ../src/guestfs.pod:1686
3355 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3360 #: ../src/guestfs.pod:1688
3362 "This function returns C<NULL> if either no data is found associated with "
3363 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3368 #: ../src/guestfs.pod:1692
3370 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3371 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3372 "all. In particular, libguestfs does I<not> try to free the data when the "
3373 "handle is closed. If the data must be freed, then the caller must either "
3374 "free it before calling L</guestfs_close> or must set up a close callback to "
3375 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3376 "can be registered for a handle)."
3380 #: ../src/guestfs.pod:1700
3382 "The private data area is implemented using a hash table, and should be "
3383 "reasonably efficient for moderate numbers of keys."
3387 #: ../src/guestfs.pod:1703 ../src/guestfs.pod:1708
3392 #: ../src/guestfs.pod:1705
3394 "<!-- old anchor for the next section --> <a name="
3395 "\"state_machine_and_low_level_event_api\"/>"
3399 #: ../src/guestfs.pod:1710
3400 msgid "ARCHITECTURE"
3404 #: ../src/guestfs.pod:1712
3406 "Internally, libguestfs is implemented by running an appliance (a special "
3407 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3408 "process of the main program."
3412 #: ../src/guestfs.pod:1716
3415 " ___________________\n"
3417 " | main program |\n"
3419 " | | child process / appliance\n"
3420 " | | __________________________\n"
3422 " +-------------------+ RPC | +-----------------+ |\n"
3423 " | libguestfs <--------------------> guestfsd | |\n"
3424 " | | | +-----------------+ |\n"
3425 " \\___________________/ | | Linux kernel | |\n"
3426 " | +--^--------------+ |\n"
3427 " \\_________|________________/\n"
3433 " \\______________/\n"
3438 #: ../src/guestfs.pod:1736
3440 "The library, linked to the main program, creates the child process and hence "
3441 "the appliance in the L</guestfs_launch> function."
3445 #: ../src/guestfs.pod:1739
3447 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3448 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3449 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3450 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3451 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3452 "attached to the qemu process which translates device access by the "
3453 "appliance's Linux kernel into accesses to the image."
3457 #: ../src/guestfs.pod:1748
3459 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3460 "Although the disk image you are attached to might also be used by some "
3461 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3462 "care if both libguestfs's qemu process and your virtual machine are trying "
3463 "to update the disk image at the same time, since these usually results in "
3464 "massive disk corruption)."
3468 #: ../src/guestfs.pod:1755
3469 msgid "STATE MACHINE"
3473 #: ../src/guestfs.pod:1757
3474 msgid "libguestfs uses a state machine to model the child process:"
3478 #: ../src/guestfs.pod:1759
3490 " / | \\ \\ guestfs_launch\n"
3491 " / | _\\__V______\n"
3493 " / | | LAUNCHING |\n"
3494 " / | \\___________/\n"
3496 " / | guestfs_launch\n"
3498 " ______ / __|____V\n"
3499 " / \\ ------> / \\\n"
3500 " | BUSY | | READY |\n"
3501 " \\______/ <------ \\________/\n"
3506 #: ../src/guestfs.pod:1781
3508 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3509 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3510 "(3) alternating between READY and BUSY as commands are issued to, and "
3511 "carried out by, the child process."
3515 #: ../src/guestfs.pod:1786
3517 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3518 "asynchronously at any time (eg. due to some internal error), and that causes "
3519 "the state to transition back to CONFIG."
3523 #: ../src/guestfs.pod:1790
3525 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3526 "issued when in the CONFIG state."
3530 #: ../src/guestfs.pod:1793
3532 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3533 "L</guestfs_launch> blocks until the child process is READY to accept "
3534 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3535 "moves the state from CONFIG to LAUNCHING while it is running."
3539 #: ../src/guestfs.pod:1799
3541 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3542 "state. These API calls block waiting for the command to be carried out (ie. "
3543 "the state to transition to BUSY and then back to READY). There are no non-"
3544 "blocking versions, and no way to issue more than one command per handle at "
3549 #: ../src/guestfs.pod:1805
3551 "Finally, the child process sends asynchronous messages back to the main "
3552 "program, such as kernel log messages. You can register a callback to "
3553 "receive these messages."
3557 #: ../src/guestfs.pod:1809
3562 #: ../src/guestfs.pod:1811
3563 msgid "COMMUNICATION PROTOCOL"
3567 #: ../src/guestfs.pod:1813
3569 "Don't rely on using this protocol directly. This section documents how it "
3570 "currently works, but it may change at any time."
3574 #: ../src/guestfs.pod:1816
3576 "The protocol used to talk between the library and the daemon running inside "
3577 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3578 "1014, RFC 1832, RFC 4506)."
3582 #: ../src/guestfs.pod:1820
3584 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3585 "this file is automatically generated)."
3589 #: ../src/guestfs.pod:1823
3591 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3592 "and C<FileOut> parameters, which are handled with very simple request/reply "
3593 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3594 "parameters, which use the same request and reply messages, but they may also "
3595 "be followed by files sent using a chunked encoding."
3599 #: ../src/guestfs.pod:1830
3600 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3604 #: ../src/guestfs.pod:1832
3605 msgid "For ordinary functions, the request message is:"
3609 #: ../src/guestfs.pod:1834
3612 " total length (header + arguments,\n"
3613 " but not including the length word itself)\n"
3614 " struct guestfs_message_header (encoded as XDR)\n"
3615 " struct guestfs_<foo>_args (encoded as XDR)\n"
3620 #: ../src/guestfs.pod:1839
3622 "The total length field allows the daemon to allocate a fixed size buffer "
3623 "into which it slurps the rest of the message. As a result, the total length "
3624 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3625 "effective size of any request is limited to somewhere under this size."
3629 #: ../src/guestfs.pod:1845
3631 "Note also that many functions don't take any arguments, in which case the "
3632 "C<guestfs_I<foo>_args> is completely omitted."
3636 #: ../src/guestfs.pod:1848
3638 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3639 "receiver knows what type of args structure to expect, or none at all."
3643 #: ../src/guestfs.pod:1852
3644 msgid "The reply message for ordinary functions is:"
3648 #: ../src/guestfs.pod:1854
3651 " total length (header + ret,\n"
3652 " but not including the length word itself)\n"
3653 " struct guestfs_message_header (encoded as XDR)\n"
3654 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3659 #: ../src/guestfs.pod:1859
3661 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3662 "functions that return no formal return values."
3666 #: ../src/guestfs.pod:1862
3668 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3672 #: ../src/guestfs.pod:1865
3674 "In the case of an error, a flag is set in the header, and the reply message "
3675 "is slightly changed:"
3679 #: ../src/guestfs.pod:1868
3682 " total length (header + error,\n"
3683 " but not including the length word itself)\n"
3684 " struct guestfs_message_header (encoded as XDR)\n"
3685 " struct guestfs_message_error (encoded as XDR)\n"
3690 #: ../src/guestfs.pod:1873
3692 "The C<guestfs_message_error> structure contains the error message as a "
3697 #: ../src/guestfs.pod:1876
3698 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3702 #: ../src/guestfs.pod:1878
3704 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3705 "The normal request message is sent (see above). However this is followed by "
3706 "a sequence of file chunks."
3710 #: ../src/guestfs.pod:1882
3713 " total length (header + arguments,\n"
3714 " but not including the length word itself,\n"
3715 " and not including the chunks)\n"
3716 " struct guestfs_message_header (encoded as XDR)\n"
3717 " struct guestfs_<foo>_args (encoded as XDR)\n"
3718 " sequence of chunks for FileIn param #0\n"
3719 " sequence of chunks for FileIn param #1 etc.\n"
3724 #: ../src/guestfs.pod:1890
3725 msgid "The \"sequence of chunks\" is:"
3729 #: ../src/guestfs.pod:1892
3732 " length of chunk (not including length word itself)\n"
3733 " struct guestfs_chunk (encoded as XDR)\n"
3734 " length of chunk\n"
3735 " struct guestfs_chunk (encoded as XDR)\n"
3737 " length of chunk\n"
3738 " struct guestfs_chunk (with data.data_len == 0)\n"
3743 #: ../src/guestfs.pod:1900
3745 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3746 "is set in the final chunk to indicate either successful completion or early "
3751 #: ../src/guestfs.pod:1904
3753 "At time of writing there are no functions that have more than one FileIn "
3754 "parameter. However this is (theoretically) supported, by sending the "
3755 "sequence of chunks for each FileIn parameter one after another (from left to "
3760 #: ../src/guestfs.pod:1909
3762 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3763 "transfer. The library does this by sending a chunk with a special flag set "
3764 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3765 "RPC, does I<not> send any reply, and goes back to reading the next request."
3769 #: ../src/guestfs.pod:1915
3771 "The daemon may also cancel. It does this by writing a special word "
3772 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3773 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3774 "cancel chunk). The special word is chosen so that even if cancellation "
3775 "happens right at the end of the transfer (after the library has finished "
3776 "writing and has started listening for the reply), the \"spurious\" cancel "
3777 "flag will not be confused with the reply message."
3781 #: ../src/guestfs.pod:1924
3783 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3784 "limit), and also files where the size is not known in advance (eg. from "
3785 "pipes or sockets). However the chunks are rather small "
3786 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3787 "to keep much in memory."
3791 #: ../src/guestfs.pod:1930
3792 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3796 #: ../src/guestfs.pod:1932
3798 "The protocol for FileOut parameters is exactly the same as for FileIn "
3799 "parameters, but with the roles of daemon and library reversed."
3803 #: ../src/guestfs.pod:1935
3806 " total length (header + ret,\n"
3807 " but not including the length word itself,\n"
3808 " and not including the chunks)\n"
3809 " struct guestfs_message_header (encoded as XDR)\n"
3810 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3811 " sequence of chunks for FileOut param #0\n"
3812 " sequence of chunks for FileOut param #1 etc.\n"
3817 #: ../src/guestfs.pod:1943
3818 msgid "INITIAL MESSAGE"
3822 #: ../src/guestfs.pod:1945
3824 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3825 "which indicates that the guest and daemon is alive. This is what L</"
3826 "guestfs_launch> waits for."
3830 #: ../src/guestfs.pod:1949
3831 msgid "PROGRESS NOTIFICATION MESSAGES"
3835 #: ../src/guestfs.pod:1951
3837 "The daemon may send progress notification messages at any time. These are "
3838 "distinguished by the normal length word being replaced by "
3839 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3843 #: ../src/guestfs.pod:1955
3845 "The library turns them into progress callbacks (see "
3846 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3847 "discards them if not."
3851 #: ../src/guestfs.pod:1959
3853 "The daemon self-limits the frequency of progress messages it sends (see "
3854 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3859 #: ../src/guestfs.pod:1963
3860 msgid "LIBGUESTFS VERSION NUMBERS"
3864 #: ../src/guestfs.pod:1965
3866 "Since April 2010, libguestfs has started to make separate development and "
3867 "stable releases, along with corresponding branches in our git repository. "
3868 "These separate releases can be identified by version number:"
3872 #: ../src/guestfs.pod:1970
3875 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3876 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3882 " | `-------- sub-version\n"
3884 " `------ always '1' because we don't change the ABI\n"
3889 #: ../src/guestfs.pod:1981
3890 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3894 #: ../src/guestfs.pod:1983
3896 "As time passes we cherry pick fixes from the development branch and backport "
3897 "those into the stable branch, the effect being that the stable branch should "
3898 "get more stable and less buggy over time. So the stable releases are ideal "
3899 "for people who don't need new features but would just like the software to "
3904 #: ../src/guestfs.pod:1989
3905 msgid "Our criteria for backporting changes are:"
3909 #: ../src/guestfs.pod:1995
3911 "Documentation changes which don't affect any code are backported unless the "
3912 "documentation refers to a future feature which is not in stable."
3916 #: ../src/guestfs.pod:2001
3918 "Bug fixes which are not controversial, fix obvious problems, and have been "
3919 "well tested are backported."
3923 #: ../src/guestfs.pod:2006
3925 "Simple rearrangements of code which shouldn't affect how it works get "
3926 "backported. This is so that the code in the two branches doesn't get too "
3927 "far out of step, allowing us to backport future fixes more easily."
3931 #: ../src/guestfs.pod:2012
3933 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3934 "exceptional case: the new feature is required in order to implement an "
3935 "important bug fix."
3939 #: ../src/guestfs.pod:2018
3941 "A new stable branch starts when we think the new features in development are "
3942 "substantial and compelling enough over the current stable branch to warrant "
3943 "it. When that happens we create new stable and development versions 1.N.0 "
3944 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3945 "stable at this point, but by backporting fixes from development, that branch "
3946 "will stabilize over time."
3950 #: ../src/guestfs.pod:2026 ../fish/guestfish.pod:914
3951 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3952 #: ../tools/virt-rescue.pl:255
3953 msgid "ENVIRONMENT VARIABLES"
3957 #: ../src/guestfs.pod:2030 ../fish/guestfish.pod:940
3958 msgid "LIBGUESTFS_APPEND"
3962 #: ../src/guestfs.pod:2032 ../fish/guestfish.pod:942
3963 msgid "Pass additional options to the guest kernel."
3967 #: ../src/guestfs.pod:2034 ../fish/guestfish.pod:944
3968 msgid "LIBGUESTFS_DEBUG"
3972 #: ../src/guestfs.pod:2036
3974 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3975 "effect as calling C<guestfs_set_verbose (g, 1)>."
3979 #: ../src/guestfs.pod:2039 ../fish/guestfish.pod:949
3980 msgid "LIBGUESTFS_MEMSIZE"
3984 #: ../src/guestfs.pod:2041 ../fish/guestfish.pod:951
3986 "Set the memory allocated to the qemu process, in megabytes. For example:"
3990 #: ../src/guestfs.pod:2044 ../fish/guestfish.pod:954
3993 " LIBGUESTFS_MEMSIZE=700\n"
3998 #: ../src/guestfs.pod:2046 ../fish/guestfish.pod:956
3999 msgid "LIBGUESTFS_PATH"
4003 #: ../src/guestfs.pod:2048
4005 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4006 "the discussion of paths in section PATH above."
4010 #: ../src/guestfs.pod:2051 ../fish/guestfish.pod:961
4011 msgid "LIBGUESTFS_QEMU"
4015 #: ../src/guestfs.pod:2053 ../fish/guestfish.pod:963
4017 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4018 "which was found at compile time by the configure script is used."
4022 #: ../src/guestfs.pod:2057
4023 msgid "See also L</QEMU WRAPPERS> above."
4027 #: ../src/guestfs.pod:2059 ../fish/guestfish.pod:967
4028 msgid "LIBGUESTFS_TRACE"
4032 #: ../src/guestfs.pod:2061
4034 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4035 "effect as calling C<guestfs_set_trace (g, 1)>."
4039 #: ../src/guestfs.pod:2064 ../fish/guestfish.pod:976
4044 #: ../src/guestfs.pod:2066 ../fish/guestfish.pod:978
4045 msgid "Location of temporary directory, defaults to C</tmp>."
4049 #: ../src/guestfs.pod:2068 ../fish/guestfish.pod:980
4051 "If libguestfs was compiled to use the supermin appliance then the real "
4052 "appliance is cached in this directory, shared between all handles belonging "
4053 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4054 "use in case C</tmp> is not large enough."
4058 #: ../src/guestfs.pod:2076 ../fish/guestfish.pod:1038
4059 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4060 #: ../inspector/virt-inspector.pl:452 ../tools/virt-edit.pl:350
4061 #: ../tools/virt-win-reg.pl:484 ../tools/virt-df.pl:640
4062 #: ../tools/virt-ls.pl:232 ../tools/virt-resize.pl:1486
4063 #: ../tools/virt-list-filesystems.pl:186 ../tools/virt-tar.pl:281
4064 #: ../tools/virt-rescue.pl:267 ../tools/virt-make-fs.pl:534
4065 #: ../tools/virt-list-partitions.pl:254
4070 #: ../src/guestfs.pod:2078
4072 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-edit"
4073 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
4074 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
4075 "tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
4076 "L<http://libguestfs.org/>."
4080 #: ../src/guestfs.pod:2096
4082 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4083 "(8)>, L<disktype(1)>."
4087 #: ../src/guestfs.pod:2103 ../tools/virt-win-reg.pl:499
4088 #: ../tools/virt-make-fs.pl:548
4093 #: ../src/guestfs.pod:2105
4094 msgid "To get a list of bugs against libguestfs use this link:"
4098 #: ../src/guestfs.pod:2107
4100 "L<https://bugzilla.redhat.com/buglist.cgi?"
4101 "component=libguestfs&product=Virtualization+Tools>"
4105 #: ../src/guestfs.pod:2109
4106 msgid "To report a new bug against libguestfs use this link:"
4110 #: ../src/guestfs.pod:2111
4112 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4113 "component=libguestfs&product=Virtualization+Tools>"
4117 #: ../src/guestfs.pod:2113
4118 msgid "When reporting a bug, please check:"
4122 #: ../src/guestfs.pod:2119
4123 msgid "That the bug hasn't been reported already."
4127 #: ../src/guestfs.pod:2123
4128 msgid "That you are testing a recent version."
4132 #: ../src/guestfs.pod:2127
4133 msgid "Describe the bug accurately, and give a way to reproduce it."
4137 #: ../src/guestfs.pod:2131
4139 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4144 #: ../src/guestfs.pod:2136 ../fish/guestfish.pod:1055
4145 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4146 #: ../inspector/virt-inspector.pl:462
4151 #: ../src/guestfs.pod:2138 ../fish/guestfish.pod:1057
4152 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4153 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4157 #: ../src/guestfs.pod:2140 ../fish/guestfish.pod:1059
4158 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4159 #: ../inspector/virt-inspector.pl:476 ../tools/virt-edit.pl:366
4160 #: ../tools/virt-win-reg.pl:514 ../tools/virt-df.pl:653
4161 #: ../tools/virt-ls.pl:247 ../tools/virt-resize.pl:1512
4162 #: ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:296
4163 #: ../tools/virt-rescue.pl:281 ../tools/virt-make-fs.pl:563
4164 #: ../tools/virt-list-partitions.pl:269
4169 #: ../src/guestfs.pod:2142 ../fish/guestfish.pod:1061
4170 #: ../fuse/guestmount.pod:250
4171 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4175 #: ../src/guestfs.pod:2145
4177 "This library is free software; you can redistribute it and/or modify it "
4178 "under the terms of the GNU Lesser General Public License as published by the "
4179 "Free Software Foundation; either version 2 of the License, or (at your "
4180 "option) any later version."
4184 #: ../src/guestfs.pod:2150
4186 "This library is distributed in the hope that it will be useful, but WITHOUT "
4187 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4188 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4193 #: ../src/guestfs.pod:2155
4195 "You should have received a copy of the GNU Lesser General Public License "
4196 "along with this library; if not, write to the Free Software Foundation, "
4197 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4201 #: ../src/guestfs-actions.pod:1
4202 msgid "guestfs_add_cdrom"
4206 #: ../src/guestfs-actions.pod:3
4210 " guestfs_add_cdrom (guestfs_h *g,\n"
4211 " const char *filename);\n"
4216 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4217 msgid "This function adds a virtual CD-ROM disk image to the guest."
4221 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4222 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4226 #: ../src/guestfs-actions.pod:17
4228 "This call checks for the existence of C<filename>. This stops you from "
4229 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4230 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4235 #: ../src/guestfs-actions.pod:24
4237 "If you just want to add an ISO file (often you use this as an efficient way "
4238 "to transfer large files into the guest), then you should probably use "
4239 "C<guestfs_add_drive_ro> instead."
4243 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:126
4244 #: ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:224
4245 #: ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259
4246 #: ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:293
4247 #: ../src/guestfs-actions.pod:408 ../src/guestfs-actions.pod:428
4248 #: ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:487
4249 #: ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:533
4250 #: ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:633
4251 #: ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:662
4252 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
4253 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
4254 #: ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:988
4255 #: ../src/guestfs-actions.pod:1006 ../src/guestfs-actions.pod:1090
4256 #: ../src/guestfs-actions.pod:1108 ../src/guestfs-actions.pod:1127
4257 #: ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1161
4258 #: ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1262
4259 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:1324
4260 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1464
4261 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1704
4262 #: ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2213
4263 #: ../src/guestfs-actions.pod:2357 ../src/guestfs-actions.pod:2418
4264 #: ../src/guestfs-actions.pod:2453 ../src/guestfs-actions.pod:3162
4265 #: ../src/guestfs-actions.pod:3177 ../src/guestfs-actions.pod:3197
4266 #: ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3336
4267 #: ../src/guestfs-actions.pod:3349 ../src/guestfs-actions.pod:3363
4268 #: ../src/guestfs-actions.pod:3378 ../src/guestfs-actions.pod:3414
4269 #: ../src/guestfs-actions.pod:3486 ../src/guestfs-actions.pod:3506
4270 #: ../src/guestfs-actions.pod:3523 ../src/guestfs-actions.pod:3546
4271 #: ../src/guestfs-actions.pod:3569 ../src/guestfs-actions.pod:3601
4272 #: ../src/guestfs-actions.pod:3620 ../src/guestfs-actions.pod:3639
4273 #: ../src/guestfs-actions.pod:3674 ../src/guestfs-actions.pod:3686
4274 #: ../src/guestfs-actions.pod:3722 ../src/guestfs-actions.pod:3738
4275 #: ../src/guestfs-actions.pod:3751 ../src/guestfs-actions.pod:3766
4276 #: ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3876
4277 #: ../src/guestfs-actions.pod:3896 ../src/guestfs-actions.pod:3909
4278 #: ../src/guestfs-actions.pod:3960 ../src/guestfs-actions.pod:3978
4279 #: ../src/guestfs-actions.pod:3996 ../src/guestfs-actions.pod:4012
4280 #: ../src/guestfs-actions.pod:4026 ../src/guestfs-actions.pod:4040
4281 #: ../src/guestfs-actions.pod:4057 ../src/guestfs-actions.pod:4072
4282 #: ../src/guestfs-actions.pod:4092 ../src/guestfs-actions.pod:4141
4283 #: ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:4191
4284 #: ../src/guestfs-actions.pod:4210 ../src/guestfs-actions.pod:4222
4285 #: ../src/guestfs-actions.pod:4239 ../src/guestfs-actions.pod:4252
4286 #: ../src/guestfs-actions.pod:4267 ../src/guestfs-actions.pod:4282
4287 #: ../src/guestfs-actions.pod:4317 ../src/guestfs-actions.pod:4332
4288 #: ../src/guestfs-actions.pod:4352 ../src/guestfs-actions.pod:4366
4289 #: ../src/guestfs-actions.pod:4383 ../src/guestfs-actions.pod:4432
4290 #: ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:4483
4291 #: ../src/guestfs-actions.pod:4511 ../src/guestfs-actions.pod:4528
4292 #: ../src/guestfs-actions.pod:4546 ../src/guestfs-actions.pod:4680
4293 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4759
4294 #: ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:4809
4295 #: ../src/guestfs-actions.pod:4875 ../src/guestfs-actions.pod:4892
4296 #: ../src/guestfs-actions.pod:4905 ../src/guestfs-actions.pod:4919
4297 #: ../src/guestfs-actions.pod:5208 ../src/guestfs-actions.pod:5227
4298 #: ../src/guestfs-actions.pod:5241 ../src/guestfs-actions.pod:5253
4299 #: ../src/guestfs-actions.pod:5267 ../src/guestfs-actions.pod:5279
4300 #: ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5309
4301 #: ../src/guestfs-actions.pod:5330 ../src/guestfs-actions.pod:5349
4302 #: ../src/guestfs-actions.pod:5368 ../src/guestfs-actions.pod:5386
4303 #: ../src/guestfs-actions.pod:5409 ../src/guestfs-actions.pod:5427
4304 #: ../src/guestfs-actions.pod:5446 ../src/guestfs-actions.pod:5467
4305 #: ../src/guestfs-actions.pod:5486 ../src/guestfs-actions.pod:5503
4306 #: ../src/guestfs-actions.pod:5531 ../src/guestfs-actions.pod:5555
4307 #: ../src/guestfs-actions.pod:5574 ../src/guestfs-actions.pod:5598
4308 #: ../src/guestfs-actions.pod:5613 ../src/guestfs-actions.pod:5628
4309 #: ../src/guestfs-actions.pod:5647 ../src/guestfs-actions.pod:5684
4310 #: ../src/guestfs-actions.pod:5707 ../src/guestfs-actions.pod:5733
4311 #: ../src/guestfs-actions.pod:5841 ../src/guestfs-actions.pod:5962
4312 #: ../src/guestfs-actions.pod:5974 ../src/guestfs-actions.pod:5987
4313 #: ../src/guestfs-actions.pod:6000 ../src/guestfs-actions.pod:6022
4314 #: ../src/guestfs-actions.pod:6035 ../src/guestfs-actions.pod:6048
4315 #: ../src/guestfs-actions.pod:6061 ../src/guestfs-actions.pod:6076
4316 #: ../src/guestfs-actions.pod:6135 ../src/guestfs-actions.pod:6152
4317 #: ../src/guestfs-actions.pod:6168 ../src/guestfs-actions.pod:6184
4318 #: ../src/guestfs-actions.pod:6201 ../src/guestfs-actions.pod:6214
4319 #: ../src/guestfs-actions.pod:6234 ../src/guestfs-actions.pod:6270
4320 #: ../src/guestfs-actions.pod:6284 ../src/guestfs-actions.pod:6325
4321 #: ../src/guestfs-actions.pod:6338 ../src/guestfs-actions.pod:6356
4322 #: ../src/guestfs-actions.pod:6385 ../src/guestfs-actions.pod:6416
4323 #: ../src/guestfs-actions.pod:6535 ../src/guestfs-actions.pod:6553
4324 #: ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:6622
4325 #: ../src/guestfs-actions.pod:6635 ../src/guestfs-actions.pod:6680
4326 #: ../src/guestfs-actions.pod:6713 ../src/guestfs-actions.pod:6767
4327 #: ../src/guestfs-actions.pod:6793 ../src/guestfs-actions.pod:6859
4328 #: ../src/guestfs-actions.pod:6878 ../src/guestfs-actions.pod:6907
4329 msgid "This function returns 0 on success or -1 on error."
4333 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:240
4334 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:28
4335 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4337 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4342 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:243
4343 #: ../src/guestfs-actions.pod:264 ../src/guestfs-actions.pod:1435
4344 #: ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1942
4345 #: ../src/guestfs-actions.pod:6801 ../src/guestfs-actions.pod:6970
4346 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:156
4347 #: ../fish/guestfish-actions.pod:170 ../fish/guestfish-actions.pod:951
4348 #: ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1322
4349 #: ../fish/guestfish-actions.pod:4534 ../fish/guestfish-actions.pod:4631
4351 "Deprecated functions will not be removed from the API, but the fact that "
4352 "they are deprecated indicates that there are problems with correct use of "
4357 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:128
4358 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1893
4359 #: ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2094
4360 #: ../src/guestfs-actions.pod:3164 ../src/guestfs-actions.pod:3179
4361 #: ../src/guestfs-actions.pod:4319 ../src/guestfs-actions.pod:5388
4362 #: ../src/guestfs-actions.pod:5505 ../src/guestfs-actions.pod:5615
4363 #: ../src/guestfs-actions.pod:6078 ../src/guestfs-actions.pod:6203
4364 #: ../src/guestfs-actions.pod:6715
4365 msgid "(Added in 0.3)"
4369 #: ../src/guestfs-actions.pod:41
4370 msgid "guestfs_add_domain"
4374 #: ../src/guestfs-actions.pod:43
4378 " guestfs_add_domain (guestfs_h *g,\n"
4379 " const char *dom,\n"
4385 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:137
4387 "You may supply a list of optional arguments to this call. Use zero or more "
4388 "of the following pairs of parameters, and terminate the list with C<-1> on "
4389 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4393 #: ../src/guestfs-actions.pod:53
4396 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4397 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4398 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4403 #: ../src/guestfs-actions.pod:57
4405 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4406 "It works by connecting to libvirt, requesting the domain and domain XML from "
4407 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4412 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4414 "The number of disks added is returned. This operation is atomic: if an "
4415 "error is returned, then no disks are added."
4419 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4421 "This function does some minimal checks to make sure the libvirt domain is "
4422 "not running (unless C<readonly> is true). In a future version we will try "
4423 "to acquire the libvirt lock on each disk."
4427 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4429 "Disks must be accessible locally. This often means that adding disks from a "
4430 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4431 "unless those disks are accessible via the same device path locally too."
4435 #: ../src/guestfs-actions.pod:74
4437 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4438 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4439 "libvirt URI (or one set through an environment variable, see the libvirt "
4440 "documentation for full details). If you are using the C API directly then "
4441 "it is more flexible to create the libvirt connection object yourself, get "
4442 "the domain object, and call C<guestfs_add_libvirt_dom>."
4446 #: ../src/guestfs-actions.pod:82
4448 "The other optional parameters are passed directly through to "
4449 "C<guestfs_add_drive_opts>."
4453 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:336
4454 #: ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:679
4455 #: ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728
4456 #: ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:1307
4457 #: ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1864
4458 #: ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:2003
4459 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2081
4460 #: ../src/guestfs-actions.pod:2344 ../src/guestfs-actions.pod:2610
4461 #: ../src/guestfs-actions.pod:2631 ../src/guestfs-actions.pod:4455
4462 #: ../src/guestfs-actions.pod:4583 ../src/guestfs-actions.pod:4989
4463 #: ../src/guestfs-actions.pod:5015 ../src/guestfs-actions.pod:6311
4464 #: ../src/guestfs-actions.pod:6726 ../src/guestfs-actions.pod:6739
4465 #: ../src/guestfs-actions.pod:6752
4466 msgid "On error this function returns -1."
4470 #: ../src/guestfs-actions.pod:87
4471 msgid "guestfs_add_domain_va"
4475 #: ../src/guestfs-actions.pod:89
4479 " guestfs_add_domain_va (guestfs_h *g,\n"
4480 " const char *dom,\n"
4486 #: ../src/guestfs-actions.pod:94
4487 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4491 #: ../src/guestfs-actions.pod:96 ../src/guestfs-actions.pod:107
4492 #: ../src/guestfs-actions.pod:200 ../src/guestfs-actions.pod:211
4493 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4497 #: ../src/guestfs-actions.pod:98
4498 msgid "guestfs_add_domain_argv"
4502 #: ../src/guestfs-actions.pod:100
4506 " guestfs_add_domain_argv (guestfs_h *g,\n"
4507 " const char *dom,\n"
4508 " const struct guestfs_add_domain_argv *optargs);\n"
4513 #: ../src/guestfs-actions.pod:105
4514 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4518 #: ../src/guestfs-actions.pod:109
4519 msgid "guestfs_add_drive"
4523 #: ../src/guestfs-actions.pod:111
4527 " guestfs_add_drive (guestfs_h *g,\n"
4528 " const char *filename);\n"
4533 #: ../src/guestfs-actions.pod:115
4535 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4536 "optional parameters, so the disk is added writable, with the format being "
4537 "detected automatically."
4541 #: ../src/guestfs-actions.pod:119
4543 "Automatic detection of the format opens you up to a potential security hole "
4544 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4545 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4546 "you should think about replacing calls to this function with calls to "
4547 "C<guestfs_add_drive_opts>, and specifying the format."
4551 #: ../src/guestfs-actions.pod:130
4552 msgid "guestfs_add_drive_opts"
4556 #: ../src/guestfs-actions.pod:132
4560 " guestfs_add_drive_opts (guestfs_h *g,\n"
4561 " const char *filename,\n"
4567 #: ../src/guestfs-actions.pod:142
4570 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4571 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4572 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4577 #: ../src/guestfs-actions.pod:146 ../fish/guestfish-actions.pod:92
4579 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4580 "The first time you call this function, the disk appears as C</dev/sda>, the "
4581 "second time as C</dev/sdb>, and so on."
4585 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:97
4587 "You don't necessarily need to be root when using libguestfs. However you "
4588 "obviously do need sufficient permissions to access the filename for whatever "
4589 "operations you want to perform (ie. read access if you just want to read the "
4590 "image or write access if you want to modify the image)."
4594 #: ../src/guestfs-actions.pod:157 ../fish/guestfish-actions.pod:103
4595 msgid "This call checks that C<filename> exists."
4599 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:105
4600 msgid "The optional arguments are:"
4604 #: ../src/guestfs-actions.pod:163 ../fish/guestfish-actions.pod:109
4609 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:111
4611 "If true then the image is treated as read-only. Writes are still allowed, "
4612 "but they are stored in a temporary snapshot overlay which is discarded at "
4613 "the end. The disk that you add is not modified."
4617 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:115
4622 #: ../src/guestfs-actions.pod:171
4624 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4625 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4626 "Possible formats include C<raw> and C<qcow2>."
4630 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:121
4632 "Automatic detection of the format opens you up to a potential security hole "
4633 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4634 "RHBZ#642934. Specifying the format closes this security hole."
4638 #: ../src/guestfs-actions.pod:180 ../fish/guestfish-actions.pod:126
4643 #: ../src/guestfs-actions.pod:182
4645 "This rarely-used option lets you emulate the behaviour of the deprecated "
4646 "C<guestfs_add_drive_with_if> call (q.v.)"
4650 #: ../src/guestfs-actions.pod:189
4651 msgid "(Added in 1.5.23)"
4655 #: ../src/guestfs-actions.pod:191
4656 msgid "guestfs_add_drive_opts_va"
4660 #: ../src/guestfs-actions.pod:193
4664 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4665 " const char *filename,\n"
4671 #: ../src/guestfs-actions.pod:198
4672 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4676 #: ../src/guestfs-actions.pod:202
4677 msgid "guestfs_add_drive_opts_argv"
4681 #: ../src/guestfs-actions.pod:204
4685 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4686 " const char *filename,\n"
4687 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4692 #: ../src/guestfs-actions.pod:209
4693 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4697 #: ../src/guestfs-actions.pod:213
4698 msgid "guestfs_add_drive_ro"
4702 #: ../src/guestfs-actions.pod:215
4706 " guestfs_add_drive_ro (guestfs_h *g,\n"
4707 " const char *filename);\n"
4712 #: ../src/guestfs-actions.pod:219
4714 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4715 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4716 "disk is added read-only, with the format being detected automatically."
4720 #: ../src/guestfs-actions.pod:226
4721 msgid "(Added in 1.0.38)"
4725 #: ../src/guestfs-actions.pod:228
4726 msgid "guestfs_add_drive_ro_with_if"
4730 #: ../src/guestfs-actions.pod:230
4734 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4735 " const char *filename,\n"
4736 " const char *iface);\n"
4741 #: ../src/guestfs-actions.pod:235
4743 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4744 "QEMU interface emulation to use at run time."
4748 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:268
4749 #: ../src/guestfs-actions.pod:2303
4750 msgid "(Added in 1.0.84)"
4754 #: ../src/guestfs-actions.pod:249
4755 msgid "guestfs_add_drive_with_if"
4759 #: ../src/guestfs-actions.pod:251
4763 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4764 " const char *filename,\n"
4765 " const char *iface);\n"
4770 #: ../src/guestfs-actions.pod:256
4772 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4773 "QEMU interface emulation to use at run time."
4777 #: ../src/guestfs-actions.pod:270
4778 msgid "guestfs_aug_clear"
4782 #: ../src/guestfs-actions.pod:272
4786 " guestfs_aug_clear (guestfs_h *g,\n"
4787 " const char *augpath);\n"
4792 #: ../src/guestfs-actions.pod:276 ../fish/guestfish-actions.pod:178
4794 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4795 "L<augtool(1)> C<clear> command."
4799 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:2083
4800 msgid "(Added in 1.3.4)"
4804 #: ../src/guestfs-actions.pod:283
4805 msgid "guestfs_aug_close"
4809 #: ../src/guestfs-actions.pod:285
4813 " guestfs_aug_close (guestfs_h *g);\n"
4818 #: ../src/guestfs-actions.pod:288
4820 "Close the current Augeas handle and free up any resources used by it. After "
4821 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4822 "any other Augeas functions."
4826 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:320
4827 #: ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:352
4828 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4829 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:475
4830 #: ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503
4831 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4832 #: ../src/guestfs-actions.pod:5066
4833 msgid "(Added in 0.7)"
4837 #: ../src/guestfs-actions.pod:297
4838 msgid "guestfs_aug_defnode"
4842 #: ../src/guestfs-actions.pod:299
4845 " struct guestfs_int_bool *\n"
4846 " guestfs_aug_defnode (guestfs_h *g,\n"
4847 " const char *name,\n"
4848 " const char *expr,\n"
4849 " const char *val);\n"
4854 #: ../src/guestfs-actions.pod:305 ../fish/guestfish-actions.pod:194
4856 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4860 #: ../src/guestfs-actions.pod:308
4862 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4863 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4864 "containing that single node."
4868 #: ../src/guestfs-actions.pod:312 ../fish/guestfish-actions.pod:201
4870 "On success this returns a pair containing the number of nodes in the "
4871 "nodeset, and a boolean flag if a node was created."
4875 #: ../src/guestfs-actions.pod:316
4877 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4878 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4882 #: ../src/guestfs-actions.pod:322
4883 msgid "guestfs_aug_defvar"
4887 #: ../src/guestfs-actions.pod:324
4891 " guestfs_aug_defvar (guestfs_h *g,\n"
4892 " const char *name,\n"
4893 " const char *expr);\n"
4898 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:209
4900 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4901 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4905 #: ../src/guestfs-actions.pod:333 ../fish/guestfish-actions.pod:213
4907 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4908 "evaluates to something which is not a nodeset."
4912 #: ../src/guestfs-actions.pod:340
4913 msgid "guestfs_aug_get"
4917 #: ../src/guestfs-actions.pod:342
4921 " guestfs_aug_get (guestfs_h *g,\n"
4922 " const char *augpath);\n"
4927 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:220
4929 "Look up the value associated with C<path>. If C<path> matches exactly one "
4930 "node, the C<value> is returned."
4934 #: ../src/guestfs-actions.pod:349 ../src/guestfs-actions.pod:849
4935 #: ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:927
4936 #: ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1046
4937 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1193
4938 #: ../src/guestfs-actions.pod:1212 ../src/guestfs-actions.pod:1341
4939 #: ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1644
4940 #: ../src/guestfs-actions.pod:1807 ../src/guestfs-actions.pod:1824
4941 #: ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1936
4942 #: ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2268
4943 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2556
4944 #: ../src/guestfs-actions.pod:2692 ../src/guestfs-actions.pod:2721
4945 #: ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:2803
4946 #: ../src/guestfs-actions.pod:2826 ../src/guestfs-actions.pod:3308
4947 #: ../src/guestfs-actions.pod:3658 ../src/guestfs-actions.pod:3828
4948 #: ../src/guestfs-actions.pod:3938 ../src/guestfs-actions.pod:4601
4949 #: ../src/guestfs-actions.pod:4794 ../src/guestfs-actions.pod:4964
4950 #: ../src/guestfs-actions.pod:5142 ../src/guestfs-actions.pod:5191
4951 #: ../src/guestfs-actions.pod:5754 ../src/guestfs-actions.pod:5770
4952 #: ../src/guestfs-actions.pod:5787 ../src/guestfs-actions.pod:5811
4953 #: ../src/guestfs-actions.pod:6475 ../src/guestfs-actions.pod:6494
4954 #: ../src/guestfs-actions.pod:6512 ../src/guestfs-actions.pod:6692
4955 #: ../src/guestfs-actions.pod:6964
4957 "This function returns a string, or NULL on error. I<The caller must free "
4958 "the returned string after use>."
4962 #: ../src/guestfs-actions.pod:354
4963 msgid "guestfs_aug_init"
4967 #: ../src/guestfs-actions.pod:356
4971 " guestfs_aug_init (guestfs_h *g,\n"
4972 " const char *root,\n"
4978 #: ../src/guestfs-actions.pod:361 ../fish/guestfish-actions.pod:227
4980 "Create a new Augeas handle for editing configuration files. If there was "
4981 "any previous Augeas handle associated with this guestfs session, then it is "
4986 #: ../src/guestfs-actions.pod:365
4987 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4991 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:234
4993 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4997 #: ../src/guestfs-actions.pod:371 ../fish/guestfish-actions.pod:237
4999 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5000 "logical I<or> of the following integers:"
5004 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:243
5005 msgid "C<AUG_SAVE_BACKUP> = 1"
5009 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:245
5010 msgid "Keep the original file with a C<.augsave> extension."
5014 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:247
5015 msgid "C<AUG_SAVE_NEWFILE> = 2"
5019 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:249
5021 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5022 "original. Overrides C<AUG_SAVE_BACKUP>."
5026 #: ../src/guestfs-actions.pod:386 ../fish/guestfish-actions.pod:252
5027 msgid "C<AUG_TYPE_CHECK> = 4"
5031 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:254
5032 msgid "Typecheck lenses (can be expensive)."
5036 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:256
5037 msgid "C<AUG_NO_STDINC> = 8"
5041 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:258
5042 msgid "Do not use standard load path for modules."
5046 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:260
5047 msgid "C<AUG_SAVE_NOOP> = 16"
5051 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:262
5052 msgid "Make save a no-op, just record what would have been changed."
5056 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:264
5057 msgid "C<AUG_NO_LOAD> = 32"
5061 #: ../src/guestfs-actions.pod:400
5062 msgid "Do not load the tree in C<guestfs_aug_init>."
5066 #: ../src/guestfs-actions.pod:404
5067 msgid "To close the handle, you can call C<guestfs_aug_close>."
5071 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:272
5072 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5076 #: ../src/guestfs-actions.pod:412
5077 msgid "guestfs_aug_insert"
5081 #: ../src/guestfs-actions.pod:414
5085 " guestfs_aug_insert (guestfs_h *g,\n"
5086 " const char *augpath,\n"
5087 " const char *label,\n"
5093 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:278
5095 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5096 "or after C<path> (depending on the boolean flag C<before>)."
5100 #: ../src/guestfs-actions.pod:424 ../fish/guestfish-actions.pod:282
5102 "C<path> must match exactly one existing node in the tree, and C<label> must "
5103 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5107 #: ../src/guestfs-actions.pod:432
5108 msgid "guestfs_aug_load"
5112 #: ../src/guestfs-actions.pod:434
5116 " guestfs_aug_load (guestfs_h *g);\n"
5121 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:290
5122 msgid "Load files into the tree."
5126 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:292
5127 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5131 #: ../src/guestfs-actions.pod:446
5132 msgid "guestfs_aug_ls"
5136 #: ../src/guestfs-actions.pod:448
5140 " guestfs_aug_ls (guestfs_h *g,\n"
5141 " const char *augpath);\n"
5146 #: ../src/guestfs-actions.pod:452
5148 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5149 "sorting the resulting nodes into alphabetical order."
5153 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:471
5154 #: ../src/guestfs-actions.pod:617 ../src/guestfs-actions.pod:1065
5155 #: ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1375
5156 #: ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1497
5157 #: ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:2148
5158 #: ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:2183
5159 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:2250
5160 #: ../src/guestfs-actions.pod:2321 ../src/guestfs-actions.pod:2370
5161 #: ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:2762
5162 #: ../src/guestfs-actions.pod:2973 ../src/guestfs-actions.pod:3228
5163 #: ../src/guestfs-actions.pod:3290 ../src/guestfs-actions.pod:3395
5164 #: ../src/guestfs-actions.pod:3800 ../src/guestfs-actions.pod:4416
5165 #: ../src/guestfs-actions.pod:4936 ../src/guestfs-actions.pod:5062
5166 #: ../src/guestfs-actions.pod:5176 ../src/guestfs-actions.pod:5827
5167 #: ../src/guestfs-actions.pod:5888 ../src/guestfs-actions.pod:5943
5168 #: ../src/guestfs-actions.pod:6089 ../src/guestfs-actions.pod:6113
5169 #: ../src/guestfs-actions.pod:6585 ../src/guestfs-actions.pod:6605
5170 #: ../src/guestfs-actions.pod:6652 ../src/guestfs-actions.pod:6817
5171 #: ../src/guestfs-actions.pod:6836 ../src/guestfs-actions.pod:6921
5172 #: ../src/guestfs-actions.pod:6940 ../src/guestfs-actions.pod:6986
5173 #: ../src/guestfs-actions.pod:7005
5175 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5176 ">), or NULL if there was an error. I<The caller must free the strings and "
5177 "the array after use>."
5181 #: ../src/guestfs-actions.pod:459 ../src/guestfs-actions.pod:990
5182 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1413
5183 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3082
5184 #: ../src/guestfs-actions.pod:3641 ../src/guestfs-actions.pod:3691
5185 #: ../src/guestfs-actions.pod:3878 ../src/guestfs-actions.pod:3911
5186 #: ../src/guestfs-actions.pod:4074 ../src/guestfs-actions.pod:4420
5187 #: ../src/guestfs-actions.pod:4877 ../src/guestfs-actions.pod:5255
5188 #: ../src/guestfs-actions.pod:5269 ../src/guestfs-actions.pod:5281
5189 #: ../src/guestfs-actions.pod:5689 ../src/guestfs-actions.pod:6327
5190 #: ../src/guestfs-actions.pod:6340 ../src/guestfs-actions.pod:6569
5191 #: ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6805
5192 msgid "(Added in 0.8)"
5196 #: ../src/guestfs-actions.pod:461
5197 msgid "guestfs_aug_match"
5201 #: ../src/guestfs-actions.pod:463
5205 " guestfs_aug_match (guestfs_h *g,\n"
5206 " const char *augpath);\n"
5211 #: ../src/guestfs-actions.pod:467 ../fish/guestfish-actions.pod:306
5213 "Returns a list of paths which match the path expression C<path>. The "
5214 "returned paths are sufficiently qualified so that they match exactly one "
5215 "node in the current tree."
5219 #: ../src/guestfs-actions.pod:477
5220 msgid "guestfs_aug_mv"
5224 #: ../src/guestfs-actions.pod:479
5228 " guestfs_aug_mv (guestfs_h *g,\n"
5229 " const char *src,\n"
5230 " const char *dest);\n"
5235 #: ../src/guestfs-actions.pod:484 ../fish/guestfish-actions.pod:314
5237 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5238 "C<dest> is overwritten if it exists."
5242 #: ../src/guestfs-actions.pod:491
5243 msgid "guestfs_aug_rm"
5247 #: ../src/guestfs-actions.pod:493
5251 " guestfs_aug_rm (guestfs_h *g,\n"
5252 " const char *augpath);\n"
5257 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:321
5258 msgid "Remove C<path> and all of its children."
5262 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:323
5263 msgid "On success this returns the number of entries which were removed."
5267 #: ../src/guestfs-actions.pod:505
5268 msgid "guestfs_aug_save"
5272 #: ../src/guestfs-actions.pod:507
5276 " guestfs_aug_save (guestfs_h *g);\n"
5281 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:329
5282 msgid "This writes all pending changes to disk."
5286 #: ../src/guestfs-actions.pod:512
5288 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5293 #: ../src/guestfs-actions.pod:519
5294 msgid "guestfs_aug_set"
5298 #: ../src/guestfs-actions.pod:521
5302 " guestfs_aug_set (guestfs_h *g,\n"
5303 " const char *augpath,\n"
5304 " const char *val);\n"
5309 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:338
5310 msgid "Set the value associated with C<path> to C<val>."
5314 #: ../src/guestfs-actions.pod:528
5316 "In the Augeas API, it is possible to clear a node by setting the value to "
5317 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5318 "this call. Instead you must use the C<guestfs_aug_clear> call."
5322 #: ../src/guestfs-actions.pod:537
5323 msgid "guestfs_available"
5327 #: ../src/guestfs-actions.pod:539
5331 " guestfs_available (guestfs_h *g,\n"
5332 " char *const *groups);\n"
5337 #: ../src/guestfs-actions.pod:543 ../fish/guestfish-actions.pod:349
5339 "This command is used to check the availability of some groups of "
5340 "functionality in the appliance, which not all builds of the libguestfs "
5341 "appliance will be able to provide."
5345 #: ../src/guestfs-actions.pod:547
5347 "The libguestfs groups, and the functions that those groups correspond to, "
5348 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5349 "runtime by calling C<guestfs_available_all_groups>."
5353 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:358
5355 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5356 "\"]> would check for the availability of the Linux inotify functions and "
5357 "Augeas (configuration file editing) functions."
5361 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:363
5362 msgid "The command returns no error if I<all> requested groups are available."
5366 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:365
5368 "It fails with an error if one or more of the requested groups is unavailable "
5373 #: ../src/guestfs-actions.pod:562 ../fish/guestfish-actions.pod:368
5375 "If an unknown group name is included in the list of groups then an error is "
5380 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:371
5385 #: ../src/guestfs-actions.pod:571
5386 msgid "You must call C<guestfs_launch> before calling this function."
5390 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:379
5392 "The reason is because we don't know what groups are supported by the "
5393 "appliance/daemon until it is running and can be queried."
5397 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:385
5399 "If a group of functions is available, this does not necessarily mean that "
5400 "they will work. You still have to check for errors when calling individual "
5401 "API functions even if they are available."
5405 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:392
5407 "It is usually the job of distro packagers to build complete functionality "
5408 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5409 "with all requirements satisfied, will support everything."
5413 #: ../src/guestfs-actions.pod:593
5415 "This call was added in version C<1.0.80>. In previous versions of "
5416 "libguestfs all you could do would be to speculatively execute a command to "
5417 "find out if the daemon implemented it. See also C<guestfs_version>."
5421 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:1163
5422 msgid "(Added in 1.0.80)"
5426 #: ../src/guestfs-actions.pod:604
5427 msgid "guestfs_available_all_groups"
5431 #: ../src/guestfs-actions.pod:606
5435 " guestfs_available_all_groups (guestfs_h *g);\n"
5440 #: ../src/guestfs-actions.pod:609
5442 "This command returns a list of all optional groups that this daemon knows "
5443 "about. Note this returns both supported and unsupported groups. To find "
5444 "out which ones the daemon can actually support you have to call "
5445 "C<guestfs_available> on each member of the returned list."
5449 #: ../src/guestfs-actions.pod:615
5450 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5454 #: ../src/guestfs-actions.pod:621
5455 msgid "(Added in 1.3.15)"
5459 #: ../src/guestfs-actions.pod:623
5460 msgid "guestfs_base64_in"
5464 #: ../src/guestfs-actions.pod:625
5468 " guestfs_base64_in (guestfs_h *g,\n"
5469 " const char *base64file,\n"
5470 " const char *filename);\n"
5475 #: ../src/guestfs-actions.pod:630 ../fish/guestfish-actions.pod:422
5477 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5481 #: ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649
5482 msgid "(Added in 1.3.5)"
5486 #: ../src/guestfs-actions.pod:637
5487 msgid "guestfs_base64_out"
5491 #: ../src/guestfs-actions.pod:639
5495 " guestfs_base64_out (guestfs_h *g,\n"
5496 " const char *filename,\n"
5497 " const char *base64file);\n"
5502 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:431
5504 "This command downloads the contents of C<filename>, writing it out to local "
5505 "file C<base64file> encoded as base64."
5509 #: ../src/guestfs-actions.pod:651
5510 msgid "guestfs_blockdev_flushbufs"
5514 #: ../src/guestfs-actions.pod:653
5518 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5519 " const char *device);\n"
5524 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:440
5526 "This tells the kernel to flush internal buffers associated with C<device>."
5530 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:677
5531 #: ../src/guestfs-actions.pod:692 ../src/guestfs-actions.pod:708
5532 #: ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:745
5533 #: ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:777
5534 #: ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805
5535 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5536 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5537 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5538 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5539 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5540 msgid "This uses the L<blockdev(8)> command."
5544 #: ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:681
5545 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:712
5546 #: ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749
5547 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
5548 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
5549 msgid "(Added in 0.9.3)"
5553 #: ../src/guestfs-actions.pod:666
5554 msgid "guestfs_blockdev_getbsz"
5558 #: ../src/guestfs-actions.pod:668
5562 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5563 " const char *device);\n"
5568 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:449
5569 msgid "This returns the block size of a device."
5573 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:774
5574 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5576 "(Note this is different from both I<size in blocks> and I<filesystem block "
5581 #: ../src/guestfs-actions.pod:683
5582 msgid "guestfs_blockdev_getro"
5586 #: ../src/guestfs-actions.pod:685
5590 " guestfs_blockdev_getro (guestfs_h *g,\n"
5591 " const char *device);\n"
5596 #: ../src/guestfs-actions.pod:689 ../fish/guestfish-actions.pod:460
5598 "Returns a boolean indicating if the block device is read-only (true if read-"
5599 "only, false if not)."
5603 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:1396
5604 #: ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1891
5605 #: ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1974
5606 #: ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2044
5607 #: ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2092
5608 #: ../src/guestfs-actions.pod:2990 ../src/guestfs-actions.pod:3004
5609 #: ../src/guestfs-actions.pod:3019 ../src/guestfs-actions.pod:3033
5610 #: ../src/guestfs-actions.pod:3049 ../src/guestfs-actions.pod:3064
5611 #: ../src/guestfs-actions.pod:3080 ../src/guestfs-actions.pod:3094
5612 #: ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3121
5613 #: ../src/guestfs-actions.pod:3136 ../src/guestfs-actions.pod:3151
5614 #: ../src/guestfs-actions.pod:4565
5615 msgid "This function returns a C truth value on success or -1 on error."
5619 #: ../src/guestfs-actions.pod:698
5620 msgid "guestfs_blockdev_getsize64"
5624 #: ../src/guestfs-actions.pod:700
5628 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5629 " const char *device);\n"
5634 #: ../src/guestfs-actions.pod:704 ../fish/guestfish-actions.pod:469
5635 msgid "This returns the size of the device in bytes."
5639 #: ../src/guestfs-actions.pod:706
5640 msgid "See also C<guestfs_blockdev_getsz>."
5644 #: ../src/guestfs-actions.pod:714
5645 msgid "guestfs_blockdev_getss"
5649 #: ../src/guestfs-actions.pod:716
5653 " guestfs_blockdev_getss (guestfs_h *g,\n"
5654 " const char *device);\n"
5659 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:479
5661 "This returns the size of sectors on a block device. Usually 512, but can be "
5662 "larger for modern devices."
5666 #: ../src/guestfs-actions.pod:723
5668 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5673 #: ../src/guestfs-actions.pod:732
5674 msgid "guestfs_blockdev_getsz"
5678 #: ../src/guestfs-actions.pod:734
5682 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5683 " const char *device);\n"
5688 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:491
5690 "This returns the size of the device in units of 512-byte sectors (even if "
5691 "the sectorsize isn't 512 bytes ... weird)."
5695 #: ../src/guestfs-actions.pod:741
5697 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5698 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5702 #: ../src/guestfs-actions.pod:751
5703 msgid "guestfs_blockdev_rereadpt"
5707 #: ../src/guestfs-actions.pod:753
5711 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5712 " const char *device);\n"
5717 #: ../src/guestfs-actions.pod:757 ../fish/guestfish-actions.pod:504
5718 msgid "Reread the partition table on C<device>."
5722 #: ../src/guestfs-actions.pod:765
5723 msgid "guestfs_blockdev_setbsz"
5727 #: ../src/guestfs-actions.pod:767
5731 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5732 " const char *device,\n"
5733 " int blocksize);\n"
5738 #: ../src/guestfs-actions.pod:772 ../fish/guestfish-actions.pod:512
5739 msgid "This sets the block size of a device."
5743 #: ../src/guestfs-actions.pod:783
5744 msgid "guestfs_blockdev_setro"
5748 #: ../src/guestfs-actions.pod:785
5752 " guestfs_blockdev_setro (guestfs_h *g,\n"
5753 " const char *device);\n"
5758 #: ../src/guestfs-actions.pod:789 ../fish/guestfish-actions.pod:523
5759 msgid "Sets the block device named C<device> to read-only."
5763 #: ../src/guestfs-actions.pod:797
5764 msgid "guestfs_blockdev_setrw"
5768 #: ../src/guestfs-actions.pod:799
5772 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5773 " const char *device);\n"
5778 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:531
5779 msgid "Sets the block device named C<device> to read-write."
5783 #: ../src/guestfs-actions.pod:811
5784 msgid "guestfs_case_sensitive_path"
5788 #: ../src/guestfs-actions.pod:813
5792 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5793 " const char *path);\n"
5798 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:539
5800 "This can be used to resolve case insensitive paths on a filesystem which is "
5801 "case sensitive. The use case is to resolve paths which you have read from "
5802 "Windows configuration files or the Windows Registry, to the true path."
5806 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:544
5808 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5809 "(and probably others), which is that although the underlying filesystem is "
5810 "case-insensitive, the driver exports the filesystem to Linux as case-"
5815 #: ../src/guestfs-actions.pod:827 ../fish/guestfish-actions.pod:549
5817 "One consequence of this is that special directories such as C<c:\\windows> "
5818 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5819 "precise details of how they were created. In Windows itself this would not "
5824 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:555
5826 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5831 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:558
5833 "This function resolves the true case of each element in the path and returns "
5834 "the case-sensitive path."
5838 #: ../src/guestfs-actions.pod:839
5840 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5841 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5842 "how the directories were originally created under Windows)."
5846 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:566
5847 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5851 #: ../src/guestfs-actions.pod:847
5852 msgid "See also C<guestfs_realpath>."
5856 #: ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:6497
5857 msgid "(Added in 1.0.75)"
5861 #: ../src/guestfs-actions.pod:854
5866 #: ../src/guestfs-actions.pod:856
5870 " guestfs_cat (guestfs_h *g,\n"
5871 " const char *path);\n"
5876 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5052
5877 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3378
5878 msgid "Return the contents of the file named C<path>."
5882 #: ../src/guestfs-actions.pod:862
5884 "Note that this function cannot correctly handle binary files (specifically, "
5885 "files containing C<\\0> character which is treated as end of string). For "
5886 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5887 "functions which have a more complex interface."
5891 #: ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:1049
5892 #: ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1360
5893 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1482
5894 #: ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1750
5895 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:2187
5896 #: ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:2254
5897 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:2300
5898 #: ../src/guestfs-actions.pod:4834 ../src/guestfs-actions.pod:4860
5899 #: ../src/guestfs-actions.pod:4991 ../src/guestfs-actions.pod:5017
5900 #: ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:5892
5901 #: ../src/guestfs-actions.pod:5947 ../src/guestfs-actions.pod:6093
5902 #: ../src/guestfs-actions.pod:6117 ../src/guestfs-actions.pod:6769
5903 #: ../src/guestfs-actions.pod:6795 ../src/guestfs-actions.pod:6821
5904 #: ../src/guestfs-actions.pod:6840 ../src/guestfs-actions.pod:6925
5905 #: ../src/guestfs-actions.pod:6944 ../src/guestfs-actions.pod:6990
5906 #: ../src/guestfs-actions.pod:7009 ../fish/guestfish-actions.pod:582
5907 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
5908 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
5909 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
5910 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462
5911 #: ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500
5912 #: ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525
5913 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3248
5914 #: ../fish/guestfish-actions.pod:3263 ../fish/guestfish-actions.pod:3339
5915 #: ../fish/guestfish-actions.pod:3356 ../fish/guestfish-actions.pod:3371
5916 #: ../fish/guestfish-actions.pod:3954 ../fish/guestfish-actions.pod:4000
5917 #: ../fish/guestfish-actions.pod:4085 ../fish/guestfish-actions.pod:4100
5918 #: ../fish/guestfish-actions.pod:4510 ../fish/guestfish-actions.pod:4528
5919 #: ../fish/guestfish-actions.pod:4545 ../fish/guestfish-actions.pod:4555
5920 #: ../fish/guestfish-actions.pod:4603 ../fish/guestfish-actions.pod:4613
5921 #: ../fish/guestfish-actions.pod:4642 ../fish/guestfish-actions.pod:4652
5923 "Because of the message protocol, there is a transfer limit of somewhere "
5924 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5928 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:3232
5929 #: ../src/guestfs-actions.pod:3294 ../src/guestfs-actions.pod:3311
5930 #: ../src/guestfs-actions.pod:3399 ../src/guestfs-actions.pod:3804
5931 #: ../src/guestfs-actions.pod:3818 ../src/guestfs-actions.pod:4940
5932 #: ../src/guestfs-actions.pod:4954 ../src/guestfs-actions.pod:6656
5933 #: ../src/guestfs-actions.pod:6670
5934 msgid "(Added in 0.4)"
5938 #: ../src/guestfs-actions.pod:875
5939 msgid "guestfs_checksum"
5943 #: ../src/guestfs-actions.pod:877
5947 " guestfs_checksum (guestfs_h *g,\n"
5948 " const char *csumtype,\n"
5949 " const char *path);\n"
5954 #: ../src/guestfs-actions.pod:882 ../fish/guestfish-actions.pod:589
5956 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5960 #: ../src/guestfs-actions.pod:885 ../fish/guestfish-actions.pod:592
5962 "The type of checksum to compute is given by the C<csumtype> parameter which "
5963 "must have one of the following values:"
5967 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:597
5972 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:599
5974 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5979 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:602
5984 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:604
5985 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5989 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:606
5994 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:608
5995 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5999 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:610
6004 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:612
6005 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6009 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:614
6014 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:616
6015 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6019 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:618
6024 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:620
6025 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6029 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:622
6034 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:624
6035 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6039 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:628
6040 msgid "The checksum is returned as a printable string."
6044 #: ../src/guestfs-actions.pod:923
6045 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6049 #: ../src/guestfs-actions.pod:925
6050 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6054 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:1238
6055 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:3006
6056 #: ../src/guestfs-actions.pod:3035 ../src/guestfs-actions.pod:3096
6057 #: ../src/guestfs-actions.pod:3123 ../src/guestfs-actions.pod:6358
6058 msgid "(Added in 1.0.2)"
6062 #: ../src/guestfs-actions.pod:932
6063 msgid "guestfs_checksum_device"
6067 #: ../src/guestfs-actions.pod:934
6071 " guestfs_checksum_device (guestfs_h *g,\n"
6072 " const char *csumtype,\n"
6073 " const char *device);\n"
6078 #: ../src/guestfs-actions.pod:939
6080 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6081 "device named C<device>. For the types of checksums supported see the "
6082 "C<guestfs_checksum> command."
6086 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:4471
6087 #: ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4567
6088 #: ../src/guestfs-actions.pod:4585 ../src/guestfs-actions.pod:4761
6089 #: ../src/guestfs-actions.pod:6272 ../src/guestfs-actions.pod:6286
6090 #: ../src/guestfs-actions.pod:6682
6091 msgid "(Added in 1.3.2)"
6095 #: ../src/guestfs-actions.pod:948
6096 msgid "guestfs_checksums_out"
6100 #: ../src/guestfs-actions.pod:950
6104 " guestfs_checksums_out (guestfs_h *g,\n"
6105 " const char *csumtype,\n"
6106 " const char *directory,\n"
6107 " const char *sumsfile);\n"
6112 #: ../src/guestfs-actions.pod:956 ../fish/guestfish-actions.pod:646
6114 "This command computes the checksums of all regular files in C<directory> and "
6115 "then emits a list of those checksums to the local output file C<sumsfile>."
6119 #: ../src/guestfs-actions.pod:960 ../fish/guestfish-actions.pod:650
6121 "This can be used for verifying the integrity of a virtual machine. However "
6122 "to be properly secure you should pay attention to the output of the checksum "
6123 "command (it uses the ones from GNU coreutils). In particular when the "
6124 "filename is not printable, coreutils uses a special backslash syntax. For "
6125 "more information, see the GNU coreutils info file."
6129 #: ../src/guestfs-actions.pod:970
6130 msgid "(Added in 1.3.7)"
6134 #: ../src/guestfs-actions.pod:972
6135 msgid "guestfs_chmod"
6139 #: ../src/guestfs-actions.pod:974
6143 " guestfs_chmod (guestfs_h *g,\n"
6145 " const char *path);\n"
6150 #: ../src/guestfs-actions.pod:979 ../fish/guestfish-actions.pod:664
6152 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6157 #: ../src/guestfs-actions.pod:982 ../fish/guestfish-actions.pod:667
6159 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6160 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6165 #: ../src/guestfs-actions.pod:986 ../src/guestfs-actions.pod:4055
6166 #: ../src/guestfs-actions.pod:4170 ../src/guestfs-actions.pod:4189
6167 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:671
6168 #: ../fish/guestfish-actions.pod:2738 ../fish/guestfish-actions.pod:2823
6169 #: ../fish/guestfish-actions.pod:2833 ../fish/guestfish-actions.pod:2843
6170 msgid "The mode actually set is affected by the umask."
6174 #: ../src/guestfs-actions.pod:992
6175 msgid "guestfs_chown"
6179 #: ../src/guestfs-actions.pod:994
6183 " guestfs_chown (guestfs_h *g,\n"
6186 " const char *path);\n"
6191 #: ../src/guestfs-actions.pod:1000 ../fish/guestfish-actions.pod:677
6192 msgid "Change the file owner to C<owner> and group to C<group>."
6196 #: ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:3193
6197 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2216
6199 "Only numeric uid and gid are supported. If you want to use names, you will "
6200 "need to locate and parse the password file yourself (Augeas support makes "
6201 "this relatively easy)."
6205 #: ../src/guestfs-actions.pod:1010
6206 msgid "guestfs_command"
6210 #: ../src/guestfs-actions.pod:1012
6214 " guestfs_command (guestfs_h *g,\n"
6215 " char *const *arguments);\n"
6220 #: ../src/guestfs-actions.pod:1016 ../fish/guestfish-actions.pod:687
6222 "This call runs a command from the guest filesystem. The filesystem must be "
6223 "mounted, and must contain a compatible operating system (ie. something "
6224 "Linux, with the same or compatible processor architecture)."
6228 #: ../src/guestfs-actions.pod:1021
6230 "The single parameter is an argv-style list of arguments. The first element "
6231 "is the name of the program to run. Subsequent elements are parameters. The "
6232 "list must be non-empty (ie. must contain a program name). Note that the "
6233 "command runs directly, and is I<not> invoked via the shell (see "
6238 #: ../src/guestfs-actions.pod:1028 ../fish/guestfish-actions.pod:699
6239 msgid "The return value is anything printed to I<stdout> by the command."
6243 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:702
6245 "If the command returns a non-zero exit status, then this function returns an "
6246 "error message. The error message string is the content of I<stderr> from "
6251 #: ../src/guestfs-actions.pod:1035 ../fish/guestfish-actions.pod:706
6253 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6254 "bin>. If you require a program from another location, you should provide "
6255 "the full path in the first parameter."
6259 #: ../src/guestfs-actions.pod:1040 ../fish/guestfish-actions.pod:711
6261 "Shared libraries and data files required by the program must be available on "
6262 "filesystems which are mounted in the correct places. It is the caller's "
6263 "responsibility to ensure all filesystems that are needed are mounted at the "
6268 #: ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072
6269 #: ../src/guestfs-actions.pod:1535
6270 msgid "(Added in 0.9.1)"
6274 #: ../src/guestfs-actions.pod:1054
6275 msgid "guestfs_command_lines"
6279 #: ../src/guestfs-actions.pod:1056
6283 " guestfs_command_lines (guestfs_h *g,\n"
6284 " char *const *arguments);\n"
6289 #: ../src/guestfs-actions.pod:1060
6291 "This is the same as C<guestfs_command>, but splits the result into a list of "
6296 #: ../src/guestfs-actions.pod:1063
6297 msgid "See also: C<guestfs_sh_lines>"
6301 #: ../src/guestfs-actions.pod:1074
6302 msgid "guestfs_config"
6306 #: ../src/guestfs-actions.pod:1076
6310 " guestfs_config (guestfs_h *g,\n"
6311 " const char *qemuparam,\n"
6312 " const char *qemuvalue);\n"
6317 #: ../src/guestfs-actions.pod:1081 ../fish/guestfish-actions.pod:736
6319 "This can be used to add arbitrary qemu command line parameters of the form "
6320 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6321 "setting some parameters which would interfere with parameters that we use."
6325 #: ../src/guestfs-actions.pod:1086 ../fish/guestfish-actions.pod:741
6326 msgid "The first character of C<param> string must be a C<-> (dash)."
6330 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:743
6331 msgid "C<value> can be NULL."
6335 #: ../src/guestfs-actions.pod:1094
6336 msgid "guestfs_copy_size"
6340 #: ../src/guestfs-actions.pod:1096
6344 " guestfs_copy_size (guestfs_h *g,\n"
6345 " const char *src,\n"
6346 " const char *dest,\n"
6352 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:749
6354 "This command copies exactly C<size> bytes from one source device or file "
6355 "C<src> to another destination device or file C<dest>."
6359 #: ../src/guestfs-actions.pod:1105 ../fish/guestfish-actions.pod:752
6361 "Note this will fail if the source is too short or if the destination is not "
6366 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1233
6367 #: ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1684
6368 #: ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:6861
6369 #: ../src/guestfs-actions.pod:6880
6371 "This long-running command can generate progress notification messages so "
6372 "that the caller can display a progress bar or indicator. To receive these "
6373 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6374 "guestfs_set_progress_callback>."
6378 #: ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:3831
6379 #: ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:6589
6380 #: ../src/guestfs-actions.pod:6609 ../src/guestfs-actions.pod:6695
6381 msgid "(Added in 1.0.87)"
6385 #: ../src/guestfs-actions.pod:1117
6390 #: ../src/guestfs-actions.pod:1119
6394 " guestfs_cp (guestfs_h *g,\n"
6395 " const char *src,\n"
6396 " const char *dest);\n"
6401 #: ../src/guestfs-actions.pod:1124 ../fish/guestfish-actions.pod:759
6403 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6404 "destination filename or destination directory."
6408 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143
6409 #: ../src/guestfs-actions.pod:1215 ../src/guestfs-actions.pod:1289
6410 #: ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:4434
6411 #: ../src/guestfs-actions.pod:4811
6412 msgid "(Added in 1.0.18)"
6416 #: ../src/guestfs-actions.pod:1131
6417 msgid "guestfs_cp_a"
6421 #: ../src/guestfs-actions.pod:1133
6425 " guestfs_cp_a (guestfs_h *g,\n"
6426 " const char *src,\n"
6427 " const char *dest);\n"
6432 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:766
6434 "This copies a file or directory from C<src> to C<dest> recursively using the "
6439 #: ../src/guestfs-actions.pod:1145
6444 #: ../src/guestfs-actions.pod:1147
6448 " guestfs_dd (guestfs_h *g,\n"
6449 " const char *src,\n"
6450 " const char *dest);\n"
6455 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:773
6457 "This command copies from one source device or file C<src> to another "
6458 "destination device or file C<dest>. Normally you would use this to copy to "
6459 "or from a device or partition, for example to duplicate a filesystem."
6463 #: ../src/guestfs-actions.pod:1157
6465 "If the destination is a device, it must be as large or larger than the "
6466 "source file or device, otherwise the copy will fail. This command cannot do "
6467 "partial copies (see C<guestfs_copy_size>)."
6471 #: ../src/guestfs-actions.pod:1165
6476 #: ../src/guestfs-actions.pod:1167
6480 " guestfs_df (guestfs_h *g);\n"
6485 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:786
6486 msgid "This command runs the C<df> command to report disk space used."
6490 #: ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:1189
6491 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6493 "This command is mostly useful for interactive sessions. It is I<not> "
6494 "intended that you try to parse the output string. Use C<statvfs> from "
6499 #: ../src/guestfs-actions.pod:1179 ../src/guestfs-actions.pod:1196
6500 #: ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:2233
6501 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2325
6502 #: ../src/guestfs-actions.pod:3941 ../src/guestfs-actions.pod:4334
6503 #: ../src/guestfs-actions.pod:6096 ../src/guestfs-actions.pod:6120
6504 #: ../src/guestfs-actions.pod:6728 ../src/guestfs-actions.pod:6741
6505 #: ../src/guestfs-actions.pod:6754
6506 msgid "(Added in 1.0.54)"
6510 #: ../src/guestfs-actions.pod:1181
6511 msgid "guestfs_df_h"
6515 #: ../src/guestfs-actions.pod:1183
6519 " guestfs_df_h (guestfs_h *g);\n"
6524 #: ../src/guestfs-actions.pod:1186 ../fish/guestfish-actions.pod:796
6526 "This command runs the C<df -h> command to report disk space used in human-"
6531 #: ../src/guestfs-actions.pod:1198
6532 msgid "guestfs_dmesg"
6536 #: ../src/guestfs-actions.pod:1200
6540 " guestfs_dmesg (guestfs_h *g);\n"
6545 #: ../src/guestfs-actions.pod:1203 ../fish/guestfish-actions.pod:807
6547 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6548 "This is sometimes useful for extended debugging of problems."
6552 #: ../src/guestfs-actions.pod:1207
6554 "Another way to get the same information is to enable verbose messages with "
6555 "C<guestfs_set_verbose> or by setting the environment variable "
6556 "C<LIBGUESTFS_DEBUG=1> before running the program."
6560 #: ../src/guestfs-actions.pod:1217
6561 msgid "guestfs_download"
6565 #: ../src/guestfs-actions.pod:1219
6569 " guestfs_download (guestfs_h *g,\n"
6570 " const char *remotefilename,\n"
6571 " const char *filename);\n"
6576 #: ../src/guestfs-actions.pod:1224 ../src/guestfs-actions.pod:1249
6577 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6579 "Download file C<remotefilename> and save it as C<filename> on the local "
6584 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:6352
6585 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4258
6586 msgid "C<filename> can also be a named pipe."
6590 #: ../src/guestfs-actions.pod:1229
6591 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6595 #: ../src/guestfs-actions.pod:1240
6596 msgid "guestfs_download_offset"
6600 #: ../src/guestfs-actions.pod:1242
6604 " guestfs_download_offset (guestfs_h *g,\n"
6605 " const char *remotefilename,\n"
6606 " const char *filename,\n"
6607 " int64_t offset,\n"
6613 #: ../src/guestfs-actions.pod:1252 ../fish/guestfish-actions.pod:836
6615 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6616 "region must be within the file or device)."
6620 #: ../src/guestfs-actions.pod:1255
6622 "Note that there is no limit on the amount of data that can be downloaded "
6623 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6624 "full amount unless an error occurs."
6628 #: ../src/guestfs-actions.pod:1260
6629 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6633 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:6387
6634 msgid "(Added in 1.5.17)"
6638 #: ../src/guestfs-actions.pod:1271
6639 msgid "guestfs_drop_caches"
6643 #: ../src/guestfs-actions.pod:1273
6647 " guestfs_drop_caches (guestfs_h *g,\n"
6648 " int whattodrop);\n"
6653 #: ../src/guestfs-actions.pod:1277 ../fish/guestfish-actions.pod:852
6655 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6656 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6657 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6661 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:857
6662 msgid "Setting C<whattodrop> to 3 should drop everything."
6666 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:859
6668 "This automatically calls L<sync(2)> before the operation, so that the "
6669 "maximum guest memory is freed."
6673 #: ../src/guestfs-actions.pod:1291
6678 #: ../src/guestfs-actions.pod:1293
6682 " guestfs_du (guestfs_h *g,\n"
6683 " const char *path);\n"
6688 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:866
6690 "This command runs the C<du -s> command to estimate file space usage for "
6695 #: ../src/guestfs-actions.pod:1300 ../fish/guestfish-actions.pod:869
6697 "C<path> can be a file or a directory. If C<path> is a directory then the "
6698 "estimate includes the contents of the directory and all subdirectories "
6703 #: ../src/guestfs-actions.pod:1304 ../fish/guestfish-actions.pod:873
6705 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6709 #: ../src/guestfs-actions.pod:1311
6710 msgid "guestfs_e2fsck_f"
6714 #: ../src/guestfs-actions.pod:1313
6718 " guestfs_e2fsck_f (guestfs_h *g,\n"
6719 " const char *device);\n"
6724 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:880
6726 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6727 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6732 #: ../src/guestfs-actions.pod:1321
6734 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6735 "Normally you should use C<guestfs_fsck>."
6739 #: ../src/guestfs-actions.pod:1326
6740 msgid "(Added in 1.0.29)"
6744 #: ../src/guestfs-actions.pod:1328
6745 msgid "guestfs_echo_daemon"
6749 #: ../src/guestfs-actions.pod:1330
6753 " guestfs_echo_daemon (guestfs_h *g,\n"
6754 " char *const *words);\n"
6759 #: ../src/guestfs-actions.pod:1334 ../fish/guestfish-actions.pod:891
6761 "This command concatenates the list of C<words> passed with single spaces "
6762 "between them and returns the resulting string."
6766 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:894
6767 msgid "You can use this command to test the connection through to the daemon."
6771 #: ../src/guestfs-actions.pod:1339
6772 msgid "See also C<guestfs_ping_daemon>."
6776 #: ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:2071
6777 #: ../src/guestfs-actions.pod:5600
6778 msgid "(Added in 1.0.69)"
6782 #: ../src/guestfs-actions.pod:1346
6783 msgid "guestfs_egrep"
6787 #: ../src/guestfs-actions.pod:1348
6791 " guestfs_egrep (guestfs_h *g,\n"
6792 " const char *regex,\n"
6793 " const char *path);\n"
6798 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:902
6800 "This calls the external C<egrep> program and returns the matching lines."
6804 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1382
6805 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1485
6806 #: ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:2171
6807 #: ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:2346
6808 #: ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2374
6809 #: ../src/guestfs-actions.pod:2420 ../src/guestfs-actions.pod:2442
6810 #: ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3324
6811 #: ../src/guestfs-actions.pod:3338 ../src/guestfs-actions.pod:3351
6812 #: ../src/guestfs-actions.pod:3365 ../src/guestfs-actions.pod:4269
6813 #: ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5194
6814 #: ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:5976
6815 #: ../src/guestfs-actions.pod:5989 ../src/guestfs-actions.pod:6002
6816 #: ../src/guestfs-actions.pod:6024 ../src/guestfs-actions.pod:6037
6817 #: ../src/guestfs-actions.pod:6050 ../src/guestfs-actions.pod:6063
6818 #: ../src/guestfs-actions.pod:6824 ../src/guestfs-actions.pod:6843
6819 #: ../src/guestfs-actions.pod:6928 ../src/guestfs-actions.pod:6947
6820 #: ../src/guestfs-actions.pod:6993 ../src/guestfs-actions.pod:7012
6821 msgid "(Added in 1.0.66)"
6825 #: ../src/guestfs-actions.pod:1365
6826 msgid "guestfs_egrepi"
6830 #: ../src/guestfs-actions.pod:1367
6834 " guestfs_egrepi (guestfs_h *g,\n"
6835 " const char *regex,\n"
6836 " const char *path);\n"
6841 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:912
6843 "This calls the external C<egrep -i> program and returns the matching lines."
6847 #: ../src/guestfs-actions.pod:1384
6848 msgid "guestfs_equal"
6852 #: ../src/guestfs-actions.pod:1386
6856 " guestfs_equal (guestfs_h *g,\n"
6857 " const char *file1,\n"
6858 " const char *file2);\n"
6863 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:922
6865 "This compares the two files C<file1> and C<file2> and returns true if their "
6866 "content is exactly equal, or false otherwise."
6870 #: ../src/guestfs-actions.pod:1394 ../fish/guestfish-actions.pod:925
6871 msgid "The external L<cmp(1)> program is used for the comparison."
6875 #: ../src/guestfs-actions.pod:1400
6876 msgid "guestfs_exists"
6880 #: ../src/guestfs-actions.pod:1402
6884 " guestfs_exists (guestfs_h *g,\n"
6885 " const char *path);\n"
6890 #: ../src/guestfs-actions.pod:1406 ../fish/guestfish-actions.pod:931
6892 "This returns C<true> if and only if there is a file, directory (or anything) "
6893 "with the given C<path> name."
6897 #: ../src/guestfs-actions.pod:1409
6898 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6902 #: ../src/guestfs-actions.pod:1415
6903 msgid "guestfs_fallocate"
6907 #: ../src/guestfs-actions.pod:1417
6911 " guestfs_fallocate (guestfs_h *g,\n"
6912 " const char *path,\n"
6918 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1448
6919 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6921 "This command preallocates a file (containing zero bytes) named C<path> of "
6922 "size C<len> bytes. If the file exists already, it is overwritten."
6926 #: ../src/guestfs-actions.pod:1426 ../fish/guestfish-actions.pod:944
6928 "Do not confuse this with the guestfish-specific C<alloc> command which "
6929 "allocates a file in the host and attaches it as a device."
6933 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:948
6935 "This function is deprecated. In new code, use the C<fallocate64> call "
6940 #: ../src/guestfs-actions.pod:1441
6941 msgid "guestfs_fallocate64"
6945 #: ../src/guestfs-actions.pod:1443
6949 " guestfs_fallocate64 (guestfs_h *g,\n"
6950 " const char *path,\n"
6956 #: ../src/guestfs-actions.pod:1452
6958 "Note that this call allocates disk blocks for the file. To create a sparse "
6959 "file use C<guestfs_truncate_size> instead."
6963 #: ../src/guestfs-actions.pod:1455
6965 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6966 "oversight it only allowed 30 bit lengths to be specified, effectively "
6967 "limiting the maximum size of files created through that call to 1GB."
6971 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:971
6973 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6974 "commands which create a file in the host and attach it as a device."
6978 #: ../src/guestfs-actions.pod:1466
6979 msgid "(Added in 1.3.17)"
6983 #: ../src/guestfs-actions.pod:1468
6984 msgid "guestfs_fgrep"
6988 #: ../src/guestfs-actions.pod:1470
6992 " guestfs_fgrep (guestfs_h *g,\n"
6993 " const char *pattern,\n"
6994 " const char *path);\n"
6999 #: ../src/guestfs-actions.pod:1475 ../fish/guestfish-actions.pod:979
7001 "This calls the external C<fgrep> program and returns the matching lines."
7005 #: ../src/guestfs-actions.pod:1487
7006 msgid "guestfs_fgrepi"
7010 #: ../src/guestfs-actions.pod:1489
7014 " guestfs_fgrepi (guestfs_h *g,\n"
7015 " const char *pattern,\n"
7016 " const char *path);\n"
7021 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:989
7023 "This calls the external C<fgrep -i> program and returns the matching lines."
7027 #: ../src/guestfs-actions.pod:1506
7028 msgid "guestfs_file"
7032 #: ../src/guestfs-actions.pod:1508
7036 " guestfs_file (guestfs_h *g,\n"
7037 " const char *path);\n"
7042 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:999
7044 "This call uses the standard L<file(1)> command to determine the type or "
7045 "contents of the file."
7049 #: ../src/guestfs-actions.pod:1515 ../fish/guestfish-actions.pod:1002
7051 "This call will also transparently look inside various types of compressed "
7056 #: ../src/guestfs-actions.pod:1518 ../fish/guestfish-actions.pod:1005
7058 "The exact command which runs is C<file -zb path>. Note in particular that "
7059 "the filename is not prepended to the output (the C<-b> option)."
7063 #: ../src/guestfs-actions.pod:1522
7065 "This command can also be used on C</dev/> devices (and partitions, LV "
7066 "names). You can for example use this to determine if a device contains a "
7067 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7071 #: ../src/guestfs-actions.pod:1527 ../fish/guestfish-actions.pod:1014
7073 "If the C<path> does not begin with C</dev/> then this command only works for "
7074 "the content of regular files. For other file types (directory, symbolic "
7075 "link etc) it will just return the string C<directory> etc."
7079 #: ../src/guestfs-actions.pod:1537
7080 msgid "guestfs_file_architecture"
7084 #: ../src/guestfs-actions.pod:1539
7088 " guestfs_file_architecture (guestfs_h *g,\n"
7089 " const char *filename);\n"
7094 #: ../src/guestfs-actions.pod:1543 ../fish/guestfish-actions.pod:1023
7096 "This detects the architecture of the binary C<filename>, and returns it if "
7101 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1026
7102 msgid "Currently defined architectures are:"
7106 #: ../src/guestfs-actions.pod:1550 ../fish/guestfish-actions.pod:1030
7111 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1032
7113 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7114 "irrespective of the precise processor requirements of the binary."
7118 #: ../src/guestfs-actions.pod:1555 ../fish/guestfish-actions.pod:1035
7123 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1037
7124 msgid "64 bit x86-64."
7128 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1039
7133 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1041
7134 msgid "32 bit SPARC."
7138 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1043
7143 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1045
7144 msgid "64 bit SPARC V9 and above."
7148 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1047
7153 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1049
7154 msgid "Intel Itanium."
7158 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1051
7163 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1053
7164 msgid "32 bit Power PC."
7168 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1055
7173 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1057
7174 msgid "64 bit Power PC."
7178 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1061
7179 msgid "Libguestfs may return other architecture strings in future."
7183 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1063
7184 msgid "The function works on at least the following types of files:"
7188 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1069
7189 msgid "many types of Un*x and Linux binary"
7193 #: ../src/guestfs-actions.pod:1593 ../fish/guestfish-actions.pod:1073
7194 msgid "many types of Un*x and Linux shared library"
7198 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1077
7199 msgid "Windows Win32 and Win64 binaries"
7203 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1081
7204 msgid "Windows Win32 and Win64 DLLs"
7208 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1083
7209 msgid "Win32 binaries and DLLs return C<i386>."
7213 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1085
7214 msgid "Win64 binaries and DLLs return C<x86_64>."
7218 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1089
7219 msgid "Linux kernel modules"
7223 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1093
7224 msgid "Linux new-style initrd images"
7228 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1097
7229 msgid "some non-x86 Linux vmlinuz kernels"
7233 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1101
7234 msgid "What it can't do currently:"
7238 #: ../src/guestfs-actions.pod:1627 ../fish/guestfish-actions.pod:1107
7239 msgid "static libraries (libfoo.a)"
7243 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1111
7244 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7248 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1115
7249 msgid "x86 Linux vmlinuz kernels"
7253 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1117
7255 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7256 "compressed code, and are horribly hard to unpack. If you want to find the "
7257 "architecture of a kernel, use the architecture of the associated initrd or "
7258 "kernel module(s) instead."
7262 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1810
7263 #: ../src/guestfs-actions.pod:1827 ../src/guestfs-actions.pod:2478
7264 #: ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2585
7265 #: ../src/guestfs-actions.pod:2612 ../src/guestfs-actions.pod:2633
7266 #: ../src/guestfs-actions.pod:2666 ../src/guestfs-actions.pod:2746
7267 #: ../src/guestfs-actions.pod:2806 ../src/guestfs-actions.pod:2977
7268 #: ../src/guestfs-actions.pod:3109
7269 msgid "(Added in 1.5.3)"
7273 #: ../src/guestfs-actions.pod:1649
7274 msgid "guestfs_filesize"
7278 #: ../src/guestfs-actions.pod:1651
7282 " guestfs_filesize (guestfs_h *g,\n"
7283 " const char *file);\n"
7288 #: ../src/guestfs-actions.pod:1655 ../fish/guestfish-actions.pod:1128
7289 msgid "This command returns the size of C<file> in bytes."
7293 #: ../src/guestfs-actions.pod:1657
7295 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7296 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7297 "devices, use C<guestfs_blockdev_getsize64>."
7301 #: ../src/guestfs-actions.pod:1663
7302 msgid "(Added in 1.0.82)"
7306 #: ../src/guestfs-actions.pod:1665
7307 msgid "guestfs_fill"
7311 #: ../src/guestfs-actions.pod:1667
7315 " guestfs_fill (guestfs_h *g,\n"
7318 " const char *path);\n"
7323 #: ../src/guestfs-actions.pod:1673 ../fish/guestfish-actions.pod:1138
7325 "This command creates a new file called C<path>. The initial content of the "
7326 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7331 #: ../src/guestfs-actions.pod:1677
7333 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7334 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7335 "bytes use C<guestfs_fill_pattern>."
7339 #: ../src/guestfs-actions.pod:1689
7340 msgid "(Added in 1.0.79)"
7344 #: ../src/guestfs-actions.pod:1691
7345 msgid "guestfs_fill_pattern"
7349 #: ../src/guestfs-actions.pod:1693
7353 " guestfs_fill_pattern (guestfs_h *g,\n"
7354 " const char *pattern,\n"
7356 " const char *path);\n"
7361 #: ../src/guestfs-actions.pod:1699
7363 "This function is like C<guestfs_fill> except that it creates a new file of "
7364 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7365 "pattern is truncated if necessary to ensure the length of the file is "
7366 "exactly C<len> bytes."
7370 #: ../src/guestfs-actions.pod:1711
7371 msgid "(Added in 1.3.12)"
7375 #: ../src/guestfs-actions.pod:1713
7376 msgid "guestfs_find"
7380 #: ../src/guestfs-actions.pod:1715
7384 " guestfs_find (guestfs_h *g,\n"
7385 " const char *directory);\n"
7390 #: ../src/guestfs-actions.pod:1719 ../fish/guestfish-actions.pod:1160
7392 "This command lists out all files and directories, recursively, starting at "
7393 "C<directory>. It is essentially equivalent to running the shell command "
7394 "C<find directory -print> but some post-processing happens on the output, "
7399 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1165
7401 "This returns a list of strings I<without any prefix>. Thus if the directory "
7406 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1168
7416 #: ../src/guestfs-actions.pod:1731
7418 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7422 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1175
7433 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1180
7434 msgid "If C<directory> is not a directory, then this command returns an error."
7438 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1183
7439 msgid "The returned list is sorted."
7443 #: ../src/guestfs-actions.pod:1744
7444 msgid "See also C<guestfs_find0>."
7448 #: ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:3768
7449 #: ../src/guestfs-actions.pod:5229
7450 msgid "(Added in 1.0.27)"
7454 #: ../src/guestfs-actions.pod:1755
7455 msgid "guestfs_find0"
7459 #: ../src/guestfs-actions.pod:1757
7463 " guestfs_find0 (guestfs_h *g,\n"
7464 " const char *directory,\n"
7465 " const char *files);\n"
7470 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1194
7472 "This command lists out all files and directories, recursively, starting at "
7473 "C<directory>, placing the resulting list in the external file called "
7478 #: ../src/guestfs-actions.pod:1766
7480 "This command works the same way as C<guestfs_find> with the following "
7485 #: ../src/guestfs-actions.pod:1773 ../fish/guestfish-actions.pod:1205
7486 msgid "The resulting list is written to an external file."
7490 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1209
7492 "Items (filenames) in the result are separated by C<\\0> characters. See "
7493 "L<find(1)> option I<-print0>."
7497 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1214
7498 msgid "This command is not limited in the number of names that it can return."
7502 #: ../src/guestfs-actions.pod:1787 ../fish/guestfish-actions.pod:1219
7503 msgid "The result list is not sorted."
7507 #: ../src/guestfs-actions.pod:1793
7508 msgid "(Added in 1.0.74)"
7512 #: ../src/guestfs-actions.pod:1795
7513 msgid "guestfs_findfs_label"
7517 #: ../src/guestfs-actions.pod:1797
7521 " guestfs_findfs_label (guestfs_h *g,\n"
7522 " const char *label);\n"
7527 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1229
7529 "This command searches the filesystems and returns the one which has the "
7530 "given label. An error is returned if no such filesystem can be found."
7534 #: ../src/guestfs-actions.pod:1805
7535 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7539 #: ../src/guestfs-actions.pod:1812
7540 msgid "guestfs_findfs_uuid"
7544 #: ../src/guestfs-actions.pod:1814
7548 " guestfs_findfs_uuid (guestfs_h *g,\n"
7549 " const char *uuid);\n"
7554 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1239
7556 "This command searches the filesystems and returns the one which has the "
7557 "given UUID. An error is returned if no such filesystem can be found."
7561 #: ../src/guestfs-actions.pod:1822
7562 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7566 #: ../src/guestfs-actions.pod:1829
7567 msgid "guestfs_fsck"
7571 #: ../src/guestfs-actions.pod:1831
7575 " guestfs_fsck (guestfs_h *g,\n"
7576 " const char *fstype,\n"
7577 " const char *device);\n"
7582 #: ../src/guestfs-actions.pod:1836 ../fish/guestfish-actions.pod:1249
7584 "This runs the filesystem checker (fsck) on C<device> which should have "
7585 "filesystem type C<fstype>."
7589 #: ../src/guestfs-actions.pod:1839 ../fish/guestfish-actions.pod:1252
7591 "The returned integer is the status. See L<fsck(8)> for the list of status "
7592 "codes from C<fsck>."
7596 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1261
7597 msgid "Multiple status codes can be summed together."
7601 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1265
7603 "A non-zero return code can mean \"success\", for example if errors have been "
7604 "corrected on the filesystem."
7608 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1270
7609 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7613 #: ../src/guestfs-actions.pod:1862 ../fish/guestfish-actions.pod:1275
7615 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7619 #: ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:6866
7620 msgid "(Added in 1.0.16)"
7624 #: ../src/guestfs-actions.pod:1868
7625 msgid "guestfs_get_append"
7629 #: ../src/guestfs-actions.pod:1870
7633 " guestfs_get_append (guestfs_h *g);\n"
7638 #: ../src/guestfs-actions.pod:1873 ../fish/guestfish-actions.pod:1281
7640 "Return the additional kernel options which are added to the guest kernel "
7645 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1284
7646 msgid "If C<NULL> then no options are added."
7650 #: ../src/guestfs-actions.pod:1878
7652 "This function returns a string which may be NULL. There is no way to return "
7653 "an error from this function. The string is owned by the guest handle and "
7654 "must I<not> be freed."
7658 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:4907
7659 #: ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5738
7660 #: ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5773
7661 #: ../src/guestfs-actions.pod:5790 ../src/guestfs-actions.pod:6537
7662 #: ../src/guestfs-actions.pod:6555 ../src/guestfs-actions.pod:6909
7663 msgid "(Added in 1.0.26)"
7667 #: ../src/guestfs-actions.pod:1884
7668 msgid "guestfs_get_autosync"
7672 #: ../src/guestfs-actions.pod:1886
7676 " guestfs_get_autosync (guestfs_h *g);\n"
7681 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1290
7682 msgid "Get the autosync flag."
7686 #: ../src/guestfs-actions.pod:1895
7687 msgid "guestfs_get_direct"
7691 #: ../src/guestfs-actions.pod:1897
7695 " guestfs_get_direct (guestfs_h *g);\n"
7700 #: ../src/guestfs-actions.pod:1900 ../fish/guestfish-actions.pod:1296
7701 msgid "Return the direct appliance mode flag."
7705 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:5411
7706 msgid "(Added in 1.0.72)"
7710 #: ../src/guestfs-actions.pod:1906
7711 msgid "guestfs_get_e2label"
7715 #: ../src/guestfs-actions.pod:1908
7719 " guestfs_get_e2label (guestfs_h *g,\n"
7720 " const char *device);\n"
7725 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1302
7727 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7731 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1305
7733 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7737 #: ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1946
7738 #: ../src/guestfs-actions.pod:5429 ../src/guestfs-actions.pod:5448
7739 msgid "(Added in 1.0.15)"
7743 #: ../src/guestfs-actions.pod:1927
7744 msgid "guestfs_get_e2uuid"
7748 #: ../src/guestfs-actions.pod:1929
7752 " guestfs_get_e2uuid (guestfs_h *g,\n"
7753 " const char *device);\n"
7758 #: ../src/guestfs-actions.pod:1933 ../fish/guestfish-actions.pod:1316
7760 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7764 #: ../src/guestfs-actions.pod:1939 ../fish/guestfish-actions.pod:1319
7766 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7770 #: ../src/guestfs-actions.pod:1948
7771 msgid "guestfs_get_memsize"
7775 #: ../src/guestfs-actions.pod:1950
7779 " guestfs_get_memsize (guestfs_h *g);\n"
7784 #: ../src/guestfs-actions.pod:1953 ../fish/guestfish-actions.pod:1330
7786 "This gets the memory size in megabytes allocated to the qemu subprocess."
7790 #: ../src/guestfs-actions.pod:1956
7792 "If C<guestfs_set_memsize> was not called on this handle, and if "
7793 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7794 "value for memsize."
7798 #: ../src/guestfs-actions.pod:1960 ../src/guestfs-actions.pod:2041
7799 #: ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5571
7800 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7801 #: ../fish/guestfish-actions.pod:3665 ../fish/guestfish-actions.pod:3752
7803 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7807 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:4059
7808 #: ../src/guestfs-actions.pod:4174 ../src/guestfs-actions.pod:4193
7809 #: ../src/guestfs-actions.pod:4212 ../src/guestfs-actions.pod:4224
7810 #: ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4254
7811 #: ../src/guestfs-actions.pod:5132 ../src/guestfs-actions.pod:5469
7812 #: ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:6313
7813 msgid "(Added in 1.0.55)"
7817 #: ../src/guestfs-actions.pod:1967
7818 msgid "guestfs_get_network"
7822 #: ../src/guestfs-actions.pod:1969
7826 " guestfs_get_network (guestfs_h *g);\n"
7831 #: ../src/guestfs-actions.pod:1972 ../fish/guestfish-actions.pod:1344
7832 msgid "This returns the enable network flag."
7836 #: ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:5488
7837 msgid "(Added in 1.5.4)"
7841 #: ../src/guestfs-actions.pod:1978
7842 msgid "guestfs_get_path"
7846 #: ../src/guestfs-actions.pod:1980
7850 " guestfs_get_path (guestfs_h *g);\n"
7855 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1350
7856 msgid "Return the current search path."
7860 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1352
7862 "This is always non-NULL. If it wasn't set already, then this will return "
7867 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2017
7869 "This function returns a string, or NULL on error. The string is owned by "
7870 "the guest handle and must I<not> be freed."
7874 #: ../src/guestfs-actions.pod:1993
7875 msgid "guestfs_get_pid"
7879 #: ../src/guestfs-actions.pod:1995
7883 " guestfs_get_pid (guestfs_h *g);\n"
7888 #: ../src/guestfs-actions.pod:1998 ../fish/guestfish-actions.pod:1361
7890 "Return the process ID of the qemu subprocess. If there is no qemu "
7891 "subprocess, then this will return an error."
7895 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1364
7896 msgid "This is an internal call used for debugging and testing."
7900 #: ../src/guestfs-actions.pod:2005
7901 msgid "(Added in 1.0.56)"
7905 #: ../src/guestfs-actions.pod:2007
7906 msgid "guestfs_get_qemu"
7910 #: ../src/guestfs-actions.pod:2009
7914 " guestfs_get_qemu (guestfs_h *g);\n"
7919 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1370
7920 msgid "Return the current qemu binary."
7924 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1372
7926 "This is always non-NULL. If it wasn't set already, then this will return "
7927 "the default qemu binary name."
7931 #: ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:5533
7932 msgid "(Added in 1.0.6)"
7936 #: ../src/guestfs-actions.pod:2022
7937 msgid "guestfs_get_recovery_proc"
7941 #: ../src/guestfs-actions.pod:2024
7945 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7950 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1379
7951 msgid "Return the recovery process enabled flag."
7955 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:3199
7956 #: ../src/guestfs-actions.pod:3466 ../src/guestfs-actions.pod:3866
7957 #: ../src/guestfs-actions.pod:3898 ../src/guestfs-actions.pod:4837
7958 #: ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5557
7959 #: ../src/guestfs-actions.pod:6216 ../src/guestfs-actions.pod:6236
7960 #: ../src/guestfs-actions.pod:6418
7961 msgid "(Added in 1.0.77)"
7965 #: ../src/guestfs-actions.pod:2033
7966 msgid "guestfs_get_selinux"
7970 #: ../src/guestfs-actions.pod:2035
7974 " guestfs_get_selinux (guestfs_h *g);\n"
7979 #: ../src/guestfs-actions.pod:2038
7981 "This returns the current setting of the selinux flag which is passed to the "
7982 "appliance at boot time. See C<guestfs_set_selinux>."
7986 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2109
7987 #: ../src/guestfs-actions.pod:5576 ../src/guestfs-actions.pod:5630
7988 msgid "(Added in 1.0.67)"
7992 #: ../src/guestfs-actions.pod:2048
7993 msgid "guestfs_get_state"
7997 #: ../src/guestfs-actions.pod:2050
8001 " guestfs_get_state (guestfs_h *g);\n"
8006 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1395
8008 "This returns the current state as an opaque integer. This is only useful "
8009 "for printing debug and internal error messages."
8013 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:3002
8014 #: ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3092
8015 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:1398
8016 #: ../fish/guestfish-actions.pod:2098 ../fish/guestfish-actions.pod:2116
8017 #: ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2170
8018 msgid "For more information on states, see L<guestfs(3)>."
8022 #: ../src/guestfs-actions.pod:2062
8023 msgid "guestfs_get_trace"
8027 #: ../src/guestfs-actions.pod:2064
8031 " guestfs_get_trace (guestfs_h *g);\n"
8036 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1404
8037 msgid "Return the command trace flag."
8041 #: ../src/guestfs-actions.pod:2073
8042 msgid "guestfs_get_umask"
8046 #: ../src/guestfs-actions.pod:2075
8050 " guestfs_get_umask (guestfs_h *g);\n"
8055 #: ../src/guestfs-actions.pod:2078
8057 "Return the current umask. By default the umask is C<022> unless it has been "
8058 "set by calling C<guestfs_umask>."
8062 #: ../src/guestfs-actions.pod:2085
8063 msgid "guestfs_get_verbose"
8067 #: ../src/guestfs-actions.pod:2087
8071 " guestfs_get_verbose (guestfs_h *g);\n"
8076 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1417
8077 msgid "This returns the verbose messages flag."
8081 #: ../src/guestfs-actions.pod:2096
8082 msgid "guestfs_getcon"
8086 #: ../src/guestfs-actions.pod:2098
8090 " guestfs_getcon (guestfs_h *g);\n"
8095 #: ../src/guestfs-actions.pod:2101 ../fish/guestfish-actions.pod:1423
8096 msgid "This gets the SELinux security context of the daemon."
8100 #: ../src/guestfs-actions.pod:2103
8102 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8106 #: ../src/guestfs-actions.pod:2111
8107 msgid "guestfs_getxattrs"
8111 #: ../src/guestfs-actions.pod:2113
8114 " struct guestfs_xattr_list *\n"
8115 " guestfs_getxattrs (guestfs_h *g,\n"
8116 " const char *path);\n"
8121 #: ../src/guestfs-actions.pod:2117 ../fish/guestfish-actions.pod:1432
8123 "This call lists the extended attributes of the file or directory C<path>."
8127 #: ../src/guestfs-actions.pod:2120 ../fish/guestfish-actions.pod:1435
8129 "At the system call level, this is a combination of the L<listxattr(2)> and "
8130 "L<getxattr(2)> calls."
8134 #: ../src/guestfs-actions.pod:2123
8135 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8139 #: ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:3211
8140 #: ../src/guestfs-actions.pod:3862
8142 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8143 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8147 #: ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:3215
8148 #: ../src/guestfs-actions.pod:3380 ../src/guestfs-actions.pod:3416
8149 #: ../src/guestfs-actions.pod:5210 ../src/guestfs-actions.pod:5649
8150 #: ../src/guestfs-actions.pod:6974
8151 msgid "(Added in 1.0.59)"
8155 #: ../src/guestfs-actions.pod:2131
8156 msgid "guestfs_glob_expand"
8160 #: ../src/guestfs-actions.pod:2133
8164 " guestfs_glob_expand (guestfs_h *g,\n"
8165 " const char *pattern);\n"
8170 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1444
8172 "This command searches for all the pathnames matching C<pattern> according to "
8173 "the wildcard expansion rules used by the shell."
8177 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1448
8179 "If no paths match, then this returns an empty list (note: not an error)."
8183 #: ../src/guestfs-actions.pod:2144 ../fish/guestfish-actions.pod:1451
8185 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8186 "GLOB_BRACE>. See that manual page for more details."
8190 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:5814
8191 #: ../src/guestfs-actions.pod:5831
8192 msgid "(Added in 1.0.50)"
8196 #: ../src/guestfs-actions.pod:2154
8197 msgid "guestfs_grep"
8201 #: ../src/guestfs-actions.pod:2156
8205 " guestfs_grep (guestfs_h *g,\n"
8206 " const char *regex,\n"
8207 " const char *path);\n"
8212 #: ../src/guestfs-actions.pod:2161 ../fish/guestfish-actions.pod:1459
8213 msgid "This calls the external C<grep> program and returns the matching lines."
8217 #: ../src/guestfs-actions.pod:2173
8218 msgid "guestfs_grepi"
8222 #: ../src/guestfs-actions.pod:2175
8226 " guestfs_grepi (guestfs_h *g,\n"
8227 " const char *regex,\n"
8228 " const char *path);\n"
8233 #: ../src/guestfs-actions.pod:2180 ../fish/guestfish-actions.pod:1469
8235 "This calls the external C<grep -i> program and returns the matching lines."
8239 #: ../src/guestfs-actions.pod:2192
8240 msgid "guestfs_grub_install"
8244 #: ../src/guestfs-actions.pod:2194
8248 " guestfs_grub_install (guestfs_h *g,\n"
8249 " const char *root,\n"
8250 " const char *device);\n"
8255 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1479
8257 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8258 "the root directory being C<root>."
8262 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1482
8264 "Note: If grub-install reports the error \"No suitable drive was found in the "
8265 "generated device map.\" it may be that you need to create a C</boot/grub/"
8266 "device.map> file first that contains the mapping between grub device names "
8267 "and Linux device names. It is usually sufficient to create a file "
8272 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1489
8280 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1491
8281 msgid "replacing C</dev/vda> with the name of the installation device."
8285 #: ../src/guestfs-actions.pod:2215
8286 msgid "(Added in 1.0.17)"
8290 #: ../src/guestfs-actions.pod:2217
8291 msgid "guestfs_head"
8295 #: ../src/guestfs-actions.pod:2219
8299 " guestfs_head (guestfs_h *g,\n"
8300 " const char *path);\n"
8305 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1497
8307 "This command returns up to the first 10 lines of a file as a list of strings."
8311 #: ../src/guestfs-actions.pod:2235
8312 msgid "guestfs_head_n"
8316 #: ../src/guestfs-actions.pod:2237
8320 " guestfs_head_n (guestfs_h *g,\n"
8322 " const char *path);\n"
8327 #: ../src/guestfs-actions.pod:2242 ../fish/guestfish-actions.pod:1507
8329 "If the parameter C<nrlines> is a positive number, this returns the first "
8330 "C<nrlines> lines of the file C<path>."
8334 #: ../src/guestfs-actions.pod:2245 ../fish/guestfish-actions.pod:1510
8336 "If the parameter C<nrlines> is a negative number, this returns lines from "
8337 "the file C<path>, excluding the last C<nrlines> lines."
8341 #: ../src/guestfs-actions.pod:2248 ../src/guestfs-actions.pod:6111
8342 #: ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:4098
8343 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8347 #: ../src/guestfs-actions.pod:2259
8348 msgid "guestfs_hexdump"
8352 #: ../src/guestfs-actions.pod:2261
8356 " guestfs_hexdump (guestfs_h *g,\n"
8357 " const char *path);\n"
8362 #: ../src/guestfs-actions.pod:2265 ../fish/guestfish-actions.pod:1522
8364 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8365 "readable, canonical hex dump of the file."
8369 #: ../src/guestfs-actions.pod:2274 ../src/guestfs-actions.pod:5895
8370 #: ../src/guestfs-actions.pod:5950
8371 msgid "(Added in 1.0.22)"
8375 #: ../src/guestfs-actions.pod:2276
8376 msgid "guestfs_initrd_cat"
8380 #: ../src/guestfs-actions.pod:2278
8384 " guestfs_initrd_cat (guestfs_h *g,\n"
8385 " const char *initrdpath,\n"
8386 " const char *filename,\n"
8387 " size_t *size_r);\n"
8392 #: ../src/guestfs-actions.pod:2284 ../fish/guestfish-actions.pod:1532
8394 "This command unpacks the file C<filename> from the initrd file called "
8395 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8400 #: ../src/guestfs-actions.pod:2288 ../fish/guestfish-actions.pod:1536
8402 "For example, in guestfish you could use the following command to examine the "
8403 "boot script (usually called C</init>) contained in a Linux initrd or "
8408 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1540
8411 " initrd-cat /boot/initrd-<version>.img init\n"
8416 #: ../src/guestfs-actions.pod:2294
8417 msgid "See also C<guestfs_initrd_list>."
8421 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:4830
8422 #: ../src/guestfs-actions.pod:4856 ../src/guestfs-actions.pod:5037
8424 "This function returns a buffer, or NULL on error. The size of the returned "
8425 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8430 #: ../src/guestfs-actions.pod:2305
8431 msgid "guestfs_initrd_list"
8435 #: ../src/guestfs-actions.pod:2307
8439 " guestfs_initrd_list (guestfs_h *g,\n"
8440 " const char *path);\n"
8445 #: ../src/guestfs-actions.pod:2311 ../fish/guestfish-actions.pod:1551
8446 msgid "This command lists out files contained in an initrd."
8450 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1553
8452 "The files are listed without any initial C</> character. The files are "
8453 "listed in the order they appear (not necessarily alphabetical). Directory "
8454 "names are listed as separate items."
8458 #: ../src/guestfs-actions.pod:2317 ../fish/guestfish-actions.pod:1557
8460 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8461 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8466 #: ../src/guestfs-actions.pod:2327
8467 msgid "guestfs_inotify_add_watch"
8471 #: ../src/guestfs-actions.pod:2329
8475 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8476 " const char *path,\n"
8482 #: ../src/guestfs-actions.pod:2334 ../fish/guestfish-actions.pod:1565
8483 msgid "Watch C<path> for the events listed in C<mask>."
8487 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1567
8489 "Note that if C<path> is a directory then events within that directory are "
8490 "watched, but this does I<not> happen recursively (in subdirectories)."
8494 #: ../src/guestfs-actions.pod:2340 ../fish/guestfish-actions.pod:1571
8496 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8497 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8501 #: ../src/guestfs-actions.pod:2348
8502 msgid "guestfs_inotify_close"
8506 #: ../src/guestfs-actions.pod:2350
8510 " guestfs_inotify_close (guestfs_h *g);\n"
8515 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1579
8517 "This closes the inotify handle which was previously opened by inotify_init. "
8518 "It removes all watches, throws away any pending events, and deallocates all "
8523 #: ../src/guestfs-actions.pod:2361
8524 msgid "guestfs_inotify_files"
8528 #: ../src/guestfs-actions.pod:2363
8532 " guestfs_inotify_files (guestfs_h *g);\n"
8537 #: ../src/guestfs-actions.pod:2366
8539 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8540 "returns a list of pathnames of objects that were touched. The returned "
8541 "pathnames are sorted and deduplicated."
8545 #: ../src/guestfs-actions.pod:2376
8546 msgid "guestfs_inotify_init"
8550 #: ../src/guestfs-actions.pod:2378
8554 " guestfs_inotify_init (guestfs_h *g,\n"
8555 " int maxevents);\n"
8560 #: ../src/guestfs-actions.pod:2382 ../fish/guestfish-actions.pod:1595
8562 "This command creates a new inotify handle. The inotify subsystem can be "
8563 "used to notify events which happen to objects in the guest filesystem."
8567 #: ../src/guestfs-actions.pod:2386
8569 "C<maxevents> is the maximum number of events which will be queued up between "
8570 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8571 "passed as C<0>, then the kernel (or previously set) default is used. For "
8572 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8573 "throws away events, but records the fact that it threw them away by setting "
8574 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8575 "C<guestfs_inotify_read>)."
8579 #: ../src/guestfs-actions.pod:2396
8581 "Before any events are generated, you have to add some watches to the "
8582 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8583 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8587 #: ../src/guestfs-actions.pod:2402
8589 "Queued up events should be read periodically by calling "
8590 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8591 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8592 "often enough then you risk the internal queue overflowing."
8596 #: ../src/guestfs-actions.pod:2409
8598 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8599 "This also removes any watches automatically."
8603 #: ../src/guestfs-actions.pod:2413 ../fish/guestfish-actions.pod:1626
8605 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8606 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8607 "that there is one global inotify handle per libguestfs instance."
8611 #: ../src/guestfs-actions.pod:2422
8612 msgid "guestfs_inotify_read"
8616 #: ../src/guestfs-actions.pod:2424
8619 " struct guestfs_inotify_event_list *\n"
8620 " guestfs_inotify_read (guestfs_h *g);\n"
8625 #: ../src/guestfs-actions.pod:2427 ../fish/guestfish-actions.pod:1635
8627 "Return the complete queue of events that have happened since the previous "
8632 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1638
8633 msgid "If no events have happened, this returns an empty list."
8637 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1640
8639 "I<Note>: In order to make sure that all events have been read, you must call "
8640 "this function repeatedly until it returns an empty list. The reason is that "
8641 "the call will read events up to the maximum appliance-to-host message size "
8642 "and leave remaining events in the queue."
8646 #: ../src/guestfs-actions.pod:2438
8648 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8649 "there was an error. I<The caller must call "
8650 "C<guestfs_free_inotify_event_list> after use>."
8654 #: ../src/guestfs-actions.pod:2444
8655 msgid "guestfs_inotify_rm_watch"
8659 #: ../src/guestfs-actions.pod:2446
8663 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8669 #: ../src/guestfs-actions.pod:2450
8671 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8675 #: ../src/guestfs-actions.pod:2457
8676 msgid "guestfs_inspect_get_arch"
8680 #: ../src/guestfs-actions.pod:2459
8684 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8685 " const char *root);\n"
8690 #: ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:2486
8691 #: ../src/guestfs-actions.pod:2567 ../src/guestfs-actions.pod:2593
8692 #: ../src/guestfs-actions.pod:2620 ../src/guestfs-actions.pod:2641
8693 #: ../src/guestfs-actions.pod:2674 ../src/guestfs-actions.pod:2701
8694 #: ../src/guestfs-actions.pod:2730 ../src/guestfs-actions.pod:2772
8695 #: ../src/guestfs-actions.pod:2814 ../src/guestfs-actions.pod:2837
8697 "This function should only be called with a root device string as returned by "
8698 "C<guestfs_inspect_os>."
8702 #: ../src/guestfs-actions.pod:2466
8704 "This returns the architecture of the inspected operating system. The "
8705 "possible return values are listed under C<guestfs_file_architecture>."
8709 #: ../src/guestfs-actions.pod:2470 ../fish/guestfish-actions.pod:1664
8711 "If the architecture could not be determined, then the string C<unknown> is "
8716 #: ../src/guestfs-actions.pod:2473 ../src/guestfs-actions.pod:2554
8717 #: ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:2690
8718 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2741
8719 #: ../src/guestfs-actions.pod:2760 ../src/guestfs-actions.pod:2801
8720 #: ../src/guestfs-actions.pod:2824 ../src/guestfs-actions.pod:2930
8721 #: ../src/guestfs-actions.pod:2969 ../fish/guestfish-actions.pod:1667
8722 #: ../fish/guestfish-actions.pod:1741 ../fish/guestfish-actions.pod:1780
8723 #: ../fish/guestfish-actions.pod:1840 ../fish/guestfish-actions.pod:1864
8724 #: ../fish/guestfish-actions.pod:1881 ../fish/guestfish-actions.pod:1894
8725 #: ../fish/guestfish-actions.pod:1929 ../fish/guestfish-actions.pod:1945
8726 #: ../fish/guestfish-actions.pod:2044 ../fish/guestfish-actions.pod:2078
8727 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8731 #: ../src/guestfs-actions.pod:2480
8732 msgid "guestfs_inspect_get_distro"
8736 #: ../src/guestfs-actions.pod:2482
8740 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8741 " const char *root);\n"
8746 #: ../src/guestfs-actions.pod:2489 ../fish/guestfish-actions.pod:1676
8748 "This returns the distro (distribution) of the inspected operating system."
8752 #: ../src/guestfs-actions.pod:2492 ../fish/guestfish-actions.pod:1679
8753 msgid "Currently defined distros are:"
8757 #: ../src/guestfs-actions.pod:2496 ../fish/guestfish-actions.pod:1683
8758 msgid "\"archlinux\""
8762 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1685
8767 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1687
8772 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1689
8777 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1691
8782 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1693
8787 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1695
8792 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1697
8797 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1699
8798 msgid "\"linuxmint\""
8802 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1701
8807 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1703
8808 msgid "\"mandriva\""
8812 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1705
8817 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1707
8822 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1709
8827 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1711
8832 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1713
8837 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1715
8838 msgid "\"redhat-based\""
8842 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1717
8843 msgid "Some Red Hat-derived distro."
8847 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1719
8852 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1721
8853 msgid "Red Hat Enterprise Linux and some derivatives."
8857 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1723
8862 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1725
8867 #: ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2792
8868 #: ../fish/guestfish-actions.pod:1727 ../fish/guestfish-actions.pod:1920
8873 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1729
8874 msgid "The distro could not be determined."
8878 #: ../src/guestfs-actions.pod:2544 ../src/guestfs-actions.pod:2784
8879 #: ../fish/guestfish-actions.pod:1731 ../fish/guestfish-actions.pod:1912
8884 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1733
8886 "Windows does not have distributions. This string is returned if the OS type "
8891 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2798
8892 #: ../fish/guestfish-actions.pod:1738 ../fish/guestfish-actions.pod:1926
8894 "Future versions of libguestfs may return other strings here. The caller "
8895 "should be prepared to handle any string."
8899 #: ../src/guestfs-actions.pod:2561
8900 msgid "guestfs_inspect_get_filesystems"
8904 #: ../src/guestfs-actions.pod:2563
8908 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8909 " const char *root);\n"
8914 #: ../src/guestfs-actions.pod:2570 ../fish/guestfish-actions.pod:1750
8916 "This returns a list of all the filesystems that we think are associated with "
8917 "this operating system. This includes the root filesystem, other ordinary "
8918 "filesystems, and non-mounted devices like swap partitions."
8922 #: ../src/guestfs-actions.pod:2575 ../fish/guestfish-actions.pod:1755
8924 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8925 "to be shared between operating systems."
8929 #: ../src/guestfs-actions.pod:2578
8931 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8932 "C<guestfs_inspect_get_mountpoints>."
8936 #: ../src/guestfs-actions.pod:2587
8937 msgid "guestfs_inspect_get_major_version"
8941 #: ../src/guestfs-actions.pod:2589
8945 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
8946 " const char *root);\n"
8951 #: ../src/guestfs-actions.pod:2596 ../fish/guestfish-actions.pod:1768
8953 "This returns the major version number of the inspected operating system."
8957 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:1771
8959 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8960 "popular public names used by the operating system. Notably the operating "
8961 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8962 "1). You can find out the real versions corresponding to releases of Windows "
8963 "by consulting Wikipedia or MSDN."
8967 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2626
8968 #: ../fish/guestfish-actions.pod:1778 ../fish/guestfish-actions.pod:1792
8969 msgid "If the version could not be determined, then C<0> is returned."
8973 #: ../src/guestfs-actions.pod:2614
8974 msgid "guestfs_inspect_get_minor_version"
8978 #: ../src/guestfs-actions.pod:2616
8982 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8983 " const char *root);\n"
8988 #: ../src/guestfs-actions.pod:2623 ../fish/guestfish-actions.pod:1789
8990 "This returns the minor version number of the inspected operating system."
8994 #: ../src/guestfs-actions.pod:2628
8996 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8997 "C<guestfs_inspect_get_major_version>."
9001 #: ../src/guestfs-actions.pod:2635
9002 msgid "guestfs_inspect_get_mountpoints"
9006 #: ../src/guestfs-actions.pod:2637
9010 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9011 " const char *root);\n"
9016 #: ../src/guestfs-actions.pod:2644 ../fish/guestfish-actions.pod:1804
9018 "This returns a hash of where we think the filesystems associated with this "
9019 "operating system should be mounted. Callers should note that this is at "
9020 "best an educated guess made by reading configuration files such as C</etc/"
9025 #: ../src/guestfs-actions.pod:2649 ../fish/guestfish-actions.pod:1809
9027 "Each element in the returned hashtable has a key which is the path of the "
9028 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9029 "mounted there (eg. C</dev/sda1>)."
9033 #: ../src/guestfs-actions.pod:2654 ../fish/guestfish-actions.pod:1814
9035 "Non-mounted devices such as swap devices are I<not> returned in this list."
9039 #: ../src/guestfs-actions.pod:2657
9041 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9042 "C<guestfs_inspect_get_filesystems>."
9046 #: ../src/guestfs-actions.pod:2660 ../src/guestfs-actions.pod:3268
9047 #: ../src/guestfs-actions.pod:4396 ../src/guestfs-actions.pod:6252
9049 "This function returns a NULL-terminated array of strings, or NULL if there "
9050 "was an error. The array of strings will always have length C<2n+1>, where "
9051 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9052 "caller must free the strings and the array after use>."
9056 #: ../src/guestfs-actions.pod:2668
9057 msgid "guestfs_inspect_get_package_format"
9061 #: ../src/guestfs-actions.pod:2670
9065 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9066 " const char *root);\n"
9071 #: ../src/guestfs-actions.pod:2677
9073 "This function and C<guestfs_inspect_get_package_management> return the "
9074 "package format and package management tool used by the inspected operating "
9075 "system. For example for Fedora these functions would return C<rpm> (package "
9076 "format) and C<yum> (package management)."
9080 #: ../src/guestfs-actions.pod:2683 ../fish/guestfish-actions.pod:1833
9082 "This returns the string C<unknown> if we could not determine the package "
9083 "format I<or> if the operating system does not have a real packaging system "
9088 #: ../src/guestfs-actions.pod:2687 ../fish/guestfish-actions.pod:1837
9090 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9091 "Future versions of libguestfs may return other strings."
9095 #: ../src/guestfs-actions.pod:2695
9096 msgid "guestfs_inspect_get_package_management"
9100 #: ../src/guestfs-actions.pod:2697
9104 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9105 " const char *root);\n"
9110 #: ../src/guestfs-actions.pod:2704
9112 "C<guestfs_inspect_get_package_format> and this function return the package "
9113 "format and package management tool used by the inspected operating system. "
9114 "For example for Fedora these functions would return C<rpm> (package format) "
9115 "and C<yum> (package management)."
9119 #: ../src/guestfs-actions.pod:2710 ../fish/guestfish-actions.pod:1855
9121 "This returns the string C<unknown> if we could not determine the package "
9122 "management tool I<or> if the operating system does not have a real packaging "
9123 "system (eg. Windows)."
9127 #: ../src/guestfs-actions.pod:2714 ../fish/guestfish-actions.pod:1859
9129 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9130 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9131 "libguestfs may return other strings."
9135 #: ../src/guestfs-actions.pod:2724
9136 msgid "guestfs_inspect_get_product_name"
9140 #: ../src/guestfs-actions.pod:2726
9144 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9145 " const char *root);\n"
9150 #: ../src/guestfs-actions.pod:2733 ../fish/guestfish-actions.pod:1873
9152 "This returns the product name of the inspected operating system. The "
9153 "product name is generally some freeform string which can be displayed to the "
9154 "user, but should not be parsed by programs."
9158 #: ../src/guestfs-actions.pod:2738 ../fish/guestfish-actions.pod:1878
9160 "If the product name could not be determined, then the string C<unknown> is "
9165 #: ../src/guestfs-actions.pod:2748
9166 msgid "guestfs_inspect_get_roots"
9170 #: ../src/guestfs-actions.pod:2750
9174 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9179 #: ../src/guestfs-actions.pod:2753
9181 "This function is a convenient way to get the list of root devices, as "
9182 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9183 "the whole inspection process."
9187 #: ../src/guestfs-actions.pod:2757
9189 "This returns an empty list if either no root devices were found or the "
9190 "caller has not called C<guestfs_inspect_os>."
9194 #: ../src/guestfs-actions.pod:2766
9195 msgid "guestfs_inspect_get_type"
9199 #: ../src/guestfs-actions.pod:2768
9203 " guestfs_inspect_get_type (guestfs_h *g,\n"
9204 " const char *root);\n"
9209 #: ../src/guestfs-actions.pod:2775 ../fish/guestfish-actions.pod:1903
9211 "This returns the type of the inspected operating system. Currently defined "
9216 #: ../src/guestfs-actions.pod:2780 ../fish/guestfish-actions.pod:1908
9221 #: ../src/guestfs-actions.pod:2782 ../fish/guestfish-actions.pod:1910
9222 msgid "Any Linux-based operating system."
9226 #: ../src/guestfs-actions.pod:2786 ../fish/guestfish-actions.pod:1914
9227 msgid "Any Microsoft Windows operating system."
9231 #: ../src/guestfs-actions.pod:2788 ../fish/guestfish-actions.pod:1916
9236 #: ../src/guestfs-actions.pod:2790 ../fish/guestfish-actions.pod:1918
9241 #: ../src/guestfs-actions.pod:2794 ../fish/guestfish-actions.pod:1922
9242 msgid "The operating system type could not be determined."
9246 #: ../src/guestfs-actions.pod:2808
9247 msgid "guestfs_inspect_get_windows_systemroot"
9251 #: ../src/guestfs-actions.pod:2810
9255 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9256 " const char *root);\n"
9261 #: ../src/guestfs-actions.pod:2817 ../fish/guestfish-actions.pod:1938
9263 "This returns the Windows systemroot of the inspected guest. The systemroot "
9264 "is a directory path such as C</WINDOWS>."
9268 #: ../src/guestfs-actions.pod:2820 ../fish/guestfish-actions.pod:1941
9270 "This call assumes that the guest is Windows and that the systemroot could be "
9271 "determined by inspection. If this is not the case then an error is returned."
9275 #: ../src/guestfs-actions.pod:2829
9276 msgid "(Added in 1.5.25)"
9280 #: ../src/guestfs-actions.pod:2831
9281 msgid "guestfs_inspect_list_applications"
9285 #: ../src/guestfs-actions.pod:2833
9288 " struct guestfs_application_list *\n"
9289 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9290 " const char *root);\n"
9295 #: ../src/guestfs-actions.pod:2840 ../fish/guestfish-actions.pod:1954
9296 msgid "Return the list of applications installed in the operating system."
9300 #: ../src/guestfs-actions.pod:2842
9302 "I<Note:> This call works differently from other parts of the inspection "
9303 "API. You have to call C<guestfs_inspect_os>, then "
9304 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9305 "this. Listing applications is a significantly more difficult operation "
9306 "which requires access to the full filesystem. Also note that unlike the "
9307 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9308 "the libguestfs handle, this call actually reads parts of the mounted "
9309 "filesystems during the call."
9313 #: ../src/guestfs-actions.pod:2852 ../fish/guestfish-actions.pod:1966
9315 "This returns an empty list if the inspection code was not able to determine "
9316 "the list of applications."
9320 #: ../src/guestfs-actions.pod:2855 ../fish/guestfish-actions.pod:1969
9321 msgid "The application structure contains the following fields:"
9325 #: ../src/guestfs-actions.pod:2859 ../fish/guestfish-actions.pod:1973
9330 #: ../src/guestfs-actions.pod:2861 ../fish/guestfish-actions.pod:1975
9332 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9333 "guests, this is the package name."
9337 #: ../src/guestfs-actions.pod:2864 ../fish/guestfish-actions.pod:1978
9338 msgid "C<app_display_name>"
9342 #: ../src/guestfs-actions.pod:2866 ../fish/guestfish-actions.pod:1980
9344 "The display name of the application, sometimes localized to the install "
9345 "language of the guest operating system."
9349 #: ../src/guestfs-actions.pod:2869 ../fish/guestfish-actions.pod:1983
9351 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9352 "to display something can use C<app_name> instead."
9356 #: ../src/guestfs-actions.pod:2872 ../fish/guestfish-actions.pod:1986
9357 msgid "C<app_epoch>"
9361 #: ../src/guestfs-actions.pod:2874 ../fish/guestfish-actions.pod:1988
9363 "For package managers which use epochs, this contains the epoch of the "
9364 "package (an integer). If unavailable, this is returned as C<0>."
9368 #: ../src/guestfs-actions.pod:2877 ../fish/guestfish-actions.pod:1991
9369 msgid "C<app_version>"
9373 #: ../src/guestfs-actions.pod:2879 ../fish/guestfish-actions.pod:1993
9375 "The version string of the application or package. If unavailable this is "
9376 "returned as an empty string C<\"\">."
9380 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:1996
9381 msgid "C<app_release>"
9385 #: ../src/guestfs-actions.pod:2884 ../fish/guestfish-actions.pod:1998
9387 "The release string of the application or package, for package managers that "
9388 "use this. If unavailable this is returned as an empty string C<\"\">."
9392 #: ../src/guestfs-actions.pod:2888 ../fish/guestfish-actions.pod:2002
9393 msgid "C<app_install_path>"
9397 #: ../src/guestfs-actions.pod:2890 ../fish/guestfish-actions.pod:2004
9399 "The installation path of the application (on operating systems such as "
9400 "Windows which use installation paths). This path is in the format used by "
9401 "the guest operating system, it is not a libguestfs path."
9405 #: ../src/guestfs-actions.pod:2895 ../fish/guestfish-actions.pod:2009
9406 msgid "If unavailable this is returned as an empty string C<\"\">."
9410 #: ../src/guestfs-actions.pod:2897 ../fish/guestfish-actions.pod:2011
9411 msgid "C<app_trans_path>"
9415 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:2013
9417 "The install path translated into a libguestfs path. If unavailable this is "
9418 "returned as an empty string C<\"\">."
9422 #: ../src/guestfs-actions.pod:2902 ../fish/guestfish-actions.pod:2016
9423 msgid "C<app_publisher>"
9427 #: ../src/guestfs-actions.pod:2904 ../fish/guestfish-actions.pod:2018
9429 "The name of the publisher of the application, for package managers that use "
9430 "this. If unavailable this is returned as an empty string C<\"\">."
9434 #: ../src/guestfs-actions.pod:2908 ../fish/guestfish-actions.pod:2022
9439 #: ../src/guestfs-actions.pod:2910 ../fish/guestfish-actions.pod:2024
9441 "The URL (eg. upstream URL) of the application. If unavailable this is "
9442 "returned as an empty string C<\"\">."
9446 #: ../src/guestfs-actions.pod:2913 ../fish/guestfish-actions.pod:2027
9447 msgid "C<app_source_package>"
9451 #: ../src/guestfs-actions.pod:2915 ../fish/guestfish-actions.pod:2029
9453 "For packaging systems which support this, the name of the source package. "
9454 "If unavailable this is returned as an empty string C<\"\">."
9458 #: ../src/guestfs-actions.pod:2918 ../fish/guestfish-actions.pod:2032
9459 msgid "C<app_summary>"
9463 #: ../src/guestfs-actions.pod:2920 ../fish/guestfish-actions.pod:2034
9465 "A short (usually one line) description of the application or package. If "
9466 "unavailable this is returned as an empty string C<\"\">."
9470 #: ../src/guestfs-actions.pod:2923 ../fish/guestfish-actions.pod:2037
9471 msgid "C<app_description>"
9475 #: ../src/guestfs-actions.pod:2925 ../fish/guestfish-actions.pod:2039
9477 "A longer description of the application or package. If unavailable this is "
9478 "returned as an empty string C<\"\">."
9482 #: ../src/guestfs-actions.pod:2932
9484 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9485 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9490 #: ../src/guestfs-actions.pod:2936
9491 msgid "guestfs_inspect_os"
9495 #: ../src/guestfs-actions.pod:2938
9499 " guestfs_inspect_os (guestfs_h *g);\n"
9504 #: ../src/guestfs-actions.pod:2941 ../fish/guestfish-actions.pod:2050
9506 "This function uses other libguestfs functions and certain heuristics to "
9507 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9508 "for operating systems."
9512 #: ../src/guestfs-actions.pod:2945 ../fish/guestfish-actions.pod:2054
9513 msgid "The list returned is empty if no operating systems were found."
9517 #: ../src/guestfs-actions.pod:2947 ../fish/guestfish-actions.pod:2056
9519 "If one operating system was found, then this returns a list with a single "
9520 "element, which is the name of the root filesystem of this operating system. "
9521 "It is also possible for this function to return a list containing more than "
9522 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9523 "element being the root filesystem of one of the operating systems."
9527 #: ../src/guestfs-actions.pod:2954
9529 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9530 "functions in order to query further information about each operating system, "
9531 "such as the name and version."
9535 #: ../src/guestfs-actions.pod:2959
9537 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9538 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9539 "the contents. This should be called with no disks currently mounted. The "
9540 "function may also use Augeas, so any existing Augeas handle will be closed."
9544 #: ../src/guestfs-actions.pod:2965 ../fish/guestfish-actions.pod:2074
9546 "This function cannot decrypt encrypted disks. The caller must do that first "
9547 "(supplying the necessary keys) if the disk is encrypted."
9551 #: ../src/guestfs-actions.pod:2971 ../src/guestfs-actions.pod:3226
9552 #: ../src/guestfs-actions.pod:3288
9553 msgid "See also C<guestfs_list_filesystems>."
9557 #: ../src/guestfs-actions.pod:2979
9558 msgid "guestfs_is_blockdev"
9562 #: ../src/guestfs-actions.pod:2981
9566 " guestfs_is_blockdev (guestfs_h *g,\n"
9567 " const char *path);\n"
9572 #: ../src/guestfs-actions.pod:2985 ../fish/guestfish-actions.pod:2086
9574 "This returns C<true> if and only if there is a block device with the given "
9579 #: ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3017
9580 #: ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3062
9581 #: ../src/guestfs-actions.pod:3078 ../src/guestfs-actions.pod:3134
9582 #: ../src/guestfs-actions.pod:3149
9583 msgid "See also C<guestfs_stat>."
9587 #: ../src/guestfs-actions.pod:2992 ../src/guestfs-actions.pod:3021
9588 #: ../src/guestfs-actions.pod:3066 ../src/guestfs-actions.pod:3138
9589 #: ../src/guestfs-actions.pod:3153
9590 msgid "(Added in 1.5.10)"
9594 #: ../src/guestfs-actions.pod:2994
9595 msgid "guestfs_is_busy"
9599 #: ../src/guestfs-actions.pod:2996
9603 " guestfs_is_busy (guestfs_h *g);\n"
9608 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2095
9610 "This returns true iff this handle is busy processing a command (in the "
9615 #: ../src/guestfs-actions.pod:3008
9616 msgid "guestfs_is_chardev"
9620 #: ../src/guestfs-actions.pod:3010
9624 " guestfs_is_chardev (guestfs_h *g,\n"
9625 " const char *path);\n"
9630 #: ../src/guestfs-actions.pod:3014 ../fish/guestfish-actions.pod:2104
9632 "This returns C<true> if and only if there is a character device with the "
9633 "given C<path> name."
9637 #: ../src/guestfs-actions.pod:3023
9638 msgid "guestfs_is_config"
9642 #: ../src/guestfs-actions.pod:3025
9646 " guestfs_is_config (guestfs_h *g);\n"
9651 #: ../src/guestfs-actions.pod:3028 ../fish/guestfish-actions.pod:2113
9653 "This returns true iff this handle is being configured (in the C<CONFIG> "
9658 #: ../src/guestfs-actions.pod:3037
9659 msgid "guestfs_is_dir"
9663 #: ../src/guestfs-actions.pod:3039
9667 " guestfs_is_dir (guestfs_h *g,\n"
9668 " const char *path);\n"
9673 #: ../src/guestfs-actions.pod:3043 ../fish/guestfish-actions.pod:2122
9675 "This returns C<true> if and only if there is a directory with the given "
9676 "C<path> name. Note that it returns false for other objects like files."
9680 #: ../src/guestfs-actions.pod:3053
9681 msgid "guestfs_is_fifo"
9685 #: ../src/guestfs-actions.pod:3055
9689 " guestfs_is_fifo (guestfs_h *g,\n"
9690 " const char *path);\n"
9695 #: ../src/guestfs-actions.pod:3059 ../fish/guestfish-actions.pod:2132
9697 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9698 "given C<path> name."
9702 #: ../src/guestfs-actions.pod:3068
9703 msgid "guestfs_is_file"
9707 #: ../src/guestfs-actions.pod:3070
9711 " guestfs_is_file (guestfs_h *g,\n"
9712 " const char *path);\n"
9717 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2141
9719 "This returns C<true> if and only if there is a regular file with the given "
9720 "C<path> name. Note that it returns false for other objects like directories."
9724 #: ../src/guestfs-actions.pod:3084
9725 msgid "guestfs_is_launching"
9729 #: ../src/guestfs-actions.pod:3086
9733 " guestfs_is_launching (guestfs_h *g);\n"
9738 #: ../src/guestfs-actions.pod:3089 ../fish/guestfish-actions.pod:2151
9740 "This returns true iff this handle is launching the subprocess (in the "
9741 "C<LAUNCHING> state)."
9745 #: ../src/guestfs-actions.pod:3098
9746 msgid "guestfs_is_lv"
9750 #: ../src/guestfs-actions.pod:3100
9754 " guestfs_is_lv (guestfs_h *g,\n"
9755 " const char *device);\n"
9760 #: ../src/guestfs-actions.pod:3104 ../fish/guestfish-actions.pod:2160
9762 "This command tests whether C<device> is a logical volume, and returns true "
9763 "iff this is the case."
9767 #: ../src/guestfs-actions.pod:3111
9768 msgid "guestfs_is_ready"
9772 #: ../src/guestfs-actions.pod:3113
9776 " guestfs_is_ready (guestfs_h *g);\n"
9781 #: ../src/guestfs-actions.pod:3116 ../fish/guestfish-actions.pod:2167
9783 "This returns true iff this handle is ready to accept commands (in the "
9788 #: ../src/guestfs-actions.pod:3125
9789 msgid "guestfs_is_socket"
9793 #: ../src/guestfs-actions.pod:3127
9797 " guestfs_is_socket (guestfs_h *g,\n"
9798 " const char *path);\n"
9803 #: ../src/guestfs-actions.pod:3131 ../fish/guestfish-actions.pod:2176
9805 "This returns C<true> if and only if there is a Unix domain socket with the "
9806 "given C<path> name."
9810 #: ../src/guestfs-actions.pod:3140
9811 msgid "guestfs_is_symlink"
9815 #: ../src/guestfs-actions.pod:3142
9819 " guestfs_is_symlink (guestfs_h *g,\n"
9820 " const char *path);\n"
9825 #: ../src/guestfs-actions.pod:3146 ../fish/guestfish-actions.pod:2185
9827 "This returns C<true> if and only if there is a symbolic link with the given "
9832 #: ../src/guestfs-actions.pod:3155
9833 msgid "guestfs_kill_subprocess"
9837 #: ../src/guestfs-actions.pod:3157
9841 " guestfs_kill_subprocess (guestfs_h *g);\n"
9846 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2194
9847 msgid "This kills the qemu subprocess. You should never need to call this."
9851 #: ../src/guestfs-actions.pod:3166
9852 msgid "guestfs_launch"
9856 #: ../src/guestfs-actions.pod:3168
9860 " guestfs_launch (guestfs_h *g);\n"
9865 #: ../src/guestfs-actions.pod:3171 ../fish/guestfish-actions.pod:2202
9867 "Internally libguestfs is implemented by running a virtual machine using "
9872 #: ../src/guestfs-actions.pod:3174 ../fish/guestfish-actions.pod:2205
9874 "You should call this after configuring the handle (eg. adding drives) but "
9875 "before performing any actions."
9879 #: ../src/guestfs-actions.pod:3181
9880 msgid "guestfs_lchown"
9884 #: ../src/guestfs-actions.pod:3183
9888 " guestfs_lchown (guestfs_h *g,\n"
9891 " const char *path);\n"
9896 #: ../src/guestfs-actions.pod:3189
9898 "Change the file owner to C<owner> and group to C<group>. This is like "
9899 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
9900 "changed, not the target."
9904 #: ../src/guestfs-actions.pod:3201
9905 msgid "guestfs_lgetxattrs"
9909 #: ../src/guestfs-actions.pod:3203
9912 " struct guestfs_xattr_list *\n"
9913 " guestfs_lgetxattrs (guestfs_h *g,\n"
9914 " const char *path);\n"
9919 #: ../src/guestfs-actions.pod:3207
9921 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
9922 "then it returns the extended attributes of the link itself."
9926 #: ../src/guestfs-actions.pod:3217
9927 msgid "guestfs_list_devices"
9931 #: ../src/guestfs-actions.pod:3219
9935 " guestfs_list_devices (guestfs_h *g);\n"
9940 #: ../src/guestfs-actions.pod:3222 ../fish/guestfish-actions.pod:2232
9941 msgid "List all the block devices."
9945 #: ../src/guestfs-actions.pod:3224 ../fish/guestfish-actions.pod:2234
9946 msgid "The full block device names are returned, eg. C</dev/sda>."
9950 #: ../src/guestfs-actions.pod:3234
9951 msgid "guestfs_list_filesystems"
9955 #: ../src/guestfs-actions.pod:3236
9959 " guestfs_list_filesystems (guestfs_h *g);\n"
9964 #: ../src/guestfs-actions.pod:3239 ../fish/guestfish-actions.pod:2242
9966 "This inspection command looks for filesystems on partitions, block devices "
9967 "and logical volumes, returning a list of devices containing filesystems and "
9972 #: ../src/guestfs-actions.pod:3243 ../fish/guestfish-actions.pod:2246
9974 "The return value is a hash, where the keys are the devices containing "
9975 "filesystems, and the values are the filesystem types. For example:"
9979 #: ../src/guestfs-actions.pod:3247 ../fish/guestfish-actions.pod:2250
9982 " \"/dev/sda1\" => \"ntfs\"\n"
9983 " \"/dev/sda2\" => \"ext2\"\n"
9984 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9985 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9990 #: ../src/guestfs-actions.pod:3252 ../fish/guestfish-actions.pod:2255
9992 "The value can have the special value \"unknown\", meaning the content of the "
9993 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9997 #: ../src/guestfs-actions.pod:3256
9999 "This command runs other libguestfs commands, which might include "
10000 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10001 "soon after launch and only when nothing is mounted."
10005 #: ../src/guestfs-actions.pod:3260
10007 "Not all of the filesystems returned will be mountable. In particular, swap "
10008 "partitions are returned in the list. Also this command does not check that "
10009 "each filesystem found is valid and mountable, and some filesystems might be "
10010 "mountable but require special options. Filesystems may not all belong to a "
10011 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
10015 #: ../src/guestfs-actions.pod:3274 ../src/guestfs-actions.pod:4797
10016 msgid "(Added in 1.5.15)"
10020 #: ../src/guestfs-actions.pod:3276
10021 msgid "guestfs_list_partitions"
10025 #: ../src/guestfs-actions.pod:3278
10029 " guestfs_list_partitions (guestfs_h *g);\n"
10034 #: ../src/guestfs-actions.pod:3281 ../fish/guestfish-actions.pod:2275
10035 msgid "List all the partitions detected on all block devices."
10039 #: ../src/guestfs-actions.pod:3283 ../fish/guestfish-actions.pod:2277
10040 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10044 #: ../src/guestfs-actions.pod:3285
10046 "This does not return logical volumes. For that you will need to call "
10051 #: ../src/guestfs-actions.pod:3296
10056 #: ../src/guestfs-actions.pod:3298
10060 " guestfs_ll (guestfs_h *g,\n"
10061 " const char *directory);\n"
10066 #: ../src/guestfs-actions.pod:3302 ../fish/guestfish-actions.pod:2288
10068 "List the files in C<directory> (relative to the root directory, there is no "
10069 "cwd) in the format of 'ls -la'."
10073 #: ../src/guestfs-actions.pod:3305 ../fish/guestfish-actions.pod:2291
10075 "This command is mostly useful for interactive sessions. It is I<not> "
10076 "intended that you try to parse the output string."
10080 #: ../src/guestfs-actions.pod:3313
10085 #: ../src/guestfs-actions.pod:3315
10089 " guestfs_ln (guestfs_h *g,\n"
10090 " const char *target,\n"
10091 " const char *linkname);\n"
10096 #: ../src/guestfs-actions.pod:3320 ../fish/guestfish-actions.pod:2298
10097 msgid "This command creates a hard link using the C<ln> command."
10101 #: ../src/guestfs-actions.pod:3326
10102 msgid "guestfs_ln_f"
10106 #: ../src/guestfs-actions.pod:3328
10110 " guestfs_ln_f (guestfs_h *g,\n"
10111 " const char *target,\n"
10112 " const char *linkname);\n"
10117 #: ../src/guestfs-actions.pod:3333 ../fish/guestfish-actions.pod:2304
10119 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10120 "option removes the link (C<linkname>) if it exists already."
10124 #: ../src/guestfs-actions.pod:3340
10125 msgid "guestfs_ln_s"
10129 #: ../src/guestfs-actions.pod:3342
10133 " guestfs_ln_s (guestfs_h *g,\n"
10134 " const char *target,\n"
10135 " const char *linkname);\n"
10140 #: ../src/guestfs-actions.pod:3347 ../fish/guestfish-actions.pod:2311
10141 msgid "This command creates a symbolic link using the C<ln -s> command."
10145 #: ../src/guestfs-actions.pod:3353
10146 msgid "guestfs_ln_sf"
10150 #: ../src/guestfs-actions.pod:3355
10154 " guestfs_ln_sf (guestfs_h *g,\n"
10155 " const char *target,\n"
10156 " const char *linkname);\n"
10161 #: ../src/guestfs-actions.pod:3360 ../fish/guestfish-actions.pod:2317
10163 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10164 "option removes the link (C<linkname>) if it exists already."
10168 #: ../src/guestfs-actions.pod:3367
10169 msgid "guestfs_lremovexattr"
10173 #: ../src/guestfs-actions.pod:3369
10177 " guestfs_lremovexattr (guestfs_h *g,\n"
10178 " const char *xattr,\n"
10179 " const char *path);\n"
10184 #: ../src/guestfs-actions.pod:3374
10186 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10187 "link, then it removes an extended attribute of the link itself."
10191 #: ../src/guestfs-actions.pod:3382
10196 #: ../src/guestfs-actions.pod:3384
10200 " guestfs_ls (guestfs_h *g,\n"
10201 " const char *directory);\n"
10206 #: ../src/guestfs-actions.pod:3388 ../fish/guestfish-actions.pod:2332
10208 "List the files in C<directory> (relative to the root directory, there is no "
10209 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10213 #: ../src/guestfs-actions.pod:3392
10215 "This command is mostly useful for interactive sessions. Programs should "
10216 "probably use C<guestfs_readdir> instead."
10220 #: ../src/guestfs-actions.pod:3401
10221 msgid "guestfs_lsetxattr"
10225 #: ../src/guestfs-actions.pod:3403
10229 " guestfs_lsetxattr (guestfs_h *g,\n"
10230 " const char *xattr,\n"
10231 " const char *val,\n"
10233 " const char *path);\n"
10238 #: ../src/guestfs-actions.pod:3410
10240 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10241 "then it sets an extended attribute of the link itself."
10245 #: ../src/guestfs-actions.pod:3418
10246 msgid "guestfs_lstat"
10250 #: ../src/guestfs-actions.pod:3420
10253 " struct guestfs_stat *\n"
10254 " guestfs_lstat (guestfs_h *g,\n"
10255 " const char *path);\n"
10260 #: ../src/guestfs-actions.pod:3424 ../src/guestfs-actions.pod:5851
10261 #: ../fish/guestfish-actions.pod:2351 ../fish/guestfish-actions.pod:3933
10262 msgid "Returns file information for the given C<path>."
10266 #: ../src/guestfs-actions.pod:3426
10268 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10269 "link, then the link is stat-ed, not the file it refers to."
10273 #: ../src/guestfs-actions.pod:3430 ../fish/guestfish-actions.pod:2357
10274 msgid "This is the same as the C<lstat(2)> system call."
10278 #: ../src/guestfs-actions.pod:3432 ../src/guestfs-actions.pod:5855
10280 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10281 "error. I<The caller must call C<guestfs_free_stat> after use>."
10285 #: ../src/guestfs-actions.pod:3436 ../src/guestfs-actions.pod:5859
10286 #: ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:6258
10287 msgid "(Added in 0.9.2)"
10291 #: ../src/guestfs-actions.pod:3438
10292 msgid "guestfs_lstatlist"
10296 #: ../src/guestfs-actions.pod:3440
10299 " struct guestfs_stat_list *\n"
10300 " guestfs_lstatlist (guestfs_h *g,\n"
10301 " const char *path,\n"
10302 " char *const *names);\n"
10307 #: ../src/guestfs-actions.pod:3445
10309 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10310 "files, where all files are in the directory C<path>. C<names> is the list "
10311 "of files from this directory."
10315 #: ../src/guestfs-actions.pod:3449 ../fish/guestfish-actions.pod:2367
10317 "On return you get a list of stat structs, with a one-to-one correspondence "
10318 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10319 "then the C<ino> field of that structure is set to C<-1>."
10323 #: ../src/guestfs-actions.pod:3454
10325 "This call is intended for programs that want to efficiently list a directory "
10326 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10327 "for a similarly efficient call for getting extended attributes. Very long "
10328 "directory listings might cause the protocol message size to be exceeded, "
10329 "causing this call to fail. The caller must split up such requests into "
10330 "smaller groups of names."
10334 #: ../src/guestfs-actions.pod:3462
10336 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10337 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10341 #: ../src/guestfs-actions.pod:3468
10342 msgid "guestfs_luks_add_key"
10346 #: ../src/guestfs-actions.pod:3470
10350 " guestfs_luks_add_key (guestfs_h *g,\n"
10351 " const char *device,\n"
10352 " const char *key,\n"
10353 " const char *newkey,\n"
10359 #: ../src/guestfs-actions.pod:3477 ../fish/guestfish-actions.pod:2384
10361 "This command adds a new key on LUKS device C<device>. C<key> is any "
10362 "existing key, and is used to access the device. C<newkey> is the new key to "
10363 "add. C<keyslot> is the key slot that will be replaced."
10367 #: ../src/guestfs-actions.pod:3482
10369 "Note that if C<keyslot> already contains a key, then this command will "
10370 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10374 #: ../src/guestfs-actions.pod:3488 ../src/guestfs-actions.pod:3528
10375 #: ../src/guestfs-actions.pod:3551 ../src/guestfs-actions.pod:3571
10376 #: ../src/guestfs-actions.pod:3603 ../src/guestfs-actions.pod:3622
10378 "This function takes a key or passphrase parameter which could contain "
10379 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10384 #: ../src/guestfs-actions.pod:3492 ../src/guestfs-actions.pod:3532
10385 #: ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:3575
10386 msgid "(Added in 1.5.2)"
10390 #: ../src/guestfs-actions.pod:3494
10391 msgid "guestfs_luks_close"
10395 #: ../src/guestfs-actions.pod:3496
10399 " guestfs_luks_close (guestfs_h *g,\n"
10400 " const char *device);\n"
10405 #: ../src/guestfs-actions.pod:3500
10407 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10408 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10409 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10410 "underlying block device."
10414 #: ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3607
10415 #: ../src/guestfs-actions.pod:3626 ../src/guestfs-actions.pod:3676
10416 #: ../src/guestfs-actions.pod:3724
10417 msgid "(Added in 1.5.1)"
10421 #: ../src/guestfs-actions.pod:3510
10422 msgid "guestfs_luks_format"
10426 #: ../src/guestfs-actions.pod:3512
10430 " guestfs_luks_format (guestfs_h *g,\n"
10431 " const char *device,\n"
10432 " const char *key,\n"
10438 #: ../src/guestfs-actions.pod:3518 ../fish/guestfish-actions.pod:2410
10440 "This command erases existing data on C<device> and formats the device as a "
10441 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10442 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10446 #: ../src/guestfs-actions.pod:3525 ../src/guestfs-actions.pod:3548
10447 #: ../src/guestfs-actions.pod:3688 ../src/guestfs-actions.pod:4548
10448 #: ../src/guestfs-actions.pod:5311 ../src/guestfs-actions.pod:5686
10449 #: ../src/guestfs-actions.pod:5709 ../src/guestfs-actions.pod:5735
10450 #: ../src/guestfs-actions.pod:6885 ../fish/guestfish-actions.pod:2418
10451 #: ../fish/guestfish-actions.pod:2431 ../fish/guestfish-actions.pod:2515
10452 #: ../fish/guestfish-actions.pod:3045 ../fish/guestfish-actions.pod:3552
10453 #: ../fish/guestfish-actions.pod:3832 ../fish/guestfish-actions.pod:3848
10454 #: ../fish/guestfish-actions.pod:3863 ../fish/guestfish-actions.pod:4578
10456 "B<This command is dangerous. Without careful use you can easily destroy all "
10461 #: ../src/guestfs-actions.pod:3534
10462 msgid "guestfs_luks_format_cipher"
10466 #: ../src/guestfs-actions.pod:3536
10470 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10471 " const char *device,\n"
10472 " const char *key,\n"
10474 " const char *cipher);\n"
10479 #: ../src/guestfs-actions.pod:3543
10481 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10482 "set the C<cipher> used."
10486 #: ../src/guestfs-actions.pod:3557
10487 msgid "guestfs_luks_kill_slot"
10491 #: ../src/guestfs-actions.pod:3559
10495 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10496 " const char *device,\n"
10497 " const char *key,\n"
10503 #: ../src/guestfs-actions.pod:3565 ../fish/guestfish-actions.pod:2438
10505 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10506 "device C<device>. C<key> must be one of the I<other> keys."
10510 #: ../src/guestfs-actions.pod:3577
10511 msgid "guestfs_luks_open"
10515 #: ../src/guestfs-actions.pod:3579
10519 " guestfs_luks_open (guestfs_h *g,\n"
10520 " const char *device,\n"
10521 " const char *key,\n"
10522 " const char *mapname);\n"
10527 #: ../src/guestfs-actions.pod:3585 ../fish/guestfish-actions.pod:2449
10529 "This command opens a block device which has been encrypted according to the "
10530 "Linux Unified Key Setup (LUKS) standard."
10534 #: ../src/guestfs-actions.pod:3588 ../fish/guestfish-actions.pod:2452
10535 msgid "C<device> is the encrypted block device or partition."
10539 #: ../src/guestfs-actions.pod:3590 ../fish/guestfish-actions.pod:2454
10541 "The caller must supply one of the keys associated with the LUKS block "
10542 "device, in the C<key> parameter."
10546 #: ../src/guestfs-actions.pod:3593 ../fish/guestfish-actions.pod:2457
10548 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10549 "writes to this block device are decrypted from and encrypted to the "
10550 "underlying C<device> respectively."
10554 #: ../src/guestfs-actions.pod:3597
10556 "If this block device contains LVM volume groups, then calling "
10557 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10562 #: ../src/guestfs-actions.pod:3609
10563 msgid "guestfs_luks_open_ro"
10567 #: ../src/guestfs-actions.pod:3611
10571 " guestfs_luks_open_ro (guestfs_h *g,\n"
10572 " const char *device,\n"
10573 " const char *key,\n"
10574 " const char *mapname);\n"
10579 #: ../src/guestfs-actions.pod:3617
10581 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10586 #: ../src/guestfs-actions.pod:3628
10587 msgid "guestfs_lvcreate"
10591 #: ../src/guestfs-actions.pod:3630
10595 " guestfs_lvcreate (guestfs_h *g,\n"
10596 " const char *logvol,\n"
10597 " const char *volgroup,\n"
10603 #: ../src/guestfs-actions.pod:3636 ../fish/guestfish-actions.pod:2482
10605 "This creates an LVM logical volume called C<logvol> on the volume group "
10606 "C<volgroup>, with C<size> megabytes."
10610 #: ../src/guestfs-actions.pod:3643
10611 msgid "guestfs_lvm_canonical_lv_name"
10615 #: ../src/guestfs-actions.pod:3645
10619 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10620 " const char *lvname);\n"
10625 #: ../src/guestfs-actions.pod:3649 ../fish/guestfish-actions.pod:2489
10627 "This converts alternative naming schemes for LVs that you might find to the "
10628 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10633 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2493
10635 "This command returns an error if the C<lvname> parameter does not refer to a "
10640 #: ../src/guestfs-actions.pod:3656
10641 msgid "See also C<guestfs_is_lv>."
10645 #: ../src/guestfs-actions.pod:3661
10646 msgid "(Added in 1.5.24)"
10650 #: ../src/guestfs-actions.pod:3663
10651 msgid "guestfs_lvm_clear_filter"
10655 #: ../src/guestfs-actions.pod:3665
10659 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10664 #: ../src/guestfs-actions.pod:3668
10666 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10667 "see every block device."
10671 #: ../src/guestfs-actions.pod:3671 ../src/guestfs-actions.pod:3713
10672 #: ../fish/guestfish-actions.pod:2505 ../fish/guestfish-actions.pod:2536
10674 "This command also clears the LVM cache and performs a volume group scan."
10678 #: ../src/guestfs-actions.pod:3678
10679 msgid "guestfs_lvm_remove_all"
10683 #: ../src/guestfs-actions.pod:3680
10687 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10692 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2512
10694 "This command removes all LVM logical volumes, volume groups and physical "
10699 #: ../src/guestfs-actions.pod:3693
10700 msgid "guestfs_lvm_set_filter"
10704 #: ../src/guestfs-actions.pod:3695
10708 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10709 " char *const *devices);\n"
10714 #: ../src/guestfs-actions.pod:3699 ../fish/guestfish-actions.pod:2522
10716 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10717 "block devices in the list C<devices>, and will ignore all other attached "
10722 #: ../src/guestfs-actions.pod:3703 ../fish/guestfish-actions.pod:2526
10724 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10725 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10726 "there are two types of duplication possible: either cloned PVs/VGs which "
10727 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10728 "same name. In normal operation you cannot create this situation, but you "
10729 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10730 "inside the LVM metadata."
10734 #: ../src/guestfs-actions.pod:3716 ../fish/guestfish-actions.pod:2539
10735 msgid "You can filter whole block devices or individual partitions."
10739 #: ../src/guestfs-actions.pod:3718 ../fish/guestfish-actions.pod:2541
10741 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10742 "filesystem), even if you are not filtering out that VG."
10746 #: ../src/guestfs-actions.pod:3726
10747 msgid "guestfs_lvremove"
10751 #: ../src/guestfs-actions.pod:3728
10755 " guestfs_lvremove (guestfs_h *g,\n"
10756 " const char *device);\n"
10761 #: ../src/guestfs-actions.pod:3732 ../fish/guestfish-actions.pod:2549
10763 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10764 "LV, such as C</dev/VG/LV>."
10768 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2552
10770 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10775 #: ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:4894
10776 #: ../src/guestfs-actions.pod:6624
10777 msgid "(Added in 1.0.13)"
10781 #: ../src/guestfs-actions.pod:3742
10782 msgid "guestfs_lvrename"
10786 #: ../src/guestfs-actions.pod:3744
10790 " guestfs_lvrename (guestfs_h *g,\n"
10791 " const char *logvol,\n"
10792 " const char *newlogvol);\n"
10797 #: ../src/guestfs-actions.pod:3749 ../fish/guestfish-actions.pod:2559
10798 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10802 #: ../src/guestfs-actions.pod:3753 ../src/guestfs-actions.pod:6637
10803 msgid "(Added in 1.0.83)"
10807 #: ../src/guestfs-actions.pod:3755
10808 msgid "guestfs_lvresize"
10812 #: ../src/guestfs-actions.pod:3757
10816 " guestfs_lvresize (guestfs_h *g,\n"
10817 " const char *device,\n"
10823 #: ../src/guestfs-actions.pod:3762 ../fish/guestfish-actions.pod:2565
10825 "This resizes (expands or shrinks) an existing LVM logical volume to "
10826 "C<mbytes>. When reducing, data in the reduced part is lost."
10830 #: ../src/guestfs-actions.pod:3770
10831 msgid "guestfs_lvresize_free"
10835 #: ../src/guestfs-actions.pod:3772
10839 " guestfs_lvresize_free (guestfs_h *g,\n"
10840 " const char *lv,\n"
10846 #: ../src/guestfs-actions.pod:3777 ../fish/guestfish-actions.pod:2573
10848 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10849 "remaining free space in the volume group. Commonly you would call this with "
10850 "pc = 100 which expands the logical volume as much as possible, using all "
10851 "remaining free space in the volume group."
10855 #: ../src/guestfs-actions.pod:3785
10856 msgid "(Added in 1.3.3)"
10860 #: ../src/guestfs-actions.pod:3787
10861 msgid "guestfs_lvs"
10865 #: ../src/guestfs-actions.pod:3789
10869 " guestfs_lvs (guestfs_h *g);\n"
10874 #: ../src/guestfs-actions.pod:3792 ../fish/guestfish-actions.pod:2583
10876 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10881 #: ../src/guestfs-actions.pod:3795 ../fish/guestfish-actions.pod:2586
10883 "This returns a list of the logical volume device names (eg. C</dev/"
10884 "VolGroup00/LogVol00>)."
10888 #: ../src/guestfs-actions.pod:3798
10889 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
10893 #: ../src/guestfs-actions.pod:3806
10894 msgid "guestfs_lvs_full"
10898 #: ../src/guestfs-actions.pod:3808
10901 " struct guestfs_lvm_lv_list *\n"
10902 " guestfs_lvs_full (guestfs_h *g);\n"
10907 #: ../src/guestfs-actions.pod:3811 ../fish/guestfish-actions.pod:2595
10909 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10910 "(8)> command. The \"full\" version includes all fields."
10914 #: ../src/guestfs-actions.pod:3814
10916 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
10917 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
10921 #: ../src/guestfs-actions.pod:3820
10922 msgid "guestfs_lvuuid"
10926 #: ../src/guestfs-actions.pod:3822
10930 " guestfs_lvuuid (guestfs_h *g,\n"
10931 " const char *device);\n"
10936 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2602
10937 msgid "This command returns the UUID of the LVM LV C<device>."
10941 #: ../src/guestfs-actions.pod:3833
10942 msgid "guestfs_lxattrlist"
10946 #: ../src/guestfs-actions.pod:3835
10949 " struct guestfs_xattr_list *\n"
10950 " guestfs_lxattrlist (guestfs_h *g,\n"
10951 " const char *path,\n"
10952 " char *const *names);\n"
10957 #: ../src/guestfs-actions.pod:3840 ../fish/guestfish-actions.pod:2608
10959 "This call allows you to get the extended attributes of multiple files, where "
10960 "all files are in the directory C<path>. C<names> is the list of files from "
10965 #: ../src/guestfs-actions.pod:3844 ../fish/guestfish-actions.pod:2612
10967 "On return you get a flat list of xattr structs which must be interpreted "
10968 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10969 "C<attrval> in this struct is zero-length to indicate there was an error "
10970 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10971 "number (the number of following attributes for this file, which could be C<"
10972 "\"0\">). Then after the first xattr struct are the zero or more attributes "
10973 "for the first named file. This repeats for the second and subsequent files."
10977 #: ../src/guestfs-actions.pod:3854
10979 "This call is intended for programs that want to efficiently list a directory "
10980 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
10981 "a similarly efficient call for getting standard stats. Very long directory "
10982 "listings might cause the protocol message size to be exceeded, causing this "
10983 "call to fail. The caller must split up such requests into smaller groups of "
10988 #: ../src/guestfs-actions.pod:3868
10989 msgid "guestfs_mkdir"
10993 #: ../src/guestfs-actions.pod:3870
10997 " guestfs_mkdir (guestfs_h *g,\n"
10998 " const char *path);\n"
11003 #: ../src/guestfs-actions.pod:3874 ../fish/guestfish-actions.pod:2634
11004 msgid "Create a directory named C<path>."
11008 #: ../src/guestfs-actions.pod:3880
11009 msgid "guestfs_mkdir_mode"
11013 #: ../src/guestfs-actions.pod:3882
11017 " guestfs_mkdir_mode (guestfs_h *g,\n"
11018 " const char *path,\n"
11024 #: ../src/guestfs-actions.pod:3887 ../fish/guestfish-actions.pod:2640
11026 "This command creates a directory, setting the initial permissions of the "
11027 "directory to C<mode>."
11031 #: ../src/guestfs-actions.pod:3890 ../fish/guestfish-actions.pod:2643
11033 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11034 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11039 #: ../src/guestfs-actions.pod:3894
11040 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11044 #: ../src/guestfs-actions.pod:3900
11045 msgid "guestfs_mkdir_p"
11049 #: ../src/guestfs-actions.pod:3902
11053 " guestfs_mkdir_p (guestfs_h *g,\n"
11054 " const char *path);\n"
11059 #: ../src/guestfs-actions.pod:3906 ../fish/guestfish-actions.pod:2653
11061 "Create a directory named C<path>, creating any parent directories as "
11062 "necessary. This is like the C<mkdir -p> shell command."
11066 #: ../src/guestfs-actions.pod:3913
11067 msgid "guestfs_mkdtemp"
11071 #: ../src/guestfs-actions.pod:3915
11075 " guestfs_mkdtemp (guestfs_h *g,\n"
11076 " const char *template);\n"
11081 #: ../src/guestfs-actions.pod:3919 ../fish/guestfish-actions.pod:2660
11083 "This command creates a temporary directory. The C<template> parameter "
11084 "should be a full pathname for the temporary directory name with the final "
11085 "six characters being \"XXXXXX\"."
11089 #: ../src/guestfs-actions.pod:3924 ../fish/guestfish-actions.pod:2665
11091 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11092 "being suitable for Windows filesystems."
11096 #: ../src/guestfs-actions.pod:3927 ../fish/guestfish-actions.pod:2668
11097 msgid "The name of the temporary directory that was created is returned."
11101 #: ../src/guestfs-actions.pod:3930 ../fish/guestfish-actions.pod:2671
11102 msgid "The temporary directory is created with mode 0700 and is owned by root."
11106 #: ../src/guestfs-actions.pod:3933 ../fish/guestfish-actions.pod:2674
11108 "The caller is responsible for deleting the temporary directory and its "
11109 "contents after use."
11113 #: ../src/guestfs-actions.pod:3936 ../fish/guestfish-actions.pod:2677
11114 msgid "See also: L<mkdtemp(3)>"
11118 #: ../src/guestfs-actions.pod:3943
11119 msgid "guestfs_mke2fs_J"
11123 #: ../src/guestfs-actions.pod:3945
11127 " guestfs_mke2fs_J (guestfs_h *g,\n"
11128 " const char *fstype,\n"
11129 " int blocksize,\n"
11130 " const char *device,\n"
11131 " const char *journal);\n"
11136 #: ../src/guestfs-actions.pod:3952 ../fish/guestfish-actions.pod:2683
11138 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11139 "C<journal>. It is equivalent to the command:"
11143 #: ../src/guestfs-actions.pod:3956 ../fish/guestfish-actions.pod:2687
11146 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11151 #: ../src/guestfs-actions.pod:3958
11152 msgid "See also C<guestfs_mke2journal>."
11156 #: ../src/guestfs-actions.pod:3962 ../src/guestfs-actions.pod:3980
11157 #: ../src/guestfs-actions.pod:3998 ../src/guestfs-actions.pod:4014
11158 #: ../src/guestfs-actions.pod:4028 ../src/guestfs-actions.pod:4042
11159 #: ../src/guestfs-actions.pod:4094 ../src/guestfs-actions.pod:4284
11160 msgid "(Added in 1.0.68)"
11164 #: ../src/guestfs-actions.pod:3964
11165 msgid "guestfs_mke2fs_JL"
11169 #: ../src/guestfs-actions.pod:3966
11173 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11174 " const char *fstype,\n"
11175 " int blocksize,\n"
11176 " const char *device,\n"
11177 " const char *label);\n"
11182 #: ../src/guestfs-actions.pod:3973 ../fish/guestfish-actions.pod:2695
11184 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11185 "the journal labeled C<label>."
11189 #: ../src/guestfs-actions.pod:3976
11190 msgid "See also C<guestfs_mke2journal_L>."
11194 #: ../src/guestfs-actions.pod:3982
11195 msgid "guestfs_mke2fs_JU"
11199 #: ../src/guestfs-actions.pod:3984
11203 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11204 " const char *fstype,\n"
11205 " int blocksize,\n"
11206 " const char *device,\n"
11207 " const char *uuid);\n"
11212 #: ../src/guestfs-actions.pod:3991 ../fish/guestfish-actions.pod:2704
11214 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11215 "the journal with UUID C<uuid>."
11219 #: ../src/guestfs-actions.pod:3994
11220 msgid "See also C<guestfs_mke2journal_U>."
11224 #: ../src/guestfs-actions.pod:4000
11225 msgid "guestfs_mke2journal"
11229 #: ../src/guestfs-actions.pod:4002
11233 " guestfs_mke2journal (guestfs_h *g,\n"
11234 " int blocksize,\n"
11235 " const char *device);\n"
11240 #: ../src/guestfs-actions.pod:4007 ../fish/guestfish-actions.pod:2713
11242 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11247 #: ../src/guestfs-actions.pod:4010 ../fish/guestfish-actions.pod:2716
11250 " mke2fs -O journal_dev -b blocksize device\n"
11255 #: ../src/guestfs-actions.pod:4016
11256 msgid "guestfs_mke2journal_L"
11260 #: ../src/guestfs-actions.pod:4018
11264 " guestfs_mke2journal_L (guestfs_h *g,\n"
11265 " int blocksize,\n"
11266 " const char *label,\n"
11267 " const char *device);\n"
11272 #: ../src/guestfs-actions.pod:4024 ../fish/guestfish-actions.pod:2722
11273 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11277 #: ../src/guestfs-actions.pod:4030
11278 msgid "guestfs_mke2journal_U"
11282 #: ../src/guestfs-actions.pod:4032
11286 " guestfs_mke2journal_U (guestfs_h *g,\n"
11287 " int blocksize,\n"
11288 " const char *uuid,\n"
11289 " const char *device);\n"
11294 #: ../src/guestfs-actions.pod:4038 ../fish/guestfish-actions.pod:2728
11295 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11299 #: ../src/guestfs-actions.pod:4044
11300 msgid "guestfs_mkfifo"
11304 #: ../src/guestfs-actions.pod:4046
11308 " guestfs_mkfifo (guestfs_h *g,\n"
11310 " const char *path);\n"
11315 #: ../src/guestfs-actions.pod:4051
11317 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11318 "is just a convenient wrapper around C<guestfs_mknod>."
11322 #: ../src/guestfs-actions.pod:4061
11323 msgid "guestfs_mkfs"
11327 #: ../src/guestfs-actions.pod:4063
11331 " guestfs_mkfs (guestfs_h *g,\n"
11332 " const char *fstype,\n"
11333 " const char *device);\n"
11338 #: ../src/guestfs-actions.pod:4068 ../fish/guestfish-actions.pod:2744
11340 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11341 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11345 #: ../src/guestfs-actions.pod:4076
11346 msgid "guestfs_mkfs_b"
11350 #: ../src/guestfs-actions.pod:4078
11354 " guestfs_mkfs_b (guestfs_h *g,\n"
11355 " const char *fstype,\n"
11356 " int blocksize,\n"
11357 " const char *device);\n"
11362 #: ../src/guestfs-actions.pod:4084
11364 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11365 "block size of the resulting filesystem. Supported block sizes depend on the "
11366 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11370 #: ../src/guestfs-actions.pod:4089 ../fish/guestfish-actions.pod:2757
11372 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11377 #: ../src/guestfs-actions.pod:4096
11378 msgid "guestfs_mkmountpoint"
11382 #: ../src/guestfs-actions.pod:4098
11386 " guestfs_mkmountpoint (guestfs_h *g,\n"
11387 " const char *exemptpath);\n"
11392 #: ../src/guestfs-actions.pod:4102
11394 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11395 "that can be used to create extra mountpoints before mounting the first "
11400 #: ../src/guestfs-actions.pod:4106 ../fish/guestfish-actions.pod:2768
11402 "These calls are I<only> necessary in some very limited circumstances, mainly "
11403 "the case where you want to mount a mix of unrelated and/or read-only "
11404 "filesystems together."
11408 #: ../src/guestfs-actions.pod:4110 ../fish/guestfish-actions.pod:2772
11410 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11411 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11412 "inside that. You can unpack this as follows in guestfish:"
11416 #: ../src/guestfs-actions.pod:4115 ../fish/guestfish-actions.pod:2777
11419 " add-ro Fedora-11-i686-Live.iso\n"
11421 " mkmountpoint /cd\n"
11422 " mkmountpoint /sqsh\n"
11423 " mkmountpoint /ext3fs\n"
11424 " mount /dev/sda /cd\n"
11425 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11426 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11431 #: ../src/guestfs-actions.pod:4124 ../fish/guestfish-actions.pod:2786
11432 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11436 #: ../src/guestfs-actions.pod:4126
11438 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11439 "may get unexpected errors if you try to mix these calls. It is safest to "
11440 "manually unmount filesystems and remove mountpoints after use."
11444 #: ../src/guestfs-actions.pod:4130
11446 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11447 "first, so for this to work for manual mountpoints, you must ensure that the "
11448 "innermost mountpoints have the longest pathnames, as in the example code "
11453 #: ../src/guestfs-actions.pod:4135 ../fish/guestfish-actions.pod:2797
11455 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11459 #: ../src/guestfs-actions.pod:4137
11461 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11462 "means that C<guestfs_umount_all> is called when the handle is closed which "
11463 "can also trigger these issues."
11467 #: ../src/guestfs-actions.pod:4143 ../src/guestfs-actions.pod:4402
11468 #: ../src/guestfs-actions.pod:5295
11469 msgid "(Added in 1.0.62)"
11473 #: ../src/guestfs-actions.pod:4145
11474 msgid "guestfs_mknod"
11478 #: ../src/guestfs-actions.pod:4147
11482 " guestfs_mknod (guestfs_h *g,\n"
11486 " const char *path);\n"
11491 #: ../src/guestfs-actions.pod:4154 ../fish/guestfish-actions.pod:2807
11493 "This call creates block or character special devices, or named pipes (FIFOs)."
11497 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:2810
11499 "The C<mode> parameter should be the mode, using the standard constants. "
11500 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11501 "used when creating block and character special devices."
11505 #: ../src/guestfs-actions.pod:4162
11507 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11508 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11509 "regular file). These constants are available in the standard Linux header "
11510 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11511 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11512 "the appropriate constant for you."
11516 #: ../src/guestfs-actions.pod:4176
11517 msgid "guestfs_mknod_b"
11521 #: ../src/guestfs-actions.pod:4178
11525 " guestfs_mknod_b (guestfs_h *g,\n"
11529 " const char *path);\n"
11534 #: ../src/guestfs-actions.pod:4185
11536 "This call creates a block device node called C<path> with mode C<mode> and "
11537 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11538 "wrapper around C<guestfs_mknod>."
11542 #: ../src/guestfs-actions.pod:4195
11543 msgid "guestfs_mknod_c"
11547 #: ../src/guestfs-actions.pod:4197
11551 " guestfs_mknod_c (guestfs_h *g,\n"
11555 " const char *path);\n"
11560 #: ../src/guestfs-actions.pod:4204
11562 "This call creates a char device node called C<path> with mode C<mode> and "
11563 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11564 "wrapper around C<guestfs_mknod>."
11568 #: ../src/guestfs-actions.pod:4214
11569 msgid "guestfs_mkswap"
11573 #: ../src/guestfs-actions.pod:4216
11577 " guestfs_mkswap (guestfs_h *g,\n"
11578 " const char *device);\n"
11583 #: ../src/guestfs-actions.pod:4220 ../fish/guestfish-actions.pod:2849
11584 msgid "Create a swap partition on C<device>."
11588 #: ../src/guestfs-actions.pod:4226
11589 msgid "guestfs_mkswap_L"
11593 #: ../src/guestfs-actions.pod:4228
11597 " guestfs_mkswap_L (guestfs_h *g,\n"
11598 " const char *label,\n"
11599 " const char *device);\n"
11604 #: ../src/guestfs-actions.pod:4233 ../fish/guestfish-actions.pod:2855
11605 msgid "Create a swap partition on C<device> with label C<label>."
11609 #: ../src/guestfs-actions.pod:4235 ../fish/guestfish-actions.pod:2857
11611 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11612 "sda>), just to a partition. This appears to be a limitation of the kernel "
11617 #: ../src/guestfs-actions.pod:4243
11618 msgid "guestfs_mkswap_U"
11622 #: ../src/guestfs-actions.pod:4245
11626 " guestfs_mkswap_U (guestfs_h *g,\n"
11627 " const char *uuid,\n"
11628 " const char *device);\n"
11633 #: ../src/guestfs-actions.pod:4250 ../fish/guestfish-actions.pod:2865
11634 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11638 #: ../src/guestfs-actions.pod:4256
11639 msgid "guestfs_mkswap_file"
11643 #: ../src/guestfs-actions.pod:4258
11647 " guestfs_mkswap_file (guestfs_h *g,\n"
11648 " const char *path);\n"
11653 #: ../src/guestfs-actions.pod:4262 ../fish/guestfish-actions.pod:2871
11654 msgid "Create a swap file."
11658 #: ../src/guestfs-actions.pod:4264
11660 "This command just writes a swap file signature to an existing file. To "
11661 "create the file itself, use something like C<guestfs_fallocate>."
11665 #: ../src/guestfs-actions.pod:4271
11666 msgid "guestfs_modprobe"
11670 #: ../src/guestfs-actions.pod:4273
11674 " guestfs_modprobe (guestfs_h *g,\n"
11675 " const char *modulename);\n"
11680 #: ../src/guestfs-actions.pod:4277 ../fish/guestfish-actions.pod:2880
11681 msgid "This loads a kernel module in the appliance."
11685 #: ../src/guestfs-actions.pod:4279 ../fish/guestfish-actions.pod:2882
11687 "The kernel module must have been whitelisted when libguestfs was built (see "
11688 "C<appliance/kmod.whitelist.in> in the source)."
11692 #: ../src/guestfs-actions.pod:4286
11693 msgid "guestfs_mount"
11697 #: ../src/guestfs-actions.pod:4288
11701 " guestfs_mount (guestfs_h *g,\n"
11702 " const char *device,\n"
11703 " const char *mountpoint);\n"
11708 #: ../src/guestfs-actions.pod:4293 ../fish/guestfish-actions.pod:2889
11710 "Mount a guest disk at a position in the filesystem. Block devices are named "
11711 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11712 "those block devices contain partitions, they will have the usual names (eg. "
11713 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11717 #: ../src/guestfs-actions.pod:4299 ../fish/guestfish-actions.pod:2895
11719 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11720 "mounted on C</> before others can be mounted. Other filesystems can only be "
11721 "mounted on directories which already exist."
11725 #: ../src/guestfs-actions.pod:4304 ../fish/guestfish-actions.pod:2900
11727 "The mounted filesystem is writable, if we have sufficient permissions on the "
11728 "underlying device."
11732 #: ../src/guestfs-actions.pod:4307
11734 "B<Important note:> When you use this call, the filesystem options C<sync> "
11735 "and C<noatime> are set implicitly. This was originally done because we "
11736 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11737 "very large negative performance impact and negligible effect on "
11738 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
11739 "in any code that needs performance, and instead use C<guestfs_mount_options> "
11740 "(use an empty string for the first parameter if you don't want any options)."
11744 #: ../src/guestfs-actions.pod:4321
11745 msgid "guestfs_mount_loop"
11749 #: ../src/guestfs-actions.pod:4323
11753 " guestfs_mount_loop (guestfs_h *g,\n"
11754 " const char *file,\n"
11755 " const char *mountpoint);\n"
11760 #: ../src/guestfs-actions.pod:4328 ../fish/guestfish-actions.pod:2917
11762 "This command lets you mount C<file> (a filesystem image in a file) on a "
11763 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11768 #: ../src/guestfs-actions.pod:4336
11769 msgid "guestfs_mount_options"
11773 #: ../src/guestfs-actions.pod:4338
11777 " guestfs_mount_options (guestfs_h *g,\n"
11778 " const char *options,\n"
11779 " const char *device,\n"
11780 " const char *mountpoint);\n"
11785 #: ../src/guestfs-actions.pod:4344
11787 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11788 "the mount options as for the L<mount(8)> I<-o> flag."
11792 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:2929
11794 "If the C<options> parameter is an empty string, then no options are passed "
11795 "(all options default to whatever the filesystem uses)."
11799 #: ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:4368
11800 #: ../src/guestfs-actions.pod:4385
11801 msgid "(Added in 1.0.10)"
11805 #: ../src/guestfs-actions.pod:4356
11806 msgid "guestfs_mount_ro"
11810 #: ../src/guestfs-actions.pod:4358
11814 " guestfs_mount_ro (guestfs_h *g,\n"
11815 " const char *device,\n"
11816 " const char *mountpoint);\n"
11821 #: ../src/guestfs-actions.pod:4363
11823 "This is the same as the C<guestfs_mount> command, but it mounts the "
11824 "filesystem with the read-only (I<-o ro>) flag."
11828 #: ../src/guestfs-actions.pod:4370
11829 msgid "guestfs_mount_vfs"
11833 #: ../src/guestfs-actions.pod:4372
11837 " guestfs_mount_vfs (guestfs_h *g,\n"
11838 " const char *options,\n"
11839 " const char *vfstype,\n"
11840 " const char *device,\n"
11841 " const char *mountpoint);\n"
11846 #: ../src/guestfs-actions.pod:4379
11848 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11849 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
11854 #: ../src/guestfs-actions.pod:4387
11855 msgid "guestfs_mountpoints"
11859 #: ../src/guestfs-actions.pod:4389
11863 " guestfs_mountpoints (guestfs_h *g);\n"
11868 #: ../src/guestfs-actions.pod:4392
11870 "This call is similar to C<guestfs_mounts>. That call returns a list of "
11871 "devices. This one returns a hash table (map) of device name to directory "
11872 "where the device is mounted."
11876 #: ../src/guestfs-actions.pod:4404
11877 msgid "guestfs_mounts"
11881 #: ../src/guestfs-actions.pod:4406
11885 " guestfs_mounts (guestfs_h *g);\n"
11890 #: ../src/guestfs-actions.pod:4409 ../fish/guestfish-actions.pod:2960
11892 "This returns the list of currently mounted filesystems. It returns the list "
11893 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11897 #: ../src/guestfs-actions.pod:4412 ../fish/guestfish-actions.pod:2963
11898 msgid "Some internal mounts are not shown."
11902 #: ../src/guestfs-actions.pod:4414
11903 msgid "See also: C<guestfs_mountpoints>"
11907 #: ../src/guestfs-actions.pod:4422
11912 #: ../src/guestfs-actions.pod:4424
11916 " guestfs_mv (guestfs_h *g,\n"
11917 " const char *src,\n"
11918 " const char *dest);\n"
11923 #: ../src/guestfs-actions.pod:4429 ../fish/guestfish-actions.pod:2971
11925 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11926 "destination filename or destination directory."
11930 #: ../src/guestfs-actions.pod:4436
11931 msgid "guestfs_ntfs_3g_probe"
11935 #: ../src/guestfs-actions.pod:4438
11939 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
11941 " const char *device);\n"
11946 #: ../src/guestfs-actions.pod:4443 ../fish/guestfish-actions.pod:2978
11948 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11949 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11950 "write, and some cannot be mounted at all)."
11954 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:2982
11956 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11957 "can be mounted read-write. Set it to false if you want to test if the "
11958 "volume can be mounted read-only."
11962 #: ../src/guestfs-actions.pod:4451 ../fish/guestfish-actions.pod:2986
11964 "The return value is an integer which C<0> if the operation would succeed, or "
11965 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11969 #: ../src/guestfs-actions.pod:4457
11970 msgid "(Added in 1.0.43)"
11974 #: ../src/guestfs-actions.pod:4459
11975 msgid "guestfs_ntfsresize"
11979 #: ../src/guestfs-actions.pod:4461
11983 " guestfs_ntfsresize (guestfs_h *g,\n"
11984 " const char *device);\n"
11989 #: ../src/guestfs-actions.pod:4465 ../fish/guestfish-actions.pod:2994
11991 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11992 "size of the underlying device. See also L<ntfsresize(8)>."
11996 #: ../src/guestfs-actions.pod:4473
11997 msgid "guestfs_ntfsresize_size"
12001 #: ../src/guestfs-actions.pod:4475
12005 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12006 " const char *device,\n"
12007 " int64_t size);\n"
12012 #: ../src/guestfs-actions.pod:4480
12014 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12015 "to specify the new size (in bytes) explicitly."
12019 #: ../src/guestfs-actions.pod:4485 ../src/guestfs-actions.pod:4921
12020 #: ../src/guestfs-actions.pod:4994 ../src/guestfs-actions.pod:5243
12021 msgid "(Added in 1.3.14)"
12025 #: ../src/guestfs-actions.pod:4487
12026 msgid "guestfs_part_add"
12030 #: ../src/guestfs-actions.pod:4489
12034 " guestfs_part_add (guestfs_h *g,\n"
12035 " const char *device,\n"
12036 " const char *prlogex,\n"
12037 " int64_t startsect,\n"
12038 " int64_t endsect);\n"
12043 #: ../src/guestfs-actions.pod:4496
12045 "This command adds a partition to C<device>. If there is no partition table "
12046 "on the device, call C<guestfs_part_init> first."
12050 #: ../src/guestfs-actions.pod:4499 ../fish/guestfish-actions.pod:3012
12052 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12053 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12054 "C<logical>) and C<e> (or C<extended>) partition types."
12058 #: ../src/guestfs-actions.pod:4504 ../fish/guestfish-actions.pod:3017
12060 "C<startsect> and C<endsect> are the start and end of the partition in "
12061 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12062 "from the end of the disk (C<-1> is the last sector)."
12066 #: ../src/guestfs-actions.pod:4508
12068 "Creating a partition which covers the whole disk is not so easy. Use "
12069 "C<guestfs_part_disk> to do that."
12073 #: ../src/guestfs-actions.pod:4513 ../src/guestfs-actions.pod:4551
12074 #: ../src/guestfs-actions.pod:4604 ../src/guestfs-actions.pod:4682
12075 #: ../src/guestfs-actions.pod:4720 ../src/guestfs-actions.pod:4739
12076 #: ../src/guestfs-actions.pod:4779
12077 msgid "(Added in 1.0.78)"
12081 #: ../src/guestfs-actions.pod:4515
12082 msgid "guestfs_part_del"
12086 #: ../src/guestfs-actions.pod:4517
12090 " guestfs_part_del (guestfs_h *g,\n"
12091 " const char *device,\n"
12097 #: ../src/guestfs-actions.pod:4522 ../fish/guestfish-actions.pod:3028
12098 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12102 #: ../src/guestfs-actions.pod:4524 ../fish/guestfish-actions.pod:3030
12104 "Note that in the case of MBR partitioning, deleting an extended partition "
12105 "also deletes any logical partitions it contains."
12109 #: ../src/guestfs-actions.pod:4532
12110 msgid "guestfs_part_disk"
12114 #: ../src/guestfs-actions.pod:4534
12118 " guestfs_part_disk (guestfs_h *g,\n"
12119 " const char *device,\n"
12120 " const char *parttype);\n"
12125 #: ../src/guestfs-actions.pod:4539
12127 "This command is simply a combination of C<guestfs_part_init> followed by "
12128 "C<guestfs_part_add> to create a single primary partition covering the whole "
12133 #: ../src/guestfs-actions.pod:4543
12135 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12136 "possible values are described in C<guestfs_part_init>."
12140 #: ../src/guestfs-actions.pod:4553
12141 msgid "guestfs_part_get_bootable"
12145 #: ../src/guestfs-actions.pod:4555
12149 " guestfs_part_get_bootable (guestfs_h *g,\n"
12150 " const char *device,\n"
12156 #: ../src/guestfs-actions.pod:4560 ../fish/guestfish-actions.pod:3052
12158 "This command returns true if the partition C<partnum> on C<device> has the "
12159 "bootable flag set."
12163 #: ../src/guestfs-actions.pod:4563
12164 msgid "See also C<guestfs_part_set_bootable>."
12168 #: ../src/guestfs-actions.pod:4569
12169 msgid "guestfs_part_get_mbr_id"
12173 #: ../src/guestfs-actions.pod:4571
12177 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12178 " const char *device,\n"
12184 #: ../src/guestfs-actions.pod:4576 ../fish/guestfish-actions.pod:3061
12186 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12187 "partition C<partnum>."
12191 #: ../src/guestfs-actions.pod:4579 ../src/guestfs-actions.pod:4755
12193 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12194 "undefined results for other partition table types (see "
12195 "C<guestfs_part_get_parttype>)."
12199 #: ../src/guestfs-actions.pod:4587
12200 msgid "guestfs_part_get_parttype"
12204 #: ../src/guestfs-actions.pod:4589
12208 " guestfs_part_get_parttype (guestfs_h *g,\n"
12209 " const char *device);\n"
12214 #: ../src/guestfs-actions.pod:4593 ../fish/guestfish-actions.pod:3072
12216 "This command examines the partition table on C<device> and returns the "
12217 "partition table type (format) being used."
12221 #: ../src/guestfs-actions.pod:4596
12223 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12224 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12225 "possible, although unusual. See C<guestfs_part_init> for a full list."
12229 #: ../src/guestfs-actions.pod:4606
12230 msgid "guestfs_part_init"
12234 #: ../src/guestfs-actions.pod:4608
12238 " guestfs_part_init (guestfs_h *g,\n"
12239 " const char *device,\n"
12240 " const char *parttype);\n"
12245 #: ../src/guestfs-actions.pod:4613 ../fish/guestfish-actions.pod:3084
12247 "This creates an empty partition table on C<device> of one of the partition "
12248 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12249 "(for large disks)."
12253 #: ../src/guestfs-actions.pod:4617
12255 "Initially there are no partitions. Following this, you should call "
12256 "C<guestfs_part_add> for each partition required."
12260 #: ../src/guestfs-actions.pod:4620 ../fish/guestfish-actions.pod:3091
12261 msgid "Possible values for C<parttype> are:"
12265 #: ../src/guestfs-actions.pod:4624 ../fish/guestfish-actions.pod:3095
12266 msgid "B<efi> | B<gpt>"
12270 #: ../src/guestfs-actions.pod:4626 ../fish/guestfish-actions.pod:3097
12271 msgid "Intel EFI / GPT partition table."
12275 #: ../src/guestfs-actions.pod:4628 ../fish/guestfish-actions.pod:3099
12277 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12278 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12279 "the C<mbr> format."
12283 #: ../src/guestfs-actions.pod:4632 ../fish/guestfish-actions.pod:3103
12284 msgid "B<mbr> | B<msdos>"
12288 #: ../src/guestfs-actions.pod:4634 ../fish/guestfish-actions.pod:3105
12290 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12291 "Windows. This partition type will B<only> work for device sizes up to 2 "
12292 "TB. For large disks we recommend using C<gpt>."
12296 #: ../src/guestfs-actions.pod:4641 ../fish/guestfish-actions.pod:3112
12298 "Other partition table types that may work but are not supported include:"
12302 #: ../src/guestfs-actions.pod:4646 ../fish/guestfish-actions.pod:3117
12307 #: ../src/guestfs-actions.pod:4648 ../fish/guestfish-actions.pod:3119
12308 msgid "AIX disk labels."
12312 #: ../src/guestfs-actions.pod:4650 ../fish/guestfish-actions.pod:3121
12313 msgid "B<amiga> | B<rdb>"
12317 #: ../src/guestfs-actions.pod:4652 ../fish/guestfish-actions.pod:3123
12318 msgid "Amiga \"Rigid Disk Block\" format."
12322 #: ../src/guestfs-actions.pod:4654 ../fish/guestfish-actions.pod:3125
12327 #: ../src/guestfs-actions.pod:4656 ../fish/guestfish-actions.pod:3127
12328 msgid "BSD disk labels."
12332 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3129
12337 #: ../src/guestfs-actions.pod:4660 ../fish/guestfish-actions.pod:3131
12338 msgid "DASD, used on IBM mainframes."
12342 #: ../src/guestfs-actions.pod:4662 ../fish/guestfish-actions.pod:3133
12347 #: ../src/guestfs-actions.pod:4664 ../fish/guestfish-actions.pod:3135
12348 msgid "MIPS/SGI volumes."
12352 #: ../src/guestfs-actions.pod:4666 ../fish/guestfish-actions.pod:3137
12357 #: ../src/guestfs-actions.pod:4668 ../fish/guestfish-actions.pod:3139
12358 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12362 #: ../src/guestfs-actions.pod:4670 ../fish/guestfish-actions.pod:3141
12367 #: ../src/guestfs-actions.pod:4672 ../fish/guestfish-actions.pod:3143
12368 msgid "NEC PC-98 format, common in Japan apparently."
12372 #: ../src/guestfs-actions.pod:4674 ../fish/guestfish-actions.pod:3145
12377 #: ../src/guestfs-actions.pod:4676 ../fish/guestfish-actions.pod:3147
12378 msgid "Sun disk labels."
12382 #: ../src/guestfs-actions.pod:4684
12383 msgid "guestfs_part_list"
12387 #: ../src/guestfs-actions.pod:4686
12390 " struct guestfs_partition_list *\n"
12391 " guestfs_part_list (guestfs_h *g,\n"
12392 " const char *device);\n"
12397 #: ../src/guestfs-actions.pod:4690 ../fish/guestfish-actions.pod:3155
12399 "This command parses the partition table on C<device> and returns the list of "
12400 "partitions found."
12404 #: ../src/guestfs-actions.pod:4693 ../fish/guestfish-actions.pod:3158
12405 msgid "The fields in the returned structure are:"
12409 #: ../src/guestfs-actions.pod:4697 ../fish/guestfish-actions.pod:3162
12410 msgid "B<part_num>"
12414 #: ../src/guestfs-actions.pod:4699 ../fish/guestfish-actions.pod:3164
12415 msgid "Partition number, counting from 1."
12419 #: ../src/guestfs-actions.pod:4701 ../fish/guestfish-actions.pod:3166
12420 msgid "B<part_start>"
12424 #: ../src/guestfs-actions.pod:4703
12426 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12427 "the device's sector size, see C<guestfs_blockdev_getss>."
12431 #: ../src/guestfs-actions.pod:4706 ../fish/guestfish-actions.pod:3171
12432 msgid "B<part_end>"
12436 #: ../src/guestfs-actions.pod:4708 ../fish/guestfish-actions.pod:3173
12437 msgid "End of the partition in bytes."
12441 #: ../src/guestfs-actions.pod:4710 ../fish/guestfish-actions.pod:3175
12442 msgid "B<part_size>"
12446 #: ../src/guestfs-actions.pod:4712 ../fish/guestfish-actions.pod:3177
12447 msgid "Size of the partition in bytes."
12451 #: ../src/guestfs-actions.pod:4716
12453 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12454 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12459 #: ../src/guestfs-actions.pod:4722
12460 msgid "guestfs_part_set_bootable"
12464 #: ../src/guestfs-actions.pod:4724
12468 " guestfs_part_set_bootable (guestfs_h *g,\n"
12469 " const char *device,\n"
12471 " int bootable);\n"
12476 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3185
12478 "This sets the bootable flag on partition numbered C<partnum> on device "
12479 "C<device>. Note that partitions are numbered from 1."
12483 #: ../src/guestfs-actions.pod:4733 ../fish/guestfish-actions.pod:3188
12485 "The bootable flag is used by some operating systems (notably Windows) to "
12486 "determine which partition to boot from. It is by no means universally "
12491 #: ../src/guestfs-actions.pod:4741
12492 msgid "guestfs_part_set_mbr_id"
12496 #: ../src/guestfs-actions.pod:4743
12500 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12501 " const char *device,\n"
12508 #: ../src/guestfs-actions.pod:4749 ../fish/guestfish-actions.pod:3196
12510 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12511 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12512 "documentation are in fact hexadecimal numbers, but usually documented "
12513 "without any leading \"0x\" which might be confusing."
12517 #: ../src/guestfs-actions.pod:4763
12518 msgid "guestfs_part_set_name"
12522 #: ../src/guestfs-actions.pod:4765
12526 " guestfs_part_set_name (guestfs_h *g,\n"
12527 " const char *device,\n"
12529 " const char *name);\n"
12534 #: ../src/guestfs-actions.pod:4771 ../fish/guestfish-actions.pod:3210
12536 "This sets the partition name on partition numbered C<partnum> on device "
12537 "C<device>. Note that partitions are numbered from 1."
12541 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3213
12543 "The partition name can only be set on certain types of partition table. "
12544 "This works on C<gpt> but not on C<mbr> partitions."
12548 #: ../src/guestfs-actions.pod:4781
12549 msgid "guestfs_part_to_dev"
12553 #: ../src/guestfs-actions.pod:4783
12557 " guestfs_part_to_dev (guestfs_h *g,\n"
12558 " const char *partition);\n"
12563 #: ../src/guestfs-actions.pod:4787 ../fish/guestfish-actions.pod:3220
12565 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12566 "partition number, returning the device name (eg. \"/dev/sdb\")."
12570 #: ../src/guestfs-actions.pod:4791
12572 "The named partition must exist, for example as a string returned from "
12573 "C<guestfs_list_partitions>."
12577 #: ../src/guestfs-actions.pod:4799
12578 msgid "guestfs_ping_daemon"
12582 #: ../src/guestfs-actions.pod:4801
12586 " guestfs_ping_daemon (guestfs_h *g);\n"
12591 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3231
12593 "This is a test probe into the guestfs daemon running inside the qemu "
12594 "subprocess. Calling this function checks that the daemon responds to the "
12595 "ping message, without affecting the daemon or attached block device(s) in "
12600 #: ../src/guestfs-actions.pod:4813
12601 msgid "guestfs_pread"
12605 #: ../src/guestfs-actions.pod:4815
12609 " guestfs_pread (guestfs_h *g,\n"
12610 " const char *path,\n"
12612 " int64_t offset,\n"
12613 " size_t *size_r);\n"
12618 #: ../src/guestfs-actions.pod:4822 ../fish/guestfish-actions.pod:3240
12620 "This command lets you read part of a file. It reads C<count> bytes of the "
12621 "file, starting at C<offset>, from file C<path>."
12625 #: ../src/guestfs-actions.pod:4825 ../src/guestfs-actions.pod:4851
12626 #: ../fish/guestfish-actions.pod:3243 ../fish/guestfish-actions.pod:3258
12628 "This may read fewer bytes than requested. For further details see the "
12629 "L<pread(2)> system call."
12633 #: ../src/guestfs-actions.pod:4828
12634 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12638 #: ../src/guestfs-actions.pod:4839
12639 msgid "guestfs_pread_device"
12643 #: ../src/guestfs-actions.pod:4841
12647 " guestfs_pread_device (guestfs_h *g,\n"
12648 " const char *device,\n"
12650 " int64_t offset,\n"
12651 " size_t *size_r);\n"
12656 #: ../src/guestfs-actions.pod:4848 ../fish/guestfish-actions.pod:3255
12658 "This command lets you read part of a file. It reads C<count> bytes of "
12659 "C<device>, starting at C<offset>."
12663 #: ../src/guestfs-actions.pod:4854
12664 msgid "See also C<guestfs_pread>."
12668 #: ../src/guestfs-actions.pod:4863
12669 msgid "(Added in 1.5.21)"
12673 #: ../src/guestfs-actions.pod:4865
12674 msgid "guestfs_pvcreate"
12678 #: ../src/guestfs-actions.pod:4867
12682 " guestfs_pvcreate (guestfs_h *g,\n"
12683 " const char *device);\n"
12688 #: ../src/guestfs-actions.pod:4871 ../fish/guestfish-actions.pod:3270
12690 "This creates an LVM physical volume on the named C<device>, where C<device> "
12691 "should usually be a partition name such as C</dev/sda1>."
12695 #: ../src/guestfs-actions.pod:4879
12696 msgid "guestfs_pvremove"
12700 #: ../src/guestfs-actions.pod:4881
12704 " guestfs_pvremove (guestfs_h *g,\n"
12705 " const char *device);\n"
12710 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3278
12712 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12717 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3281
12719 "The implementation uses the C<pvremove> command which refuses to wipe "
12720 "physical volumes that contain any volume groups, so you have to remove those "
12725 #: ../src/guestfs-actions.pod:4896
12726 msgid "guestfs_pvresize"
12730 #: ../src/guestfs-actions.pod:4898
12734 " guestfs_pvresize (guestfs_h *g,\n"
12735 " const char *device);\n"
12740 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3289
12742 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12743 "the new size of the underlying device."
12747 #: ../src/guestfs-actions.pod:4909
12748 msgid "guestfs_pvresize_size"
12752 #: ../src/guestfs-actions.pod:4911
12756 " guestfs_pvresize_size (guestfs_h *g,\n"
12757 " const char *device,\n"
12758 " int64_t size);\n"
12763 #: ../src/guestfs-actions.pod:4916
12765 "This command is the same as C<guestfs_pvresize> except that it allows you to "
12766 "specify the new size (in bytes) explicitly."
12770 #: ../src/guestfs-actions.pod:4923
12771 msgid "guestfs_pvs"
12775 #: ../src/guestfs-actions.pod:4925
12779 " guestfs_pvs (guestfs_h *g);\n"
12784 #: ../src/guestfs-actions.pod:4928 ../fish/guestfish-actions.pod:3303
12786 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12791 #: ../src/guestfs-actions.pod:4931 ../fish/guestfish-actions.pod:3306
12793 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12798 #: ../src/guestfs-actions.pod:4934
12799 msgid "See also C<guestfs_pvs_full>."
12803 #: ../src/guestfs-actions.pod:4942
12804 msgid "guestfs_pvs_full"
12808 #: ../src/guestfs-actions.pod:4944
12811 " struct guestfs_lvm_pv_list *\n"
12812 " guestfs_pvs_full (guestfs_h *g);\n"
12817 #: ../src/guestfs-actions.pod:4947 ../fish/guestfish-actions.pod:3315
12819 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12820 "(8)> command. The \"full\" version includes all fields."
12824 #: ../src/guestfs-actions.pod:4950
12826 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
12827 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
12831 #: ../src/guestfs-actions.pod:4956
12832 msgid "guestfs_pvuuid"
12836 #: ../src/guestfs-actions.pod:4958
12840 " guestfs_pvuuid (guestfs_h *g,\n"
12841 " const char *device);\n"
12846 #: ../src/guestfs-actions.pod:4962 ../fish/guestfish-actions.pod:3322
12847 msgid "This command returns the UUID of the LVM PV C<device>."
12851 #: ../src/guestfs-actions.pod:4969
12852 msgid "guestfs_pwrite"
12856 #: ../src/guestfs-actions.pod:4971
12860 " guestfs_pwrite (guestfs_h *g,\n"
12861 " const char *path,\n"
12862 " const char *content,\n"
12863 " size_t content_size,\n"
12864 " int64_t offset);\n"
12869 #: ../src/guestfs-actions.pod:4978 ../fish/guestfish-actions.pod:3328
12871 "This command writes to part of a file. It writes the data buffer C<content> "
12872 "to the file C<path> starting at offset C<offset>."
12876 #: ../src/guestfs-actions.pod:4981 ../fish/guestfish-actions.pod:3331
12878 "This command implements the L<pwrite(2)> system call, and like that system "
12879 "call it may not write the full data requested. The return value is the "
12880 "number of bytes that were actually written to the file. This could even be "
12881 "0, although short writes are unlikely for regular files in ordinary "
12886 #: ../src/guestfs-actions.pod:4987
12887 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
12891 #: ../src/guestfs-actions.pod:4996
12892 msgid "guestfs_pwrite_device"
12896 #: ../src/guestfs-actions.pod:4998
12900 " guestfs_pwrite_device (guestfs_h *g,\n"
12901 " const char *device,\n"
12902 " const char *content,\n"
12903 " size_t content_size,\n"
12904 " int64_t offset);\n"
12909 #: ../src/guestfs-actions.pod:5005 ../fish/guestfish-actions.pod:3346
12911 "This command writes to part of a device. It writes the data buffer "
12912 "C<content> to C<device> starting at offset C<offset>."
12916 #: ../src/guestfs-actions.pod:5008 ../fish/guestfish-actions.pod:3349
12918 "This command implements the L<pwrite(2)> system call, and like that system "
12919 "call it may not write the full data requested (although short writes to disk "
12920 "devices and partitions are probably impossible with standard Linux kernels)."
12924 #: ../src/guestfs-actions.pod:5013
12925 msgid "See also C<guestfs_pwrite>."
12929 #: ../src/guestfs-actions.pod:5020
12930 msgid "(Added in 1.5.20)"
12934 #: ../src/guestfs-actions.pod:5022
12935 msgid "guestfs_read_file"
12939 #: ../src/guestfs-actions.pod:5024
12943 " guestfs_read_file (guestfs_h *g,\n"
12944 " const char *path,\n"
12945 " size_t *size_r);\n"
12950 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3363
12951 msgid "This calls returns the contents of the file C<path> as a buffer."
12955 #: ../src/guestfs-actions.pod:5032
12957 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
12958 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
12959 "function is limited in the total size of file that can be handled."
12963 #: ../src/guestfs-actions.pod:5044
12964 msgid "(Added in 1.0.63)"
12968 #: ../src/guestfs-actions.pod:5046
12969 msgid "guestfs_read_lines"
12973 #: ../src/guestfs-actions.pod:5048
12977 " guestfs_read_lines (guestfs_h *g,\n"
12978 " const char *path);\n"
12983 #: ../src/guestfs-actions.pod:5054 ../fish/guestfish-actions.pod:3380
12985 "The file contents are returned as a list of lines. Trailing C<LF> and "
12986 "C<CRLF> character sequences are I<not> returned."
12990 #: ../src/guestfs-actions.pod:5057
12992 "Note that this function cannot correctly handle binary files (specifically, "
12993 "files containing C<\\0> character which is treated as end of line). For "
12994 "those you need to use the C<guestfs_read_file> function which has a more "
12995 "complex interface."
12999 #: ../src/guestfs-actions.pod:5068
13000 msgid "guestfs_readdir"
13004 #: ../src/guestfs-actions.pod:5070
13007 " struct guestfs_dirent_list *\n"
13008 " guestfs_readdir (guestfs_h *g,\n"
13009 " const char *dir);\n"
13014 #: ../src/guestfs-actions.pod:5074 ../fish/guestfish-actions.pod:3392
13015 msgid "This returns the list of directory entries in directory C<dir>."
13019 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3394
13021 "All entries in the directory are returned, including C<.> and C<..>. The "
13022 "entries are I<not> sorted, but returned in the same order as the underlying "
13027 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3398
13029 "Also this call returns basic file type information about each file. The "
13030 "C<ftyp> field will contain one of the following characters:"
13034 #: ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3403
13039 #: ../src/guestfs-actions.pod:5087 ../fish/guestfish-actions.pod:3405
13040 msgid "Block special"
13044 #: ../src/guestfs-actions.pod:5089 ../fish/guestfish-actions.pod:3407
13049 #: ../src/guestfs-actions.pod:5091 ../fish/guestfish-actions.pod:3409
13050 msgid "Char special"
13054 #: ../src/guestfs-actions.pod:5093 ../fish/guestfish-actions.pod:3411
13059 #: ../src/guestfs-actions.pod:5095 ../fish/guestfish-actions.pod:3413
13064 #: ../src/guestfs-actions.pod:5097 ../fish/guestfish-actions.pod:3415
13069 #: ../src/guestfs-actions.pod:5099 ../fish/guestfish-actions.pod:3417
13070 msgid "FIFO (named pipe)"
13074 #: ../src/guestfs-actions.pod:5101 ../fish/guestfish-actions.pod:3419
13079 #: ../src/guestfs-actions.pod:5103 ../fish/guestfish-actions.pod:3421
13080 msgid "Symbolic link"
13084 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3423
13089 #: ../src/guestfs-actions.pod:5107 ../fish/guestfish-actions.pod:3425
13090 msgid "Regular file"
13094 #: ../src/guestfs-actions.pod:5109 ../fish/guestfish-actions.pod:3427
13099 #: ../src/guestfs-actions.pod:5111 ../fish/guestfish-actions.pod:3429
13104 #: ../src/guestfs-actions.pod:5113 ../fish/guestfish-actions.pod:3431
13109 #: ../src/guestfs-actions.pod:5115 ../fish/guestfish-actions.pod:3433
13110 msgid "Unknown file type"
13114 #: ../src/guestfs-actions.pod:5117 ../fish/guestfish-actions.pod:3435
13119 #: ../src/guestfs-actions.pod:5119 ../fish/guestfish-actions.pod:3437
13121 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13125 #: ../src/guestfs-actions.pod:5124
13127 "This function is primarily intended for use by programs. To get a simple "
13128 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13129 "consumption, use C<guestfs_ll>."
13133 #: ../src/guestfs-actions.pod:5128
13135 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13136 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
13140 #: ../src/guestfs-actions.pod:5134
13141 msgid "guestfs_readlink"
13145 #: ../src/guestfs-actions.pod:5136
13149 " guestfs_readlink (guestfs_h *g,\n"
13150 " const char *path);\n"
13155 #: ../src/guestfs-actions.pod:5140 ../fish/guestfish-actions.pod:3450
13156 msgid "This command reads the target of a symbolic link."
13160 #: ../src/guestfs-actions.pod:5147
13161 msgid "guestfs_readlinklist"
13165 #: ../src/guestfs-actions.pod:5149
13169 " guestfs_readlinklist (guestfs_h *g,\n"
13170 " const char *path,\n"
13171 " char *const *names);\n"
13176 #: ../src/guestfs-actions.pod:5154 ../fish/guestfish-actions.pod:3456
13178 "This call allows you to do a C<readlink> operation on multiple files, where "
13179 "all files are in the directory C<path>. C<names> is the list of files from "
13184 #: ../src/guestfs-actions.pod:5158 ../fish/guestfish-actions.pod:3460
13186 "On return you get a list of strings, with a one-to-one correspondence to the "
13187 "C<names> list. Each string is the value of the symbolic link."
13191 #: ../src/guestfs-actions.pod:5162 ../fish/guestfish-actions.pod:3464
13193 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13194 "result string is the empty string C<\"\">. However the whole operation is "
13195 "completed even if there were C<readlink(2)> errors, and so you can call this "
13196 "function with names where you don't know if they are symbolic links already "
13197 "(albeit slightly less efficient)."
13201 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:3471
13203 "This call is intended for programs that want to efficiently list a directory "
13204 "contents without making many round-trips. Very long directory listings "
13205 "might cause the protocol message size to be exceeded, causing this call to "
13206 "fail. The caller must split up such requests into smaller groups of names."
13210 #: ../src/guestfs-actions.pod:5182
13211 msgid "guestfs_realpath"
13215 #: ../src/guestfs-actions.pod:5184
13219 " guestfs_realpath (guestfs_h *g,\n"
13220 " const char *path);\n"
13225 #: ../src/guestfs-actions.pod:5188 ../fish/guestfish-actions.pod:3482
13227 "Return the canonicalized absolute pathname of C<path>. The returned path "
13228 "has no C<.>, C<..> or symbolic link path elements."
13232 #: ../src/guestfs-actions.pod:5196
13233 msgid "guestfs_removexattr"
13237 #: ../src/guestfs-actions.pod:5198
13241 " guestfs_removexattr (guestfs_h *g,\n"
13242 " const char *xattr,\n"
13243 " const char *path);\n"
13248 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:3489
13250 "This call removes the extended attribute named C<xattr> of the file C<path>."
13254 #: ../src/guestfs-actions.pod:5206
13255 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13259 #: ../src/guestfs-actions.pod:5212
13260 msgid "guestfs_resize2fs"
13264 #: ../src/guestfs-actions.pod:5214
13268 " guestfs_resize2fs (guestfs_h *g,\n"
13269 " const char *device);\n"
13274 #: ../src/guestfs-actions.pod:5218 ../fish/guestfish-actions.pod:3498
13276 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13277 "underlying device."
13281 #: ../src/guestfs-actions.pod:5221
13283 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13284 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13285 "sometimes gives an error about this and sometimes not. In any case, it is "
13286 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13290 #: ../src/guestfs-actions.pod:5231
13291 msgid "guestfs_resize2fs_size"
13295 #: ../src/guestfs-actions.pod:5233
13299 " guestfs_resize2fs_size (guestfs_h *g,\n"
13300 " const char *device,\n"
13301 " int64_t size);\n"
13306 #: ../src/guestfs-actions.pod:5238
13308 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13309 "to specify the new size (in bytes) explicitly."
13313 #: ../src/guestfs-actions.pod:5245
13318 #: ../src/guestfs-actions.pod:5247
13322 " guestfs_rm (guestfs_h *g,\n"
13323 " const char *path);\n"
13328 #: ../src/guestfs-actions.pod:5251 ../fish/guestfish-actions.pod:3518
13329 msgid "Remove the single file C<path>."
13333 #: ../src/guestfs-actions.pod:5257
13334 msgid "guestfs_rm_rf"
13338 #: ../src/guestfs-actions.pod:5259
13342 " guestfs_rm_rf (guestfs_h *g,\n"
13343 " const char *path);\n"
13348 #: ../src/guestfs-actions.pod:5263 ../fish/guestfish-actions.pod:3524
13350 "Remove the file or directory C<path>, recursively removing the contents if "
13351 "its a directory. This is like the C<rm -rf> shell command."
13355 #: ../src/guestfs-actions.pod:5271
13356 msgid "guestfs_rmdir"
13360 #: ../src/guestfs-actions.pod:5273
13364 " guestfs_rmdir (guestfs_h *g,\n"
13365 " const char *path);\n"
13370 #: ../src/guestfs-actions.pod:5277 ../fish/guestfish-actions.pod:3532
13371 msgid "Remove the single directory C<path>."
13375 #: ../src/guestfs-actions.pod:5283
13376 msgid "guestfs_rmmountpoint"
13380 #: ../src/guestfs-actions.pod:5285
13384 " guestfs_rmmountpoint (guestfs_h *g,\n"
13385 " const char *exemptpath);\n"
13390 #: ../src/guestfs-actions.pod:5289
13392 "This calls removes a mountpoint that was previously created with "
13393 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13397 #: ../src/guestfs-actions.pod:5297
13398 msgid "guestfs_scrub_device"
13402 #: ../src/guestfs-actions.pod:5299
13406 " guestfs_scrub_device (guestfs_h *g,\n"
13407 " const char *device);\n"
13412 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:3546
13414 "This command writes patterns over C<device> to make data retrieval more "
13419 #: ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:5327
13420 #: ../src/guestfs-actions.pod:5346 ../fish/guestfish-actions.pod:3549
13421 #: ../fish/guestfish-actions.pod:3564 ../fish/guestfish-actions.pod:3577
13423 "It is an interface to the L<scrub(1)> program. See that manual page for "
13428 #: ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5332
13429 #: ../src/guestfs-actions.pod:5351
13430 msgid "(Added in 1.0.52)"
13434 #: ../src/guestfs-actions.pod:5316
13435 msgid "guestfs_scrub_file"
13439 #: ../src/guestfs-actions.pod:5318
13443 " guestfs_scrub_file (guestfs_h *g,\n"
13444 " const char *file);\n"
13449 #: ../src/guestfs-actions.pod:5322 ../fish/guestfish-actions.pod:3559
13451 "This command writes patterns over a file to make data retrieval more "
13456 #: ../src/guestfs-actions.pod:5325 ../fish/guestfish-actions.pod:3562
13457 msgid "The file is I<removed> after scrubbing."
13461 #: ../src/guestfs-actions.pod:5334
13462 msgid "guestfs_scrub_freespace"
13466 #: ../src/guestfs-actions.pod:5336
13470 " guestfs_scrub_freespace (guestfs_h *g,\n"
13471 " const char *dir);\n"
13476 #: ../src/guestfs-actions.pod:5340
13478 "This command creates the directory C<dir> and then fills it with files until "
13479 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13480 "and deletes them. The intention is to scrub any free space on the partition "
13481 "containing C<dir>."
13485 #: ../src/guestfs-actions.pod:5353
13486 msgid "guestfs_set_append"
13490 #: ../src/guestfs-actions.pod:5355
13494 " guestfs_set_append (guestfs_h *g,\n"
13495 " const char *append);\n"
13500 #: ../src/guestfs-actions.pod:5359 ../fish/guestfish-actions.pod:3586
13502 "This function is used to add additional options to the guest kernel command "
13507 #: ../src/guestfs-actions.pod:5362 ../fish/guestfish-actions.pod:3589
13509 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13510 "environment variable."
13514 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:3592
13516 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13517 "(libguestfs always adds a few of its own)."
13521 #: ../src/guestfs-actions.pod:5372
13522 msgid "guestfs_set_autosync"
13526 #: ../src/guestfs-actions.pod:5374
13530 " guestfs_set_autosync (guestfs_h *g,\n"
13531 " int autosync);\n"
13536 #: ../src/guestfs-actions.pod:5378
13538 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13539 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13540 "the handle is closed (also if the program exits without closing handles)."
13544 #: ../src/guestfs-actions.pod:5383 ../fish/guestfish-actions.pod:3606
13546 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13547 "disabled by default)."
13551 #: ../src/guestfs-actions.pod:5390
13552 msgid "guestfs_set_direct"
13556 #: ../src/guestfs-actions.pod:5392
13560 " guestfs_set_direct (guestfs_h *g,\n"
13566 #: ../src/guestfs-actions.pod:5396 ../fish/guestfish-actions.pod:3615
13568 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13569 "passed directly through to the appliance once it is launched."
13573 #: ../src/guestfs-actions.pod:5400
13575 "One consequence of this is that log messages aren't caught by the library "
13576 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13581 #: ../src/guestfs-actions.pod:5404 ../fish/guestfish-actions.pod:3623
13582 msgid "You probably don't want to use this unless you know what you are doing."
13586 #: ../src/guestfs-actions.pod:5407 ../fish/guestfish-actions.pod:3626
13587 msgid "The default is disabled."
13591 #: ../src/guestfs-actions.pod:5413
13592 msgid "guestfs_set_e2label"
13596 #: ../src/guestfs-actions.pod:5415
13600 " guestfs_set_e2label (guestfs_h *g,\n"
13601 " const char *device,\n"
13602 " const char *label);\n"
13607 #: ../src/guestfs-actions.pod:5420 ../fish/guestfish-actions.pod:3632
13609 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13610 "C<label>. Filesystem labels are limited to 16 characters."
13614 #: ../src/guestfs-actions.pod:5424
13616 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13617 "the existing label on a filesystem."
13621 #: ../src/guestfs-actions.pod:5431
13622 msgid "guestfs_set_e2uuid"
13626 #: ../src/guestfs-actions.pod:5433
13630 " guestfs_set_e2uuid (guestfs_h *g,\n"
13631 " const char *device,\n"
13632 " const char *uuid);\n"
13637 #: ../src/guestfs-actions.pod:5438 ../fish/guestfish-actions.pod:3643
13639 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13640 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13641 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13645 #: ../src/guestfs-actions.pod:5443
13647 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13648 "the existing UUID of a filesystem."
13652 #: ../src/guestfs-actions.pod:5450
13653 msgid "guestfs_set_memsize"
13657 #: ../src/guestfs-actions.pod:5452
13661 " guestfs_set_memsize (guestfs_h *g,\n"
13667 #: ../src/guestfs-actions.pod:5456
13669 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13670 "This only has any effect if called before C<guestfs_launch>."
13674 #: ../src/guestfs-actions.pod:5460 ../fish/guestfish-actions.pod:3661
13676 "You can also change this by setting the environment variable "
13677 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13681 #: ../src/guestfs-actions.pod:5471
13682 msgid "guestfs_set_network"
13686 #: ../src/guestfs-actions.pod:5473
13690 " guestfs_set_network (guestfs_h *g,\n"
13696 #: ../src/guestfs-actions.pod:5477 ../fish/guestfish-actions.pod:3674
13698 "If C<network> is true, then the network is enabled in the libguestfs "
13699 "appliance. The default is false."
13703 #: ../src/guestfs-actions.pod:5480 ../fish/guestfish-actions.pod:3677
13705 "This affects whether commands are able to access the network (see L<guestfs"
13706 "(3)/RUNNING COMMANDS>)."
13710 #: ../src/guestfs-actions.pod:5483
13712 "You must call this before calling C<guestfs_launch>, otherwise it has no "
13717 #: ../src/guestfs-actions.pod:5490
13718 msgid "guestfs_set_path"
13722 #: ../src/guestfs-actions.pod:5492
13726 " guestfs_set_path (guestfs_h *g,\n"
13727 " const char *searchpath);\n"
13732 #: ../src/guestfs-actions.pod:5496 ../fish/guestfish-actions.pod:3689
13733 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13737 #: ../src/guestfs-actions.pod:5498 ../fish/guestfish-actions.pod:3691
13739 "The default is C<$libdir/guestfs> unless overridden by setting "
13740 "C<LIBGUESTFS_PATH> environment variable."
13744 #: ../src/guestfs-actions.pod:5501 ../fish/guestfish-actions.pod:3694
13745 msgid "Setting C<path> to C<NULL> restores the default path."
13749 #: ../src/guestfs-actions.pod:5507
13750 msgid "guestfs_set_qemu"
13754 #: ../src/guestfs-actions.pod:5509
13758 " guestfs_set_qemu (guestfs_h *g,\n"
13759 " const char *qemu);\n"
13764 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3702
13765 msgid "Set the qemu binary that we will use."
13769 #: ../src/guestfs-actions.pod:5515 ../fish/guestfish-actions.pod:3704
13771 "The default is chosen when the library was compiled by the configure script."
13775 #: ../src/guestfs-actions.pod:5518 ../fish/guestfish-actions.pod:3707
13777 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13782 #: ../src/guestfs-actions.pod:5521 ../fish/guestfish-actions.pod:3710
13783 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13787 #: ../src/guestfs-actions.pod:5523 ../fish/guestfish-actions.pod:3712
13789 "Note that you should call this function as early as possible after creating "
13790 "the handle. This is because some pre-launch operations depend on testing "
13791 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13792 "don't retest features, and so you might see inconsistent results. Using the "
13793 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13794 "the qemu binary at the same time as the handle is created."
13798 #: ../src/guestfs-actions.pod:5535
13799 msgid "guestfs_set_recovery_proc"
13803 #: ../src/guestfs-actions.pod:5537
13807 " guestfs_set_recovery_proc (guestfs_h *g,\n"
13808 " int recoveryproc);\n"
13813 #: ../src/guestfs-actions.pod:5541
13815 "If this is called with the parameter C<false> then C<guestfs_launch> does "
13816 "not create a recovery process. The purpose of the recovery process is to "
13817 "stop runaway qemu processes in the case where the main program aborts "
13822 #: ../src/guestfs-actions.pod:5546
13824 "This only has any effect if called before C<guestfs_launch>, and the default "
13829 #: ../src/guestfs-actions.pod:5549 ../fish/guestfish-actions.pod:3734
13831 "About the only time when you would want to disable this is if the main "
13832 "process will fork itself into the background (\"daemonize\" itself). In "
13833 "this case the recovery process thinks that the main program has disappeared "
13834 "and so kills qemu, which is not very helpful."
13838 #: ../src/guestfs-actions.pod:5559
13839 msgid "guestfs_set_selinux"
13843 #: ../src/guestfs-actions.pod:5561
13847 " guestfs_set_selinux (guestfs_h *g,\n"
13853 #: ../src/guestfs-actions.pod:5565 ../fish/guestfish-actions.pod:3746
13855 "This sets the selinux flag that is passed to the appliance at boot time. "
13856 "The default is C<selinux=0> (disabled)."
13860 #: ../src/guestfs-actions.pod:5568 ../fish/guestfish-actions.pod:3749
13862 "Note that if SELinux is enabled, it is always in Permissive mode "
13863 "(C<enforcing=0>)."
13867 #: ../src/guestfs-actions.pod:5578
13868 msgid "guestfs_set_trace"
13872 #: ../src/guestfs-actions.pod:5580
13876 " guestfs_set_trace (guestfs_h *g,\n"
13882 #: ../src/guestfs-actions.pod:5584 ../fish/guestfish-actions.pod:3761
13884 "If the command trace flag is set to 1, then commands are printed on stderr "
13885 "before they are executed in a format which is very similar to the one used "
13886 "by guestfish. In other words, you can run a program with this enabled, and "
13887 "you will get out a script which you can feed to guestfish to perform the "
13888 "same set of actions."
13892 #: ../src/guestfs-actions.pod:5591 ../fish/guestfish-actions.pod:3768
13894 "If you want to trace C API calls into libguestfs (and other libraries) then "
13895 "possibly a better way is to use the external ltrace(1) command."
13899 #: ../src/guestfs-actions.pod:5595 ../fish/guestfish-actions.pod:3772
13901 "Command traces are disabled unless the environment variable "
13902 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13906 #: ../src/guestfs-actions.pod:5602
13907 msgid "guestfs_set_verbose"
13911 #: ../src/guestfs-actions.pod:5604
13915 " guestfs_set_verbose (guestfs_h *g,\n"
13921 #: ../src/guestfs-actions.pod:5608 ../fish/guestfish-actions.pod:3781
13922 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
13926 #: ../src/guestfs-actions.pod:5610 ../fish/guestfish-actions.pod:3783
13928 "Verbose messages are disabled unless the environment variable "
13929 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13933 #: ../src/guestfs-actions.pod:5617
13934 msgid "guestfs_setcon"
13938 #: ../src/guestfs-actions.pod:5619
13942 " guestfs_setcon (guestfs_h *g,\n"
13943 " const char *context);\n"
13948 #: ../src/guestfs-actions.pod:5623 ../fish/guestfish-actions.pod:3790
13950 "This sets the SELinux security context of the daemon to the string "
13955 #: ../src/guestfs-actions.pod:5626 ../fish/guestfish-actions.pod:3793
13956 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13960 #: ../src/guestfs-actions.pod:5632
13961 msgid "guestfs_setxattr"
13965 #: ../src/guestfs-actions.pod:5634
13969 " guestfs_setxattr (guestfs_h *g,\n"
13970 " const char *xattr,\n"
13971 " const char *val,\n"
13973 " const char *path);\n"
13978 #: ../src/guestfs-actions.pod:5641 ../fish/guestfish-actions.pod:3799
13980 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13981 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13985 #: ../src/guestfs-actions.pod:5645
13986 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
13990 #: ../src/guestfs-actions.pod:5651
13991 msgid "guestfs_sfdisk"
13995 #: ../src/guestfs-actions.pod:5653
13999 " guestfs_sfdisk (guestfs_h *g,\n"
14000 " const char *device,\n"
14004 " char *const *lines);\n"
14009 #: ../src/guestfs-actions.pod:5661 ../fish/guestfish-actions.pod:3809
14011 "This is a direct interface to the L<sfdisk(8)> program for creating "
14012 "partitions on block devices."
14016 #: ../src/guestfs-actions.pod:5664 ../fish/guestfish-actions.pod:3812
14017 msgid "C<device> should be a block device, for example C</dev/sda>."
14021 #: ../src/guestfs-actions.pod:5666 ../fish/guestfish-actions.pod:3814
14023 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14024 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14025 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14026 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14027 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14028 "the kernel) cannot work out the right geometry and you will need to tell it."
14032 #: ../src/guestfs-actions.pod:5674 ../fish/guestfish-actions.pod:3822
14034 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14035 "refer to the L<sfdisk(8)> manpage."
14039 #: ../src/guestfs-actions.pod:5677 ../fish/guestfish-actions.pod:3825
14041 "To create a single partition occupying the whole disk, you would pass "
14042 "C<lines> as a single element list, when the single element being the string "
14047 #: ../src/guestfs-actions.pod:5681
14049 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14053 #: ../src/guestfs-actions.pod:5691
14054 msgid "guestfs_sfdiskM"
14058 #: ../src/guestfs-actions.pod:5693
14062 " guestfs_sfdiskM (guestfs_h *g,\n"
14063 " const char *device,\n"
14064 " char *const *lines);\n"
14069 #: ../src/guestfs-actions.pod:5698
14071 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14072 "partition sizes are specified in megabytes only (rounded to the nearest "
14073 "cylinder) and you don't need to specify the cyls, heads and sectors "
14074 "parameters which were rarely if ever used anyway."
14078 #: ../src/guestfs-actions.pod:5704
14080 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14081 "C<guestfs_part_disk>"
14085 #: ../src/guestfs-actions.pod:5714
14086 msgid "guestfs_sfdisk_N"
14090 #: ../src/guestfs-actions.pod:5716
14094 " guestfs_sfdisk_N (guestfs_h *g,\n"
14095 " const char *device,\n"
14100 " const char *line);\n"
14105 #: ../src/guestfs-actions.pod:5725 ../fish/guestfish-actions.pod:3855
14107 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14108 "(note: C<n> counts from 1)."
14112 #: ../src/guestfs-actions.pod:5728
14114 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14115 "for the cyls/heads/sectors parameters."
14119 #: ../src/guestfs-actions.pod:5731
14120 msgid "See also: C<guestfs_part_add>"
14124 #: ../src/guestfs-actions.pod:5740
14125 msgid "guestfs_sfdisk_disk_geometry"
14129 #: ../src/guestfs-actions.pod:5742
14133 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14134 " const char *device);\n"
14139 #: ../src/guestfs-actions.pod:5746
14141 "This displays the disk geometry of C<device> read from the partition table. "
14142 "Especially in the case where the underlying block device has been resized, "
14143 "this can be different from the kernel's idea of the geometry (see "
14144 "C<guestfs_sfdisk_kernel_geometry>)."
14148 #: ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:5767
14149 #: ../fish/guestfish-actions.pod:3875 ../fish/guestfish-actions.pod:3884
14150 msgid "The result is in human-readable format, and not designed to be parsed."
14154 #: ../src/guestfs-actions.pod:5759
14155 msgid "guestfs_sfdisk_kernel_geometry"
14159 #: ../src/guestfs-actions.pod:5761
14163 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14164 " const char *device);\n"
14169 #: ../src/guestfs-actions.pod:5765 ../fish/guestfish-actions.pod:3882
14170 msgid "This displays the kernel's idea of the geometry of C<device>."
14174 #: ../src/guestfs-actions.pod:5775
14175 msgid "guestfs_sfdisk_l"
14179 #: ../src/guestfs-actions.pod:5777
14183 " guestfs_sfdisk_l (guestfs_h *g,\n"
14184 " const char *device);\n"
14189 #: ../src/guestfs-actions.pod:5781 ../fish/guestfish-actions.pod:3891
14191 "This displays the partition table on C<device>, in the human-readable output "
14192 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14196 #: ../src/guestfs-actions.pod:5785
14197 msgid "See also: C<guestfs_part_list>"
14201 #: ../src/guestfs-actions.pod:5792
14206 #: ../src/guestfs-actions.pod:5794
14210 " guestfs_sh (guestfs_h *g,\n"
14211 " const char *command);\n"
14216 #: ../src/guestfs-actions.pod:5798 ../fish/guestfish-actions.pod:3901
14218 "This call runs a command from the guest filesystem via the guest's C</bin/"
14223 #: ../src/guestfs-actions.pod:5801
14224 msgid "This is like C<guestfs_command>, but passes the command to:"
14228 #: ../src/guestfs-actions.pod:5803 ../fish/guestfish-actions.pod:3906
14231 " /bin/sh -c \"command\"\n"
14236 #: ../src/guestfs-actions.pod:5805 ../fish/guestfish-actions.pod:3908
14238 "Depending on the guest's shell, this usually results in wildcards being "
14239 "expanded, shell expressions being interpolated and so on."
14243 #: ../src/guestfs-actions.pod:5809
14244 msgid "All the provisos about C<guestfs_command> apply to this call."
14248 #: ../src/guestfs-actions.pod:5816
14249 msgid "guestfs_sh_lines"
14253 #: ../src/guestfs-actions.pod:5818
14257 " guestfs_sh_lines (guestfs_h *g,\n"
14258 " const char *command);\n"
14263 #: ../src/guestfs-actions.pod:5822
14265 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14270 #: ../src/guestfs-actions.pod:5825
14271 msgid "See also: C<guestfs_command_lines>"
14275 #: ../src/guestfs-actions.pod:5833
14276 msgid "guestfs_sleep"
14280 #: ../src/guestfs-actions.pod:5835
14284 " guestfs_sleep (guestfs_h *g,\n"
14290 #: ../src/guestfs-actions.pod:5839 ../fish/guestfish-actions.pod:3927
14291 msgid "Sleep for C<secs> seconds."
14295 #: ../src/guestfs-actions.pod:5843
14296 msgid "(Added in 1.0.41)"
14300 #: ../src/guestfs-actions.pod:5845 ../src/guestfs-structs.pod:109
14301 msgid "guestfs_stat"
14305 #: ../src/guestfs-actions.pod:5847
14308 " struct guestfs_stat *\n"
14309 " guestfs_stat (guestfs_h *g,\n"
14310 " const char *path);\n"
14315 #: ../src/guestfs-actions.pod:5853 ../fish/guestfish-actions.pod:3935
14316 msgid "This is the same as the C<stat(2)> system call."
14320 #: ../src/guestfs-actions.pod:5861 ../src/guestfs-structs.pod:135
14321 msgid "guestfs_statvfs"
14325 #: ../src/guestfs-actions.pod:5863
14328 " struct guestfs_statvfs *\n"
14329 " guestfs_statvfs (guestfs_h *g,\n"
14330 " const char *path);\n"
14335 #: ../src/guestfs-actions.pod:5867 ../fish/guestfish-actions.pod:3941
14337 "Returns file system statistics for any mounted file system. C<path> should "
14338 "be a file or directory in the mounted file system (typically it is the mount "
14339 "point itself, but it doesn't need to be)."
14343 #: ../src/guestfs-actions.pod:5871 ../fish/guestfish-actions.pod:3945
14344 msgid "This is the same as the C<statvfs(2)> system call."
14348 #: ../src/guestfs-actions.pod:5873
14350 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14351 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14355 #: ../src/guestfs-actions.pod:5879
14356 msgid "guestfs_strings"
14360 #: ../src/guestfs-actions.pod:5881
14364 " guestfs_strings (guestfs_h *g,\n"
14365 " const char *path);\n"
14370 #: ../src/guestfs-actions.pod:5885 ../fish/guestfish-actions.pod:3951
14372 "This runs the L<strings(1)> command on a file and returns the list of "
14373 "printable strings found."
14377 #: ../src/guestfs-actions.pod:5897
14378 msgid "guestfs_strings_e"
14382 #: ../src/guestfs-actions.pod:5899
14386 " guestfs_strings_e (guestfs_h *g,\n"
14387 " const char *encoding,\n"
14388 " const char *path);\n"
14393 #: ../src/guestfs-actions.pod:5904
14395 "This is like the C<guestfs_strings> command, but allows you to specify the "
14396 "encoding of strings that are looked for in the source file C<path>."
14400 #: ../src/guestfs-actions.pod:5908 ../fish/guestfish-actions.pod:3965
14401 msgid "Allowed encodings are:"
14405 #: ../src/guestfs-actions.pod:5912 ../fish/guestfish-actions.pod:3969
14410 #: ../src/guestfs-actions.pod:5914
14412 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14413 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14417 #: ../src/guestfs-actions.pod:5917 ../fish/guestfish-actions.pod:3974
14422 #: ../src/guestfs-actions.pod:5919 ../fish/guestfish-actions.pod:3976
14423 msgid "Single 8-bit-byte characters."
14427 #: ../src/guestfs-actions.pod:5921 ../fish/guestfish-actions.pod:3978
14432 #: ../src/guestfs-actions.pod:5923 ../fish/guestfish-actions.pod:3980
14433 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14437 #: ../src/guestfs-actions.pod:5926 ../fish/guestfish-actions.pod:3983
14438 msgid "l (lower case letter L)"
14442 #: ../src/guestfs-actions.pod:5928 ../fish/guestfish-actions.pod:3985
14444 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14445 "examining binaries in Windows guests."
14449 #: ../src/guestfs-actions.pod:5931 ../fish/guestfish-actions.pod:3988
14454 #: ../src/guestfs-actions.pod:5933 ../fish/guestfish-actions.pod:3990
14455 msgid "32-bit big endian such as UCS-4BE."
14459 #: ../src/guestfs-actions.pod:5935 ../fish/guestfish-actions.pod:3992
14464 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:3994
14465 msgid "32-bit little endian such as UCS-4LE."
14469 #: ../src/guestfs-actions.pod:5941 ../fish/guestfish-actions.pod:3998
14470 msgid "The returned strings are transcoded to UTF-8."
14474 #: ../src/guestfs-actions.pod:5952
14475 msgid "guestfs_swapoff_device"
14479 #: ../src/guestfs-actions.pod:5954
14483 " guestfs_swapoff_device (guestfs_h *g,\n"
14484 " const char *device);\n"
14489 #: ../src/guestfs-actions.pod:5958
14491 "This command disables the libguestfs appliance swap device or partition "
14492 "named C<device>. See C<guestfs_swapon_device>."
14496 #: ../src/guestfs-actions.pod:5966
14497 msgid "guestfs_swapoff_file"
14501 #: ../src/guestfs-actions.pod:5968
14505 " guestfs_swapoff_file (guestfs_h *g,\n"
14506 " const char *file);\n"
14511 #: ../src/guestfs-actions.pod:5972 ../fish/guestfish-actions.pod:4015
14512 msgid "This command disables the libguestfs appliance swap on file."
14516 #: ../src/guestfs-actions.pod:5978
14517 msgid "guestfs_swapoff_label"
14521 #: ../src/guestfs-actions.pod:5980
14525 " guestfs_swapoff_label (guestfs_h *g,\n"
14526 " const char *label);\n"
14531 #: ../src/guestfs-actions.pod:5984 ../fish/guestfish-actions.pod:4021
14533 "This command disables the libguestfs appliance swap on labeled swap "
14538 #: ../src/guestfs-actions.pod:5991
14539 msgid "guestfs_swapoff_uuid"
14543 #: ../src/guestfs-actions.pod:5993
14547 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14548 " const char *uuid);\n"
14553 #: ../src/guestfs-actions.pod:5997 ../fish/guestfish-actions.pod:4028
14555 "This command disables the libguestfs appliance swap partition with the given "
14560 #: ../src/guestfs-actions.pod:6004
14561 msgid "guestfs_swapon_device"
14565 #: ../src/guestfs-actions.pod:6006
14569 " guestfs_swapon_device (guestfs_h *g,\n"
14570 " const char *device);\n"
14575 #: ../src/guestfs-actions.pod:6010
14577 "This command enables the libguestfs appliance to use the swap device or "
14578 "partition named C<device>. The increased memory is made available for all "
14579 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14583 #: ../src/guestfs-actions.pod:6015 ../fish/guestfish-actions.pod:4040
14585 "Note that you should not swap to existing guest swap partitions unless you "
14586 "know what you are doing. They may contain hibernation information, or other "
14587 "information that the guest doesn't want you to trash. You also risk leaking "
14588 "information about the host to the guest this way. Instead, attach a new "
14589 "host device to the guest and swap on that."
14593 #: ../src/guestfs-actions.pod:6026
14594 msgid "guestfs_swapon_file"
14598 #: ../src/guestfs-actions.pod:6028
14602 " guestfs_swapon_file (guestfs_h *g,\n"
14603 " const char *file);\n"
14608 #: ../src/guestfs-actions.pod:6032
14610 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14615 #: ../src/guestfs-actions.pod:6039
14616 msgid "guestfs_swapon_label"
14620 #: ../src/guestfs-actions.pod:6041
14624 " guestfs_swapon_label (guestfs_h *g,\n"
14625 " const char *label);\n"
14630 #: ../src/guestfs-actions.pod:6045
14632 "This command enables swap to a labeled swap partition. See "
14633 "C<guestfs_swapon_device> for other notes."
14637 #: ../src/guestfs-actions.pod:6052
14638 msgid "guestfs_swapon_uuid"
14642 #: ../src/guestfs-actions.pod:6054
14646 " guestfs_swapon_uuid (guestfs_h *g,\n"
14647 " const char *uuid);\n"
14652 #: ../src/guestfs-actions.pod:6058
14654 "This command enables swap to a swap partition with the given UUID. See "
14655 "C<guestfs_swapon_device> for other notes."
14659 #: ../src/guestfs-actions.pod:6065
14660 msgid "guestfs_sync"
14664 #: ../src/guestfs-actions.pod:6067
14668 " guestfs_sync (guestfs_h *g);\n"
14673 #: ../src/guestfs-actions.pod:6070 ../fish/guestfish-actions.pod:4072
14675 "This syncs the disk, so that any writes are flushed through to the "
14676 "underlying disk image."
14680 #: ../src/guestfs-actions.pod:6073 ../fish/guestfish-actions.pod:4075
14682 "You should always call this if you have modified a disk image, before "
14683 "closing the handle."
14687 #: ../src/guestfs-actions.pod:6080
14688 msgid "guestfs_tail"
14692 #: ../src/guestfs-actions.pod:6082
14696 " guestfs_tail (guestfs_h *g,\n"
14697 " const char *path);\n"
14702 #: ../src/guestfs-actions.pod:6086 ../fish/guestfish-actions.pod:4082
14704 "This command returns up to the last 10 lines of a file as a list of strings."
14708 #: ../src/guestfs-actions.pod:6098
14709 msgid "guestfs_tail_n"
14713 #: ../src/guestfs-actions.pod:6100
14717 " guestfs_tail_n (guestfs_h *g,\n"
14719 " const char *path);\n"
14724 #: ../src/guestfs-actions.pod:6105 ../fish/guestfish-actions.pod:4092
14726 "If the parameter C<nrlines> is a positive number, this returns the last "
14727 "C<nrlines> lines of the file C<path>."
14731 #: ../src/guestfs-actions.pod:6108 ../fish/guestfish-actions.pod:4095
14733 "If the parameter C<nrlines> is a negative number, this returns lines from "
14734 "the file C<path>, starting with the C<-nrlines>th line."
14738 #: ../src/guestfs-actions.pod:6122
14739 msgid "guestfs_tar_in"
14743 #: ../src/guestfs-actions.pod:6124
14747 " guestfs_tar_in (guestfs_h *g,\n"
14748 " const char *tarfile,\n"
14749 " const char *directory);\n"
14754 #: ../src/guestfs-actions.pod:6129 ../fish/guestfish-actions.pod:4107
14756 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14757 "tar file) into C<directory>."
14761 #: ../src/guestfs-actions.pod:6132
14763 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
14767 #: ../src/guestfs-actions.pod:6137 ../src/guestfs-actions.pod:6154
14768 #: ../src/guestfs-actions.pod:6170 ../src/guestfs-actions.pod:6186
14769 msgid "(Added in 1.0.3)"
14773 #: ../src/guestfs-actions.pod:6139
14774 msgid "guestfs_tar_out"
14778 #: ../src/guestfs-actions.pod:6141
14782 " guestfs_tar_out (guestfs_h *g,\n"
14783 " const char *directory,\n"
14784 " const char *tarfile);\n"
14789 #: ../src/guestfs-actions.pod:6146 ../fish/guestfish-actions.pod:4119
14791 "This command packs the contents of C<directory> and downloads it to local "
14796 #: ../src/guestfs-actions.pod:6149
14798 "To download a compressed tarball, use C<guestfs_tgz_out> or "
14799 "C<guestfs_txz_out>."
14803 #: ../src/guestfs-actions.pod:6156
14804 msgid "guestfs_tgz_in"
14808 #: ../src/guestfs-actions.pod:6158
14812 " guestfs_tgz_in (guestfs_h *g,\n"
14813 " const char *tarball,\n"
14814 " const char *directory);\n"
14819 #: ../src/guestfs-actions.pod:6163 ../fish/guestfish-actions.pod:4131
14821 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14822 "tar file) into C<directory>."
14826 #: ../src/guestfs-actions.pod:6166
14827 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
14831 #: ../src/guestfs-actions.pod:6172
14832 msgid "guestfs_tgz_out"
14836 #: ../src/guestfs-actions.pod:6174
14840 " guestfs_tgz_out (guestfs_h *g,\n"
14841 " const char *directory,\n"
14842 " const char *tarball);\n"
14847 #: ../src/guestfs-actions.pod:6179 ../fish/guestfish-actions.pod:4142
14849 "This command packs the contents of C<directory> and downloads it to local "
14854 #: ../src/guestfs-actions.pod:6182
14855 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
14859 #: ../src/guestfs-actions.pod:6188
14860 msgid "guestfs_touch"
14864 #: ../src/guestfs-actions.pod:6190
14868 " guestfs_touch (guestfs_h *g,\n"
14869 " const char *path);\n"
14874 #: ../src/guestfs-actions.pod:6194 ../fish/guestfish-actions.pod:4153
14876 "Touch acts like the L<touch(1)> command. It can be used to update the "
14877 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14882 #: ../src/guestfs-actions.pod:6198 ../fish/guestfish-actions.pod:4157
14884 "This command only works on regular files, and will fail on other file types "
14885 "such as directories, symbolic links, block special etc."
14889 #: ../src/guestfs-actions.pod:6205
14890 msgid "guestfs_truncate"
14894 #: ../src/guestfs-actions.pod:6207
14898 " guestfs_truncate (guestfs_h *g,\n"
14899 " const char *path);\n"
14904 #: ../src/guestfs-actions.pod:6211 ../fish/guestfish-actions.pod:4164
14906 "This command truncates C<path> to a zero-length file. The file must exist "
14911 #: ../src/guestfs-actions.pod:6218
14912 msgid "guestfs_truncate_size"
14916 #: ../src/guestfs-actions.pod:6220
14920 " guestfs_truncate_size (guestfs_h *g,\n"
14921 " const char *path,\n"
14922 " int64_t size);\n"
14927 #: ../src/guestfs-actions.pod:6225 ../fish/guestfish-actions.pod:4171
14929 "This command truncates C<path> to size C<size> bytes. The file must exist "
14934 #: ../src/guestfs-actions.pod:6228
14936 "If the current file size is less than C<size> then the file is extended to "
14937 "the required size with zero bytes. This creates a sparse file (ie. disk "
14938 "blocks are not allocated for the file until you write to it). To create a "
14939 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
14943 #: ../src/guestfs-actions.pod:6238
14944 msgid "guestfs_tune2fs_l"
14948 #: ../src/guestfs-actions.pod:6240
14952 " guestfs_tune2fs_l (guestfs_h *g,\n"
14953 " const char *device);\n"
14958 #: ../src/guestfs-actions.pod:6244 ../fish/guestfish-actions.pod:4184
14960 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14965 #: ../src/guestfs-actions.pod:6247 ../fish/guestfish-actions.pod:4187
14967 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14968 "for more details. The list of fields returned isn't clearly defined, and "
14969 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14970 "and the filesystem itself."
14974 #: ../src/guestfs-actions.pod:6260
14975 msgid "guestfs_txz_in"
14979 #: ../src/guestfs-actions.pod:6262
14983 " guestfs_txz_in (guestfs_h *g,\n"
14984 " const char *tarball,\n"
14985 " const char *directory);\n"
14990 #: ../src/guestfs-actions.pod:6267 ../fish/guestfish-actions.pod:4196
14992 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14993 "tar file) into C<directory>."
14997 #: ../src/guestfs-actions.pod:6274
14998 msgid "guestfs_txz_out"
15002 #: ../src/guestfs-actions.pod:6276
15006 " guestfs_txz_out (guestfs_h *g,\n"
15007 " const char *directory,\n"
15008 " const char *tarball);\n"
15013 #: ../src/guestfs-actions.pod:6281 ../fish/guestfish-actions.pod:4205
15015 "This command packs the contents of C<directory> and downloads it to local "
15016 "file C<tarball> (as an xz compressed tar archive)."
15020 #: ../src/guestfs-actions.pod:6288
15021 msgid "guestfs_umask"
15025 #: ../src/guestfs-actions.pod:6290
15029 " guestfs_umask (guestfs_h *g,\n"
15035 #: ../src/guestfs-actions.pod:6294 ../fish/guestfish-actions.pod:4214
15037 "This function sets the mask used for creating new files and device nodes to "
15042 #: ../src/guestfs-actions.pod:6297 ../fish/guestfish-actions.pod:4217
15044 "Typical umask values would be C<022> which creates new files with "
15045 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15046 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15050 #: ../src/guestfs-actions.pod:6302 ../fish/guestfish-actions.pod:4222
15052 "The default umask is C<022>. This is important because it means that "
15053 "directories and device nodes will be created with C<0644> or C<0755> mode "
15054 "even if you specify C<0777>."
15058 #: ../src/guestfs-actions.pod:6306
15060 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15061 "C<guestfs_mkdir>."
15065 #: ../src/guestfs-actions.pod:6309 ../fish/guestfish-actions.pod:4229
15066 msgid "This call returns the previous umask."
15070 #: ../src/guestfs-actions.pod:6315
15071 msgid "guestfs_umount"
15075 #: ../src/guestfs-actions.pod:6317
15079 " guestfs_umount (guestfs_h *g,\n"
15080 " const char *pathordevice);\n"
15085 #: ../src/guestfs-actions.pod:6321 ../fish/guestfish-actions.pod:4237
15087 "This unmounts the given filesystem. The filesystem may be specified either "
15088 "by its mountpoint (path) or the device which contains the filesystem."
15092 #: ../src/guestfs-actions.pod:6329
15093 msgid "guestfs_umount_all"
15097 #: ../src/guestfs-actions.pod:6331
15101 " guestfs_umount_all (guestfs_h *g);\n"
15106 #: ../src/guestfs-actions.pod:6334 ../fish/guestfish-actions.pod:4247
15107 msgid "This unmounts all mounted filesystems."
15111 #: ../src/guestfs-actions.pod:6336 ../fish/guestfish-actions.pod:4249
15112 msgid "Some internal mounts are not unmounted by this call."
15116 #: ../src/guestfs-actions.pod:6342
15117 msgid "guestfs_upload"
15121 #: ../src/guestfs-actions.pod:6344
15125 " guestfs_upload (guestfs_h *g,\n"
15126 " const char *filename,\n"
15127 " const char *remotefilename);\n"
15132 #: ../src/guestfs-actions.pod:6349 ../src/guestfs-actions.pod:6368
15133 #: ../fish/guestfish-actions.pod:4255 ../fish/guestfish-actions.pod:4268
15134 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15138 #: ../src/guestfs-actions.pod:6354
15139 msgid "See also C<guestfs_download>."
15143 #: ../src/guestfs-actions.pod:6360
15144 msgid "guestfs_upload_offset"
15148 #: ../src/guestfs-actions.pod:6362
15152 " guestfs_upload_offset (guestfs_h *g,\n"
15153 " const char *filename,\n"
15154 " const char *remotefilename,\n"
15155 " int64_t offset);\n"
15160 #: ../src/guestfs-actions.pod:6371 ../fish/guestfish-actions.pod:4271
15162 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15163 "The intention is to overwrite parts of existing files or devices, although "
15164 "if a non-existant file is specified then it is created with a \"hole\" "
15165 "before C<offset>. The size of the data written is implicit in the size of "
15166 "the source C<filename>."
15170 #: ../src/guestfs-actions.pod:6378
15172 "Note that there is no limit on the amount of data that can be uploaded with "
15173 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15174 "full amount unless an error occurs."
15178 #: ../src/guestfs-actions.pod:6383
15179 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15183 #: ../src/guestfs-actions.pod:6389
15184 msgid "guestfs_utimens"
15188 #: ../src/guestfs-actions.pod:6391
15192 " guestfs_utimens (guestfs_h *g,\n"
15193 " const char *path,\n"
15194 " int64_t atsecs,\n"
15195 " int64_t atnsecs,\n"
15196 " int64_t mtsecs,\n"
15197 " int64_t mtnsecs);\n"
15202 #: ../src/guestfs-actions.pod:6399 ../fish/guestfish-actions.pod:4291
15203 msgid "This command sets the timestamps of a file with nanosecond precision."
15207 #: ../src/guestfs-actions.pod:6402 ../fish/guestfish-actions.pod:4294
15209 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15214 #: ../src/guestfs-actions.pod:6405 ../fish/guestfish-actions.pod:4297
15216 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15217 "nanoseconds from the epoch."
15221 #: ../src/guestfs-actions.pod:6408 ../fish/guestfish-actions.pod:4300
15223 "If the C<*nsecs> field contains the special value C<-1> then the "
15224 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15225 "ignored in this case)."
15229 #: ../src/guestfs-actions.pod:6412 ../fish/guestfish-actions.pod:4304
15231 "If the C<*nsecs> field contains the special value C<-2> then the "
15232 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15237 #: ../src/guestfs-actions.pod:6420 ../src/guestfs-structs.pod:175
15238 msgid "guestfs_version"
15242 #: ../src/guestfs-actions.pod:6422
15245 " struct guestfs_version *\n"
15246 " guestfs_version (guestfs_h *g);\n"
15251 #: ../src/guestfs-actions.pod:6425 ../fish/guestfish-actions.pod:4312
15253 "Return the libguestfs version number that the program is linked against."
15257 #: ../src/guestfs-actions.pod:6428 ../fish/guestfish-actions.pod:4315
15259 "Note that because of dynamic linking this is not necessarily the version of "
15260 "libguestfs that you compiled against. You can compile the program, and then "
15261 "at runtime dynamically link against a completely different C<libguestfs.so> "
15266 #: ../src/guestfs-actions.pod:6433 ../fish/guestfish-actions.pod:4320
15268 "This call was added in version C<1.0.58>. In previous versions of "
15269 "libguestfs there was no way to get the version number. From C code you can "
15270 "use dynamic linker functions to find out if this symbol exists (if it "
15271 "doesn't, then it's an earlier version)."
15275 #: ../src/guestfs-actions.pod:6439 ../fish/guestfish-actions.pod:4326
15277 "The call returns a structure with four elements. The first three (C<major>, "
15278 "C<minor> and C<release>) are numbers and correspond to the usual version "
15279 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15280 "but may be used for distro-specific information."
15284 #: ../src/guestfs-actions.pod:6445 ../fish/guestfish-actions.pod:4332
15286 "To construct the original version string: C<$major.$minor.$release$extra>"
15290 #: ../src/guestfs-actions.pod:6448 ../fish/guestfish-actions.pod:4335
15291 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15295 #: ../src/guestfs-actions.pod:6450
15297 "I<Note:> Don't use this call to test for availability of features. In "
15298 "enterprise distributions we backport features from later versions into "
15299 "earlier versions, making this an unreliable way to test for features. Use "
15300 "C<guestfs_available> instead."
15304 #: ../src/guestfs-actions.pod:6456
15306 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15307 "error. I<The caller must call C<guestfs_free_version> after use>."
15311 #: ../src/guestfs-actions.pod:6460
15312 msgid "(Added in 1.0.58)"
15316 #: ../src/guestfs-actions.pod:6462
15317 msgid "guestfs_vfs_label"
15321 #: ../src/guestfs-actions.pod:6464
15325 " guestfs_vfs_label (guestfs_h *g,\n"
15326 " const char *device);\n"
15331 #: ../src/guestfs-actions.pod:6468 ../fish/guestfish-actions.pod:4347
15332 msgid "This returns the filesystem label of the filesystem on C<device>."
15336 #: ../src/guestfs-actions.pod:6471 ../fish/guestfish-actions.pod:4350
15337 msgid "If the filesystem is unlabeled, this returns the empty string."
15341 #: ../src/guestfs-actions.pod:6473
15342 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15346 #: ../src/guestfs-actions.pod:6478 ../src/guestfs-actions.pod:6515
15347 msgid "(Added in 1.3.18)"
15351 #: ../src/guestfs-actions.pod:6480
15352 msgid "guestfs_vfs_type"
15356 #: ../src/guestfs-actions.pod:6482
15360 " guestfs_vfs_type (guestfs_h *g,\n"
15361 " const char *device);\n"
15366 #: ../src/guestfs-actions.pod:6486 ../fish/guestfish-actions.pod:4358
15368 "This command gets the filesystem type corresponding to the filesystem on "
15373 #: ../src/guestfs-actions.pod:6489 ../fish/guestfish-actions.pod:4361
15375 "For most filesystems, the result is the name of the Linux VFS module which "
15376 "would be used to mount this filesystem if you mounted it without specifying "
15377 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15381 #: ../src/guestfs-actions.pod:6499
15382 msgid "guestfs_vfs_uuid"
15386 #: ../src/guestfs-actions.pod:6501
15390 " guestfs_vfs_uuid (guestfs_h *g,\n"
15391 " const char *device);\n"
15396 #: ../src/guestfs-actions.pod:6505 ../fish/guestfish-actions.pod:4370
15397 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15401 #: ../src/guestfs-actions.pod:6508 ../fish/guestfish-actions.pod:4373
15402 msgid "If the filesystem does not have a UUID, this returns the empty string."
15406 #: ../src/guestfs-actions.pod:6510
15407 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15411 #: ../src/guestfs-actions.pod:6517
15412 msgid "guestfs_vg_activate"
15416 #: ../src/guestfs-actions.pod:6519
15420 " guestfs_vg_activate (guestfs_h *g,\n"
15422 " char *const *volgroups);\n"
15427 #: ../src/guestfs-actions.pod:6524 ../fish/guestfish-actions.pod:4381
15429 "This command activates or (if C<activate> is false) deactivates all logical "
15430 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15431 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15432 "deactivated, then those devices disappear."
15436 #: ../src/guestfs-actions.pod:6530 ../fish/guestfish-actions.pod:4387
15437 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15441 #: ../src/guestfs-actions.pod:6532 ../fish/guestfish-actions.pod:4389
15443 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15444 "activated or deactivated."
15448 #: ../src/guestfs-actions.pod:6539
15449 msgid "guestfs_vg_activate_all"
15453 #: ../src/guestfs-actions.pod:6541
15457 " guestfs_vg_activate_all (guestfs_h *g,\n"
15458 " int activate);\n"
15463 #: ../src/guestfs-actions.pod:6545 ../fish/guestfish-actions.pod:4396
15465 "This command activates or (if C<activate> is false) deactivates all logical "
15466 "volumes in all volume groups. If activated, then they are made known to the "
15467 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15468 "those devices disappear."
15472 #: ../src/guestfs-actions.pod:6551 ../fish/guestfish-actions.pod:4402
15473 msgid "This command is the same as running C<vgchange -a y|n>"
15477 #: ../src/guestfs-actions.pod:6557
15478 msgid "guestfs_vgcreate"
15482 #: ../src/guestfs-actions.pod:6559
15486 " guestfs_vgcreate (guestfs_h *g,\n"
15487 " const char *volgroup,\n"
15488 " char *const *physvols);\n"
15493 #: ../src/guestfs-actions.pod:6564 ../fish/guestfish-actions.pod:4408
15495 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15496 "of physical volumes C<physvols>."
15500 #: ../src/guestfs-actions.pod:6571
15501 msgid "guestfs_vglvuuids"
15505 #: ../src/guestfs-actions.pod:6573
15509 " guestfs_vglvuuids (guestfs_h *g,\n"
15510 " const char *vgname);\n"
15515 #: ../src/guestfs-actions.pod:6577 ../fish/guestfish-actions.pod:4415
15517 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15518 "volumes created in this volume group."
15522 #: ../src/guestfs-actions.pod:6580
15524 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15525 "associate logical volumes and volume groups."
15529 #: ../src/guestfs-actions.pod:6583
15530 msgid "See also C<guestfs_vgpvuuids>."
15534 #: ../src/guestfs-actions.pod:6591
15535 msgid "guestfs_vgpvuuids"
15539 #: ../src/guestfs-actions.pod:6593
15543 " guestfs_vgpvuuids (guestfs_h *g,\n"
15544 " const char *vgname);\n"
15549 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4427
15551 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15552 "volumes that this volume group resides on."
15556 #: ../src/guestfs-actions.pod:6600
15558 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15559 "associate physical volumes and volume groups."
15563 #: ../src/guestfs-actions.pod:6603
15564 msgid "See also C<guestfs_vglvuuids>."
15568 #: ../src/guestfs-actions.pod:6611
15569 msgid "guestfs_vgremove"
15573 #: ../src/guestfs-actions.pod:6613
15577 " guestfs_vgremove (guestfs_h *g,\n"
15578 " const char *vgname);\n"
15583 #: ../src/guestfs-actions.pod:6617 ../fish/guestfish-actions.pod:4439
15584 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15588 #: ../src/guestfs-actions.pod:6619 ../fish/guestfish-actions.pod:4441
15590 "This also forcibly removes all logical volumes in the volume group (if any)."
15594 #: ../src/guestfs-actions.pod:6626
15595 msgid "guestfs_vgrename"
15599 #: ../src/guestfs-actions.pod:6628
15603 " guestfs_vgrename (guestfs_h *g,\n"
15604 " const char *volgroup,\n"
15605 " const char *newvolgroup);\n"
15610 #: ../src/guestfs-actions.pod:6633 ../fish/guestfish-actions.pod:4448
15611 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15615 #: ../src/guestfs-actions.pod:6639
15616 msgid "guestfs_vgs"
15620 #: ../src/guestfs-actions.pod:6641
15624 " guestfs_vgs (guestfs_h *g);\n"
15629 #: ../src/guestfs-actions.pod:6644 ../fish/guestfish-actions.pod:4454
15631 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15636 #: ../src/guestfs-actions.pod:6647 ../fish/guestfish-actions.pod:4457
15638 "This returns a list of just the volume group names that were detected (eg. "
15643 #: ../src/guestfs-actions.pod:6650
15644 msgid "See also C<guestfs_vgs_full>."
15648 #: ../src/guestfs-actions.pod:6658
15649 msgid "guestfs_vgs_full"
15653 #: ../src/guestfs-actions.pod:6660
15656 " struct guestfs_lvm_vg_list *\n"
15657 " guestfs_vgs_full (guestfs_h *g);\n"
15662 #: ../src/guestfs-actions.pod:6663 ../fish/guestfish-actions.pod:4466
15664 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15665 "> command. The \"full\" version includes all fields."
15669 #: ../src/guestfs-actions.pod:6666
15671 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15672 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
15676 #: ../src/guestfs-actions.pod:6672
15677 msgid "guestfs_vgscan"
15681 #: ../src/guestfs-actions.pod:6674
15685 " guestfs_vgscan (guestfs_h *g);\n"
15690 #: ../src/guestfs-actions.pod:6677 ../fish/guestfish-actions.pod:4473
15692 "This rescans all block devices and rebuilds the list of LVM physical "
15693 "volumes, volume groups and logical volumes."
15697 #: ../src/guestfs-actions.pod:6684
15698 msgid "guestfs_vguuid"
15702 #: ../src/guestfs-actions.pod:6686
15706 " guestfs_vguuid (guestfs_h *g,\n"
15707 " const char *vgname);\n"
15712 #: ../src/guestfs-actions.pod:6690 ../fish/guestfish-actions.pod:4480
15713 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15717 #: ../src/guestfs-actions.pod:6697
15718 msgid "guestfs_wait_ready"
15722 #: ../src/guestfs-actions.pod:6699
15726 " guestfs_wait_ready (guestfs_h *g);\n"
15731 #: ../src/guestfs-actions.pod:6702
15732 msgid "This function is a no op."
15736 #: ../src/guestfs-actions.pod:6704
15738 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
15739 "calling C<guestfs_launch> to wait for the launch to complete. However this "
15740 "is no longer necessary because C<guestfs_launch> now does the waiting."
15744 #: ../src/guestfs-actions.pod:6709
15746 "If you see any calls to this function in code then you can just remove them, "
15747 "unless you want to retain compatibility with older versions of the API."
15751 #: ../src/guestfs-actions.pod:6717
15752 msgid "guestfs_wc_c"
15756 #: ../src/guestfs-actions.pod:6719
15760 " guestfs_wc_c (guestfs_h *g,\n"
15761 " const char *path);\n"
15766 #: ../src/guestfs-actions.pod:6723 ../fish/guestfish-actions.pod:4486
15768 "This command counts the characters in a file, using the C<wc -c> external "
15773 #: ../src/guestfs-actions.pod:6730
15774 msgid "guestfs_wc_l"
15778 #: ../src/guestfs-actions.pod:6732
15782 " guestfs_wc_l (guestfs_h *g,\n"
15783 " const char *path);\n"
15788 #: ../src/guestfs-actions.pod:6736 ../fish/guestfish-actions.pod:4493
15790 "This command counts the lines in a file, using the C<wc -l> external command."
15794 #: ../src/guestfs-actions.pod:6743
15795 msgid "guestfs_wc_w"
15799 #: ../src/guestfs-actions.pod:6745
15803 " guestfs_wc_w (guestfs_h *g,\n"
15804 " const char *path);\n"
15809 #: ../src/guestfs-actions.pod:6749 ../fish/guestfish-actions.pod:4500
15811 "This command counts the words in a file, using the C<wc -w> external command."
15815 #: ../src/guestfs-actions.pod:6756
15816 msgid "guestfs_write"
15820 #: ../src/guestfs-actions.pod:6758
15824 " guestfs_write (guestfs_h *g,\n"
15825 " const char *path,\n"
15826 " const char *content,\n"
15827 " size_t content_size);\n"
15832 #: ../src/guestfs-actions.pod:6764 ../fish/guestfish-actions.pod:4507
15834 "This call creates a file called C<path>. The content of the file is the "
15835 "string C<content> (which can contain any 8 bit data)."
15839 #: ../src/guestfs-actions.pod:6774
15840 msgid "guestfs_write_file"
15844 #: ../src/guestfs-actions.pod:6776
15848 " guestfs_write_file (guestfs_h *g,\n"
15849 " const char *path,\n"
15850 " const char *content,\n"
15856 #: ../src/guestfs-actions.pod:6782 ../fish/guestfish-actions.pod:4517
15858 "This call creates a file called C<path>. The contents of the file is the "
15859 "string C<content> (which can contain any 8 bit data), with length C<size>."
15863 #: ../src/guestfs-actions.pod:6786 ../fish/guestfish-actions.pod:4521
15865 "As a special case, if C<size> is C<0> then the length is calculated using "
15866 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15870 #: ../src/guestfs-actions.pod:6790 ../fish/guestfish-actions.pod:4525
15872 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15873 "I<not> work, even if the length is specified."
15877 #: ../src/guestfs-actions.pod:6798 ../fish/guestfish-actions.pod:4531
15879 "This function is deprecated. In new code, use the C<write> call instead."
15883 #: ../src/guestfs-actions.pod:6807
15884 msgid "guestfs_zegrep"
15888 #: ../src/guestfs-actions.pod:6809
15892 " guestfs_zegrep (guestfs_h *g,\n"
15893 " const char *regex,\n"
15894 " const char *path);\n"
15899 #: ../src/guestfs-actions.pod:6814 ../fish/guestfish-actions.pod:4542
15901 "This calls the external C<zegrep> program and returns the matching lines."
15905 #: ../src/guestfs-actions.pod:6826
15906 msgid "guestfs_zegrepi"
15910 #: ../src/guestfs-actions.pod:6828
15914 " guestfs_zegrepi (guestfs_h *g,\n"
15915 " const char *regex,\n"
15916 " const char *path);\n"
15921 #: ../src/guestfs-actions.pod:6833 ../fish/guestfish-actions.pod:4552
15923 "This calls the external C<zegrep -i> program and returns the matching lines."
15927 #: ../src/guestfs-actions.pod:6845
15928 msgid "guestfs_zero"
15932 #: ../src/guestfs-actions.pod:6847
15936 " guestfs_zero (guestfs_h *g,\n"
15937 " const char *device);\n"
15942 #: ../src/guestfs-actions.pod:6851 ../fish/guestfish-actions.pod:4562
15943 msgid "This command writes zeroes over the first few blocks of C<device>."
15947 #: ../src/guestfs-actions.pod:6853 ../fish/guestfish-actions.pod:4564
15949 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15950 "securely wipe the device). It should be sufficient to remove any partition "
15951 "tables, filesystem superblocks and so on."
15955 #: ../src/guestfs-actions.pod:6857
15956 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
15960 #: ../src/guestfs-actions.pod:6868
15961 msgid "guestfs_zero_device"
15965 #: ../src/guestfs-actions.pod:6870
15969 " guestfs_zero_device (guestfs_h *g,\n"
15970 " const char *device);\n"
15975 #: ../src/guestfs-actions.pod:6874
15977 "This command writes zeroes over the entire C<device>. Compare with "
15978 "C<guestfs_zero> which just zeroes the first few blocks of a device."
15982 #: ../src/guestfs-actions.pod:6888
15983 msgid "(Added in 1.3.1)"
15987 #: ../src/guestfs-actions.pod:6890
15988 msgid "guestfs_zerofree"
15992 #: ../src/guestfs-actions.pod:6892
15996 " guestfs_zerofree (guestfs_h *g,\n"
15997 " const char *device);\n"
16002 #: ../src/guestfs-actions.pod:6896 ../fish/guestfish-actions.pod:4585
16004 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16005 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16006 "possible to compress the filesystem more effectively."
16010 #: ../src/guestfs-actions.pod:6901 ../fish/guestfish-actions.pod:4590
16011 msgid "You should B<not> run this program if the filesystem is mounted."
16015 #: ../src/guestfs-actions.pod:6904 ../fish/guestfish-actions.pod:4593
16017 "It is possible that using this program can damage the filesystem or data on "
16022 #: ../src/guestfs-actions.pod:6911
16023 msgid "guestfs_zfgrep"
16027 #: ../src/guestfs-actions.pod:6913
16031 " guestfs_zfgrep (guestfs_h *g,\n"
16032 " const char *pattern,\n"
16033 " const char *path);\n"
16038 #: ../src/guestfs-actions.pod:6918 ../fish/guestfish-actions.pod:4600
16040 "This calls the external C<zfgrep> program and returns the matching lines."
16044 #: ../src/guestfs-actions.pod:6930
16045 msgid "guestfs_zfgrepi"
16049 #: ../src/guestfs-actions.pod:6932
16053 " guestfs_zfgrepi (guestfs_h *g,\n"
16054 " const char *pattern,\n"
16055 " const char *path);\n"
16060 #: ../src/guestfs-actions.pod:6937 ../fish/guestfish-actions.pod:4610
16062 "This calls the external C<zfgrep -i> program and returns the matching lines."
16066 #: ../src/guestfs-actions.pod:6949
16067 msgid "guestfs_zfile"
16071 #: ../src/guestfs-actions.pod:6951
16075 " guestfs_zfile (guestfs_h *g,\n"
16076 " const char *meth,\n"
16077 " const char *path);\n"
16082 #: ../src/guestfs-actions.pod:6956 ../fish/guestfish-actions.pod:4620
16084 "This command runs C<file> after first decompressing C<path> using C<method>."
16088 #: ../src/guestfs-actions.pod:6959 ../fish/guestfish-actions.pod:4623
16089 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16093 #: ../src/guestfs-actions.pod:6961
16095 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16100 #: ../src/guestfs-actions.pod:6967 ../fish/guestfish-actions.pod:4628
16102 "This function is deprecated. In new code, use the C<file> call instead."
16106 #: ../src/guestfs-actions.pod:6976
16107 msgid "guestfs_zgrep"
16111 #: ../src/guestfs-actions.pod:6978
16115 " guestfs_zgrep (guestfs_h *g,\n"
16116 " const char *regex,\n"
16117 " const char *path);\n"
16122 #: ../src/guestfs-actions.pod:6983 ../fish/guestfish-actions.pod:4639
16124 "This calls the external C<zgrep> program and returns the matching lines."
16128 #: ../src/guestfs-actions.pod:6995
16129 msgid "guestfs_zgrepi"
16133 #: ../src/guestfs-actions.pod:6997
16137 " guestfs_zgrepi (guestfs_h *g,\n"
16138 " const char *regex,\n"
16139 " const char *path);\n"
16144 #: ../src/guestfs-actions.pod:7002 ../fish/guestfish-actions.pod:4649
16146 "This calls the external C<zgrep -i> program and returns the matching lines."
16150 #: ../src/guestfs-availability.pod:3
16155 #: ../src/guestfs-availability.pod:5
16157 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
16158 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
16159 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
16160 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
16161 "L</guestfs_aug_save> L</guestfs_aug_set>"
16165 #: ../src/guestfs-availability.pod:21
16170 #: ../src/guestfs-availability.pod:23
16172 "The following functions: L</guestfs_inotify_add_watch> L</"
16173 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
16174 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16178 #: ../src/guestfs-availability.pod:31
16179 msgid "B<linuxfsuuid>"
16183 #: ../src/guestfs-availability.pod:33
16185 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
16186 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16190 #: ../src/guestfs-availability.pod:40
16191 msgid "B<linuxmodules>"
16195 #: ../src/guestfs-availability.pod:42
16196 msgid "The following functions: L</guestfs_modprobe>"
16200 #: ../src/guestfs-availability.pod:45
16201 msgid "B<linuxxattrs>"
16205 #: ../src/guestfs-availability.pod:47
16207 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
16208 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
16209 "guestfs_removexattr> L</guestfs_setxattr>"
16213 #: ../src/guestfs-availability.pod:56
16218 #: ../src/guestfs-availability.pod:58
16220 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
16221 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
16222 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16226 #: ../src/guestfs-availability.pod:67
16231 #: ../src/guestfs-availability.pod:69
16233 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16234 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16235 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16236 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16237 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16238 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16239 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16243 #: ../src/guestfs-availability.pod:92
16248 #: ../src/guestfs-availability.pod:94
16250 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16251 "guestfs_mknod_b> L</guestfs_mknod_c>"
16255 #: ../src/guestfs-availability.pod:100
16260 #: ../src/guestfs-availability.pod:102
16261 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16265 #: ../src/guestfs-availability.pod:105
16266 msgid "B<ntfsprogs>"
16270 #: ../src/guestfs-availability.pod:107
16272 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16276 #: ../src/guestfs-availability.pod:111
16277 msgid "B<realpath>"
16281 #: ../src/guestfs-availability.pod:113
16282 msgid "The following functions: L</guestfs_realpath>"
16286 #: ../src/guestfs-availability.pod:116
16291 #: ../src/guestfs-availability.pod:118
16293 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16294 "guestfs_scrub_freespace>"
16298 #: ../src/guestfs-availability.pod:123
16303 #: ../src/guestfs-availability.pod:125
16304 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16308 #: ../src/guestfs-availability.pod:129
16313 #: ../src/guestfs-availability.pod:131
16314 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16318 #: ../src/guestfs-availability.pod:135
16319 msgid "B<zerofree>"
16323 #: ../src/guestfs-availability.pod:137
16324 msgid "The following functions: L</guestfs_zerofree>"
16328 #: ../src/guestfs-structs.pod:1
16329 msgid "guestfs_int_bool"
16333 #: ../src/guestfs-structs.pod:3
16336 " struct guestfs_int_bool {\n"
16344 #: ../src/guestfs-structs.pod:8
16347 " struct guestfs_int_bool_list {\n"
16348 " uint32_t len; /* Number of elements in list. */\n"
16349 " struct guestfs_int_bool *val; /* Elements. */\n"
16355 #: ../src/guestfs-structs.pod:13
16358 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16359 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16364 #: ../src/guestfs-structs.pod:16
16365 msgid "guestfs_lvm_pv"
16369 #: ../src/guestfs-structs.pod:18
16372 " struct guestfs_lvm_pv {\n"
16373 " char *pv_name;\n"
16374 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16375 " char pv_uuid[32];\n"
16377 " uint64_t pv_size;\n"
16378 " uint64_t dev_size;\n"
16379 " uint64_t pv_free;\n"
16380 " uint64_t pv_used;\n"
16381 " char *pv_attr;\n"
16382 " int64_t pv_pe_count;\n"
16383 " int64_t pv_pe_alloc_count;\n"
16384 " char *pv_tags;\n"
16385 " uint64_t pe_start;\n"
16386 " int64_t pv_mda_count;\n"
16387 " uint64_t pv_mda_free;\n"
16393 #: ../src/guestfs-structs.pod:36
16396 " struct guestfs_lvm_pv_list {\n"
16397 " uint32_t len; /* Number of elements in list. */\n"
16398 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16404 #: ../src/guestfs-structs.pod:41
16407 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16408 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16413 #: ../src/guestfs-structs.pod:44
16414 msgid "guestfs_lvm_vg"
16418 #: ../src/guestfs-structs.pod:46
16421 " struct guestfs_lvm_vg {\n"
16422 " char *vg_name;\n"
16423 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16424 " char vg_uuid[32];\n"
16426 " char *vg_attr;\n"
16427 " uint64_t vg_size;\n"
16428 " uint64_t vg_free;\n"
16429 " char *vg_sysid;\n"
16430 " uint64_t vg_extent_size;\n"
16431 " int64_t vg_extent_count;\n"
16432 " int64_t vg_free_count;\n"
16433 " int64_t max_lv;\n"
16434 " int64_t max_pv;\n"
16435 " int64_t pv_count;\n"
16436 " int64_t lv_count;\n"
16437 " int64_t snap_count;\n"
16438 " int64_t vg_seqno;\n"
16439 " char *vg_tags;\n"
16440 " int64_t vg_mda_count;\n"
16441 " uint64_t vg_mda_free;\n"
16447 #: ../src/guestfs-structs.pod:69
16450 " struct guestfs_lvm_vg_list {\n"
16451 " uint32_t len; /* Number of elements in list. */\n"
16452 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16458 #: ../src/guestfs-structs.pod:74
16461 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16462 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16467 #: ../src/guestfs-structs.pod:77
16468 msgid "guestfs_lvm_lv"
16472 #: ../src/guestfs-structs.pod:79
16475 " struct guestfs_lvm_lv {\n"
16476 " char *lv_name;\n"
16477 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16478 " char lv_uuid[32];\n"
16479 " char *lv_attr;\n"
16480 " int64_t lv_major;\n"
16481 " int64_t lv_minor;\n"
16482 " int64_t lv_kernel_major;\n"
16483 " int64_t lv_kernel_minor;\n"
16484 " uint64_t lv_size;\n"
16485 " int64_t seg_count;\n"
16487 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16488 " float snap_percent;\n"
16489 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16490 " float copy_percent;\n"
16491 " char *move_pv;\n"
16492 " char *lv_tags;\n"
16493 " char *mirror_log;\n"
16494 " char *modules;\n"
16500 #: ../src/guestfs-structs.pod:101
16503 " struct guestfs_lvm_lv_list {\n"
16504 " uint32_t len; /* Number of elements in list. */\n"
16505 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16511 #: ../src/guestfs-structs.pod:106
16514 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16515 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16520 #: ../src/guestfs-structs.pod:111
16523 " struct guestfs_stat {\n"
16527 " int64_t nlink;\n"
16532 " int64_t blksize;\n"
16533 " int64_t blocks;\n"
16534 " int64_t atime;\n"
16535 " int64_t mtime;\n"
16536 " int64_t ctime;\n"
16542 #: ../src/guestfs-structs.pod:127
16545 " struct guestfs_stat_list {\n"
16546 " uint32_t len; /* Number of elements in list. */\n"
16547 " struct guestfs_stat *val; /* Elements. */\n"
16553 #: ../src/guestfs-structs.pod:132
16556 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16557 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16562 #: ../src/guestfs-structs.pod:137
16565 " struct guestfs_statvfs {\n"
16566 " int64_t bsize;\n"
16567 " int64_t frsize;\n"
16568 " int64_t blocks;\n"
16569 " int64_t bfree;\n"
16570 " int64_t bavail;\n"
16571 " int64_t files;\n"
16572 " int64_t ffree;\n"
16573 " int64_t favail;\n"
16576 " int64_t namemax;\n"
16582 #: ../src/guestfs-structs.pod:151
16585 " struct guestfs_statvfs_list {\n"
16586 " uint32_t len; /* Number of elements in list. */\n"
16587 " struct guestfs_statvfs *val; /* Elements. */\n"
16593 #: ../src/guestfs-structs.pod:156
16596 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16597 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16602 #: ../src/guestfs-structs.pod:159
16603 msgid "guestfs_dirent"
16607 #: ../src/guestfs-structs.pod:161
16610 " struct guestfs_dirent {\n"
16619 #: ../src/guestfs-structs.pod:167
16622 " struct guestfs_dirent_list {\n"
16623 " uint32_t len; /* Number of elements in list. */\n"
16624 " struct guestfs_dirent *val; /* Elements. */\n"
16630 #: ../src/guestfs-structs.pod:172
16633 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16634 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16639 #: ../src/guestfs-structs.pod:177
16642 " struct guestfs_version {\n"
16643 " int64_t major;\n"
16644 " int64_t minor;\n"
16645 " int64_t release;\n"
16652 #: ../src/guestfs-structs.pod:184
16655 " struct guestfs_version_list {\n"
16656 " uint32_t len; /* Number of elements in list. */\n"
16657 " struct guestfs_version *val; /* Elements. */\n"
16663 #: ../src/guestfs-structs.pod:189
16666 " void guestfs_free_version (struct guestfs_free_version *);\n"
16667 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16672 #: ../src/guestfs-structs.pod:192
16673 msgid "guestfs_xattr"
16677 #: ../src/guestfs-structs.pod:194
16680 " struct guestfs_xattr {\n"
16681 " char *attrname;\n"
16682 " /* The next two fields describe a byte array. */\n"
16683 " uint32_t attrval_len;\n"
16684 " char *attrval;\n"
16690 #: ../src/guestfs-structs.pod:201
16693 " struct guestfs_xattr_list {\n"
16694 " uint32_t len; /* Number of elements in list. */\n"
16695 " struct guestfs_xattr *val; /* Elements. */\n"
16701 #: ../src/guestfs-structs.pod:206
16704 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
16705 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
16710 #: ../src/guestfs-structs.pod:209
16711 msgid "guestfs_inotify_event"
16715 #: ../src/guestfs-structs.pod:211
16718 " struct guestfs_inotify_event {\n"
16719 " int64_t in_wd;\n"
16720 " uint32_t in_mask;\n"
16721 " uint32_t in_cookie;\n"
16722 " char *in_name;\n"
16728 #: ../src/guestfs-structs.pod:218
16731 " struct guestfs_inotify_event_list {\n"
16732 " uint32_t len; /* Number of elements in list. */\n"
16733 " struct guestfs_inotify_event *val; /* Elements. */\n"
16739 #: ../src/guestfs-structs.pod:223
16742 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
16743 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
16748 #: ../src/guestfs-structs.pod:226
16749 msgid "guestfs_partition"
16753 #: ../src/guestfs-structs.pod:228
16756 " struct guestfs_partition {\n"
16757 " int32_t part_num;\n"
16758 " uint64_t part_start;\n"
16759 " uint64_t part_end;\n"
16760 " uint64_t part_size;\n"
16766 #: ../src/guestfs-structs.pod:235
16769 " struct guestfs_partition_list {\n"
16770 " uint32_t len; /* Number of elements in list. */\n"
16771 " struct guestfs_partition *val; /* Elements. */\n"
16777 #: ../src/guestfs-structs.pod:240
16780 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
16781 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
16786 #: ../src/guestfs-structs.pod:243
16787 msgid "guestfs_application"
16791 #: ../src/guestfs-structs.pod:245
16794 " struct guestfs_application {\n"
16795 " char *app_name;\n"
16796 " char *app_display_name;\n"
16797 " int32_t app_epoch;\n"
16798 " char *app_version;\n"
16799 " char *app_release;\n"
16800 " char *app_install_path;\n"
16801 " char *app_trans_path;\n"
16802 " char *app_publisher;\n"
16803 " char *app_url;\n"
16804 " char *app_source_package;\n"
16805 " char *app_summary;\n"
16806 " char *app_description;\n"
16812 #: ../src/guestfs-structs.pod:260
16815 " struct guestfs_application_list {\n"
16816 " uint32_t len; /* Number of elements in list. */\n"
16817 " struct guestfs_application *val; /* Elements. */\n"
16823 #: ../src/guestfs-structs.pod:265
16826 " void guestfs_free_application (struct guestfs_free_application *);\n"
16827 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
16832 #: ../fish/guestfish.pod:5
16833 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16837 #: ../fish/guestfish.pod:9
16840 " guestfish [--options] [commands]\n"
16845 #: ../fish/guestfish.pod:11
16853 #: ../fish/guestfish.pod:13
16856 " guestfish [--ro|--rw] -a disk.img\n"
16861 #: ../fish/guestfish.pod:15
16864 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16869 #: ../fish/guestfish.pod:17
16872 " guestfish -d libvirt-domain\n"
16877 #: ../fish/guestfish.pod:19
16880 " guestfish [--ro|--rw] -a disk.img -i\n"
16885 #: ../fish/guestfish.pod:21
16888 " guestfish -d libvirt-domain -i\n"
16893 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
16894 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
16895 #: ../tools/virt-rescue.pl:41
16900 #: ../fish/guestfish.pod:25
16902 "Using guestfish in read/write mode on live virtual machines can be "
16903 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16904 "option to use guestfish safely if the disk image or virtual machine might be "
16909 #: ../fish/guestfish.pod:32
16911 "Guestfish is a shell and command-line tool for examining and modifying "
16912 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16913 "functionality of the guestfs API, see L<guestfs(3)>."
16917 #: ../fish/guestfish.pod:36
16919 "Guestfish gives you structured access to the libguestfs API, from shell "
16920 "scripts or the command line or interactively. If you want to rescue a "
16921 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16926 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:846
16927 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
16928 #: ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:45
16933 #: ../fish/guestfish.pod:43
16934 msgid "As an interactive shell"
16938 #: ../fish/guestfish.pod:45
16946 #: ../fish/guestfish.pod:47
16949 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16950 " editing virtual machine filesystems.\n"
16955 #: ../fish/guestfish.pod:50
16958 " Type: 'help' for a list of commands\n"
16959 " 'man' to read the manual\n"
16960 " 'quit' to quit the shell\n"
16965 #: ../fish/guestfish.pod:54
16968 " ><fs> add-ro disk.img\n"
16970 " ><fs> list-filesystems\n"
16971 " /dev/sda1: ext4\n"
16972 " /dev/vg_guest/lv_root: ext4\n"
16973 " /dev/vg_guest/lv_swap: swap\n"
16974 " ><fs> mount /dev/vg_guest/lv_root /\n"
16975 " ><fs> cat /etc/fstab\n"
16977 " # Created by anaconda\n"
16984 #: ../fish/guestfish.pod:67
16985 msgid "From shell scripts"
16989 #: ../fish/guestfish.pod:69
16990 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16994 #: ../fish/guestfish.pod:71
16997 " guestfish <<_EOF_\n"
17000 " mount /dev/vg_guest/lv_root /\n"
17001 " write /etc/motd \"Welcome, new users\"\n"
17007 #: ../fish/guestfish.pod:78
17008 msgid "List the LVM logical volumes in a disk image:"
17012 #: ../fish/guestfish.pod:80
17015 " guestfish -a disk.img --ro <<_EOF_\n"
17023 #: ../fish/guestfish.pod:85
17024 msgid "List all the filesystems in a disk image:"
17028 #: ../fish/guestfish.pod:87
17031 " guestfish -a disk.img --ro <<_EOF_\n"
17033 " list-filesystems\n"
17039 #: ../fish/guestfish.pod:92
17040 msgid "On one command line"
17044 #: ../fish/guestfish.pod:94
17045 msgid "Update C</etc/resolv.conf> in a guest:"
17049 #: ../fish/guestfish.pod:96
17053 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17054 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17059 #: ../fish/guestfish.pod:100
17060 msgid "Edit C</boot/grub/grub.conf> interactively:"
17064 #: ../fish/guestfish.pod:102
17067 " guestfish --rw --add disk.img \\\n"
17068 " --mount /dev/vg_guest/lv_root \\\n"
17069 " --mount /dev/sda1:/boot \\\n"
17070 " edit /boot/grub/grub.conf\n"
17075 #: ../fish/guestfish.pod:107
17076 msgid "Mount disks automatically"
17080 #: ../fish/guestfish.pod:109
17082 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17086 #: ../fish/guestfish.pod:112
17089 " guestfish --ro -a disk.img -i cat /etc/group\n"
17094 #: ../fish/guestfish.pod:114
17097 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17102 #: ../fish/guestfish.pod:116
17103 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17107 #: ../fish/guestfish.pod:118
17110 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17115 #: ../fish/guestfish.pod:120
17116 msgid "As a script interpreter"
17120 #: ../fish/guestfish.pod:122
17121 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17125 #: ../fish/guestfish.pod:124
17128 " #!/usr/bin/guestfish -f\n"
17129 " sparse test1.img 100M\n"
17131 " part-disk /dev/sda mbr\n"
17132 " mkfs ext2 /dev/sda1\n"
17137 #: ../fish/guestfish.pod:130
17138 msgid "Start with a prepared disk"
17142 #: ../fish/guestfish.pod:132
17144 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17145 "single ext2-formatted partition:"
17149 #: ../fish/guestfish.pod:135
17152 " guestfish -N fs\n"
17157 #: ../fish/guestfish.pod:137
17158 msgid "To list what is available do:"
17162 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:837
17165 " guestfish -N help | less\n"
17170 #: ../fish/guestfish.pod:141
17171 msgid "Remote control"
17175 #: ../fish/guestfish.pod:143
17178 " eval \"`guestfish --listen`\"\n"
17179 " guestfish --remote add-ro disk.img\n"
17180 " guestfish --remote run\n"
17181 " guestfish --remote lvs\n"
17186 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
17187 #: ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68
17188 #: ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171
17189 #: ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257
17190 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-tar.pl:98
17191 #: ../tools/virt-rescue.pl:103 ../tools/virt-make-fs.pl:153
17192 #: ../tools/virt-list-partitions.pl:51
17197 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
17198 #: ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80
17199 #: ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86
17200 #: ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58
17201 #: ../tools/virt-tar.pl:106 ../tools/virt-rescue.pl:111
17202 #: ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:59
17207 #: ../fish/guestfish.pod:154
17208 msgid "Displays general help on options."
17212 #: ../fish/guestfish.pod:156
17213 msgid "B<-h> | B<--cmd-help>"
17217 #: ../fish/guestfish.pod:158
17218 msgid "Lists all available guestfish commands."
17222 #: ../fish/guestfish.pod:160
17223 msgid "B<-h cmd> | B<--cmd-help cmd>"
17227 #: ../fish/guestfish.pod:162
17228 msgid "Displays detailed help on a single command C<cmd>."
17232 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
17233 msgid "B<-a image> | B<--add image>"
17237 #: ../fish/guestfish.pod:166
17238 msgid "Add a block device or virtual machine image to the shell."
17242 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
17244 "The format of the disk image is auto-detected. To override this and force a "
17245 "particular format use the I<--format=..> option."
17249 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
17250 msgid "B<-c URI> | B<--connect URI>"
17254 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
17256 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17257 "URI to use. The default is to use the default libvirt connection."
17261 #: ../fish/guestfish.pod:177
17266 #: ../fish/guestfish.pod:179
17268 "If using the I<--listen> option and a csh-like shell, use this option. See "
17269 "section L</REMOTE CONTROL AND CSH> below."
17273 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
17274 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
17278 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
17280 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17281 "used, then any libvirt domain can be used. However in write mode, only "
17282 "libvirt domains which are shut down can be named here."
17286 #: ../fish/guestfish.pod:188
17287 msgid "B<-D> | B<--no-dest-paths>"
17291 #: ../fish/guestfish.pod:190
17293 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17294 "to hit the tab key to complete paths on the guest filesystem, but this "
17295 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17296 "allow this feature to be disabled."
17300 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
17301 msgid "B<--echo-keys>"
17305 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
17307 "When prompting for keys and passphrases, guestfish normally turns echoing "
17308 "off so you cannot see what you are typing. If you are not worried about "
17309 "Tempest attacks and there is no one else in the room you can specify this "
17310 "flag to see what you are typing."
17314 #: ../fish/guestfish.pod:202
17315 msgid "B<-f file> | B<--file file>"
17319 #: ../fish/guestfish.pod:204
17320 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17324 #: ../fish/guestfish.pod:207
17327 " #!/usr/bin/guestfish -f\n"
17332 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
17333 msgid "B<--format=raw|qcow2|..> | B<--format>"
17337 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
17339 "The default for the I<-a> option is to auto-detect the format of the disk "
17340 "image. Using this forces the disk format for I<-a> options which follow on "
17341 "the command line. Using I<--format> with no argument switches back to auto-"
17342 "detection for subsequent I<-a> options."
17346 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:543
17347 #: ../inspector/virt-inspector.pl:431
17348 msgid "For example:"
17352 #: ../fish/guestfish.pod:218
17355 " guestfish --format=raw -a disk.img\n"
17360 #: ../fish/guestfish.pod:220
17361 msgid "forces raw format (no auto-detection) for C<disk.img>."
17365 #: ../fish/guestfish.pod:222
17368 " guestfish --format=raw -a disk.img --format -a another.img\n"
17373 #: ../fish/guestfish.pod:224
17375 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17376 "detection for C<another.img>."
17380 #: ../fish/guestfish.pod:227
17382 "If you have untrusted raw-format guest disk images, you should use this "
17383 "option to specify the disk format. This avoids a possible security problem "
17384 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17388 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
17389 msgid "B<-i> | B<--inspector>"
17393 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
17395 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17396 "system and mount filesystems as they would be mounted on the real virtual "
17401 #: ../fish/guestfish.pod:238
17402 msgid "Typical usage is either:"
17406 #: ../fish/guestfish.pod:240
17409 " guestfish -d myguest -i\n"
17414 #: ../fish/guestfish.pod:242
17415 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17419 #: ../fish/guestfish.pod:244
17422 " guestfish --ro -d myguest -i\n"
17427 #: ../fish/guestfish.pod:246
17428 msgid "(for active domains, readonly), or specify the block device directly:"
17432 #: ../fish/guestfish.pod:248
17435 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17440 #: ../fish/guestfish.pod:250
17442 "Note that the command line syntax changed slightly over older versions of "
17443 "guestfish. You can still use the old syntax:"
17447 #: ../fish/guestfish.pod:253
17450 " guestfish [--ro] -i disk.img\n"
17455 #: ../fish/guestfish.pod:255
17458 " guestfish [--ro] -i libvirt-domain\n"
17463 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
17464 msgid "B<--keys-from-stdin>"
17468 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
17470 "Read key or passphrase parameters from stdin. The default is to try to read "
17471 "passphrases from the user by opening C</dev/tty>."
17475 #: ../fish/guestfish.pod:262
17476 msgid "B<--listen>"
17480 #: ../fish/guestfish.pod:264
17482 "Fork into the background and listen for remote commands. See section L</"
17483 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17487 #: ../fish/guestfish.pod:267
17488 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
17492 #: ../fish/guestfish.pod:269
17493 msgid "Mount the named partition or logical volume on the given mountpoint."
17497 #: ../fish/guestfish.pod:271
17498 msgid "If the mountpoint is omitted, it defaults to C</>."
17502 #: ../fish/guestfish.pod:273
17503 msgid "You have to mount something on C</> before most commands will work."
17507 #: ../fish/guestfish.pod:275
17509 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17514 #: ../fish/guestfish.pod:278
17516 "If you don't know what filesystems a disk image contains, you can either run "
17517 "guestfish without this option, then list the partitions and LVs available "
17518 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
17519 "list-filesystems(1)> program."
17523 #: ../fish/guestfish.pod:283 ../fuse/guestmount.pod:154
17524 msgid "B<-n> | B<--no-sync>"
17528 #: ../fish/guestfish.pod:285
17530 "Disable autosync. This is enabled by default. See the discussion of "
17531 "autosync in the L<guestfs(3)> manpage."
17535 #: ../fish/guestfish.pod:288
17536 msgid "B<-N type> | B<--new type> | B<-N help>"
17540 #: ../fish/guestfish.pod:290
17542 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17543 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17544 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17549 #: ../fish/guestfish.pod:295
17550 msgid "B<--progress-bars>"
17554 #: ../fish/guestfish.pod:297
17555 msgid "Enable progress bars, even when guestfish is used non-interactively."
17559 #: ../fish/guestfish.pod:299
17561 "Progress bars are enabled by default when guestfish is used as an "
17562 "interactive shell."
17566 #: ../fish/guestfish.pod:302
17567 msgid "B<--no-progress-bars>"
17571 #: ../fish/guestfish.pod:304
17572 msgid "Disable progress bars."
17576 #: ../fish/guestfish.pod:306
17577 msgid "B<--remote[=pid]>"
17581 #: ../fish/guestfish.pod:308
17583 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17584 "CONTROL GUESTFISH OVER A SOCKET> below."
17588 #: ../fish/guestfish.pod:311 ../fuse/guestmount.pod:196
17589 msgid "B<-r> | B<--ro>"
17593 #: ../fish/guestfish.pod:313
17595 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
17596 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
17600 #: ../fish/guestfish.pod:316 ../tools/virt-rescue.pl:187
17602 "The option must always be used if the disk image or virtual machine might be "
17603 "running, and is generally recommended in cases where you don't need write "
17604 "access to the disk."
17608 #: ../fish/guestfish.pod:320
17610 "Note that prepared disk images created with I<-N> are not affected by the "
17615 #: ../fish/guestfish.pod:323
17616 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17620 #: ../fish/guestfish.pod:325 ../fuse/guestmount.pod:208
17621 #: ../tools/virt-rescue.pl:195
17622 msgid "B<--selinux>"
17626 #: ../fish/guestfish.pod:327
17627 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17631 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:212
17632 msgid "B<-v> | B<--verbose>"
17636 #: ../fish/guestfish.pod:331
17638 "Enable very verbose messages. This is particularly useful if you find a bug."
17642 #: ../fish/guestfish.pod:334 ../fuse/guestmount.pod:216
17643 msgid "B<-V> | B<--version>"
17647 #: ../fish/guestfish.pod:336
17648 msgid "Display the guestfish / libguestfs version number and exit."
17652 #: ../fish/guestfish.pod:338 ../fuse/guestmount.pod:220
17653 msgid "B<-w> | B<--rw>"
17657 #: ../fish/guestfish.pod:340
17659 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
17664 #: ../fish/guestfish.pod:343
17669 #: ../fish/guestfish.pod:345
17670 msgid "Echo each command before executing it."
17674 #: ../fish/guestfish.pod:349
17675 msgid "COMMANDS ON COMMAND LINE"
17679 #: ../fish/guestfish.pod:351
17681 "Any additional (non-option) arguments are treated as commands to execute."
17685 #: ../fish/guestfish.pod:354
17687 "Commands to execute should be separated by a colon (C<:>), where the colon "
17688 "is a separate parameter. Thus:"
17692 #: ../fish/guestfish.pod:357
17695 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17700 #: ../fish/guestfish.pod:359
17702 "If there are no additional arguments, then we enter a shell, either an "
17703 "interactive shell with a prompt (if the input is a terminal) or a non-"
17704 "interactive shell."
17708 #: ../fish/guestfish.pod:363
17710 "In either command line mode or non-interactive shell, the first command that "
17711 "gives an error causes the whole shell to exit. In interactive mode (with a "
17712 "prompt) if a command fails, you can continue to enter commands."
17716 #: ../fish/guestfish.pod:368
17717 msgid "USING launch (OR run)"
17721 #: ../fish/guestfish.pod:370
17723 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17724 "then launch it, then mount any disks you need, and finally issue actions/"
17725 "commands. So the general order of the day is:"
17729 #: ../fish/guestfish.pod:378
17730 msgid "add or -a/--add"
17734 #: ../fish/guestfish.pod:382
17735 msgid "launch (aka run)"
17739 #: ../fish/guestfish.pod:386
17740 msgid "mount or -m/--mount"
17744 #: ../fish/guestfish.pod:390
17745 msgid "any other commands"
17749 #: ../fish/guestfish.pod:394
17751 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17752 "guest before mounting or performing any other commands."
17756 #: ../fish/guestfish.pod:397
17758 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17759 "I<--new> options were given then C<run> is done automatically, simply "
17760 "because guestfish can't perform the action you asked for without doing this."
17764 #: ../fish/guestfish.pod:402
17765 msgid "OPENING DISKS FOR READ AND WRITE"
17769 #: ../fish/guestfish.pod:404
17771 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
17772 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
17773 "open disk images read-only or for writing."
17777 #: ../fish/guestfish.pod:408
17779 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
17780 "disk images supplied on the command line for write. To open a disk image "
17781 "read-only you have to do I<-a image --ro>."
17785 #: ../fish/guestfish.pod:412
17787 "This matters: If you accidentally open a live VM disk image writable then "
17788 "you will cause irreversible disk corruption."
17792 #: ../fish/guestfish.pod:415
17794 "By libguestfs 1.8 we intend to change the default the other way. Disk "
17795 "images will be opened read-only. You will have to either specify "
17796 "I<guestfish --rw> or change a configuration file in order to get write "
17797 "access for disk images specified by those other command line options."
17801 #: ../fish/guestfish.pod:420
17803 "This version of guestfish has a I<--rw> option which does nothing (it is "
17804 "already the default). However it is highly recommended that you use this "
17805 "option to indicate that guestfish needs write access, and to prepare your "
17806 "scripts for the day when this option will be required for write access."
17810 #: ../fish/guestfish.pod:426
17812 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17813 "other libguestfs program apart from guestfish and guestmount."
17817 #: ../fish/guestfish.pod:429
17822 #: ../fish/guestfish.pod:431
17824 "You can quote ordinary parameters using either single or double quotes. For "
17829 #: ../fish/guestfish.pod:434
17832 " add \"file with a space.img\"\n"
17837 #: ../fish/guestfish.pod:436
17840 " rm '/file name'\n"
17845 #: ../fish/guestfish.pod:438
17853 #: ../fish/guestfish.pod:440
17855 "A few commands require a list of strings to be passed. For these, use a "
17856 "whitespace-separated list, enclosed in quotes. Strings containing "
17857 "whitespace to be passed through must be enclosed in single quotes. A "
17858 "literal single quote must be escaped with a backslash."
17862 #: ../fish/guestfish.pod:445
17865 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17866 " command \"/bin/echo 'foo bar'\"\n"
17867 " command \"/bin/echo \\'foo\\'\"\n"
17872 #: ../fish/guestfish.pod:449
17873 msgid "OPTIONAL ARGUMENTS"
17877 #: ../fish/guestfish.pod:451
17879 "Some commands take optional arguments. These arguments appear in this "
17880 "documentation as C<[argname:..]>. You can use them as in these examples:"
17884 #: ../fish/guestfish.pod:455
17887 " add-drive-opts filename\n"
17892 #: ../fish/guestfish.pod:457
17895 " add-drive-opts filename readonly:true\n"
17900 #: ../fish/guestfish.pod:459
17903 " add-drive-opts filename format:qcow2 readonly:false\n"
17908 #: ../fish/guestfish.pod:461
17910 "Each optional argument can appear at most once. All optional arguments must "
17911 "appear after the required ones."
17915 #: ../fish/guestfish.pod:464
17920 #: ../fish/guestfish.pod:466
17922 "This section applies to all commands which can take integers as parameters."
17926 #: ../fish/guestfish.pod:469
17927 msgid "SIZE SUFFIX"
17931 #: ../fish/guestfish.pod:471
17933 "When the command takes a parameter measured in bytes, you can use one of the "
17934 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17938 #: ../fish/guestfish.pod:477
17939 msgid "B<k> or B<K> or B<KiB>"
17943 #: ../fish/guestfish.pod:479
17944 msgid "The size in kilobytes (multiplied by 1024)."
17948 #: ../fish/guestfish.pod:481
17953 #: ../fish/guestfish.pod:483
17954 msgid "The size in SI 1000 byte units."
17958 #: ../fish/guestfish.pod:485
17959 msgid "B<M> or B<MiB>"
17963 #: ../fish/guestfish.pod:487
17964 msgid "The size in megabytes (multiplied by 1048576)."
17968 #: ../fish/guestfish.pod:489
17973 #: ../fish/guestfish.pod:491
17974 msgid "The size in SI 1000000 byte units."
17978 #: ../fish/guestfish.pod:493
17979 msgid "B<G> or B<GiB>"
17983 #: ../fish/guestfish.pod:495
17984 msgid "The size in gigabytes (multiplied by 2**30)."
17988 #: ../fish/guestfish.pod:497
17993 #: ../fish/guestfish.pod:499
17994 msgid "The size in SI 10**9 byte units."
17998 #: ../fish/guestfish.pod:501
17999 msgid "B<T> or B<TiB>"
18003 #: ../fish/guestfish.pod:503
18004 msgid "The size in terabytes (multiplied by 2**40)."
18008 #: ../fish/guestfish.pod:505
18013 #: ../fish/guestfish.pod:507
18014 msgid "The size in SI 10**12 byte units."
18018 #: ../fish/guestfish.pod:509
18019 msgid "B<P> or B<PiB>"
18023 #: ../fish/guestfish.pod:511
18024 msgid "The size in petabytes (multiplied by 2**50)."
18028 #: ../fish/guestfish.pod:513
18033 #: ../fish/guestfish.pod:515
18034 msgid "The size in SI 10**15 byte units."
18038 #: ../fish/guestfish.pod:517
18039 msgid "B<E> or B<EiB>"
18043 #: ../fish/guestfish.pod:519
18044 msgid "The size in exabytes (multiplied by 2**60)."
18048 #: ../fish/guestfish.pod:521
18053 #: ../fish/guestfish.pod:523
18054 msgid "The size in SI 10**18 byte units."
18058 #: ../fish/guestfish.pod:525
18059 msgid "B<Z> or B<ZiB>"
18063 #: ../fish/guestfish.pod:527
18064 msgid "The size in zettabytes (multiplied by 2**70)."
18068 #: ../fish/guestfish.pod:529
18073 #: ../fish/guestfish.pod:531
18074 msgid "The size in SI 10**21 byte units."
18078 #: ../fish/guestfish.pod:533
18079 msgid "B<Y> or B<YiB>"
18083 #: ../fish/guestfish.pod:535
18084 msgid "The size in yottabytes (multiplied by 2**80)."
18088 #: ../fish/guestfish.pod:537
18093 #: ../fish/guestfish.pod:539
18094 msgid "The size in SI 10**24 byte units."
18098 #: ../fish/guestfish.pod:545
18101 " truncate-size /file 1G\n"
18106 #: ../fish/guestfish.pod:547
18107 msgid "would truncate the file to 1 gigabyte."
18111 #: ../fish/guestfish.pod:549
18113 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18114 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18115 "suffix will probably not do what you expect."
18119 #: ../fish/guestfish.pod:553
18120 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18124 #: ../fish/guestfish.pod:555
18126 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18127 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18131 #: ../fish/guestfish.pod:558
18134 " 1234 decimal number 1234\n"
18135 " 02322 octal number, equivalent to decimal 1234\n"
18136 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18141 #: ../fish/guestfish.pod:562
18143 "When using the C<chmod> command, you almost always want to specify an octal "
18144 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18145 "L<chmod(1)> program):"
18149 #: ../fish/guestfish.pod:566
18152 " chmod 0777 /public # OK\n"
18153 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18158 #: ../fish/guestfish.pod:569
18160 "Commands that return numbers usually print them in decimal, but some "
18161 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18162 "octal, preceeded by C<0>)."
18166 #: ../fish/guestfish.pod:573
18167 msgid "WILDCARDS AND GLOBBING"
18171 #: ../fish/guestfish.pod:575
18173 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18174 "(globbing) by default. So for example the following will not do what you "
18179 #: ../fish/guestfish.pod:579
18187 #: ../fish/guestfish.pod:581
18189 "Assuming you don't have a directory called literally C</home/*> then the "
18190 "above command will return an error."
18194 #: ../fish/guestfish.pod:584
18195 msgid "To perform wildcard expansion, use the C<glob> command."
18199 #: ../fish/guestfish.pod:586
18202 " glob rm-rf /home/*\n"
18207 #: ../fish/guestfish.pod:588
18209 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18210 "many times), equivalent to:"
18214 #: ../fish/guestfish.pod:591
18217 " rm-rf /home/jim\n"
18218 " rm-rf /home/joe\n"
18219 " rm-rf /home/mary\n"
18224 #: ../fish/guestfish.pod:595
18225 msgid "C<glob> only works on simple guest paths and not on device names."
18229 #: ../fish/guestfish.pod:597
18231 "If you have several parameters, each containing a wildcard, then glob will "
18232 "perform a Cartesian product."
18236 #: ../fish/guestfish.pod:600
18241 #: ../fish/guestfish.pod:602
18243 "Any line which starts with a I<#> character is treated as a comment and "
18244 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18245 "a command. For example:"
18249 #: ../fish/guestfish.pod:606
18252 " # this is a comment\n"
18253 " # this is a comment\n"
18254 " foo # NOT a comment\n"
18259 #: ../fish/guestfish.pod:610
18260 msgid "Blank lines are also ignored."
18264 #: ../fish/guestfish.pod:612
18265 msgid "RUNNING COMMANDS LOCALLY"
18269 #: ../fish/guestfish.pod:614
18271 "Any line which starts with a I<!> character is treated as a command sent to "
18272 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18276 #: ../fish/guestfish.pod:618
18280 " tgz-out /remote local/remote-data.tar.gz\n"
18285 #: ../fish/guestfish.pod:621
18287 "will create a directory C<local> on the host, and then export the contents "
18288 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18289 "(See C<tgz-out>)."
18293 #: ../fish/guestfish.pod:625
18295 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18296 "effect, due to the way that subprocesses work in Unix."
18300 #: ../fish/guestfish.pod:628
18305 #: ../fish/guestfish.pod:630
18307 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18308 "command (a guestfish command) to the second command (any host command). For "
18313 #: ../fish/guestfish.pod:634
18316 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18321 #: ../fish/guestfish.pod:636
18323 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18324 "program). The above command would list all accounts in the guest filesystem "
18325 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18329 #: ../fish/guestfish.pod:641
18332 " hexdump /bin/ls | head\n"
18333 " list-devices | tail -1\n"
18334 " tgz-out / - | tar ztf -\n"
18339 #: ../fish/guestfish.pod:645
18341 "The space before the pipe symbol is required, any space after the pipe "
18342 "symbol is optional. Everything after the pipe symbol is just passed "
18343 "straight to the host shell, so it can contain redirections, globs and "
18344 "anything else that makes sense on the host side."
18348 #: ../fish/guestfish.pod:650
18350 "To use a literal argument which begins with a pipe symbol, you have to quote "
18355 #: ../fish/guestfish.pod:653
18363 #: ../fish/guestfish.pod:655
18364 msgid "HOME DIRECTORIES"
18368 #: ../fish/guestfish.pod:657
18370 "If a parameter starts with the character C<~> then the tilde may be expanded "
18371 "as a home directory path (either C<~> for the current user's home directory, "
18372 "or C<~user> for another user)."
18376 #: ../fish/guestfish.pod:661
18378 "Note that home directory expansion happens for users known I<on the host>, "
18379 "not in the guest filesystem."
18383 #: ../fish/guestfish.pod:664
18385 "To use a literal argument which begins with a tilde, you have to quote it, "
18390 #: ../fish/guestfish.pod:667
18398 #: ../fish/guestfish.pod:671
18400 "Libguestfs has some support for Linux guests encrypted according to the "
18401 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18402 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18403 "LUKS is supported."
18407 #: ../fish/guestfish.pod:676
18408 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18412 #: ../fish/guestfish.pod:678
18415 " ><fs> vfs-type /dev/sda2\n"
18421 #: ../fish/guestfish.pod:681
18423 "Then open those devices using L</luks-open>. This creates a device-mapper "
18424 "device called C</dev/mapper/luksdev>."
18428 #: ../fish/guestfish.pod:684
18431 " ><fs> luks-open /dev/sda2 luksdev\n"
18432 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18437 #: ../fish/guestfish.pod:687
18439 "Finally you have to tell LVM to scan for volume groups on the newly created "
18444 #: ../fish/guestfish.pod:690
18448 " vg-activate-all true\n"
18453 #: ../fish/guestfish.pod:693
18454 msgid "The logical volume(s) can now be mounted in the usual way."
18458 #: ../fish/guestfish.pod:695
18460 "Before closing a LUKS device you must unmount any logical volumes on it and "
18461 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18462 "one. Then you can close the mapper device:"
18466 #: ../fish/guestfish.pod:699
18469 " vg-activate false /dev/VG\n"
18470 " luks-close /dev/mapper/luksdev\n"
18475 #: ../fish/guestfish.pod:702
18476 msgid "WINDOWS PATHS"
18480 #: ../fish/guestfish.pod:704
18482 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18483 "(with some limitations). The following commands are equivalent:"
18487 #: ../fish/guestfish.pod:707
18490 " file /WINDOWS/system32/config/system.LOG\n"
18495 #: ../fish/guestfish.pod:709
18498 " file win:/windows/system32/config/system.log\n"
18503 #: ../fish/guestfish.pod:711
18506 " file win:\\windows\\system32\\config\\system.log\n"
18511 #: ../fish/guestfish.pod:713
18514 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18519 #: ../fish/guestfish.pod:715
18521 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18522 "handles case insensitivity like Windows would. This only works in argument "
18523 "positions that expect a path."
18527 #: ../fish/guestfish.pod:719
18528 msgid "UPLOADING AND DOWNLOADING FILES"
18532 #: ../fish/guestfish.pod:721
18534 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18535 "others which upload from or download to a local file, you can use the "
18536 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18540 #: ../fish/guestfish.pod:725
18548 #: ../fish/guestfish.pod:727
18550 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18554 #: ../fish/guestfish.pod:730
18557 " tar-out /etc - | tar tf -\n"
18562 #: ../fish/guestfish.pod:732
18564 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18565 "command (see L</PIPES>)."
18569 #: ../fish/guestfish.pod:735
18571 "When using C<-> to read from stdin, the input is read up to the end of "
18572 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18573 "some arbitrary end marker:"
18577 #: ../fish/guestfish.pod:739
18580 " upload -<<END /foo\n"
18589 #: ../fish/guestfish.pod:745
18591 "Any string of characters can be used instead of C<END>. The end marker must "
18592 "appear on a line of its own, without any preceeding or following characters "
18593 "(not even spaces)."
18597 #: ../fish/guestfish.pod:749
18599 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18600 "upload local files (so-called \"FileIn\" parameters in the generator)."
18604 #: ../fish/guestfish.pod:752
18605 msgid "EXIT ON ERROR BEHAVIOUR"
18609 #: ../fish/guestfish.pod:754
18611 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18612 "taking commands from a human over a tty), and will exit on the first error "
18613 "in non-interactive mode (scripts, commands given on the command line)."
18617 #: ../fish/guestfish.pod:759
18619 "If you prefix a command with a I<-> character, then that command will not "
18620 "cause guestfish to exit, even if that (one) command returns an error."
18624 #: ../fish/guestfish.pod:763
18625 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18629 #: ../fish/guestfish.pod:765
18631 "Guestfish can be remote-controlled over a socket. This is useful "
18632 "particularly in shell scripts where you want to make several different "
18633 "changes to a filesystem, but you don't want the overhead of starting up a "
18634 "guestfish process each time."
18638 #: ../fish/guestfish.pod:770
18639 msgid "Start a guestfish server process using:"
18643 #: ../fish/guestfish.pod:772
18646 " eval \"`guestfish --listen`\"\n"
18651 #: ../fish/guestfish.pod:774
18652 msgid "and then send it commands by doing:"
18656 #: ../fish/guestfish.pod:776
18659 " guestfish --remote cmd [...]\n"
18664 #: ../fish/guestfish.pod:778
18665 msgid "To cause the server to exit, send it the exit command:"
18669 #: ../fish/guestfish.pod:780
18672 " guestfish --remote exit\n"
18677 #: ../fish/guestfish.pod:782
18679 "Note that the server will normally exit if there is an error in a command. "
18680 "You can change this in the usual way. See section L</EXIT ON ERROR "
18685 #: ../fish/guestfish.pod:786
18686 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18690 #: ../fish/guestfish.pod:788
18692 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18693 "is how the I<--remote> option knows where to send the commands. You can "
18694 "have several guestfish listener processes running using:"
18698 #: ../fish/guestfish.pod:792
18701 " eval \"`guestfish --listen`\"\n"
18702 " pid1=$GUESTFISH_PID\n"
18703 " eval \"`guestfish --listen`\"\n"
18704 " pid2=$GUESTFISH_PID\n"
18706 " guestfish --remote=$pid1 cmd\n"
18707 " guestfish --remote=$pid2 cmd\n"
18712 #: ../fish/guestfish.pod:800
18713 msgid "REMOTE CONTROL AND CSH"
18717 #: ../fish/guestfish.pod:802
18719 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18724 #: ../fish/guestfish.pod:805
18727 " eval \"`guestfish --listen --csh`\"\n"
18732 #: ../fish/guestfish.pod:807
18733 msgid "REMOTE CONTROL DETAILS"
18737 #: ../fish/guestfish.pod:809
18739 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18740 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18741 "and C<$PID> is the process ID of the server."
18745 #: ../fish/guestfish.pod:813
18746 msgid "Guestfish client and server versions must match exactly."
18750 #: ../fish/guestfish.pod:815
18751 msgid "PREPARED DISK IMAGES"
18755 #: ../fish/guestfish.pod:817
18757 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18758 "preformatted disk images that guestfish can make for you to save typing. "
18759 "This is particularly useful for testing purposes. This option is used "
18760 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18761 "can be mixed with I<-a>)."
18765 #: ../fish/guestfish.pod:823
18767 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18768 "the second and so on. Existing files in the current directory are "
18773 #: ../fish/guestfish.pod:827
18775 "The type briefly describes how the disk should be sized, partitioned, how "
18776 "filesystem(s) should be created, and how content should be added. "
18777 "Optionally the type can be followed by extra parameters, separated by C<:> "
18778 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18779 "allocated disk, containing a single partition, with the partition formatted "
18780 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18785 #: ../fish/guestfish.pod:835
18786 msgid "To list the available types and any extra parameters they take, run:"
18790 #: ../fish/guestfish.pod:839
18792 "Note that the prepared filesystem is not mounted. You would usually have to "
18793 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18797 #: ../fish/guestfish.pod:843
18799 "If any I<-N> or I<--new> options are given, the guest is automatically "
18804 #: ../fish/guestfish.pod:848
18805 msgid "Create a 100MB disk with an ext4-formatted partition:"
18809 #: ../fish/guestfish.pod:850
18812 " guestfish -N fs:ext4\n"
18817 #: ../fish/guestfish.pod:852
18818 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18822 #: ../fish/guestfish.pod:854
18825 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18830 #: ../fish/guestfish.pod:856
18831 msgid "Create a blank 200MB disk:"
18835 #: ../fish/guestfish.pod:858
18838 " guestfish -N disk:200M\n"
18843 #: ../fish/guestfish.pod:860
18844 msgid "PROGRESS BARS"
18848 #: ../fish/guestfish.pod:862
18850 "Some (not all) long-running commands send progress notification messages as "
18851 "they are running. Guestfish turns these messages into progress bars."
18855 #: ../fish/guestfish.pod:866
18857 "When a command that supports progress bars takes longer than two seconds to "
18858 "run, and if progress bars are enabled, then you will see one appearing below "
18863 #: ../fish/guestfish.pod:870
18866 " ><fs> copy-size /large-file /another-file 2048M\n"
18867 " / 10% [#####-----------------------------------------] 00:30\n"
18872 #: ../fish/guestfish.pod:873
18874 "The spinner on the left hand side moves round once for every progress "
18875 "notification received from the backend. This is a (reasonably) golden "
18876 "assurance that the command is \"doing something\" even if the progress bar "
18877 "is not moving, because the command is able to send the progress "
18878 "notifications. When the bar reaches 100% and the command finishes, the "
18879 "spinner disappears."
18883 #: ../fish/guestfish.pod:880
18885 "Progress bars are enabled by default when guestfish is used interactively. "
18886 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18887 "and you can disable them completely using I<--no-progress-bars>."
18891 #: ../fish/guestfish.pod:885
18892 msgid "GUESTFISH COMMANDS"
18896 #: ../fish/guestfish.pod:887
18898 "The commands in this section are guestfish convenience commands, in other "
18899 "words, they are not part of the L<guestfs(3)> API."
18903 #: ../fish/guestfish.pod:890
18908 #: ../fish/guestfish.pod:892
18917 #: ../fish/guestfish.pod:895
18918 msgid "Without any parameter, this provides general help."
18922 #: ../fish/guestfish.pod:897
18923 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18927 #: ../fish/guestfish.pod:899
18928 msgid "quit | exit"
18932 #: ../fish/guestfish.pod:901
18933 msgid "This exits guestfish. You can also use C<^D> key."
18937 #: ../fish/guestfish.pod:903
18938 msgid "@FISH_COMMANDS@"
18942 #: ../fish/guestfish.pod:905
18947 #: ../fish/guestfish.pod:909 ../test-tool/libguestfs-test-tool.pod:83
18952 #: ../fish/guestfish.pod:911
18954 "guestfish returns 0 if the commands completed without error, or 1 if there "
18959 #: ../fish/guestfish.pod:918
18964 #: ../fish/guestfish.pod:920
18966 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18971 #: ../fish/guestfish.pod:923
18972 msgid "GUESTFISH_PID"
18976 #: ../fish/guestfish.pod:925
18978 "Used with the I<--remote> option to specify the remote guestfish process to "
18979 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18983 #: ../fish/guestfish.pod:929
18988 #: ../fish/guestfish.pod:931
18990 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18991 "not specified, the external L<hexedit(1)> program is used."
18995 #: ../fish/guestfish.pod:935
19000 #: ../fish/guestfish.pod:937
19002 "If compiled with GNU readline support, various files in the home directory "
19003 "can be used. See L</FILES>."
19007 #: ../fish/guestfish.pod:946
19009 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19010 "effect as using the B<-v> option."
19014 #: ../fish/guestfish.pod:958
19016 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19017 "the discussion of paths in L<guestfs(3)>."
19021 #: ../fish/guestfish.pod:969
19022 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19026 #: ../fish/guestfish.pod:971
19031 #: ../fish/guestfish.pod:973
19033 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19038 #: ../fish/guestfish.pod:988 ../test-tool/libguestfs-test-tool.pod:88
19043 #: ../fish/guestfish.pod:992
19044 msgid "$HOME/.guestfish"
19048 #: ../fish/guestfish.pod:994
19050 "If compiled with GNU readline support, then the command history is saved in "
19055 #: ../fish/guestfish.pod:997
19056 msgid "$HOME/.inputrc"
19060 #: ../fish/guestfish.pod:999
19061 msgid "/etc/inputrc"
19065 #: ../fish/guestfish.pod:1001
19067 "If compiled with GNU readline support, then these files can be used to "
19068 "configure readline. For further information, please see L<readline(3)/"
19069 "INITIALIZATION FILE>."
19073 #: ../fish/guestfish.pod:1005
19074 msgid "To write rules which only apply to guestfish, use:"
19078 #: ../fish/guestfish.pod:1007
19088 #: ../fish/guestfish.pod:1011
19090 "Variables that you can set in inputrc that change the behaviour of guestfish "
19091 "in useful ways include:"
19095 #: ../fish/guestfish.pod:1016
19096 msgid "completion-ignore-case (default: on)"
19100 #: ../fish/guestfish.pod:1018
19102 "By default, guestfish will ignore case when tab-completing paths on the "
19107 #: ../fish/guestfish.pod:1021
19110 " set completion-ignore-case off\n"
19115 #: ../fish/guestfish.pod:1023
19116 msgid "to make guestfish case sensitive."
19120 #: ../fish/guestfish.pod:1027
19125 #: ../fish/guestfish.pod:1029
19126 msgid "test2.img (etc)"
19130 #: ../fish/guestfish.pod:1031
19132 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19133 "will be created in the file C<test1.img> in the current directory. The "
19134 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19135 "the same name will be overwritten."
19139 #: ../fish/guestfish.pod:1040
19141 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
19142 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
19143 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
19144 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
19148 #: ../fish/guestfish.pod:1064 ../test-tool/libguestfs-test-tool.pod:124
19149 #: ../fuse/guestmount.pod:253 ../inspector/virt-inspector.pl:480
19150 #: ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518
19151 #: ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251
19152 #: ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206
19153 #: ../tools/virt-tar.pl:300 ../tools/virt-rescue.pl:285
19154 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:273
19156 "This program is free software; you can redistribute it and/or modify it "
19157 "under the terms of the GNU General Public License as published by the Free "
19158 "Software Foundation; either version 2 of the License, or (at your option) "
19159 "any later version."
19163 #: ../fish/guestfish.pod:1069 ../test-tool/libguestfs-test-tool.pod:129
19164 #: ../fuse/guestmount.pod:258 ../inspector/virt-inspector.pl:485
19165 #: ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523
19166 #: ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256
19167 #: ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211
19168 #: ../tools/virt-tar.pl:305 ../tools/virt-rescue.pl:290
19169 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:278
19171 "This program is distributed in the hope that it will be useful, but WITHOUT "
19172 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19173 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19178 #: ../fish/guestfish.pod:1074 ../test-tool/libguestfs-test-tool.pod:134
19179 #: ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pl:490
19180 #: ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528
19181 #: ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261
19182 #: ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216
19183 #: ../tools/virt-tar.pl:310 ../tools/virt-rescue.pl:295
19184 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:283
19186 "You should have received a copy of the GNU General Public License along with "
19187 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19188 "Ave, Cambridge, MA 02139, USA."
19192 #: ../fish/guestfish-actions.pod:1
19197 #: ../fish/guestfish-actions.pod:3
19200 " add-cdrom filename\n"
19205 #: ../fish/guestfish-actions.pod:15
19207 "This call checks for the existence of C<filename>. This stops you from "
19208 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19209 "and C<http:> URLs. To specify those, use the general L</config> call "
19214 #: ../fish/guestfish-actions.pod:22
19216 "If you just want to add an ISO file (often you use this as an efficient way "
19217 "to transfer large files into the guest), then you should probably use L</add-"
19218 "drive-ro> instead."
19222 #: ../fish/guestfish-actions.pod:35
19227 #: ../fish/guestfish-actions.pod:37
19232 #: ../fish/guestfish-actions.pod:39
19235 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19240 #: ../fish/guestfish-actions.pod:41
19242 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19243 "It works by connecting to libvirt, requesting the domain and domain XML from "
19244 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19248 #: ../fish/guestfish-actions.pod:58
19250 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
19251 "libvirt.org/uri.html>). If this is not set then we connect to the default "
19252 "libvirt URI (or one set through an environment variable, see the libvirt "
19253 "documentation for full details). If you are using the C API directly then "
19254 "it is more flexible to create the libvirt connection object yourself, get "
19255 "the domain object, and call L</add-libvirt-dom>."
19259 #: ../fish/guestfish-actions.pod:66
19261 "The other optional parameters are passed directly through to L</add-drive-"
19266 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
19268 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
19272 #: ../fish/guestfish-actions.pod:71
19277 #: ../fish/guestfish-actions.pod:73
19280 " add-drive filename\n"
19285 #: ../fish/guestfish-actions.pod:75
19287 "This function is the equivalent of calling L</add-drive-opts> with no "
19288 "optional parameters, so the disk is added writable, with the format being "
19289 "detected automatically."
19293 #: ../fish/guestfish-actions.pod:79
19295 "Automatic detection of the format opens you up to a potential security hole "
19296 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19297 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19298 "you should think about replacing calls to this function with calls to L</add-"
19299 "drive-opts>, and specifying the format."
19303 #: ../fish/guestfish-actions.pod:86
19304 msgid "add-drive-opts"
19308 #: ../fish/guestfish-actions.pod:88
19313 #: ../fish/guestfish-actions.pod:90
19316 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19321 #: ../fish/guestfish-actions.pod:117
19323 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19324 "add-drive-ro>) then the format is automatically detected. Possible formats "
19325 "include C<raw> and C<qcow2>."
19329 #: ../fish/guestfish-actions.pod:128
19331 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19332 "add-drive-with-if> call (q.v.)"
19336 #: ../fish/guestfish-actions.pod:135
19337 msgid "add-drive-ro"
19341 #: ../fish/guestfish-actions.pod:137
19346 #: ../fish/guestfish-actions.pod:139
19349 " add-drive-ro filename\n"
19354 #: ../fish/guestfish-actions.pod:141
19356 "This function is the equivalent of calling L</add-drive-opts> with the "
19357 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19358 "is added read-only, with the format being detected automatically."
19362 #: ../fish/guestfish-actions.pod:146
19363 msgid "add-drive-ro-with-if"
19367 #: ../fish/guestfish-actions.pod:148
19370 " add-drive-ro-with-if filename iface\n"
19375 #: ../fish/guestfish-actions.pod:150
19377 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19378 "interface emulation to use at run time."
19382 #: ../fish/guestfish-actions.pod:160
19383 msgid "add-drive-with-if"
19387 #: ../fish/guestfish-actions.pod:162
19390 " add-drive-with-if filename iface\n"
19395 #: ../fish/guestfish-actions.pod:164
19397 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19398 "interface emulation to use at run time."
19402 #: ../fish/guestfish-actions.pod:174
19407 #: ../fish/guestfish-actions.pod:176
19410 " aug-clear augpath\n"
19415 #: ../fish/guestfish-actions.pod:181
19420 #: ../fish/guestfish-actions.pod:183
19428 #: ../fish/guestfish-actions.pod:185
19430 "Close the current Augeas handle and free up any resources used by it. After "
19431 "calling this, you have to call L</aug-init> again before you can use any "
19432 "other Augeas functions."
19436 #: ../fish/guestfish-actions.pod:190
19437 msgid "aug-defnode"
19441 #: ../fish/guestfish-actions.pod:192
19444 " aug-defnode name expr val\n"
19449 #: ../fish/guestfish-actions.pod:197
19451 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19452 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19453 "containing that single node."
19457 #: ../fish/guestfish-actions.pod:205
19462 #: ../fish/guestfish-actions.pod:207
19465 " aug-defvar name expr\n"
19470 #: ../fish/guestfish-actions.pod:216
19475 #: ../fish/guestfish-actions.pod:218
19478 " aug-get augpath\n"
19483 #: ../fish/guestfish-actions.pod:223
19488 #: ../fish/guestfish-actions.pod:225
19491 " aug-init root flags\n"
19496 #: ../fish/guestfish-actions.pod:231
19497 msgid "You must call this before using any other L</aug-*> commands."
19501 #: ../fish/guestfish-actions.pod:266
19502 msgid "Do not load the tree in L</aug-init>."
19506 #: ../fish/guestfish-actions.pod:270
19507 msgid "To close the handle, you can call L</aug-close>."
19511 #: ../fish/guestfish-actions.pod:274
19516 #: ../fish/guestfish-actions.pod:276
19519 " aug-insert augpath label true|false\n"
19524 #: ../fish/guestfish-actions.pod:286
19529 #: ../fish/guestfish-actions.pod:288
19537 #: ../fish/guestfish-actions.pod:295
19542 #: ../fish/guestfish-actions.pod:297
19545 " aug-ls augpath\n"
19550 #: ../fish/guestfish-actions.pod:299
19552 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19553 "resulting nodes into alphabetical order."
19557 #: ../fish/guestfish-actions.pod:302
19562 #: ../fish/guestfish-actions.pod:304
19565 " aug-match augpath\n"
19570 #: ../fish/guestfish-actions.pod:310
19575 #: ../fish/guestfish-actions.pod:312
19578 " aug-mv src dest\n"
19583 #: ../fish/guestfish-actions.pod:317
19588 #: ../fish/guestfish-actions.pod:319
19591 " aug-rm augpath\n"
19596 #: ../fish/guestfish-actions.pod:325
19601 #: ../fish/guestfish-actions.pod:327
19609 #: ../fish/guestfish-actions.pod:331
19611 "The flags which were passed to L</aug-init> affect exactly how files are "
19616 #: ../fish/guestfish-actions.pod:334
19621 #: ../fish/guestfish-actions.pod:336
19624 " aug-set augpath val\n"
19629 #: ../fish/guestfish-actions.pod:340
19631 "In the Augeas API, it is possible to clear a node by setting the value to "
19632 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
19633 "this call. Instead you must use the L</aug-clear> call."
19637 #: ../fish/guestfish-actions.pod:345
19642 #: ../fish/guestfish-actions.pod:347
19645 " available 'groups ...'\n"
19650 #: ../fish/guestfish-actions.pod:353
19652 "The libguestfs groups, and the functions that those groups correspond to, "
19653 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
19654 "runtime by calling L</available-all-groups>."
19658 #: ../fish/guestfish-actions.pod:377
19659 msgid "You must call L</launch> before calling this function."
19663 #: ../fish/guestfish-actions.pod:399
19665 "This call was added in version C<1.0.80>. In previous versions of "
19666 "libguestfs all you could do would be to speculatively execute a command to "
19667 "find out if the daemon implemented it. See also L</version>."
19671 #: ../fish/guestfish-actions.pod:406
19672 msgid "available-all-groups"
19676 #: ../fish/guestfish-actions.pod:408
19679 " available-all-groups\n"
19684 #: ../fish/guestfish-actions.pod:410
19686 "This command returns a list of all optional groups that this daemon knows "
19687 "about. Note this returns both supported and unsupported groups. To find "
19688 "out which ones the daemon can actually support you have to call L</"
19689 "available> on each member of the returned list."
19693 #: ../fish/guestfish-actions.pod:416
19694 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
19698 #: ../fish/guestfish-actions.pod:418
19703 #: ../fish/guestfish-actions.pod:420
19706 " base64-in (base64file|-) filename\n"
19711 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
19712 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
19713 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
19714 #: ../fish/guestfish-actions.pod:4113 ../fish/guestfish-actions.pod:4125
19715 #: ../fish/guestfish-actions.pod:4136 ../fish/guestfish-actions.pod:4147
19716 #: ../fish/guestfish-actions.pod:4199 ../fish/guestfish-actions.pod:4208
19717 #: ../fish/guestfish-actions.pod:4262 ../fish/guestfish-actions.pod:4285
19718 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
19722 #: ../fish/guestfish-actions.pod:427
19727 #: ../fish/guestfish-actions.pod:429
19730 " base64-out filename (base64file|-)\n"
19735 #: ../fish/guestfish-actions.pod:436
19736 msgid "blockdev-flushbufs"
19740 #: ../fish/guestfish-actions.pod:438
19743 " blockdev-flushbufs device\n"
19748 #: ../fish/guestfish-actions.pod:445
19749 msgid "blockdev-getbsz"
19753 #: ../fish/guestfish-actions.pod:447
19756 " blockdev-getbsz device\n"
19761 #: ../fish/guestfish-actions.pod:456
19762 msgid "blockdev-getro"
19766 #: ../fish/guestfish-actions.pod:458
19769 " blockdev-getro device\n"
19774 #: ../fish/guestfish-actions.pod:465
19775 msgid "blockdev-getsize64"
19779 #: ../fish/guestfish-actions.pod:467
19782 " blockdev-getsize64 device\n"
19787 #: ../fish/guestfish-actions.pod:471
19788 msgid "See also L</blockdev-getsz>."
19792 #: ../fish/guestfish-actions.pod:475
19793 msgid "blockdev-getss"
19797 #: ../fish/guestfish-actions.pod:477
19800 " blockdev-getss device\n"
19805 #: ../fish/guestfish-actions.pod:482
19807 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
19811 #: ../fish/guestfish-actions.pod:487
19812 msgid "blockdev-getsz"
19816 #: ../fish/guestfish-actions.pod:489
19819 " blockdev-getsz device\n"
19824 #: ../fish/guestfish-actions.pod:494
19826 "See also L</blockdev-getss> for the real sector size of the device, and L</"
19827 "blockdev-getsize64> for the more useful I<size in bytes>."
19831 #: ../fish/guestfish-actions.pod:500
19832 msgid "blockdev-rereadpt"
19836 #: ../fish/guestfish-actions.pod:502
19839 " blockdev-rereadpt device\n"
19844 #: ../fish/guestfish-actions.pod:508
19845 msgid "blockdev-setbsz"
19849 #: ../fish/guestfish-actions.pod:510
19852 " blockdev-setbsz device blocksize\n"
19857 #: ../fish/guestfish-actions.pod:519
19858 msgid "blockdev-setro"
19862 #: ../fish/guestfish-actions.pod:521
19865 " blockdev-setro device\n"
19870 #: ../fish/guestfish-actions.pod:527
19871 msgid "blockdev-setrw"
19875 #: ../fish/guestfish-actions.pod:529
19878 " blockdev-setrw device\n"
19883 #: ../fish/guestfish-actions.pod:535
19884 msgid "case-sensitive-path"
19888 #: ../fish/guestfish-actions.pod:537
19891 " case-sensitive-path path\n"
19896 #: ../fish/guestfish-actions.pod:561
19898 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
19899 "WINDOWS/system32\"> (the exact return value would depend on details of how "
19900 "the directories were originally created under Windows)."
19904 #: ../fish/guestfish-actions.pod:569
19905 msgid "See also L</realpath>."
19909 #: ../fish/guestfish-actions.pod:571
19914 #: ../fish/guestfish-actions.pod:573
19922 #: ../fish/guestfish-actions.pod:577
19924 "Note that this function cannot correctly handle binary files (specifically, "
19925 "files containing C<\\0> character which is treated as end of string). For "
19926 "those you need to use the L</read-file> or L</download> functions which have "
19927 "a more complex interface."
19931 #: ../fish/guestfish-actions.pod:585
19936 #: ../fish/guestfish-actions.pod:587
19939 " checksum csumtype path\n"
19944 #: ../fish/guestfish-actions.pod:630
19945 msgid "To get the checksum for a device, use L</checksum-device>."
19949 #: ../fish/guestfish-actions.pod:632
19950 msgid "To get the checksums for many files, use L</checksums-out>."
19954 #: ../fish/guestfish-actions.pod:634
19955 msgid "checksum-device"
19959 #: ../fish/guestfish-actions.pod:636
19962 " checksum-device csumtype device\n"
19967 #: ../fish/guestfish-actions.pod:638
19969 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
19970 "device named C<device>. For the types of checksums supported see the L</"
19971 "checksum> command."
19975 #: ../fish/guestfish-actions.pod:642
19976 msgid "checksums-out"
19980 #: ../fish/guestfish-actions.pod:644
19983 " checksums-out csumtype directory (sumsfile|-)\n"
19988 #: ../fish/guestfish-actions.pod:660
19993 #: ../fish/guestfish-actions.pod:662
19996 " chmod mode path\n"
20001 #: ../fish/guestfish-actions.pod:673
20006 #: ../fish/guestfish-actions.pod:675
20009 " chown owner group path\n"
20014 #: ../fish/guestfish-actions.pod:683
20019 #: ../fish/guestfish-actions.pod:685
20022 " command 'arguments ...'\n"
20027 #: ../fish/guestfish-actions.pod:692
20029 "The single parameter is an argv-style list of arguments. The first element "
20030 "is the name of the program to run. Subsequent elements are parameters. The "
20031 "list must be non-empty (ie. must contain a program name). Note that the "
20032 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20036 #: ../fish/guestfish-actions.pod:720
20037 msgid "command-lines"
20041 #: ../fish/guestfish-actions.pod:722
20044 " command-lines 'arguments ...'\n"
20049 #: ../fish/guestfish-actions.pod:724
20051 "This is the same as L</command>, but splits the result into a list of lines."
20055 #: ../fish/guestfish-actions.pod:727
20056 msgid "See also: L</sh-lines>"
20060 #: ../fish/guestfish-actions.pod:732
20065 #: ../fish/guestfish-actions.pod:734
20068 " config qemuparam qemuvalue\n"
20073 #: ../fish/guestfish-actions.pod:745
20078 #: ../fish/guestfish-actions.pod:747
20081 " copy-size src dest size\n"
20086 #: ../fish/guestfish-actions.pod:755
20091 #: ../fish/guestfish-actions.pod:757
20099 #: ../fish/guestfish-actions.pod:762
20104 #: ../fish/guestfish-actions.pod:764
20112 #: ../fish/guestfish-actions.pod:769
20117 #: ../fish/guestfish-actions.pod:771
20125 #: ../fish/guestfish-actions.pod:778
20127 "If the destination is a device, it must be as large or larger than the "
20128 "source file or device, otherwise the copy will fail. This command cannot do "
20129 "partial copies (see L</copy-size>)."
20133 #: ../fish/guestfish-actions.pod:782
20138 #: ../fish/guestfish-actions.pod:784
20146 #: ../fish/guestfish-actions.pod:792
20151 #: ../fish/guestfish-actions.pod:794
20159 #: ../fish/guestfish-actions.pod:803
20164 #: ../fish/guestfish-actions.pod:805
20172 #: ../fish/guestfish-actions.pod:811
20174 "Another way to get the same information is to enable verbose messages with "
20175 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20176 "before running the program."
20180 #: ../fish/guestfish-actions.pod:816
20185 #: ../fish/guestfish-actions.pod:818
20188 " download remotefilename (filename|-)\n"
20193 #: ../fish/guestfish-actions.pod:825
20194 msgid "See also L</upload>, L</cat>."
20198 #: ../fish/guestfish-actions.pod:829
20199 msgid "download-offset"
20203 #: ../fish/guestfish-actions.pod:831
20206 " download-offset remotefilename (filename|-) offset size\n"
20211 #: ../fish/guestfish-actions.pod:839
20213 "Note that there is no limit on the amount of data that can be downloaded "
20214 "with this call, unlike with L</pread>, and this call always reads the full "
20215 "amount unless an error occurs."
20219 #: ../fish/guestfish-actions.pod:844
20220 msgid "See also L</download>, L</pread>."
20224 #: ../fish/guestfish-actions.pod:848
20225 msgid "drop-caches"
20229 #: ../fish/guestfish-actions.pod:850
20232 " drop-caches whattodrop\n"
20237 #: ../fish/guestfish-actions.pod:862
20242 #: ../fish/guestfish-actions.pod:864
20250 #: ../fish/guestfish-actions.pod:876
20255 #: ../fish/guestfish-actions.pod:878
20258 " e2fsck-f device\n"
20263 #: ../fish/guestfish-actions.pod:884
20265 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20266 "should use L</fsck>."
20270 #: ../fish/guestfish-actions.pod:887
20271 msgid "echo-daemon"
20275 #: ../fish/guestfish-actions.pod:889
20278 " echo-daemon 'words ...'\n"
20283 #: ../fish/guestfish-actions.pod:896
20284 msgid "See also L</ping-daemon>."
20288 #: ../fish/guestfish-actions.pod:898
20293 #: ../fish/guestfish-actions.pod:900
20296 " egrep regex path\n"
20301 #: ../fish/guestfish-actions.pod:908
20306 #: ../fish/guestfish-actions.pod:910
20309 " egrepi regex path\n"
20314 #: ../fish/guestfish-actions.pod:918
20319 #: ../fish/guestfish-actions.pod:920
20322 " equal file1 file2\n"
20327 #: ../fish/guestfish-actions.pod:927
20332 #: ../fish/guestfish-actions.pod:929
20340 #: ../fish/guestfish-actions.pod:934
20341 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20345 #: ../fish/guestfish-actions.pod:936
20350 #: ../fish/guestfish-actions.pod:938
20353 " fallocate path len\n"
20358 #: ../fish/guestfish-actions.pod:955
20359 msgid "fallocate64"
20363 #: ../fish/guestfish-actions.pod:957
20366 " fallocate64 path len\n"
20371 #: ../fish/guestfish-actions.pod:963
20373 "Note that this call allocates disk blocks for the file. To create a sparse "
20374 "file use L</truncate-size> instead."
20378 #: ../fish/guestfish-actions.pod:966
20380 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20381 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20382 "maximum size of files created through that call to 1GB."
20386 #: ../fish/guestfish-actions.pod:975
20391 #: ../fish/guestfish-actions.pod:977
20394 " fgrep pattern path\n"
20399 #: ../fish/guestfish-actions.pod:985
20404 #: ../fish/guestfish-actions.pod:987
20407 " fgrepi pattern path\n"
20412 #: ../fish/guestfish-actions.pod:995
20417 #: ../fish/guestfish-actions.pod:997
20425 #: ../fish/guestfish-actions.pod:1009
20427 "This command can also be used on C</dev/> devices (and partitions, LV "
20428 "names). You can for example use this to determine if a device contains a "
20429 "filesystem, although it's usually better to use L</vfs-type>."
20433 #: ../fish/guestfish-actions.pod:1019
20434 msgid "file-architecture"
20438 #: ../fish/guestfish-actions.pod:1021
20441 " file-architecture filename\n"
20446 #: ../fish/guestfish-actions.pod:1124
20451 #: ../fish/guestfish-actions.pod:1126
20459 #: ../fish/guestfish-actions.pod:1130
20461 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20462 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20466 #: ../fish/guestfish-actions.pod:1134
20471 #: ../fish/guestfish-actions.pod:1136
20474 " fill c len path\n"
20479 #: ../fish/guestfish-actions.pod:1142
20481 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20482 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20483 "L</fill-pattern>."
20487 #: ../fish/guestfish-actions.pod:1147
20488 msgid "fill-pattern"
20492 #: ../fish/guestfish-actions.pod:1149
20495 " fill-pattern pattern len path\n"
20500 #: ../fish/guestfish-actions.pod:1151
20502 "This function is like L</fill> except that it creates a new file of length "
20503 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20504 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20509 #: ../fish/guestfish-actions.pod:1156
20514 #: ../fish/guestfish-actions.pod:1158
20517 " find directory\n"
20522 #: ../fish/guestfish-actions.pod:1172
20523 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20527 #: ../fish/guestfish-actions.pod:1185
20528 msgid "See also L</find0>."
20532 #: ../fish/guestfish-actions.pod:1190
20537 #: ../fish/guestfish-actions.pod:1192
20540 " find0 directory (files|-)\n"
20545 #: ../fish/guestfish-actions.pod:1198
20547 "This command works the same way as L</find> with the following exceptions:"
20551 #: ../fish/guestfish-actions.pod:1225
20552 msgid "findfs-label"
20556 #: ../fish/guestfish-actions.pod:1227
20559 " findfs-label label\n"
20564 #: ../fish/guestfish-actions.pod:1233
20565 msgid "To find the label of a filesystem, use L</vfs-label>."
20569 #: ../fish/guestfish-actions.pod:1235
20570 msgid "findfs-uuid"
20574 #: ../fish/guestfish-actions.pod:1237
20577 " findfs-uuid uuid\n"
20582 #: ../fish/guestfish-actions.pod:1243
20583 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
20587 #: ../fish/guestfish-actions.pod:1245
20592 #: ../fish/guestfish-actions.pod:1247
20595 " fsck fstype device\n"
20600 #: ../fish/guestfish-actions.pod:1277
20605 #: ../fish/guestfish-actions.pod:1279
20613 #: ../fish/guestfish-actions.pod:1286
20614 msgid "get-autosync"
20618 #: ../fish/guestfish-actions.pod:1288
20626 #: ../fish/guestfish-actions.pod:1292
20631 #: ../fish/guestfish-actions.pod:1294
20639 #: ../fish/guestfish-actions.pod:1298
20640 msgid "get-e2label"
20644 #: ../fish/guestfish-actions.pod:1300
20647 " get-e2label device\n"
20652 #: ../fish/guestfish-actions.pod:1312
20657 #: ../fish/guestfish-actions.pod:1314
20660 " get-e2uuid device\n"
20665 #: ../fish/guestfish-actions.pod:1326
20666 msgid "get-memsize"
20670 #: ../fish/guestfish-actions.pod:1328
20678 #: ../fish/guestfish-actions.pod:1333
20680 "If L</set-memsize> was not called on this handle, and if "
20681 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
20682 "value for memsize."
20686 #: ../fish/guestfish-actions.pod:1340
20687 msgid "get-network"
20691 #: ../fish/guestfish-actions.pod:1342
20699 #: ../fish/guestfish-actions.pod:1346
20704 #: ../fish/guestfish-actions.pod:1348
20712 #: ../fish/guestfish-actions.pod:1355
20717 #: ../fish/guestfish-actions.pod:1357
20722 #: ../fish/guestfish-actions.pod:1359
20730 #: ../fish/guestfish-actions.pod:1366
20735 #: ../fish/guestfish-actions.pod:1368
20743 #: ../fish/guestfish-actions.pod:1375
20744 msgid "get-recovery-proc"
20748 #: ../fish/guestfish-actions.pod:1377
20751 " get-recovery-proc\n"
20756 #: ../fish/guestfish-actions.pod:1381
20757 msgid "get-selinux"
20761 #: ../fish/guestfish-actions.pod:1383
20769 #: ../fish/guestfish-actions.pod:1385
20771 "This returns the current setting of the selinux flag which is passed to the "
20772 "appliance at boot time. See L</set-selinux>."
20776 #: ../fish/guestfish-actions.pod:1391
20781 #: ../fish/guestfish-actions.pod:1393
20789 #: ../fish/guestfish-actions.pod:1400
20794 #: ../fish/guestfish-actions.pod:1402
20802 #: ../fish/guestfish-actions.pod:1406
20807 #: ../fish/guestfish-actions.pod:1408
20815 #: ../fish/guestfish-actions.pod:1410
20817 "Return the current umask. By default the umask is C<022> unless it has been "
20818 "set by calling L</umask>."
20822 #: ../fish/guestfish-actions.pod:1413
20823 msgid "get-verbose"
20827 #: ../fish/guestfish-actions.pod:1415
20835 #: ../fish/guestfish-actions.pod:1419
20840 #: ../fish/guestfish-actions.pod:1421
20848 #: ../fish/guestfish-actions.pod:1425
20849 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
20853 #: ../fish/guestfish-actions.pod:1428
20858 #: ../fish/guestfish-actions.pod:1430
20861 " getxattrs path\n"
20866 #: ../fish/guestfish-actions.pod:1438
20867 msgid "See also: L</lgetxattrs>, L<attr(5)>."
20871 #: ../fish/guestfish-actions.pod:1440
20872 msgid "glob-expand"
20876 #: ../fish/guestfish-actions.pod:1442
20879 " glob-expand pattern\n"
20884 #: ../fish/guestfish-actions.pod:1455
20889 #: ../fish/guestfish-actions.pod:1457
20892 " grep regex path\n"
20897 #: ../fish/guestfish-actions.pod:1465
20902 #: ../fish/guestfish-actions.pod:1467
20905 " grepi regex path\n"
20910 #: ../fish/guestfish-actions.pod:1475
20911 msgid "grub-install"
20915 #: ../fish/guestfish-actions.pod:1477
20918 " grub-install root device\n"
20923 #: ../fish/guestfish-actions.pod:1493
20928 #: ../fish/guestfish-actions.pod:1495
20936 #: ../fish/guestfish-actions.pod:1503
20941 #: ../fish/guestfish-actions.pod:1505
20944 " head-n nrlines path\n"
20949 #: ../fish/guestfish-actions.pod:1518
20954 #: ../fish/guestfish-actions.pod:1520
20962 #: ../fish/guestfish-actions.pod:1528
20967 #: ../fish/guestfish-actions.pod:1530
20970 " initrd-cat initrdpath filename\n"
20975 #: ../fish/guestfish-actions.pod:1542
20976 msgid "See also L</initrd-list>."
20980 #: ../fish/guestfish-actions.pod:1547
20981 msgid "initrd-list"
20985 #: ../fish/guestfish-actions.pod:1549
20988 " initrd-list path\n"
20993 #: ../fish/guestfish-actions.pod:1561
20994 msgid "inotify-add-watch"
20998 #: ../fish/guestfish-actions.pod:1563
21001 " inotify-add-watch path mask\n"
21006 #: ../fish/guestfish-actions.pod:1575
21007 msgid "inotify-close"
21011 #: ../fish/guestfish-actions.pod:1577
21019 #: ../fish/guestfish-actions.pod:1583
21020 msgid "inotify-files"
21024 #: ../fish/guestfish-actions.pod:1585
21032 #: ../fish/guestfish-actions.pod:1587
21034 "This function is a helpful wrapper around L</inotify-read> which just "
21035 "returns a list of pathnames of objects that were touched. The returned "
21036 "pathnames are sorted and deduplicated."
21040 #: ../fish/guestfish-actions.pod:1591
21041 msgid "inotify-init"
21045 #: ../fish/guestfish-actions.pod:1593
21048 " inotify-init maxevents\n"
21053 #: ../fish/guestfish-actions.pod:1599
21055 "C<maxevents> is the maximum number of events which will be queued up between "
21056 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21057 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21058 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21059 "but records the fact that it threw them away by setting a flag "
21060 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21064 #: ../fish/guestfish-actions.pod:1609
21066 "Before any events are generated, you have to add some watches to the "
21067 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21068 "L</inotify-watch-all>."
21072 #: ../fish/guestfish-actions.pod:1615
21074 "Queued up events should be read periodically by calling L</inotify-read> (or "
21075 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21076 "If you don't read the events out often enough then you risk the internal "
21077 "queue overflowing."
21081 #: ../fish/guestfish-actions.pod:1622
21083 "The handle should be closed after use by calling L</inotify-close>. This "
21084 "also removes any watches automatically."
21088 #: ../fish/guestfish-actions.pod:1631
21089 msgid "inotify-read"
21093 #: ../fish/guestfish-actions.pod:1633
21101 #: ../fish/guestfish-actions.pod:1646
21102 msgid "inotify-rm-watch"
21106 #: ../fish/guestfish-actions.pod:1648
21109 " inotify-rm-watch wd\n"
21114 #: ../fish/guestfish-actions.pod:1650
21115 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21119 #: ../fish/guestfish-actions.pod:1653
21120 msgid "inspect-get-arch"
21124 #: ../fish/guestfish-actions.pod:1655
21127 " inspect-get-arch root\n"
21132 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673
21133 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1765
21134 #: ../fish/guestfish-actions.pod:1786 ../fish/guestfish-actions.pod:1801
21135 #: ../fish/guestfish-actions.pod:1824 ../fish/guestfish-actions.pod:1846
21136 #: ../fish/guestfish-actions.pod:1870 ../fish/guestfish-actions.pod:1900
21137 #: ../fish/guestfish-actions.pod:1935 ../fish/guestfish-actions.pod:1951
21139 "This function should only be called with a root device string as returned by "
21144 #: ../fish/guestfish-actions.pod:1660
21146 "This returns the architecture of the inspected operating system. The "
21147 "possible return values are listed under L</file-architecture>."
21151 #: ../fish/guestfish-actions.pod:1669
21152 msgid "inspect-get-distro"
21156 #: ../fish/guestfish-actions.pod:1671
21159 " inspect-get-distro root\n"
21164 #: ../fish/guestfish-actions.pod:1743
21165 msgid "inspect-get-filesystems"
21169 #: ../fish/guestfish-actions.pod:1745
21172 " inspect-get-filesystems root\n"
21177 #: ../fish/guestfish-actions.pod:1758
21179 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21180 "get-mountpoints>."
21184 #: ../fish/guestfish-actions.pod:1761
21185 msgid "inspect-get-major-version"
21189 #: ../fish/guestfish-actions.pod:1763
21192 " inspect-get-major-version root\n"
21197 #: ../fish/guestfish-actions.pod:1782
21198 msgid "inspect-get-minor-version"
21202 #: ../fish/guestfish-actions.pod:1784
21205 " inspect-get-minor-version root\n"
21210 #: ../fish/guestfish-actions.pod:1794
21212 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21213 "get-major-version>."
21217 #: ../fish/guestfish-actions.pod:1797
21218 msgid "inspect-get-mountpoints"
21222 #: ../fish/guestfish-actions.pod:1799
21225 " inspect-get-mountpoints root\n"
21230 #: ../fish/guestfish-actions.pod:1817
21232 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21233 "get-filesystems>."
21237 #: ../fish/guestfish-actions.pod:1820
21238 msgid "inspect-get-package-format"
21242 #: ../fish/guestfish-actions.pod:1822
21245 " inspect-get-package-format root\n"
21250 #: ../fish/guestfish-actions.pod:1827
21252 "This function and L</inspect-get-package-management> return the package "
21253 "format and package management tool used by the inspected operating system. "
21254 "For example for Fedora these functions would return C<rpm> (package format) "
21255 "and C<yum> (package management)."
21259 #: ../fish/guestfish-actions.pod:1842
21260 msgid "inspect-get-package-management"
21264 #: ../fish/guestfish-actions.pod:1844
21267 " inspect-get-package-management root\n"
21272 #: ../fish/guestfish-actions.pod:1849
21274 "L</inspect-get-package-format> and this function return the package format "
21275 "and package management tool used by the inspected operating system. For "
21276 "example for Fedora these functions would return C<rpm> (package format) and "
21277 "C<yum> (package management)."
21281 #: ../fish/guestfish-actions.pod:1866
21282 msgid "inspect-get-product-name"
21286 #: ../fish/guestfish-actions.pod:1868
21289 " inspect-get-product-name root\n"
21294 #: ../fish/guestfish-actions.pod:1883
21295 msgid "inspect-get-roots"
21299 #: ../fish/guestfish-actions.pod:1885
21302 " inspect-get-roots\n"
21307 #: ../fish/guestfish-actions.pod:1887
21309 "This function is a convenient way to get the list of root devices, as "
21310 "returned from a previous call to L</inspect-os>, but without redoing the "
21311 "whole inspection process."
21315 #: ../fish/guestfish-actions.pod:1891
21317 "This returns an empty list if either no root devices were found or the "
21318 "caller has not called L</inspect-os>."
21322 #: ../fish/guestfish-actions.pod:1896
21323 msgid "inspect-get-type"
21327 #: ../fish/guestfish-actions.pod:1898
21330 " inspect-get-type root\n"
21335 #: ../fish/guestfish-actions.pod:1931
21336 msgid "inspect-get-windows-systemroot"
21340 #: ../fish/guestfish-actions.pod:1933
21343 " inspect-get-windows-systemroot root\n"
21348 #: ../fish/guestfish-actions.pod:1947
21349 msgid "inspect-list-applications"
21353 #: ../fish/guestfish-actions.pod:1949
21356 " inspect-list-applications root\n"
21361 #: ../fish/guestfish-actions.pod:1956
21363 "I<Note:> This call works differently from other parts of the inspection "
21364 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21365 "then mount up the disks, before calling this. Listing applications is a "
21366 "significantly more difficult operation which requires access to the full "
21367 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21368 "are just returning data cached in the libguestfs handle, this call actually "
21369 "reads parts of the mounted filesystems during the call."
21373 #: ../fish/guestfish-actions.pod:2046
21378 #: ../fish/guestfish-actions.pod:2048
21386 #: ../fish/guestfish-actions.pod:2063
21388 "You can pass the root string(s) returned to other L</inspect-get-*> "
21389 "functions in order to query further information about each operating system, "
21390 "such as the name and version."
21394 #: ../fish/guestfish-actions.pod:2068
21396 "This function uses other libguestfs features such as L</mount-ro> and L</"
21397 "umount-all> in order to mount and unmount filesystems and look at the "
21398 "contents. This should be called with no disks currently mounted. The "
21399 "function may also use Augeas, so any existing Augeas handle will be closed."
21403 #: ../fish/guestfish-actions.pod:2080 ../fish/guestfish-actions.pod:2236
21404 #: ../fish/guestfish-actions.pod:2282
21405 msgid "See also L</list-filesystems>."
21409 #: ../fish/guestfish-actions.pod:2082
21410 msgid "is-blockdev"
21414 #: ../fish/guestfish-actions.pod:2084
21417 " is-blockdev path\n"
21422 #: ../fish/guestfish-actions.pod:2089 ../fish/guestfish-actions.pod:2107
21423 #: ../fish/guestfish-actions.pod:2126 ../fish/guestfish-actions.pod:2135
21424 #: ../fish/guestfish-actions.pod:2145 ../fish/guestfish-actions.pod:2179
21425 #: ../fish/guestfish-actions.pod:2188
21426 msgid "See also L</stat>."
21430 #: ../fish/guestfish-actions.pod:2091
21435 #: ../fish/guestfish-actions.pod:2093
21443 #: ../fish/guestfish-actions.pod:2100
21448 #: ../fish/guestfish-actions.pod:2102
21451 " is-chardev path\n"
21456 #: ../fish/guestfish-actions.pod:2109
21461 #: ../fish/guestfish-actions.pod:2111
21469 #: ../fish/guestfish-actions.pod:2118
21474 #: ../fish/guestfish-actions.pod:2120
21482 #: ../fish/guestfish-actions.pod:2128
21487 #: ../fish/guestfish-actions.pod:2130
21495 #: ../fish/guestfish-actions.pod:2137
21500 #: ../fish/guestfish-actions.pod:2139
21508 #: ../fish/guestfish-actions.pod:2147
21509 msgid "is-launching"
21513 #: ../fish/guestfish-actions.pod:2149
21521 #: ../fish/guestfish-actions.pod:2156
21526 #: ../fish/guestfish-actions.pod:2158
21534 #: ../fish/guestfish-actions.pod:2163
21539 #: ../fish/guestfish-actions.pod:2165
21547 #: ../fish/guestfish-actions.pod:2172
21552 #: ../fish/guestfish-actions.pod:2174
21555 " is-socket path\n"
21560 #: ../fish/guestfish-actions.pod:2181
21565 #: ../fish/guestfish-actions.pod:2183
21568 " is-symlink path\n"
21573 #: ../fish/guestfish-actions.pod:2190
21574 msgid "kill-subprocess"
21578 #: ../fish/guestfish-actions.pod:2192
21581 " kill-subprocess\n"
21586 #: ../fish/guestfish-actions.pod:2196
21591 #: ../fish/guestfish-actions.pod:2198
21596 #: ../fish/guestfish-actions.pod:2200
21604 #: ../fish/guestfish-actions.pod:2208
21609 #: ../fish/guestfish-actions.pod:2210
21612 " lchown owner group path\n"
21617 #: ../fish/guestfish-actions.pod:2212
21619 "Change the file owner to C<owner> and group to C<group>. This is like L</"
21620 "chown> but if C<path> is a symlink then the link itself is changed, not the "
21625 #: ../fish/guestfish-actions.pod:2220
21630 #: ../fish/guestfish-actions.pod:2222
21633 " lgetxattrs path\n"
21638 #: ../fish/guestfish-actions.pod:2224
21640 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
21641 "it returns the extended attributes of the link itself."
21645 #: ../fish/guestfish-actions.pod:2228
21646 msgid "list-devices"
21650 #: ../fish/guestfish-actions.pod:2230
21658 #: ../fish/guestfish-actions.pod:2238
21659 msgid "list-filesystems"
21663 #: ../fish/guestfish-actions.pod:2240
21666 " list-filesystems\n"
21671 #: ../fish/guestfish-actions.pod:2259
21673 "This command runs other libguestfs commands, which might include L</mount> "
21674 "and L</umount>, and therefore you should use this soon after launch and only "
21675 "when nothing is mounted."
21679 #: ../fish/guestfish-actions.pod:2263
21681 "Not all of the filesystems returned will be mountable. In particular, swap "
21682 "partitions are returned in the list. Also this command does not check that "
21683 "each filesystem found is valid and mountable, and some filesystems might be "
21684 "mountable but require special options. Filesystems may not all belong to a "
21685 "single logical operating system (use L</inspect-os> to look for OSes)."
21689 #: ../fish/guestfish-actions.pod:2271
21690 msgid "list-partitions"
21694 #: ../fish/guestfish-actions.pod:2273
21697 " list-partitions\n"
21702 #: ../fish/guestfish-actions.pod:2279
21704 "This does not return logical volumes. For that you will need to call L</"
21709 #: ../fish/guestfish-actions.pod:2284
21714 #: ../fish/guestfish-actions.pod:2286
21722 #: ../fish/guestfish-actions.pod:2294
21727 #: ../fish/guestfish-actions.pod:2296
21730 " ln target linkname\n"
21735 #: ../fish/guestfish-actions.pod:2300
21740 #: ../fish/guestfish-actions.pod:2302
21743 " ln-f target linkname\n"
21748 #: ../fish/guestfish-actions.pod:2307
21753 #: ../fish/guestfish-actions.pod:2309
21756 " ln-s target linkname\n"
21761 #: ../fish/guestfish-actions.pod:2313
21766 #: ../fish/guestfish-actions.pod:2315
21769 " ln-sf target linkname\n"
21774 #: ../fish/guestfish-actions.pod:2320
21775 msgid "lremovexattr"
21779 #: ../fish/guestfish-actions.pod:2322
21782 " lremovexattr xattr path\n"
21787 #: ../fish/guestfish-actions.pod:2324
21789 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
21790 "it removes an extended attribute of the link itself."
21794 #: ../fish/guestfish-actions.pod:2328
21799 #: ../fish/guestfish-actions.pod:2330
21807 #: ../fish/guestfish-actions.pod:2336
21809 "This command is mostly useful for interactive sessions. Programs should "
21810 "probably use L</readdir> instead."
21814 #: ../fish/guestfish-actions.pod:2339
21819 #: ../fish/guestfish-actions.pod:2341
21822 " lsetxattr xattr val vallen path\n"
21827 #: ../fish/guestfish-actions.pod:2343
21829 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
21830 "sets an extended attribute of the link itself."
21834 #: ../fish/guestfish-actions.pod:2347
21839 #: ../fish/guestfish-actions.pod:2349
21847 #: ../fish/guestfish-actions.pod:2353
21849 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
21850 "the link is stat-ed, not the file it refers to."
21854 #: ../fish/guestfish-actions.pod:2359
21859 #: ../fish/guestfish-actions.pod:2361
21862 " lstatlist path 'names ...'\n"
21867 #: ../fish/guestfish-actions.pod:2363
21869 "This call allows you to perform the L</lstat> operation on multiple files, "
21870 "where all files are in the directory C<path>. C<names> is the list of files "
21871 "from this directory."
21875 #: ../fish/guestfish-actions.pod:2372
21877 "This call is intended for programs that want to efficiently list a directory "
21878 "contents without making many round-trips. See also L</lxattrlist> for a "
21879 "similarly efficient call for getting extended attributes. Very long "
21880 "directory listings might cause the protocol message size to be exceeded, "
21881 "causing this call to fail. The caller must split up such requests into "
21882 "smaller groups of names."
21886 #: ../fish/guestfish-actions.pod:2380
21887 msgid "luks-add-key"
21891 #: ../fish/guestfish-actions.pod:2382
21894 " luks-add-key device keyslot\n"
21899 #: ../fish/guestfish-actions.pod:2389
21901 "Note that if C<keyslot> already contains a key, then this command will "
21902 "fail. You have to use L</luks-kill-slot> first to remove that key."
21906 #: ../fish/guestfish-actions.pod:2393 ../fish/guestfish-actions.pod:2415
21907 #: ../fish/guestfish-actions.pod:2428 ../fish/guestfish-actions.pod:2442
21908 #: ../fish/guestfish-actions.pod:2465 ../fish/guestfish-actions.pod:2475
21910 "This command has one or more key or passphrase parameters. Guestfish will "
21911 "prompt for these separately."
21915 #: ../fish/guestfish-actions.pod:2396
21920 #: ../fish/guestfish-actions.pod:2398
21923 " luks-close device\n"
21928 #: ../fish/guestfish-actions.pod:2400
21930 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
21931 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
21932 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
21937 #: ../fish/guestfish-actions.pod:2406
21938 msgid "luks-format"
21942 #: ../fish/guestfish-actions.pod:2408
21945 " luks-format device keyslot\n"
21950 #: ../fish/guestfish-actions.pod:2421
21951 msgid "luks-format-cipher"
21955 #: ../fish/guestfish-actions.pod:2423
21958 " luks-format-cipher device keyslot cipher\n"
21963 #: ../fish/guestfish-actions.pod:2425
21965 "This command is the same as L</luks-format> but it also allows you to set "
21966 "the C<cipher> used."
21970 #: ../fish/guestfish-actions.pod:2434
21971 msgid "luks-kill-slot"
21975 #: ../fish/guestfish-actions.pod:2436
21978 " luks-kill-slot device keyslot\n"
21983 #: ../fish/guestfish-actions.pod:2445
21988 #: ../fish/guestfish-actions.pod:2447
21991 " luks-open device mapname\n"
21996 #: ../fish/guestfish-actions.pod:2461
21998 "If this block device contains LVM volume groups, then calling L</vgscan> "
21999 "followed by L</vg-activate-all> will make them visible."
22003 #: ../fish/guestfish-actions.pod:2468
22004 msgid "luks-open-ro"
22008 #: ../fish/guestfish-actions.pod:2470
22011 " luks-open-ro device mapname\n"
22016 #: ../fish/guestfish-actions.pod:2472
22018 "This is the same as L</luks-open> except that a read-only mapping is created."
22022 #: ../fish/guestfish-actions.pod:2478
22027 #: ../fish/guestfish-actions.pod:2480
22030 " lvcreate logvol volgroup mbytes\n"
22035 #: ../fish/guestfish-actions.pod:2485
22036 msgid "lvm-canonical-lv-name"
22040 #: ../fish/guestfish-actions.pod:2487
22043 " lvm-canonical-lv-name lvname\n"
22048 #: ../fish/guestfish-actions.pod:2496
22049 msgid "See also L</is-lv>."
22053 #: ../fish/guestfish-actions.pod:2498
22054 msgid "lvm-clear-filter"
22058 #: ../fish/guestfish-actions.pod:2500
22061 " lvm-clear-filter\n"
22066 #: ../fish/guestfish-actions.pod:2502
22068 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22073 #: ../fish/guestfish-actions.pod:2508
22074 msgid "lvm-remove-all"
22078 #: ../fish/guestfish-actions.pod:2510
22081 " lvm-remove-all\n"
22086 #: ../fish/guestfish-actions.pod:2518
22087 msgid "lvm-set-filter"
22091 #: ../fish/guestfish-actions.pod:2520
22094 " lvm-set-filter 'devices ...'\n"
22099 #: ../fish/guestfish-actions.pod:2545
22104 #: ../fish/guestfish-actions.pod:2547
22107 " lvremove device\n"
22112 #: ../fish/guestfish-actions.pod:2555
22117 #: ../fish/guestfish-actions.pod:2557
22120 " lvrename logvol newlogvol\n"
22125 #: ../fish/guestfish-actions.pod:2561
22130 #: ../fish/guestfish-actions.pod:2563
22133 " lvresize device mbytes\n"
22138 #: ../fish/guestfish-actions.pod:2569
22139 msgid "lvresize-free"
22143 #: ../fish/guestfish-actions.pod:2571
22146 " lvresize-free lv percent\n"
22151 #: ../fish/guestfish-actions.pod:2579
22156 #: ../fish/guestfish-actions.pod:2581
22164 #: ../fish/guestfish-actions.pod:2589
22165 msgid "See also L</lvs-full>, L</list-filesystems>."
22169 #: ../fish/guestfish-actions.pod:2591
22174 #: ../fish/guestfish-actions.pod:2593
22182 #: ../fish/guestfish-actions.pod:2598
22187 #: ../fish/guestfish-actions.pod:2600
22195 #: ../fish/guestfish-actions.pod:2604
22200 #: ../fish/guestfish-actions.pod:2606
22203 " lxattrlist path 'names ...'\n"
22208 #: ../fish/guestfish-actions.pod:2622
22210 "This call is intended for programs that want to efficiently list a directory "
22211 "contents without making many round-trips. See also L</lstatlist> for a "
22212 "similarly efficient call for getting standard stats. Very long directory "
22213 "listings might cause the protocol message size to be exceeded, causing this "
22214 "call to fail. The caller must split up such requests into smaller groups of "
22219 #: ../fish/guestfish-actions.pod:2630
22224 #: ../fish/guestfish-actions.pod:2632
22232 #: ../fish/guestfish-actions.pod:2636
22237 #: ../fish/guestfish-actions.pod:2638
22240 " mkdir-mode path mode\n"
22245 #: ../fish/guestfish-actions.pod:2647
22246 msgid "See also L</mkdir>, L</umask>"
22250 #: ../fish/guestfish-actions.pod:2649
22255 #: ../fish/guestfish-actions.pod:2651
22263 #: ../fish/guestfish-actions.pod:2656
22268 #: ../fish/guestfish-actions.pod:2658
22271 " mkdtemp template\n"
22276 #: ../fish/guestfish-actions.pod:2679
22281 #: ../fish/guestfish-actions.pod:2681
22284 " mke2fs-J fstype blocksize device journal\n"
22289 #: ../fish/guestfish-actions.pod:2689
22290 msgid "See also L</mke2journal>."
22294 #: ../fish/guestfish-actions.pod:2691
22299 #: ../fish/guestfish-actions.pod:2693
22302 " mke2fs-JL fstype blocksize device label\n"
22307 #: ../fish/guestfish-actions.pod:2698
22308 msgid "See also L</mke2journal-L>."
22312 #: ../fish/guestfish-actions.pod:2700
22317 #: ../fish/guestfish-actions.pod:2702
22320 " mke2fs-JU fstype blocksize device uuid\n"
22325 #: ../fish/guestfish-actions.pod:2707
22326 msgid "See also L</mke2journal-U>."
22330 #: ../fish/guestfish-actions.pod:2709
22331 msgid "mke2journal"
22335 #: ../fish/guestfish-actions.pod:2711
22338 " mke2journal blocksize device\n"
22343 #: ../fish/guestfish-actions.pod:2718
22344 msgid "mke2journal-L"
22348 #: ../fish/guestfish-actions.pod:2720
22351 " mke2journal-L blocksize label device\n"
22356 #: ../fish/guestfish-actions.pod:2724
22357 msgid "mke2journal-U"
22361 #: ../fish/guestfish-actions.pod:2726
22364 " mke2journal-U blocksize uuid device\n"
22369 #: ../fish/guestfish-actions.pod:2730
22374 #: ../fish/guestfish-actions.pod:2732
22377 " mkfifo mode path\n"
22382 #: ../fish/guestfish-actions.pod:2734
22384 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22385 "is just a convenient wrapper around L</mknod>."
22389 #: ../fish/guestfish-actions.pod:2740
22394 #: ../fish/guestfish-actions.pod:2742
22397 " mkfs fstype device\n"
22402 #: ../fish/guestfish-actions.pod:2748
22407 #: ../fish/guestfish-actions.pod:2750
22410 " mkfs-b fstype blocksize device\n"
22415 #: ../fish/guestfish-actions.pod:2752
22417 "This call is similar to L</mkfs>, but it allows you to control the block "
22418 "size of the resulting filesystem. Supported block sizes depend on the "
22419 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22423 #: ../fish/guestfish-actions.pod:2760
22424 msgid "mkmountpoint"
22428 #: ../fish/guestfish-actions.pod:2762
22431 " mkmountpoint exemptpath\n"
22436 #: ../fish/guestfish-actions.pod:2764
22438 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22439 "to create extra mountpoints before mounting the first filesystem."
22443 #: ../fish/guestfish-actions.pod:2788
22445 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22446 "unexpected errors if you try to mix these calls. It is safest to manually "
22447 "unmount filesystems and remove mountpoints after use."
22451 #: ../fish/guestfish-actions.pod:2792
22453 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22454 "for this to work for manual mountpoints, you must ensure that the innermost "
22455 "mountpoints have the longest pathnames, as in the example code above."
22459 #: ../fish/guestfish-actions.pod:2799
22461 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22462 "that L</umount-all> is called when the handle is closed which can also "
22463 "trigger these issues."
22467 #: ../fish/guestfish-actions.pod:2803
22472 #: ../fish/guestfish-actions.pod:2805
22475 " mknod mode devmajor devminor path\n"
22480 #: ../fish/guestfish-actions.pod:2815
22482 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22483 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22484 "regular file). These constants are available in the standard Linux header "
22485 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22486 "wrappers around this command which bitwise OR in the appropriate constant "
22491 #: ../fish/guestfish-actions.pod:2825
22496 #: ../fish/guestfish-actions.pod:2827
22499 " mknod-b mode devmajor devminor path\n"
22504 #: ../fish/guestfish-actions.pod:2829
22506 "This call creates a block device node called C<path> with mode C<mode> and "
22507 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22508 "wrapper around L</mknod>."
22512 #: ../fish/guestfish-actions.pod:2835
22517 #: ../fish/guestfish-actions.pod:2837
22520 " mknod-c mode devmajor devminor path\n"
22525 #: ../fish/guestfish-actions.pod:2839
22527 "This call creates a char device node called C<path> with mode C<mode> and "
22528 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22529 "wrapper around L</mknod>."
22533 #: ../fish/guestfish-actions.pod:2845
22538 #: ../fish/guestfish-actions.pod:2847
22546 #: ../fish/guestfish-actions.pod:2851
22551 #: ../fish/guestfish-actions.pod:2853
22554 " mkswap-L label device\n"
22559 #: ../fish/guestfish-actions.pod:2861
22564 #: ../fish/guestfish-actions.pod:2863
22567 " mkswap-U uuid device\n"
22572 #: ../fish/guestfish-actions.pod:2867
22573 msgid "mkswap-file"
22577 #: ../fish/guestfish-actions.pod:2869
22580 " mkswap-file path\n"
22585 #: ../fish/guestfish-actions.pod:2873
22587 "This command just writes a swap file signature to an existing file. To "
22588 "create the file itself, use something like L</fallocate>."
22592 #: ../fish/guestfish-actions.pod:2876
22597 #: ../fish/guestfish-actions.pod:2878
22600 " modprobe modulename\n"
22605 #: ../fish/guestfish-actions.pod:2885
22610 #: ../fish/guestfish-actions.pod:2887
22613 " mount device mountpoint\n"
22618 #: ../fish/guestfish-actions.pod:2903
22620 "B<Important note:> When you use this call, the filesystem options C<sync> "
22621 "and C<noatime> are set implicitly. This was originally done because we "
22622 "thought it would improve reliability, but it turns out that I<-o sync> has a "
22623 "very large negative performance impact and negligible effect on "
22624 "reliability. Therefore we recommend that you avoid using L</mount> in any "
22625 "code that needs performance, and instead use L</mount-options> (use an empty "
22626 "string for the first parameter if you don't want any options)."
22630 #: ../fish/guestfish-actions.pod:2913
22635 #: ../fish/guestfish-actions.pod:2915
22638 " mount-loop file mountpoint\n"
22643 #: ../fish/guestfish-actions.pod:2921
22644 msgid "mount-options"
22648 #: ../fish/guestfish-actions.pod:2923
22651 " mount-options options device mountpoint\n"
22656 #: ../fish/guestfish-actions.pod:2925
22658 "This is the same as the L</mount> command, but it allows you to set the "
22659 "mount options as for the L<mount(8)> I<-o> flag."
22663 #: ../fish/guestfish-actions.pod:2933
22668 #: ../fish/guestfish-actions.pod:2935
22671 " mount-ro device mountpoint\n"
22676 #: ../fish/guestfish-actions.pod:2937
22678 "This is the same as the L</mount> command, but it mounts the filesystem with "
22679 "the read-only (I<-o ro>) flag."
22683 #: ../fish/guestfish-actions.pod:2940
22688 #: ../fish/guestfish-actions.pod:2942
22691 " mount-vfs options vfstype device mountpoint\n"
22696 #: ../fish/guestfish-actions.pod:2944
22698 "This is the same as the L</mount> command, but it allows you to set both the "
22699 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
22703 #: ../fish/guestfish-actions.pod:2948
22704 msgid "mountpoints"
22708 #: ../fish/guestfish-actions.pod:2950
22716 #: ../fish/guestfish-actions.pod:2952
22718 "This call is similar to L</mounts>. That call returns a list of devices. "
22719 "This one returns a hash table (map) of device name to directory where the "
22720 "device is mounted."
22724 #: ../fish/guestfish-actions.pod:2956
22729 #: ../fish/guestfish-actions.pod:2958
22737 #: ../fish/guestfish-actions.pod:2965
22738 msgid "See also: L</mountpoints>"
22742 #: ../fish/guestfish-actions.pod:2967
22747 #: ../fish/guestfish-actions.pod:2969
22755 #: ../fish/guestfish-actions.pod:2974
22756 msgid "ntfs-3g-probe"
22760 #: ../fish/guestfish-actions.pod:2976
22763 " ntfs-3g-probe true|false device\n"
22768 #: ../fish/guestfish-actions.pod:2990
22773 #: ../fish/guestfish-actions.pod:2992
22776 " ntfsresize device\n"
22781 #: ../fish/guestfish-actions.pod:2998
22782 msgid "ntfsresize-size"
22786 #: ../fish/guestfish-actions.pod:3000
22789 " ntfsresize-size device size\n"
22794 #: ../fish/guestfish-actions.pod:3002
22796 "This command is the same as L</ntfsresize> except that it allows you to "
22797 "specify the new size (in bytes) explicitly."
22801 #: ../fish/guestfish-actions.pod:3005
22806 #: ../fish/guestfish-actions.pod:3007
22809 " part-add device prlogex startsect endsect\n"
22814 #: ../fish/guestfish-actions.pod:3009
22816 "This command adds a partition to C<device>. If there is no partition table "
22817 "on the device, call L</part-init> first."
22821 #: ../fish/guestfish-actions.pod:3021
22823 "Creating a partition which covers the whole disk is not so easy. Use L</"
22824 "part-disk> to do that."
22828 #: ../fish/guestfish-actions.pod:3024
22833 #: ../fish/guestfish-actions.pod:3026
22836 " part-del device partnum\n"
22841 #: ../fish/guestfish-actions.pod:3034
22846 #: ../fish/guestfish-actions.pod:3036
22849 " part-disk device parttype\n"
22854 #: ../fish/guestfish-actions.pod:3038
22856 "This command is simply a combination of L</part-init> followed by L</part-"
22857 "add> to create a single primary partition covering the whole disk."
22861 #: ../fish/guestfish-actions.pod:3042
22863 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
22864 "possible values are described in L</part-init>."
22868 #: ../fish/guestfish-actions.pod:3048
22869 msgid "part-get-bootable"
22873 #: ../fish/guestfish-actions.pod:3050
22876 " part-get-bootable device partnum\n"
22881 #: ../fish/guestfish-actions.pod:3055
22882 msgid "See also L</part-set-bootable>."
22886 #: ../fish/guestfish-actions.pod:3057
22887 msgid "part-get-mbr-id"
22891 #: ../fish/guestfish-actions.pod:3059
22894 " part-get-mbr-id device partnum\n"
22899 #: ../fish/guestfish-actions.pod:3064 ../fish/guestfish-actions.pod:3202
22901 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
22902 "undefined results for other partition table types (see L</part-get-"
22907 #: ../fish/guestfish-actions.pod:3068
22908 msgid "part-get-parttype"
22912 #: ../fish/guestfish-actions.pod:3070
22915 " part-get-parttype device\n"
22920 #: ../fish/guestfish-actions.pod:3075
22922 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
22923 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
22924 "possible, although unusual. See L</part-init> for a full list."
22928 #: ../fish/guestfish-actions.pod:3080
22933 #: ../fish/guestfish-actions.pod:3082
22936 " part-init device parttype\n"
22941 #: ../fish/guestfish-actions.pod:3088
22943 "Initially there are no partitions. Following this, you should call L</part-"
22944 "add> for each partition required."
22948 #: ../fish/guestfish-actions.pod:3151
22953 #: ../fish/guestfish-actions.pod:3153
22956 " part-list device\n"
22961 #: ../fish/guestfish-actions.pod:3168
22963 "Start of the partition I<in bytes>. To get sectors you have to divide by "
22964 "the device's sector size, see L</blockdev-getss>."
22968 #: ../fish/guestfish-actions.pod:3181
22969 msgid "part-set-bootable"
22973 #: ../fish/guestfish-actions.pod:3183
22976 " part-set-bootable device partnum true|false\n"
22981 #: ../fish/guestfish-actions.pod:3192
22982 msgid "part-set-mbr-id"
22986 #: ../fish/guestfish-actions.pod:3194
22989 " part-set-mbr-id device partnum idbyte\n"
22994 #: ../fish/guestfish-actions.pod:3206
22995 msgid "part-set-name"
22999 #: ../fish/guestfish-actions.pod:3208
23002 " part-set-name device partnum name\n"
23007 #: ../fish/guestfish-actions.pod:3216
23008 msgid "part-to-dev"
23012 #: ../fish/guestfish-actions.pod:3218
23015 " part-to-dev partition\n"
23020 #: ../fish/guestfish-actions.pod:3224
23022 "The named partition must exist, for example as a string returned from L</"
23023 "list-partitions>."
23027 #: ../fish/guestfish-actions.pod:3227
23028 msgid "ping-daemon"
23032 #: ../fish/guestfish-actions.pod:3229
23040 #: ../fish/guestfish-actions.pod:3236
23045 #: ../fish/guestfish-actions.pod:3238
23048 " pread path count offset\n"
23053 #: ../fish/guestfish-actions.pod:3246
23054 msgid "See also L</pwrite>, L</pread-device>."
23058 #: ../fish/guestfish-actions.pod:3251
23059 msgid "pread-device"
23063 #: ../fish/guestfish-actions.pod:3253
23066 " pread-device device count offset\n"
23071 #: ../fish/guestfish-actions.pod:3261
23072 msgid "See also L</pread>."
23076 #: ../fish/guestfish-actions.pod:3266
23081 #: ../fish/guestfish-actions.pod:3268
23084 " pvcreate device\n"
23089 #: ../fish/guestfish-actions.pod:3274
23094 #: ../fish/guestfish-actions.pod:3276
23097 " pvremove device\n"
23102 #: ../fish/guestfish-actions.pod:3285
23107 #: ../fish/guestfish-actions.pod:3287
23110 " pvresize device\n"
23115 #: ../fish/guestfish-actions.pod:3292
23116 msgid "pvresize-size"
23120 #: ../fish/guestfish-actions.pod:3294
23123 " pvresize-size device size\n"
23128 #: ../fish/guestfish-actions.pod:3296
23130 "This command is the same as L</pvresize> except that it allows you to "
23131 "specify the new size (in bytes) explicitly."
23135 #: ../fish/guestfish-actions.pod:3299
23140 #: ../fish/guestfish-actions.pod:3301
23148 #: ../fish/guestfish-actions.pod:3309
23149 msgid "See also L</pvs-full>."
23153 #: ../fish/guestfish-actions.pod:3311
23158 #: ../fish/guestfish-actions.pod:3313
23166 #: ../fish/guestfish-actions.pod:3318
23171 #: ../fish/guestfish-actions.pod:3320
23179 #: ../fish/guestfish-actions.pod:3324
23184 #: ../fish/guestfish-actions.pod:3326
23187 " pwrite path content offset\n"
23192 #: ../fish/guestfish-actions.pod:3337
23193 msgid "See also L</pread>, L</pwrite-device>."
23197 #: ../fish/guestfish-actions.pod:3342
23198 msgid "pwrite-device"
23202 #: ../fish/guestfish-actions.pod:3344
23205 " pwrite-device device content offset\n"
23210 #: ../fish/guestfish-actions.pod:3354
23211 msgid "See also L</pwrite>."
23215 #: ../fish/guestfish-actions.pod:3359
23220 #: ../fish/guestfish-actions.pod:3361
23223 " read-file path\n"
23228 #: ../fish/guestfish-actions.pod:3366
23230 "Unlike L</cat>, this function can correctly handle files that contain "
23231 "embedded ASCII NUL characters. However unlike L</download>, this function "
23232 "is limited in the total size of file that can be handled."
23236 #: ../fish/guestfish-actions.pod:3374
23241 #: ../fish/guestfish-actions.pod:3376
23244 " read-lines path\n"
23249 #: ../fish/guestfish-actions.pod:3383
23251 "Note that this function cannot correctly handle binary files (specifically, "
23252 "files containing C<\\0> character which is treated as end of line). For "
23253 "those you need to use the L</read-file> function which has a more complex "
23258 #: ../fish/guestfish-actions.pod:3388
23263 #: ../fish/guestfish-actions.pod:3390
23271 #: ../fish/guestfish-actions.pod:3442
23273 "This function is primarily intended for use by programs. To get a simple "
23274 "list of names, use L</ls>. To get a printable directory for human "
23275 "consumption, use L</ll>."
23279 #: ../fish/guestfish-actions.pod:3446
23284 #: ../fish/guestfish-actions.pod:3448
23292 #: ../fish/guestfish-actions.pod:3452
23293 msgid "readlinklist"
23297 #: ../fish/guestfish-actions.pod:3454
23300 " readlinklist path 'names ...'\n"
23305 #: ../fish/guestfish-actions.pod:3478
23310 #: ../fish/guestfish-actions.pod:3480
23318 #: ../fish/guestfish-actions.pod:3485
23319 msgid "removexattr"
23323 #: ../fish/guestfish-actions.pod:3487
23326 " removexattr xattr path\n"
23331 #: ../fish/guestfish-actions.pod:3492
23332 msgid "See also: L</lremovexattr>, L<attr(5)>."
23336 #: ../fish/guestfish-actions.pod:3494
23341 #: ../fish/guestfish-actions.pod:3496
23344 " resize2fs device\n"
23349 #: ../fish/guestfish-actions.pod:3501
23351 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23352 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23353 "gives an error about this and sometimes not. In any case, it is always safe "
23354 "to call L</e2fsck-f> before calling this function."
23358 #: ../fish/guestfish-actions.pod:3507
23359 msgid "resize2fs-size"
23363 #: ../fish/guestfish-actions.pod:3509
23366 " resize2fs-size device size\n"
23371 #: ../fish/guestfish-actions.pod:3511
23373 "This command is the same as L</resize2fs> except that it allows you to "
23374 "specify the new size (in bytes) explicitly."
23378 #: ../fish/guestfish-actions.pod:3514
23383 #: ../fish/guestfish-actions.pod:3516
23391 #: ../fish/guestfish-actions.pod:3520
23396 #: ../fish/guestfish-actions.pod:3522
23404 #: ../fish/guestfish-actions.pod:3528
23409 #: ../fish/guestfish-actions.pod:3530
23417 #: ../fish/guestfish-actions.pod:3534
23418 msgid "rmmountpoint"
23422 #: ../fish/guestfish-actions.pod:3536
23425 " rmmountpoint exemptpath\n"
23430 #: ../fish/guestfish-actions.pod:3538
23432 "This calls removes a mountpoint that was previously created with L</"
23433 "mkmountpoint>. See L</mkmountpoint> for full details."
23437 #: ../fish/guestfish-actions.pod:3542
23438 msgid "scrub-device"
23442 #: ../fish/guestfish-actions.pod:3544
23445 " scrub-device device\n"
23450 #: ../fish/guestfish-actions.pod:3555
23455 #: ../fish/guestfish-actions.pod:3557
23458 " scrub-file file\n"
23463 #: ../fish/guestfish-actions.pod:3567
23464 msgid "scrub-freespace"
23468 #: ../fish/guestfish-actions.pod:3569
23471 " scrub-freespace dir\n"
23476 #: ../fish/guestfish-actions.pod:3571
23478 "This command creates the directory C<dir> and then fills it with files until "
23479 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23480 "deletes them. The intention is to scrub any free space on the partition "
23481 "containing C<dir>."
23485 #: ../fish/guestfish-actions.pod:3580
23490 #: ../fish/guestfish-actions.pod:3582
23495 #: ../fish/guestfish-actions.pod:3584
23498 " set-append append\n"
23503 #: ../fish/guestfish-actions.pod:3595
23504 msgid "set-autosync"
23508 #: ../fish/guestfish-actions.pod:3597
23513 #: ../fish/guestfish-actions.pod:3599
23516 " set-autosync true|false\n"
23521 #: ../fish/guestfish-actions.pod:3601
23523 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
23524 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
23525 "closed (also if the program exits without closing handles)."
23529 #: ../fish/guestfish-actions.pod:3609
23534 #: ../fish/guestfish-actions.pod:3611
23539 #: ../fish/guestfish-actions.pod:3613
23542 " set-direct true|false\n"
23547 #: ../fish/guestfish-actions.pod:3619
23549 "One consequence of this is that log messages aren't caught by the library "
23550 "and handled by L</set-log-message-callback>, but go straight to stdout."
23554 #: ../fish/guestfish-actions.pod:3628
23555 msgid "set-e2label"
23559 #: ../fish/guestfish-actions.pod:3630
23562 " set-e2label device label\n"
23567 #: ../fish/guestfish-actions.pod:3636
23569 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
23570 "label on a filesystem."
23574 #: ../fish/guestfish-actions.pod:3639
23579 #: ../fish/guestfish-actions.pod:3641
23582 " set-e2uuid device uuid\n"
23587 #: ../fish/guestfish-actions.pod:3648
23589 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
23590 "UUID of a filesystem."
23594 #: ../fish/guestfish-actions.pod:3651
23595 msgid "set-memsize"
23599 #: ../fish/guestfish-actions.pod:3653
23604 #: ../fish/guestfish-actions.pod:3655
23607 " set-memsize memsize\n"
23612 #: ../fish/guestfish-actions.pod:3657
23614 "This sets the memory size in megabytes allocated to the qemu subprocess. "
23615 "This only has any effect if called before L</launch>."
23619 #: ../fish/guestfish-actions.pod:3668
23620 msgid "set-network"
23624 #: ../fish/guestfish-actions.pod:3670
23629 #: ../fish/guestfish-actions.pod:3672
23632 " set-network true|false\n"
23637 #: ../fish/guestfish-actions.pod:3680
23639 "You must call this before calling L</launch>, otherwise it has no effect."
23643 #: ../fish/guestfish-actions.pod:3683
23648 #: ../fish/guestfish-actions.pod:3685
23653 #: ../fish/guestfish-actions.pod:3687
23656 " set-path searchpath\n"
23661 #: ../fish/guestfish-actions.pod:3696
23666 #: ../fish/guestfish-actions.pod:3698
23671 #: ../fish/guestfish-actions.pod:3700
23679 #: ../fish/guestfish-actions.pod:3720
23680 msgid "set-recovery-proc"
23684 #: ../fish/guestfish-actions.pod:3722
23685 msgid "recovery-proc"
23689 #: ../fish/guestfish-actions.pod:3724
23692 " set-recovery-proc true|false\n"
23697 #: ../fish/guestfish-actions.pod:3726
23699 "If this is called with the parameter C<false> then L</launch> does not "
23700 "create a recovery process. The purpose of the recovery process is to stop "
23701 "runaway qemu processes in the case where the main program aborts abruptly."
23705 #: ../fish/guestfish-actions.pod:3731
23707 "This only has any effect if called before L</launch>, and the default is "
23712 #: ../fish/guestfish-actions.pod:3740
23713 msgid "set-selinux"
23717 #: ../fish/guestfish-actions.pod:3742
23722 #: ../fish/guestfish-actions.pod:3744
23725 " set-selinux true|false\n"
23730 #: ../fish/guestfish-actions.pod:3755
23735 #: ../fish/guestfish-actions.pod:3757
23740 #: ../fish/guestfish-actions.pod:3759
23743 " set-trace true|false\n"
23748 #: ../fish/guestfish-actions.pod:3775
23749 msgid "set-verbose"
23753 #: ../fish/guestfish-actions.pod:3777
23758 #: ../fish/guestfish-actions.pod:3779
23761 " set-verbose true|false\n"
23766 #: ../fish/guestfish-actions.pod:3786
23771 #: ../fish/guestfish-actions.pod:3788
23774 " setcon context\n"
23779 #: ../fish/guestfish-actions.pod:3795
23784 #: ../fish/guestfish-actions.pod:3797
23787 " setxattr xattr val vallen path\n"
23792 #: ../fish/guestfish-actions.pod:3803
23793 msgid "See also: L</lsetxattr>, L<attr(5)>."
23797 #: ../fish/guestfish-actions.pod:3805
23802 #: ../fish/guestfish-actions.pod:3807
23805 " sfdisk device cyls heads sectors 'lines ...'\n"
23810 #: ../fish/guestfish-actions.pod:3829
23811 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
23815 #: ../fish/guestfish-actions.pod:3835
23820 #: ../fish/guestfish-actions.pod:3837
23823 " sfdiskM device 'lines ...'\n"
23828 #: ../fish/guestfish-actions.pod:3839
23830 "This is a simplified interface to the L</sfdisk> command, where partition "
23831 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
23832 "you don't need to specify the cyls, heads and sectors parameters which were "
23833 "rarely if ever used anyway."
23837 #: ../fish/guestfish-actions.pod:3845
23838 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
23842 #: ../fish/guestfish-actions.pod:3851
23847 #: ../fish/guestfish-actions.pod:3853
23850 " sfdisk-N device partnum cyls heads sectors line\n"
23855 #: ../fish/guestfish-actions.pod:3858
23857 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
23858 "cyls/heads/sectors parameters."
23862 #: ../fish/guestfish-actions.pod:3861
23863 msgid "See also: L</part-add>"
23867 #: ../fish/guestfish-actions.pod:3866
23868 msgid "sfdisk-disk-geometry"
23872 #: ../fish/guestfish-actions.pod:3868
23875 " sfdisk-disk-geometry device\n"
23880 #: ../fish/guestfish-actions.pod:3870
23882 "This displays the disk geometry of C<device> read from the partition table. "
23883 "Especially in the case where the underlying block device has been resized, "
23884 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
23885 "kernel-geometry>)."
23889 #: ../fish/guestfish-actions.pod:3878
23890 msgid "sfdisk-kernel-geometry"
23894 #: ../fish/guestfish-actions.pod:3880
23897 " sfdisk-kernel-geometry device\n"
23902 #: ../fish/guestfish-actions.pod:3887
23907 #: ../fish/guestfish-actions.pod:3889
23910 " sfdisk-l device\n"
23915 #: ../fish/guestfish-actions.pod:3895
23916 msgid "See also: L</part-list>"
23920 #: ../fish/guestfish-actions.pod:3897
23925 #: ../fish/guestfish-actions.pod:3899
23933 #: ../fish/guestfish-actions.pod:3904
23934 msgid "This is like L</command>, but passes the command to:"
23938 #: ../fish/guestfish-actions.pod:3912
23939 msgid "All the provisos about L</command> apply to this call."
23943 #: ../fish/guestfish-actions.pod:3914
23948 #: ../fish/guestfish-actions.pod:3916
23951 " sh-lines command\n"
23956 #: ../fish/guestfish-actions.pod:3918
23957 msgid "This is the same as L</sh>, but splits the result into a list of lines."
23961 #: ../fish/guestfish-actions.pod:3921
23962 msgid "See also: L</command-lines>"
23966 #: ../fish/guestfish-actions.pod:3923
23971 #: ../fish/guestfish-actions.pod:3925
23979 #: ../fish/guestfish-actions.pod:3929
23984 #: ../fish/guestfish-actions.pod:3931
23992 #: ../fish/guestfish-actions.pod:3937
23997 #: ../fish/guestfish-actions.pod:3939
24005 #: ../fish/guestfish-actions.pod:3947
24010 #: ../fish/guestfish-actions.pod:3949
24018 #: ../fish/guestfish-actions.pod:3957
24023 #: ../fish/guestfish-actions.pod:3959
24026 " strings-e encoding path\n"
24031 #: ../fish/guestfish-actions.pod:3961
24033 "This is like the L</strings> command, but allows you to specify the encoding "
24034 "of strings that are looked for in the source file C<path>."
24038 #: ../fish/guestfish-actions.pod:3971
24040 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24041 "ISO-8859-X (this is what L</strings> uses)."
24045 #: ../fish/guestfish-actions.pod:4003
24046 msgid "swapoff-device"
24050 #: ../fish/guestfish-actions.pod:4005
24053 " swapoff-device device\n"
24058 #: ../fish/guestfish-actions.pod:4007
24060 "This command disables the libguestfs appliance swap device or partition "
24061 "named C<device>. See L</swapon-device>."
24065 #: ../fish/guestfish-actions.pod:4011
24066 msgid "swapoff-file"
24070 #: ../fish/guestfish-actions.pod:4013
24073 " swapoff-file file\n"
24078 #: ../fish/guestfish-actions.pod:4017
24079 msgid "swapoff-label"
24083 #: ../fish/guestfish-actions.pod:4019
24086 " swapoff-label label\n"
24091 #: ../fish/guestfish-actions.pod:4024
24092 msgid "swapoff-uuid"
24096 #: ../fish/guestfish-actions.pod:4026
24099 " swapoff-uuid uuid\n"
24104 #: ../fish/guestfish-actions.pod:4031
24105 msgid "swapon-device"
24109 #: ../fish/guestfish-actions.pod:4033
24112 " swapon-device device\n"
24117 #: ../fish/guestfish-actions.pod:4035
24119 "This command enables the libguestfs appliance to use the swap device or "
24120 "partition named C<device>. The increased memory is made available for all "
24121 "commands, for example those run using L</command> or L</sh>."
24125 #: ../fish/guestfish-actions.pod:4047
24126 msgid "swapon-file"
24130 #: ../fish/guestfish-actions.pod:4049
24133 " swapon-file file\n"
24138 #: ../fish/guestfish-actions.pod:4051
24140 "This command enables swap to a file. See L</swapon-device> for other notes."
24144 #: ../fish/guestfish-actions.pod:4054
24145 msgid "swapon-label"
24149 #: ../fish/guestfish-actions.pod:4056
24152 " swapon-label label\n"
24157 #: ../fish/guestfish-actions.pod:4058
24159 "This command enables swap to a labeled swap partition. See L</swapon-"
24160 "device> for other notes."
24164 #: ../fish/guestfish-actions.pod:4061
24165 msgid "swapon-uuid"
24169 #: ../fish/guestfish-actions.pod:4063
24172 " swapon-uuid uuid\n"
24177 #: ../fish/guestfish-actions.pod:4065
24179 "This command enables swap to a swap partition with the given UUID. See L</"
24180 "swapon-device> for other notes."
24184 #: ../fish/guestfish-actions.pod:4068
24189 #: ../fish/guestfish-actions.pod:4070
24197 #: ../fish/guestfish-actions.pod:4078
24202 #: ../fish/guestfish-actions.pod:4080
24210 #: ../fish/guestfish-actions.pod:4088
24215 #: ../fish/guestfish-actions.pod:4090
24218 " tail-n nrlines path\n"
24223 #: ../fish/guestfish-actions.pod:4103
24228 #: ../fish/guestfish-actions.pod:4105
24231 " tar-in (tarfile|-) directory\n"
24236 #: ../fish/guestfish-actions.pod:4110
24237 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24241 #: ../fish/guestfish-actions.pod:4115
24246 #: ../fish/guestfish-actions.pod:4117
24249 " tar-out directory (tarfile|-)\n"
24254 #: ../fish/guestfish-actions.pod:4122
24255 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24259 #: ../fish/guestfish-actions.pod:4127
24264 #: ../fish/guestfish-actions.pod:4129
24267 " tgz-in (tarball|-) directory\n"
24272 #: ../fish/guestfish-actions.pod:4134
24273 msgid "To upload an uncompressed tarball, use L</tar-in>."
24277 #: ../fish/guestfish-actions.pod:4138
24282 #: ../fish/guestfish-actions.pod:4140
24285 " tgz-out directory (tarball|-)\n"
24290 #: ../fish/guestfish-actions.pod:4145
24291 msgid "To download an uncompressed tarball, use L</tar-out>."
24295 #: ../fish/guestfish-actions.pod:4149
24300 #: ../fish/guestfish-actions.pod:4151
24308 #: ../fish/guestfish-actions.pod:4160
24313 #: ../fish/guestfish-actions.pod:4162
24321 #: ../fish/guestfish-actions.pod:4167
24322 msgid "truncate-size"
24326 #: ../fish/guestfish-actions.pod:4169
24329 " truncate-size path size\n"
24334 #: ../fish/guestfish-actions.pod:4174
24336 "If the current file size is less than C<size> then the file is extended to "
24337 "the required size with zero bytes. This creates a sparse file (ie. disk "
24338 "blocks are not allocated for the file until you write to it). To create a "
24339 "non-sparse file of zeroes, use L</fallocate64> instead."
24343 #: ../fish/guestfish-actions.pod:4180
24348 #: ../fish/guestfish-actions.pod:4182
24351 " tune2fs-l device\n"
24356 #: ../fish/guestfish-actions.pod:4192
24361 #: ../fish/guestfish-actions.pod:4194
24364 " txz-in (tarball|-) directory\n"
24369 #: ../fish/guestfish-actions.pod:4201
24374 #: ../fish/guestfish-actions.pod:4203
24377 " txz-out directory (tarball|-)\n"
24382 #: ../fish/guestfish-actions.pod:4210
24387 #: ../fish/guestfish-actions.pod:4212
24395 #: ../fish/guestfish-actions.pod:4226
24396 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24400 #: ../fish/guestfish-actions.pod:4231
24405 #: ../fish/guestfish-actions.pod:4233
24410 #: ../fish/guestfish-actions.pod:4235
24413 " umount pathordevice\n"
24418 #: ../fish/guestfish-actions.pod:4241
24423 #: ../fish/guestfish-actions.pod:4243
24424 msgid "unmount-all"
24428 #: ../fish/guestfish-actions.pod:4245
24436 #: ../fish/guestfish-actions.pod:4251
24441 #: ../fish/guestfish-actions.pod:4253
24444 " upload (filename|-) remotefilename\n"
24449 #: ../fish/guestfish-actions.pod:4260
24450 msgid "See also L</download>."
24454 #: ../fish/guestfish-actions.pod:4264
24455 msgid "upload-offset"
24459 #: ../fish/guestfish-actions.pod:4266
24462 " upload-offset (filename|-) remotefilename offset\n"
24467 #: ../fish/guestfish-actions.pod:4278
24469 "Note that there is no limit on the amount of data that can be uploaded with "
24470 "this call, unlike with L</pwrite>, and this call always writes the full "
24471 "amount unless an error occurs."
24475 #: ../fish/guestfish-actions.pod:4283
24476 msgid "See also L</upload>, L</pwrite>."
24480 #: ../fish/guestfish-actions.pod:4287
24485 #: ../fish/guestfish-actions.pod:4289
24488 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24493 #: ../fish/guestfish-actions.pod:4308
24498 #: ../fish/guestfish-actions.pod:4310
24506 #: ../fish/guestfish-actions.pod:4337
24508 "I<Note:> Don't use this call to test for availability of features. In "
24509 "enterprise distributions we backport features from later versions into "
24510 "earlier versions, making this an unreliable way to test for features. Use "
24511 "L</available> instead."
24515 #: ../fish/guestfish-actions.pod:4343
24520 #: ../fish/guestfish-actions.pod:4345
24523 " vfs-label device\n"
24528 #: ../fish/guestfish-actions.pod:4352
24529 msgid "To find a filesystem from the label, use L</findfs-label>."
24533 #: ../fish/guestfish-actions.pod:4354
24538 #: ../fish/guestfish-actions.pod:4356
24541 " vfs-type device\n"
24546 #: ../fish/guestfish-actions.pod:4366
24551 #: ../fish/guestfish-actions.pod:4368
24554 " vfs-uuid device\n"
24559 #: ../fish/guestfish-actions.pod:4375
24560 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
24564 #: ../fish/guestfish-actions.pod:4377
24565 msgid "vg-activate"
24569 #: ../fish/guestfish-actions.pod:4379
24572 " vg-activate true|false 'volgroups ...'\n"
24577 #: ../fish/guestfish-actions.pod:4392
24578 msgid "vg-activate-all"
24582 #: ../fish/guestfish-actions.pod:4394
24585 " vg-activate-all true|false\n"
24590 #: ../fish/guestfish-actions.pod:4404
24595 #: ../fish/guestfish-actions.pod:4406
24598 " vgcreate volgroup 'physvols ...'\n"
24603 #: ../fish/guestfish-actions.pod:4411
24608 #: ../fish/guestfish-actions.pod:4413
24611 " vglvuuids vgname\n"
24616 #: ../fish/guestfish-actions.pod:4418
24618 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
24619 "logical volumes and volume groups."
24623 #: ../fish/guestfish-actions.pod:4421
24624 msgid "See also L</vgpvuuids>."
24628 #: ../fish/guestfish-actions.pod:4423
24633 #: ../fish/guestfish-actions.pod:4425
24636 " vgpvuuids vgname\n"
24641 #: ../fish/guestfish-actions.pod:4430
24643 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
24644 "physical volumes and volume groups."
24648 #: ../fish/guestfish-actions.pod:4433
24649 msgid "See also L</vglvuuids>."
24653 #: ../fish/guestfish-actions.pod:4435
24658 #: ../fish/guestfish-actions.pod:4437
24661 " vgremove vgname\n"
24666 #: ../fish/guestfish-actions.pod:4444
24671 #: ../fish/guestfish-actions.pod:4446
24674 " vgrename volgroup newvolgroup\n"
24679 #: ../fish/guestfish-actions.pod:4450
24684 #: ../fish/guestfish-actions.pod:4452
24692 #: ../fish/guestfish-actions.pod:4460
24693 msgid "See also L</vgs-full>."
24697 #: ../fish/guestfish-actions.pod:4462
24702 #: ../fish/guestfish-actions.pod:4464
24710 #: ../fish/guestfish-actions.pod:4469
24715 #: ../fish/guestfish-actions.pod:4471
24723 #: ../fish/guestfish-actions.pod:4476
24728 #: ../fish/guestfish-actions.pod:4478
24736 #: ../fish/guestfish-actions.pod:4482
24741 #: ../fish/guestfish-actions.pod:4484
24749 #: ../fish/guestfish-actions.pod:4489
24754 #: ../fish/guestfish-actions.pod:4491
24762 #: ../fish/guestfish-actions.pod:4496
24767 #: ../fish/guestfish-actions.pod:4498
24775 #: ../fish/guestfish-actions.pod:4503
24780 #: ../fish/guestfish-actions.pod:4505
24783 " write path content\n"
24788 #: ../fish/guestfish-actions.pod:4513
24793 #: ../fish/guestfish-actions.pod:4515
24796 " write-file path content size\n"
24801 #: ../fish/guestfish-actions.pod:4538
24806 #: ../fish/guestfish-actions.pod:4540
24809 " zegrep regex path\n"
24814 #: ../fish/guestfish-actions.pod:4548
24819 #: ../fish/guestfish-actions.pod:4550
24822 " zegrepi regex path\n"
24827 #: ../fish/guestfish-actions.pod:4558
24832 #: ../fish/guestfish-actions.pod:4560
24840 #: ../fish/guestfish-actions.pod:4568
24841 msgid "See also: L</zero-device>, L</scrub-device>."
24845 #: ../fish/guestfish-actions.pod:4570
24846 msgid "zero-device"
24850 #: ../fish/guestfish-actions.pod:4572
24853 " zero-device device\n"
24858 #: ../fish/guestfish-actions.pod:4574
24860 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
24861 "which just zeroes the first few blocks of a device."
24865 #: ../fish/guestfish-actions.pod:4581
24870 #: ../fish/guestfish-actions.pod:4583
24873 " zerofree device\n"
24878 #: ../fish/guestfish-actions.pod:4596
24883 #: ../fish/guestfish-actions.pod:4598
24886 " zfgrep pattern path\n"
24891 #: ../fish/guestfish-actions.pod:4606
24896 #: ../fish/guestfish-actions.pod:4608
24899 " zfgrepi pattern path\n"
24904 #: ../fish/guestfish-actions.pod:4616
24909 #: ../fish/guestfish-actions.pod:4618
24912 " zfile meth path\n"
24917 #: ../fish/guestfish-actions.pod:4625
24919 "Since 1.0.63, use L</file> instead which can now process compressed files."
24923 #: ../fish/guestfish-actions.pod:4635
24928 #: ../fish/guestfish-actions.pod:4637
24931 " zgrep regex path\n"
24936 #: ../fish/guestfish-actions.pod:4645
24941 #: ../fish/guestfish-actions.pod:4647
24944 " zgrepi regex path\n"
24949 #: ../fish/guestfish-commands.pod:1
24954 #: ../fish/guestfish-commands.pod:3
24959 #: ../fish/guestfish-commands.pod:5
24962 " alloc filename size\n"
24967 #: ../fish/guestfish-commands.pod:7
24969 "This creates an empty (zeroed) file of the given size, and then adds so it "
24970 "can be further examined."
24974 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
24975 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
24979 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
24980 msgid "Size can be specified using standard suffixes, eg. C<1M>."
24984 #: ../fish/guestfish-commands.pod:14
24986 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
24987 "image, see L</PREPARED DISK IMAGES>."
24991 #: ../fish/guestfish-commands.pod:17
24996 #: ../fish/guestfish-commands.pod:19
24999 " copy-in local [local ...] /remotedir\n"
25004 #: ../fish/guestfish-commands.pod:21
25006 "C<copy-in> copies local files or directories recursively into the disk "
25007 "image, placing them in the directory called C</remotedir> (which must "
25008 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25009 "other commands as necessary."
25013 #: ../fish/guestfish-commands.pod:26
25015 "Multiple local files and directories can be specified, but the last "
25016 "parameter must always be a remote directory. Wildcards cannot be used."
25020 #: ../fish/guestfish-commands.pod:30
25025 #: ../fish/guestfish-commands.pod:32
25028 " copy-out remote [remote ...] localdir\n"
25033 #: ../fish/guestfish-commands.pod:34
25035 "C<copy-out> copies remote files or directories recursively out of the disk "
25036 "image, placing them on the host disk in a local directory called C<localdir> "
25037 "(which must exist). This guestfish meta-command turns into a sequence of L</"
25038 "download>, L</tar-out> and other commands as necessary."
25042 #: ../fish/guestfish-commands.pod:40
25044 "Multiple remote files and directories can be specified, but the last "
25045 "parameter must always be a local directory. To download to the current "
25046 "directory, use C<.> as in:"
25050 #: ../fish/guestfish-commands.pod:44
25053 " copy-out /home .\n"
25058 #: ../fish/guestfish-commands.pod:46
25060 "Wildcards cannot be used in the ordinary command, but you can use them with "
25061 "the help of L</glob> like this:"
25065 #: ../fish/guestfish-commands.pod:49
25068 " glob copy-out /home/* .\n"
25073 #: ../fish/guestfish-commands.pod:51
25078 #: ../fish/guestfish-commands.pod:53
25081 " echo [params ...]\n"
25086 #: ../fish/guestfish-commands.pod:55
25087 msgid "This echos the parameters to the terminal."
25091 #: ../fish/guestfish-commands.pod:57
25096 #: ../fish/guestfish-commands.pod:59
25101 #: ../fish/guestfish-commands.pod:61
25106 #: ../fish/guestfish-commands.pod:63
25114 #: ../fish/guestfish-commands.pod:65
25116 "This is used to edit a file. It downloads the file, edits it locally using "
25117 "your editor, then uploads the result."
25121 #: ../fish/guestfish-commands.pod:68
25123 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25124 "or C<emacs> you will get those corresponding editors."
25128 #: ../fish/guestfish-commands.pod:72
25133 #: ../fish/guestfish-commands.pod:74
25136 " glob command args...\n"
25141 #: ../fish/guestfish-commands.pod:76
25143 "Expand wildcards in any paths in the args list, and run C<command> "
25144 "repeatedly on each matching path."
25148 #: ../fish/guestfish-commands.pod:79
25149 msgid "See L</WILDCARDS AND GLOBBING>."
25153 #: ../fish/guestfish-commands.pod:81
25158 #: ../fish/guestfish-commands.pod:83
25161 " hexedit <filename|device>\n"
25162 " hexedit <filename|device> <max>\n"
25163 " hexedit <filename|device> <start> <max>\n"
25168 #: ../fish/guestfish-commands.pod:87
25170 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25175 #: ../fish/guestfish-commands.pod:90
25177 "This command works by downloading potentially the whole file or device, "
25178 "editing it locally, then uploading it. If the file or device is large, you "
25179 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25180 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25181 "usual modifiers allowed such as C<1M> (1 megabyte)."
25185 #: ../fish/guestfish-commands.pod:97
25186 msgid "For example to edit the first few sectors of a disk you might do:"
25190 #: ../fish/guestfish-commands.pod:100
25193 " hexedit /dev/sda 1M\n"
25198 #: ../fish/guestfish-commands.pod:102
25200 "which would allow you to edit anywhere within the first megabyte of the disk."
25204 #: ../fish/guestfish-commands.pod:105
25205 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25209 #: ../fish/guestfish-commands.pod:107
25212 " hexedit /dev/sda1 0x400 0x400\n"
25217 #: ../fish/guestfish-commands.pod:109
25218 msgid "(assuming the superblock is in the standard location)."
25222 #: ../fish/guestfish-commands.pod:111
25224 "This command requires the external L<hexedit(1)> program. You can specify "
25225 "another program to use by setting the C<HEXEDITOR> environment variable."
25229 #: ../fish/guestfish-commands.pod:115
25230 msgid "See also L</hexdump>."
25234 #: ../fish/guestfish-commands.pod:117
25239 #: ../fish/guestfish-commands.pod:119
25247 #: ../fish/guestfish-commands.pod:121
25249 "Change the local directory, ie. the current directory of guestfish itself."
25253 #: ../fish/guestfish-commands.pod:124
25254 msgid "Note that C<!cd> won't do what you might expect."
25258 #: ../fish/guestfish-commands.pod:126
25263 #: ../fish/guestfish-commands.pod:128
25268 #: ../fish/guestfish-commands.pod:130
25276 #: ../fish/guestfish-commands.pod:132
25277 msgid "Opens the manual page for guestfish."
25281 #: ../fish/guestfish-commands.pod:134
25286 #: ../fish/guestfish-commands.pod:136
25291 #: ../fish/guestfish-commands.pod:138
25299 #: ../fish/guestfish-commands.pod:140
25307 #: ../fish/guestfish-commands.pod:142
25308 msgid "This is used to view a file."
25312 #: ../fish/guestfish-commands.pod:144
25314 "The default viewer is C<$PAGER>. However if you use the alternate command "
25315 "C<less> you will get the C<less> command specifically."
25319 #: ../fish/guestfish-commands.pod:147
25324 #: ../fish/guestfish-commands.pod:149
25332 #: ../fish/guestfish-commands.pod:151
25334 "Close and reopen the libguestfs handle. It is not necessary to use this "
25335 "normally, because the handle is closed properly when guestfish exits. "
25336 "However this is occasionally useful for testing."
25340 #: ../fish/guestfish-commands.pod:155
25345 #: ../fish/guestfish-commands.pod:157
25348 " sparse filename size\n"
25353 #: ../fish/guestfish-commands.pod:159
25355 "This creates an empty sparse file of the given size, and then adds so it can "
25356 "be further examined."
25360 #: ../fish/guestfish-commands.pod:162
25362 "In all respects it works the same as the L</alloc> command, except that the "
25363 "image file is allocated sparsely, which means that disk blocks are not "
25364 "assigned to the file until they are needed. Sparse disk files only use "
25365 "space when written to, but they are slower and there is a danger you could "
25366 "run out of real disk space during a write operation."
25370 #: ../fish/guestfish-commands.pod:172
25375 #: ../fish/guestfish-commands.pod:174
25383 #: ../fish/guestfish-commands.pod:176
25385 "This command returns a list of the optional groups known to the daemon, and "
25386 "indicates which ones are supported by this build of the libguestfs appliance."
25390 #: ../fish/guestfish-commands.pod:180
25391 msgid "See also L<guestfs(3)/AVAILABILITY>."
25395 #: ../fish/guestfish-commands.pod:182
25400 #: ../fish/guestfish-commands.pod:184
25403 " time command args...\n"
25408 #: ../fish/guestfish-commands.pod:186
25410 "Run the command as usual, but print the elapsed time afterwards. This can "
25411 "be useful for benchmarking operations."
25415 #: ../test-tool/libguestfs-test-tool.pod:5
25416 msgid "libguestfs-test-tool - End user tests for libguestfs"
25420 #: ../test-tool/libguestfs-test-tool.pod:9
25423 " libguestfs-test-tool [--options]\n"
25428 #: ../test-tool/libguestfs-test-tool.pod:13
25430 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25431 "and developers, to allow them to check basic libguestfs functionality is "
25432 "working. This is needed because libguestfs occasionally breaks for reasons "
25433 "beyond our control: usually because of changes in the underlying qemu or "
25434 "kernel packages, or the host environment."
25438 #: ../test-tool/libguestfs-test-tool.pod:20
25439 msgid "If you suspect a problem in libguestfs, then just run:"
25443 #: ../test-tool/libguestfs-test-tool.pod:22
25446 " libguestfs-test-tool\n"
25451 #: ../test-tool/libguestfs-test-tool.pod:24
25452 msgid "It will print lots of diagnostic messages."
25456 #: ../test-tool/libguestfs-test-tool.pod:26
25457 msgid "If it runs to completion successfully, you will see this near the end:"
25461 #: ../test-tool/libguestfs-test-tool.pod:28
25464 " ===== TEST FINISHED OK =====\n"
25469 #: ../test-tool/libguestfs-test-tool.pod:30
25470 msgid "and the test tool will exit with code 0."
25474 #: ../test-tool/libguestfs-test-tool.pod:32
25476 "If it fails (and/or exits with non-zero error code), please paste the "
25477 "B<complete, unedited> output of the test tool into a bug report. More "
25478 "information about reporting bugs can be found on the L<http://libguestfs.org/"
25483 #: ../test-tool/libguestfs-test-tool.pod:41
25488 #: ../test-tool/libguestfs-test-tool.pod:43
25489 msgid "Display short usage information and exit."
25493 #: ../test-tool/libguestfs-test-tool.pod:45
25494 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
25498 #: ../test-tool/libguestfs-test-tool.pod:47
25500 "Pass an alternate name for the helper program. libguestfs-test-tool will "
25501 "normally look in the C<$libexec> directory that was configured when the tool "
25506 #: ../test-tool/libguestfs-test-tool.pod:51
25507 msgid "I<--qemu qemu_binary>"
25511 #: ../test-tool/libguestfs-test-tool.pod:53
25513 "If you have downloaded another qemu binary, point this option at the full "
25514 "path of the binary to try it."
25518 #: ../test-tool/libguestfs-test-tool.pod:56
25519 msgid "I<--qemudir qemu_source_dir>"
25523 #: ../test-tool/libguestfs-test-tool.pod:58
25525 "If you have compiled qemu from source, point this option at the source "
25526 "directory to try it."
25530 #: ../test-tool/libguestfs-test-tool.pod:61
25531 msgid "I<--timeout N>"
25535 #: ../test-tool/libguestfs-test-tool.pod:63
25537 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
25538 "does not usually need to be adjusted unless your machine is very slow."
25542 #: ../test-tool/libguestfs-test-tool.pod:69
25543 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
25547 #: ../test-tool/libguestfs-test-tool.pod:71
25549 "If you have compiled another version of qemu from source and would like to "
25550 "try that, then you can use the I<--qemudir> option to point to the qemu "
25551 "source directory."
25555 #: ../test-tool/libguestfs-test-tool.pod:75
25557 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
25558 "option to point to the binary."
25562 #: ../test-tool/libguestfs-test-tool.pod:78
25564 "When using an alternate qemu with libguestfs, usually you would need to "
25565 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
25566 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
25567 "use either of the I<--qemudir> or I<--qemu> options."
25571 #: ../test-tool/libguestfs-test-tool.pod:85
25573 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
25574 "I<1> if there was an error."
25578 #: ../test-tool/libguestfs-test-tool.pod:92
25579 msgid "/usr/libexec/libguestfs-test-tool-helper"
25583 #: ../test-tool/libguestfs-test-tool.pod:94
25585 "This helper program is run inside the appliance and provides additional "
25590 #: ../test-tool/libguestfs-test-tool.pod:97
25591 msgid "/usr/bin/mkisofs"
25595 #: ../test-tool/libguestfs-test-tool.pod:99
25597 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
25598 "which is used as part of the tests."
25602 #: ../test-tool/libguestfs-test-tool.pod:106
25604 "For the full list of environment variables which may affect libguestfs, "
25605 "please see the L<guestfs(3)> manual page."
25609 #: ../test-tool/libguestfs-test-tool.pod:111
25610 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
25614 #: ../test-tool/libguestfs-test-tool.pod:121
25615 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
25619 #: ../fuse/guestmount.pod:5
25621 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
25625 #: ../fuse/guestmount.pod:9
25628 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
25633 #: ../fuse/guestmount.pod:11
25636 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
25641 #: ../fuse/guestmount.pod:13
25644 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
25649 #: ../fuse/guestmount.pod:17
25651 "You must I<not> use C<guestmount> in read-write mode on live virtual "
25652 "machines. If you do this, you risk disk corruption in the VM."
25656 #: ../fuse/guestmount.pod:22
25658 "The guestmount program can be used to mount virtual machine filesystems and "
25659 "other disk images on the host. It uses libguestfs for access to the guest "
25660 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
25661 "a mountable device."
25665 #: ../fuse/guestmount.pod:27
25667 "Along with other options, you have to give at least one device (I<-a> "
25668 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
25669 "option) or use the I<-i> inspection option. How this works is better "
25670 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
25675 #: ../fuse/guestmount.pod:33
25677 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
25678 "by you, and the filesystem will not be visible to any other users unless you "
25679 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
25680 "the filesystem, use the C<fusermount -u> command."
25684 #: ../fuse/guestmount.pod:41
25686 "For a typical Windows guest which has its main filesystem on the first "
25691 #: ../fuse/guestmount.pod:44
25694 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
25699 #: ../fuse/guestmount.pod:46
25701 "For a typical Linux guest which has a /boot filesystem on the first "
25702 "partition, and the root filesystem on a logical volume:"
25706 #: ../fuse/guestmount.pod:49
25709 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
25714 #: ../fuse/guestmount.pod:51
25715 msgid "To get libguestfs to detect guest mountpoints for you:"
25719 #: ../fuse/guestmount.pod:53
25722 " guestmount -a guest.img -i --ro /mnt\n"
25727 #: ../fuse/guestmount.pod:55
25728 msgid "For a libvirt guest called \"Guest\" you could do:"
25732 #: ../fuse/guestmount.pod:57
25735 " guestmount -d Guest -i --ro /mnt\n"
25740 #: ../fuse/guestmount.pod:59
25742 "If you don't know what filesystems are contained in a guest or disk image, "
25743 "use L<virt-list-filesystems(1)> first:"
25747 #: ../fuse/guestmount.pod:62
25750 " virt-list-filesystems MyGuest\n"
25755 #: ../fuse/guestmount.pod:64
25757 "If you want to trace the libguestfs calls but without excessive debugging "
25758 "information, we recommend:"
25762 #: ../fuse/guestmount.pod:67
25765 " guestmount [...] --trace /mnt\n"
25770 #: ../fuse/guestmount.pod:69
25771 msgid "If you want to debug the program, we recommend:"
25775 #: ../fuse/guestmount.pod:71
25778 " guestmount [...] --trace --verbose /mnt\n"
25783 #: ../fuse/guestmount.pod:79
25784 msgid "Add a block device or virtual machine image."
25788 #: ../fuse/guestmount.pod:96
25789 msgid "B<--dir-cache-timeout N>"
25793 #: ../fuse/guestmount.pod:98
25795 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
25796 "seconds. The readdir cache [actually, there are several semi-independent "
25797 "caches] is populated after a readdir(2) call with the stat and extended "
25798 "attributes of the files in the directory, in anticipation that they will be "
25799 "requested soon after."
25803 #: ../fuse/guestmount.pod:104
25805 "There is also a different attribute cache implemented by FUSE (see the FUSE "
25806 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
25807 "requests, only cache existing ones."
25811 #: ../fuse/guestmount.pod:122
25813 "If you have untrusted raw-format guest disk images, you should use this "
25814 "option to specify the disk format. This avoids a possible security problem "
25815 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
25816 "guestfs_add_drive_opts>."
25820 #: ../fuse/guestmount.pod:127
25821 msgid "B<--fuse-help>"
25825 #: ../fuse/guestmount.pod:129
25826 msgid "Display help on special FUSE options (see I<-o> below)."
25830 #: ../fuse/guestmount.pod:133
25831 msgid "Display brief help and exit."
25835 #: ../fuse/guestmount.pod:146
25836 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
25840 #: ../fuse/guestmount.pod:148
25842 "Mount the named partition or logical volume on the given mountpoint B<in the "
25843 "guest> (this has nothing to do with mountpoints in the host)."
25847 #: ../fuse/guestmount.pod:151
25849 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
25850 "something on C</>."
25854 #: ../fuse/guestmount.pod:156
25856 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
25857 "unmounted. If you specify this option, then we don't attempt to sync the "
25858 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
25862 #: ../fuse/guestmount.pod:161
25863 msgid "B<-o option> | B<--option option>"
25867 #: ../fuse/guestmount.pod:163
25868 msgid "Pass extra options to FUSE."
25872 #: ../fuse/guestmount.pod:165
25874 "To get a list of all the extra options supported by FUSE, use the command "
25875 "below. Note that only the FUSE I<-o> options can be passed, and only some "
25876 "of them are a good idea."
25880 #: ../fuse/guestmount.pod:169
25883 " guestmount --fuse-help\n"
25888 #: ../fuse/guestmount.pod:171
25889 msgid "Some potentially useful FUSE options:"
25893 #: ../fuse/guestmount.pod:175
25894 msgid "B<-o allow_other>"
25898 #: ../fuse/guestmount.pod:177
25899 msgid "Allow other users to see the filesystem."
25903 #: ../fuse/guestmount.pod:179
25904 msgid "B<-o attr_timeout=N>"
25908 #: ../fuse/guestmount.pod:181
25909 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
25913 #: ../fuse/guestmount.pod:183
25914 msgid "B<-o kernel_cache>"
25918 #: ../fuse/guestmount.pod:185
25920 "Allow the kernel to cache files (reduces the number of reads that have to go "
25921 "through the L<guestfs(3)> API). This is generally a good idea if you can "
25922 "afford the extra memory usage."
25926 #: ../fuse/guestmount.pod:189
25927 msgid "B<-o uid=N> B<-o gid=N>"
25931 #: ../fuse/guestmount.pod:191
25933 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
25934 "the chosen values."
25938 #: ../fuse/guestmount.pod:198
25940 "Add devices and mount everything read-only. Also disallow writes and make "
25941 "the disk appear read-only to FUSE."
25945 #: ../fuse/guestmount.pod:201
25947 "This is highly recommended if you are not going to edit the guest disk. If "
25948 "the guest is running and this option is I<not> supplied, then there is a "
25949 "strong risk of disk corruption in the guest. We try to prevent this from "
25950 "happening, but it is not always possible."
25954 #: ../fuse/guestmount.pod:206
25955 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
25959 #: ../fuse/guestmount.pod:210
25960 msgid "Enable SELinux support for the guest."
25964 #: ../fuse/guestmount.pod:214
25965 msgid "Enable verbose messages from underlying libguestfs."
25969 #: ../fuse/guestmount.pod:218
25970 msgid "Display the program version and exit."
25974 #: ../fuse/guestmount.pod:222
25976 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
25977 "FOR READ AND WRITE>."
25981 #: ../fuse/guestmount.pod:225
25982 msgid "B<-x> | B<--trace>"
25986 #: ../fuse/guestmount.pod:227
25987 msgid "Trace libguestfs calls."
25991 #: ../fuse/guestmount.pod:229
25992 msgid "This also stops the daemon from forking into the background."
25996 #: ../fuse/guestmount.pod:235
25998 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
25999 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
26004 #: ../inspector/virt-inspector.pl:35
26006 "virt-inspector - Display operating system version and other information "
26007 "about a virtual machine"
26011 #: ../inspector/virt-inspector.pl:39
26014 " virt-inspector [--connect URI] domname\n"
26019 #: ../inspector/virt-inspector.pl:41
26022 " virt-inspector guest.img [guest.img ...]\n"
26027 #: ../inspector/virt-inspector.pl:45
26029 "B<virt-inspector> examines a virtual machine or disk image and tries to "
26030 "determine the version of the operating system and other information about "
26031 "the virtual machine."
26035 #: ../inspector/virt-inspector.pl:49
26036 msgid "Virt-inspector produces XML output for feeding into other programs."
26040 #: ../inspector/virt-inspector.pl:51
26042 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
26043 "libvirt domain (see: C<virsh list --all>)."
26047 #: ../inspector/virt-inspector.pl:54
26049 "You can also run virt-inspector directly on disk images from a single "
26050 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
26051 "has several block devices, in which case you should list them one after "
26052 "another, with the first corresponding to the guest's C</dev/sda>, the second "
26053 "to the guest's C</dev/sdb> and so on."
26057 #: ../inspector/virt-inspector.pl:60
26059 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
26060 "inspect several virtual machines, you have to run virt-inspector several "
26061 "times (for example, from a shell script for-loop)."
26065 #: ../inspector/virt-inspector.pl:65
26067 "Because virt-inspector needs direct access to guest images, it won't "
26068 "normally work over remote libvirt connections."
26072 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82
26073 #: ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88
26074 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-tar.pl:108
26075 #: ../tools/virt-rescue.pl:113 ../tools/virt-make-fs.pl:163
26076 #: ../tools/virt-list-partitions.pl:61
26077 msgid "Display brief help."
26081 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88
26082 #: ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94
26083 #: ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66
26084 #: ../tools/virt-tar.pl:114 ../tools/virt-rescue.pl:119
26085 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:67
26086 msgid "B<--version>"
26090 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90
26091 #: ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96
26092 #: ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68
26093 #: ../tools/virt-tar.pl:116 ../tools/virt-rescue.pl:121
26094 #: ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:69
26095 msgid "Display version number and exit."
26099 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112
26100 #: ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102
26101 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-tar.pl:122
26102 #: ../tools/virt-rescue.pl:135 ../tools/virt-list-partitions.pl:75
26103 msgid "B<--connect URI> | B<-c URI>"
26107 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114
26108 #: ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104
26109 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-tar.pl:124
26110 #: ../tools/virt-rescue.pl:137 ../tools/virt-list-partitions.pl:77
26112 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26113 "to the default libvirt hypervisor."
26117 #: ../inspector/virt-inspector.pl:97
26119 "Libvirt is only used if you specify a C<domname> on the command line. If "
26120 "you specify guest block devices directly, then libvirt is not used at all."
26124 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124
26125 #: ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117
26126 #: ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523
26127 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-tar.pl:134
26128 #: ../tools/virt-rescue.pl:147 ../tools/virt-list-partitions.pl:87
26129 msgid "B<--format> raw"
26133 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126
26134 #: ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119
26135 #: ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88
26136 #: ../tools/virt-tar.pl:136 ../tools/virt-rescue.pl:149
26137 #: ../tools/virt-list-partitions.pl:89
26139 "Specify the format of disk images given on the command line. If this is "
26140 "omitted then the format is autodetected from the content of the disk image."
26144 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130
26145 #: ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123
26146 #: ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92
26147 #: ../tools/virt-tar.pl:140 ../tools/virt-rescue.pl:153
26148 #: ../tools/virt-list-partitions.pl:93
26150 "If disk images are requested from libvirt, then this program asks libvirt "
26151 "for this information. In this case, the value of the format parameter is "
26156 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134
26157 #: ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127
26158 #: ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528
26159 #: ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96
26160 #: ../tools/virt-tar.pl:144 ../tools/virt-rescue.pl:157
26161 #: ../tools/virt-list-partitions.pl:97
26163 "If working with untrusted raw-format guest disk images, you should ensure "
26164 "the format is always specified."
26168 #: ../inspector/virt-inspector.pl:149
26173 #: ../inspector/virt-inspector.pl:151
26175 "The virt-inspector XML is described precisely in a RELAX NG schema which is "
26176 "supplied with libguestfs. This section is just an overview."
26180 #: ../inspector/virt-inspector.pl:154
26182 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
26183 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
26184 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
26185 "which is vanishingly rare in real world VMs."
26189 #: ../inspector/virt-inspector.pl:159
26190 msgid "E<lt>operatingsystemE<gt>"
26194 #: ../inspector/virt-inspector.pl:161
26196 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
26197 "describe the operating system, its architecture, the descriptive \"product "
26198 "name\" string, the type of OS and so on, as in this example:"
26202 #: ../inspector/virt-inspector.pl:165
26205 " <operatingsystems>\n"
26206 " <operatingsystem>\n"
26207 " <root>/dev/sda2</root>\n"
26208 " <name>windows</name>\n"
26209 " <arch>i386</arch>\n"
26210 " <distro>windows</distro>\n"
26211 " <product_name>Windows 7 Enterprise</product_name>\n"
26212 " <major_version>6</major_version>\n"
26213 " <minor_version>1</minor_version>\n"
26214 " <windows_systemroot>/Windows</windows_systemroot>\n"
26219 #: ../inspector/virt-inspector.pl:176
26221 "These fields are derived from the libguestfs inspection API, and you can "
26222 "find more details in L<guestfs(3)/INSPECTION>."
26226 #: ../inspector/virt-inspector.pl:179
26228 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
26229 "of view of libguestfs (block devices may have completely different names "
26230 "inside the VM itself)."
26234 #: ../inspector/virt-inspector.pl:246
26235 msgid "E<lt>mountpointsE<gt>"
26239 #: ../inspector/virt-inspector.pl:248
26241 "Un*x-like guests typically have multiple filesystems which are mounted at "
26242 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
26243 "element which looks like this:"
26247 #: ../inspector/virt-inspector.pl:252
26250 " <operatingsystems>\n"
26251 " <operatingsystem>\n"
26254 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
26255 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
26256 " </mountpoints>\n"
26261 #: ../inspector/virt-inspector.pl:260
26263 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
26264 "and may have completely different names inside the guest. Only mountable "
26265 "filesystems appear in this list, not things like swap devices."
26269 #: ../inspector/virt-inspector.pl:282
26270 msgid "E<lt>filesystemsE<gt>"
26274 #: ../inspector/virt-inspector.pl:284
26276 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
26277 "filesystems belonging to the guest, including swap and empty partitions. "
26278 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
26279 "this OS or shared by this OS and other OSes)."
26283 #: ../inspector/virt-inspector.pl:289
26284 msgid "You might see something like this:"
26288 #: ../inspector/virt-inspector.pl:291
26291 " <operatingsystems>\n"
26292 " <operatingsystem>\n"
26295 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
26296 " <type>ext4</type>\n"
26297 " <label>Fedora-13-x86_64</label>\n"
26298 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
26304 #: ../inspector/virt-inspector.pl:301
26306 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
26307 "the label, and the UUID."
26311 #: ../inspector/virt-inspector.pl:343
26312 msgid "E<lt>applicationsE<gt>"
26316 #: ../inspector/virt-inspector.pl:345
26318 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
26319 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
26320 "machine. At the moment we are only able to list RPMs and Debian packages "
26321 "installed, but in future we will support other Linux distros and Windows."
26325 #: ../inspector/virt-inspector.pl:351
26327 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
26328 "Typical values would be C<rpm> and C<deb>."
26332 #: ../inspector/virt-inspector.pl:354
26334 "E<lt>package_managementE<gt>, if present, describes the package manager. "
26335 "Typical values include C<yum>, C<up2date> and C<apt>"
26339 #: ../inspector/virt-inspector.pl:357
26340 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
26344 #: ../inspector/virt-inspector.pl:360
26347 " <operatingsystems>\n"
26348 " <operatingsystem>\n"
26350 " <applications>\n"
26352 " <name>coreutils</name>\n"
26353 " <version>8.5</version>\n"
26354 " <release>1</release>\n"
26355 " </application>\n"
26360 #: ../inspector/virt-inspector.pl:370
26362 "The version and release fields may not be available for some types guests. "
26363 "Other fields are possible, see L<guestfs(3)/"
26364 "guestfs_inspect_list_applications>."
26368 #: ../inspector/virt-inspector.pl:426
26369 msgid "USING XPATH"
26373 #: ../inspector/virt-inspector.pl:428
26375 "You can use the XPath query language, and/or the xpath tool, in order to "
26376 "select parts of the XML."
26380 #: ../inspector/virt-inspector.pl:433
26383 " $ virt-inspector Guest | xpath //filesystems\n"
26384 " Found 1 nodes:\n"
26387 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
26388 " <type>ext4</type>\n"
26394 #: ../inspector/virt-inspector.pl:441
26397 " $ virt-inspector Guest | \\\n"
26398 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
26399 " Query didn't return a nodeset. Value: ext4\n"
26404 #: ../inspector/virt-inspector.pl:445 ../tools/virt-edit.pl:343
26405 #: ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477
26406 #: ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225
26407 #: ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179
26408 #: ../tools/virt-tar.pl:274 ../tools/virt-rescue.pl:260
26409 #: ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:247
26410 msgid "SHELL QUOTING"
26414 #: ../inspector/virt-inspector.pl:447 ../tools/virt-edit.pl:345
26415 #: ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635
26416 #: ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481
26417 #: ../tools/virt-list-filesystems.pl:181 ../tools/virt-tar.pl:276
26418 #: ../tools/virt-rescue.pl:262 ../tools/virt-make-fs.pl:529
26419 #: ../tools/virt-list-partitions.pl:249
26421 "Libvirt guest names can contain arbitrary characters, some of which have "
26422 "meaning to the shell such as C<#> and space. You may need to quote or "
26423 "escape these characters on the command line. See the shell manual page L<sh"
26424 "(1)> for details."
26428 #: ../inspector/virt-inspector.pl:454
26430 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
26431 "L<Sys::Virt(3)>, L<http://www.w3.org/TR/xpath/>, L<http://libguestfs.org/>."
26435 #: ../inspector/virt-inspector.pl:468 ../tools/virt-edit.pl:364
26436 #: ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651
26437 #: ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510
26438 #: ../tools/virt-list-filesystems.pl:200 ../tools/virt-tar.pl:294
26439 #: ../tools/virt-rescue.pl:279 ../tools/virt-make-fs.pl:561
26440 #: ../tools/virt-list-partitions.pl:267
26441 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26445 #: ../inspector/virt-inspector.pl:472
26446 msgid "Matthew Booth L<mbooth@redhat.com>"
26450 #: ../inspector/virt-inspector.pl:478 ../tools/virt-win-reg.pl:516
26451 #: ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
26452 msgid "Copyright (C) 2010 Red Hat Inc."
26456 #: ../tools/virt-edit.pl:34
26457 msgid "virt-edit - Edit a file in a virtual machine"
26461 #: ../tools/virt-edit.pl:38
26464 " virt-edit [--options] domname file\n"
26469 #: ../tools/virt-edit.pl:40
26472 " virt-edit [--options] disk.img [disk.img ...] file\n"
26477 #: ../tools/virt-edit.pl:42
26480 " virt-edit [domname|disk.img] file -e 'expr'\n"
26485 #: ../tools/virt-edit.pl:46
26487 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26488 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26489 "doing this, but doesn't catch all cases."
26493 #: ../tools/virt-edit.pl:52
26495 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26496 "the named virtual machine (or disk image)."
26500 #: ../tools/virt-edit.pl:55
26502 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26503 "you should look at the L<guestfish(1)> tool."
26507 #: ../tools/virt-edit.pl:60
26508 msgid "Edit the named files interactively:"
26512 #: ../tools/virt-edit.pl:62
26515 " virt-edit mydomain /boot/grub/grub.conf\n"
26520 #: ../tools/virt-edit.pl:64
26523 " virt-edit mydomain /etc/passwd\n"
26528 #: ../tools/virt-edit.pl:66
26530 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26531 "below). To change the init default level to 5:"
26535 #: ../tools/virt-edit.pl:70
26538 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26543 #: ../tools/virt-edit.pl:96
26544 msgid "B<--backup extension> | B<-b extension>"
26548 #: ../tools/virt-edit.pl:98
26550 "Create a backup of the original file I<in the guest disk image>. The backup "
26551 "has the original filename with C<extension> added."
26555 #: ../tools/virt-edit.pl:101
26557 "Usually the first character of C<extension> would be a dot C<.> so you would "
26562 #: ../tools/virt-edit.pl:104
26565 " virt-edit -b .orig [etc]\n"
26570 #: ../tools/virt-edit.pl:106
26571 msgid "By default, no backup file is made."
26575 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
26576 #: ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107
26577 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:127
26578 #: ../tools/virt-rescue.pl:140 ../tools/virt-list-partitions.pl:80
26580 "If you specify guest block devices directly, then libvirt is not used at all."
26584 #: ../tools/virt-edit.pl:141
26585 msgid "B<--expr EXPR> | B<-e EXPR>"
26589 #: ../tools/virt-edit.pl:143
26591 "Instead of launching the external editor, non-interactively apply the Perl "
26592 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26597 #: ../tools/virt-edit.pl:147
26599 "Be careful to properly quote the expression to prevent it from being altered "
26604 #: ../tools/virt-edit.pl:268
26605 msgid "NON-INTERACTIVE EDITING"
26609 #: ../tools/virt-edit.pl:270
26611 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26612 "administrator can interactively edit the file."
26616 #: ../tools/virt-edit.pl:273
26618 "There are two ways also to use C<virt-edit> from scripts in order to make "
26619 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26620 "like this, it's less error-prone to write scripts directly using the "
26621 "libguestfs API and Augeas for configuration file editing.)"
26625 #: ../tools/virt-edit.pl:279
26627 "The first method is to temporarily set C<$EDITOR> to any script or program "
26628 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26629 "update C<tmpfile> in place however it likes."
26633 #: ../tools/virt-edit.pl:283
26635 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26636 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26637 "instances of C<foo> with C<bar> in a file:"
26641 #: ../tools/virt-edit.pl:287
26644 " virt-edit domname filename -e 's/foo/bar/'\n"
26649 #: ../tools/virt-edit.pl:289
26651 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26652 "For example to delete root's password you could do:"
26656 #: ../tools/virt-edit.pl:292
26659 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26664 #: ../tools/virt-edit.pl:294
26666 "What really happens is that the snippet is evaluated as a Perl expression "
26667 "for each line of the file. The line, including the final C<\\n>, is passed "
26668 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26672 #: ../tools/virt-edit.pl:299
26674 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26675 "C<apache> user account from the password file you can do:"
26679 #: ../tools/virt-edit.pl:302
26682 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26687 #: ../tools/virt-edit.pl:304
26689 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26690 "the end of the file is rather difficult this way since there is no concept "
26691 "of \"last line of the file\" - your expression just doesn't get called "
26692 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26697 #: ../tools/virt-edit.pl:310
26699 "The variable C<$lineno> contains the current line number. As is "
26700 "traditional, the first line in the file is number C<1>."
26704 #: ../tools/virt-edit.pl:313
26706 "The return value from the expression is ignored, but the expression may call "
26707 "C<die> in order to abort the whole program, leaving the original file "
26712 #: ../tools/virt-edit.pl:317
26714 "Remember when matching the end of a line that C<$_> may contain the final C<"
26715 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26716 "newline then neither of these. Thus to match or substitute some text at the "
26717 "end of a line, use this regular expression:"
26721 #: ../tools/virt-edit.pl:322
26724 " /some text(\\r?\\n)?$/\n"
26729 #: ../tools/virt-edit.pl:324
26731 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26732 "$_> itself (since that would remove all newlines from the file):"
26736 #: ../tools/virt-edit.pl:328
26739 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26744 #: ../tools/virt-edit.pl:334
26749 #: ../tools/virt-edit.pl:336
26751 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26756 #: ../tools/virt-edit.pl:339
26757 msgid "If not set, C<vi> is used."
26761 #: ../tools/virt-edit.pl:352
26763 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26764 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
26769 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
26770 #: ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243
26771 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198
26772 #: ../tools/virt-tar.pl:292 ../tools/virt-rescue.pl:277
26773 #: ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:265
26778 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655
26779 #: ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
26780 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26784 #: ../tools/virt-win-reg.pl:37
26786 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26790 #: ../tools/virt-win-reg.pl:41
26793 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26798 #: ../tools/virt-win-reg.pl:43
26801 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26806 #: ../tools/virt-win-reg.pl:45
26809 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26814 #: ../tools/virt-win-reg.pl:47
26817 " virt-win-reg --merge domname [input.reg ...]\n"
26822 #: ../tools/virt-win-reg.pl:49
26825 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26830 #: ../tools/virt-win-reg.pl:53
26832 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26833 "virtual machines. If you do this, you I<will> get irreversible disk "
26834 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26835 "but doesn't catch all cases."
26839 #: ../tools/virt-win-reg.pl:58
26841 "Modifying the Windows Registry is an inherently risky operation. The format "
26842 "is deliberately obscure and undocumented, and Registry changes can leave the "
26843 "system unbootable. Therefore when using the C<--merge> option, make sure "
26844 "you have a reliable backup first."
26848 #: ../tools/virt-win-reg.pl:65
26850 "This program can export and merge Windows Registry entries from a Windows "
26855 #: ../tools/virt-win-reg.pl:68
26857 "The first parameter is the libvirt guest name or the raw disk image of a "
26862 #: ../tools/virt-win-reg.pl:71
26864 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26865 "exported (recursively). For example:"
26869 #: ../tools/virt-win-reg.pl:74
26872 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26877 #: ../tools/virt-win-reg.pl:76
26879 "You can also display single values from within registry keys, for example:"
26883 #: ../tools/virt-win-reg.pl:79
26886 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26887 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26888 " Windows 7 Enterprise\n"
26893 #: ../tools/virt-win-reg.pl:83
26895 "With C<--merge>, you can merge a textual regedit file into the Windows "
26900 #: ../tools/virt-win-reg.pl:86
26903 " $ virt-win-reg --merge Windows7 changes.reg\n"
26908 #: ../tools/virt-win-reg.pl:88
26909 msgid "SUPPORTED SYSTEMS"
26913 #: ../tools/virt-win-reg.pl:90
26915 "The program currently supports Windows NT-derived guests starting with "
26916 "Windows XP through to at least Windows 7."
26920 #: ../tools/virt-win-reg.pl:93
26922 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26923 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26924 "and C<HKEY_USERS\\.DEFAULT>."
26928 #: ../tools/virt-win-reg.pl:97
26930 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26935 #: ../tools/virt-win-reg.pl:100
26937 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26942 #: ../tools/virt-win-reg.pl:103
26947 #: ../tools/virt-win-reg.pl:105
26949 "This program is only meant for simple access to the registry. If you want "
26950 "to do complicated things with the registry, we suggest you download the "
26951 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26952 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26953 "L<hivexregedit(1)>."
26957 #: ../tools/virt-win-reg.pl:111
26962 #: ../tools/virt-win-reg.pl:113
26964 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26965 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26966 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26967 "Windows-style line endings, you may need to reencode the whole file before "
26968 "or after processing."
26972 #: ../tools/virt-win-reg.pl:119
26974 "To reencode a file from Windows format to Linux (before processing it with "
26975 "the C<--merge> option), you would do something like this:"
26979 #: ../tools/virt-win-reg.pl:122
26982 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26987 #: ../tools/virt-win-reg.pl:124
26989 "To go in the opposite direction, after exporting and before sending the file "
26990 "to a Windows user, do something like this:"
26994 #: ../tools/virt-win-reg.pl:127
26997 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
27002 #: ../tools/virt-win-reg.pl:129
27003 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
27007 #: ../tools/virt-win-reg.pl:131
27009 "If you are unsure about the current encoding, use the L<file(1)> command. "
27010 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
27011 "style (CRLF) line endings, like this:"
27015 #: ../tools/virt-win-reg.pl:135
27018 " $ file software.reg\n"
27019 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
27020 " with CRLF line terminators\n"
27025 #: ../tools/virt-win-reg.pl:139
27026 msgid "This file would need conversion before you could C<--merge> it."
27030 #: ../tools/virt-win-reg.pl:143
27032 "Be careful when passing parameters containing C<\\> (backslash) in the "
27033 "shell. Usually you will have to use 'single quotes' or double backslashes "
27034 "(but not both) to protect them from the shell."
27038 #: ../tools/virt-win-reg.pl:147
27039 msgid "Paths and value names are case-insensitive."
27043 #: ../tools/virt-win-reg.pl:149
27044 msgid "CurrentControlSet etc."
27048 #: ../tools/virt-win-reg.pl:151
27050 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
27051 "Registry at the level of the hive file, and therefore you cannot modify "
27056 #: ../tools/virt-win-reg.pl:155
27058 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
27059 "circumstances it might refer to another control set. The way to find out is "
27060 "to look at the C<HKLM\\SYSTEM\\Select> key:"
27064 #: ../tools/virt-win-reg.pl:159
27067 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
27068 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
27069 " \"Current\"=dword:00000001\n"
27070 " \"Default\"=dword:00000001\n"
27071 " \"Failed\"=dword:00000000\n"
27072 " \"LastKnownGood\"=dword:00000002\n"
27077 #: ../tools/virt-win-reg.pl:166
27078 msgid "\"Current\" is the one which Windows will choose when it boots."
27082 #: ../tools/virt-win-reg.pl:168
27084 "Similarly, other C<Current...> keys in the path may need to be replaced."
27088 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
27093 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
27094 msgid "Enable debugging messages."
27098 #: ../tools/virt-win-reg.pl:232
27103 #: ../tools/virt-win-reg.pl:234
27105 "In merge mode, this merges a textual regedit file into the Windows Registry "
27106 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
27107 "displays or exports Registry entries instead."
27111 #: ../tools/virt-win-reg.pl:238
27113 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
27114 "result in disk corruption. However exporting (without this flag) is always "
27119 #: ../tools/virt-win-reg.pl:246
27120 msgid "B<--encoding> UTF-16LE|ASCII"
27124 #: ../tools/virt-win-reg.pl:248
27126 "When merging (only), you may need to specify the encoding for strings to be "
27127 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
27128 "(3)/ENCODING STRINGS>."
27132 #: ../tools/virt-win-reg.pl:252
27134 "The default is to use UTF-16LE, which should work with recent versions of "
27139 #: ../tools/virt-win-reg.pl:486
27141 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
27142 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
27143 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27147 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
27149 "When reporting bugs, please enable debugging and capture the I<complete> "
27154 #: ../tools/virt-win-reg.pl:504
27157 " export LIBGUESTFS_DEBUG=1\n"
27158 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
27163 #: ../tools/virt-win-reg.pl:507
27165 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
27170 #: ../tools/virt-df.pl:36
27171 msgid "virt-df - Display free space on virtual filesystems"
27175 #: ../tools/virt-df.pl:40
27178 " virt-df [--options]\n"
27183 #: ../tools/virt-df.pl:42
27186 " virt-df [--options] domname\n"
27191 #: ../tools/virt-df.pl:44
27194 " virt-df [--options] disk.img [disk.img ...]\n"
27199 #: ../tools/virt-df.pl:48
27201 "C<virt-df> is a command line tool to display free space on virtual machine "
27202 "filesystems. Unlike other tools, it doesn't just display the amount of "
27203 "space allocated to a virtual machine, but can look inside the virtual "
27204 "machine to see how much space is really being used."
27208 #: ../tools/virt-df.pl:53
27210 "It is like the L<df(1)> command, but for virtual machines, except that it "
27211 "also works for Windows virtual machines."
27215 #: ../tools/virt-df.pl:56
27217 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
27218 "of all active and inactive guests, and performs a C<df>-type operation on "
27219 "each one in turn, printing out the results."
27223 #: ../tools/virt-df.pl:60
27225 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
27226 "either the single named libvirt domain, or on the disk image(s) listed on "
27227 "the command line (which must all belong to a single VM). In this mode (with "
27228 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
27229 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
27233 #: ../tools/virt-df.pl:67
27235 "Use the C<--csv> option to get a format which can be easily parsed by other "
27236 "programs. Other options are mostly similar to standard C<df> options. See "
27237 "below for the complete list."
27241 #: ../tools/virt-df.pl:107
27246 #: ../tools/virt-df.pl:109
27248 "Write out the results in CSV format (comma-separated values). This format "
27249 "can be imported easily into databases and spreadsheets, but read L</NOTE "
27250 "ABOUT CSV FORMAT> below."
27254 #: ../tools/virt-df.pl:134
27255 msgid "B<--human-readable> | B<-h>"
27259 #: ../tools/virt-df.pl:136
27260 msgid "Print sizes in human-readable format."
27264 #: ../tools/virt-df.pl:138
27265 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
27269 #: ../tools/virt-df.pl:144
27270 msgid "B<--inodes> | B<-i>"
27274 #: ../tools/virt-df.pl:146
27275 msgid "Print inodes instead of blocks."
27279 #: ../tools/virt-df.pl:152
27280 msgid "B<--one-per-guest>"
27284 #: ../tools/virt-df.pl:154
27286 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
27287 "disks from several guests to a single libguestfs appliance."
27291 #: ../tools/virt-df.pl:157
27292 msgid "You might use this option in the following circumstances:"
27296 #: ../tools/virt-df.pl:163
27298 "If you think an untrusted guest might actively try to exploit the libguestfs "
27299 "appliance kernel, then this prevents one guest from interfering with the "
27300 "stats printed for another guest."
27304 #: ../tools/virt-df.pl:169
27306 "If the kernel has a bug which stops it from accessing a filesystem in one "
27307 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
27308 "and report stats for further guests."
27312 #: ../tools/virt-df.pl:180
27317 #: ../tools/virt-df.pl:182
27319 "Print UUIDs instead of names. This is useful for following a guest even "
27320 "when the guest is migrated or renamed, or when two guests happen to have the "
27325 #: ../tools/virt-df.pl:186
27327 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
27328 "images, we still print the disk image name even when this option is "
27333 #: ../tools/virt-df.pl:609
27334 msgid "NOTE ABOUT CSV FORMAT"
27338 #: ../tools/virt-df.pl:611
27340 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
27341 "should be easy to parse, but it is definitely not easy to parse."
27345 #: ../tools/virt-df.pl:614
27347 "Myth: Just split fields at commas. Reality: This does I<not> work "
27348 "reliably. This example has two columns:"
27352 #: ../tools/virt-df.pl:617
27355 " \"foo,bar\",baz\n"
27360 #: ../tools/virt-df.pl:619
27362 "Myth: Read the file one line at a time. Reality: This does I<not> work "
27363 "reliably. This example has one row:"
27367 #: ../tools/virt-df.pl:622
27376 #: ../tools/virt-df.pl:625
27378 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
27379 "packaged in major Linux distributions)."
27383 #: ../tools/virt-df.pl:628
27385 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
27386 "or Python's built-in csv library)."
27390 #: ../tools/virt-df.pl:631
27391 msgid "Most spreadsheets and databases can import CSV directly."
27395 #: ../tools/virt-df.pl:642
27397 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27398 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27402 #: ../tools/virt-ls.pl:34
27403 msgid "virt-ls - List files in a virtual machine"
27407 #: ../tools/virt-ls.pl:38
27410 " virt-ls [--options] domname directory\n"
27415 #: ../tools/virt-ls.pl:40
27418 " virt-ls [--options] disk.img [disk.img ...] directory\n"
27423 #: ../tools/virt-ls.pl:44
27425 "C<virt-ls> is a command line tool to list the names of files in a directory "
27426 "inside a virtual machine or disk image."
27430 #: ../tools/virt-ls.pl:47
27432 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
27433 "For more complex cases you should look at the L<guestfish(1)> tool."
27437 #: ../tools/virt-ls.pl:51
27439 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
27440 "simple listing is like the ordinary L<ls(1)> command:"
27444 #: ../tools/virt-ls.pl:54
27447 " $ virt-ls myguest /\n"
27455 #: ../tools/virt-ls.pl:59
27456 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
27460 #: ../tools/virt-ls.pl:61
27463 " $ virt-ls -l myguest /\n"
27465 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
27466 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
27472 #: ../tools/virt-ls.pl:67
27474 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
27475 "and directories recursively:"
27479 #: ../tools/virt-ls.pl:70
27482 " $ virt-ls -R myguest /tmp\n"
27490 #: ../tools/virt-ls.pl:75
27492 "You I<cannot> combine these options. To do more complicated things, use "
27497 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103
27498 #: ../tools/virt-list-partitions.pl:112
27499 msgid "B<-l> | B<--long>"
27503 #: ../tools/virt-ls.pl:133
27504 msgid "B<-R> | B<--recursive>"
27508 #: ../tools/virt-ls.pl:135
27510 "Select the mode. With neither of these options, C<virt-ls> produces a "
27511 "simple, flat list of the files in the named directory."
27515 #: ../tools/virt-ls.pl:138
27517 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
27518 "like the plain C<ls -l> command)."
27522 #: ../tools/virt-ls.pl:141
27524 "C<virt-ls -R> produces a recursive list of files starting at the named "
27525 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
27530 #: ../tools/virt-ls.pl:145
27531 msgid "You cannot combine these options."
27535 #: ../tools/virt-ls.pl:234
27537 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
27538 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
27543 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204
27544 #: ../tools/virt-tar.pl:298
27545 msgid "Copyright (C) 2009 Red Hat Inc."
27549 #: ../tools/virt-resize.pl:42
27550 msgid "virt-resize - Resize a virtual machine disk"
27554 #: ../tools/virt-resize.pl:46
27557 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27558 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27559 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27564 #: ../tools/virt-resize.pl:52
27566 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27567 "larger or smaller overall, and resizing or deleting any partitions contained "
27572 #: ../tools/virt-resize.pl:56
27574 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27575 "not> be used on live virtual machines - for consistent results, shut the "
27576 "virtual machine down before resizing it."
27580 #: ../tools/virt-resize.pl:60
27582 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
27583 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
27584 "read those manual pages first."
27588 #: ../tools/virt-resize.pl:68
27590 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27591 "fill the extra 5GB of space."
27595 #: ../tools/virt-resize.pl:71
27598 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27599 " virt-list-partitions -lht olddisk\n"
27600 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27601 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27606 #: ../tools/virt-resize.pl:76
27608 "As above, but make the /boot partition 200MB bigger, while giving the "
27609 "remaining space to /dev/sda2:"
27613 #: ../tools/virt-resize.pl:79
27616 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27621 #: ../tools/virt-resize.pl:81
27622 msgid "As above, but the output format will be uncompressed qcow2:"
27626 #: ../tools/virt-resize.pl:83
27629 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27630 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27635 #: ../tools/virt-resize.pl:86
27636 msgid "DETAILED USAGE"
27640 #: ../tools/virt-resize.pl:88
27641 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27645 #: ../tools/virt-resize.pl:92
27646 msgid "1. Shut down the virtual machine"
27650 #: ../tools/virt-resize.pl:94
27651 msgid "2. Locate input disk image"
27655 #: ../tools/virt-resize.pl:96
27657 "Locate the input disk image (ie. the file or device on the host containing "
27658 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27659 "dumpxml> like this to find the disk image name:"
27663 #: ../tools/virt-resize.pl:100
27666 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27667 " Found 1 nodes:\n"
27669 " <source dev=\"/dev/vg/lv_guest\" />\n"
27674 #: ../tools/virt-resize.pl:105
27675 msgid "3. Look at current sizing"
27679 #: ../tools/virt-resize.pl:107
27681 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
27685 #: ../tools/virt-resize.pl:110
27688 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
27689 " /dev/sda1 ext3 101.9M\n"
27690 " /dev/sda2 pv 7.9G\n"
27691 " /dev/sda device 8.0G\n"
27696 #: ../tools/virt-resize.pl:115
27698 "(This example is a virtual machine with an 8 GB disk which we would like to "
27699 "expand up to 10 GB)."
27703 #: ../tools/virt-resize.pl:118
27704 msgid "4. Create output disk"
27708 #: ../tools/virt-resize.pl:120
27710 "Virt-resize cannot do in-place disk modifications. You have to have space "
27711 "to store the resized output disk."
27715 #: ../tools/virt-resize.pl:123
27717 "To store the resized disk image in a file, create a file of a suitable size:"
27721 #: ../tools/virt-resize.pl:126
27724 " # rm -f outdisk\n"
27725 " # truncate -s 10G outdisk\n"
27730 #: ../tools/virt-resize.pl:129
27731 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27735 #: ../tools/virt-resize.pl:131
27738 " # lvcreate -L 10G -n lv_name vg_name\n"
27743 #: ../tools/virt-resize.pl:133
27744 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27748 #: ../tools/virt-resize.pl:135
27751 " # virsh pool-list\n"
27752 " # virsh vol-create-as poolname newvol 10G\n"
27757 #: ../tools/virt-resize.pl:138
27762 #: ../tools/virt-resize.pl:140
27764 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27765 "file) and the output disk. The output disk is the one created in the "
27770 #: ../tools/virt-resize.pl:144
27773 " # virt-resize indisk outdisk\n"
27778 #: ../tools/virt-resize.pl:146
27780 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27781 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27782 "larger, then an extra, empty partition is created at the end of the disk "
27783 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27788 #: ../tools/virt-resize.pl:152
27790 "More realistically you'd want to expand existing partitions in the disk "
27791 "image by passing extra options (for the full list see the L</OPTIONS> "
27796 #: ../tools/virt-resize.pl:156
27798 "L</--expand> is the most useful option. It expands the named partition "
27799 "within the disk to fill any extra space:"
27803 #: ../tools/virt-resize.pl:159
27806 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27811 #: ../tools/virt-resize.pl:161
27813 "(In this case, an extra partition is I<not> created at the end of the disk, "
27814 "because there will be no unused space)."
27818 #: ../tools/virt-resize.pl:164
27820 "L</--resize> is the other commonly used option. The following would "
27821 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27822 "rest of the available space:"
27826 #: ../tools/virt-resize.pl:168
27829 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27830 " indisk outdisk\n"
27835 #: ../tools/virt-resize.pl:171
27837 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27838 "if virt-resize knows how, it will resize the contents, the equivalent of "
27839 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27840 ">. However virt-resize does not know how to resize some filesystems, so you "
27841 "would have to online resize them after booting the guest. And virt-resize "
27842 "also does not resize anything inside an LVM PV, it just resizes the PV "
27843 "itself and leaves the user to resize any LVs inside that PV as desired."
27847 #: ../tools/virt-resize.pl:180
27848 msgid "Other options are covered below."
27852 #: ../tools/virt-resize.pl:182
27857 #: ../tools/virt-resize.pl:184
27858 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27862 #: ../tools/virt-resize.pl:186
27863 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27867 #: ../tools/virt-resize.pl:188
27870 " # virsh edit guestname\n"
27875 #: ../tools/virt-resize.pl:190
27877 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27878 "html#elementsDisks>"
27882 #: ../tools/virt-resize.pl:193
27883 msgid "Then start up the domain with the new, resized disk:"
27887 #: ../tools/virt-resize.pl:195
27890 " # virsh start guestname\n"
27895 #: ../tools/virt-resize.pl:197
27897 "and check that it still works. See also the L</NOTES> section below for "
27898 "additional information."
27902 #: ../tools/virt-resize.pl:200
27903 msgid "7. Resize LVs etc inside the guest"
27907 #: ../tools/virt-resize.pl:202
27908 msgid "(This can also be done offline using L<guestfish(1)>)"
27912 #: ../tools/virt-resize.pl:204
27914 "Once the guest has booted you should see the new space available, at least "
27915 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27916 "may need to resize LVs inside PVs, and also resize filesystem types that "
27917 "virt-resize does not know how to expand."
27921 #: ../tools/virt-resize.pl:211
27922 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27926 #: ../tools/virt-resize.pl:213
27928 "Shrinking is somewhat more complex than expanding, and only an overview is "
27933 #: ../tools/virt-resize.pl:216
27935 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27936 "filesystems). The user has to shrink content before passing the disk image "
27937 "to virt-resize, and virt-resize will check that the content has been shrunk "
27942 #: ../tools/virt-resize.pl:221
27943 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27947 #: ../tools/virt-resize.pl:223
27949 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27950 "steps 3 and 4 above to allocate a new disk image."
27954 #: ../tools/virt-resize.pl:226
27956 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
27960 #: ../tools/virt-resize.pl:229
27961 msgid "IGNORING OR DELETING PARTITIONS"
27965 #: ../tools/virt-resize.pl:231
27967 "virt-resize also gives a convenient way to ignore or delete partitions when "
27968 "copying from the input disk to the output disk. Ignoring a partition speeds "
27969 "up the copy where you don't care about the existing contents of a "
27970 "partition. Deleting a partition removes it completely, but note that it "
27971 "also renumbers any partitions after the one which is deleted, which can "
27972 "leave some guests unbootable."
27976 #: ../tools/virt-resize.pl:238
27977 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
27981 #: ../tools/virt-resize.pl:240
27983 "If the input disk is in qcow2 format, then you may prefer that the output is "
27984 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
27985 "the fly. The output format is simply determined by the format of the empty "
27986 "output container that you provide. Thus to create qcow2 output, use:"
27990 #: ../tools/virt-resize.pl:246
27993 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
27998 #: ../tools/virt-resize.pl:248
27999 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
28003 #: ../tools/virt-resize.pl:250
28004 msgid "Similarly, to get non-sparse raw output use:"
28008 #: ../tools/virt-resize.pl:252
28011 " fallocate -l size outdisk\n"
28016 #: ../tools/virt-resize.pl:254
28018 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
28019 "dev/zero of=outdisk bs=1M count=..>)"
28023 #: ../tools/virt-resize.pl:267
28024 msgid "Display help."
28028 #: ../tools/virt-resize.pl:281
28029 msgid "B<--resize part=size>"
28033 #: ../tools/virt-resize.pl:283
28035 "Resize the named partition (expanding or shrinking it) so that it has the "
28040 #: ../tools/virt-resize.pl:286
28042 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
28043 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
28044 "Exabytes; or as a percentage of the current size; or as a relative number or "
28045 "percentage. For example:"
28049 #: ../tools/virt-resize.pl:291
28052 " --resize /dev/sda2=10G\n"
28057 #: ../tools/virt-resize.pl:293
28060 " --resize /dev/sda4=90%\n"
28065 #: ../tools/virt-resize.pl:295
28068 " --resize /dev/sda2=+1G\n"
28073 #: ../tools/virt-resize.pl:297
28076 " --resize /dev/sda2=-200M\n"
28081 #: ../tools/virt-resize.pl:299
28084 " --resize /dev/sda1=+128K\n"
28089 #: ../tools/virt-resize.pl:301
28092 " --resize /dev/sda1=+10%\n"
28097 #: ../tools/virt-resize.pl:303
28100 " --resize /dev/sda1=-10%\n"
28105 #: ../tools/virt-resize.pl:305
28107 "You can increase the size of any partition. Virt-resize will expand the "
28108 "direct content of the partition if it knows how (see C<--expand> below)."
28112 #: ../tools/virt-resize.pl:309
28114 "You can only I<decrease> the size of partitions that contain filesystems or "
28115 "PVs which have already been shrunk. Virt-resize will check this has been "
28116 "done before proceeding, or else will print an error (see also C<--resize-"
28121 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406
28122 #: ../tools/virt-resize.pl:423
28123 msgid "You can give this option multiple times."
28127 #: ../tools/virt-resize.pl:320
28128 msgid "B<--resize-force part=size>"
28132 #: ../tools/virt-resize.pl:322
28134 "This is the same as C<--resize> except that it will let you decrease the "
28135 "size of any partition. Generally this means you will lose any data which "
28136 "was at the end of the partition you shrink, but you may not care about that "
28137 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
28138 "as a swap partition)."
28142 #: ../tools/virt-resize.pl:328
28143 msgid "See also the C<--ignore> option."
28147 #: ../tools/virt-resize.pl:334
28148 msgid "B<--expand part>"
28152 #: ../tools/virt-resize.pl:336
28154 "Expand the named partition so it uses up all extra space (space left over "
28155 "after any other resize changes that you request have been done)."
28159 #: ../tools/virt-resize.pl:339
28161 "If virt-resize knows how, it will expand the direct content of the "
28162 "partition. For example, if the partition is an LVM PV, it will expand the "
28163 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
28164 "content it doesn't know about alone."
28168 #: ../tools/virt-resize.pl:344
28169 msgid "Currently virt-resize can resize:"
28173 #: ../tools/virt-resize.pl:350
28175 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
28180 #: ../tools/virt-resize.pl:355
28182 "NTFS filesystems contained directly in a partition, if libguestfs was "
28183 "compiled with support for NTFS."
28187 #: ../tools/virt-resize.pl:358
28189 "The filesystem must have been shut down consistently last time it was used. "
28190 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
28191 "consistency check, so at the first boot after resizing Windows will check "
28196 #: ../tools/virt-resize.pl:365
28198 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
28199 "inside the PV. The user will have to resize LVs as desired."
28203 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
28204 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
28208 #: ../tools/virt-resize.pl:377
28209 msgid "B<--shrink part>"
28213 #: ../tools/virt-resize.pl:379
28215 "Shrink the named partition until the overall disk image fits in the "
28216 "destination. The named partition B<must> contain a filesystem or PV which "
28217 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
28218 "online tools). Virt-resize will check this and give an error if it has not "
28223 #: ../tools/virt-resize.pl:385
28225 "The amount by which the overall disk must be shrunk (after carrying out all "
28226 "other operations requested by the user) is called the \"deficit\". For "
28227 "example, a straight copy (assume no other operations) from a 5GB disk image "
28228 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
28229 "would give an error unless the user specified a partition to shrink and that "
28230 "partition had more than a gigabyte of free space."
28234 #: ../tools/virt-resize.pl:399
28235 msgid "B<--ignore part>"
28239 #: ../tools/virt-resize.pl:401
28241 "Ignore the named partition. Effectively this means the partition is "
28242 "allocated on the destination disk, but the content is not copied across from "
28243 "the source disk. The content of the partition will be blank (all zero "
28248 #: ../tools/virt-resize.pl:412
28249 msgid "B<--delete part>"
28253 #: ../tools/virt-resize.pl:414
28255 "Delete the named partition. It would be more accurate to describe this as "
28256 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
28257 "the original disk image is left intact."
28261 #: ../tools/virt-resize.pl:418
28263 "Note that when you delete a partition, then anything contained in the "
28264 "partition is also deleted. Furthermore, this causes any partitions that "
28265 "come after to be I<renumbered>, which can easily make your guest unbootable."
28269 #: ../tools/virt-resize.pl:429
28270 msgid "B<--LV-expand logvol>"
28274 #: ../tools/virt-resize.pl:431
28276 "This takes the logical volume and, as a final step, expands it to fill all "
28277 "the space available in its volume group. A typical usage, assuming a Linux "
28278 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
28279 "lv_root> would be:"
28283 #: ../tools/virt-resize.pl:436
28286 " virt-resize indisk outdisk \\\n"
28287 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
28292 #: ../tools/virt-resize.pl:439
28294 "This would first expand the partition (and PV), and then expand the root "
28295 "device to fill the extra space in the PV."
28299 #: ../tools/virt-resize.pl:442
28301 "The contents of the LV are also resized if virt-resize knows how to do "
28302 "that. You can stop virt-resize from trying to expand the content by using "
28303 "the option C<--no-expand-content>."
28307 #: ../tools/virt-resize.pl:446
28308 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
28312 #: ../tools/virt-resize.pl:449
28314 "You can give this option multiple times, I<but> it doesn't make sense to do "
28315 "this unless the logical volumes you specify are all in different volume "
28320 #: ../tools/virt-resize.pl:457
28321 msgid "B<--no-copy-boot-loader>"
28325 #: ../tools/virt-resize.pl:459
28327 "By default, virt-resize copies over some sectors at the start of the disk "
28328 "(up to the beginning of the first partition). Commonly these sectors "
28329 "contain the Master Boot Record (MBR) and the boot loader, and are required "
28330 "in order for the guest to boot correctly."
28334 #: ../tools/virt-resize.pl:464
28336 "If you specify this flag, then this initial copy is not done. You may need "
28337 "to reinstall the boot loader in this case."
28341 #: ../tools/virt-resize.pl:472
28342 msgid "B<--no-extra-partition>"
28346 #: ../tools/virt-resize.pl:474
28348 "By default, virt-resize creates an extra partition if there is any extra, "
28349 "unused space after all resizing has happened. Use this option to prevent "
28350 "the extra partition from being created. If you do this then the extra space "
28351 "will be inaccessible until you run fdisk, parted, or some other partitioning "
28352 "tool in the guest."
28356 #: ../tools/virt-resize.pl:480
28358 "Note that if the surplus space is smaller than 10 MB, no extra partition "
28363 #: ../tools/virt-resize.pl:487
28364 msgid "B<--no-expand-content>"
28368 #: ../tools/virt-resize.pl:489
28370 "By default, virt-resize will try to expand the direct contents of "
28371 "partitions, if it knows how (see C<--expand> option above)."
28375 #: ../tools/virt-resize.pl:492
28377 "If you give the C<--no-expand-content> option then virt-resize will not "
28382 #: ../tools/virt-resize.pl:499
28383 msgid "B<-d> | B<--debug>"
28387 #: ../tools/virt-resize.pl:507
28388 msgid "B<-n> | B<--dryrun>"
28392 #: ../tools/virt-resize.pl:509
28393 msgid "Print a summary of what would be done, but don't do anything."
28397 #: ../tools/virt-resize.pl:515
28398 msgid "B<-q> | B<--quiet>"
28402 #: ../tools/virt-resize.pl:517
28403 msgid "Don't print the summary."
28407 #: ../tools/virt-resize.pl:525
28409 "Specify the format of the input disk image. If this flag is not given then "
28410 "it is auto-detected from the image itself."
28414 #: ../tools/virt-resize.pl:531
28416 "Note that this option I<does not> affect the output format. See L</QCOW2 "
28417 "AND NON-SPARSE RAW FORMATS>."
28421 #: ../tools/virt-resize.pl:538
28422 msgid "B<--output-format> raw"
28426 #: ../tools/virt-resize.pl:540
28428 "Specify the format of the output disk image. If this flag is not given then "
28429 "it is auto-detected from the image itself."
28433 #: ../tools/virt-resize.pl:546
28435 "Note that you still need to create the output disk with the right format. "
28436 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
28440 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
28445 #: ../tools/virt-resize.pl:1424
28446 msgid "\"Partition 1 does not end on cylinder boundary.\""
28450 #: ../tools/virt-resize.pl:1426
28452 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
28453 "means the partitions will not be aligned to the ancient CHS geometry. "
28454 "However CHS geometry is meaningless for disks manufactured since the early "
28455 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
28456 "cylinders is not required by any modern operating system."
28460 #: ../tools/virt-resize.pl:1433
28461 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
28465 #: ../tools/virt-resize.pl:1435
28467 "In Windows Vista and later versions, Microsoft switched to using a separate "
28468 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
28469 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
28470 "the boot partition. Doing so seems to break the guest completely. However "
28471 "expanding the second partition (ie. C: drive) should work."
28475 #: ../tools/virt-resize.pl:1442
28477 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
28478 "NTFS partitions have been expanded. This is just a safety check and (unless "
28479 "it find errors) is nothing to worry about."
28483 #: ../tools/virt-resize.pl:1446
28484 msgid "GUEST BOOT STUCK AT \"GRUB\""
28488 #: ../tools/virt-resize.pl:1448
28490 "If a Linux guest does not boot after resizing, and the boot is stuck after "
28491 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
28492 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
28493 "although we think is to do with partition alignment."
28497 #: ../tools/virt-resize.pl:1453
28500 " guestfish -i -a newdisk\n"
28501 " ><fs> cat /boot/grub/device.map\n"
28502 " # check the contents of this file are sensible or\n"
28503 " # edit the file if necessary\n"
28504 " ><fs> grub-install / /dev/vda\n"
28510 #: ../tools/virt-resize.pl:1460
28512 "For more flexible guest reconfiguration, including if you need to specify "
28513 "other parameters to grub-install, use L<virt-rescue(1)>."
28517 #: ../tools/virt-resize.pl:1463
28518 msgid "ALTERNATIVE TOOLS"
28522 #: ../tools/virt-resize.pl:1465
28524 "There are several proprietary tools for resizing partitions. We won't "
28525 "mention any here."
28529 #: ../tools/virt-resize.pl:1468
28531 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
28532 "operations on disk images. They can resize and move partitions, but I don't "
28533 "think they can do anything with the contents, and they certainly don't "
28538 #: ../tools/virt-resize.pl:1473
28540 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
28541 "but at a much lower level. You will probably end up hand-calculating sector "
28542 "offsets, which is something that virt-resize was designed to avoid. If you "
28543 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28548 #: ../tools/virt-resize.pl:1488
28550 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
28551 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
28552 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)"
28553 ">, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
28554 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28558 #: ../tools/virt-list-filesystems.pl:32
28560 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28564 #: ../tools/virt-list-filesystems.pl:36
28567 " virt-list-filesystems [--options] domname\n"
28572 #: ../tools/virt-list-filesystems.pl:38
28575 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28580 #: ../tools/virt-list-filesystems.pl:42
28582 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28583 "are contained in a virtual machine or disk image."
28587 #: ../tools/virt-list-filesystems.pl:46
28589 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28590 "functionality. For more complex cases you should look at the L<guestfish(1)"
28595 #: ../tools/virt-list-filesystems.pl:105
28597 "With this option, C<virt-list-filesystems> displays the type of each "
28598 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28602 #: ../tools/virt-list-filesystems.pl:112
28603 msgid "B<-a> | B<--all>"
28607 #: ../tools/virt-list-filesystems.pl:114
28609 "Normally we only show mountable filesystems. If this option is given then "
28610 "swap devices are shown too."
28614 #: ../tools/virt-list-filesystems.pl:188
28616 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
28617 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
28618 ">, L<http://libguestfs.org/>."
28622 #: ../tools/virt-tar.pl:33
28623 msgid "virt-tar - Extract or upload files to a virtual machine"
28627 #: ../tools/virt-tar.pl:37
28630 " virt-tar [--options] -x domname directory tarball\n"
28635 #: ../tools/virt-tar.pl:39
28638 " virt-tar [--options] -u domname tarball directory\n"
28643 #: ../tools/virt-tar.pl:41
28646 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28651 #: ../tools/virt-tar.pl:43
28654 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28659 #: ../tools/virt-tar.pl:47
28660 msgid "Download C</home> from the VM into a local tarball:"
28664 #: ../tools/virt-tar.pl:49
28667 " virt-tar -x domname /home home.tar\n"
28672 #: ../tools/virt-tar.pl:51
28675 " virt-tar -zx domname /home home.tar.gz\n"
28680 #: ../tools/virt-tar.pl:53
28681 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28685 #: ../tools/virt-tar.pl:55
28688 " virt-tar -u domname uploadstuff.tar /tmp\n"
28693 #: ../tools/virt-tar.pl:57
28696 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28701 #: ../tools/virt-tar.pl:61
28703 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28704 "virtual machines. If you do this, you risk disk corruption in the VM. "
28705 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28709 #: ../tools/virt-tar.pl:66
28711 "You can use C<-x> (extract) on live virtual machines, but you might get "
28712 "inconsistent results or errors if there is filesystem activity inside the "
28713 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28714 "work, but the only way to guarantee consistent results is if the virtual "
28715 "machine is shut down."
28719 #: ../tools/virt-tar.pl:74
28721 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28722 "parts of a guest filesystem. There are many possibilities: making backups, "
28723 "uploading data files, snooping on guest activity, fixing or customizing "
28728 #: ../tools/virt-tar.pl:79
28730 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28731 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28732 "should look at the L<guestfish(1)> tool."
28736 #: ../tools/virt-tar.pl:83
28738 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28739 "its contents (recursively) from the virtual machine into a local tarball. "
28740 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28741 "virtual machine. You cannot use these two options together."
28745 #: ../tools/virt-tar.pl:89
28747 "In addition, you may need to use the C<-z> (gZip) option to enable "
28748 "compression. When uploading, you have to specify C<-z> if the upload file "
28749 "is compressed because virt-tar won't detect this on its own."
28753 #: ../tools/virt-tar.pl:93
28755 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28756 "example it cannot do PKZip files or bzip2 compression. If you want that "
28757 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28758 "the L<libguestfs(3)> API)."
28762 #: ../tools/virt-tar.pl:151
28763 msgid "B<-x> | B<--extract> | B<--download>"
28767 #: ../tools/virt-tar.pl:153
28768 msgid "B<-u> | B<--upload>"
28772 #: ../tools/virt-tar.pl:155
28774 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28779 #: ../tools/virt-tar.pl:158
28781 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28782 "Please read the L</WARNING> section above before using this option."
28786 #: ../tools/virt-tar.pl:162
28787 msgid "You must specify exactly one of these options."
28791 #: ../tools/virt-tar.pl:168
28792 msgid "B<-z> | B<--gzip>"
28796 #: ../tools/virt-tar.pl:170
28797 msgid "Specify that the input or output tarball is gzip-compressed."
28801 #: ../tools/virt-tar.pl:283
28803 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28804 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28809 #: ../tools/virt-rescue.pl:33
28810 msgid "virt-rescue - Run a rescue shell on a virtual machine"
28814 #: ../tools/virt-rescue.pl:37
28817 " virt-rescue [--options] domname\n"
28822 #: ../tools/virt-rescue.pl:39
28825 " virt-rescue [--options] disk.img [disk.img ...]\n"
28830 #: ../tools/virt-rescue.pl:43
28832 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
28833 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
28834 "you from doing this, but doesn't catch all cases."
28838 #: ../tools/virt-rescue.pl:47
28840 "However if you use the I<--ro> (read only) option, then you can attach a "
28841 "shell to a live virtual machine. The results might be strange or "
28842 "inconsistent at times but you won't get disk corruption."
28846 #: ../tools/virt-rescue.pl:53
28848 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
28849 "need for a CD. virt-rescue gives you a rescue shell and some simple "
28850 "recovery tools which you can use to examine or rescue a virtual machine or "
28855 #: ../tools/virt-rescue.pl:58
28857 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
28858 "on disk image(s):"
28862 #: ../tools/virt-rescue.pl:61
28865 " virt-rescue GuestName\n"
28870 #: ../tools/virt-rescue.pl:63
28873 " virt-rescue --ro /path/to/disk.img\n"
28878 #: ../tools/virt-rescue.pl:65
28881 " virt-rescue /dev/sdc\n"
28886 #: ../tools/virt-rescue.pl:67
28887 msgid "For live VMs you I<must> use the --ro option."
28891 #: ../tools/virt-rescue.pl:69
28893 "When you run virt-rescue on a virtual machine or disk image, you are placed "
28894 "in an interactive bash shell where you can use many ordinary Linux "
28895 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
28896 "appliance. You must mount the virtual machine's filesystems by hand. There "
28897 "is an empty directory called C</sysroot> where you can mount filesystems."
28901 #: ../tools/virt-rescue.pl:76
28903 "In the example below, we list logical volumes, then choose one to mount "
28904 "under C</sysroot>:"
28908 #: ../tools/virt-rescue.pl:79
28912 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
28913 " lv_root vg_f11x64 -wi-a- 8.83G\n"
28914 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
28915 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
28916 " ><rescue> ls /sysroot\n"
28921 #: ../tools/virt-rescue.pl:86
28923 "If you don't know what filesystems are available on the virtual machine then "
28924 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
28928 #: ../tools/virt-rescue.pl:92
28930 "Virt-rescue can be used on I<any> disk image file or device, not just a "
28931 "virtual machine. For example you can use it on a blank file if you want to "
28932 "partition that file (although we would recommend using L<guestfish(1)> "
28933 "instead as it is more suitable for this purpose). You can even use virt-"
28934 "rescue on things like SD cards."
28938 #: ../tools/virt-rescue.pl:98
28940 "This tool is just designed for quick interactive hacking on a virtual "
28941 "machine. For more structured access to a virtual machine disk image, you "
28942 "should use L<guestfs(3)>. To get a structured shell that you can use to "
28943 "make scripted changes to guests, use L<guestfish(1)>."
28947 #: ../tools/virt-rescue.pl:127
28948 msgid "B<--append kernelopts>"
28952 #: ../tools/virt-rescue.pl:129
28953 msgid "Pass additional options to the rescue kernel."
28957 #: ../tools/virt-rescue.pl:164
28958 msgid "B<--memsize MB> | B<-m MB>"
28962 #: ../tools/virt-rescue.pl:166
28964 "Change the amount of memory allocated to the rescue system. The default is "
28965 "set by libguestfs and is small but adequate for running system tools. The "
28966 "occasional program might need more memory. The parameter is specified in "
28971 #: ../tools/virt-rescue.pl:175
28972 msgid "B<--network MB>"
28976 #: ../tools/virt-rescue.pl:177
28977 msgid "Enable QEMU user networking in the guest."
28981 #: ../tools/virt-rescue.pl:183
28982 msgid "B<--ro> | B<-r>"
28986 #: ../tools/virt-rescue.pl:185
28987 msgid "Open the image read-only."
28991 #: ../tools/virt-rescue.pl:197
28993 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
28994 "SELINUX> before using this option."
28998 #: ../tools/virt-rescue.pl:257
29000 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
29001 "ENVIRONMENT VARIABLES> for the complete list."
29005 #: ../tools/virt-rescue.pl:269
29007 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
29008 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29012 #: ../tools/virt-make-fs.pl:37
29013 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
29017 #: ../tools/virt-make-fs.pl:41
29020 " virt-make-fs [--options] input.tar output.img\n"
29025 #: ../tools/virt-make-fs.pl:43
29028 " virt-make-fs [--options] input.tar.gz output.img\n"
29033 #: ../tools/virt-make-fs.pl:45
29036 " virt-make-fs [--options] directory output.img\n"
29041 #: ../tools/virt-make-fs.pl:49
29043 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
29044 "archive or some files in a directory. It is similar to tools like L<mkisofs"
29045 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
29046 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
29047 "you want to attach these filesystems to existing virtual machines (eg. to "
29048 "import large amounts of read-only data to a VM)."
29052 #: ../tools/virt-make-fs.pl:57
29053 msgid "Basic usage is:"
29057 #: ../tools/virt-make-fs.pl:59
29060 " virt-make-fs input output\n"
29065 #: ../tools/virt-make-fs.pl:61
29067 "where C<input> is either a directory containing files that you want to add, "
29068 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
29069 "C<output> is a disk image. The input type is detected automatically. The "
29070 "output disk image defaults to a raw ext2 image unless you specify extra "
29071 "flags (see L</OPTIONS> below)."
29075 #: ../tools/virt-make-fs.pl:67
29076 msgid "EXTRA SPACE"
29080 #: ../tools/virt-make-fs.pl:69
29082 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
29083 "the files that it contains, but might have extra space. Depending on how "
29084 "you are going to use the output, you might think this extra space is wasted "
29085 "and want to minimize it, or you might want to leave space so that more files "
29086 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
29087 "but you can use the C<--size> flag to leave space in the filesystem if you "
29092 #: ../tools/virt-make-fs.pl:77
29094 "An alternative way to leave extra space but not make the output image any "
29095 "bigger is to use an alternative disk image format (instead of the default "
29096 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
29097 "image format (check your hypervisor supports this before using it). This "
29098 "allows you to choose a large C<--size> but the extra space won't actually be "
29099 "allocated in the image until you try to store something in it."
29103 #: ../tools/virt-make-fs.pl:85
29105 "Don't forget that you can also use local commands including L<resize2fs(8)> "
29106 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
29107 "resize to build another image from scratch."
29111 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
29112 #: ../tools/virt-make-fs.pl:142
29117 #: ../tools/virt-make-fs.pl:91
29120 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
29125 #: ../tools/virt-make-fs.pl:93
29126 msgid "FILESYSTEM TYPE"
29130 #: ../tools/virt-make-fs.pl:95
29132 "The default filesystem type is C<ext2>. Just about any filesystem type that "
29133 "libguestfs supports can be used (but I<not> read-only formats like "
29134 "ISO9660). Here are some of the more common choices:"
29138 #: ../tools/virt-make-fs.pl:101
29143 #: ../tools/virt-make-fs.pl:103
29145 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
29146 "you are not going to use the filesystem in a way that requires the journal, "
29147 "then this is just wasted overhead."
29151 #: ../tools/virt-make-fs.pl:107
29152 msgid "I<ntfs> or I<vfat>"
29156 #: ../tools/virt-make-fs.pl:109
29157 msgid "Useful if exporting data to a Windows guest."
29161 #: ../tools/virt-make-fs.pl:111
29163 "I<Note for vfat>: The tar archive or local directory must only contain files "
29164 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
29165 "program running within libguestfs is unable to change the ownership of non-"
29166 "root files, since vfat itself does not support this."
29170 #: ../tools/virt-make-fs.pl:116
29175 #: ../tools/virt-make-fs.pl:118
29177 "Lower overhead than C<ext2>, but certain limitations on filename length and "
29178 "total filesystem size."
29182 #: ../tools/virt-make-fs.pl:125
29185 " virt-make-fs --type=minix input minixfs.img\n"
29190 #: ../tools/virt-make-fs.pl:127
29191 msgid "TO PARTITION OR NOT TO PARTITION"
29195 #: ../tools/virt-make-fs.pl:129
29196 msgid "Optionally virt-make-fs can add a partition table to the output disk."
29200 #: ../tools/virt-make-fs.pl:131
29202 "Adding a partition can make the disk image more compatible with certain "
29203 "virtualized operating systems which don't expect to see a filesystem "
29204 "directly located on a block device (Linux doesn't care and will happily "
29205 "handle both types)."
29209 #: ../tools/virt-make-fs.pl:136
29211 "On the other hand, if you have a partition table then the output image is no "
29212 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
29213 "directly on a partitioned disk image. (However libguestfs tools such as "
29214 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
29218 #: ../tools/virt-make-fs.pl:144
29219 msgid "Add an MBR partition:"
29223 #: ../tools/virt-make-fs.pl:146
29226 " virt-make-fs --partition -- input disk.img\n"
29231 #: ../tools/virt-make-fs.pl:148
29233 "If the output disk image could be terabyte-sized or larger, it's better to "
29234 "use an EFI/GPT-compatible partition table:"
29238 #: ../tools/virt-make-fs.pl:151
29241 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
29246 #: ../tools/virt-make-fs.pl:179
29247 msgid "Enable debugging information."
29251 #: ../tools/virt-make-fs.pl:185
29252 msgid "B<--size=E<lt>NE<gt>>"
29256 #: ../tools/virt-make-fs.pl:187
29257 msgid "B<--size=+E<lt>NE<gt>>"
29261 #: ../tools/virt-make-fs.pl:189
29262 msgid "B<-s E<lt>NE<gt>>"
29266 #: ../tools/virt-make-fs.pl:191
29267 msgid "B<-s +E<lt>NE<gt>>"
29271 #: ../tools/virt-make-fs.pl:193
29273 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
29277 #: ../tools/virt-make-fs.pl:196
29279 "If this option is I<not> given, then the output image will be just large "
29280 "enough to contain all the files, with not much wasted space."
29284 #: ../tools/virt-make-fs.pl:199
29286 "To choose a fixed size output disk, specify an absolute number followed by b/"
29287 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29288 "Petabytes or Exabytes. This must be large enough to contain all the input "
29289 "files, else you will get an error."
29293 #: ../tools/virt-make-fs.pl:204
29295 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
29296 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29297 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
29298 "the input files, and (approximately) an extra 200 MB free space."
29302 #: ../tools/virt-make-fs.pl:210
29304 "Note that virt-make-fs estimates free space, and therefore will not produce "
29305 "filesystems containing precisely the free space requested. (It is much more "
29306 "expensive and time-consuming to produce a filesystem which has precisely the "
29307 "desired free space)."
29311 #: ../tools/virt-make-fs.pl:219
29312 msgid "B<--format=E<lt>fmtE<gt>>"
29316 #: ../tools/virt-make-fs.pl:221
29317 msgid "B<-F E<lt>fmtE<gt>>"
29321 #: ../tools/virt-make-fs.pl:223
29322 msgid "Choose the output disk image format."
29326 #: ../tools/virt-make-fs.pl:225
29327 msgid "The default is C<raw> (raw disk image)."
29331 #: ../tools/virt-make-fs.pl:227
29333 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29334 "that would really make sense here is C<qcow2>."
29338 #: ../tools/virt-make-fs.pl:234
29339 msgid "B<--type=E<lt>fsE<gt>>"
29343 #: ../tools/virt-make-fs.pl:236
29344 msgid "B<-t E<lt>fsE<gt>>"
29348 #: ../tools/virt-make-fs.pl:238
29349 msgid "Choose the output filesystem type."
29353 #: ../tools/virt-make-fs.pl:240
29354 msgid "The default is C<ext2>."
29358 #: ../tools/virt-make-fs.pl:242
29360 "Any filesystem which is supported read-write by libguestfs can be used here."
29364 #: ../tools/virt-make-fs.pl:249
29365 msgid "B<--partition>"
29369 #: ../tools/virt-make-fs.pl:251
29370 msgid "B<--partition=E<lt>parttypeE<gt>>"
29374 #: ../tools/virt-make-fs.pl:253
29376 "If specified, this flag adds an MBR partition table to the output disk image."
29380 #: ../tools/virt-make-fs.pl:256
29382 "You can change the partition table type, eg. C<--partition=gpt> for large "
29387 #: ../tools/virt-make-fs.pl:259
29389 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29390 "might consider the next parameter to be the partition type. For example:"
29394 #: ../tools/virt-make-fs.pl:263
29397 " virt-make-fs --partition input.tar ...\n"
29402 #: ../tools/virt-make-fs.pl:265
29404 "would cause virt-make-fs to think you wanted to use a partition type of "
29405 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29406 "dash) between options and the input file argument:"
29410 #: ../tools/virt-make-fs.pl:269
29413 " virt-make-fs --partition -- input.tar ...\n"
29418 #: ../tools/virt-make-fs.pl:536
29420 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
29421 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
29422 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29426 #: ../tools/virt-make-fs.pl:553
29429 " export LIBGUESTFS_DEBUG=1\n"
29430 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29435 #: ../tools/virt-make-fs.pl:556
29437 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
29442 #: ../tools/virt-list-partitions.pl:32
29444 "virt-list-partitions - List partitions in a virtual machine or disk image"
29448 #: ../tools/virt-list-partitions.pl:36
29451 " virt-list-partitions [--options] domname\n"
29456 #: ../tools/virt-list-partitions.pl:38
29459 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29464 #: ../tools/virt-list-partitions.pl:42
29466 "C<virt-list-partitions> is a command line tool to list the partitions that "
29467 "are contained in a virtual machine or disk image. It is mainly useful as a "
29468 "first step to using L<virt-resize(1)>."
29472 #: ../tools/virt-list-partitions.pl:47
29474 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
29475 "functionality. For more complex cases you should look at the L<guestfish(1)"
29480 #: ../tools/virt-list-partitions.pl:104
29481 msgid "B<-h> | B<--human-readable>"
29485 #: ../tools/virt-list-partitions.pl:106
29486 msgid "Show sizes in human-readable form (eg. \"1G\")."
29490 #: ../tools/virt-list-partitions.pl:114
29492 "With this option, C<virt-list-partitions> displays the type and size of each "
29493 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
29497 #: ../tools/virt-list-partitions.pl:121
29498 msgid "B<-t> | B<--total>"
29502 #: ../tools/virt-list-partitions.pl:123
29504 "Display the total size of each block device (as a separate row or rows)."
29508 #: ../tools/virt-list-partitions.pl:256
29510 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
29511 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
29512 "libguestfs.org/>."