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-13 16:19+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:955
782 #: ../src/guestfs.pod:959 ../src/guestfs.pod:963 ../src/guestfs.pod:968
783 #: ../src/guestfs.pod:976 ../src/guestfs.pod:995 ../src/guestfs.pod:1003
784 #: ../src/guestfs.pod:1025 ../src/guestfs.pod:1029 ../src/guestfs.pod:1033
785 #: ../src/guestfs.pod:1037 ../src/guestfs.pod:1041 ../src/guestfs.pod:1045
786 #: ../src/guestfs.pod:1519 ../src/guestfs.pod:1524 ../src/guestfs.pod:1528
787 #: ../src/guestfs.pod:1638 ../src/guestfs.pod:1643 ../src/guestfs.pod:1647
788 #: ../src/guestfs.pod:1991 ../src/guestfs.pod:1997 ../src/guestfs.pod:2002
789 #: ../src/guestfs.pod:2008 ../src/guestfs.pod:2115 ../src/guestfs.pod:2119
790 #: ../src/guestfs.pod:2123 ../src/guestfs.pod:2127
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:550 ../inspector/virt-inspector.pl:554
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:1140 ../src/guestfs.pod:1271
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:1144 ../src/guestfs.pod:1275
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:1281
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."
1217 #: ../src/guestfs.pod:581
1218 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1222 #: ../src/guestfs.pod:583
1224 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1225 "ntfs-3g.org/> driver."
1229 #: ../src/guestfs.pod:586
1231 "DOS and Windows still use drive letters, and the filesystems are always "
1232 "treated as case insensitive by Windows itself, and therefore you might find "
1233 "a Windows configuration file referring to a path like C<c:\\windows"
1234 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1235 "might be referred to as C</WINDOWS/System32>."
1239 #: ../src/guestfs.pod:592
1241 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1242 "libguestfs to read the appropriate Windows Registry and configuration files, "
1243 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1248 #: ../src/guestfs.pod:597
1250 "Replacing backslash characters with forward slash characters is also outside "
1251 "the scope of libguestfs, but something that you can easily do."
1255 #: ../src/guestfs.pod:600
1257 "Where we can help is in resolving the case insensitivity of paths. For "
1258 "this, call L</guestfs_case_sensitive_path>."
1262 #: ../src/guestfs.pod:603
1264 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1265 "files, through the library C<hivex> which is part of the libguestfs project "
1266 "although ships as a separate tarball. You have to locate and download the "
1267 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1268 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1269 "reg(1)> for more help on this issue."
1273 #: ../src/guestfs.pod:611
1274 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1278 #: ../src/guestfs.pod:613
1280 "Although we don't want to discourage you from using the C API, we will "
1281 "mention here that the same API is also available in other languages."
1285 #: ../src/guestfs.pod:616
1287 "The API is broadly identical in all supported languages. This means that "
1288 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1289 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1290 "words, a straightforward, predictable isomorphism between each language."
1294 #: ../src/guestfs.pod:622
1296 "Error messages are automatically transformed into exceptions if the language "
1301 #: ../src/guestfs.pod:625
1303 "We don't try to \"object orientify\" parts of the API in OO languages, "
1304 "although contributors are welcome to write higher level APIs above what we "
1305 "provide in their favourite languages if they wish."
1309 #: ../src/guestfs.pod:631
1314 #: ../src/guestfs.pod:633
1316 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1317 "identical to the C API. C++ classes and exceptions are not used."
1321 #: ../src/guestfs.pod:637
1326 #: ../src/guestfs.pod:639
1328 "The C# bindings are highly experimental. Please read the warnings at the "
1329 "top of C<csharp/Libguestfs.cs>."
1333 #: ../src/guestfs.pod:642
1338 #: ../src/guestfs.pod:644
1340 "This is the only language binding that is working but incomplete. Only "
1341 "calls which return simple integers have been bound in Haskell, and we are "
1342 "looking for help to complete this binding."
1346 #: ../src/guestfs.pod:648
1351 #: ../src/guestfs.pod:650
1353 "Full documentation is contained in the Javadoc which is distributed with "
1358 #: ../src/guestfs.pod:653
1363 #: ../src/guestfs.pod:655
1364 msgid "For documentation see the file C<guestfs.mli>."
1368 #: ../src/guestfs.pod:657
1373 #: ../src/guestfs.pod:659
1374 msgid "For documentation see L<Sys::Guestfs(3)>."
1378 #: ../src/guestfs.pod:661
1383 #: ../src/guestfs.pod:663
1385 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1386 "the php-libguestfs package for your distribution."
1390 #: ../src/guestfs.pod:666
1391 msgid "The PHP binding only works correctly on 64 bit machines."
1395 #: ../src/guestfs.pod:668
1400 #: ../src/guestfs.pod:670
1401 msgid "For documentation do:"
1405 #: ../src/guestfs.pod:672
1409 " >>> import guestfs\n"
1410 " >>> help (guestfs)\n"
1415 #: ../src/guestfs.pod:676
1420 #: ../src/guestfs.pod:678
1422 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1423 "can find examples written in Ruby in the libguestfs source."
1427 #: ../src/guestfs.pod:681
1428 msgid "B<shell scripts>"
1432 #: ../src/guestfs.pod:683
1433 msgid "For documentation see L<guestfish(1)>."
1437 #: ../src/guestfs.pod:687
1438 msgid "LIBGUESTFS GOTCHAS"
1442 #: ../src/guestfs.pod:689
1444 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1445 "system [...] that works in the way it is documented but is counterintuitive "
1446 "and almost invites mistakes.\""
1450 #: ../src/guestfs.pod:693
1452 "Since we developed libguestfs and the associated tools, there are several "
1453 "things we would have designed differently, but are now stuck with for "
1454 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1455 "release, you can expect these to change. Beware of them."
1459 #: ../src/guestfs.pod:701
1460 msgid "Autosync / forgetting to sync."
1464 #: ../src/guestfs.pod:703
1466 "When modifying a filesystem from C or another language, you B<must> unmount "
1467 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1468 "libguestfs handle. You can also call:"
1472 #: ../src/guestfs.pod:707
1475 " guestfs_set_autosync (g, 1);\n"
1480 #: ../src/guestfs.pod:709
1482 "to have the unmount/sync done automatically for you when the handle 'g' is "
1483 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1487 #: ../src/guestfs.pod:713
1489 "If you forget to do this, then it is entirely possible that your changes "
1490 "won't be written out, or will be partially written, or (very rarely) that "
1491 "you'll get disk corruption."
1495 #: ../src/guestfs.pod:717
1497 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1498 "guestfish scripts that forget to sync will work just fine, which can make "
1499 "this very puzzling if you are trying to debug a problem."
1503 #: ../src/guestfs.pod:721
1505 "Update: Autosync is enabled by default for all API users starting from "
1506 "libguestfs 1.5.24."
1510 #: ../src/guestfs.pod:724
1511 msgid "Mount option C<-o sync> should not be the default."
1515 #: ../src/guestfs.pod:726
1517 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1518 "However C<-o sync> does not add any reliability benefit, but does have a "
1519 "very large performance impact."
1523 #: ../src/guestfs.pod:730
1525 "The work around is to use L</guestfs_mount_options> and set the mount "
1526 "options that you actually want to use."
1530 #: ../src/guestfs.pod:733
1531 msgid "Read-only should be the default."
1535 #: ../src/guestfs.pod:735
1537 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1538 "specify I<--rw> if you want to make changes to the image."
1542 #: ../src/guestfs.pod:738
1543 msgid "This would reduce the potential to corrupt live VM images."
1547 #: ../src/guestfs.pod:740
1549 "Note that many filesystems change the disk when you just mount and unmount, "
1550 "even if you didn't perform any writes. You need to use L</"
1551 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1555 #: ../src/guestfs.pod:744
1556 msgid "guestfish command line is hard to use."
1560 #: ../src/guestfs.pod:746
1562 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1563 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1564 "exist, so it fails. In earlier versions of guestfish the error message was "
1565 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1566 "we should have used C<guestfish -c command> to run commands."
1570 #: ../src/guestfs.pod:753
1571 msgid "guestfish megabyte modifiers don't work right on all commands"
1575 #: ../src/guestfs.pod:755
1577 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1578 "other modifiers). What guestfish actually does is to multiply the number "
1579 "part by the modifier part and pass the result to the C API. However this "
1580 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1581 "expecting some other unit (eg. megabytes)."
1585 #: ../src/guestfs.pod:762
1586 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1590 #: ../src/guestfs.pod:764
1593 " lvcreate LV VG 100M\n"
1598 #: ../src/guestfs.pod:766
1600 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1601 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1602 "megabytes * megabytes) logical volume. The error message you get from this "
1603 "is also a little obscure."
1607 #: ../src/guestfs.pod:771
1609 "This could be fixed in the generator by specially marking parameters and "
1610 "return values which take bytes or other units."
1614 #: ../src/guestfs.pod:774
1615 msgid "Ambiguity between devices and paths"
1619 #: ../src/guestfs.pod:776
1621 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1622 "sdb2>) and a similar pathname. A file might just happen to be called "
1623 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1627 #: ../src/guestfs.pod:781
1629 "In the current API we usually resolve this ambiguity by having two separate "
1630 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1631 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1632 "detecting if the path supplied begins with C</dev/>."
1636 #: ../src/guestfs.pod:787
1638 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1639 "make paths/devices into structured names. One way to do this would be to "
1640 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1641 "aspect of grub. Another way would be to use a structured type, equivalent "
1642 "to this OCaml type:"
1646 #: ../src/guestfs.pod:793
1649 " type path = Path of string | Device of int | Partition of int * int\n"
1654 #: ../src/guestfs.pod:795
1655 msgid "which would allow you to pass arguments like:"
1659 #: ../src/guestfs.pod:797
1662 " Path \"/foo/bar\"\n"
1663 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1664 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1665 " Path \"/dev/sdb2\" (* not a device *)\n"
1670 #: ../src/guestfs.pod:802
1672 "As you can see there are still problems to resolve even with this "
1673 "representation. Also consider how it might work in guestfish."
1677 #: ../src/guestfs.pod:807
1678 msgid "PROTOCOL LIMITS"
1682 #: ../src/guestfs.pod:809
1684 "Internally libguestfs uses a message-based protocol to pass API calls and "
1685 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1686 "plenty more detail about this). The maximum message size used by the "
1687 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1688 "aware of this limit. The API calls which may be affected are individually "
1689 "documented, with a link back to this section of the documentation."
1693 #: ../src/guestfs.pod:817
1695 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1696 "a simple string. Because this string is at some point internally encoded as "
1697 "a message, the maximum size that it can return is slightly under 4 MB. If "
1698 "the requested file is larger than this then you will get an error."
1702 #: ../src/guestfs.pod:823
1704 "In order to transfer large files into and out of the guest filesystem, you "
1705 "need to use particular calls that support this. The sections L</UPLOADING> "
1706 "and L</DOWNLOADING> document how to do this."
1710 #: ../src/guestfs.pod:827
1712 "You might also consider mounting the disk image using our FUSE filesystem "
1713 "support (L<guestmount(1)>)."
1717 #: ../src/guestfs.pod:830
1718 msgid "KEYS AND PASSPHRASES"
1722 #: ../src/guestfs.pod:832
1724 "Certain libguestfs calls take a parameter that contains sensitive key "
1725 "material, passed in as a C string."
1729 #: ../src/guestfs.pod:835
1731 "In the future we would hope to change the libguestfs implementation so that "
1732 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1733 "swap. However this is I<not> done at the moment, because of the complexity "
1734 "of such an implementation."
1738 #: ../src/guestfs.pod:840
1740 "Therefore you should be aware that any key parameter you pass to libguestfs "
1741 "might end up being written out to the swap partition. If this is a concern, "
1742 "scrub the swap partition or don't use libguestfs on encrypted devices."
1746 #: ../src/guestfs.pod:845
1747 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1751 #: ../src/guestfs.pod:847
1753 "All high-level libguestfs actions are synchronous. If you want to use "
1754 "libguestfs asynchronously then you must create a thread."
1758 #: ../src/guestfs.pod:850
1760 "Only use the handle from a single thread. Either use the handle exclusively "
1761 "from one thread, or provide your own mutex so that two threads cannot issue "
1762 "calls on the same handle at the same time."
1766 #: ../src/guestfs.pod:854
1768 "See the graphical program guestfs-browser for one possible architecture for "
1769 "multithreaded programs using libvirt and libguestfs."
1773 #: ../src/guestfs.pod:857
1778 #: ../src/guestfs.pod:859
1780 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1785 #: ../src/guestfs.pod:862
1787 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1788 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1792 #: ../src/guestfs.pod:865
1794 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1795 "to change the directories that libguestfs will search in. The value is a "
1796 "colon-separated list of paths. The current directory is I<not> searched "
1797 "unless the path contains an empty element or C<.>. For example "
1798 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1799 "then C</usr/lib/guestfs>."
1803 #: ../src/guestfs.pod:872
1804 msgid "QEMU WRAPPERS"
1808 #: ../src/guestfs.pod:874
1810 "If you want to compile your own qemu, run qemu from a non-standard location, "
1811 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1816 #: ../src/guestfs.pod:878
1818 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1819 "last command in the shell script (so that qemu replaces the shell and "
1820 "becomes the direct child of the libguestfs-using program). If you don't do "
1821 "this, then the qemu process won't be cleaned up correctly."
1825 #: ../src/guestfs.pod:883
1827 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1832 #: ../src/guestfs.pod:886
1836 " qemudir=/home/rjones/d/qemu\n"
1837 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1842 #: ../src/guestfs.pod:890
1844 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1845 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1850 #: ../src/guestfs.pod:894
1853 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1858 #: ../src/guestfs.pod:896
1860 "Note that libguestfs also calls qemu with the -help and -version options in "
1861 "order to determine features."
1865 #: ../src/guestfs.pod:899
1866 msgid "ABI GUARANTEE"
1870 #: ../src/guestfs.pod:901
1872 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1873 "actions as outlined in this section. Although we will deprecate some "
1874 "actions, for example if they get replaced by newer calls, we will keep the "
1875 "old actions forever. This allows you the developer to program in confidence "
1876 "against the libguestfs API."
1880 #: ../src/guestfs.pod:907
1881 msgid "BLOCK DEVICE NAMING"
1885 #: ../src/guestfs.pod:909
1887 "In the kernel there is now quite a profusion of schemata for naming block "
1888 "devices (in this context, by I<block device> I mean a physical or virtual "
1889 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1890 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1891 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1892 "for the old IDE driver (particularly for SATA devices) those devices also "
1893 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1894 "paravirtualized drivers. This has created several different naming systems, "
1895 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
1899 #: ../src/guestfs.pod:921
1901 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1902 "Linux kernel to access block devices. We can run a variety of appliances "
1903 "based on a variety of Linux kernels."
1907 #: ../src/guestfs.pod:925
1909 "This causes a problem for libguestfs because many API calls use device or "
1910 "partition names. Working scripts and the recipe (example) scripts that we "
1911 "make available over the internet could fail if the naming scheme changes."
1915 #: ../src/guestfs.pod:930
1917 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1918 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1919 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1920 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1924 #: ../src/guestfs.pod:936
1926 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1927 "L</guestfs_list_partitions> and similar calls return the true names of the "
1928 "devices and partitions as known to the appliance."
1932 #: ../src/guestfs.pod:941
1933 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1937 #: ../src/guestfs.pod:943
1939 "Usually this translation is transparent. However in some (very rare) cases "
1940 "you may need to know the exact algorithm. Such cases include where you use "
1941 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
1942 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
1946 #: ../src/guestfs.pod:949
1948 "The algorithm is applied only to I<parameters> which are known to be either "
1949 "device or partition names. Return values from functions such as L</"
1950 "guestfs_list_devices> are never changed."
1954 #: ../src/guestfs.pod:957
1955 msgid "Is the string a parameter which is a device or partition name?"
1959 #: ../src/guestfs.pod:961
1960 msgid "Does the string begin with C</dev/sd>?"
1964 #: ../src/guestfs.pod:965
1966 "Does the named device exist? If so, we use that device. However if I<not> "
1967 "then we continue with this algorithm."
1971 #: ../src/guestfs.pod:970
1972 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
1976 #: ../src/guestfs.pod:972
1977 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
1981 #: ../src/guestfs.pod:974
1982 msgid "If that named device exists, use it. If not, continue."
1986 #: ../src/guestfs.pod:978
1987 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
1991 #: ../src/guestfs.pod:980
1992 msgid "If that named device exists, use it. If not, return an error."
1996 #: ../src/guestfs.pod:984
1997 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2001 #: ../src/guestfs.pod:986
2003 "Although the standard naming scheme and automatic translation is useful for "
2004 "simple programs and guestfish scripts, for larger programs it is best not to "
2005 "rely on this mechanism."
2009 #: ../src/guestfs.pod:990
2011 "Where possible for maximum future portability programs using libguestfs "
2012 "should use these future-proof techniques:"
2016 #: ../src/guestfs.pod:997
2018 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2019 "device names, and then use those names directly."
2023 #: ../src/guestfs.pod:1000
2025 "Since those device names exist by definition, they will never be translated."
2029 #: ../src/guestfs.pod:1005
2031 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2032 "filesystem labels."
2036 #: ../src/guestfs.pod:1010
2041 #: ../src/guestfs.pod:1012
2043 "This section discusses security implications of using libguestfs, "
2044 "particularly with untrusted or malicious guests or disk images."
2048 #: ../src/guestfs.pod:1015
2049 msgid "GENERAL SECURITY CONSIDERATIONS"
2053 #: ../src/guestfs.pod:1017
2055 "Be careful with any files or data that you download from a guest (by "
2056 "\"download\" we mean not just the L</guestfs_download> command but any "
2057 "command that reads files, filenames, directories or anything else from a "
2058 "disk image). An attacker could manipulate the data to fool your program "
2059 "into doing the wrong thing. Consider cases such as:"
2063 #: ../src/guestfs.pod:1027
2064 msgid "the data (file etc) not being present"
2068 #: ../src/guestfs.pod:1031
2069 msgid "being present but empty"
2073 #: ../src/guestfs.pod:1035
2074 msgid "being much larger than normal"
2078 #: ../src/guestfs.pod:1039
2079 msgid "containing arbitrary 8 bit data"
2083 #: ../src/guestfs.pod:1043
2084 msgid "being in an unexpected character encoding"
2088 #: ../src/guestfs.pod:1047
2089 msgid "containing homoglyphs."
2093 #: ../src/guestfs.pod:1051
2094 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2098 #: ../src/guestfs.pod:1053
2100 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2101 "(VFS) module can sometimes be escalated into exploits by deliberately "
2102 "creating a malicious, malformed filesystem. These exploits are very severe "
2103 "for two reasons. Firstly there are very many filesystem drivers in the "
2104 "kernel, and many of them are infrequently used and not much developer "
2105 "attention has been paid to the code. Linux userspace helps potential "
2106 "crackers by detecting the filesystem type and automatically choosing the "
2107 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2108 "the administrator. Secondly, a kernel-level exploit is like a local root "
2109 "exploit (worse in some ways), giving immediate and total access to the "
2110 "system right down to the hardware level."
2114 #: ../src/guestfs.pod:1066
2116 "That explains why you should never mount a filesystem from an untrusted "
2117 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2118 "inside a qemu virtual machine, usually running as a non-root user. The "
2119 "attacker would need to write a filesystem which first exploited the kernel, "
2120 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2121 "the libguestfs protocol, and finally to be as serious as the host kernel "
2122 "exploit it would need to escalate its privileges to root. This multi-step "
2123 "escalation, performed by a static piece of data, is thought to be extremely "
2124 "hard to do, although we never say 'never' about security issues."
2128 #: ../src/guestfs.pod:1077
2130 "In any case callers can reduce the attack surface by forcing the filesystem "
2131 "type when mounting (use L</guestfs_mount_vfs>)."
2135 #: ../src/guestfs.pod:1080
2136 msgid "PROTOCOL SECURITY"
2140 #: ../src/guestfs.pod:1082
2142 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2143 "defined upper message size. However a program that uses libguestfs must "
2144 "also take care - for example you can write a program that downloads a binary "
2145 "from a disk image and executes it locally, and no amount of protocol "
2146 "security will save you from the consequences."
2150 #: ../src/guestfs.pod:1088
2151 msgid "INSPECTION SECURITY"
2155 #: ../src/guestfs.pod:1090
2157 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2158 "directly from the guest, and these could contain any 8 bit data. Callers "
2159 "should be careful to escape these before printing them to a structured file "
2160 "(for example, use HTML escaping if creating a web page)."
2164 #: ../src/guestfs.pod:1096
2166 "The inspection API parses guest configuration using two external libraries: "
2167 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2168 "designed to be robust in the face of malicious data, although denial of "
2169 "service attacks are still possible, for example with oversized configuration "
2174 #: ../src/guestfs.pod:1102
2175 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2179 #: ../src/guestfs.pod:1104
2181 "Be very cautious about running commands from the guest. By running a "
2182 "command in the guest, you are giving CPU time to a binary that you do not "
2183 "control, under the same user account as the library, albeit wrapped in qemu "
2184 "virtualization. More information and alternatives can be found in the "
2185 "section L</RUNNING COMMANDS>."
2189 #: ../src/guestfs.pod:1110
2190 msgid "CVE-2010-3851"
2194 #: ../src/guestfs.pod:1112
2195 msgid "https://bugzilla.redhat.com/642934"
2199 #: ../src/guestfs.pod:1114
2201 "This security bug concerns the automatic disk format detection that qemu "
2202 "does on disk images."
2206 #: ../src/guestfs.pod:1117
2208 "A raw disk image is just the raw bytes, there is no header. Other disk "
2209 "images like qcow2 contain a special header. Qemu deals with this by looking "
2210 "for one of the known headers, and if none is found then assuming the disk "
2211 "image must be raw."
2215 #: ../src/guestfs.pod:1122
2217 "This allows a guest which has been given a raw disk image to write some "
2218 "other header. At next boot (or when the disk image is accessed by "
2219 "libguestfs) qemu would do autodetection and think the disk image format was, "
2220 "say, qcow2 based on the header written by the guest."
2224 #: ../src/guestfs.pod:1127
2226 "This in itself would not be a problem, but qcow2 offers many features, one "
2227 "of which is to allow a disk image to refer to another image (called the "
2228 "\"backing disk\"). It does this by placing the path to the backing disk "
2229 "into the qcow2 header. This path is not validated and could point to any "
2230 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2231 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2232 "control of the attacker."
2236 #: ../src/guestfs.pod:1135
2238 "In libguestfs this is rather hard to exploit except under two circumstances:"
2242 #: ../src/guestfs.pod:1142
2243 msgid "You have enabled the network or have opened the disk in write mode."
2247 #: ../src/guestfs.pod:1146
2249 "You are also running untrusted code from the guest (see L</RUNNING "
2254 #: ../src/guestfs.pod:1151
2256 "The way to avoid this is to specify the expected disk format when adding "
2257 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2258 "should always do this if the disk is raw format, and it's a good idea for "
2263 #: ../src/guestfs.pod:1156
2265 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2266 "format is fetched from libvirt and passed through."
2270 #: ../src/guestfs.pod:1159
2272 "For libguestfs tools, use the I<--format> command line parameter as "
2277 #: ../src/guestfs.pod:1162
2278 msgid "CONNECTION MANAGEMENT"
2282 #: ../src/guestfs.pod:1164
2287 #: ../src/guestfs.pod:1166
2289 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2290 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2291 "handle and release all resources used."
2295 #: ../src/guestfs.pod:1170
2297 "For information on using multiple handles and threads, see the section L</"
2298 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2302 #: ../src/guestfs.pod:1173
2303 msgid "guestfs_create"
2307 #: ../src/guestfs.pod:1175
2310 " guestfs_h *guestfs_create (void);\n"
2315 #: ../src/guestfs.pod:1177
2316 msgid "Create a connection handle."
2320 #: ../src/guestfs.pod:1179
2322 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2323 "on the handle at least once."
2327 #: ../src/guestfs.pod:1182
2329 "This function returns a non-NULL pointer to a handle on success or NULL on "
2334 #: ../src/guestfs.pod:1185
2335 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2339 #: ../src/guestfs.pod:1187
2341 "You may also want to configure error handling for the handle. See L</ERROR "
2342 "HANDLING> section below."
2346 #: ../src/guestfs.pod:1190
2347 msgid "guestfs_close"
2351 #: ../src/guestfs.pod:1192
2354 " void guestfs_close (guestfs_h *g);\n"
2359 #: ../src/guestfs.pod:1194
2360 msgid "This closes the connection handle and frees up all resources used."
2364 #: ../src/guestfs.pod:1196
2365 msgid "ERROR HANDLING"
2369 #: ../src/guestfs.pod:1198
2371 "API functions can return errors. For example, almost all functions that "
2372 "return C<int> will return C<-1> to indicate an error."
2376 #: ../src/guestfs.pod:1201
2378 "Additional information is available for errors: an error message string and "
2379 "optionally an error number (errno) if the thing that failed was a system "
2384 #: ../src/guestfs.pod:1205
2386 "You can get at the additional information about the last error on the handle "
2387 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2388 "up an error handler with L</guestfs_set_error_handler>."
2392 #: ../src/guestfs.pod:1210
2394 "When the handle is created, a default error handler is installed which "
2395 "prints the error message string to C<stderr>. For small short-running "
2396 "command line programs it is sufficient to do:"
2400 #: ../src/guestfs.pod:1214
2403 " if (guestfs_launch (g) == -1)\n"
2404 " exit (EXIT_FAILURE);\n"
2409 #: ../src/guestfs.pod:1217
2411 "since the default error handler will ensure that an error message has been "
2412 "printed to C<stderr> before the program exits."
2416 #: ../src/guestfs.pod:1220
2418 "For other programs the caller will almost certainly want to install an "
2419 "alternate error handler or do error handling in-line like this:"
2423 #: ../src/guestfs.pod:1223
2426 " g = guestfs_create ();\n"
2431 #: ../src/guestfs.pod:1225
2434 " /* This disables the default behaviour of printing errors\n"
2436 " guestfs_set_error_handler (g, NULL, NULL);\n"
2441 #: ../src/guestfs.pod:1229
2444 " if (guestfs_launch (g) == -1) {\n"
2445 " /* Examine the error message and print it etc. */\n"
2446 " char *msg = guestfs_last_error (g);\n"
2447 " int errnum = guestfs_last_errno (g);\n"
2448 " fprintf (stderr, \"%s\\n\", msg);\n"
2455 #: ../src/guestfs.pod:1237
2457 "Out of memory errors are handled differently. The default action is to call "
2458 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2459 "guestfs_set_out_of_memory_handler>."
2463 #: ../src/guestfs.pod:1241
2465 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2466 "because there is no handle if this happens there is no way to get additional "
2467 "error information. However L</guestfs_create> is supposed to be a "
2468 "lightweight operation which can only fail because of insufficient memory (it "
2469 "returns NULL in this case)."
2473 #: ../src/guestfs.pod:1247
2474 msgid "guestfs_last_error"
2478 #: ../src/guestfs.pod:1249
2481 " const char *guestfs_last_error (guestfs_h *g);\n"
2486 #: ../src/guestfs.pod:1251
2488 "This returns the last error message that happened on C<g>. If there has not "
2489 "been an error since the handle was created, then this returns C<NULL>."
2493 #: ../src/guestfs.pod:1255
2495 "The lifetime of the returned string is until the next error occurs, or L</"
2496 "guestfs_close> is called."
2500 #: ../src/guestfs.pod:1258
2501 msgid "guestfs_last_errno"
2505 #: ../src/guestfs.pod:1260
2508 " int guestfs_last_errno (guestfs_h *g);\n"
2513 #: ../src/guestfs.pod:1262
2514 msgid "This returns the last error number (errno) that happened on C<g>."
2518 #: ../src/guestfs.pod:1264
2519 msgid "If successful, an errno integer not equal to zero is returned."
2523 #: ../src/guestfs.pod:1266
2525 "If no error, this returns 0. This call can return 0 in three situations:"
2529 #: ../src/guestfs.pod:1273
2530 msgid "There has not been any error on the handle."
2534 #: ../src/guestfs.pod:1277
2536 "There has been an error but the errno was meaningless. This corresponds to "
2537 "the case where the error did not come from a failed system call, but for "
2538 "some other reason."
2542 #: ../src/guestfs.pod:1283
2544 "There was an error from a failed system call, but for some reason the errno "
2545 "was not captured and returned. This usually indicates a bug in libguestfs."
2549 #: ../src/guestfs.pod:1289
2551 "Libguestfs tries to convert the errno from inside the applicance into a "
2552 "corresponding errno for the caller (not entirely trivial: the appliance "
2553 "might be running a completely different operating system from the library "
2554 "and error numbers are not standardized across Un*xen). If this could not be "
2555 "done, then the error is translated to C<EINVAL>. In practice this should "
2556 "only happen in very rare circumstances."
2560 #: ../src/guestfs.pod:1297
2561 msgid "guestfs_set_error_handler"
2565 #: ../src/guestfs.pod:1299
2568 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2570 " const char *msg);\n"
2571 " void guestfs_set_error_handler (guestfs_h *g,\n"
2572 " guestfs_error_handler_cb cb,\n"
2578 #: ../src/guestfs.pod:1306
2580 "The callback C<cb> will be called if there is an error. The parameters "
2581 "passed to the callback are an opaque data pointer and the error message "
2586 #: ../src/guestfs.pod:1310
2588 "C<errno> is not passed to the callback. To get that the callback must call "
2589 "L</guestfs_last_errno>."
2593 #: ../src/guestfs.pod:1313
2595 "Note that the message string C<msg> is freed as soon as the callback "
2596 "function returns, so if you want to stash it somewhere you must make your "
2601 #: ../src/guestfs.pod:1317
2602 msgid "The default handler prints messages on C<stderr>."
2606 #: ../src/guestfs.pod:1319
2607 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2611 #: ../src/guestfs.pod:1321
2612 msgid "guestfs_get_error_handler"
2616 #: ../src/guestfs.pod:1323
2619 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2620 " void **opaque_rtn);\n"
2625 #: ../src/guestfs.pod:1326
2626 msgid "Returns the current error handler callback."
2630 #: ../src/guestfs.pod:1328
2631 msgid "guestfs_set_out_of_memory_handler"
2635 #: ../src/guestfs.pod:1330
2638 " typedef void (*guestfs_abort_cb) (void);\n"
2639 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2640 " guestfs_abort_cb);\n"
2645 #: ../src/guestfs.pod:1334
2647 "The callback C<cb> will be called if there is an out of memory situation. "
2648 "I<Note this callback must not return>."
2652 #: ../src/guestfs.pod:1337
2653 msgid "The default is to call L<abort(3)>."
2657 #: ../src/guestfs.pod:1339
2659 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2663 #: ../src/guestfs.pod:1342
2664 msgid "guestfs_get_out_of_memory_handler"
2668 #: ../src/guestfs.pod:1344
2671 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2676 #: ../src/guestfs.pod:1346
2677 msgid "This returns the current out of memory handler."
2681 #: ../src/guestfs.pod:1348
2686 #: ../src/guestfs.pod:1350 ../fish/guestfish.pod:907
2691 #: ../src/guestfs.pod:1352
2696 #: ../src/guestfs.pod:1354
2701 #: ../src/guestfs.pod:1356
2702 msgid "AVAILABILITY"
2706 #: ../src/guestfs.pod:1358
2707 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2711 #: ../src/guestfs.pod:1360
2713 "Using L</guestfs_available> you can test availability of the following "
2714 "groups of functions. This test queries the appliance to see if the "
2715 "appliance you are currently using supports the functionality."
2719 #: ../src/guestfs.pod:1365
2720 msgid "@AVAILABILITY@"
2724 #: ../src/guestfs.pod:1367
2725 msgid "GUESTFISH supported COMMAND"
2729 #: ../src/guestfs.pod:1369
2731 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2732 "prints out the available groups and whether they are supported by this build "
2733 "of libguestfs. Note however that you have to do C<run> first."
2737 #: ../src/guestfs.pod:1374
2738 msgid "SINGLE CALLS AT COMPILE TIME"
2742 #: ../src/guestfs.pod:1376
2744 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2745 "function, such as:"
2749 #: ../src/guestfs.pod:1379
2752 " #define LIBGUESTFS_HAVE_DD 1\n"
2757 #: ../src/guestfs.pod:1381
2758 msgid "if L</guestfs_dd> is available."
2762 #: ../src/guestfs.pod:1383
2764 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2765 "function is available at compile time, we recommended using build tools such "
2766 "as autoconf or cmake. For example in autotools you could use:"
2770 #: ../src/guestfs.pod:1388
2773 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2774 " AC_CHECK_FUNCS([guestfs_dd])\n"
2779 #: ../src/guestfs.pod:1391
2781 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2786 #: ../src/guestfs.pod:1394
2787 msgid "SINGLE CALLS AT RUN TIME"
2791 #: ../src/guestfs.pod:1396
2793 "Testing at compile time doesn't guarantee that a function really exists in "
2794 "the library. The reason is that you might be dynamically linked against a "
2795 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2796 "This situation unfortunately results in a segmentation fault, which is a "
2797 "shortcoming of the C dynamic linking system itself."
2801 #: ../src/guestfs.pod:1403
2803 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2804 "in this example program (note that you still need the compile time check as "
2809 #: ../src/guestfs.pod:1407
2812 " #include <stdio.h>\n"
2813 " #include <stdlib.h>\n"
2814 " #include <unistd.h>\n"
2815 " #include <dlfcn.h>\n"
2816 " #include <guestfs.h>\n"
2821 #: ../src/guestfs.pod:1413
2826 " #ifdef LIBGUESTFS_HAVE_DD\n"
2828 " int has_function;\n"
2833 #: ../src/guestfs.pod:1419
2836 " /* Test if the function guestfs_dd is really available. */\n"
2837 " dl = dlopen (NULL, RTLD_LAZY);\n"
2839 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2840 " exit (EXIT_FAILURE);\n"
2842 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2848 #: ../src/guestfs.pod:1428
2851 " if (!has_function)\n"
2852 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2854 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2855 " /* Now it's safe to call\n"
2856 " guestfs_dd (g, \"foo\", \"bar\");\n"
2860 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2867 #: ../src/guestfs.pod:1441
2869 "You may think the above is an awful lot of hassle, and it is. There are "
2870 "other ways outside of the C linking system to ensure that this kind of "
2871 "incompatibility never arises, such as using package versioning:"
2875 #: ../src/guestfs.pod:1446
2878 " Requires: libguestfs >= 1.0.80\n"
2883 #: ../src/guestfs.pod:1448
2884 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2888 #: ../src/guestfs.pod:1450
2890 "A recent feature of the API is the introduction of calls which take optional "
2891 "arguments. In C these are declared 3 ways. The main way is as a call which "
2892 "takes variable arguments (ie. C<...>), as in this example:"
2896 #: ../src/guestfs.pod:1455
2899 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2904 #: ../src/guestfs.pod:1457
2906 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2907 "call with no optional arguments specified:"
2911 #: ../src/guestfs.pod:1460
2914 " guestfs_add_drive_opts (g, filename, -1);\n"
2919 #: ../src/guestfs.pod:1462
2920 msgid "With a single optional argument:"
2924 #: ../src/guestfs.pod:1464
2927 " guestfs_add_drive_opts (g, filename,\n"
2928 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2934 #: ../src/guestfs.pod:1468
2939 #: ../src/guestfs.pod:1470
2942 " guestfs_add_drive_opts (g, filename,\n"
2943 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2944 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2950 #: ../src/guestfs.pod:1475
2952 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2957 #: ../src/guestfs.pod:1478
2958 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2962 #: ../src/guestfs.pod:1480
2964 "The second variant has the same name with the suffix C<_va>, which works the "
2965 "same way but takes a C<va_list>. See the C manual for details. For the "
2966 "example function, this is declared:"
2970 #: ../src/guestfs.pod:1484
2973 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2979 #: ../src/guestfs.pod:1487
2980 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2984 #: ../src/guestfs.pod:1489
2986 "The third variant is useful where you need to construct these calls. You "
2987 "pass in a structure where you fill in the optional fields. The structure "
2988 "has a bitmask as the first element which you must set to indicate which "
2989 "fields you have filled in. For our example function the structure and call "
2994 #: ../src/guestfs.pod:1495
2997 " struct guestfs_add_drive_opts_argv {\n"
2998 " uint64_t bitmask;\n"
3000 " const char *format;\n"
3003 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3004 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3009 #: ../src/guestfs.pod:1504
3010 msgid "You could call it like this:"
3014 #: ../src/guestfs.pod:1506
3017 " struct guestfs_add_drive_opts_argv optargs = {\n"
3018 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3019 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3021 " .format = \"qcow2\"\n"
3027 #: ../src/guestfs.pod:1513
3030 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3035 #: ../src/guestfs.pod:1515 ../src/guestfs-actions.pod:11
3036 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9
3037 #: ../fish/guestfish-actions.pod:1255
3042 #: ../src/guestfs.pod:1521
3043 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3047 #: ../src/guestfs.pod:1526
3048 msgid "You do not need to fill in all fields of the structure."
3052 #: ../src/guestfs.pod:1530
3054 "There must be a one-to-one correspondence between fields of the structure "
3055 "that are filled in, and bits set in the bitmask."
3059 #: ../src/guestfs.pod:1535
3060 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3064 #: ../src/guestfs.pod:1537
3066 "In other languages, optional arguments are expressed in the way that is "
3067 "natural for that language. We refer you to the language-specific "
3068 "documentation for more details on that."
3072 #: ../src/guestfs.pod:1541
3073 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3077 #: ../src/guestfs.pod:1543
3078 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3082 #: ../src/guestfs.pod:1545
3084 "The child process generates events in some situations. Current events "
3085 "include: receiving a log message, the child process exits."
3089 #: ../src/guestfs.pod:1548
3091 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3096 #: ../src/guestfs.pod:1551
3098 "Only I<one callback of each type> can be registered for each handle. "
3099 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3100 "that type. Cancel all callbacks of this type by calling this function with "
3101 "C<cb> set to C<NULL>."
3105 #: ../src/guestfs.pod:1556
3106 msgid "guestfs_set_log_message_callback"
3110 #: ../src/guestfs.pod:1558
3113 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3114 " char *buf, int len);\n"
3115 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3116 " guestfs_log_message_cb cb,\n"
3122 #: ../src/guestfs.pod:1564
3124 "The callback function C<cb> will be called whenever qemu or the guest writes "
3125 "anything to the console."
3129 #: ../src/guestfs.pod:1567
3130 msgid "Use this function to capture kernel messages and similar."
3134 #: ../src/guestfs.pod:1569
3136 "Normally there is no log message handler, and log messages are just "
3141 #: ../src/guestfs.pod:1572
3142 msgid "guestfs_set_subprocess_quit_callback"
3146 #: ../src/guestfs.pod:1574
3149 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3150 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3151 " guestfs_subprocess_quit_cb cb,\n"
3157 #: ../src/guestfs.pod:1579
3159 "The callback function C<cb> will be called when the child process quits, "
3160 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3161 "corresponds to a transition from any state to the CONFIG state)."
3165 #: ../src/guestfs.pod:1584
3166 msgid "guestfs_set_launch_done_callback"
3170 #: ../src/guestfs.pod:1586
3173 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3174 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3175 " guestfs_launch_done_cb cb,\n"
3181 #: ../src/guestfs.pod:1591
3183 "The callback function C<cb> will be called when the child process becomes "
3184 "ready first time after it has been launched. (This corresponds to a "
3185 "transition from LAUNCHING to the READY state)."
3189 #: ../src/guestfs.pod:1595
3190 msgid "guestfs_set_close_callback"
3194 #: ../src/guestfs.pod:1597
3197 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3198 " void guestfs_set_close_callback (guestfs_h *g,\n"
3199 " guestfs_close_cb cb,\n"
3205 #: ../src/guestfs.pod:1602
3207 "The callback function C<cb> will be called while the handle is being closed "
3208 "(synchronously from L</guestfs_close>)."
3212 #: ../src/guestfs.pod:1605
3214 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3215 "handles that are open when the program exits. This means that this callback "
3216 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3217 "problems in higher-level languages (eg. if your HLL interpreter has already "
3218 "been cleaned up by the time this is called, and if your callback then jumps "
3219 "into some HLL function)."
3223 #: ../src/guestfs.pod:1613
3224 msgid "guestfs_set_progress_callback"
3228 #: ../src/guestfs.pod:1615
3231 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3232 " int proc_nr, int serial,\n"
3233 " uint64_t position, uint64_t total);\n"
3234 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3235 " guestfs_progress_cb cb,\n"
3241 #: ../src/guestfs.pod:1622
3243 "Some long-running operations can generate progress messages. If this "
3244 "callback is registered, then it will be called each time a progress message "
3245 "is generated (usually two seconds after the operation started, and three "
3246 "times per second thereafter until it completes, although the frequency may "
3247 "change in future versions)."
3251 #: ../src/guestfs.pod:1628
3253 "The callback receives two numbers: C<position> and C<total>. The units of "
3254 "C<total> are not defined, although for some operations C<total> may relate "
3255 "in some way to the amount of data to be transferred (eg. in bytes or "
3256 "megabytes), and C<position> may be the portion which has been transferred."
3260 #: ../src/guestfs.pod:1634
3261 msgid "The only defined and stable parts of the API are:"
3265 #: ../src/guestfs.pod:1640
3267 "The callback can display to the user some type of progress bar or indicator "
3268 "which shows the ratio of C<position>:C<total>."
3272 #: ../src/guestfs.pod:1645
3273 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3277 #: ../src/guestfs.pod:1649
3279 "If any progress notification is sent during a call, then a final progress "
3280 "notification is always sent when C<position> = C<total>."
3284 #: ../src/guestfs.pod:1652
3286 "This is to simplify caller code, so callers can easily set the progress "
3287 "indicator to \"100%\" at the end of the operation, without requiring special "
3288 "code to detect this case."
3292 #: ../src/guestfs.pod:1658
3294 "The callback also receives the procedure number and serial number of the "
3295 "call. These are only useful for debugging protocol issues, and the callback "
3296 "can normally ignore them. The callback may want to print these numbers in "
3297 "error messages or debugging messages."
3301 #: ../src/guestfs.pod:1663
3302 msgid "PRIVATE DATA AREA"
3306 #: ../src/guestfs.pod:1665
3308 "You can attach named pieces of private data to the libguestfs handle, and "
3309 "fetch them by name for the lifetime of the handle. This is called the "
3310 "private data area and is only available from the C API."
3314 #: ../src/guestfs.pod:1669
3315 msgid "To attach a named piece of data, use the following call:"
3319 #: ../src/guestfs.pod:1671
3322 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3327 #: ../src/guestfs.pod:1673
3329 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3330 "pointer (which can be C<NULL>). Any previous item with the same name is "
3335 #: ../src/guestfs.pod:1677
3337 "You can use any C<key> you want, but names beginning with an underscore "
3338 "character are reserved for internal libguestfs purposes (for implementing "
3339 "language bindings). It is recommended to prefix the name with some unique "
3340 "string to avoid collisions with other users."
3344 #: ../src/guestfs.pod:1682
3345 msgid "To retrieve the pointer, use:"
3349 #: ../src/guestfs.pod:1684
3352 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3357 #: ../src/guestfs.pod:1686
3359 "This function returns C<NULL> if either no data is found associated with "
3360 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3365 #: ../src/guestfs.pod:1690
3367 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3368 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3369 "all. In particular, libguestfs does I<not> try to free the data when the "
3370 "handle is closed. If the data must be freed, then the caller must either "
3371 "free it before calling L</guestfs_close> or must set up a close callback to "
3372 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3373 "can be registered for a handle)."
3377 #: ../src/guestfs.pod:1698
3379 "The private data area is implemented using a hash table, and should be "
3380 "reasonably efficient for moderate numbers of keys."
3384 #: ../src/guestfs.pod:1701 ../src/guestfs.pod:1706
3389 #: ../src/guestfs.pod:1703
3391 "<!-- old anchor for the next section --> <a name="
3392 "\"state_machine_and_low_level_event_api\"/>"
3396 #: ../src/guestfs.pod:1708
3397 msgid "ARCHITECTURE"
3401 #: ../src/guestfs.pod:1710
3403 "Internally, libguestfs is implemented by running an appliance (a special "
3404 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3405 "process of the main program."
3409 #: ../src/guestfs.pod:1714
3412 " ___________________\n"
3414 " | main program |\n"
3416 " | | child process / appliance\n"
3417 " | | __________________________\n"
3419 " +-------------------+ RPC | +-----------------+ |\n"
3420 " | libguestfs <--------------------> guestfsd | |\n"
3421 " | | | +-----------------+ |\n"
3422 " \\___________________/ | | Linux kernel | |\n"
3423 " | +--^--------------+ |\n"
3424 " \\_________|________________/\n"
3430 " \\______________/\n"
3435 #: ../src/guestfs.pod:1734
3437 "The library, linked to the main program, creates the child process and hence "
3438 "the appliance in the L</guestfs_launch> function."
3442 #: ../src/guestfs.pod:1737
3444 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3445 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3446 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3447 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3448 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3449 "attached to the qemu process which translates device access by the "
3450 "appliance's Linux kernel into accesses to the image."
3454 #: ../src/guestfs.pod:1746
3456 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3457 "Although the disk image you are attached to might also be used by some "
3458 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3459 "care if both libguestfs's qemu process and your virtual machine are trying "
3460 "to update the disk image at the same time, since these usually results in "
3461 "massive disk corruption)."
3465 #: ../src/guestfs.pod:1753
3466 msgid "STATE MACHINE"
3470 #: ../src/guestfs.pod:1755
3471 msgid "libguestfs uses a state machine to model the child process:"
3475 #: ../src/guestfs.pod:1757
3487 " / | \\ \\ guestfs_launch\n"
3488 " / | _\\__V______\n"
3490 " / | | LAUNCHING |\n"
3491 " / | \\___________/\n"
3493 " / | guestfs_launch\n"
3495 " ______ / __|____V\n"
3496 " / \\ ------> / \\\n"
3497 " | BUSY | | READY |\n"
3498 " \\______/ <------ \\________/\n"
3503 #: ../src/guestfs.pod:1779
3505 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3506 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3507 "(3) alternating between READY and BUSY as commands are issued to, and "
3508 "carried out by, the child process."
3512 #: ../src/guestfs.pod:1784
3514 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3515 "asynchronously at any time (eg. due to some internal error), and that causes "
3516 "the state to transition back to CONFIG."
3520 #: ../src/guestfs.pod:1788
3522 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3523 "issued when in the CONFIG state."
3527 #: ../src/guestfs.pod:1791
3529 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3530 "L</guestfs_launch> blocks until the child process is READY to accept "
3531 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3532 "moves the state from CONFIG to LAUNCHING while it is running."
3536 #: ../src/guestfs.pod:1797
3538 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3539 "state. These API calls block waiting for the command to be carried out (ie. "
3540 "the state to transition to BUSY and then back to READY). There are no non-"
3541 "blocking versions, and no way to issue more than one command per handle at "
3546 #: ../src/guestfs.pod:1803
3548 "Finally, the child process sends asynchronous messages back to the main "
3549 "program, such as kernel log messages. You can register a callback to "
3550 "receive these messages."
3554 #: ../src/guestfs.pod:1807
3559 #: ../src/guestfs.pod:1809
3560 msgid "COMMUNICATION PROTOCOL"
3564 #: ../src/guestfs.pod:1811
3566 "Don't rely on using this protocol directly. This section documents how it "
3567 "currently works, but it may change at any time."
3571 #: ../src/guestfs.pod:1814
3573 "The protocol used to talk between the library and the daemon running inside "
3574 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3575 "1014, RFC 1832, RFC 4506)."
3579 #: ../src/guestfs.pod:1818
3581 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3582 "this file is automatically generated)."
3586 #: ../src/guestfs.pod:1821
3588 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3589 "and C<FileOut> parameters, which are handled with very simple request/reply "
3590 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3591 "parameters, which use the same request and reply messages, but they may also "
3592 "be followed by files sent using a chunked encoding."
3596 #: ../src/guestfs.pod:1828
3597 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3601 #: ../src/guestfs.pod:1830
3602 msgid "For ordinary functions, the request message is:"
3606 #: ../src/guestfs.pod:1832
3609 " total length (header + arguments,\n"
3610 " but not including the length word itself)\n"
3611 " struct guestfs_message_header (encoded as XDR)\n"
3612 " struct guestfs_<foo>_args (encoded as XDR)\n"
3617 #: ../src/guestfs.pod:1837
3619 "The total length field allows the daemon to allocate a fixed size buffer "
3620 "into which it slurps the rest of the message. As a result, the total length "
3621 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3622 "effective size of any request is limited to somewhere under this size."
3626 #: ../src/guestfs.pod:1843
3628 "Note also that many functions don't take any arguments, in which case the "
3629 "C<guestfs_I<foo>_args> is completely omitted."
3633 #: ../src/guestfs.pod:1846
3635 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3636 "receiver knows what type of args structure to expect, or none at all."
3640 #: ../src/guestfs.pod:1850
3641 msgid "The reply message for ordinary functions is:"
3645 #: ../src/guestfs.pod:1852
3648 " total length (header + ret,\n"
3649 " but not including the length word itself)\n"
3650 " struct guestfs_message_header (encoded as XDR)\n"
3651 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3656 #: ../src/guestfs.pod:1857
3658 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3659 "functions that return no formal return values."
3663 #: ../src/guestfs.pod:1860
3665 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3669 #: ../src/guestfs.pod:1863
3671 "In the case of an error, a flag is set in the header, and the reply message "
3672 "is slightly changed:"
3676 #: ../src/guestfs.pod:1866
3679 " total length (header + error,\n"
3680 " but not including the length word itself)\n"
3681 " struct guestfs_message_header (encoded as XDR)\n"
3682 " struct guestfs_message_error (encoded as XDR)\n"
3687 #: ../src/guestfs.pod:1871
3689 "The C<guestfs_message_error> structure contains the error message as a "
3694 #: ../src/guestfs.pod:1874
3695 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3699 #: ../src/guestfs.pod:1876
3701 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3702 "The normal request message is sent (see above). However this is followed by "
3703 "a sequence of file chunks."
3707 #: ../src/guestfs.pod:1880
3710 " total length (header + arguments,\n"
3711 " but not including the length word itself,\n"
3712 " and not including the chunks)\n"
3713 " struct guestfs_message_header (encoded as XDR)\n"
3714 " struct guestfs_<foo>_args (encoded as XDR)\n"
3715 " sequence of chunks for FileIn param #0\n"
3716 " sequence of chunks for FileIn param #1 etc.\n"
3721 #: ../src/guestfs.pod:1888
3722 msgid "The \"sequence of chunks\" is:"
3726 #: ../src/guestfs.pod:1890
3729 " length of chunk (not including length word itself)\n"
3730 " struct guestfs_chunk (encoded as XDR)\n"
3731 " length of chunk\n"
3732 " struct guestfs_chunk (encoded as XDR)\n"
3734 " length of chunk\n"
3735 " struct guestfs_chunk (with data.data_len == 0)\n"
3740 #: ../src/guestfs.pod:1898
3742 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3743 "is set in the final chunk to indicate either successful completion or early "
3748 #: ../src/guestfs.pod:1902
3750 "At time of writing there are no functions that have more than one FileIn "
3751 "parameter. However this is (theoretically) supported, by sending the "
3752 "sequence of chunks for each FileIn parameter one after another (from left to "
3757 #: ../src/guestfs.pod:1907
3759 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3760 "transfer. The library does this by sending a chunk with a special flag set "
3761 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3762 "RPC, does I<not> send any reply, and goes back to reading the next request."
3766 #: ../src/guestfs.pod:1913
3768 "The daemon may also cancel. It does this by writing a special word "
3769 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3770 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3771 "cancel chunk). The special word is chosen so that even if cancellation "
3772 "happens right at the end of the transfer (after the library has finished "
3773 "writing and has started listening for the reply), the \"spurious\" cancel "
3774 "flag will not be confused with the reply message."
3778 #: ../src/guestfs.pod:1922
3780 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3781 "limit), and also files where the size is not known in advance (eg. from "
3782 "pipes or sockets). However the chunks are rather small "
3783 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3784 "to keep much in memory."
3788 #: ../src/guestfs.pod:1928
3789 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3793 #: ../src/guestfs.pod:1930
3795 "The protocol for FileOut parameters is exactly the same as for FileIn "
3796 "parameters, but with the roles of daemon and library reversed."
3800 #: ../src/guestfs.pod:1933
3803 " total length (header + ret,\n"
3804 " but not including the length word itself,\n"
3805 " and not including the chunks)\n"
3806 " struct guestfs_message_header (encoded as XDR)\n"
3807 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3808 " sequence of chunks for FileOut param #0\n"
3809 " sequence of chunks for FileOut param #1 etc.\n"
3814 #: ../src/guestfs.pod:1941
3815 msgid "INITIAL MESSAGE"
3819 #: ../src/guestfs.pod:1943
3821 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3822 "which indicates that the guest and daemon is alive. This is what L</"
3823 "guestfs_launch> waits for."
3827 #: ../src/guestfs.pod:1947
3828 msgid "PROGRESS NOTIFICATION MESSAGES"
3832 #: ../src/guestfs.pod:1949
3834 "The daemon may send progress notification messages at any time. These are "
3835 "distinguished by the normal length word being replaced by "
3836 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3840 #: ../src/guestfs.pod:1953
3842 "The library turns them into progress callbacks (see "
3843 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3844 "discards them if not."
3848 #: ../src/guestfs.pod:1957
3850 "The daemon self-limits the frequency of progress messages it sends (see "
3851 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3856 #: ../src/guestfs.pod:1961
3857 msgid "LIBGUESTFS VERSION NUMBERS"
3861 #: ../src/guestfs.pod:1963
3863 "Since April 2010, libguestfs has started to make separate development and "
3864 "stable releases, along with corresponding branches in our git repository. "
3865 "These separate releases can be identified by version number:"
3869 #: ../src/guestfs.pod:1968
3872 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3873 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3879 " | `-------- sub-version\n"
3881 " `------ always '1' because we don't change the ABI\n"
3886 #: ../src/guestfs.pod:1979
3887 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3891 #: ../src/guestfs.pod:1981
3893 "As time passes we cherry pick fixes from the development branch and backport "
3894 "those into the stable branch, the effect being that the stable branch should "
3895 "get more stable and less buggy over time. So the stable releases are ideal "
3896 "for people who don't need new features but would just like the software to "
3901 #: ../src/guestfs.pod:1987
3902 msgid "Our criteria for backporting changes are:"
3906 #: ../src/guestfs.pod:1993
3908 "Documentation changes which don't affect any code are backported unless the "
3909 "documentation refers to a future feature which is not in stable."
3913 #: ../src/guestfs.pod:1999
3915 "Bug fixes which are not controversial, fix obvious problems, and have been "
3916 "well tested are backported."
3920 #: ../src/guestfs.pod:2004
3922 "Simple rearrangements of code which shouldn't affect how it works get "
3923 "backported. This is so that the code in the two branches doesn't get too "
3924 "far out of step, allowing us to backport future fixes more easily."
3928 #: ../src/guestfs.pod:2010
3930 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3931 "exceptional case: the new feature is required in order to implement an "
3932 "important bug fix."
3936 #: ../src/guestfs.pod:2016
3938 "A new stable branch starts when we think the new features in development are "
3939 "substantial and compelling enough over the current stable branch to warrant "
3940 "it. When that happens we create new stable and development versions 1.N.0 "
3941 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3942 "stable at this point, but by backporting fixes from development, that branch "
3943 "will stabilize over time."
3947 #: ../src/guestfs.pod:2024 ../fish/guestfish.pod:914
3948 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3949 #: ../tools/virt-rescue.pl:255
3950 msgid "ENVIRONMENT VARIABLES"
3954 #: ../src/guestfs.pod:2028 ../fish/guestfish.pod:940
3955 msgid "LIBGUESTFS_APPEND"
3959 #: ../src/guestfs.pod:2030 ../fish/guestfish.pod:942
3960 msgid "Pass additional options to the guest kernel."
3964 #: ../src/guestfs.pod:2032 ../fish/guestfish.pod:944
3965 msgid "LIBGUESTFS_DEBUG"
3969 #: ../src/guestfs.pod:2034
3971 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3972 "effect as calling C<guestfs_set_verbose (g, 1)>."
3976 #: ../src/guestfs.pod:2037 ../fish/guestfish.pod:949
3977 msgid "LIBGUESTFS_MEMSIZE"
3981 #: ../src/guestfs.pod:2039 ../fish/guestfish.pod:951
3983 "Set the memory allocated to the qemu process, in megabytes. For example:"
3987 #: ../src/guestfs.pod:2042 ../fish/guestfish.pod:954
3990 " LIBGUESTFS_MEMSIZE=700\n"
3995 #: ../src/guestfs.pod:2044 ../fish/guestfish.pod:956
3996 msgid "LIBGUESTFS_PATH"
4000 #: ../src/guestfs.pod:2046
4002 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4003 "the discussion of paths in section PATH above."
4007 #: ../src/guestfs.pod:2049 ../fish/guestfish.pod:961
4008 msgid "LIBGUESTFS_QEMU"
4012 #: ../src/guestfs.pod:2051 ../fish/guestfish.pod:963
4014 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4015 "which was found at compile time by the configure script is used."
4019 #: ../src/guestfs.pod:2055
4020 msgid "See also L</QEMU WRAPPERS> above."
4024 #: ../src/guestfs.pod:2057 ../fish/guestfish.pod:967
4025 msgid "LIBGUESTFS_TRACE"
4029 #: ../src/guestfs.pod:2059
4031 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4032 "effect as calling C<guestfs_set_trace (g, 1)>."
4036 #: ../src/guestfs.pod:2062 ../fish/guestfish.pod:976
4041 #: ../src/guestfs.pod:2064 ../fish/guestfish.pod:978
4042 msgid "Location of temporary directory, defaults to C</tmp>."
4046 #: ../src/guestfs.pod:2066 ../fish/guestfish.pod:980
4048 "If libguestfs was compiled to use the supermin appliance then the real "
4049 "appliance is cached in this directory, shared between all handles belonging "
4050 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4051 "use in case C</tmp> is not large enough."
4055 #: ../src/guestfs.pod:2074 ../fish/guestfish.pod:1038
4056 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4057 #: ../inspector/virt-inspector.pl:536 ../tools/virt-edit.pl:350
4058 #: ../tools/virt-win-reg.pl:484 ../tools/virt-df.pl:640
4059 #: ../tools/virt-ls.pl:232 ../tools/virt-resize.pl:1486
4060 #: ../tools/virt-list-filesystems.pl:186 ../tools/virt-tar.pl:281
4061 #: ../tools/virt-rescue.pl:267 ../tools/virt-make-fs.pl:534
4062 #: ../tools/virt-list-partitions.pl:254
4067 #: ../src/guestfs.pod:2076
4069 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-edit"
4070 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
4071 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
4072 "tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
4073 "L<http://libguestfs.org/>."
4077 #: ../src/guestfs.pod:2094
4079 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4080 "(8)>, L<disktype(1)>."
4084 #: ../src/guestfs.pod:2101 ../tools/virt-win-reg.pl:499
4085 #: ../tools/virt-make-fs.pl:548
4090 #: ../src/guestfs.pod:2103
4091 msgid "To get a list of bugs against libguestfs use this link:"
4095 #: ../src/guestfs.pod:2105
4097 "L<https://bugzilla.redhat.com/buglist.cgi?"
4098 "component=libguestfs&product=Virtualization+Tools>"
4102 #: ../src/guestfs.pod:2107
4103 msgid "To report a new bug against libguestfs use this link:"
4107 #: ../src/guestfs.pod:2109
4109 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4110 "component=libguestfs&product=Virtualization+Tools>"
4114 #: ../src/guestfs.pod:2111
4115 msgid "When reporting a bug, please check:"
4119 #: ../src/guestfs.pod:2117
4120 msgid "That the bug hasn't been reported already."
4124 #: ../src/guestfs.pod:2121
4125 msgid "That you are testing a recent version."
4129 #: ../src/guestfs.pod:2125
4130 msgid "Describe the bug accurately, and give a way to reproduce it."
4134 #: ../src/guestfs.pod:2129
4136 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4141 #: ../src/guestfs.pod:2134 ../fish/guestfish.pod:1055
4142 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4143 #: ../inspector/virt-inspector.pl:546
4148 #: ../src/guestfs.pod:2136 ../fish/guestfish.pod:1057
4149 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4150 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4154 #: ../src/guestfs.pod:2138 ../fish/guestfish.pod:1059
4155 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4156 #: ../inspector/virt-inspector.pl:560 ../tools/virt-edit.pl:366
4157 #: ../tools/virt-win-reg.pl:514 ../tools/virt-df.pl:653
4158 #: ../tools/virt-ls.pl:247 ../tools/virt-resize.pl:1512
4159 #: ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:296
4160 #: ../tools/virt-rescue.pl:281 ../tools/virt-make-fs.pl:563
4161 #: ../tools/virt-list-partitions.pl:269
4166 #: ../src/guestfs.pod:2140 ../fish/guestfish.pod:1061
4167 #: ../fuse/guestmount.pod:250
4168 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4172 #: ../src/guestfs.pod:2143
4174 "This library is free software; you can redistribute it and/or modify it "
4175 "under the terms of the GNU Lesser General Public License as published by the "
4176 "Free Software Foundation; either version 2 of the License, or (at your "
4177 "option) any later version."
4181 #: ../src/guestfs.pod:2148
4183 "This library is distributed in the hope that it will be useful, but WITHOUT "
4184 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4185 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4190 #: ../src/guestfs.pod:2153
4192 "You should have received a copy of the GNU Lesser General Public License "
4193 "along with this library; if not, write to the Free Software Foundation, "
4194 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4198 #: ../src/guestfs-actions.pod:1
4199 msgid "guestfs_add_cdrom"
4203 #: ../src/guestfs-actions.pod:3
4207 " guestfs_add_cdrom (guestfs_h *g,\n"
4208 " const char *filename);\n"
4213 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4214 msgid "This function adds a virtual CD-ROM disk image to the guest."
4218 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4219 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4223 #: ../src/guestfs-actions.pod:17
4225 "This call checks for the existence of C<filename>. This stops you from "
4226 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4227 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4232 #: ../src/guestfs-actions.pod:24
4234 "If you just want to add an ISO file (often you use this as an efficient way "
4235 "to transfer large files into the guest), then you should probably use "
4236 "C<guestfs_add_drive_ro> instead."
4240 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:126
4241 #: ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:224
4242 #: ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259
4243 #: ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:293
4244 #: ../src/guestfs-actions.pod:408 ../src/guestfs-actions.pod:428
4245 #: ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:487
4246 #: ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:533
4247 #: ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:633
4248 #: ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:662
4249 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
4250 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
4251 #: ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:988
4252 #: ../src/guestfs-actions.pod:1006 ../src/guestfs-actions.pod:1090
4253 #: ../src/guestfs-actions.pod:1108 ../src/guestfs-actions.pod:1127
4254 #: ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1161
4255 #: ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1262
4256 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:1324
4257 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1464
4258 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1704
4259 #: ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2213
4260 #: ../src/guestfs-actions.pod:2357 ../src/guestfs-actions.pod:2418
4261 #: ../src/guestfs-actions.pod:2453 ../src/guestfs-actions.pod:3049
4262 #: ../src/guestfs-actions.pod:3064 ../src/guestfs-actions.pod:3084
4263 #: ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3223
4264 #: ../src/guestfs-actions.pod:3236 ../src/guestfs-actions.pod:3250
4265 #: ../src/guestfs-actions.pod:3265 ../src/guestfs-actions.pod:3301
4266 #: ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3393
4267 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3433
4268 #: ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:3488
4269 #: ../src/guestfs-actions.pod:3507 ../src/guestfs-actions.pod:3526
4270 #: ../src/guestfs-actions.pod:3561 ../src/guestfs-actions.pod:3573
4271 #: ../src/guestfs-actions.pod:3609 ../src/guestfs-actions.pod:3625
4272 #: ../src/guestfs-actions.pod:3638 ../src/guestfs-actions.pod:3653
4273 #: ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3763
4274 #: ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3796
4275 #: ../src/guestfs-actions.pod:3847 ../src/guestfs-actions.pod:3865
4276 #: ../src/guestfs-actions.pod:3883 ../src/guestfs-actions.pod:3899
4277 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:3927
4278 #: ../src/guestfs-actions.pod:3944 ../src/guestfs-actions.pod:3959
4279 #: ../src/guestfs-actions.pod:3979 ../src/guestfs-actions.pod:4028
4280 #: ../src/guestfs-actions.pod:4059 ../src/guestfs-actions.pod:4078
4281 #: ../src/guestfs-actions.pod:4097 ../src/guestfs-actions.pod:4109
4282 #: ../src/guestfs-actions.pod:4126 ../src/guestfs-actions.pod:4139
4283 #: ../src/guestfs-actions.pod:4154 ../src/guestfs-actions.pod:4169
4284 #: ../src/guestfs-actions.pod:4204 ../src/guestfs-actions.pod:4219
4285 #: ../src/guestfs-actions.pod:4239 ../src/guestfs-actions.pod:4253
4286 #: ../src/guestfs-actions.pod:4270 ../src/guestfs-actions.pod:4319
4287 #: ../src/guestfs-actions.pod:4356 ../src/guestfs-actions.pod:4370
4288 #: ../src/guestfs-actions.pod:4398 ../src/guestfs-actions.pod:4415
4289 #: ../src/guestfs-actions.pod:4433 ../src/guestfs-actions.pod:4567
4290 #: ../src/guestfs-actions.pod:4624 ../src/guestfs-actions.pod:4646
4291 #: ../src/guestfs-actions.pod:4664 ../src/guestfs-actions.pod:4696
4292 #: ../src/guestfs-actions.pod:4762 ../src/guestfs-actions.pod:4779
4293 #: ../src/guestfs-actions.pod:4792 ../src/guestfs-actions.pod:4806
4294 #: ../src/guestfs-actions.pod:5095 ../src/guestfs-actions.pod:5114
4295 #: ../src/guestfs-actions.pod:5128 ../src/guestfs-actions.pod:5140
4296 #: ../src/guestfs-actions.pod:5154 ../src/guestfs-actions.pod:5166
4297 #: ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5196
4298 #: ../src/guestfs-actions.pod:5217 ../src/guestfs-actions.pod:5236
4299 #: ../src/guestfs-actions.pod:5255 ../src/guestfs-actions.pod:5273
4300 #: ../src/guestfs-actions.pod:5296 ../src/guestfs-actions.pod:5314
4301 #: ../src/guestfs-actions.pod:5333 ../src/guestfs-actions.pod:5354
4302 #: ../src/guestfs-actions.pod:5373 ../src/guestfs-actions.pod:5390
4303 #: ../src/guestfs-actions.pod:5418 ../src/guestfs-actions.pod:5442
4304 #: ../src/guestfs-actions.pod:5461 ../src/guestfs-actions.pod:5485
4305 #: ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:5515
4306 #: ../src/guestfs-actions.pod:5534 ../src/guestfs-actions.pod:5571
4307 #: ../src/guestfs-actions.pod:5594 ../src/guestfs-actions.pod:5620
4308 #: ../src/guestfs-actions.pod:5728 ../src/guestfs-actions.pod:5849
4309 #: ../src/guestfs-actions.pod:5861 ../src/guestfs-actions.pod:5874
4310 #: ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:5909
4311 #: ../src/guestfs-actions.pod:5922 ../src/guestfs-actions.pod:5935
4312 #: ../src/guestfs-actions.pod:5948 ../src/guestfs-actions.pod:5963
4313 #: ../src/guestfs-actions.pod:6022 ../src/guestfs-actions.pod:6039
4314 #: ../src/guestfs-actions.pod:6055 ../src/guestfs-actions.pod:6071
4315 #: ../src/guestfs-actions.pod:6088 ../src/guestfs-actions.pod:6101
4316 #: ../src/guestfs-actions.pod:6121 ../src/guestfs-actions.pod:6157
4317 #: ../src/guestfs-actions.pod:6171 ../src/guestfs-actions.pod:6212
4318 #: ../src/guestfs-actions.pod:6225 ../src/guestfs-actions.pod:6243
4319 #: ../src/guestfs-actions.pod:6272 ../src/guestfs-actions.pod:6303
4320 #: ../src/guestfs-actions.pod:6422 ../src/guestfs-actions.pod:6440
4321 #: ../src/guestfs-actions.pod:6454 ../src/guestfs-actions.pod:6509
4322 #: ../src/guestfs-actions.pod:6522 ../src/guestfs-actions.pod:6567
4323 #: ../src/guestfs-actions.pod:6600 ../src/guestfs-actions.pod:6654
4324 #: ../src/guestfs-actions.pod:6680 ../src/guestfs-actions.pod:6746
4325 #: ../src/guestfs-actions.pod:6765 ../src/guestfs-actions.pod:6794
4326 msgid "This function returns 0 on success or -1 on error."
4330 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:240
4331 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:28
4332 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4334 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4339 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:243
4340 #: ../src/guestfs-actions.pod:264 ../src/guestfs-actions.pod:1435
4341 #: ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1942
4342 #: ../src/guestfs-actions.pod:6688 ../src/guestfs-actions.pod:6857
4343 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:156
4344 #: ../fish/guestfish-actions.pod:170 ../fish/guestfish-actions.pod:951
4345 #: ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1322
4346 #: ../fish/guestfish-actions.pod:4427 ../fish/guestfish-actions.pod:4524
4348 "Deprecated functions will not be removed from the API, but the fact that "
4349 "they are deprecated indicates that there are problems with correct use of "
4354 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:128
4355 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1893
4356 #: ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2094
4357 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3066
4358 #: ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:5275
4359 #: ../src/guestfs-actions.pod:5392 ../src/guestfs-actions.pod:5502
4360 #: ../src/guestfs-actions.pod:5965 ../src/guestfs-actions.pod:6090
4361 #: ../src/guestfs-actions.pod:6602
4362 msgid "(Added in 0.3)"
4366 #: ../src/guestfs-actions.pod:41
4367 msgid "guestfs_add_domain"
4371 #: ../src/guestfs-actions.pod:43
4375 " guestfs_add_domain (guestfs_h *g,\n"
4376 " const char *dom,\n"
4382 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:137
4384 "You may supply a list of optional arguments to this call. Use zero or more "
4385 "of the following pairs of parameters, and terminate the list with C<-1> on "
4386 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4390 #: ../src/guestfs-actions.pod:53
4393 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4394 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4395 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4400 #: ../src/guestfs-actions.pod:57
4402 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4403 "It works by connecting to libvirt, requesting the domain and domain XML from "
4404 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4409 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4411 "The number of disks added is returned. This operation is atomic: if an "
4412 "error is returned, then no disks are added."
4416 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4418 "This function does some minimal checks to make sure the libvirt domain is "
4419 "not running (unless C<readonly> is true). In a future version we will try "
4420 "to acquire the libvirt lock on each disk."
4424 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4426 "Disks must be accessible locally. This often means that adding disks from a "
4427 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4428 "unless those disks are accessible via the same device path locally too."
4432 #: ../src/guestfs-actions.pod:74
4434 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4435 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4436 "libvirt URI (or one set through an environment variable, see the libvirt "
4437 "documentation for full details). If you are using the C API directly then "
4438 "it is more flexible to create the libvirt connection object yourself, get "
4439 "the domain object, and call C<guestfs_add_libvirt_dom>."
4443 #: ../src/guestfs-actions.pod:82
4445 "The other optional parameters are passed directly through to "
4446 "C<guestfs_add_drive_opts>."
4450 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:336
4451 #: ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:679
4452 #: ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728
4453 #: ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:1307
4454 #: ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1864
4455 #: ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:2003
4456 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2081
4457 #: ../src/guestfs-actions.pod:2344 ../src/guestfs-actions.pod:2602
4458 #: ../src/guestfs-actions.pod:2623 ../src/guestfs-actions.pod:4342
4459 #: ../src/guestfs-actions.pod:4470 ../src/guestfs-actions.pod:4876
4460 #: ../src/guestfs-actions.pod:4902 ../src/guestfs-actions.pod:6198
4461 #: ../src/guestfs-actions.pod:6613 ../src/guestfs-actions.pod:6626
4462 #: ../src/guestfs-actions.pod:6639
4463 msgid "On error this function returns -1."
4467 #: ../src/guestfs-actions.pod:87
4468 msgid "guestfs_add_domain_va"
4472 #: ../src/guestfs-actions.pod:89
4476 " guestfs_add_domain_va (guestfs_h *g,\n"
4477 " const char *dom,\n"
4483 #: ../src/guestfs-actions.pod:94
4484 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4488 #: ../src/guestfs-actions.pod:96 ../src/guestfs-actions.pod:107
4489 #: ../src/guestfs-actions.pod:200 ../src/guestfs-actions.pod:211
4490 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4494 #: ../src/guestfs-actions.pod:98
4495 msgid "guestfs_add_domain_argv"
4499 #: ../src/guestfs-actions.pod:100
4503 " guestfs_add_domain_argv (guestfs_h *g,\n"
4504 " const char *dom,\n"
4505 " const struct guestfs_add_domain_argv *optargs);\n"
4510 #: ../src/guestfs-actions.pod:105
4511 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4515 #: ../src/guestfs-actions.pod:109
4516 msgid "guestfs_add_drive"
4520 #: ../src/guestfs-actions.pod:111
4524 " guestfs_add_drive (guestfs_h *g,\n"
4525 " const char *filename);\n"
4530 #: ../src/guestfs-actions.pod:115
4532 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4533 "optional parameters, so the disk is added writable, with the format being "
4534 "detected automatically."
4538 #: ../src/guestfs-actions.pod:119
4540 "Automatic detection of the format opens you up to a potential security hole "
4541 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4542 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4543 "you should think about replacing calls to this function with calls to "
4544 "C<guestfs_add_drive_opts>, and specifying the format."
4548 #: ../src/guestfs-actions.pod:130
4549 msgid "guestfs_add_drive_opts"
4553 #: ../src/guestfs-actions.pod:132
4557 " guestfs_add_drive_opts (guestfs_h *g,\n"
4558 " const char *filename,\n"
4564 #: ../src/guestfs-actions.pod:142
4567 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4568 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4569 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4574 #: ../src/guestfs-actions.pod:146 ../fish/guestfish-actions.pod:92
4576 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4577 "The first time you call this function, the disk appears as C</dev/sda>, the "
4578 "second time as C</dev/sdb>, and so on."
4582 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:97
4584 "You don't necessarily need to be root when using libguestfs. However you "
4585 "obviously do need sufficient permissions to access the filename for whatever "
4586 "operations you want to perform (ie. read access if you just want to read the "
4587 "image or write access if you want to modify the image)."
4591 #: ../src/guestfs-actions.pod:157 ../fish/guestfish-actions.pod:103
4592 msgid "This call checks that C<filename> exists."
4596 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:105
4597 msgid "The optional arguments are:"
4601 #: ../src/guestfs-actions.pod:163 ../fish/guestfish-actions.pod:109
4606 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:111
4608 "If true then the image is treated as read-only. Writes are still allowed, "
4609 "but they are stored in a temporary snapshot overlay which is discarded at "
4610 "the end. The disk that you add is not modified."
4614 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:115
4619 #: ../src/guestfs-actions.pod:171
4621 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4622 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4623 "Possible formats include C<raw> and C<qcow2>."
4627 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:121
4629 "Automatic detection of the format opens you up to a potential security hole "
4630 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4631 "RHBZ#642934. Specifying the format closes this security hole."
4635 #: ../src/guestfs-actions.pod:180 ../fish/guestfish-actions.pod:126
4640 #: ../src/guestfs-actions.pod:182
4642 "This rarely-used option lets you emulate the behaviour of the deprecated "
4643 "C<guestfs_add_drive_with_if> call (q.v.)"
4647 #: ../src/guestfs-actions.pod:189
4648 msgid "(Added in 1.5.23)"
4652 #: ../src/guestfs-actions.pod:191
4653 msgid "guestfs_add_drive_opts_va"
4657 #: ../src/guestfs-actions.pod:193
4661 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4662 " const char *filename,\n"
4668 #: ../src/guestfs-actions.pod:198
4669 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4673 #: ../src/guestfs-actions.pod:202
4674 msgid "guestfs_add_drive_opts_argv"
4678 #: ../src/guestfs-actions.pod:204
4682 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4683 " const char *filename,\n"
4684 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4689 #: ../src/guestfs-actions.pod:209
4690 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4694 #: ../src/guestfs-actions.pod:213
4695 msgid "guestfs_add_drive_ro"
4699 #: ../src/guestfs-actions.pod:215
4703 " guestfs_add_drive_ro (guestfs_h *g,\n"
4704 " const char *filename);\n"
4709 #: ../src/guestfs-actions.pod:219
4711 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4712 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4713 "disk is added read-only, with the format being detected automatically."
4717 #: ../src/guestfs-actions.pod:226
4718 msgid "(Added in 1.0.38)"
4722 #: ../src/guestfs-actions.pod:228
4723 msgid "guestfs_add_drive_ro_with_if"
4727 #: ../src/guestfs-actions.pod:230
4731 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4732 " const char *filename,\n"
4733 " const char *iface);\n"
4738 #: ../src/guestfs-actions.pod:235
4740 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4741 "QEMU interface emulation to use at run time."
4745 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:268
4746 #: ../src/guestfs-actions.pod:2303
4747 msgid "(Added in 1.0.84)"
4751 #: ../src/guestfs-actions.pod:249
4752 msgid "guestfs_add_drive_with_if"
4756 #: ../src/guestfs-actions.pod:251
4760 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4761 " const char *filename,\n"
4762 " const char *iface);\n"
4767 #: ../src/guestfs-actions.pod:256
4769 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4770 "QEMU interface emulation to use at run time."
4774 #: ../src/guestfs-actions.pod:270
4775 msgid "guestfs_aug_clear"
4779 #: ../src/guestfs-actions.pod:272
4783 " guestfs_aug_clear (guestfs_h *g,\n"
4784 " const char *augpath);\n"
4789 #: ../src/guestfs-actions.pod:276 ../fish/guestfish-actions.pod:178
4791 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4792 "L<augtool(1)> C<clear> command."
4796 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:2083
4797 msgid "(Added in 1.3.4)"
4801 #: ../src/guestfs-actions.pod:283
4802 msgid "guestfs_aug_close"
4806 #: ../src/guestfs-actions.pod:285
4810 " guestfs_aug_close (guestfs_h *g);\n"
4815 #: ../src/guestfs-actions.pod:288
4817 "Close the current Augeas handle and free up any resources used by it. After "
4818 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4819 "any other Augeas functions."
4823 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:320
4824 #: ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:352
4825 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4826 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:475
4827 #: ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503
4828 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4829 #: ../src/guestfs-actions.pod:4953
4830 msgid "(Added in 0.7)"
4834 #: ../src/guestfs-actions.pod:297
4835 msgid "guestfs_aug_defnode"
4839 #: ../src/guestfs-actions.pod:299
4842 " struct guestfs_int_bool *\n"
4843 " guestfs_aug_defnode (guestfs_h *g,\n"
4844 " const char *name,\n"
4845 " const char *expr,\n"
4846 " const char *val);\n"
4851 #: ../src/guestfs-actions.pod:305 ../fish/guestfish-actions.pod:194
4853 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4857 #: ../src/guestfs-actions.pod:308
4859 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4860 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4861 "containing that single node."
4865 #: ../src/guestfs-actions.pod:312 ../fish/guestfish-actions.pod:201
4867 "On success this returns a pair containing the number of nodes in the "
4868 "nodeset, and a boolean flag if a node was created."
4872 #: ../src/guestfs-actions.pod:316
4874 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4875 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4879 #: ../src/guestfs-actions.pod:322
4880 msgid "guestfs_aug_defvar"
4884 #: ../src/guestfs-actions.pod:324
4888 " guestfs_aug_defvar (guestfs_h *g,\n"
4889 " const char *name,\n"
4890 " const char *expr);\n"
4895 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:209
4897 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4898 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4902 #: ../src/guestfs-actions.pod:333 ../fish/guestfish-actions.pod:213
4904 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4905 "evaluates to something which is not a nodeset."
4909 #: ../src/guestfs-actions.pod:340
4910 msgid "guestfs_aug_get"
4914 #: ../src/guestfs-actions.pod:342
4918 " guestfs_aug_get (guestfs_h *g,\n"
4919 " const char *augpath);\n"
4924 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:220
4926 "Look up the value associated with C<path>. If C<path> matches exactly one "
4927 "node, the C<value> is returned."
4931 #: ../src/guestfs-actions.pod:349 ../src/guestfs-actions.pod:849
4932 #: ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:927
4933 #: ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1046
4934 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1193
4935 #: ../src/guestfs-actions.pod:1212 ../src/guestfs-actions.pod:1341
4936 #: ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1644
4937 #: ../src/guestfs-actions.pod:1807 ../src/guestfs-actions.pod:1824
4938 #: ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1936
4939 #: ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2268
4940 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2548
4941 #: ../src/guestfs-actions.pod:2684 ../src/guestfs-actions.pod:2713
4942 #: ../src/guestfs-actions.pod:2735 ../src/guestfs-actions.pod:2795
4943 #: ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:3195
4944 #: ../src/guestfs-actions.pod:3545 ../src/guestfs-actions.pod:3715
4945 #: ../src/guestfs-actions.pod:3825 ../src/guestfs-actions.pod:4488
4946 #: ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4851
4947 #: ../src/guestfs-actions.pod:5029 ../src/guestfs-actions.pod:5078
4948 #: ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:5657
4949 #: ../src/guestfs-actions.pod:5674 ../src/guestfs-actions.pod:5698
4950 #: ../src/guestfs-actions.pod:6362 ../src/guestfs-actions.pod:6381
4951 #: ../src/guestfs-actions.pod:6399 ../src/guestfs-actions.pod:6579
4952 #: ../src/guestfs-actions.pod:6851
4954 "This function returns a string, or NULL on error. I<The caller must free "
4955 "the returned string after use>."
4959 #: ../src/guestfs-actions.pod:354
4960 msgid "guestfs_aug_init"
4964 #: ../src/guestfs-actions.pod:356
4968 " guestfs_aug_init (guestfs_h *g,\n"
4969 " const char *root,\n"
4975 #: ../src/guestfs-actions.pod:361 ../fish/guestfish-actions.pod:227
4977 "Create a new Augeas handle for editing configuration files. If there was "
4978 "any previous Augeas handle associated with this guestfs session, then it is "
4983 #: ../src/guestfs-actions.pod:365
4984 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4988 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:234
4990 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4994 #: ../src/guestfs-actions.pod:371 ../fish/guestfish-actions.pod:237
4996 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4997 "logical I<or> of the following integers:"
5001 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:243
5002 msgid "C<AUG_SAVE_BACKUP> = 1"
5006 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:245
5007 msgid "Keep the original file with a C<.augsave> extension."
5011 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:247
5012 msgid "C<AUG_SAVE_NEWFILE> = 2"
5016 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:249
5018 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5019 "original. Overrides C<AUG_SAVE_BACKUP>."
5023 #: ../src/guestfs-actions.pod:386 ../fish/guestfish-actions.pod:252
5024 msgid "C<AUG_TYPE_CHECK> = 4"
5028 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:254
5029 msgid "Typecheck lenses (can be expensive)."
5033 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:256
5034 msgid "C<AUG_NO_STDINC> = 8"
5038 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:258
5039 msgid "Do not use standard load path for modules."
5043 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:260
5044 msgid "C<AUG_SAVE_NOOP> = 16"
5048 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:262
5049 msgid "Make save a no-op, just record what would have been changed."
5053 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:264
5054 msgid "C<AUG_NO_LOAD> = 32"
5058 #: ../src/guestfs-actions.pod:400
5059 msgid "Do not load the tree in C<guestfs_aug_init>."
5063 #: ../src/guestfs-actions.pod:404
5064 msgid "To close the handle, you can call C<guestfs_aug_close>."
5068 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:272
5069 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5073 #: ../src/guestfs-actions.pod:412
5074 msgid "guestfs_aug_insert"
5078 #: ../src/guestfs-actions.pod:414
5082 " guestfs_aug_insert (guestfs_h *g,\n"
5083 " const char *augpath,\n"
5084 " const char *label,\n"
5090 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:278
5092 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5093 "or after C<path> (depending on the boolean flag C<before>)."
5097 #: ../src/guestfs-actions.pod:424 ../fish/guestfish-actions.pod:282
5099 "C<path> must match exactly one existing node in the tree, and C<label> must "
5100 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5104 #: ../src/guestfs-actions.pod:432
5105 msgid "guestfs_aug_load"
5109 #: ../src/guestfs-actions.pod:434
5113 " guestfs_aug_load (guestfs_h *g);\n"
5118 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:290
5119 msgid "Load files into the tree."
5123 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:292
5124 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5128 #: ../src/guestfs-actions.pod:446
5129 msgid "guestfs_aug_ls"
5133 #: ../src/guestfs-actions.pod:448
5137 " guestfs_aug_ls (guestfs_h *g,\n"
5138 " const char *augpath);\n"
5143 #: ../src/guestfs-actions.pod:452
5145 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5146 "sorting the resulting nodes into alphabetical order."
5150 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:471
5151 #: ../src/guestfs-actions.pod:617 ../src/guestfs-actions.pod:1065
5152 #: ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1375
5153 #: ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1497
5154 #: ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:2148
5155 #: ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:2183
5156 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:2250
5157 #: ../src/guestfs-actions.pod:2321 ../src/guestfs-actions.pod:2370
5158 #: ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:2754
5159 #: ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:3115
5160 #: ../src/guestfs-actions.pod:3177 ../src/guestfs-actions.pod:3282
5161 #: ../src/guestfs-actions.pod:3687 ../src/guestfs-actions.pod:4303
5162 #: ../src/guestfs-actions.pod:4823 ../src/guestfs-actions.pod:4949
5163 #: ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5714
5164 #: ../src/guestfs-actions.pod:5775 ../src/guestfs-actions.pod:5830
5165 #: ../src/guestfs-actions.pod:5976 ../src/guestfs-actions.pod:6000
5166 #: ../src/guestfs-actions.pod:6472 ../src/guestfs-actions.pod:6492
5167 #: ../src/guestfs-actions.pod:6539 ../src/guestfs-actions.pod:6704
5168 #: ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6808
5169 #: ../src/guestfs-actions.pod:6827 ../src/guestfs-actions.pod:6873
5170 #: ../src/guestfs-actions.pod:6892
5172 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5173 ">), or NULL if there was an error. I<The caller must free the strings and "
5174 "the array after use>."
5178 #: ../src/guestfs-actions.pod:459 ../src/guestfs-actions.pod:990
5179 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1413
5180 #: ../src/guestfs-actions.pod:2938 ../src/guestfs-actions.pod:2969
5181 #: ../src/guestfs-actions.pod:3528 ../src/guestfs-actions.pod:3578
5182 #: ../src/guestfs-actions.pod:3765 ../src/guestfs-actions.pod:3798
5183 #: ../src/guestfs-actions.pod:3961 ../src/guestfs-actions.pod:4307
5184 #: ../src/guestfs-actions.pod:4764 ../src/guestfs-actions.pod:5142
5185 #: ../src/guestfs-actions.pod:5156 ../src/guestfs-actions.pod:5168
5186 #: ../src/guestfs-actions.pod:5576 ../src/guestfs-actions.pod:6214
5187 #: ../src/guestfs-actions.pod:6227 ../src/guestfs-actions.pod:6456
5188 #: ../src/guestfs-actions.pod:6659 ../src/guestfs-actions.pod:6692
5189 msgid "(Added in 0.8)"
5193 #: ../src/guestfs-actions.pod:461
5194 msgid "guestfs_aug_match"
5198 #: ../src/guestfs-actions.pod:463
5202 " guestfs_aug_match (guestfs_h *g,\n"
5203 " const char *augpath);\n"
5208 #: ../src/guestfs-actions.pod:467 ../fish/guestfish-actions.pod:306
5210 "Returns a list of paths which match the path expression C<path>. The "
5211 "returned paths are sufficiently qualified so that they match exactly one "
5212 "node in the current tree."
5216 #: ../src/guestfs-actions.pod:477
5217 msgid "guestfs_aug_mv"
5221 #: ../src/guestfs-actions.pod:479
5225 " guestfs_aug_mv (guestfs_h *g,\n"
5226 " const char *src,\n"
5227 " const char *dest);\n"
5232 #: ../src/guestfs-actions.pod:484 ../fish/guestfish-actions.pod:314
5234 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5235 "C<dest> is overwritten if it exists."
5239 #: ../src/guestfs-actions.pod:491
5240 msgid "guestfs_aug_rm"
5244 #: ../src/guestfs-actions.pod:493
5248 " guestfs_aug_rm (guestfs_h *g,\n"
5249 " const char *augpath);\n"
5254 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:321
5255 msgid "Remove C<path> and all of its children."
5259 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:323
5260 msgid "On success this returns the number of entries which were removed."
5264 #: ../src/guestfs-actions.pod:505
5265 msgid "guestfs_aug_save"
5269 #: ../src/guestfs-actions.pod:507
5273 " guestfs_aug_save (guestfs_h *g);\n"
5278 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:329
5279 msgid "This writes all pending changes to disk."
5283 #: ../src/guestfs-actions.pod:512
5285 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5290 #: ../src/guestfs-actions.pod:519
5291 msgid "guestfs_aug_set"
5295 #: ../src/guestfs-actions.pod:521
5299 " guestfs_aug_set (guestfs_h *g,\n"
5300 " const char *augpath,\n"
5301 " const char *val);\n"
5306 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:338
5307 msgid "Set the value associated with C<path> to C<val>."
5311 #: ../src/guestfs-actions.pod:528
5313 "In the Augeas API, it is possible to clear a node by setting the value to "
5314 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5315 "this call. Instead you must use the C<guestfs_aug_clear> call."
5319 #: ../src/guestfs-actions.pod:537
5320 msgid "guestfs_available"
5324 #: ../src/guestfs-actions.pod:539
5328 " guestfs_available (guestfs_h *g,\n"
5329 " char *const *groups);\n"
5334 #: ../src/guestfs-actions.pod:543 ../fish/guestfish-actions.pod:349
5336 "This command is used to check the availability of some groups of "
5337 "functionality in the appliance, which not all builds of the libguestfs "
5338 "appliance will be able to provide."
5342 #: ../src/guestfs-actions.pod:547
5344 "The libguestfs groups, and the functions that those groups correspond to, "
5345 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5346 "runtime by calling C<guestfs_available_all_groups>."
5350 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:358
5352 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5353 "\"]> would check for the availability of the Linux inotify functions and "
5354 "Augeas (configuration file editing) functions."
5358 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:363
5359 msgid "The command returns no error if I<all> requested groups are available."
5363 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:365
5365 "It fails with an error if one or more of the requested groups is unavailable "
5370 #: ../src/guestfs-actions.pod:562 ../fish/guestfish-actions.pod:368
5372 "If an unknown group name is included in the list of groups then an error is "
5377 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:371
5382 #: ../src/guestfs-actions.pod:571
5383 msgid "You must call C<guestfs_launch> before calling this function."
5387 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:379
5389 "The reason is because we don't know what groups are supported by the "
5390 "appliance/daemon until it is running and can be queried."
5394 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:385
5396 "If a group of functions is available, this does not necessarily mean that "
5397 "they will work. You still have to check for errors when calling individual "
5398 "API functions even if they are available."
5402 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:392
5404 "It is usually the job of distro packagers to build complete functionality "
5405 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5406 "with all requirements satisfied, will support everything."
5410 #: ../src/guestfs-actions.pod:593
5412 "This call was added in version C<1.0.80>. In previous versions of "
5413 "libguestfs all you could do would be to speculatively execute a command to "
5414 "find out if the daemon implemented it. See also C<guestfs_version>."
5418 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:1163
5419 msgid "(Added in 1.0.80)"
5423 #: ../src/guestfs-actions.pod:604
5424 msgid "guestfs_available_all_groups"
5428 #: ../src/guestfs-actions.pod:606
5432 " guestfs_available_all_groups (guestfs_h *g);\n"
5437 #: ../src/guestfs-actions.pod:609
5439 "This command returns a list of all optional groups that this daemon knows "
5440 "about. Note this returns both supported and unsupported groups. To find "
5441 "out which ones the daemon can actually support you have to call "
5442 "C<guestfs_available> on each member of the returned list."
5446 #: ../src/guestfs-actions.pod:615
5447 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5451 #: ../src/guestfs-actions.pod:621
5452 msgid "(Added in 1.3.15)"
5456 #: ../src/guestfs-actions.pod:623
5457 msgid "guestfs_base64_in"
5461 #: ../src/guestfs-actions.pod:625
5465 " guestfs_base64_in (guestfs_h *g,\n"
5466 " const char *base64file,\n"
5467 " const char *filename);\n"
5472 #: ../src/guestfs-actions.pod:630 ../fish/guestfish-actions.pod:422
5474 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5478 #: ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649
5479 msgid "(Added in 1.3.5)"
5483 #: ../src/guestfs-actions.pod:637
5484 msgid "guestfs_base64_out"
5488 #: ../src/guestfs-actions.pod:639
5492 " guestfs_base64_out (guestfs_h *g,\n"
5493 " const char *filename,\n"
5494 " const char *base64file);\n"
5499 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:431
5501 "This command downloads the contents of C<filename>, writing it out to local "
5502 "file C<base64file> encoded as base64."
5506 #: ../src/guestfs-actions.pod:651
5507 msgid "guestfs_blockdev_flushbufs"
5511 #: ../src/guestfs-actions.pod:653
5515 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5516 " const char *device);\n"
5521 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:440
5523 "This tells the kernel to flush internal buffers associated with C<device>."
5527 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:677
5528 #: ../src/guestfs-actions.pod:692 ../src/guestfs-actions.pod:708
5529 #: ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:745
5530 #: ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:777
5531 #: ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805
5532 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5533 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5534 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5535 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5536 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5537 msgid "This uses the L<blockdev(8)> command."
5541 #: ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:681
5542 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:712
5543 #: ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749
5544 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
5545 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
5546 msgid "(Added in 0.9.3)"
5550 #: ../src/guestfs-actions.pod:666
5551 msgid "guestfs_blockdev_getbsz"
5555 #: ../src/guestfs-actions.pod:668
5559 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5560 " const char *device);\n"
5565 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:449
5566 msgid "This returns the block size of a device."
5570 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:774
5571 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5573 "(Note this is different from both I<size in blocks> and I<filesystem block "
5578 #: ../src/guestfs-actions.pod:683
5579 msgid "guestfs_blockdev_getro"
5583 #: ../src/guestfs-actions.pod:685
5587 " guestfs_blockdev_getro (guestfs_h *g,\n"
5588 " const char *device);\n"
5593 #: ../src/guestfs-actions.pod:689 ../fish/guestfish-actions.pod:460
5595 "Returns a boolean indicating if the block device is read-only (true if read-"
5596 "only, false if not)."
5600 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:1396
5601 #: ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1891
5602 #: ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1974
5603 #: ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2044
5604 #: ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2092
5605 #: ../src/guestfs-actions.pod:2877 ../src/guestfs-actions.pod:2891
5606 #: ../src/guestfs-actions.pod:2906 ../src/guestfs-actions.pod:2920
5607 #: ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:2951
5608 #: ../src/guestfs-actions.pod:2967 ../src/guestfs-actions.pod:2981
5609 #: ../src/guestfs-actions.pod:2994 ../src/guestfs-actions.pod:3008
5610 #: ../src/guestfs-actions.pod:3023 ../src/guestfs-actions.pod:3038
5611 #: ../src/guestfs-actions.pod:4452
5612 msgid "This function returns a C truth value on success or -1 on error."
5616 #: ../src/guestfs-actions.pod:698
5617 msgid "guestfs_blockdev_getsize64"
5621 #: ../src/guestfs-actions.pod:700
5625 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5626 " const char *device);\n"
5631 #: ../src/guestfs-actions.pod:704 ../fish/guestfish-actions.pod:469
5632 msgid "This returns the size of the device in bytes."
5636 #: ../src/guestfs-actions.pod:706
5637 msgid "See also C<guestfs_blockdev_getsz>."
5641 #: ../src/guestfs-actions.pod:714
5642 msgid "guestfs_blockdev_getss"
5646 #: ../src/guestfs-actions.pod:716
5650 " guestfs_blockdev_getss (guestfs_h *g,\n"
5651 " const char *device);\n"
5656 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:479
5658 "This returns the size of sectors on a block device. Usually 512, but can be "
5659 "larger for modern devices."
5663 #: ../src/guestfs-actions.pod:723
5665 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5670 #: ../src/guestfs-actions.pod:732
5671 msgid "guestfs_blockdev_getsz"
5675 #: ../src/guestfs-actions.pod:734
5679 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5680 " const char *device);\n"
5685 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:491
5687 "This returns the size of the device in units of 512-byte sectors (even if "
5688 "the sectorsize isn't 512 bytes ... weird)."
5692 #: ../src/guestfs-actions.pod:741
5694 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5695 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5699 #: ../src/guestfs-actions.pod:751
5700 msgid "guestfs_blockdev_rereadpt"
5704 #: ../src/guestfs-actions.pod:753
5708 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5709 " const char *device);\n"
5714 #: ../src/guestfs-actions.pod:757 ../fish/guestfish-actions.pod:504
5715 msgid "Reread the partition table on C<device>."
5719 #: ../src/guestfs-actions.pod:765
5720 msgid "guestfs_blockdev_setbsz"
5724 #: ../src/guestfs-actions.pod:767
5728 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5729 " const char *device,\n"
5730 " int blocksize);\n"
5735 #: ../src/guestfs-actions.pod:772 ../fish/guestfish-actions.pod:512
5736 msgid "This sets the block size of a device."
5740 #: ../src/guestfs-actions.pod:783
5741 msgid "guestfs_blockdev_setro"
5745 #: ../src/guestfs-actions.pod:785
5749 " guestfs_blockdev_setro (guestfs_h *g,\n"
5750 " const char *device);\n"
5755 #: ../src/guestfs-actions.pod:789 ../fish/guestfish-actions.pod:523
5756 msgid "Sets the block device named C<device> to read-only."
5760 #: ../src/guestfs-actions.pod:797
5761 msgid "guestfs_blockdev_setrw"
5765 #: ../src/guestfs-actions.pod:799
5769 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5770 " const char *device);\n"
5775 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:531
5776 msgid "Sets the block device named C<device> to read-write."
5780 #: ../src/guestfs-actions.pod:811
5781 msgid "guestfs_case_sensitive_path"
5785 #: ../src/guestfs-actions.pod:813
5789 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5790 " const char *path);\n"
5795 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:539
5797 "This can be used to resolve case insensitive paths on a filesystem which is "
5798 "case sensitive. The use case is to resolve paths which you have read from "
5799 "Windows configuration files or the Windows Registry, to the true path."
5803 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:544
5805 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5806 "(and probably others), which is that although the underlying filesystem is "
5807 "case-insensitive, the driver exports the filesystem to Linux as case-"
5812 #: ../src/guestfs-actions.pod:827 ../fish/guestfish-actions.pod:549
5814 "One consequence of this is that special directories such as C<c:\\windows> "
5815 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5816 "precise details of how they were created. In Windows itself this would not "
5821 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:555
5823 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5828 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:558
5830 "This function resolves the true case of each element in the path and returns "
5831 "the case-sensitive path."
5835 #: ../src/guestfs-actions.pod:839
5837 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5838 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5839 "how the directories were originally created under Windows)."
5843 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:566
5844 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5848 #: ../src/guestfs-actions.pod:847
5849 msgid "See also C<guestfs_realpath>."
5853 #: ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:6384
5854 msgid "(Added in 1.0.75)"
5858 #: ../src/guestfs-actions.pod:854
5863 #: ../src/guestfs-actions.pod:856
5867 " guestfs_cat (guestfs_h *g,\n"
5868 " const char *path);\n"
5873 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:4939
5874 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3271
5875 msgid "Return the contents of the file named C<path>."
5879 #: ../src/guestfs-actions.pod:862
5881 "Note that this function cannot correctly handle binary files (specifically, "
5882 "files containing C<\\0> character which is treated as end of string). For "
5883 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5884 "functions which have a more complex interface."
5888 #: ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:1049
5889 #: ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1360
5890 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1482
5891 #: ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1750
5892 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:2187
5893 #: ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:2254
5894 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:2300
5895 #: ../src/guestfs-actions.pod:4721 ../src/guestfs-actions.pod:4747
5896 #: ../src/guestfs-actions.pod:4878 ../src/guestfs-actions.pod:4904
5897 #: ../src/guestfs-actions.pod:4928 ../src/guestfs-actions.pod:5779
5898 #: ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:5980
5899 #: ../src/guestfs-actions.pod:6004 ../src/guestfs-actions.pod:6656
5900 #: ../src/guestfs-actions.pod:6682 ../src/guestfs-actions.pod:6708
5901 #: ../src/guestfs-actions.pod:6727 ../src/guestfs-actions.pod:6812
5902 #: ../src/guestfs-actions.pod:6831 ../src/guestfs-actions.pod:6877
5903 #: ../src/guestfs-actions.pod:6896 ../fish/guestfish-actions.pod:582
5904 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
5905 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
5906 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
5907 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462
5908 #: ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500
5909 #: ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525
5910 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3141
5911 #: ../fish/guestfish-actions.pod:3156 ../fish/guestfish-actions.pod:3232
5912 #: ../fish/guestfish-actions.pod:3249 ../fish/guestfish-actions.pod:3264
5913 #: ../fish/guestfish-actions.pod:3847 ../fish/guestfish-actions.pod:3893
5914 #: ../fish/guestfish-actions.pod:3978 ../fish/guestfish-actions.pod:3993
5915 #: ../fish/guestfish-actions.pod:4403 ../fish/guestfish-actions.pod:4421
5916 #: ../fish/guestfish-actions.pod:4438 ../fish/guestfish-actions.pod:4448
5917 #: ../fish/guestfish-actions.pod:4496 ../fish/guestfish-actions.pod:4506
5918 #: ../fish/guestfish-actions.pod:4535 ../fish/guestfish-actions.pod:4545
5920 "Because of the message protocol, there is a transfer limit of somewhere "
5921 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5925 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:3119
5926 #: ../src/guestfs-actions.pod:3181 ../src/guestfs-actions.pod:3198
5927 #: ../src/guestfs-actions.pod:3286 ../src/guestfs-actions.pod:3691
5928 #: ../src/guestfs-actions.pod:3705 ../src/guestfs-actions.pod:4827
5929 #: ../src/guestfs-actions.pod:4841 ../src/guestfs-actions.pod:6543
5930 #: ../src/guestfs-actions.pod:6557
5931 msgid "(Added in 0.4)"
5935 #: ../src/guestfs-actions.pod:875
5936 msgid "guestfs_checksum"
5940 #: ../src/guestfs-actions.pod:877
5944 " guestfs_checksum (guestfs_h *g,\n"
5945 " const char *csumtype,\n"
5946 " const char *path);\n"
5951 #: ../src/guestfs-actions.pod:882 ../fish/guestfish-actions.pod:589
5953 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5957 #: ../src/guestfs-actions.pod:885 ../fish/guestfish-actions.pod:592
5959 "The type of checksum to compute is given by the C<csumtype> parameter which "
5960 "must have one of the following values:"
5964 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:597
5969 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:599
5971 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5976 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:602
5981 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:604
5982 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5986 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:606
5991 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:608
5992 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5996 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:610
6001 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:612
6002 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6006 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:614
6011 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:616
6012 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6016 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:618
6021 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:620
6022 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6026 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:622
6031 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:624
6032 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6036 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:628
6037 msgid "The checksum is returned as a printable string."
6041 #: ../src/guestfs-actions.pod:923
6042 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6046 #: ../src/guestfs-actions.pod:925
6047 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6051 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:1238
6052 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2893
6053 #: ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:2983
6054 #: ../src/guestfs-actions.pod:3010 ../src/guestfs-actions.pod:6245
6055 msgid "(Added in 1.0.2)"
6059 #: ../src/guestfs-actions.pod:932
6060 msgid "guestfs_checksum_device"
6064 #: ../src/guestfs-actions.pod:934
6068 " guestfs_checksum_device (guestfs_h *g,\n"
6069 " const char *csumtype,\n"
6070 " const char *device);\n"
6075 #: ../src/guestfs-actions.pod:939
6077 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6078 "device named C<device>. For the types of checksums supported see the "
6079 "C<guestfs_checksum> command."
6083 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:4358
6084 #: ../src/guestfs-actions.pod:4417 ../src/guestfs-actions.pod:4454
6085 #: ../src/guestfs-actions.pod:4472 ../src/guestfs-actions.pod:4648
6086 #: ../src/guestfs-actions.pod:6159 ../src/guestfs-actions.pod:6173
6087 #: ../src/guestfs-actions.pod:6569
6088 msgid "(Added in 1.3.2)"
6092 #: ../src/guestfs-actions.pod:948
6093 msgid "guestfs_checksums_out"
6097 #: ../src/guestfs-actions.pod:950
6101 " guestfs_checksums_out (guestfs_h *g,\n"
6102 " const char *csumtype,\n"
6103 " const char *directory,\n"
6104 " const char *sumsfile);\n"
6109 #: ../src/guestfs-actions.pod:956 ../fish/guestfish-actions.pod:646
6111 "This command computes the checksums of all regular files in C<directory> and "
6112 "then emits a list of those checksums to the local output file C<sumsfile>."
6116 #: ../src/guestfs-actions.pod:960 ../fish/guestfish-actions.pod:650
6118 "This can be used for verifying the integrity of a virtual machine. However "
6119 "to be properly secure you should pay attention to the output of the checksum "
6120 "command (it uses the ones from GNU coreutils). In particular when the "
6121 "filename is not printable, coreutils uses a special backslash syntax. For "
6122 "more information, see the GNU coreutils info file."
6126 #: ../src/guestfs-actions.pod:970
6127 msgid "(Added in 1.3.7)"
6131 #: ../src/guestfs-actions.pod:972
6132 msgid "guestfs_chmod"
6136 #: ../src/guestfs-actions.pod:974
6140 " guestfs_chmod (guestfs_h *g,\n"
6142 " const char *path);\n"
6147 #: ../src/guestfs-actions.pod:979 ../fish/guestfish-actions.pod:664
6149 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6154 #: ../src/guestfs-actions.pod:982 ../fish/guestfish-actions.pod:667
6156 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6157 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6162 #: ../src/guestfs-actions.pod:986 ../src/guestfs-actions.pod:3942
6163 #: ../src/guestfs-actions.pod:4057 ../src/guestfs-actions.pod:4076
6164 #: ../src/guestfs-actions.pod:4095 ../fish/guestfish-actions.pod:671
6165 #: ../fish/guestfish-actions.pod:2631 ../fish/guestfish-actions.pod:2716
6166 #: ../fish/guestfish-actions.pod:2726 ../fish/guestfish-actions.pod:2736
6167 msgid "The mode actually set is affected by the umask."
6171 #: ../src/guestfs-actions.pod:992
6172 msgid "guestfs_chown"
6176 #: ../src/guestfs-actions.pod:994
6180 " guestfs_chown (guestfs_h *g,\n"
6183 " const char *path);\n"
6188 #: ../src/guestfs-actions.pod:1000 ../fish/guestfish-actions.pod:677
6189 msgid "Change the file owner to C<owner> and group to C<group>."
6193 #: ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:3080
6194 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2109
6196 "Only numeric uid and gid are supported. If you want to use names, you will "
6197 "need to locate and parse the password file yourself (Augeas support makes "
6198 "this relatively easy)."
6202 #: ../src/guestfs-actions.pod:1010
6203 msgid "guestfs_command"
6207 #: ../src/guestfs-actions.pod:1012
6211 " guestfs_command (guestfs_h *g,\n"
6212 " char *const *arguments);\n"
6217 #: ../src/guestfs-actions.pod:1016 ../fish/guestfish-actions.pod:687
6219 "This call runs a command from the guest filesystem. The filesystem must be "
6220 "mounted, and must contain a compatible operating system (ie. something "
6221 "Linux, with the same or compatible processor architecture)."
6225 #: ../src/guestfs-actions.pod:1021
6227 "The single parameter is an argv-style list of arguments. The first element "
6228 "is the name of the program to run. Subsequent elements are parameters. The "
6229 "list must be non-empty (ie. must contain a program name). Note that the "
6230 "command runs directly, and is I<not> invoked via the shell (see "
6235 #: ../src/guestfs-actions.pod:1028 ../fish/guestfish-actions.pod:699
6236 msgid "The return value is anything printed to I<stdout> by the command."
6240 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:702
6242 "If the command returns a non-zero exit status, then this function returns an "
6243 "error message. The error message string is the content of I<stderr> from "
6248 #: ../src/guestfs-actions.pod:1035 ../fish/guestfish-actions.pod:706
6250 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6251 "bin>. If you require a program from another location, you should provide "
6252 "the full path in the first parameter."
6256 #: ../src/guestfs-actions.pod:1040 ../fish/guestfish-actions.pod:711
6258 "Shared libraries and data files required by the program must be available on "
6259 "filesystems which are mounted in the correct places. It is the caller's "
6260 "responsibility to ensure all filesystems that are needed are mounted at the "
6265 #: ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072
6266 #: ../src/guestfs-actions.pod:1535
6267 msgid "(Added in 0.9.1)"
6271 #: ../src/guestfs-actions.pod:1054
6272 msgid "guestfs_command_lines"
6276 #: ../src/guestfs-actions.pod:1056
6280 " guestfs_command_lines (guestfs_h *g,\n"
6281 " char *const *arguments);\n"
6286 #: ../src/guestfs-actions.pod:1060
6288 "This is the same as C<guestfs_command>, but splits the result into a list of "
6293 #: ../src/guestfs-actions.pod:1063
6294 msgid "See also: C<guestfs_sh_lines>"
6298 #: ../src/guestfs-actions.pod:1074
6299 msgid "guestfs_config"
6303 #: ../src/guestfs-actions.pod:1076
6307 " guestfs_config (guestfs_h *g,\n"
6308 " const char *qemuparam,\n"
6309 " const char *qemuvalue);\n"
6314 #: ../src/guestfs-actions.pod:1081 ../fish/guestfish-actions.pod:736
6316 "This can be used to add arbitrary qemu command line parameters of the form "
6317 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6318 "setting some parameters which would interfere with parameters that we use."
6322 #: ../src/guestfs-actions.pod:1086 ../fish/guestfish-actions.pod:741
6323 msgid "The first character of C<param> string must be a C<-> (dash)."
6327 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:743
6328 msgid "C<value> can be NULL."
6332 #: ../src/guestfs-actions.pod:1094
6333 msgid "guestfs_copy_size"
6337 #: ../src/guestfs-actions.pod:1096
6341 " guestfs_copy_size (guestfs_h *g,\n"
6342 " const char *src,\n"
6343 " const char *dest,\n"
6349 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:749
6351 "This command copies exactly C<size> bytes from one source device or file "
6352 "C<src> to another destination device or file C<dest>."
6356 #: ../src/guestfs-actions.pod:1105 ../fish/guestfish-actions.pod:752
6358 "Note this will fail if the source is too short or if the destination is not "
6363 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1233
6364 #: ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1684
6365 #: ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:6748
6366 #: ../src/guestfs-actions.pod:6767
6368 "This long-running command can generate progress notification messages so "
6369 "that the caller can display a progress bar or indicator. To receive these "
6370 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6371 "guestfs_set_progress_callback>."
6375 #: ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:3718
6376 #: ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:6476
6377 #: ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:6582
6378 msgid "(Added in 1.0.87)"
6382 #: ../src/guestfs-actions.pod:1117
6387 #: ../src/guestfs-actions.pod:1119
6391 " guestfs_cp (guestfs_h *g,\n"
6392 " const char *src,\n"
6393 " const char *dest);\n"
6398 #: ../src/guestfs-actions.pod:1124 ../fish/guestfish-actions.pod:759
6400 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6401 "destination filename or destination directory."
6405 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143
6406 #: ../src/guestfs-actions.pod:1215 ../src/guestfs-actions.pod:1289
6407 #: ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:4321
6408 #: ../src/guestfs-actions.pod:4698
6409 msgid "(Added in 1.0.18)"
6413 #: ../src/guestfs-actions.pod:1131
6414 msgid "guestfs_cp_a"
6418 #: ../src/guestfs-actions.pod:1133
6422 " guestfs_cp_a (guestfs_h *g,\n"
6423 " const char *src,\n"
6424 " const char *dest);\n"
6429 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:766
6431 "This copies a file or directory from C<src> to C<dest> recursively using the "
6436 #: ../src/guestfs-actions.pod:1145
6441 #: ../src/guestfs-actions.pod:1147
6445 " guestfs_dd (guestfs_h *g,\n"
6446 " const char *src,\n"
6447 " const char *dest);\n"
6452 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:773
6454 "This command copies from one source device or file C<src> to another "
6455 "destination device or file C<dest>. Normally you would use this to copy to "
6456 "or from a device or partition, for example to duplicate a filesystem."
6460 #: ../src/guestfs-actions.pod:1157
6462 "If the destination is a device, it must be as large or larger than the "
6463 "source file or device, otherwise the copy will fail. This command cannot do "
6464 "partial copies (see C<guestfs_copy_size>)."
6468 #: ../src/guestfs-actions.pod:1165
6473 #: ../src/guestfs-actions.pod:1167
6477 " guestfs_df (guestfs_h *g);\n"
6482 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:786
6483 msgid "This command runs the C<df> command to report disk space used."
6487 #: ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:1189
6488 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6490 "This command is mostly useful for interactive sessions. It is I<not> "
6491 "intended that you try to parse the output string. Use C<statvfs> from "
6496 #: ../src/guestfs-actions.pod:1179 ../src/guestfs-actions.pod:1196
6497 #: ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:2233
6498 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2325
6499 #: ../src/guestfs-actions.pod:3828 ../src/guestfs-actions.pod:4221
6500 #: ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6007
6501 #: ../src/guestfs-actions.pod:6615 ../src/guestfs-actions.pod:6628
6502 #: ../src/guestfs-actions.pod:6641
6503 msgid "(Added in 1.0.54)"
6507 #: ../src/guestfs-actions.pod:1181
6508 msgid "guestfs_df_h"
6512 #: ../src/guestfs-actions.pod:1183
6516 " guestfs_df_h (guestfs_h *g);\n"
6521 #: ../src/guestfs-actions.pod:1186 ../fish/guestfish-actions.pod:796
6523 "This command runs the C<df -h> command to report disk space used in human-"
6528 #: ../src/guestfs-actions.pod:1198
6529 msgid "guestfs_dmesg"
6533 #: ../src/guestfs-actions.pod:1200
6537 " guestfs_dmesg (guestfs_h *g);\n"
6542 #: ../src/guestfs-actions.pod:1203 ../fish/guestfish-actions.pod:807
6544 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6545 "This is sometimes useful for extended debugging of problems."
6549 #: ../src/guestfs-actions.pod:1207
6551 "Another way to get the same information is to enable verbose messages with "
6552 "C<guestfs_set_verbose> or by setting the environment variable "
6553 "C<LIBGUESTFS_DEBUG=1> before running the program."
6557 #: ../src/guestfs-actions.pod:1217
6558 msgid "guestfs_download"
6562 #: ../src/guestfs-actions.pod:1219
6566 " guestfs_download (guestfs_h *g,\n"
6567 " const char *remotefilename,\n"
6568 " const char *filename);\n"
6573 #: ../src/guestfs-actions.pod:1224 ../src/guestfs-actions.pod:1249
6574 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6576 "Download file C<remotefilename> and save it as C<filename> on the local "
6581 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:6239
6582 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4151
6583 msgid "C<filename> can also be a named pipe."
6587 #: ../src/guestfs-actions.pod:1229
6588 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6592 #: ../src/guestfs-actions.pod:1240
6593 msgid "guestfs_download_offset"
6597 #: ../src/guestfs-actions.pod:1242
6601 " guestfs_download_offset (guestfs_h *g,\n"
6602 " const char *remotefilename,\n"
6603 " const char *filename,\n"
6604 " int64_t offset,\n"
6610 #: ../src/guestfs-actions.pod:1252 ../fish/guestfish-actions.pod:836
6612 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6613 "region must be within the file or device)."
6617 #: ../src/guestfs-actions.pod:1255
6619 "Note that there is no limit on the amount of data that can be downloaded "
6620 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6621 "full amount unless an error occurs."
6625 #: ../src/guestfs-actions.pod:1260
6626 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6630 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:6274
6631 msgid "(Added in 1.5.17)"
6635 #: ../src/guestfs-actions.pod:1271
6636 msgid "guestfs_drop_caches"
6640 #: ../src/guestfs-actions.pod:1273
6644 " guestfs_drop_caches (guestfs_h *g,\n"
6645 " int whattodrop);\n"
6650 #: ../src/guestfs-actions.pod:1277 ../fish/guestfish-actions.pod:852
6652 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6653 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6654 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6658 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:857
6659 msgid "Setting C<whattodrop> to 3 should drop everything."
6663 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:859
6665 "This automatically calls L<sync(2)> before the operation, so that the "
6666 "maximum guest memory is freed."
6670 #: ../src/guestfs-actions.pod:1291
6675 #: ../src/guestfs-actions.pod:1293
6679 " guestfs_du (guestfs_h *g,\n"
6680 " const char *path);\n"
6685 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:866
6687 "This command runs the C<du -s> command to estimate file space usage for "
6692 #: ../src/guestfs-actions.pod:1300 ../fish/guestfish-actions.pod:869
6694 "C<path> can be a file or a directory. If C<path> is a directory then the "
6695 "estimate includes the contents of the directory and all subdirectories "
6700 #: ../src/guestfs-actions.pod:1304 ../fish/guestfish-actions.pod:873
6702 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6706 #: ../src/guestfs-actions.pod:1311
6707 msgid "guestfs_e2fsck_f"
6711 #: ../src/guestfs-actions.pod:1313
6715 " guestfs_e2fsck_f (guestfs_h *g,\n"
6716 " const char *device);\n"
6721 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:880
6723 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6724 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6729 #: ../src/guestfs-actions.pod:1321
6731 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6732 "Normally you should use C<guestfs_fsck>."
6736 #: ../src/guestfs-actions.pod:1326
6737 msgid "(Added in 1.0.29)"
6741 #: ../src/guestfs-actions.pod:1328
6742 msgid "guestfs_echo_daemon"
6746 #: ../src/guestfs-actions.pod:1330
6750 " guestfs_echo_daemon (guestfs_h *g,\n"
6751 " char *const *words);\n"
6756 #: ../src/guestfs-actions.pod:1334 ../fish/guestfish-actions.pod:891
6758 "This command concatenates the list of C<words> passed with single spaces "
6759 "between them and returns the resulting string."
6763 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:894
6764 msgid "You can use this command to test the connection through to the daemon."
6768 #: ../src/guestfs-actions.pod:1339
6769 msgid "See also C<guestfs_ping_daemon>."
6773 #: ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:2071
6774 #: ../src/guestfs-actions.pod:5487
6775 msgid "(Added in 1.0.69)"
6779 #: ../src/guestfs-actions.pod:1346
6780 msgid "guestfs_egrep"
6784 #: ../src/guestfs-actions.pod:1348
6788 " guestfs_egrep (guestfs_h *g,\n"
6789 " const char *regex,\n"
6790 " const char *path);\n"
6795 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:902
6797 "This calls the external C<egrep> program and returns the matching lines."
6801 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1382
6802 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1485
6803 #: ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:2171
6804 #: ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:2346
6805 #: ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2374
6806 #: ../src/guestfs-actions.pod:2420 ../src/guestfs-actions.pod:2442
6807 #: ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3211
6808 #: ../src/guestfs-actions.pod:3225 ../src/guestfs-actions.pod:3238
6809 #: ../src/guestfs-actions.pod:3252 ../src/guestfs-actions.pod:4156
6810 #: ../src/guestfs-actions.pod:5032 ../src/guestfs-actions.pod:5081
6811 #: ../src/guestfs-actions.pod:5851 ../src/guestfs-actions.pod:5863
6812 #: ../src/guestfs-actions.pod:5876 ../src/guestfs-actions.pod:5889
6813 #: ../src/guestfs-actions.pod:5911 ../src/guestfs-actions.pod:5924
6814 #: ../src/guestfs-actions.pod:5937 ../src/guestfs-actions.pod:5950
6815 #: ../src/guestfs-actions.pod:6711 ../src/guestfs-actions.pod:6730
6816 #: ../src/guestfs-actions.pod:6815 ../src/guestfs-actions.pod:6834
6817 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6899
6818 msgid "(Added in 1.0.66)"
6822 #: ../src/guestfs-actions.pod:1365
6823 msgid "guestfs_egrepi"
6827 #: ../src/guestfs-actions.pod:1367
6831 " guestfs_egrepi (guestfs_h *g,\n"
6832 " const char *regex,\n"
6833 " const char *path);\n"
6838 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:912
6840 "This calls the external C<egrep -i> program and returns the matching lines."
6844 #: ../src/guestfs-actions.pod:1384
6845 msgid "guestfs_equal"
6849 #: ../src/guestfs-actions.pod:1386
6853 " guestfs_equal (guestfs_h *g,\n"
6854 " const char *file1,\n"
6855 " const char *file2);\n"
6860 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:922
6862 "This compares the two files C<file1> and C<file2> and returns true if their "
6863 "content is exactly equal, or false otherwise."
6867 #: ../src/guestfs-actions.pod:1394 ../fish/guestfish-actions.pod:925
6868 msgid "The external L<cmp(1)> program is used for the comparison."
6872 #: ../src/guestfs-actions.pod:1400
6873 msgid "guestfs_exists"
6877 #: ../src/guestfs-actions.pod:1402
6881 " guestfs_exists (guestfs_h *g,\n"
6882 " const char *path);\n"
6887 #: ../src/guestfs-actions.pod:1406 ../fish/guestfish-actions.pod:931
6889 "This returns C<true> if and only if there is a file, directory (or anything) "
6890 "with the given C<path> name."
6894 #: ../src/guestfs-actions.pod:1409
6895 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6899 #: ../src/guestfs-actions.pod:1415
6900 msgid "guestfs_fallocate"
6904 #: ../src/guestfs-actions.pod:1417
6908 " guestfs_fallocate (guestfs_h *g,\n"
6909 " const char *path,\n"
6915 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1448
6916 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6918 "This command preallocates a file (containing zero bytes) named C<path> of "
6919 "size C<len> bytes. If the file exists already, it is overwritten."
6923 #: ../src/guestfs-actions.pod:1426 ../fish/guestfish-actions.pod:944
6925 "Do not confuse this with the guestfish-specific C<alloc> command which "
6926 "allocates a file in the host and attaches it as a device."
6930 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:948
6932 "This function is deprecated. In new code, use the C<fallocate64> call "
6937 #: ../src/guestfs-actions.pod:1441
6938 msgid "guestfs_fallocate64"
6942 #: ../src/guestfs-actions.pod:1443
6946 " guestfs_fallocate64 (guestfs_h *g,\n"
6947 " const char *path,\n"
6953 #: ../src/guestfs-actions.pod:1452
6955 "Note that this call allocates disk blocks for the file. To create a sparse "
6956 "file use C<guestfs_truncate_size> instead."
6960 #: ../src/guestfs-actions.pod:1455
6962 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6963 "oversight it only allowed 30 bit lengths to be specified, effectively "
6964 "limiting the maximum size of files created through that call to 1GB."
6968 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:971
6970 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6971 "commands which create a file in the host and attach it as a device."
6975 #: ../src/guestfs-actions.pod:1466
6976 msgid "(Added in 1.3.17)"
6980 #: ../src/guestfs-actions.pod:1468
6981 msgid "guestfs_fgrep"
6985 #: ../src/guestfs-actions.pod:1470
6989 " guestfs_fgrep (guestfs_h *g,\n"
6990 " const char *pattern,\n"
6991 " const char *path);\n"
6996 #: ../src/guestfs-actions.pod:1475 ../fish/guestfish-actions.pod:979
6998 "This calls the external C<fgrep> program and returns the matching lines."
7002 #: ../src/guestfs-actions.pod:1487
7003 msgid "guestfs_fgrepi"
7007 #: ../src/guestfs-actions.pod:1489
7011 " guestfs_fgrepi (guestfs_h *g,\n"
7012 " const char *pattern,\n"
7013 " const char *path);\n"
7018 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:989
7020 "This calls the external C<fgrep -i> program and returns the matching lines."
7024 #: ../src/guestfs-actions.pod:1506
7025 msgid "guestfs_file"
7029 #: ../src/guestfs-actions.pod:1508
7033 " guestfs_file (guestfs_h *g,\n"
7034 " const char *path);\n"
7039 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:999
7041 "This call uses the standard L<file(1)> command to determine the type or "
7042 "contents of the file."
7046 #: ../src/guestfs-actions.pod:1515 ../fish/guestfish-actions.pod:1002
7048 "This call will also transparently look inside various types of compressed "
7053 #: ../src/guestfs-actions.pod:1518 ../fish/guestfish-actions.pod:1005
7055 "The exact command which runs is C<file -zb path>. Note in particular that "
7056 "the filename is not prepended to the output (the C<-b> option)."
7060 #: ../src/guestfs-actions.pod:1522
7062 "This command can also be used on C</dev/> devices (and partitions, LV "
7063 "names). You can for example use this to determine if a device contains a "
7064 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7068 #: ../src/guestfs-actions.pod:1527 ../fish/guestfish-actions.pod:1014
7070 "If the C<path> does not begin with C</dev/> then this command only works for "
7071 "the content of regular files. For other file types (directory, symbolic "
7072 "link etc) it will just return the string C<directory> etc."
7076 #: ../src/guestfs-actions.pod:1537
7077 msgid "guestfs_file_architecture"
7081 #: ../src/guestfs-actions.pod:1539
7085 " guestfs_file_architecture (guestfs_h *g,\n"
7086 " const char *filename);\n"
7091 #: ../src/guestfs-actions.pod:1543 ../fish/guestfish-actions.pod:1023
7093 "This detects the architecture of the binary C<filename>, and returns it if "
7098 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1026
7099 msgid "Currently defined architectures are:"
7103 #: ../src/guestfs-actions.pod:1550 ../fish/guestfish-actions.pod:1030
7108 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1032
7110 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7111 "irrespective of the precise processor requirements of the binary."
7115 #: ../src/guestfs-actions.pod:1555 ../fish/guestfish-actions.pod:1035
7120 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1037
7121 msgid "64 bit x86-64."
7125 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1039
7130 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1041
7131 msgid "32 bit SPARC."
7135 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1043
7140 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1045
7141 msgid "64 bit SPARC V9 and above."
7145 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1047
7150 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1049
7151 msgid "Intel Itanium."
7155 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1051
7160 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1053
7161 msgid "32 bit Power PC."
7165 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1055
7170 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1057
7171 msgid "64 bit Power PC."
7175 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1061
7176 msgid "Libguestfs may return other architecture strings in future."
7180 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1063
7181 msgid "The function works on at least the following types of files:"
7185 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1069
7186 msgid "many types of Un*x and Linux binary"
7190 #: ../src/guestfs-actions.pod:1593 ../fish/guestfish-actions.pod:1073
7191 msgid "many types of Un*x and Linux shared library"
7195 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1077
7196 msgid "Windows Win32 and Win64 binaries"
7200 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1081
7201 msgid "Windows Win32 and Win64 DLLs"
7205 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1083
7206 msgid "Win32 binaries and DLLs return C<i386>."
7210 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1085
7211 msgid "Win64 binaries and DLLs return C<x86_64>."
7215 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1089
7216 msgid "Linux kernel modules"
7220 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1093
7221 msgid "Linux new-style initrd images"
7225 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1097
7226 msgid "some non-x86 Linux vmlinuz kernels"
7230 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1101
7231 msgid "What it can't do currently:"
7235 #: ../src/guestfs-actions.pod:1627 ../fish/guestfish-actions.pod:1107
7236 msgid "static libraries (libfoo.a)"
7240 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1111
7241 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7245 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1115
7246 msgid "x86 Linux vmlinuz kernels"
7250 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1117
7252 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7253 "compressed code, and are horribly hard to unpack. If you want to find the "
7254 "architecture of a kernel, use the architecture of the associated initrd or "
7255 "kernel module(s) instead."
7259 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1810
7260 #: ../src/guestfs-actions.pod:1827 ../src/guestfs-actions.pod:2478
7261 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2577
7262 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2625
7263 #: ../src/guestfs-actions.pod:2658 ../src/guestfs-actions.pod:2738
7264 #: ../src/guestfs-actions.pod:2798 ../src/guestfs-actions.pod:2864
7265 #: ../src/guestfs-actions.pod:2996
7266 msgid "(Added in 1.5.3)"
7270 #: ../src/guestfs-actions.pod:1649
7271 msgid "guestfs_filesize"
7275 #: ../src/guestfs-actions.pod:1651
7279 " guestfs_filesize (guestfs_h *g,\n"
7280 " const char *file);\n"
7285 #: ../src/guestfs-actions.pod:1655 ../fish/guestfish-actions.pod:1128
7286 msgid "This command returns the size of C<file> in bytes."
7290 #: ../src/guestfs-actions.pod:1657
7292 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7293 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7294 "devices, use C<guestfs_blockdev_getsize64>."
7298 #: ../src/guestfs-actions.pod:1663
7299 msgid "(Added in 1.0.82)"
7303 #: ../src/guestfs-actions.pod:1665
7304 msgid "guestfs_fill"
7308 #: ../src/guestfs-actions.pod:1667
7312 " guestfs_fill (guestfs_h *g,\n"
7315 " const char *path);\n"
7320 #: ../src/guestfs-actions.pod:1673 ../fish/guestfish-actions.pod:1138
7322 "This command creates a new file called C<path>. The initial content of the "
7323 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7328 #: ../src/guestfs-actions.pod:1677
7330 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7331 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7332 "bytes use C<guestfs_fill_pattern>."
7336 #: ../src/guestfs-actions.pod:1689
7337 msgid "(Added in 1.0.79)"
7341 #: ../src/guestfs-actions.pod:1691
7342 msgid "guestfs_fill_pattern"
7346 #: ../src/guestfs-actions.pod:1693
7350 " guestfs_fill_pattern (guestfs_h *g,\n"
7351 " const char *pattern,\n"
7353 " const char *path);\n"
7358 #: ../src/guestfs-actions.pod:1699
7360 "This function is like C<guestfs_fill> except that it creates a new file of "
7361 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7362 "pattern is truncated if necessary to ensure the length of the file is "
7363 "exactly C<len> bytes."
7367 #: ../src/guestfs-actions.pod:1711
7368 msgid "(Added in 1.3.12)"
7372 #: ../src/guestfs-actions.pod:1713
7373 msgid "guestfs_find"
7377 #: ../src/guestfs-actions.pod:1715
7381 " guestfs_find (guestfs_h *g,\n"
7382 " const char *directory);\n"
7387 #: ../src/guestfs-actions.pod:1719 ../fish/guestfish-actions.pod:1160
7389 "This command lists out all files and directories, recursively, starting at "
7390 "C<directory>. It is essentially equivalent to running the shell command "
7391 "C<find directory -print> but some post-processing happens on the output, "
7396 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1165
7398 "This returns a list of strings I<without any prefix>. Thus if the directory "
7403 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1168
7413 #: ../src/guestfs-actions.pod:1731
7415 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7419 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1175
7430 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1180
7431 msgid "If C<directory> is not a directory, then this command returns an error."
7435 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1183
7436 msgid "The returned list is sorted."
7440 #: ../src/guestfs-actions.pod:1744
7441 msgid "See also C<guestfs_find0>."
7445 #: ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:3655
7446 #: ../src/guestfs-actions.pod:5116
7447 msgid "(Added in 1.0.27)"
7451 #: ../src/guestfs-actions.pod:1755
7452 msgid "guestfs_find0"
7456 #: ../src/guestfs-actions.pod:1757
7460 " guestfs_find0 (guestfs_h *g,\n"
7461 " const char *directory,\n"
7462 " const char *files);\n"
7467 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1194
7469 "This command lists out all files and directories, recursively, starting at "
7470 "C<directory>, placing the resulting list in the external file called "
7475 #: ../src/guestfs-actions.pod:1766
7477 "This command works the same way as C<guestfs_find> with the following "
7482 #: ../src/guestfs-actions.pod:1773 ../fish/guestfish-actions.pod:1205
7483 msgid "The resulting list is written to an external file."
7487 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1209
7489 "Items (filenames) in the result are separated by C<\\0> characters. See "
7490 "L<find(1)> option I<-print0>."
7494 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1214
7495 msgid "This command is not limited in the number of names that it can return."
7499 #: ../src/guestfs-actions.pod:1787 ../fish/guestfish-actions.pod:1219
7500 msgid "The result list is not sorted."
7504 #: ../src/guestfs-actions.pod:1793
7505 msgid "(Added in 1.0.74)"
7509 #: ../src/guestfs-actions.pod:1795
7510 msgid "guestfs_findfs_label"
7514 #: ../src/guestfs-actions.pod:1797
7518 " guestfs_findfs_label (guestfs_h *g,\n"
7519 " const char *label);\n"
7524 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1229
7526 "This command searches the filesystems and returns the one which has the "
7527 "given label. An error is returned if no such filesystem can be found."
7531 #: ../src/guestfs-actions.pod:1805
7532 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7536 #: ../src/guestfs-actions.pod:1812
7537 msgid "guestfs_findfs_uuid"
7541 #: ../src/guestfs-actions.pod:1814
7545 " guestfs_findfs_uuid (guestfs_h *g,\n"
7546 " const char *uuid);\n"
7551 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1239
7553 "This command searches the filesystems and returns the one which has the "
7554 "given UUID. An error is returned if no such filesystem can be found."
7558 #: ../src/guestfs-actions.pod:1822
7559 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7563 #: ../src/guestfs-actions.pod:1829
7564 msgid "guestfs_fsck"
7568 #: ../src/guestfs-actions.pod:1831
7572 " guestfs_fsck (guestfs_h *g,\n"
7573 " const char *fstype,\n"
7574 " const char *device);\n"
7579 #: ../src/guestfs-actions.pod:1836 ../fish/guestfish-actions.pod:1249
7581 "This runs the filesystem checker (fsck) on C<device> which should have "
7582 "filesystem type C<fstype>."
7586 #: ../src/guestfs-actions.pod:1839 ../fish/guestfish-actions.pod:1252
7588 "The returned integer is the status. See L<fsck(8)> for the list of status "
7589 "codes from C<fsck>."
7593 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1261
7594 msgid "Multiple status codes can be summed together."
7598 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1265
7600 "A non-zero return code can mean \"success\", for example if errors have been "
7601 "corrected on the filesystem."
7605 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1270
7606 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7610 #: ../src/guestfs-actions.pod:1862 ../fish/guestfish-actions.pod:1275
7612 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7616 #: ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:6753
7617 msgid "(Added in 1.0.16)"
7621 #: ../src/guestfs-actions.pod:1868
7622 msgid "guestfs_get_append"
7626 #: ../src/guestfs-actions.pod:1870
7630 " guestfs_get_append (guestfs_h *g);\n"
7635 #: ../src/guestfs-actions.pod:1873 ../fish/guestfish-actions.pod:1281
7637 "Return the additional kernel options which are added to the guest kernel "
7642 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1284
7643 msgid "If C<NULL> then no options are added."
7647 #: ../src/guestfs-actions.pod:1878
7649 "This function returns a string which may be NULL. There is no way to return "
7650 "an error from this function. The string is owned by the guest handle and "
7651 "must I<not> be freed."
7655 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:4794
7656 #: ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5625
7657 #: ../src/guestfs-actions.pod:5644 ../src/guestfs-actions.pod:5660
7658 #: ../src/guestfs-actions.pod:5677 ../src/guestfs-actions.pod:6424
7659 #: ../src/guestfs-actions.pod:6442 ../src/guestfs-actions.pod:6796
7660 msgid "(Added in 1.0.26)"
7664 #: ../src/guestfs-actions.pod:1884
7665 msgid "guestfs_get_autosync"
7669 #: ../src/guestfs-actions.pod:1886
7673 " guestfs_get_autosync (guestfs_h *g);\n"
7678 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1290
7679 msgid "Get the autosync flag."
7683 #: ../src/guestfs-actions.pod:1895
7684 msgid "guestfs_get_direct"
7688 #: ../src/guestfs-actions.pod:1897
7692 " guestfs_get_direct (guestfs_h *g);\n"
7697 #: ../src/guestfs-actions.pod:1900 ../fish/guestfish-actions.pod:1296
7698 msgid "Return the direct appliance mode flag."
7702 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:5298
7703 msgid "(Added in 1.0.72)"
7707 #: ../src/guestfs-actions.pod:1906
7708 msgid "guestfs_get_e2label"
7712 #: ../src/guestfs-actions.pod:1908
7716 " guestfs_get_e2label (guestfs_h *g,\n"
7717 " const char *device);\n"
7722 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1302
7724 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7728 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1305
7730 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7734 #: ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1946
7735 #: ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5335
7736 msgid "(Added in 1.0.15)"
7740 #: ../src/guestfs-actions.pod:1927
7741 msgid "guestfs_get_e2uuid"
7745 #: ../src/guestfs-actions.pod:1929
7749 " guestfs_get_e2uuid (guestfs_h *g,\n"
7750 " const char *device);\n"
7755 #: ../src/guestfs-actions.pod:1933 ../fish/guestfish-actions.pod:1316
7757 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7761 #: ../src/guestfs-actions.pod:1939 ../fish/guestfish-actions.pod:1319
7763 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7767 #: ../src/guestfs-actions.pod:1948
7768 msgid "guestfs_get_memsize"
7772 #: ../src/guestfs-actions.pod:1950
7776 " guestfs_get_memsize (guestfs_h *g);\n"
7781 #: ../src/guestfs-actions.pod:1953 ../fish/guestfish-actions.pod:1330
7783 "This gets the memory size in megabytes allocated to the qemu subprocess."
7787 #: ../src/guestfs-actions.pod:1956
7789 "If C<guestfs_set_memsize> was not called on this handle, and if "
7790 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7791 "value for memsize."
7795 #: ../src/guestfs-actions.pod:1960 ../src/guestfs-actions.pod:2041
7796 #: ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5458
7797 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7798 #: ../fish/guestfish-actions.pod:3558 ../fish/guestfish-actions.pod:3645
7800 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7804 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:3946
7805 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4080
7806 #: ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:4111
7807 #: ../src/guestfs-actions.pod:4128 ../src/guestfs-actions.pod:4141
7808 #: ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5356
7809 #: ../src/guestfs-actions.pod:5599 ../src/guestfs-actions.pod:6200
7810 msgid "(Added in 1.0.55)"
7814 #: ../src/guestfs-actions.pod:1967
7815 msgid "guestfs_get_network"
7819 #: ../src/guestfs-actions.pod:1969
7823 " guestfs_get_network (guestfs_h *g);\n"
7828 #: ../src/guestfs-actions.pod:1972 ../fish/guestfish-actions.pod:1344
7829 msgid "This returns the enable network flag."
7833 #: ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:5375
7834 msgid "(Added in 1.5.4)"
7838 #: ../src/guestfs-actions.pod:1978
7839 msgid "guestfs_get_path"
7843 #: ../src/guestfs-actions.pod:1980
7847 " guestfs_get_path (guestfs_h *g);\n"
7852 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1350
7853 msgid "Return the current search path."
7857 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1352
7859 "This is always non-NULL. If it wasn't set already, then this will return "
7864 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2017
7866 "This function returns a string, or NULL on error. The string is owned by "
7867 "the guest handle and must I<not> be freed."
7871 #: ../src/guestfs-actions.pod:1993
7872 msgid "guestfs_get_pid"
7876 #: ../src/guestfs-actions.pod:1995
7880 " guestfs_get_pid (guestfs_h *g);\n"
7885 #: ../src/guestfs-actions.pod:1998 ../fish/guestfish-actions.pod:1361
7887 "Return the process ID of the qemu subprocess. If there is no qemu "
7888 "subprocess, then this will return an error."
7892 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1364
7893 msgid "This is an internal call used for debugging and testing."
7897 #: ../src/guestfs-actions.pod:2005
7898 msgid "(Added in 1.0.56)"
7902 #: ../src/guestfs-actions.pod:2007
7903 msgid "guestfs_get_qemu"
7907 #: ../src/guestfs-actions.pod:2009
7911 " guestfs_get_qemu (guestfs_h *g);\n"
7916 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1370
7917 msgid "Return the current qemu binary."
7921 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1372
7923 "This is always non-NULL. If it wasn't set already, then this will return "
7924 "the default qemu binary name."
7928 #: ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:5420
7929 msgid "(Added in 1.0.6)"
7933 #: ../src/guestfs-actions.pod:2022
7934 msgid "guestfs_get_recovery_proc"
7938 #: ../src/guestfs-actions.pod:2024
7942 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7947 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1379
7948 msgid "Return the recovery process enabled flag."
7952 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:3086
7953 #: ../src/guestfs-actions.pod:3353 ../src/guestfs-actions.pod:3753
7954 #: ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:4724
7955 #: ../src/guestfs-actions.pod:5067 ../src/guestfs-actions.pod:5444
7956 #: ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6123
7957 #: ../src/guestfs-actions.pod:6305
7958 msgid "(Added in 1.0.77)"
7962 #: ../src/guestfs-actions.pod:2033
7963 msgid "guestfs_get_selinux"
7967 #: ../src/guestfs-actions.pod:2035
7971 " guestfs_get_selinux (guestfs_h *g);\n"
7976 #: ../src/guestfs-actions.pod:2038
7978 "This returns the current setting of the selinux flag which is passed to the "
7979 "appliance at boot time. See C<guestfs_set_selinux>."
7983 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2109
7984 #: ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5517
7985 msgid "(Added in 1.0.67)"
7989 #: ../src/guestfs-actions.pod:2048
7990 msgid "guestfs_get_state"
7994 #: ../src/guestfs-actions.pod:2050
7998 " guestfs_get_state (guestfs_h *g);\n"
8003 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1395
8005 "This returns the current state as an opaque integer. This is only useful "
8006 "for printing debug and internal error messages."
8010 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:2889
8011 #: ../src/guestfs-actions.pod:2918 ../src/guestfs-actions.pod:2979
8012 #: ../src/guestfs-actions.pod:3006 ../fish/guestfish-actions.pod:1398
8013 #: ../fish/guestfish-actions.pod:1991 ../fish/guestfish-actions.pod:2009
8014 #: ../fish/guestfish-actions.pod:2047 ../fish/guestfish-actions.pod:2063
8015 msgid "For more information on states, see L<guestfs(3)>."
8019 #: ../src/guestfs-actions.pod:2062
8020 msgid "guestfs_get_trace"
8024 #: ../src/guestfs-actions.pod:2064
8028 " guestfs_get_trace (guestfs_h *g);\n"
8033 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1404
8034 msgid "Return the command trace flag."
8038 #: ../src/guestfs-actions.pod:2073
8039 msgid "guestfs_get_umask"
8043 #: ../src/guestfs-actions.pod:2075
8047 " guestfs_get_umask (guestfs_h *g);\n"
8052 #: ../src/guestfs-actions.pod:2078
8054 "Return the current umask. By default the umask is C<022> unless it has been "
8055 "set by calling C<guestfs_umask>."
8059 #: ../src/guestfs-actions.pod:2085
8060 msgid "guestfs_get_verbose"
8064 #: ../src/guestfs-actions.pod:2087
8068 " guestfs_get_verbose (guestfs_h *g);\n"
8073 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1417
8074 msgid "This returns the verbose messages flag."
8078 #: ../src/guestfs-actions.pod:2096
8079 msgid "guestfs_getcon"
8083 #: ../src/guestfs-actions.pod:2098
8087 " guestfs_getcon (guestfs_h *g);\n"
8092 #: ../src/guestfs-actions.pod:2101 ../fish/guestfish-actions.pod:1423
8093 msgid "This gets the SELinux security context of the daemon."
8097 #: ../src/guestfs-actions.pod:2103
8099 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8103 #: ../src/guestfs-actions.pod:2111
8104 msgid "guestfs_getxattrs"
8108 #: ../src/guestfs-actions.pod:2113
8111 " struct guestfs_xattr_list *\n"
8112 " guestfs_getxattrs (guestfs_h *g,\n"
8113 " const char *path);\n"
8118 #: ../src/guestfs-actions.pod:2117 ../fish/guestfish-actions.pod:1432
8120 "This call lists the extended attributes of the file or directory C<path>."
8124 #: ../src/guestfs-actions.pod:2120 ../fish/guestfish-actions.pod:1435
8126 "At the system call level, this is a combination of the L<listxattr(2)> and "
8127 "L<getxattr(2)> calls."
8131 #: ../src/guestfs-actions.pod:2123
8132 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8136 #: ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:3098
8137 #: ../src/guestfs-actions.pod:3749
8139 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8140 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8144 #: ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:3102
8145 #: ../src/guestfs-actions.pod:3267 ../src/guestfs-actions.pod:3303
8146 #: ../src/guestfs-actions.pod:5097 ../src/guestfs-actions.pod:5536
8147 #: ../src/guestfs-actions.pod:6861
8148 msgid "(Added in 1.0.59)"
8152 #: ../src/guestfs-actions.pod:2131
8153 msgid "guestfs_glob_expand"
8157 #: ../src/guestfs-actions.pod:2133
8161 " guestfs_glob_expand (guestfs_h *g,\n"
8162 " const char *pattern);\n"
8167 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1444
8169 "This command searches for all the pathnames matching C<pattern> according to "
8170 "the wildcard expansion rules used by the shell."
8174 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1448
8176 "If no paths match, then this returns an empty list (note: not an error)."
8180 #: ../src/guestfs-actions.pod:2144 ../fish/guestfish-actions.pod:1451
8182 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8183 "GLOB_BRACE>. See that manual page for more details."
8187 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:5701
8188 #: ../src/guestfs-actions.pod:5718
8189 msgid "(Added in 1.0.50)"
8193 #: ../src/guestfs-actions.pod:2154
8194 msgid "guestfs_grep"
8198 #: ../src/guestfs-actions.pod:2156
8202 " guestfs_grep (guestfs_h *g,\n"
8203 " const char *regex,\n"
8204 " const char *path);\n"
8209 #: ../src/guestfs-actions.pod:2161 ../fish/guestfish-actions.pod:1459
8210 msgid "This calls the external C<grep> program and returns the matching lines."
8214 #: ../src/guestfs-actions.pod:2173
8215 msgid "guestfs_grepi"
8219 #: ../src/guestfs-actions.pod:2175
8223 " guestfs_grepi (guestfs_h *g,\n"
8224 " const char *regex,\n"
8225 " const char *path);\n"
8230 #: ../src/guestfs-actions.pod:2180 ../fish/guestfish-actions.pod:1469
8232 "This calls the external C<grep -i> program and returns the matching lines."
8236 #: ../src/guestfs-actions.pod:2192
8237 msgid "guestfs_grub_install"
8241 #: ../src/guestfs-actions.pod:2194
8245 " guestfs_grub_install (guestfs_h *g,\n"
8246 " const char *root,\n"
8247 " const char *device);\n"
8252 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1479
8254 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8255 "the root directory being C<root>."
8259 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1482
8261 "Note: If grub-install reports the error \"No suitable drive was found in the "
8262 "generated device map.\" it may be that you need to create a C</boot/grub/"
8263 "device.map> file first that contains the mapping between grub device names "
8264 "and Linux device names. It is usually sufficient to create a file "
8269 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1489
8277 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1491
8278 msgid "replacing C</dev/vda> with the name of the installation device."
8282 #: ../src/guestfs-actions.pod:2215
8283 msgid "(Added in 1.0.17)"
8287 #: ../src/guestfs-actions.pod:2217
8288 msgid "guestfs_head"
8292 #: ../src/guestfs-actions.pod:2219
8296 " guestfs_head (guestfs_h *g,\n"
8297 " const char *path);\n"
8302 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1497
8304 "This command returns up to the first 10 lines of a file as a list of strings."
8308 #: ../src/guestfs-actions.pod:2235
8309 msgid "guestfs_head_n"
8313 #: ../src/guestfs-actions.pod:2237
8317 " guestfs_head_n (guestfs_h *g,\n"
8319 " const char *path);\n"
8324 #: ../src/guestfs-actions.pod:2242 ../fish/guestfish-actions.pod:1507
8326 "If the parameter C<nrlines> is a positive number, this returns the first "
8327 "C<nrlines> lines of the file C<path>."
8331 #: ../src/guestfs-actions.pod:2245 ../fish/guestfish-actions.pod:1510
8333 "If the parameter C<nrlines> is a negative number, this returns lines from "
8334 "the file C<path>, excluding the last C<nrlines> lines."
8338 #: ../src/guestfs-actions.pod:2248 ../src/guestfs-actions.pod:5998
8339 #: ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:3991
8340 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8344 #: ../src/guestfs-actions.pod:2259
8345 msgid "guestfs_hexdump"
8349 #: ../src/guestfs-actions.pod:2261
8353 " guestfs_hexdump (guestfs_h *g,\n"
8354 " const char *path);\n"
8359 #: ../src/guestfs-actions.pod:2265 ../fish/guestfish-actions.pod:1522
8361 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8362 "readable, canonical hex dump of the file."
8366 #: ../src/guestfs-actions.pod:2274 ../src/guestfs-actions.pod:5782
8367 #: ../src/guestfs-actions.pod:5837
8368 msgid "(Added in 1.0.22)"
8372 #: ../src/guestfs-actions.pod:2276
8373 msgid "guestfs_initrd_cat"
8377 #: ../src/guestfs-actions.pod:2278
8381 " guestfs_initrd_cat (guestfs_h *g,\n"
8382 " const char *initrdpath,\n"
8383 " const char *filename,\n"
8384 " size_t *size_r);\n"
8389 #: ../src/guestfs-actions.pod:2284 ../fish/guestfish-actions.pod:1532
8391 "This command unpacks the file C<filename> from the initrd file called "
8392 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8397 #: ../src/guestfs-actions.pod:2288 ../fish/guestfish-actions.pod:1536
8399 "For example, in guestfish you could use the following command to examine the "
8400 "boot script (usually called C</init>) contained in a Linux initrd or "
8405 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1540
8408 " initrd-cat /boot/initrd-<version>.img init\n"
8413 #: ../src/guestfs-actions.pod:2294
8414 msgid "See also C<guestfs_initrd_list>."
8418 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:4717
8419 #: ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4924
8421 "This function returns a buffer, or NULL on error. The size of the returned "
8422 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8427 #: ../src/guestfs-actions.pod:2305
8428 msgid "guestfs_initrd_list"
8432 #: ../src/guestfs-actions.pod:2307
8436 " guestfs_initrd_list (guestfs_h *g,\n"
8437 " const char *path);\n"
8442 #: ../src/guestfs-actions.pod:2311 ../fish/guestfish-actions.pod:1551
8443 msgid "This command lists out files contained in an initrd."
8447 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1553
8449 "The files are listed without any initial C</> character. The files are "
8450 "listed in the order they appear (not necessarily alphabetical). Directory "
8451 "names are listed as separate items."
8455 #: ../src/guestfs-actions.pod:2317 ../fish/guestfish-actions.pod:1557
8457 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8458 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8463 #: ../src/guestfs-actions.pod:2327
8464 msgid "guestfs_inotify_add_watch"
8468 #: ../src/guestfs-actions.pod:2329
8472 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8473 " const char *path,\n"
8479 #: ../src/guestfs-actions.pod:2334 ../fish/guestfish-actions.pod:1565
8480 msgid "Watch C<path> for the events listed in C<mask>."
8484 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1567
8486 "Note that if C<path> is a directory then events within that directory are "
8487 "watched, but this does I<not> happen recursively (in subdirectories)."
8491 #: ../src/guestfs-actions.pod:2340 ../fish/guestfish-actions.pod:1571
8493 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8494 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8498 #: ../src/guestfs-actions.pod:2348
8499 msgid "guestfs_inotify_close"
8503 #: ../src/guestfs-actions.pod:2350
8507 " guestfs_inotify_close (guestfs_h *g);\n"
8512 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1579
8514 "This closes the inotify handle which was previously opened by inotify_init. "
8515 "It removes all watches, throws away any pending events, and deallocates all "
8520 #: ../src/guestfs-actions.pod:2361
8521 msgid "guestfs_inotify_files"
8525 #: ../src/guestfs-actions.pod:2363
8529 " guestfs_inotify_files (guestfs_h *g);\n"
8534 #: ../src/guestfs-actions.pod:2366
8536 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8537 "returns a list of pathnames of objects that were touched. The returned "
8538 "pathnames are sorted and deduplicated."
8542 #: ../src/guestfs-actions.pod:2376
8543 msgid "guestfs_inotify_init"
8547 #: ../src/guestfs-actions.pod:2378
8551 " guestfs_inotify_init (guestfs_h *g,\n"
8552 " int maxevents);\n"
8557 #: ../src/guestfs-actions.pod:2382 ../fish/guestfish-actions.pod:1595
8559 "This command creates a new inotify handle. The inotify subsystem can be "
8560 "used to notify events which happen to objects in the guest filesystem."
8564 #: ../src/guestfs-actions.pod:2386
8566 "C<maxevents> is the maximum number of events which will be queued up between "
8567 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8568 "passed as C<0>, then the kernel (or previously set) default is used. For "
8569 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8570 "throws away events, but records the fact that it threw them away by setting "
8571 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8572 "C<guestfs_inotify_read>)."
8576 #: ../src/guestfs-actions.pod:2396
8578 "Before any events are generated, you have to add some watches to the "
8579 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8580 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8584 #: ../src/guestfs-actions.pod:2402
8586 "Queued up events should be read periodically by calling "
8587 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8588 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8589 "often enough then you risk the internal queue overflowing."
8593 #: ../src/guestfs-actions.pod:2409
8595 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8596 "This also removes any watches automatically."
8600 #: ../src/guestfs-actions.pod:2413 ../fish/guestfish-actions.pod:1626
8602 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8603 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8604 "that there is one global inotify handle per libguestfs instance."
8608 #: ../src/guestfs-actions.pod:2422
8609 msgid "guestfs_inotify_read"
8613 #: ../src/guestfs-actions.pod:2424
8616 " struct guestfs_inotify_event_list *\n"
8617 " guestfs_inotify_read (guestfs_h *g);\n"
8622 #: ../src/guestfs-actions.pod:2427 ../fish/guestfish-actions.pod:1635
8624 "Return the complete queue of events that have happened since the previous "
8629 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1638
8630 msgid "If no events have happened, this returns an empty list."
8634 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1640
8636 "I<Note>: In order to make sure that all events have been read, you must call "
8637 "this function repeatedly until it returns an empty list. The reason is that "
8638 "the call will read events up to the maximum appliance-to-host message size "
8639 "and leave remaining events in the queue."
8643 #: ../src/guestfs-actions.pod:2438
8645 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8646 "there was an error. I<The caller must call "
8647 "C<guestfs_free_inotify_event_list> after use>."
8651 #: ../src/guestfs-actions.pod:2444
8652 msgid "guestfs_inotify_rm_watch"
8656 #: ../src/guestfs-actions.pod:2446
8660 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8666 #: ../src/guestfs-actions.pod:2450
8668 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8672 #: ../src/guestfs-actions.pod:2457
8673 msgid "guestfs_inspect_get_arch"
8677 #: ../src/guestfs-actions.pod:2459
8681 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8682 " const char *root);\n"
8687 #: ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:2486
8688 #: ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2585
8689 #: ../src/guestfs-actions.pod:2612 ../src/guestfs-actions.pod:2633
8690 #: ../src/guestfs-actions.pod:2666 ../src/guestfs-actions.pod:2693
8691 #: ../src/guestfs-actions.pod:2722 ../src/guestfs-actions.pod:2764
8692 #: ../src/guestfs-actions.pod:2806
8694 "This function should only be called with a root device string as returned by "
8695 "C<guestfs_inspect_os>."
8699 #: ../src/guestfs-actions.pod:2466
8701 "This returns the architecture of the inspected operating system. The "
8702 "possible return values are listed under C<guestfs_file_architecture>."
8706 #: ../src/guestfs-actions.pod:2470 ../fish/guestfish-actions.pod:1664
8708 "If the architecture could not be determined, then the string C<unknown> is "
8713 #: ../src/guestfs-actions.pod:2473 ../src/guestfs-actions.pod:2546
8714 #: ../src/guestfs-actions.pod:2600 ../src/guestfs-actions.pod:2682
8715 #: ../src/guestfs-actions.pod:2711 ../src/guestfs-actions.pod:2733
8716 #: ../src/guestfs-actions.pod:2752 ../src/guestfs-actions.pod:2793
8717 #: ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2856
8718 #: ../fish/guestfish-actions.pod:1667 ../fish/guestfish-actions.pod:1733
8719 #: ../fish/guestfish-actions.pod:1772 ../fish/guestfish-actions.pod:1832
8720 #: ../fish/guestfish-actions.pod:1856 ../fish/guestfish-actions.pod:1873
8721 #: ../fish/guestfish-actions.pod:1886 ../fish/guestfish-actions.pod:1921
8722 #: ../fish/guestfish-actions.pod:1937 ../fish/guestfish-actions.pod:1971
8723 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8727 #: ../src/guestfs-actions.pod:2480
8728 msgid "guestfs_inspect_get_distro"
8732 #: ../src/guestfs-actions.pod:2482
8736 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8737 " const char *root);\n"
8742 #: ../src/guestfs-actions.pod:2489 ../fish/guestfish-actions.pod:1676
8744 "This returns the distro (distribution) of the inspected operating system."
8748 #: ../src/guestfs-actions.pod:2492 ../fish/guestfish-actions.pod:1679
8749 msgid "Currently defined distros are:"
8753 #: ../src/guestfs-actions.pod:2496 ../fish/guestfish-actions.pod:1683
8754 msgid "\"archlinux\""
8758 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1685
8763 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1687
8768 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1689
8769 msgid "Debian or a Debian-derived distro such as Ubuntu."
8773 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1691
8778 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1693
8783 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1695
8788 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1697
8793 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1699
8798 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1701
8803 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1703
8808 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1705
8813 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1707
8814 msgid "\"redhat-based\""
8818 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1709
8819 msgid "Some Red Hat-derived distro."
8823 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1711
8828 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1713
8829 msgid "Red Hat Enterprise Linux and some derivatives."
8833 #: ../src/guestfs-actions.pod:2528 ../src/guestfs-actions.pod:2776
8834 #: ../fish/guestfish-actions.pod:1715 ../fish/guestfish-actions.pod:1904
8839 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1717
8841 "Windows does not have distributions. This string is returned if the OS type "
8846 #: ../src/guestfs-actions.pod:2533 ../fish/guestfish-actions.pod:1720
8851 #: ../src/guestfs-actions.pod:2535 ../fish/guestfish-actions.pod:1722
8856 #: ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2784
8857 #: ../fish/guestfish-actions.pod:1724 ../fish/guestfish-actions.pod:1912
8862 #: ../src/guestfs-actions.pod:2539 ../fish/guestfish-actions.pod:1726
8863 msgid "The distro could not be determined."
8867 #: ../src/guestfs-actions.pod:2543 ../src/guestfs-actions.pod:2790
8868 #: ../fish/guestfish-actions.pod:1730 ../fish/guestfish-actions.pod:1918
8870 "Future versions of libguestfs may return other strings here. The caller "
8871 "should be prepared to handle any string."
8875 #: ../src/guestfs-actions.pod:2553
8876 msgid "guestfs_inspect_get_filesystems"
8880 #: ../src/guestfs-actions.pod:2555
8884 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8885 " const char *root);\n"
8890 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1742
8892 "This returns a list of all the filesystems that we think are associated with "
8893 "this operating system. This includes the root filesystem, other ordinary "
8894 "filesystems, and non-mounted devices like swap partitions."
8898 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:1747
8900 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8901 "to be shared between operating systems."
8905 #: ../src/guestfs-actions.pod:2570
8907 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8908 "C<guestfs_inspect_get_mountpoints>."
8912 #: ../src/guestfs-actions.pod:2579
8913 msgid "guestfs_inspect_get_major_version"
8917 #: ../src/guestfs-actions.pod:2581
8921 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
8922 " const char *root);\n"
8927 #: ../src/guestfs-actions.pod:2588 ../fish/guestfish-actions.pod:1760
8929 "This returns the major version number of the inspected operating system."
8933 #: ../src/guestfs-actions.pod:2591 ../fish/guestfish-actions.pod:1763
8935 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8936 "popular public names used by the operating system. Notably the operating "
8937 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8938 "1). You can find out the real versions corresponding to releases of Windows "
8939 "by consulting Wikipedia or MSDN."
8943 #: ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2618
8944 #: ../fish/guestfish-actions.pod:1770 ../fish/guestfish-actions.pod:1784
8945 msgid "If the version could not be determined, then C<0> is returned."
8949 #: ../src/guestfs-actions.pod:2606
8950 msgid "guestfs_inspect_get_minor_version"
8954 #: ../src/guestfs-actions.pod:2608
8958 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8959 " const char *root);\n"
8964 #: ../src/guestfs-actions.pod:2615 ../fish/guestfish-actions.pod:1781
8966 "This returns the minor version number of the inspected operating system."
8970 #: ../src/guestfs-actions.pod:2620
8972 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8973 "C<guestfs_inspect_get_major_version>."
8977 #: ../src/guestfs-actions.pod:2627
8978 msgid "guestfs_inspect_get_mountpoints"
8982 #: ../src/guestfs-actions.pod:2629
8986 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
8987 " const char *root);\n"
8992 #: ../src/guestfs-actions.pod:2636 ../fish/guestfish-actions.pod:1796
8994 "This returns a hash of where we think the filesystems associated with this "
8995 "operating system should be mounted. Callers should note that this is at "
8996 "best an educated guess made by reading configuration files such as C</etc/"
9001 #: ../src/guestfs-actions.pod:2641 ../fish/guestfish-actions.pod:1801
9003 "Each element in the returned hashtable has a key which is the path of the "
9004 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9005 "mounted there (eg. C</dev/sda1>)."
9009 #: ../src/guestfs-actions.pod:2646 ../fish/guestfish-actions.pod:1806
9011 "Non-mounted devices such as swap devices are I<not> returned in this list."
9015 #: ../src/guestfs-actions.pod:2649
9017 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9018 "C<guestfs_inspect_get_filesystems>."
9022 #: ../src/guestfs-actions.pod:2652 ../src/guestfs-actions.pod:3155
9023 #: ../src/guestfs-actions.pod:4283 ../src/guestfs-actions.pod:6139
9025 "This function returns a NULL-terminated array of strings, or NULL if there "
9026 "was an error. The array of strings will always have length C<2n+1>, where "
9027 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9028 "caller must free the strings and the array after use>."
9032 #: ../src/guestfs-actions.pod:2660
9033 msgid "guestfs_inspect_get_package_format"
9037 #: ../src/guestfs-actions.pod:2662
9041 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9042 " const char *root);\n"
9047 #: ../src/guestfs-actions.pod:2669
9049 "This function and C<guestfs_inspect_get_package_management> return the "
9050 "package format and package management tool used by the inspected operating "
9051 "system. For example for Fedora these functions would return C<rpm> (package "
9052 "format) and C<yum> (package management)."
9056 #: ../src/guestfs-actions.pod:2675 ../fish/guestfish-actions.pod:1825
9058 "This returns the string C<unknown> if we could not determine the package "
9059 "format I<or> if the operating system does not have a real packaging system "
9064 #: ../src/guestfs-actions.pod:2679 ../fish/guestfish-actions.pod:1829
9066 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9067 "Future versions of libguestfs may return other strings."
9071 #: ../src/guestfs-actions.pod:2687
9072 msgid "guestfs_inspect_get_package_management"
9076 #: ../src/guestfs-actions.pod:2689
9080 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9081 " const char *root);\n"
9086 #: ../src/guestfs-actions.pod:2696
9088 "C<guestfs_inspect_get_package_format> and this function return the package "
9089 "format and package management tool used by the inspected operating system. "
9090 "For example for Fedora these functions would return C<rpm> (package format) "
9091 "and C<yum> (package management)."
9095 #: ../src/guestfs-actions.pod:2702 ../fish/guestfish-actions.pod:1847
9097 "This returns the string C<unknown> if we could not determine the package "
9098 "management tool I<or> if the operating system does not have a real packaging "
9099 "system (eg. Windows)."
9103 #: ../src/guestfs-actions.pod:2706 ../fish/guestfish-actions.pod:1851
9105 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9106 "derivatives), C<portage>, C<pisi>, C<pacman>. Future versions of libguestfs "
9107 "may return other strings."
9111 #: ../src/guestfs-actions.pod:2716
9112 msgid "guestfs_inspect_get_product_name"
9116 #: ../src/guestfs-actions.pod:2718
9120 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9121 " const char *root);\n"
9126 #: ../src/guestfs-actions.pod:2725 ../fish/guestfish-actions.pod:1865
9128 "This returns the product name of the inspected operating system. The "
9129 "product name is generally some freeform string which can be displayed to the "
9130 "user, but should not be parsed by programs."
9134 #: ../src/guestfs-actions.pod:2730 ../fish/guestfish-actions.pod:1870
9136 "If the product name could not be determined, then the string C<unknown> is "
9141 #: ../src/guestfs-actions.pod:2740
9142 msgid "guestfs_inspect_get_roots"
9146 #: ../src/guestfs-actions.pod:2742
9150 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9155 #: ../src/guestfs-actions.pod:2745
9157 "This function is a convenient way to get the list of root devices, as "
9158 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9159 "the whole inspection process."
9163 #: ../src/guestfs-actions.pod:2749
9165 "This returns an empty list if either no root devices were found or the "
9166 "caller has not called C<guestfs_inspect_os>."
9170 #: ../src/guestfs-actions.pod:2758
9171 msgid "guestfs_inspect_get_type"
9175 #: ../src/guestfs-actions.pod:2760
9179 " guestfs_inspect_get_type (guestfs_h *g,\n"
9180 " const char *root);\n"
9185 #: ../src/guestfs-actions.pod:2767 ../fish/guestfish-actions.pod:1895
9187 "This returns the type of the inspected operating system. Currently defined "
9192 #: ../src/guestfs-actions.pod:2772 ../fish/guestfish-actions.pod:1900
9197 #: ../src/guestfs-actions.pod:2774 ../fish/guestfish-actions.pod:1902
9198 msgid "Any Linux-based operating system."
9202 #: ../src/guestfs-actions.pod:2778 ../fish/guestfish-actions.pod:1906
9203 msgid "Any Microsoft Windows operating system."
9207 #: ../src/guestfs-actions.pod:2780 ../fish/guestfish-actions.pod:1908
9212 #: ../src/guestfs-actions.pod:2782 ../fish/guestfish-actions.pod:1910
9217 #: ../src/guestfs-actions.pod:2786 ../fish/guestfish-actions.pod:1914
9218 msgid "The operating system type could not be determined."
9222 #: ../src/guestfs-actions.pod:2800
9223 msgid "guestfs_inspect_get_windows_systemroot"
9227 #: ../src/guestfs-actions.pod:2802
9231 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9232 " const char *root);\n"
9237 #: ../src/guestfs-actions.pod:2809 ../fish/guestfish-actions.pod:1930
9239 "This returns the Windows systemroot of the inspected guest. The systemroot "
9240 "is a directory path such as C</WINDOWS>."
9244 #: ../src/guestfs-actions.pod:2812 ../fish/guestfish-actions.pod:1933
9246 "This call assumes that the guest is Windows and that the systemroot could be "
9247 "determined by inspection. If this is not the case then an error is returned."
9251 #: ../src/guestfs-actions.pod:2821
9252 msgid "(Added in 1.5.25)"
9256 #: ../src/guestfs-actions.pod:2823
9257 msgid "guestfs_inspect_os"
9261 #: ../src/guestfs-actions.pod:2825
9265 " guestfs_inspect_os (guestfs_h *g);\n"
9270 #: ../src/guestfs-actions.pod:2828 ../fish/guestfish-actions.pod:1943
9272 "This function uses other libguestfs functions and certain heuristics to "
9273 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9274 "for operating systems."
9278 #: ../src/guestfs-actions.pod:2832 ../fish/guestfish-actions.pod:1947
9279 msgid "The list returned is empty if no operating systems were found."
9283 #: ../src/guestfs-actions.pod:2834 ../fish/guestfish-actions.pod:1949
9285 "If one operating system was found, then this returns a list with a single "
9286 "element, which is the name of the root filesystem of this operating system. "
9287 "It is also possible for this function to return a list containing more than "
9288 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9289 "element being the root filesystem of one of the operating systems."
9293 #: ../src/guestfs-actions.pod:2841
9295 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9296 "functions in order to query further information about each operating system, "
9297 "such as the name and version."
9301 #: ../src/guestfs-actions.pod:2846
9303 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9304 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9305 "the contents. This should be called with no disks currently mounted. The "
9306 "function may also use Augeas, so any existing Augeas handle will be closed."
9310 #: ../src/guestfs-actions.pod:2852 ../fish/guestfish-actions.pod:1967
9312 "This function cannot decrypt encrypted disks. The caller must do that first "
9313 "(supplying the necessary keys) if the disk is encrypted."
9317 #: ../src/guestfs-actions.pod:2858 ../src/guestfs-actions.pod:3113
9318 #: ../src/guestfs-actions.pod:3175
9319 msgid "See also C<guestfs_list_filesystems>."
9323 #: ../src/guestfs-actions.pod:2866
9324 msgid "guestfs_is_blockdev"
9328 #: ../src/guestfs-actions.pod:2868
9332 " guestfs_is_blockdev (guestfs_h *g,\n"
9333 " const char *path);\n"
9338 #: ../src/guestfs-actions.pod:2872 ../fish/guestfish-actions.pod:1979
9340 "This returns C<true> if and only if there is a block device with the given "
9345 #: ../src/guestfs-actions.pod:2875 ../src/guestfs-actions.pod:2904
9346 #: ../src/guestfs-actions.pod:2934 ../src/guestfs-actions.pod:2949
9347 #: ../src/guestfs-actions.pod:2965 ../src/guestfs-actions.pod:3021
9348 #: ../src/guestfs-actions.pod:3036
9349 msgid "See also C<guestfs_stat>."
9353 #: ../src/guestfs-actions.pod:2879 ../src/guestfs-actions.pod:2908
9354 #: ../src/guestfs-actions.pod:2953 ../src/guestfs-actions.pod:3025
9355 #: ../src/guestfs-actions.pod:3040
9356 msgid "(Added in 1.5.10)"
9360 #: ../src/guestfs-actions.pod:2881
9361 msgid "guestfs_is_busy"
9365 #: ../src/guestfs-actions.pod:2883
9369 " guestfs_is_busy (guestfs_h *g);\n"
9374 #: ../src/guestfs-actions.pod:2886 ../fish/guestfish-actions.pod:1988
9376 "This returns true iff this handle is busy processing a command (in the "
9381 #: ../src/guestfs-actions.pod:2895
9382 msgid "guestfs_is_chardev"
9386 #: ../src/guestfs-actions.pod:2897
9390 " guestfs_is_chardev (guestfs_h *g,\n"
9391 " const char *path);\n"
9396 #: ../src/guestfs-actions.pod:2901 ../fish/guestfish-actions.pod:1997
9398 "This returns C<true> if and only if there is a character device with the "
9399 "given C<path> name."
9403 #: ../src/guestfs-actions.pod:2910
9404 msgid "guestfs_is_config"
9408 #: ../src/guestfs-actions.pod:2912
9412 " guestfs_is_config (guestfs_h *g);\n"
9417 #: ../src/guestfs-actions.pod:2915 ../fish/guestfish-actions.pod:2006
9419 "This returns true iff this handle is being configured (in the C<CONFIG> "
9424 #: ../src/guestfs-actions.pod:2924
9425 msgid "guestfs_is_dir"
9429 #: ../src/guestfs-actions.pod:2926
9433 " guestfs_is_dir (guestfs_h *g,\n"
9434 " const char *path);\n"
9439 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2015
9441 "This returns C<true> if and only if there is a directory with the given "
9442 "C<path> name. Note that it returns false for other objects like files."
9446 #: ../src/guestfs-actions.pod:2940
9447 msgid "guestfs_is_fifo"
9451 #: ../src/guestfs-actions.pod:2942
9455 " guestfs_is_fifo (guestfs_h *g,\n"
9456 " const char *path);\n"
9461 #: ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:2025
9463 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9464 "given C<path> name."
9468 #: ../src/guestfs-actions.pod:2955
9469 msgid "guestfs_is_file"
9473 #: ../src/guestfs-actions.pod:2957
9477 " guestfs_is_file (guestfs_h *g,\n"
9478 " const char *path);\n"
9483 #: ../src/guestfs-actions.pod:2961 ../fish/guestfish-actions.pod:2034
9485 "This returns C<true> if and only if there is a regular file with the given "
9486 "C<path> name. Note that it returns false for other objects like directories."
9490 #: ../src/guestfs-actions.pod:2971
9491 msgid "guestfs_is_launching"
9495 #: ../src/guestfs-actions.pod:2973
9499 " guestfs_is_launching (guestfs_h *g);\n"
9504 #: ../src/guestfs-actions.pod:2976 ../fish/guestfish-actions.pod:2044
9506 "This returns true iff this handle is launching the subprocess (in the "
9507 "C<LAUNCHING> state)."
9511 #: ../src/guestfs-actions.pod:2985
9512 msgid "guestfs_is_lv"
9516 #: ../src/guestfs-actions.pod:2987
9520 " guestfs_is_lv (guestfs_h *g,\n"
9521 " const char *device);\n"
9526 #: ../src/guestfs-actions.pod:2991 ../fish/guestfish-actions.pod:2053
9528 "This command tests whether C<device> is a logical volume, and returns true "
9529 "iff this is the case."
9533 #: ../src/guestfs-actions.pod:2998
9534 msgid "guestfs_is_ready"
9538 #: ../src/guestfs-actions.pod:3000
9542 " guestfs_is_ready (guestfs_h *g);\n"
9547 #: ../src/guestfs-actions.pod:3003 ../fish/guestfish-actions.pod:2060
9549 "This returns true iff this handle is ready to accept commands (in the "
9554 #: ../src/guestfs-actions.pod:3012
9555 msgid "guestfs_is_socket"
9559 #: ../src/guestfs-actions.pod:3014
9563 " guestfs_is_socket (guestfs_h *g,\n"
9564 " const char *path);\n"
9569 #: ../src/guestfs-actions.pod:3018 ../fish/guestfish-actions.pod:2069
9571 "This returns C<true> if and only if there is a Unix domain socket with the "
9572 "given C<path> name."
9576 #: ../src/guestfs-actions.pod:3027
9577 msgid "guestfs_is_symlink"
9581 #: ../src/guestfs-actions.pod:3029
9585 " guestfs_is_symlink (guestfs_h *g,\n"
9586 " const char *path);\n"
9591 #: ../src/guestfs-actions.pod:3033 ../fish/guestfish-actions.pod:2078
9593 "This returns C<true> if and only if there is a symbolic link with the given "
9598 #: ../src/guestfs-actions.pod:3042
9599 msgid "guestfs_kill_subprocess"
9603 #: ../src/guestfs-actions.pod:3044
9607 " guestfs_kill_subprocess (guestfs_h *g);\n"
9612 #: ../src/guestfs-actions.pod:3047 ../fish/guestfish-actions.pod:2087
9613 msgid "This kills the qemu subprocess. You should never need to call this."
9617 #: ../src/guestfs-actions.pod:3053
9618 msgid "guestfs_launch"
9622 #: ../src/guestfs-actions.pod:3055
9626 " guestfs_launch (guestfs_h *g);\n"
9631 #: ../src/guestfs-actions.pod:3058 ../fish/guestfish-actions.pod:2095
9633 "Internally libguestfs is implemented by running a virtual machine using "
9638 #: ../src/guestfs-actions.pod:3061 ../fish/guestfish-actions.pod:2098
9640 "You should call this after configuring the handle (eg. adding drives) but "
9641 "before performing any actions."
9645 #: ../src/guestfs-actions.pod:3068
9646 msgid "guestfs_lchown"
9650 #: ../src/guestfs-actions.pod:3070
9654 " guestfs_lchown (guestfs_h *g,\n"
9657 " const char *path);\n"
9662 #: ../src/guestfs-actions.pod:3076
9664 "Change the file owner to C<owner> and group to C<group>. This is like "
9665 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
9666 "changed, not the target."
9670 #: ../src/guestfs-actions.pod:3088
9671 msgid "guestfs_lgetxattrs"
9675 #: ../src/guestfs-actions.pod:3090
9678 " struct guestfs_xattr_list *\n"
9679 " guestfs_lgetxattrs (guestfs_h *g,\n"
9680 " const char *path);\n"
9685 #: ../src/guestfs-actions.pod:3094
9687 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
9688 "then it returns the extended attributes of the link itself."
9692 #: ../src/guestfs-actions.pod:3104
9693 msgid "guestfs_list_devices"
9697 #: ../src/guestfs-actions.pod:3106
9701 " guestfs_list_devices (guestfs_h *g);\n"
9706 #: ../src/guestfs-actions.pod:3109 ../fish/guestfish-actions.pod:2125
9707 msgid "List all the block devices."
9711 #: ../src/guestfs-actions.pod:3111 ../fish/guestfish-actions.pod:2127
9712 msgid "The full block device names are returned, eg. C</dev/sda>."
9716 #: ../src/guestfs-actions.pod:3121
9717 msgid "guestfs_list_filesystems"
9721 #: ../src/guestfs-actions.pod:3123
9725 " guestfs_list_filesystems (guestfs_h *g);\n"
9730 #: ../src/guestfs-actions.pod:3126 ../fish/guestfish-actions.pod:2135
9732 "This inspection command looks for filesystems on partitions, block devices "
9733 "and logical volumes, returning a list of devices containing filesystems and "
9738 #: ../src/guestfs-actions.pod:3130 ../fish/guestfish-actions.pod:2139
9740 "The return value is a hash, where the keys are the devices containing "
9741 "filesystems, and the values are the filesystem types. For example:"
9745 #: ../src/guestfs-actions.pod:3134 ../fish/guestfish-actions.pod:2143
9748 " \"/dev/sda1\" => \"ntfs\"\n"
9749 " \"/dev/sda2\" => \"ext2\"\n"
9750 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9751 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9756 #: ../src/guestfs-actions.pod:3139 ../fish/guestfish-actions.pod:2148
9758 "The value can have the special value \"unknown\", meaning the content of the "
9759 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9763 #: ../src/guestfs-actions.pod:3143
9765 "This command runs other libguestfs commands, which might include "
9766 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
9767 "soon after launch and only when nothing is mounted."
9771 #: ../src/guestfs-actions.pod:3147
9773 "Not all of the filesystems returned will be mountable. In particular, swap "
9774 "partitions are returned in the list. Also this command does not check that "
9775 "each filesystem found is valid and mountable, and some filesystems might be "
9776 "mountable but require special options. Filesystems may not all belong to a "
9777 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
9781 #: ../src/guestfs-actions.pod:3161 ../src/guestfs-actions.pod:4684
9782 msgid "(Added in 1.5.15)"
9786 #: ../src/guestfs-actions.pod:3163
9787 msgid "guestfs_list_partitions"
9791 #: ../src/guestfs-actions.pod:3165
9795 " guestfs_list_partitions (guestfs_h *g);\n"
9800 #: ../src/guestfs-actions.pod:3168 ../fish/guestfish-actions.pod:2168
9801 msgid "List all the partitions detected on all block devices."
9805 #: ../src/guestfs-actions.pod:3170 ../fish/guestfish-actions.pod:2170
9806 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9810 #: ../src/guestfs-actions.pod:3172
9812 "This does not return logical volumes. For that you will need to call "
9817 #: ../src/guestfs-actions.pod:3183
9822 #: ../src/guestfs-actions.pod:3185
9826 " guestfs_ll (guestfs_h *g,\n"
9827 " const char *directory);\n"
9832 #: ../src/guestfs-actions.pod:3189 ../fish/guestfish-actions.pod:2181
9834 "List the files in C<directory> (relative to the root directory, there is no "
9835 "cwd) in the format of 'ls -la'."
9839 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2184
9841 "This command is mostly useful for interactive sessions. It is I<not> "
9842 "intended that you try to parse the output string."
9846 #: ../src/guestfs-actions.pod:3200
9851 #: ../src/guestfs-actions.pod:3202
9855 " guestfs_ln (guestfs_h *g,\n"
9856 " const char *target,\n"
9857 " const char *linkname);\n"
9862 #: ../src/guestfs-actions.pod:3207 ../fish/guestfish-actions.pod:2191
9863 msgid "This command creates a hard link using the C<ln> command."
9867 #: ../src/guestfs-actions.pod:3213
9868 msgid "guestfs_ln_f"
9872 #: ../src/guestfs-actions.pod:3215
9876 " guestfs_ln_f (guestfs_h *g,\n"
9877 " const char *target,\n"
9878 " const char *linkname);\n"
9883 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2197
9885 "This command creates a hard link using the C<ln -f> command. The C<-f> "
9886 "option removes the link (C<linkname>) if it exists already."
9890 #: ../src/guestfs-actions.pod:3227
9891 msgid "guestfs_ln_s"
9895 #: ../src/guestfs-actions.pod:3229
9899 " guestfs_ln_s (guestfs_h *g,\n"
9900 " const char *target,\n"
9901 " const char *linkname);\n"
9906 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2204
9907 msgid "This command creates a symbolic link using the C<ln -s> command."
9911 #: ../src/guestfs-actions.pod:3240
9912 msgid "guestfs_ln_sf"
9916 #: ../src/guestfs-actions.pod:3242
9920 " guestfs_ln_sf (guestfs_h *g,\n"
9921 " const char *target,\n"
9922 " const char *linkname);\n"
9927 #: ../src/guestfs-actions.pod:3247 ../fish/guestfish-actions.pod:2210
9929 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
9930 "option removes the link (C<linkname>) if it exists already."
9934 #: ../src/guestfs-actions.pod:3254
9935 msgid "guestfs_lremovexattr"
9939 #: ../src/guestfs-actions.pod:3256
9943 " guestfs_lremovexattr (guestfs_h *g,\n"
9944 " const char *xattr,\n"
9945 " const char *path);\n"
9950 #: ../src/guestfs-actions.pod:3261
9952 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
9953 "link, then it removes an extended attribute of the link itself."
9957 #: ../src/guestfs-actions.pod:3269
9962 #: ../src/guestfs-actions.pod:3271
9966 " guestfs_ls (guestfs_h *g,\n"
9967 " const char *directory);\n"
9972 #: ../src/guestfs-actions.pod:3275 ../fish/guestfish-actions.pod:2225
9974 "List the files in C<directory> (relative to the root directory, there is no "
9975 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
9979 #: ../src/guestfs-actions.pod:3279
9981 "This command is mostly useful for interactive sessions. Programs should "
9982 "probably use C<guestfs_readdir> instead."
9986 #: ../src/guestfs-actions.pod:3288
9987 msgid "guestfs_lsetxattr"
9991 #: ../src/guestfs-actions.pod:3290
9995 " guestfs_lsetxattr (guestfs_h *g,\n"
9996 " const char *xattr,\n"
9997 " const char *val,\n"
9999 " const char *path);\n"
10004 #: ../src/guestfs-actions.pod:3297
10006 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10007 "then it sets an extended attribute of the link itself."
10011 #: ../src/guestfs-actions.pod:3305
10012 msgid "guestfs_lstat"
10016 #: ../src/guestfs-actions.pod:3307
10019 " struct guestfs_stat *\n"
10020 " guestfs_lstat (guestfs_h *g,\n"
10021 " const char *path);\n"
10026 #: ../src/guestfs-actions.pod:3311 ../src/guestfs-actions.pod:5738
10027 #: ../fish/guestfish-actions.pod:2244 ../fish/guestfish-actions.pod:3826
10028 msgid "Returns file information for the given C<path>."
10032 #: ../src/guestfs-actions.pod:3313
10034 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10035 "link, then the link is stat-ed, not the file it refers to."
10039 #: ../src/guestfs-actions.pod:3317 ../fish/guestfish-actions.pod:2250
10040 msgid "This is the same as the C<lstat(2)> system call."
10044 #: ../src/guestfs-actions.pod:3319 ../src/guestfs-actions.pod:5742
10046 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10047 "error. I<The caller must call C<guestfs_free_stat> after use>."
10051 #: ../src/guestfs-actions.pod:3323 ../src/guestfs-actions.pod:5746
10052 #: ../src/guestfs-actions.pod:5764 ../src/guestfs-actions.pod:6145
10053 msgid "(Added in 0.9.2)"
10057 #: ../src/guestfs-actions.pod:3325
10058 msgid "guestfs_lstatlist"
10062 #: ../src/guestfs-actions.pod:3327
10065 " struct guestfs_stat_list *\n"
10066 " guestfs_lstatlist (guestfs_h *g,\n"
10067 " const char *path,\n"
10068 " char *const *names);\n"
10073 #: ../src/guestfs-actions.pod:3332
10075 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10076 "files, where all files are in the directory C<path>. C<names> is the list "
10077 "of files from this directory."
10081 #: ../src/guestfs-actions.pod:3336 ../fish/guestfish-actions.pod:2260
10083 "On return you get a list of stat structs, with a one-to-one correspondence "
10084 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10085 "then the C<ino> field of that structure is set to C<-1>."
10089 #: ../src/guestfs-actions.pod:3341
10091 "This call is intended for programs that want to efficiently list a directory "
10092 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10093 "for a similarly efficient call for getting extended attributes. Very long "
10094 "directory listings might cause the protocol message size to be exceeded, "
10095 "causing this call to fail. The caller must split up such requests into "
10096 "smaller groups of names."
10100 #: ../src/guestfs-actions.pod:3349
10102 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10103 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10107 #: ../src/guestfs-actions.pod:3355
10108 msgid "guestfs_luks_add_key"
10112 #: ../src/guestfs-actions.pod:3357
10116 " guestfs_luks_add_key (guestfs_h *g,\n"
10117 " const char *device,\n"
10118 " const char *key,\n"
10119 " const char *newkey,\n"
10125 #: ../src/guestfs-actions.pod:3364 ../fish/guestfish-actions.pod:2277
10127 "This command adds a new key on LUKS device C<device>. C<key> is any "
10128 "existing key, and is used to access the device. C<newkey> is the new key to "
10129 "add. C<keyslot> is the key slot that will be replaced."
10133 #: ../src/guestfs-actions.pod:3369
10135 "Note that if C<keyslot> already contains a key, then this command will "
10136 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10140 #: ../src/guestfs-actions.pod:3375 ../src/guestfs-actions.pod:3415
10141 #: ../src/guestfs-actions.pod:3438 ../src/guestfs-actions.pod:3458
10142 #: ../src/guestfs-actions.pod:3490 ../src/guestfs-actions.pod:3509
10144 "This function takes a key or passphrase parameter which could contain "
10145 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10150 #: ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3419
10151 #: ../src/guestfs-actions.pod:3442 ../src/guestfs-actions.pod:3462
10152 msgid "(Added in 1.5.2)"
10156 #: ../src/guestfs-actions.pod:3381
10157 msgid "guestfs_luks_close"
10161 #: ../src/guestfs-actions.pod:3383
10165 " guestfs_luks_close (guestfs_h *g,\n"
10166 " const char *device);\n"
10171 #: ../src/guestfs-actions.pod:3387
10173 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10174 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10175 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10176 "underlying block device."
10180 #: ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3494
10181 #: ../src/guestfs-actions.pod:3513 ../src/guestfs-actions.pod:3563
10182 #: ../src/guestfs-actions.pod:3611
10183 msgid "(Added in 1.5.1)"
10187 #: ../src/guestfs-actions.pod:3397
10188 msgid "guestfs_luks_format"
10192 #: ../src/guestfs-actions.pod:3399
10196 " guestfs_luks_format (guestfs_h *g,\n"
10197 " const char *device,\n"
10198 " const char *key,\n"
10204 #: ../src/guestfs-actions.pod:3405 ../fish/guestfish-actions.pod:2303
10206 "This command erases existing data on C<device> and formats the device as a "
10207 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10208 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10212 #: ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3435
10213 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:4435
10214 #: ../src/guestfs-actions.pod:5198 ../src/guestfs-actions.pod:5573
10215 #: ../src/guestfs-actions.pod:5596 ../src/guestfs-actions.pod:5622
10216 #: ../src/guestfs-actions.pod:6772 ../fish/guestfish-actions.pod:2311
10217 #: ../fish/guestfish-actions.pod:2324 ../fish/guestfish-actions.pod:2408
10218 #: ../fish/guestfish-actions.pod:2938 ../fish/guestfish-actions.pod:3445
10219 #: ../fish/guestfish-actions.pod:3725 ../fish/guestfish-actions.pod:3741
10220 #: ../fish/guestfish-actions.pod:3756 ../fish/guestfish-actions.pod:4471
10222 "B<This command is dangerous. Without careful use you can easily destroy all "
10227 #: ../src/guestfs-actions.pod:3421
10228 msgid "guestfs_luks_format_cipher"
10232 #: ../src/guestfs-actions.pod:3423
10236 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10237 " const char *device,\n"
10238 " const char *key,\n"
10240 " const char *cipher);\n"
10245 #: ../src/guestfs-actions.pod:3430
10247 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10248 "set the C<cipher> used."
10252 #: ../src/guestfs-actions.pod:3444
10253 msgid "guestfs_luks_kill_slot"
10257 #: ../src/guestfs-actions.pod:3446
10261 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10262 " const char *device,\n"
10263 " const char *key,\n"
10269 #: ../src/guestfs-actions.pod:3452 ../fish/guestfish-actions.pod:2331
10271 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10272 "device C<device>. C<key> must be one of the I<other> keys."
10276 #: ../src/guestfs-actions.pod:3464
10277 msgid "guestfs_luks_open"
10281 #: ../src/guestfs-actions.pod:3466
10285 " guestfs_luks_open (guestfs_h *g,\n"
10286 " const char *device,\n"
10287 " const char *key,\n"
10288 " const char *mapname);\n"
10293 #: ../src/guestfs-actions.pod:3472 ../fish/guestfish-actions.pod:2342
10295 "This command opens a block device which has been encrypted according to the "
10296 "Linux Unified Key Setup (LUKS) standard."
10300 #: ../src/guestfs-actions.pod:3475 ../fish/guestfish-actions.pod:2345
10301 msgid "C<device> is the encrypted block device or partition."
10305 #: ../src/guestfs-actions.pod:3477 ../fish/guestfish-actions.pod:2347
10307 "The caller must supply one of the keys associated with the LUKS block "
10308 "device, in the C<key> parameter."
10312 #: ../src/guestfs-actions.pod:3480 ../fish/guestfish-actions.pod:2350
10314 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10315 "writes to this block device are decrypted from and encrypted to the "
10316 "underlying C<device> respectively."
10320 #: ../src/guestfs-actions.pod:3484
10322 "If this block device contains LVM volume groups, then calling "
10323 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10328 #: ../src/guestfs-actions.pod:3496
10329 msgid "guestfs_luks_open_ro"
10333 #: ../src/guestfs-actions.pod:3498
10337 " guestfs_luks_open_ro (guestfs_h *g,\n"
10338 " const char *device,\n"
10339 " const char *key,\n"
10340 " const char *mapname);\n"
10345 #: ../src/guestfs-actions.pod:3504
10347 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10352 #: ../src/guestfs-actions.pod:3515
10353 msgid "guestfs_lvcreate"
10357 #: ../src/guestfs-actions.pod:3517
10361 " guestfs_lvcreate (guestfs_h *g,\n"
10362 " const char *logvol,\n"
10363 " const char *volgroup,\n"
10369 #: ../src/guestfs-actions.pod:3523 ../fish/guestfish-actions.pod:2375
10371 "This creates an LVM logical volume called C<logvol> on the volume group "
10372 "C<volgroup>, with C<size> megabytes."
10376 #: ../src/guestfs-actions.pod:3530
10377 msgid "guestfs_lvm_canonical_lv_name"
10381 #: ../src/guestfs-actions.pod:3532
10385 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10386 " const char *lvname);\n"
10391 #: ../src/guestfs-actions.pod:3536 ../fish/guestfish-actions.pod:2382
10393 "This converts alternative naming schemes for LVs that you might find to the "
10394 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10399 #: ../src/guestfs-actions.pod:3540 ../fish/guestfish-actions.pod:2386
10401 "This command returns an error if the C<lvname> parameter does not refer to a "
10406 #: ../src/guestfs-actions.pod:3543
10407 msgid "See also C<guestfs_is_lv>."
10411 #: ../src/guestfs-actions.pod:3548
10412 msgid "(Added in 1.5.24)"
10416 #: ../src/guestfs-actions.pod:3550
10417 msgid "guestfs_lvm_clear_filter"
10421 #: ../src/guestfs-actions.pod:3552
10425 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10430 #: ../src/guestfs-actions.pod:3555
10432 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10433 "see every block device."
10437 #: ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3600
10438 #: ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2429
10440 "This command also clears the LVM cache and performs a volume group scan."
10444 #: ../src/guestfs-actions.pod:3565
10445 msgid "guestfs_lvm_remove_all"
10449 #: ../src/guestfs-actions.pod:3567
10453 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10458 #: ../src/guestfs-actions.pod:3570 ../fish/guestfish-actions.pod:2405
10460 "This command removes all LVM logical volumes, volume groups and physical "
10465 #: ../src/guestfs-actions.pod:3580
10466 msgid "guestfs_lvm_set_filter"
10470 #: ../src/guestfs-actions.pod:3582
10474 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10475 " char *const *devices);\n"
10480 #: ../src/guestfs-actions.pod:3586 ../fish/guestfish-actions.pod:2415
10482 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10483 "block devices in the list C<devices>, and will ignore all other attached "
10488 #: ../src/guestfs-actions.pod:3590 ../fish/guestfish-actions.pod:2419
10490 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10491 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10492 "there are two types of duplication possible: either cloned PVs/VGs which "
10493 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10494 "same name. In normal operation you cannot create this situation, but you "
10495 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10496 "inside the LVM metadata."
10500 #: ../src/guestfs-actions.pod:3603 ../fish/guestfish-actions.pod:2432
10501 msgid "You can filter whole block devices or individual partitions."
10505 #: ../src/guestfs-actions.pod:3605 ../fish/guestfish-actions.pod:2434
10507 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10508 "filesystem), even if you are not filtering out that VG."
10512 #: ../src/guestfs-actions.pod:3613
10513 msgid "guestfs_lvremove"
10517 #: ../src/guestfs-actions.pod:3615
10521 " guestfs_lvremove (guestfs_h *g,\n"
10522 " const char *device);\n"
10527 #: ../src/guestfs-actions.pod:3619 ../fish/guestfish-actions.pod:2442
10529 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10530 "LV, such as C</dev/VG/LV>."
10534 #: ../src/guestfs-actions.pod:3622 ../fish/guestfish-actions.pod:2445
10536 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10541 #: ../src/guestfs-actions.pod:3627 ../src/guestfs-actions.pod:4781
10542 #: ../src/guestfs-actions.pod:6511
10543 msgid "(Added in 1.0.13)"
10547 #: ../src/guestfs-actions.pod:3629
10548 msgid "guestfs_lvrename"
10552 #: ../src/guestfs-actions.pod:3631
10556 " guestfs_lvrename (guestfs_h *g,\n"
10557 " const char *logvol,\n"
10558 " const char *newlogvol);\n"
10563 #: ../src/guestfs-actions.pod:3636 ../fish/guestfish-actions.pod:2452
10564 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10568 #: ../src/guestfs-actions.pod:3640 ../src/guestfs-actions.pod:6524
10569 msgid "(Added in 1.0.83)"
10573 #: ../src/guestfs-actions.pod:3642
10574 msgid "guestfs_lvresize"
10578 #: ../src/guestfs-actions.pod:3644
10582 " guestfs_lvresize (guestfs_h *g,\n"
10583 " const char *device,\n"
10589 #: ../src/guestfs-actions.pod:3649 ../fish/guestfish-actions.pod:2458
10591 "This resizes (expands or shrinks) an existing LVM logical volume to "
10592 "C<mbytes>. When reducing, data in the reduced part is lost."
10596 #: ../src/guestfs-actions.pod:3657
10597 msgid "guestfs_lvresize_free"
10601 #: ../src/guestfs-actions.pod:3659
10605 " guestfs_lvresize_free (guestfs_h *g,\n"
10606 " const char *lv,\n"
10612 #: ../src/guestfs-actions.pod:3664 ../fish/guestfish-actions.pod:2466
10614 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10615 "remaining free space in the volume group. Commonly you would call this with "
10616 "pc = 100 which expands the logical volume as much as possible, using all "
10617 "remaining free space in the volume group."
10621 #: ../src/guestfs-actions.pod:3672
10622 msgid "(Added in 1.3.3)"
10626 #: ../src/guestfs-actions.pod:3674
10627 msgid "guestfs_lvs"
10631 #: ../src/guestfs-actions.pod:3676
10635 " guestfs_lvs (guestfs_h *g);\n"
10640 #: ../src/guestfs-actions.pod:3679 ../fish/guestfish-actions.pod:2476
10642 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10647 #: ../src/guestfs-actions.pod:3682 ../fish/guestfish-actions.pod:2479
10649 "This returns a list of the logical volume device names (eg. C</dev/"
10650 "VolGroup00/LogVol00>)."
10654 #: ../src/guestfs-actions.pod:3685
10655 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
10659 #: ../src/guestfs-actions.pod:3693
10660 msgid "guestfs_lvs_full"
10664 #: ../src/guestfs-actions.pod:3695
10667 " struct guestfs_lvm_lv_list *\n"
10668 " guestfs_lvs_full (guestfs_h *g);\n"
10673 #: ../src/guestfs-actions.pod:3698 ../fish/guestfish-actions.pod:2488
10675 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10676 "(8)> command. The \"full\" version includes all fields."
10680 #: ../src/guestfs-actions.pod:3701
10682 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
10683 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
10687 #: ../src/guestfs-actions.pod:3707
10688 msgid "guestfs_lvuuid"
10692 #: ../src/guestfs-actions.pod:3709
10696 " guestfs_lvuuid (guestfs_h *g,\n"
10697 " const char *device);\n"
10702 #: ../src/guestfs-actions.pod:3713 ../fish/guestfish-actions.pod:2495
10703 msgid "This command returns the UUID of the LVM LV C<device>."
10707 #: ../src/guestfs-actions.pod:3720
10708 msgid "guestfs_lxattrlist"
10712 #: ../src/guestfs-actions.pod:3722
10715 " struct guestfs_xattr_list *\n"
10716 " guestfs_lxattrlist (guestfs_h *g,\n"
10717 " const char *path,\n"
10718 " char *const *names);\n"
10723 #: ../src/guestfs-actions.pod:3727 ../fish/guestfish-actions.pod:2501
10725 "This call allows you to get the extended attributes of multiple files, where "
10726 "all files are in the directory C<path>. C<names> is the list of files from "
10731 #: ../src/guestfs-actions.pod:3731 ../fish/guestfish-actions.pod:2505
10733 "On return you get a flat list of xattr structs which must be interpreted "
10734 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10735 "C<attrval> in this struct is zero-length to indicate there was an error "
10736 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10737 "number (the number of following attributes for this file, which could be C<"
10738 "\"0\">). Then after the first xattr struct are the zero or more attributes "
10739 "for the first named file. This repeats for the second and subsequent files."
10743 #: ../src/guestfs-actions.pod:3741
10745 "This call is intended for programs that want to efficiently list a directory "
10746 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
10747 "a similarly efficient call for getting standard stats. Very long directory "
10748 "listings might cause the protocol message size to be exceeded, causing this "
10749 "call to fail. The caller must split up such requests into smaller groups of "
10754 #: ../src/guestfs-actions.pod:3755
10755 msgid "guestfs_mkdir"
10759 #: ../src/guestfs-actions.pod:3757
10763 " guestfs_mkdir (guestfs_h *g,\n"
10764 " const char *path);\n"
10769 #: ../src/guestfs-actions.pod:3761 ../fish/guestfish-actions.pod:2527
10770 msgid "Create a directory named C<path>."
10774 #: ../src/guestfs-actions.pod:3767
10775 msgid "guestfs_mkdir_mode"
10779 #: ../src/guestfs-actions.pod:3769
10783 " guestfs_mkdir_mode (guestfs_h *g,\n"
10784 " const char *path,\n"
10790 #: ../src/guestfs-actions.pod:3774 ../fish/guestfish-actions.pod:2533
10792 "This command creates a directory, setting the initial permissions of the "
10793 "directory to C<mode>."
10797 #: ../src/guestfs-actions.pod:3777 ../fish/guestfish-actions.pod:2536
10799 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10800 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10805 #: ../src/guestfs-actions.pod:3781
10806 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
10810 #: ../src/guestfs-actions.pod:3787
10811 msgid "guestfs_mkdir_p"
10815 #: ../src/guestfs-actions.pod:3789
10819 " guestfs_mkdir_p (guestfs_h *g,\n"
10820 " const char *path);\n"
10825 #: ../src/guestfs-actions.pod:3793 ../fish/guestfish-actions.pod:2546
10827 "Create a directory named C<path>, creating any parent directories as "
10828 "necessary. This is like the C<mkdir -p> shell command."
10832 #: ../src/guestfs-actions.pod:3800
10833 msgid "guestfs_mkdtemp"
10837 #: ../src/guestfs-actions.pod:3802
10841 " guestfs_mkdtemp (guestfs_h *g,\n"
10842 " const char *template);\n"
10847 #: ../src/guestfs-actions.pod:3806 ../fish/guestfish-actions.pod:2553
10849 "This command creates a temporary directory. The C<template> parameter "
10850 "should be a full pathname for the temporary directory name with the final "
10851 "six characters being \"XXXXXX\"."
10855 #: ../src/guestfs-actions.pod:3811 ../fish/guestfish-actions.pod:2558
10857 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10858 "being suitable for Windows filesystems."
10862 #: ../src/guestfs-actions.pod:3814 ../fish/guestfish-actions.pod:2561
10863 msgid "The name of the temporary directory that was created is returned."
10867 #: ../src/guestfs-actions.pod:3817 ../fish/guestfish-actions.pod:2564
10868 msgid "The temporary directory is created with mode 0700 and is owned by root."
10872 #: ../src/guestfs-actions.pod:3820 ../fish/guestfish-actions.pod:2567
10874 "The caller is responsible for deleting the temporary directory and its "
10875 "contents after use."
10879 #: ../src/guestfs-actions.pod:3823 ../fish/guestfish-actions.pod:2570
10880 msgid "See also: L<mkdtemp(3)>"
10884 #: ../src/guestfs-actions.pod:3830
10885 msgid "guestfs_mke2fs_J"
10889 #: ../src/guestfs-actions.pod:3832
10893 " guestfs_mke2fs_J (guestfs_h *g,\n"
10894 " const char *fstype,\n"
10895 " int blocksize,\n"
10896 " const char *device,\n"
10897 " const char *journal);\n"
10902 #: ../src/guestfs-actions.pod:3839 ../fish/guestfish-actions.pod:2576
10904 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10905 "C<journal>. It is equivalent to the command:"
10909 #: ../src/guestfs-actions.pod:3843 ../fish/guestfish-actions.pod:2580
10912 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10917 #: ../src/guestfs-actions.pod:3845
10918 msgid "See also C<guestfs_mke2journal>."
10922 #: ../src/guestfs-actions.pod:3849 ../src/guestfs-actions.pod:3867
10923 #: ../src/guestfs-actions.pod:3885 ../src/guestfs-actions.pod:3901
10924 #: ../src/guestfs-actions.pod:3915 ../src/guestfs-actions.pod:3929
10925 #: ../src/guestfs-actions.pod:3981 ../src/guestfs-actions.pod:4171
10926 msgid "(Added in 1.0.68)"
10930 #: ../src/guestfs-actions.pod:3851
10931 msgid "guestfs_mke2fs_JL"
10935 #: ../src/guestfs-actions.pod:3853
10939 " guestfs_mke2fs_JL (guestfs_h *g,\n"
10940 " const char *fstype,\n"
10941 " int blocksize,\n"
10942 " const char *device,\n"
10943 " const char *label);\n"
10948 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2588
10950 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10951 "the journal labeled C<label>."
10955 #: ../src/guestfs-actions.pod:3863
10956 msgid "See also C<guestfs_mke2journal_L>."
10960 #: ../src/guestfs-actions.pod:3869
10961 msgid "guestfs_mke2fs_JU"
10965 #: ../src/guestfs-actions.pod:3871
10969 " guestfs_mke2fs_JU (guestfs_h *g,\n"
10970 " const char *fstype,\n"
10971 " int blocksize,\n"
10972 " const char *device,\n"
10973 " const char *uuid);\n"
10978 #: ../src/guestfs-actions.pod:3878 ../fish/guestfish-actions.pod:2597
10980 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10981 "the journal with UUID C<uuid>."
10985 #: ../src/guestfs-actions.pod:3881
10986 msgid "See also C<guestfs_mke2journal_U>."
10990 #: ../src/guestfs-actions.pod:3887
10991 msgid "guestfs_mke2journal"
10995 #: ../src/guestfs-actions.pod:3889
10999 " guestfs_mke2journal (guestfs_h *g,\n"
11000 " int blocksize,\n"
11001 " const char *device);\n"
11006 #: ../src/guestfs-actions.pod:3894 ../fish/guestfish-actions.pod:2606
11008 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11013 #: ../src/guestfs-actions.pod:3897 ../fish/guestfish-actions.pod:2609
11016 " mke2fs -O journal_dev -b blocksize device\n"
11021 #: ../src/guestfs-actions.pod:3903
11022 msgid "guestfs_mke2journal_L"
11026 #: ../src/guestfs-actions.pod:3905
11030 " guestfs_mke2journal_L (guestfs_h *g,\n"
11031 " int blocksize,\n"
11032 " const char *label,\n"
11033 " const char *device);\n"
11038 #: ../src/guestfs-actions.pod:3911 ../fish/guestfish-actions.pod:2615
11039 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11043 #: ../src/guestfs-actions.pod:3917
11044 msgid "guestfs_mke2journal_U"
11048 #: ../src/guestfs-actions.pod:3919
11052 " guestfs_mke2journal_U (guestfs_h *g,\n"
11053 " int blocksize,\n"
11054 " const char *uuid,\n"
11055 " const char *device);\n"
11060 #: ../src/guestfs-actions.pod:3925 ../fish/guestfish-actions.pod:2621
11061 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11065 #: ../src/guestfs-actions.pod:3931
11066 msgid "guestfs_mkfifo"
11070 #: ../src/guestfs-actions.pod:3933
11074 " guestfs_mkfifo (guestfs_h *g,\n"
11076 " const char *path);\n"
11081 #: ../src/guestfs-actions.pod:3938
11083 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11084 "is just a convenient wrapper around C<guestfs_mknod>."
11088 #: ../src/guestfs-actions.pod:3948
11089 msgid "guestfs_mkfs"
11093 #: ../src/guestfs-actions.pod:3950
11097 " guestfs_mkfs (guestfs_h *g,\n"
11098 " const char *fstype,\n"
11099 " const char *device);\n"
11104 #: ../src/guestfs-actions.pod:3955 ../fish/guestfish-actions.pod:2637
11106 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11107 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11111 #: ../src/guestfs-actions.pod:3963
11112 msgid "guestfs_mkfs_b"
11116 #: ../src/guestfs-actions.pod:3965
11120 " guestfs_mkfs_b (guestfs_h *g,\n"
11121 " const char *fstype,\n"
11122 " int blocksize,\n"
11123 " const char *device);\n"
11128 #: ../src/guestfs-actions.pod:3971
11130 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11131 "block size of the resulting filesystem. Supported block sizes depend on the "
11132 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11136 #: ../src/guestfs-actions.pod:3976 ../fish/guestfish-actions.pod:2650
11138 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11143 #: ../src/guestfs-actions.pod:3983
11144 msgid "guestfs_mkmountpoint"
11148 #: ../src/guestfs-actions.pod:3985
11152 " guestfs_mkmountpoint (guestfs_h *g,\n"
11153 " const char *exemptpath);\n"
11158 #: ../src/guestfs-actions.pod:3989
11160 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11161 "that can be used to create extra mountpoints before mounting the first "
11166 #: ../src/guestfs-actions.pod:3993 ../fish/guestfish-actions.pod:2661
11168 "These calls are I<only> necessary in some very limited circumstances, mainly "
11169 "the case where you want to mount a mix of unrelated and/or read-only "
11170 "filesystems together."
11174 #: ../src/guestfs-actions.pod:3997 ../fish/guestfish-actions.pod:2665
11176 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11177 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11178 "inside that. You can unpack this as follows in guestfish:"
11182 #: ../src/guestfs-actions.pod:4002 ../fish/guestfish-actions.pod:2670
11185 " add-ro Fedora-11-i686-Live.iso\n"
11187 " mkmountpoint /cd\n"
11188 " mkmountpoint /sqsh\n"
11189 " mkmountpoint /ext3fs\n"
11190 " mount /dev/sda /cd\n"
11191 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11192 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11197 #: ../src/guestfs-actions.pod:4011 ../fish/guestfish-actions.pod:2679
11198 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11202 #: ../src/guestfs-actions.pod:4013
11204 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11205 "may get unexpected errors if you try to mix these calls. It is safest to "
11206 "manually unmount filesystems and remove mountpoints after use."
11210 #: ../src/guestfs-actions.pod:4017
11212 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11213 "first, so for this to work for manual mountpoints, you must ensure that the "
11214 "innermost mountpoints have the longest pathnames, as in the example code "
11219 #: ../src/guestfs-actions.pod:4022 ../fish/guestfish-actions.pod:2690
11221 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11225 #: ../src/guestfs-actions.pod:4024
11227 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11228 "means that C<guestfs_umount_all> is called when the handle is closed which "
11229 "can also trigger these issues."
11233 #: ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4289
11234 #: ../src/guestfs-actions.pod:5182
11235 msgid "(Added in 1.0.62)"
11239 #: ../src/guestfs-actions.pod:4032
11240 msgid "guestfs_mknod"
11244 #: ../src/guestfs-actions.pod:4034
11248 " guestfs_mknod (guestfs_h *g,\n"
11252 " const char *path);\n"
11257 #: ../src/guestfs-actions.pod:4041 ../fish/guestfish-actions.pod:2700
11259 "This call creates block or character special devices, or named pipes (FIFOs)."
11263 #: ../src/guestfs-actions.pod:4044 ../fish/guestfish-actions.pod:2703
11265 "The C<mode> parameter should be the mode, using the standard constants. "
11266 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11267 "used when creating block and character special devices."
11271 #: ../src/guestfs-actions.pod:4049
11273 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11274 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11275 "regular file). These constants are available in the standard Linux header "
11276 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11277 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11278 "the appropriate constant for you."
11282 #: ../src/guestfs-actions.pod:4063
11283 msgid "guestfs_mknod_b"
11287 #: ../src/guestfs-actions.pod:4065
11291 " guestfs_mknod_b (guestfs_h *g,\n"
11295 " const char *path);\n"
11300 #: ../src/guestfs-actions.pod:4072
11302 "This call creates a block device node called C<path> with mode C<mode> and "
11303 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11304 "wrapper around C<guestfs_mknod>."
11308 #: ../src/guestfs-actions.pod:4082
11309 msgid "guestfs_mknod_c"
11313 #: ../src/guestfs-actions.pod:4084
11317 " guestfs_mknod_c (guestfs_h *g,\n"
11321 " const char *path);\n"
11326 #: ../src/guestfs-actions.pod:4091
11328 "This call creates a char device node called C<path> with mode C<mode> and "
11329 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11330 "wrapper around C<guestfs_mknod>."
11334 #: ../src/guestfs-actions.pod:4101
11335 msgid "guestfs_mkswap"
11339 #: ../src/guestfs-actions.pod:4103
11343 " guestfs_mkswap (guestfs_h *g,\n"
11344 " const char *device);\n"
11349 #: ../src/guestfs-actions.pod:4107 ../fish/guestfish-actions.pod:2742
11350 msgid "Create a swap partition on C<device>."
11354 #: ../src/guestfs-actions.pod:4113
11355 msgid "guestfs_mkswap_L"
11359 #: ../src/guestfs-actions.pod:4115
11363 " guestfs_mkswap_L (guestfs_h *g,\n"
11364 " const char *label,\n"
11365 " const char *device);\n"
11370 #: ../src/guestfs-actions.pod:4120 ../fish/guestfish-actions.pod:2748
11371 msgid "Create a swap partition on C<device> with label C<label>."
11375 #: ../src/guestfs-actions.pod:4122 ../fish/guestfish-actions.pod:2750
11377 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11378 "sda>), just to a partition. This appears to be a limitation of the kernel "
11383 #: ../src/guestfs-actions.pod:4130
11384 msgid "guestfs_mkswap_U"
11388 #: ../src/guestfs-actions.pod:4132
11392 " guestfs_mkswap_U (guestfs_h *g,\n"
11393 " const char *uuid,\n"
11394 " const char *device);\n"
11399 #: ../src/guestfs-actions.pod:4137 ../fish/guestfish-actions.pod:2758
11400 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11404 #: ../src/guestfs-actions.pod:4143
11405 msgid "guestfs_mkswap_file"
11409 #: ../src/guestfs-actions.pod:4145
11413 " guestfs_mkswap_file (guestfs_h *g,\n"
11414 " const char *path);\n"
11419 #: ../src/guestfs-actions.pod:4149 ../fish/guestfish-actions.pod:2764
11420 msgid "Create a swap file."
11424 #: ../src/guestfs-actions.pod:4151
11426 "This command just writes a swap file signature to an existing file. To "
11427 "create the file itself, use something like C<guestfs_fallocate>."
11431 #: ../src/guestfs-actions.pod:4158
11432 msgid "guestfs_modprobe"
11436 #: ../src/guestfs-actions.pod:4160
11440 " guestfs_modprobe (guestfs_h *g,\n"
11441 " const char *modulename);\n"
11446 #: ../src/guestfs-actions.pod:4164 ../fish/guestfish-actions.pod:2773
11447 msgid "This loads a kernel module in the appliance."
11451 #: ../src/guestfs-actions.pod:4166 ../fish/guestfish-actions.pod:2775
11453 "The kernel module must have been whitelisted when libguestfs was built (see "
11454 "C<appliance/kmod.whitelist.in> in the source)."
11458 #: ../src/guestfs-actions.pod:4173
11459 msgid "guestfs_mount"
11463 #: ../src/guestfs-actions.pod:4175
11467 " guestfs_mount (guestfs_h *g,\n"
11468 " const char *device,\n"
11469 " const char *mountpoint);\n"
11474 #: ../src/guestfs-actions.pod:4180 ../fish/guestfish-actions.pod:2782
11476 "Mount a guest disk at a position in the filesystem. Block devices are named "
11477 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11478 "those block devices contain partitions, they will have the usual names (eg. "
11479 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11483 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:2788
11485 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11486 "mounted on C</> before others can be mounted. Other filesystems can only be "
11487 "mounted on directories which already exist."
11491 #: ../src/guestfs-actions.pod:4191 ../fish/guestfish-actions.pod:2793
11493 "The mounted filesystem is writable, if we have sufficient permissions on the "
11494 "underlying device."
11498 #: ../src/guestfs-actions.pod:4194
11500 "B<Important note:> When you use this call, the filesystem options C<sync> "
11501 "and C<noatime> are set implicitly. This was originally done because we "
11502 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11503 "very large negative performance impact and negligible effect on "
11504 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
11505 "in any code that needs performance, and instead use C<guestfs_mount_options> "
11506 "(use an empty string for the first parameter if you don't want any options)."
11510 #: ../src/guestfs-actions.pod:4208
11511 msgid "guestfs_mount_loop"
11515 #: ../src/guestfs-actions.pod:4210
11519 " guestfs_mount_loop (guestfs_h *g,\n"
11520 " const char *file,\n"
11521 " const char *mountpoint);\n"
11526 #: ../src/guestfs-actions.pod:4215 ../fish/guestfish-actions.pod:2810
11528 "This command lets you mount C<file> (a filesystem image in a file) on a "
11529 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11534 #: ../src/guestfs-actions.pod:4223
11535 msgid "guestfs_mount_options"
11539 #: ../src/guestfs-actions.pod:4225
11543 " guestfs_mount_options (guestfs_h *g,\n"
11544 " const char *options,\n"
11545 " const char *device,\n"
11546 " const char *mountpoint);\n"
11551 #: ../src/guestfs-actions.pod:4231
11553 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11554 "the mount options as for the L<mount(8)> I<-o> flag."
11558 #: ../src/guestfs-actions.pod:4235 ../fish/guestfish-actions.pod:2822
11560 "If the C<options> parameter is an empty string, then no options are passed "
11561 "(all options default to whatever the filesystem uses)."
11565 #: ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4255
11566 #: ../src/guestfs-actions.pod:4272
11567 msgid "(Added in 1.0.10)"
11571 #: ../src/guestfs-actions.pod:4243
11572 msgid "guestfs_mount_ro"
11576 #: ../src/guestfs-actions.pod:4245
11580 " guestfs_mount_ro (guestfs_h *g,\n"
11581 " const char *device,\n"
11582 " const char *mountpoint);\n"
11587 #: ../src/guestfs-actions.pod:4250
11589 "This is the same as the C<guestfs_mount> command, but it mounts the "
11590 "filesystem with the read-only (I<-o ro>) flag."
11594 #: ../src/guestfs-actions.pod:4257
11595 msgid "guestfs_mount_vfs"
11599 #: ../src/guestfs-actions.pod:4259
11603 " guestfs_mount_vfs (guestfs_h *g,\n"
11604 " const char *options,\n"
11605 " const char *vfstype,\n"
11606 " const char *device,\n"
11607 " const char *mountpoint);\n"
11612 #: ../src/guestfs-actions.pod:4266
11614 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11615 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
11620 #: ../src/guestfs-actions.pod:4274
11621 msgid "guestfs_mountpoints"
11625 #: ../src/guestfs-actions.pod:4276
11629 " guestfs_mountpoints (guestfs_h *g);\n"
11634 #: ../src/guestfs-actions.pod:4279
11636 "This call is similar to C<guestfs_mounts>. That call returns a list of "
11637 "devices. This one returns a hash table (map) of device name to directory "
11638 "where the device is mounted."
11642 #: ../src/guestfs-actions.pod:4291
11643 msgid "guestfs_mounts"
11647 #: ../src/guestfs-actions.pod:4293
11651 " guestfs_mounts (guestfs_h *g);\n"
11656 #: ../src/guestfs-actions.pod:4296 ../fish/guestfish-actions.pod:2853
11658 "This returns the list of currently mounted filesystems. It returns the list "
11659 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11663 #: ../src/guestfs-actions.pod:4299 ../fish/guestfish-actions.pod:2856
11664 msgid "Some internal mounts are not shown."
11668 #: ../src/guestfs-actions.pod:4301
11669 msgid "See also: C<guestfs_mountpoints>"
11673 #: ../src/guestfs-actions.pod:4309
11678 #: ../src/guestfs-actions.pod:4311
11682 " guestfs_mv (guestfs_h *g,\n"
11683 " const char *src,\n"
11684 " const char *dest);\n"
11689 #: ../src/guestfs-actions.pod:4316 ../fish/guestfish-actions.pod:2864
11691 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11692 "destination filename or destination directory."
11696 #: ../src/guestfs-actions.pod:4323
11697 msgid "guestfs_ntfs_3g_probe"
11701 #: ../src/guestfs-actions.pod:4325
11705 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
11707 " const char *device);\n"
11712 #: ../src/guestfs-actions.pod:4330 ../fish/guestfish-actions.pod:2871
11714 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11715 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11716 "write, and some cannot be mounted at all)."
11720 #: ../src/guestfs-actions.pod:4334 ../fish/guestfish-actions.pod:2875
11722 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11723 "can be mounted read-write. Set it to false if you want to test if the "
11724 "volume can be mounted read-only."
11728 #: ../src/guestfs-actions.pod:4338 ../fish/guestfish-actions.pod:2879
11730 "The return value is an integer which C<0> if the operation would succeed, or "
11731 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11735 #: ../src/guestfs-actions.pod:4344
11736 msgid "(Added in 1.0.43)"
11740 #: ../src/guestfs-actions.pod:4346
11741 msgid "guestfs_ntfsresize"
11745 #: ../src/guestfs-actions.pod:4348
11749 " guestfs_ntfsresize (guestfs_h *g,\n"
11750 " const char *device);\n"
11755 #: ../src/guestfs-actions.pod:4352 ../fish/guestfish-actions.pod:2887
11757 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11758 "size of the underlying device. See also L<ntfsresize(8)>."
11762 #: ../src/guestfs-actions.pod:4360
11763 msgid "guestfs_ntfsresize_size"
11767 #: ../src/guestfs-actions.pod:4362
11771 " guestfs_ntfsresize_size (guestfs_h *g,\n"
11772 " const char *device,\n"
11773 " int64_t size);\n"
11778 #: ../src/guestfs-actions.pod:4367
11780 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
11781 "to specify the new size (in bytes) explicitly."
11785 #: ../src/guestfs-actions.pod:4372 ../src/guestfs-actions.pod:4808
11786 #: ../src/guestfs-actions.pod:4881 ../src/guestfs-actions.pod:5130
11787 msgid "(Added in 1.3.14)"
11791 #: ../src/guestfs-actions.pod:4374
11792 msgid "guestfs_part_add"
11796 #: ../src/guestfs-actions.pod:4376
11800 " guestfs_part_add (guestfs_h *g,\n"
11801 " const char *device,\n"
11802 " const char *prlogex,\n"
11803 " int64_t startsect,\n"
11804 " int64_t endsect);\n"
11809 #: ../src/guestfs-actions.pod:4383
11811 "This command adds a partition to C<device>. If there is no partition table "
11812 "on the device, call C<guestfs_part_init> first."
11816 #: ../src/guestfs-actions.pod:4386 ../fish/guestfish-actions.pod:2905
11818 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11819 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11820 "C<logical>) and C<e> (or C<extended>) partition types."
11824 #: ../src/guestfs-actions.pod:4391 ../fish/guestfish-actions.pod:2910
11826 "C<startsect> and C<endsect> are the start and end of the partition in "
11827 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11828 "from the end of the disk (C<-1> is the last sector)."
11832 #: ../src/guestfs-actions.pod:4395
11834 "Creating a partition which covers the whole disk is not so easy. Use "
11835 "C<guestfs_part_disk> to do that."
11839 #: ../src/guestfs-actions.pod:4400 ../src/guestfs-actions.pod:4438
11840 #: ../src/guestfs-actions.pod:4491 ../src/guestfs-actions.pod:4569
11841 #: ../src/guestfs-actions.pod:4607 ../src/guestfs-actions.pod:4626
11842 #: ../src/guestfs-actions.pod:4666
11843 msgid "(Added in 1.0.78)"
11847 #: ../src/guestfs-actions.pod:4402
11848 msgid "guestfs_part_del"
11852 #: ../src/guestfs-actions.pod:4404
11856 " guestfs_part_del (guestfs_h *g,\n"
11857 " const char *device,\n"
11863 #: ../src/guestfs-actions.pod:4409 ../fish/guestfish-actions.pod:2921
11864 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11868 #: ../src/guestfs-actions.pod:4411 ../fish/guestfish-actions.pod:2923
11870 "Note that in the case of MBR partitioning, deleting an extended partition "
11871 "also deletes any logical partitions it contains."
11875 #: ../src/guestfs-actions.pod:4419
11876 msgid "guestfs_part_disk"
11880 #: ../src/guestfs-actions.pod:4421
11884 " guestfs_part_disk (guestfs_h *g,\n"
11885 " const char *device,\n"
11886 " const char *parttype);\n"
11891 #: ../src/guestfs-actions.pod:4426
11893 "This command is simply a combination of C<guestfs_part_init> followed by "
11894 "C<guestfs_part_add> to create a single primary partition covering the whole "
11899 #: ../src/guestfs-actions.pod:4430
11901 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11902 "possible values are described in C<guestfs_part_init>."
11906 #: ../src/guestfs-actions.pod:4440
11907 msgid "guestfs_part_get_bootable"
11911 #: ../src/guestfs-actions.pod:4442
11915 " guestfs_part_get_bootable (guestfs_h *g,\n"
11916 " const char *device,\n"
11922 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:2945
11924 "This command returns true if the partition C<partnum> on C<device> has the "
11925 "bootable flag set."
11929 #: ../src/guestfs-actions.pod:4450
11930 msgid "See also C<guestfs_part_set_bootable>."
11934 #: ../src/guestfs-actions.pod:4456
11935 msgid "guestfs_part_get_mbr_id"
11939 #: ../src/guestfs-actions.pod:4458
11943 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
11944 " const char *device,\n"
11950 #: ../src/guestfs-actions.pod:4463 ../fish/guestfish-actions.pod:2954
11952 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11953 "partition C<partnum>."
11957 #: ../src/guestfs-actions.pod:4466 ../src/guestfs-actions.pod:4642
11959 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11960 "undefined results for other partition table types (see "
11961 "C<guestfs_part_get_parttype>)."
11965 #: ../src/guestfs-actions.pod:4474
11966 msgid "guestfs_part_get_parttype"
11970 #: ../src/guestfs-actions.pod:4476
11974 " guestfs_part_get_parttype (guestfs_h *g,\n"
11975 " const char *device);\n"
11980 #: ../src/guestfs-actions.pod:4480 ../fish/guestfish-actions.pod:2965
11982 "This command examines the partition table on C<device> and returns the "
11983 "partition table type (format) being used."
11987 #: ../src/guestfs-actions.pod:4483
11989 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11990 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11991 "possible, although unusual. See C<guestfs_part_init> for a full list."
11995 #: ../src/guestfs-actions.pod:4493
11996 msgid "guestfs_part_init"
12000 #: ../src/guestfs-actions.pod:4495
12004 " guestfs_part_init (guestfs_h *g,\n"
12005 " const char *device,\n"
12006 " const char *parttype);\n"
12011 #: ../src/guestfs-actions.pod:4500 ../fish/guestfish-actions.pod:2977
12013 "This creates an empty partition table on C<device> of one of the partition "
12014 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12015 "(for large disks)."
12019 #: ../src/guestfs-actions.pod:4504
12021 "Initially there are no partitions. Following this, you should call "
12022 "C<guestfs_part_add> for each partition required."
12026 #: ../src/guestfs-actions.pod:4507 ../fish/guestfish-actions.pod:2984
12027 msgid "Possible values for C<parttype> are:"
12031 #: ../src/guestfs-actions.pod:4511 ../fish/guestfish-actions.pod:2988
12032 msgid "B<efi> | B<gpt>"
12036 #: ../src/guestfs-actions.pod:4513 ../fish/guestfish-actions.pod:2990
12037 msgid "Intel EFI / GPT partition table."
12041 #: ../src/guestfs-actions.pod:4515 ../fish/guestfish-actions.pod:2992
12043 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12044 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12045 "the C<mbr> format."
12049 #: ../src/guestfs-actions.pod:4519 ../fish/guestfish-actions.pod:2996
12050 msgid "B<mbr> | B<msdos>"
12054 #: ../src/guestfs-actions.pod:4521 ../fish/guestfish-actions.pod:2998
12056 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12057 "Windows. This partition type will B<only> work for device sizes up to 2 "
12058 "TB. For large disks we recommend using C<gpt>."
12062 #: ../src/guestfs-actions.pod:4528 ../fish/guestfish-actions.pod:3005
12064 "Other partition table types that may work but are not supported include:"
12068 #: ../src/guestfs-actions.pod:4533 ../fish/guestfish-actions.pod:3010
12073 #: ../src/guestfs-actions.pod:4535 ../fish/guestfish-actions.pod:3012
12074 msgid "AIX disk labels."
12078 #: ../src/guestfs-actions.pod:4537 ../fish/guestfish-actions.pod:3014
12079 msgid "B<amiga> | B<rdb>"
12083 #: ../src/guestfs-actions.pod:4539 ../fish/guestfish-actions.pod:3016
12084 msgid "Amiga \"Rigid Disk Block\" format."
12088 #: ../src/guestfs-actions.pod:4541 ../fish/guestfish-actions.pod:3018
12093 #: ../src/guestfs-actions.pod:4543 ../fish/guestfish-actions.pod:3020
12094 msgid "BSD disk labels."
12098 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3022
12103 #: ../src/guestfs-actions.pod:4547 ../fish/guestfish-actions.pod:3024
12104 msgid "DASD, used on IBM mainframes."
12108 #: ../src/guestfs-actions.pod:4549 ../fish/guestfish-actions.pod:3026
12113 #: ../src/guestfs-actions.pod:4551 ../fish/guestfish-actions.pod:3028
12114 msgid "MIPS/SGI volumes."
12118 #: ../src/guestfs-actions.pod:4553 ../fish/guestfish-actions.pod:3030
12123 #: ../src/guestfs-actions.pod:4555 ../fish/guestfish-actions.pod:3032
12124 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12128 #: ../src/guestfs-actions.pod:4557 ../fish/guestfish-actions.pod:3034
12133 #: ../src/guestfs-actions.pod:4559 ../fish/guestfish-actions.pod:3036
12134 msgid "NEC PC-98 format, common in Japan apparently."
12138 #: ../src/guestfs-actions.pod:4561 ../fish/guestfish-actions.pod:3038
12143 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3040
12144 msgid "Sun disk labels."
12148 #: ../src/guestfs-actions.pod:4571
12149 msgid "guestfs_part_list"
12153 #: ../src/guestfs-actions.pod:4573
12156 " struct guestfs_partition_list *\n"
12157 " guestfs_part_list (guestfs_h *g,\n"
12158 " const char *device);\n"
12163 #: ../src/guestfs-actions.pod:4577 ../fish/guestfish-actions.pod:3048
12165 "This command parses the partition table on C<device> and returns the list of "
12166 "partitions found."
12170 #: ../src/guestfs-actions.pod:4580 ../fish/guestfish-actions.pod:3051
12171 msgid "The fields in the returned structure are:"
12175 #: ../src/guestfs-actions.pod:4584 ../fish/guestfish-actions.pod:3055
12176 msgid "B<part_num>"
12180 #: ../src/guestfs-actions.pod:4586 ../fish/guestfish-actions.pod:3057
12181 msgid "Partition number, counting from 1."
12185 #: ../src/guestfs-actions.pod:4588 ../fish/guestfish-actions.pod:3059
12186 msgid "B<part_start>"
12190 #: ../src/guestfs-actions.pod:4590
12192 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12193 "the device's sector size, see C<guestfs_blockdev_getss>."
12197 #: ../src/guestfs-actions.pod:4593 ../fish/guestfish-actions.pod:3064
12198 msgid "B<part_end>"
12202 #: ../src/guestfs-actions.pod:4595 ../fish/guestfish-actions.pod:3066
12203 msgid "End of the partition in bytes."
12207 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3068
12208 msgid "B<part_size>"
12212 #: ../src/guestfs-actions.pod:4599 ../fish/guestfish-actions.pod:3070
12213 msgid "Size of the partition in bytes."
12217 #: ../src/guestfs-actions.pod:4603
12219 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12220 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12225 #: ../src/guestfs-actions.pod:4609
12226 msgid "guestfs_part_set_bootable"
12230 #: ../src/guestfs-actions.pod:4611
12234 " guestfs_part_set_bootable (guestfs_h *g,\n"
12235 " const char *device,\n"
12237 " int bootable);\n"
12242 #: ../src/guestfs-actions.pod:4617 ../fish/guestfish-actions.pod:3078
12244 "This sets the bootable flag on partition numbered C<partnum> on device "
12245 "C<device>. Note that partitions are numbered from 1."
12249 #: ../src/guestfs-actions.pod:4620 ../fish/guestfish-actions.pod:3081
12251 "The bootable flag is used by some operating systems (notably Windows) to "
12252 "determine which partition to boot from. It is by no means universally "
12257 #: ../src/guestfs-actions.pod:4628
12258 msgid "guestfs_part_set_mbr_id"
12262 #: ../src/guestfs-actions.pod:4630
12266 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12267 " const char *device,\n"
12274 #: ../src/guestfs-actions.pod:4636 ../fish/guestfish-actions.pod:3089
12276 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12277 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12278 "documentation are in fact hexadecimal numbers, but usually documented "
12279 "without any leading \"0x\" which might be confusing."
12283 #: ../src/guestfs-actions.pod:4650
12284 msgid "guestfs_part_set_name"
12288 #: ../src/guestfs-actions.pod:4652
12292 " guestfs_part_set_name (guestfs_h *g,\n"
12293 " const char *device,\n"
12295 " const char *name);\n"
12300 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3103
12302 "This sets the partition name on partition numbered C<partnum> on device "
12303 "C<device>. Note that partitions are numbered from 1."
12307 #: ../src/guestfs-actions.pod:4661 ../fish/guestfish-actions.pod:3106
12309 "The partition name can only be set on certain types of partition table. "
12310 "This works on C<gpt> but not on C<mbr> partitions."
12314 #: ../src/guestfs-actions.pod:4668
12315 msgid "guestfs_part_to_dev"
12319 #: ../src/guestfs-actions.pod:4670
12323 " guestfs_part_to_dev (guestfs_h *g,\n"
12324 " const char *partition);\n"
12329 #: ../src/guestfs-actions.pod:4674 ../fish/guestfish-actions.pod:3113
12331 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12332 "partition number, returning the device name (eg. \"/dev/sdb\")."
12336 #: ../src/guestfs-actions.pod:4678
12338 "The named partition must exist, for example as a string returned from "
12339 "C<guestfs_list_partitions>."
12343 #: ../src/guestfs-actions.pod:4686
12344 msgid "guestfs_ping_daemon"
12348 #: ../src/guestfs-actions.pod:4688
12352 " guestfs_ping_daemon (guestfs_h *g);\n"
12357 #: ../src/guestfs-actions.pod:4691 ../fish/guestfish-actions.pod:3124
12359 "This is a test probe into the guestfs daemon running inside the qemu "
12360 "subprocess. Calling this function checks that the daemon responds to the "
12361 "ping message, without affecting the daemon or attached block device(s) in "
12366 #: ../src/guestfs-actions.pod:4700
12367 msgid "guestfs_pread"
12371 #: ../src/guestfs-actions.pod:4702
12375 " guestfs_pread (guestfs_h *g,\n"
12376 " const char *path,\n"
12378 " int64_t offset,\n"
12379 " size_t *size_r);\n"
12384 #: ../src/guestfs-actions.pod:4709 ../fish/guestfish-actions.pod:3133
12386 "This command lets you read part of a file. It reads C<count> bytes of the "
12387 "file, starting at C<offset>, from file C<path>."
12391 #: ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4738
12392 #: ../fish/guestfish-actions.pod:3136 ../fish/guestfish-actions.pod:3151
12394 "This may read fewer bytes than requested. For further details see the "
12395 "L<pread(2)> system call."
12399 #: ../src/guestfs-actions.pod:4715
12400 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12404 #: ../src/guestfs-actions.pod:4726
12405 msgid "guestfs_pread_device"
12409 #: ../src/guestfs-actions.pod:4728
12413 " guestfs_pread_device (guestfs_h *g,\n"
12414 " const char *device,\n"
12416 " int64_t offset,\n"
12417 " size_t *size_r);\n"
12422 #: ../src/guestfs-actions.pod:4735 ../fish/guestfish-actions.pod:3148
12424 "This command lets you read part of a file. It reads C<count> bytes of "
12425 "C<device>, starting at C<offset>."
12429 #: ../src/guestfs-actions.pod:4741
12430 msgid "See also C<guestfs_pread>."
12434 #: ../src/guestfs-actions.pod:4750
12435 msgid "(Added in 1.5.21)"
12439 #: ../src/guestfs-actions.pod:4752
12440 msgid "guestfs_pvcreate"
12444 #: ../src/guestfs-actions.pod:4754
12448 " guestfs_pvcreate (guestfs_h *g,\n"
12449 " const char *device);\n"
12454 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3163
12456 "This creates an LVM physical volume on the named C<device>, where C<device> "
12457 "should usually be a partition name such as C</dev/sda1>."
12461 #: ../src/guestfs-actions.pod:4766
12462 msgid "guestfs_pvremove"
12466 #: ../src/guestfs-actions.pod:4768
12470 " guestfs_pvremove (guestfs_h *g,\n"
12471 " const char *device);\n"
12476 #: ../src/guestfs-actions.pod:4772 ../fish/guestfish-actions.pod:3171
12478 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12483 #: ../src/guestfs-actions.pod:4775 ../fish/guestfish-actions.pod:3174
12485 "The implementation uses the C<pvremove> command which refuses to wipe "
12486 "physical volumes that contain any volume groups, so you have to remove those "
12491 #: ../src/guestfs-actions.pod:4783
12492 msgid "guestfs_pvresize"
12496 #: ../src/guestfs-actions.pod:4785
12500 " guestfs_pvresize (guestfs_h *g,\n"
12501 " const char *device);\n"
12506 #: ../src/guestfs-actions.pod:4789 ../fish/guestfish-actions.pod:3182
12508 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12509 "the new size of the underlying device."
12513 #: ../src/guestfs-actions.pod:4796
12514 msgid "guestfs_pvresize_size"
12518 #: ../src/guestfs-actions.pod:4798
12522 " guestfs_pvresize_size (guestfs_h *g,\n"
12523 " const char *device,\n"
12524 " int64_t size);\n"
12529 #: ../src/guestfs-actions.pod:4803
12531 "This command is the same as C<guestfs_pvresize> except that it allows you to "
12532 "specify the new size (in bytes) explicitly."
12536 #: ../src/guestfs-actions.pod:4810
12537 msgid "guestfs_pvs"
12541 #: ../src/guestfs-actions.pod:4812
12545 " guestfs_pvs (guestfs_h *g);\n"
12550 #: ../src/guestfs-actions.pod:4815 ../fish/guestfish-actions.pod:3196
12552 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12557 #: ../src/guestfs-actions.pod:4818 ../fish/guestfish-actions.pod:3199
12559 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12564 #: ../src/guestfs-actions.pod:4821
12565 msgid "See also C<guestfs_pvs_full>."
12569 #: ../src/guestfs-actions.pod:4829
12570 msgid "guestfs_pvs_full"
12574 #: ../src/guestfs-actions.pod:4831
12577 " struct guestfs_lvm_pv_list *\n"
12578 " guestfs_pvs_full (guestfs_h *g);\n"
12583 #: ../src/guestfs-actions.pod:4834 ../fish/guestfish-actions.pod:3208
12585 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12586 "(8)> command. The \"full\" version includes all fields."
12590 #: ../src/guestfs-actions.pod:4837
12592 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
12593 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
12597 #: ../src/guestfs-actions.pod:4843
12598 msgid "guestfs_pvuuid"
12602 #: ../src/guestfs-actions.pod:4845
12606 " guestfs_pvuuid (guestfs_h *g,\n"
12607 " const char *device);\n"
12612 #: ../src/guestfs-actions.pod:4849 ../fish/guestfish-actions.pod:3215
12613 msgid "This command returns the UUID of the LVM PV C<device>."
12617 #: ../src/guestfs-actions.pod:4856
12618 msgid "guestfs_pwrite"
12622 #: ../src/guestfs-actions.pod:4858
12626 " guestfs_pwrite (guestfs_h *g,\n"
12627 " const char *path,\n"
12628 " const char *content,\n"
12629 " size_t content_size,\n"
12630 " int64_t offset);\n"
12635 #: ../src/guestfs-actions.pod:4865 ../fish/guestfish-actions.pod:3221
12637 "This command writes to part of a file. It writes the data buffer C<content> "
12638 "to the file C<path> starting at offset C<offset>."
12642 #: ../src/guestfs-actions.pod:4868 ../fish/guestfish-actions.pod:3224
12644 "This command implements the L<pwrite(2)> system call, and like that system "
12645 "call it may not write the full data requested. The return value is the "
12646 "number of bytes that were actually written to the file. This could even be "
12647 "0, although short writes are unlikely for regular files in ordinary "
12652 #: ../src/guestfs-actions.pod:4874
12653 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
12657 #: ../src/guestfs-actions.pod:4883
12658 msgid "guestfs_pwrite_device"
12662 #: ../src/guestfs-actions.pod:4885
12666 " guestfs_pwrite_device (guestfs_h *g,\n"
12667 " const char *device,\n"
12668 " const char *content,\n"
12669 " size_t content_size,\n"
12670 " int64_t offset);\n"
12675 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3239
12677 "This command writes to part of a device. It writes the data buffer "
12678 "C<content> to C<device> starting at offset C<offset>."
12682 #: ../src/guestfs-actions.pod:4895 ../fish/guestfish-actions.pod:3242
12684 "This command implements the L<pwrite(2)> system call, and like that system "
12685 "call it may not write the full data requested (although short writes to disk "
12686 "devices and partitions are probably impossible with standard Linux kernels)."
12690 #: ../src/guestfs-actions.pod:4900
12691 msgid "See also C<guestfs_pwrite>."
12695 #: ../src/guestfs-actions.pod:4907
12696 msgid "(Added in 1.5.20)"
12700 #: ../src/guestfs-actions.pod:4909
12701 msgid "guestfs_read_file"
12705 #: ../src/guestfs-actions.pod:4911
12709 " guestfs_read_file (guestfs_h *g,\n"
12710 " const char *path,\n"
12711 " size_t *size_r);\n"
12716 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3256
12717 msgid "This calls returns the contents of the file C<path> as a buffer."
12721 #: ../src/guestfs-actions.pod:4919
12723 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
12724 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
12725 "function is limited in the total size of file that can be handled."
12729 #: ../src/guestfs-actions.pod:4931
12730 msgid "(Added in 1.0.63)"
12734 #: ../src/guestfs-actions.pod:4933
12735 msgid "guestfs_read_lines"
12739 #: ../src/guestfs-actions.pod:4935
12743 " guestfs_read_lines (guestfs_h *g,\n"
12744 " const char *path);\n"
12749 #: ../src/guestfs-actions.pod:4941 ../fish/guestfish-actions.pod:3273
12751 "The file contents are returned as a list of lines. Trailing C<LF> and "
12752 "C<CRLF> character sequences are I<not> returned."
12756 #: ../src/guestfs-actions.pod:4944
12758 "Note that this function cannot correctly handle binary files (specifically, "
12759 "files containing C<\\0> character which is treated as end of line). For "
12760 "those you need to use the C<guestfs_read_file> function which has a more "
12761 "complex interface."
12765 #: ../src/guestfs-actions.pod:4955
12766 msgid "guestfs_readdir"
12770 #: ../src/guestfs-actions.pod:4957
12773 " struct guestfs_dirent_list *\n"
12774 " guestfs_readdir (guestfs_h *g,\n"
12775 " const char *dir);\n"
12780 #: ../src/guestfs-actions.pod:4961 ../fish/guestfish-actions.pod:3285
12781 msgid "This returns the list of directory entries in directory C<dir>."
12785 #: ../src/guestfs-actions.pod:4963 ../fish/guestfish-actions.pod:3287
12787 "All entries in the directory are returned, including C<.> and C<..>. The "
12788 "entries are I<not> sorted, but returned in the same order as the underlying "
12793 #: ../src/guestfs-actions.pod:4967 ../fish/guestfish-actions.pod:3291
12795 "Also this call returns basic file type information about each file. The "
12796 "C<ftyp> field will contain one of the following characters:"
12800 #: ../src/guestfs-actions.pod:4972 ../fish/guestfish-actions.pod:3296
12805 #: ../src/guestfs-actions.pod:4974 ../fish/guestfish-actions.pod:3298
12806 msgid "Block special"
12810 #: ../src/guestfs-actions.pod:4976 ../fish/guestfish-actions.pod:3300
12815 #: ../src/guestfs-actions.pod:4978 ../fish/guestfish-actions.pod:3302
12816 msgid "Char special"
12820 #: ../src/guestfs-actions.pod:4980 ../fish/guestfish-actions.pod:3304
12825 #: ../src/guestfs-actions.pod:4982 ../fish/guestfish-actions.pod:3306
12830 #: ../src/guestfs-actions.pod:4984 ../fish/guestfish-actions.pod:3308
12835 #: ../src/guestfs-actions.pod:4986 ../fish/guestfish-actions.pod:3310
12836 msgid "FIFO (named pipe)"
12840 #: ../src/guestfs-actions.pod:4988 ../fish/guestfish-actions.pod:3312
12845 #: ../src/guestfs-actions.pod:4990 ../fish/guestfish-actions.pod:3314
12846 msgid "Symbolic link"
12850 #: ../src/guestfs-actions.pod:4992 ../fish/guestfish-actions.pod:3316
12855 #: ../src/guestfs-actions.pod:4994 ../fish/guestfish-actions.pod:3318
12856 msgid "Regular file"
12860 #: ../src/guestfs-actions.pod:4996 ../fish/guestfish-actions.pod:3320
12865 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3322
12870 #: ../src/guestfs-actions.pod:5000 ../fish/guestfish-actions.pod:3324
12875 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3326
12876 msgid "Unknown file type"
12880 #: ../src/guestfs-actions.pod:5004 ../fish/guestfish-actions.pod:3328
12885 #: ../src/guestfs-actions.pod:5006 ../fish/guestfish-actions.pod:3330
12887 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12891 #: ../src/guestfs-actions.pod:5011
12893 "This function is primarily intended for use by programs. To get a simple "
12894 "list of names, use C<guestfs_ls>. To get a printable directory for human "
12895 "consumption, use C<guestfs_ll>."
12899 #: ../src/guestfs-actions.pod:5015
12901 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
12902 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
12906 #: ../src/guestfs-actions.pod:5021
12907 msgid "guestfs_readlink"
12911 #: ../src/guestfs-actions.pod:5023
12915 " guestfs_readlink (guestfs_h *g,\n"
12916 " const char *path);\n"
12921 #: ../src/guestfs-actions.pod:5027 ../fish/guestfish-actions.pod:3343
12922 msgid "This command reads the target of a symbolic link."
12926 #: ../src/guestfs-actions.pod:5034
12927 msgid "guestfs_readlinklist"
12931 #: ../src/guestfs-actions.pod:5036
12935 " guestfs_readlinklist (guestfs_h *g,\n"
12936 " const char *path,\n"
12937 " char *const *names);\n"
12942 #: ../src/guestfs-actions.pod:5041 ../fish/guestfish-actions.pod:3349
12944 "This call allows you to do a C<readlink> operation on multiple files, where "
12945 "all files are in the directory C<path>. C<names> is the list of files from "
12950 #: ../src/guestfs-actions.pod:5045 ../fish/guestfish-actions.pod:3353
12952 "On return you get a list of strings, with a one-to-one correspondence to the "
12953 "C<names> list. Each string is the value of the symbolic link."
12957 #: ../src/guestfs-actions.pod:5049 ../fish/guestfish-actions.pod:3357
12959 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12960 "result string is the empty string C<\"\">. However the whole operation is "
12961 "completed even if there were C<readlink(2)> errors, and so you can call this "
12962 "function with names where you don't know if they are symbolic links already "
12963 "(albeit slightly less efficient)."
12967 #: ../src/guestfs-actions.pod:5056 ../fish/guestfish-actions.pod:3364
12969 "This call is intended for programs that want to efficiently list a directory "
12970 "contents without making many round-trips. Very long directory listings "
12971 "might cause the protocol message size to be exceeded, causing this call to "
12972 "fail. The caller must split up such requests into smaller groups of names."
12976 #: ../src/guestfs-actions.pod:5069
12977 msgid "guestfs_realpath"
12981 #: ../src/guestfs-actions.pod:5071
12985 " guestfs_realpath (guestfs_h *g,\n"
12986 " const char *path);\n"
12991 #: ../src/guestfs-actions.pod:5075 ../fish/guestfish-actions.pod:3375
12993 "Return the canonicalized absolute pathname of C<path>. The returned path "
12994 "has no C<.>, C<..> or symbolic link path elements."
12998 #: ../src/guestfs-actions.pod:5083
12999 msgid "guestfs_removexattr"
13003 #: ../src/guestfs-actions.pod:5085
13007 " guestfs_removexattr (guestfs_h *g,\n"
13008 " const char *xattr,\n"
13009 " const char *path);\n"
13014 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3382
13016 "This call removes the extended attribute named C<xattr> of the file C<path>."
13020 #: ../src/guestfs-actions.pod:5093
13021 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13025 #: ../src/guestfs-actions.pod:5099
13026 msgid "guestfs_resize2fs"
13030 #: ../src/guestfs-actions.pod:5101
13034 " guestfs_resize2fs (guestfs_h *g,\n"
13035 " const char *device);\n"
13040 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3391
13042 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13043 "underlying device."
13047 #: ../src/guestfs-actions.pod:5108
13049 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13050 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13051 "sometimes gives an error about this and sometimes not. In any case, it is "
13052 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13056 #: ../src/guestfs-actions.pod:5118
13057 msgid "guestfs_resize2fs_size"
13061 #: ../src/guestfs-actions.pod:5120
13065 " guestfs_resize2fs_size (guestfs_h *g,\n"
13066 " const char *device,\n"
13067 " int64_t size);\n"
13072 #: ../src/guestfs-actions.pod:5125
13074 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13075 "to specify the new size (in bytes) explicitly."
13079 #: ../src/guestfs-actions.pod:5132
13084 #: ../src/guestfs-actions.pod:5134
13088 " guestfs_rm (guestfs_h *g,\n"
13089 " const char *path);\n"
13094 #: ../src/guestfs-actions.pod:5138 ../fish/guestfish-actions.pod:3411
13095 msgid "Remove the single file C<path>."
13099 #: ../src/guestfs-actions.pod:5144
13100 msgid "guestfs_rm_rf"
13104 #: ../src/guestfs-actions.pod:5146
13108 " guestfs_rm_rf (guestfs_h *g,\n"
13109 " const char *path);\n"
13114 #: ../src/guestfs-actions.pod:5150 ../fish/guestfish-actions.pod:3417
13116 "Remove the file or directory C<path>, recursively removing the contents if "
13117 "its a directory. This is like the C<rm -rf> shell command."
13121 #: ../src/guestfs-actions.pod:5158
13122 msgid "guestfs_rmdir"
13126 #: ../src/guestfs-actions.pod:5160
13130 " guestfs_rmdir (guestfs_h *g,\n"
13131 " const char *path);\n"
13136 #: ../src/guestfs-actions.pod:5164 ../fish/guestfish-actions.pod:3425
13137 msgid "Remove the single directory C<path>."
13141 #: ../src/guestfs-actions.pod:5170
13142 msgid "guestfs_rmmountpoint"
13146 #: ../src/guestfs-actions.pod:5172
13150 " guestfs_rmmountpoint (guestfs_h *g,\n"
13151 " const char *exemptpath);\n"
13156 #: ../src/guestfs-actions.pod:5176
13158 "This calls removes a mountpoint that was previously created with "
13159 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13163 #: ../src/guestfs-actions.pod:5184
13164 msgid "guestfs_scrub_device"
13168 #: ../src/guestfs-actions.pod:5186
13172 " guestfs_scrub_device (guestfs_h *g,\n"
13173 " const char *device);\n"
13178 #: ../src/guestfs-actions.pod:5190 ../fish/guestfish-actions.pod:3439
13180 "This command writes patterns over C<device> to make data retrieval more "
13185 #: ../src/guestfs-actions.pod:5193 ../src/guestfs-actions.pod:5214
13186 #: ../src/guestfs-actions.pod:5233 ../fish/guestfish-actions.pod:3442
13187 #: ../fish/guestfish-actions.pod:3457 ../fish/guestfish-actions.pod:3470
13189 "It is an interface to the L<scrub(1)> program. See that manual page for "
13194 #: ../src/guestfs-actions.pod:5201 ../src/guestfs-actions.pod:5219
13195 #: ../src/guestfs-actions.pod:5238
13196 msgid "(Added in 1.0.52)"
13200 #: ../src/guestfs-actions.pod:5203
13201 msgid "guestfs_scrub_file"
13205 #: ../src/guestfs-actions.pod:5205
13209 " guestfs_scrub_file (guestfs_h *g,\n"
13210 " const char *file);\n"
13215 #: ../src/guestfs-actions.pod:5209 ../fish/guestfish-actions.pod:3452
13217 "This command writes patterns over a file to make data retrieval more "
13222 #: ../src/guestfs-actions.pod:5212 ../fish/guestfish-actions.pod:3455
13223 msgid "The file is I<removed> after scrubbing."
13227 #: ../src/guestfs-actions.pod:5221
13228 msgid "guestfs_scrub_freespace"
13232 #: ../src/guestfs-actions.pod:5223
13236 " guestfs_scrub_freespace (guestfs_h *g,\n"
13237 " const char *dir);\n"
13242 #: ../src/guestfs-actions.pod:5227
13244 "This command creates the directory C<dir> and then fills it with files until "
13245 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13246 "and deletes them. The intention is to scrub any free space on the partition "
13247 "containing C<dir>."
13251 #: ../src/guestfs-actions.pod:5240
13252 msgid "guestfs_set_append"
13256 #: ../src/guestfs-actions.pod:5242
13260 " guestfs_set_append (guestfs_h *g,\n"
13261 " const char *append);\n"
13266 #: ../src/guestfs-actions.pod:5246 ../fish/guestfish-actions.pod:3479
13268 "This function is used to add additional options to the guest kernel command "
13273 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:3482
13275 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13276 "environment variable."
13280 #: ../src/guestfs-actions.pod:5252 ../fish/guestfish-actions.pod:3485
13282 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13283 "(libguestfs always adds a few of its own)."
13287 #: ../src/guestfs-actions.pod:5259
13288 msgid "guestfs_set_autosync"
13292 #: ../src/guestfs-actions.pod:5261
13296 " guestfs_set_autosync (guestfs_h *g,\n"
13297 " int autosync);\n"
13302 #: ../src/guestfs-actions.pod:5265
13304 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13305 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13306 "the handle is closed (also if the program exits without closing handles)."
13310 #: ../src/guestfs-actions.pod:5270 ../fish/guestfish-actions.pod:3499
13312 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13313 "disabled by default)."
13317 #: ../src/guestfs-actions.pod:5277
13318 msgid "guestfs_set_direct"
13322 #: ../src/guestfs-actions.pod:5279
13326 " guestfs_set_direct (guestfs_h *g,\n"
13332 #: ../src/guestfs-actions.pod:5283 ../fish/guestfish-actions.pod:3508
13334 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13335 "passed directly through to the appliance once it is launched."
13339 #: ../src/guestfs-actions.pod:5287
13341 "One consequence of this is that log messages aren't caught by the library "
13342 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13347 #: ../src/guestfs-actions.pod:5291 ../fish/guestfish-actions.pod:3516
13348 msgid "You probably don't want to use this unless you know what you are doing."
13352 #: ../src/guestfs-actions.pod:5294 ../fish/guestfish-actions.pod:3519
13353 msgid "The default is disabled."
13357 #: ../src/guestfs-actions.pod:5300
13358 msgid "guestfs_set_e2label"
13362 #: ../src/guestfs-actions.pod:5302
13366 " guestfs_set_e2label (guestfs_h *g,\n"
13367 " const char *device,\n"
13368 " const char *label);\n"
13373 #: ../src/guestfs-actions.pod:5307 ../fish/guestfish-actions.pod:3525
13375 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13376 "C<label>. Filesystem labels are limited to 16 characters."
13380 #: ../src/guestfs-actions.pod:5311
13382 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13383 "the existing label on a filesystem."
13387 #: ../src/guestfs-actions.pod:5318
13388 msgid "guestfs_set_e2uuid"
13392 #: ../src/guestfs-actions.pod:5320
13396 " guestfs_set_e2uuid (guestfs_h *g,\n"
13397 " const char *device,\n"
13398 " const char *uuid);\n"
13403 #: ../src/guestfs-actions.pod:5325 ../fish/guestfish-actions.pod:3536
13405 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13406 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13407 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13411 #: ../src/guestfs-actions.pod:5330
13413 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13414 "the existing UUID of a filesystem."
13418 #: ../src/guestfs-actions.pod:5337
13419 msgid "guestfs_set_memsize"
13423 #: ../src/guestfs-actions.pod:5339
13427 " guestfs_set_memsize (guestfs_h *g,\n"
13433 #: ../src/guestfs-actions.pod:5343
13435 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13436 "This only has any effect if called before C<guestfs_launch>."
13440 #: ../src/guestfs-actions.pod:5347 ../fish/guestfish-actions.pod:3554
13442 "You can also change this by setting the environment variable "
13443 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13447 #: ../src/guestfs-actions.pod:5358
13448 msgid "guestfs_set_network"
13452 #: ../src/guestfs-actions.pod:5360
13456 " guestfs_set_network (guestfs_h *g,\n"
13462 #: ../src/guestfs-actions.pod:5364 ../fish/guestfish-actions.pod:3567
13464 "If C<network> is true, then the network is enabled in the libguestfs "
13465 "appliance. The default is false."
13469 #: ../src/guestfs-actions.pod:5367 ../fish/guestfish-actions.pod:3570
13471 "This affects whether commands are able to access the network (see L<guestfs"
13472 "(3)/RUNNING COMMANDS>)."
13476 #: ../src/guestfs-actions.pod:5370
13478 "You must call this before calling C<guestfs_launch>, otherwise it has no "
13483 #: ../src/guestfs-actions.pod:5377
13484 msgid "guestfs_set_path"
13488 #: ../src/guestfs-actions.pod:5379
13492 " guestfs_set_path (guestfs_h *g,\n"
13493 " const char *searchpath);\n"
13498 #: ../src/guestfs-actions.pod:5383 ../fish/guestfish-actions.pod:3582
13499 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13503 #: ../src/guestfs-actions.pod:5385 ../fish/guestfish-actions.pod:3584
13505 "The default is C<$libdir/guestfs> unless overridden by setting "
13506 "C<LIBGUESTFS_PATH> environment variable."
13510 #: ../src/guestfs-actions.pod:5388 ../fish/guestfish-actions.pod:3587
13511 msgid "Setting C<path> to C<NULL> restores the default path."
13515 #: ../src/guestfs-actions.pod:5394
13516 msgid "guestfs_set_qemu"
13520 #: ../src/guestfs-actions.pod:5396
13524 " guestfs_set_qemu (guestfs_h *g,\n"
13525 " const char *qemu);\n"
13530 #: ../src/guestfs-actions.pod:5400 ../fish/guestfish-actions.pod:3595
13531 msgid "Set the qemu binary that we will use."
13535 #: ../src/guestfs-actions.pod:5402 ../fish/guestfish-actions.pod:3597
13537 "The default is chosen when the library was compiled by the configure script."
13541 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:3600
13543 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13548 #: ../src/guestfs-actions.pod:5408 ../fish/guestfish-actions.pod:3603
13549 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13553 #: ../src/guestfs-actions.pod:5410 ../fish/guestfish-actions.pod:3605
13555 "Note that you should call this function as early as possible after creating "
13556 "the handle. This is because some pre-launch operations depend on testing "
13557 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13558 "don't retest features, and so you might see inconsistent results. Using the "
13559 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13560 "the qemu binary at the same time as the handle is created."
13564 #: ../src/guestfs-actions.pod:5422
13565 msgid "guestfs_set_recovery_proc"
13569 #: ../src/guestfs-actions.pod:5424
13573 " guestfs_set_recovery_proc (guestfs_h *g,\n"
13574 " int recoveryproc);\n"
13579 #: ../src/guestfs-actions.pod:5428
13581 "If this is called with the parameter C<false> then C<guestfs_launch> does "
13582 "not create a recovery process. The purpose of the recovery process is to "
13583 "stop runaway qemu processes in the case where the main program aborts "
13588 #: ../src/guestfs-actions.pod:5433
13590 "This only has any effect if called before C<guestfs_launch>, and the default "
13595 #: ../src/guestfs-actions.pod:5436 ../fish/guestfish-actions.pod:3627
13597 "About the only time when you would want to disable this is if the main "
13598 "process will fork itself into the background (\"daemonize\" itself). In "
13599 "this case the recovery process thinks that the main program has disappeared "
13600 "and so kills qemu, which is not very helpful."
13604 #: ../src/guestfs-actions.pod:5446
13605 msgid "guestfs_set_selinux"
13609 #: ../src/guestfs-actions.pod:5448
13613 " guestfs_set_selinux (guestfs_h *g,\n"
13619 #: ../src/guestfs-actions.pod:5452 ../fish/guestfish-actions.pod:3639
13621 "This sets the selinux flag that is passed to the appliance at boot time. "
13622 "The default is C<selinux=0> (disabled)."
13626 #: ../src/guestfs-actions.pod:5455 ../fish/guestfish-actions.pod:3642
13628 "Note that if SELinux is enabled, it is always in Permissive mode "
13629 "(C<enforcing=0>)."
13633 #: ../src/guestfs-actions.pod:5465
13634 msgid "guestfs_set_trace"
13638 #: ../src/guestfs-actions.pod:5467
13642 " guestfs_set_trace (guestfs_h *g,\n"
13648 #: ../src/guestfs-actions.pod:5471 ../fish/guestfish-actions.pod:3654
13650 "If the command trace flag is set to 1, then commands are printed on stderr "
13651 "before they are executed in a format which is very similar to the one used "
13652 "by guestfish. In other words, you can run a program with this enabled, and "
13653 "you will get out a script which you can feed to guestfish to perform the "
13654 "same set of actions."
13658 #: ../src/guestfs-actions.pod:5478 ../fish/guestfish-actions.pod:3661
13660 "If you want to trace C API calls into libguestfs (and other libraries) then "
13661 "possibly a better way is to use the external ltrace(1) command."
13665 #: ../src/guestfs-actions.pod:5482 ../fish/guestfish-actions.pod:3665
13667 "Command traces are disabled unless the environment variable "
13668 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13672 #: ../src/guestfs-actions.pod:5489
13673 msgid "guestfs_set_verbose"
13677 #: ../src/guestfs-actions.pod:5491
13681 " guestfs_set_verbose (guestfs_h *g,\n"
13687 #: ../src/guestfs-actions.pod:5495 ../fish/guestfish-actions.pod:3674
13688 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
13692 #: ../src/guestfs-actions.pod:5497 ../fish/guestfish-actions.pod:3676
13694 "Verbose messages are disabled unless the environment variable "
13695 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13699 #: ../src/guestfs-actions.pod:5504
13700 msgid "guestfs_setcon"
13704 #: ../src/guestfs-actions.pod:5506
13708 " guestfs_setcon (guestfs_h *g,\n"
13709 " const char *context);\n"
13714 #: ../src/guestfs-actions.pod:5510 ../fish/guestfish-actions.pod:3683
13716 "This sets the SELinux security context of the daemon to the string "
13721 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3686
13722 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13726 #: ../src/guestfs-actions.pod:5519
13727 msgid "guestfs_setxattr"
13731 #: ../src/guestfs-actions.pod:5521
13735 " guestfs_setxattr (guestfs_h *g,\n"
13736 " const char *xattr,\n"
13737 " const char *val,\n"
13739 " const char *path);\n"
13744 #: ../src/guestfs-actions.pod:5528 ../fish/guestfish-actions.pod:3692
13746 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13747 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13751 #: ../src/guestfs-actions.pod:5532
13752 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
13756 #: ../src/guestfs-actions.pod:5538
13757 msgid "guestfs_sfdisk"
13761 #: ../src/guestfs-actions.pod:5540
13765 " guestfs_sfdisk (guestfs_h *g,\n"
13766 " const char *device,\n"
13770 " char *const *lines);\n"
13775 #: ../src/guestfs-actions.pod:5548 ../fish/guestfish-actions.pod:3702
13777 "This is a direct interface to the L<sfdisk(8)> program for creating "
13778 "partitions on block devices."
13782 #: ../src/guestfs-actions.pod:5551 ../fish/guestfish-actions.pod:3705
13783 msgid "C<device> should be a block device, for example C</dev/sda>."
13787 #: ../src/guestfs-actions.pod:5553 ../fish/guestfish-actions.pod:3707
13789 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13790 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
13791 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13792 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13793 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13794 "the kernel) cannot work out the right geometry and you will need to tell it."
13798 #: ../src/guestfs-actions.pod:5561 ../fish/guestfish-actions.pod:3715
13800 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13801 "refer to the L<sfdisk(8)> manpage."
13805 #: ../src/guestfs-actions.pod:5564 ../fish/guestfish-actions.pod:3718
13807 "To create a single partition occupying the whole disk, you would pass "
13808 "C<lines> as a single element list, when the single element being the string "
13813 #: ../src/guestfs-actions.pod:5568
13815 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
13819 #: ../src/guestfs-actions.pod:5578
13820 msgid "guestfs_sfdiskM"
13824 #: ../src/guestfs-actions.pod:5580
13828 " guestfs_sfdiskM (guestfs_h *g,\n"
13829 " const char *device,\n"
13830 " char *const *lines);\n"
13835 #: ../src/guestfs-actions.pod:5585
13837 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
13838 "partition sizes are specified in megabytes only (rounded to the nearest "
13839 "cylinder) and you don't need to specify the cyls, heads and sectors "
13840 "parameters which were rarely if ever used anyway."
13844 #: ../src/guestfs-actions.pod:5591
13846 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
13847 "C<guestfs_part_disk>"
13851 #: ../src/guestfs-actions.pod:5601
13852 msgid "guestfs_sfdisk_N"
13856 #: ../src/guestfs-actions.pod:5603
13860 " guestfs_sfdisk_N (guestfs_h *g,\n"
13861 " const char *device,\n"
13866 " const char *line);\n"
13871 #: ../src/guestfs-actions.pod:5612 ../fish/guestfish-actions.pod:3748
13873 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13874 "(note: C<n> counts from 1)."
13878 #: ../src/guestfs-actions.pod:5615
13880 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
13881 "for the cyls/heads/sectors parameters."
13885 #: ../src/guestfs-actions.pod:5618
13886 msgid "See also: C<guestfs_part_add>"
13890 #: ../src/guestfs-actions.pod:5627
13891 msgid "guestfs_sfdisk_disk_geometry"
13895 #: ../src/guestfs-actions.pod:5629
13899 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
13900 " const char *device);\n"
13905 #: ../src/guestfs-actions.pod:5633
13907 "This displays the disk geometry of C<device> read from the partition table. "
13908 "Especially in the case where the underlying block device has been resized, "
13909 "this can be different from the kernel's idea of the geometry (see "
13910 "C<guestfs_sfdisk_kernel_geometry>)."
13914 #: ../src/guestfs-actions.pod:5638 ../src/guestfs-actions.pod:5654
13915 #: ../fish/guestfish-actions.pod:3768 ../fish/guestfish-actions.pod:3777
13916 msgid "The result is in human-readable format, and not designed to be parsed."
13920 #: ../src/guestfs-actions.pod:5646
13921 msgid "guestfs_sfdisk_kernel_geometry"
13925 #: ../src/guestfs-actions.pod:5648
13929 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
13930 " const char *device);\n"
13935 #: ../src/guestfs-actions.pod:5652 ../fish/guestfish-actions.pod:3775
13936 msgid "This displays the kernel's idea of the geometry of C<device>."
13940 #: ../src/guestfs-actions.pod:5662
13941 msgid "guestfs_sfdisk_l"
13945 #: ../src/guestfs-actions.pod:5664
13949 " guestfs_sfdisk_l (guestfs_h *g,\n"
13950 " const char *device);\n"
13955 #: ../src/guestfs-actions.pod:5668 ../fish/guestfish-actions.pod:3784
13957 "This displays the partition table on C<device>, in the human-readable output "
13958 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13962 #: ../src/guestfs-actions.pod:5672
13963 msgid "See also: C<guestfs_part_list>"
13967 #: ../src/guestfs-actions.pod:5679
13972 #: ../src/guestfs-actions.pod:5681
13976 " guestfs_sh (guestfs_h *g,\n"
13977 " const char *command);\n"
13982 #: ../src/guestfs-actions.pod:5685 ../fish/guestfish-actions.pod:3794
13984 "This call runs a command from the guest filesystem via the guest's C</bin/"
13989 #: ../src/guestfs-actions.pod:5688
13990 msgid "This is like C<guestfs_command>, but passes the command to:"
13994 #: ../src/guestfs-actions.pod:5690 ../fish/guestfish-actions.pod:3799
13997 " /bin/sh -c \"command\"\n"
14002 #: ../src/guestfs-actions.pod:5692 ../fish/guestfish-actions.pod:3801
14004 "Depending on the guest's shell, this usually results in wildcards being "
14005 "expanded, shell expressions being interpolated and so on."
14009 #: ../src/guestfs-actions.pod:5696
14010 msgid "All the provisos about C<guestfs_command> apply to this call."
14014 #: ../src/guestfs-actions.pod:5703
14015 msgid "guestfs_sh_lines"
14019 #: ../src/guestfs-actions.pod:5705
14023 " guestfs_sh_lines (guestfs_h *g,\n"
14024 " const char *command);\n"
14029 #: ../src/guestfs-actions.pod:5709
14031 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14036 #: ../src/guestfs-actions.pod:5712
14037 msgid "See also: C<guestfs_command_lines>"
14041 #: ../src/guestfs-actions.pod:5720
14042 msgid "guestfs_sleep"
14046 #: ../src/guestfs-actions.pod:5722
14050 " guestfs_sleep (guestfs_h *g,\n"
14056 #: ../src/guestfs-actions.pod:5726 ../fish/guestfish-actions.pod:3820
14057 msgid "Sleep for C<secs> seconds."
14061 #: ../src/guestfs-actions.pod:5730
14062 msgid "(Added in 1.0.41)"
14066 #: ../src/guestfs-actions.pod:5732 ../src/guestfs-structs.pod:109
14067 msgid "guestfs_stat"
14071 #: ../src/guestfs-actions.pod:5734
14074 " struct guestfs_stat *\n"
14075 " guestfs_stat (guestfs_h *g,\n"
14076 " const char *path);\n"
14081 #: ../src/guestfs-actions.pod:5740 ../fish/guestfish-actions.pod:3828
14082 msgid "This is the same as the C<stat(2)> system call."
14086 #: ../src/guestfs-actions.pod:5748 ../src/guestfs-structs.pod:135
14087 msgid "guestfs_statvfs"
14091 #: ../src/guestfs-actions.pod:5750
14094 " struct guestfs_statvfs *\n"
14095 " guestfs_statvfs (guestfs_h *g,\n"
14096 " const char *path);\n"
14101 #: ../src/guestfs-actions.pod:5754 ../fish/guestfish-actions.pod:3834
14103 "Returns file system statistics for any mounted file system. C<path> should "
14104 "be a file or directory in the mounted file system (typically it is the mount "
14105 "point itself, but it doesn't need to be)."
14109 #: ../src/guestfs-actions.pod:5758 ../fish/guestfish-actions.pod:3838
14110 msgid "This is the same as the C<statvfs(2)> system call."
14114 #: ../src/guestfs-actions.pod:5760
14116 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14117 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14121 #: ../src/guestfs-actions.pod:5766
14122 msgid "guestfs_strings"
14126 #: ../src/guestfs-actions.pod:5768
14130 " guestfs_strings (guestfs_h *g,\n"
14131 " const char *path);\n"
14136 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:3844
14138 "This runs the L<strings(1)> command on a file and returns the list of "
14139 "printable strings found."
14143 #: ../src/guestfs-actions.pod:5784
14144 msgid "guestfs_strings_e"
14148 #: ../src/guestfs-actions.pod:5786
14152 " guestfs_strings_e (guestfs_h *g,\n"
14153 " const char *encoding,\n"
14154 " const char *path);\n"
14159 #: ../src/guestfs-actions.pod:5791
14161 "This is like the C<guestfs_strings> command, but allows you to specify the "
14162 "encoding of strings that are looked for in the source file C<path>."
14166 #: ../src/guestfs-actions.pod:5795 ../fish/guestfish-actions.pod:3858
14167 msgid "Allowed encodings are:"
14171 #: ../src/guestfs-actions.pod:5799 ../fish/guestfish-actions.pod:3862
14176 #: ../src/guestfs-actions.pod:5801
14178 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14179 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14183 #: ../src/guestfs-actions.pod:5804 ../fish/guestfish-actions.pod:3867
14188 #: ../src/guestfs-actions.pod:5806 ../fish/guestfish-actions.pod:3869
14189 msgid "Single 8-bit-byte characters."
14193 #: ../src/guestfs-actions.pod:5808 ../fish/guestfish-actions.pod:3871
14198 #: ../src/guestfs-actions.pod:5810 ../fish/guestfish-actions.pod:3873
14199 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14203 #: ../src/guestfs-actions.pod:5813 ../fish/guestfish-actions.pod:3876
14204 msgid "l (lower case letter L)"
14208 #: ../src/guestfs-actions.pod:5815 ../fish/guestfish-actions.pod:3878
14210 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14211 "examining binaries in Windows guests."
14215 #: ../src/guestfs-actions.pod:5818 ../fish/guestfish-actions.pod:3881
14220 #: ../src/guestfs-actions.pod:5820 ../fish/guestfish-actions.pod:3883
14221 msgid "32-bit big endian such as UCS-4BE."
14225 #: ../src/guestfs-actions.pod:5822 ../fish/guestfish-actions.pod:3885
14230 #: ../src/guestfs-actions.pod:5824 ../fish/guestfish-actions.pod:3887
14231 msgid "32-bit little endian such as UCS-4LE."
14235 #: ../src/guestfs-actions.pod:5828 ../fish/guestfish-actions.pod:3891
14236 msgid "The returned strings are transcoded to UTF-8."
14240 #: ../src/guestfs-actions.pod:5839
14241 msgid "guestfs_swapoff_device"
14245 #: ../src/guestfs-actions.pod:5841
14249 " guestfs_swapoff_device (guestfs_h *g,\n"
14250 " const char *device);\n"
14255 #: ../src/guestfs-actions.pod:5845
14257 "This command disables the libguestfs appliance swap device or partition "
14258 "named C<device>. See C<guestfs_swapon_device>."
14262 #: ../src/guestfs-actions.pod:5853
14263 msgid "guestfs_swapoff_file"
14267 #: ../src/guestfs-actions.pod:5855
14271 " guestfs_swapoff_file (guestfs_h *g,\n"
14272 " const char *file);\n"
14277 #: ../src/guestfs-actions.pod:5859 ../fish/guestfish-actions.pod:3908
14278 msgid "This command disables the libguestfs appliance swap on file."
14282 #: ../src/guestfs-actions.pod:5865
14283 msgid "guestfs_swapoff_label"
14287 #: ../src/guestfs-actions.pod:5867
14291 " guestfs_swapoff_label (guestfs_h *g,\n"
14292 " const char *label);\n"
14297 #: ../src/guestfs-actions.pod:5871 ../fish/guestfish-actions.pod:3914
14299 "This command disables the libguestfs appliance swap on labeled swap "
14304 #: ../src/guestfs-actions.pod:5878
14305 msgid "guestfs_swapoff_uuid"
14309 #: ../src/guestfs-actions.pod:5880
14313 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14314 " const char *uuid);\n"
14319 #: ../src/guestfs-actions.pod:5884 ../fish/guestfish-actions.pod:3921
14321 "This command disables the libguestfs appliance swap partition with the given "
14326 #: ../src/guestfs-actions.pod:5891
14327 msgid "guestfs_swapon_device"
14331 #: ../src/guestfs-actions.pod:5893
14335 " guestfs_swapon_device (guestfs_h *g,\n"
14336 " const char *device);\n"
14341 #: ../src/guestfs-actions.pod:5897
14343 "This command enables the libguestfs appliance to use the swap device or "
14344 "partition named C<device>. The increased memory is made available for all "
14345 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14349 #: ../src/guestfs-actions.pod:5902 ../fish/guestfish-actions.pod:3933
14351 "Note that you should not swap to existing guest swap partitions unless you "
14352 "know what you are doing. They may contain hibernation information, or other "
14353 "information that the guest doesn't want you to trash. You also risk leaking "
14354 "information about the host to the guest this way. Instead, attach a new "
14355 "host device to the guest and swap on that."
14359 #: ../src/guestfs-actions.pod:5913
14360 msgid "guestfs_swapon_file"
14364 #: ../src/guestfs-actions.pod:5915
14368 " guestfs_swapon_file (guestfs_h *g,\n"
14369 " const char *file);\n"
14374 #: ../src/guestfs-actions.pod:5919
14376 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14381 #: ../src/guestfs-actions.pod:5926
14382 msgid "guestfs_swapon_label"
14386 #: ../src/guestfs-actions.pod:5928
14390 " guestfs_swapon_label (guestfs_h *g,\n"
14391 " const char *label);\n"
14396 #: ../src/guestfs-actions.pod:5932
14398 "This command enables swap to a labeled swap partition. See "
14399 "C<guestfs_swapon_device> for other notes."
14403 #: ../src/guestfs-actions.pod:5939
14404 msgid "guestfs_swapon_uuid"
14408 #: ../src/guestfs-actions.pod:5941
14412 " guestfs_swapon_uuid (guestfs_h *g,\n"
14413 " const char *uuid);\n"
14418 #: ../src/guestfs-actions.pod:5945
14420 "This command enables swap to a swap partition with the given UUID. See "
14421 "C<guestfs_swapon_device> for other notes."
14425 #: ../src/guestfs-actions.pod:5952
14426 msgid "guestfs_sync"
14430 #: ../src/guestfs-actions.pod:5954
14434 " guestfs_sync (guestfs_h *g);\n"
14439 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:3965
14441 "This syncs the disk, so that any writes are flushed through to the "
14442 "underlying disk image."
14446 #: ../src/guestfs-actions.pod:5960 ../fish/guestfish-actions.pod:3968
14448 "You should always call this if you have modified a disk image, before "
14449 "closing the handle."
14453 #: ../src/guestfs-actions.pod:5967
14454 msgid "guestfs_tail"
14458 #: ../src/guestfs-actions.pod:5969
14462 " guestfs_tail (guestfs_h *g,\n"
14463 " const char *path);\n"
14468 #: ../src/guestfs-actions.pod:5973 ../fish/guestfish-actions.pod:3975
14470 "This command returns up to the last 10 lines of a file as a list of strings."
14474 #: ../src/guestfs-actions.pod:5985
14475 msgid "guestfs_tail_n"
14479 #: ../src/guestfs-actions.pod:5987
14483 " guestfs_tail_n (guestfs_h *g,\n"
14485 " const char *path);\n"
14490 #: ../src/guestfs-actions.pod:5992 ../fish/guestfish-actions.pod:3985
14492 "If the parameter C<nrlines> is a positive number, this returns the last "
14493 "C<nrlines> lines of the file C<path>."
14497 #: ../src/guestfs-actions.pod:5995 ../fish/guestfish-actions.pod:3988
14499 "If the parameter C<nrlines> is a negative number, this returns lines from "
14500 "the file C<path>, starting with the C<-nrlines>th line."
14504 #: ../src/guestfs-actions.pod:6009
14505 msgid "guestfs_tar_in"
14509 #: ../src/guestfs-actions.pod:6011
14513 " guestfs_tar_in (guestfs_h *g,\n"
14514 " const char *tarfile,\n"
14515 " const char *directory);\n"
14520 #: ../src/guestfs-actions.pod:6016 ../fish/guestfish-actions.pod:4000
14522 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14523 "tar file) into C<directory>."
14527 #: ../src/guestfs-actions.pod:6019
14529 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
14533 #: ../src/guestfs-actions.pod:6024 ../src/guestfs-actions.pod:6041
14534 #: ../src/guestfs-actions.pod:6057 ../src/guestfs-actions.pod:6073
14535 msgid "(Added in 1.0.3)"
14539 #: ../src/guestfs-actions.pod:6026
14540 msgid "guestfs_tar_out"
14544 #: ../src/guestfs-actions.pod:6028
14548 " guestfs_tar_out (guestfs_h *g,\n"
14549 " const char *directory,\n"
14550 " const char *tarfile);\n"
14555 #: ../src/guestfs-actions.pod:6033 ../fish/guestfish-actions.pod:4012
14557 "This command packs the contents of C<directory> and downloads it to local "
14562 #: ../src/guestfs-actions.pod:6036
14564 "To download a compressed tarball, use C<guestfs_tgz_out> or "
14565 "C<guestfs_txz_out>."
14569 #: ../src/guestfs-actions.pod:6043
14570 msgid "guestfs_tgz_in"
14574 #: ../src/guestfs-actions.pod:6045
14578 " guestfs_tgz_in (guestfs_h *g,\n"
14579 " const char *tarball,\n"
14580 " const char *directory);\n"
14585 #: ../src/guestfs-actions.pod:6050 ../fish/guestfish-actions.pod:4024
14587 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14588 "tar file) into C<directory>."
14592 #: ../src/guestfs-actions.pod:6053
14593 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
14597 #: ../src/guestfs-actions.pod:6059
14598 msgid "guestfs_tgz_out"
14602 #: ../src/guestfs-actions.pod:6061
14606 " guestfs_tgz_out (guestfs_h *g,\n"
14607 " const char *directory,\n"
14608 " const char *tarball);\n"
14613 #: ../src/guestfs-actions.pod:6066 ../fish/guestfish-actions.pod:4035
14615 "This command packs the contents of C<directory> and downloads it to local "
14620 #: ../src/guestfs-actions.pod:6069
14621 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
14625 #: ../src/guestfs-actions.pod:6075
14626 msgid "guestfs_touch"
14630 #: ../src/guestfs-actions.pod:6077
14634 " guestfs_touch (guestfs_h *g,\n"
14635 " const char *path);\n"
14640 #: ../src/guestfs-actions.pod:6081 ../fish/guestfish-actions.pod:4046
14642 "Touch acts like the L<touch(1)> command. It can be used to update the "
14643 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14648 #: ../src/guestfs-actions.pod:6085 ../fish/guestfish-actions.pod:4050
14650 "This command only works on regular files, and will fail on other file types "
14651 "such as directories, symbolic links, block special etc."
14655 #: ../src/guestfs-actions.pod:6092
14656 msgid "guestfs_truncate"
14660 #: ../src/guestfs-actions.pod:6094
14664 " guestfs_truncate (guestfs_h *g,\n"
14665 " const char *path);\n"
14670 #: ../src/guestfs-actions.pod:6098 ../fish/guestfish-actions.pod:4057
14672 "This command truncates C<path> to a zero-length file. The file must exist "
14677 #: ../src/guestfs-actions.pod:6105
14678 msgid "guestfs_truncate_size"
14682 #: ../src/guestfs-actions.pod:6107
14686 " guestfs_truncate_size (guestfs_h *g,\n"
14687 " const char *path,\n"
14688 " int64_t size);\n"
14693 #: ../src/guestfs-actions.pod:6112 ../fish/guestfish-actions.pod:4064
14695 "This command truncates C<path> to size C<size> bytes. The file must exist "
14700 #: ../src/guestfs-actions.pod:6115
14702 "If the current file size is less than C<size> then the file is extended to "
14703 "the required size with zero bytes. This creates a sparse file (ie. disk "
14704 "blocks are not allocated for the file until you write to it). To create a "
14705 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
14709 #: ../src/guestfs-actions.pod:6125
14710 msgid "guestfs_tune2fs_l"
14714 #: ../src/guestfs-actions.pod:6127
14718 " guestfs_tune2fs_l (guestfs_h *g,\n"
14719 " const char *device);\n"
14724 #: ../src/guestfs-actions.pod:6131 ../fish/guestfish-actions.pod:4077
14726 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14731 #: ../src/guestfs-actions.pod:6134 ../fish/guestfish-actions.pod:4080
14733 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14734 "for more details. The list of fields returned isn't clearly defined, and "
14735 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14736 "and the filesystem itself."
14740 #: ../src/guestfs-actions.pod:6147
14741 msgid "guestfs_txz_in"
14745 #: ../src/guestfs-actions.pod:6149
14749 " guestfs_txz_in (guestfs_h *g,\n"
14750 " const char *tarball,\n"
14751 " const char *directory);\n"
14756 #: ../src/guestfs-actions.pod:6154 ../fish/guestfish-actions.pod:4089
14758 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14759 "tar file) into C<directory>."
14763 #: ../src/guestfs-actions.pod:6161
14764 msgid "guestfs_txz_out"
14768 #: ../src/guestfs-actions.pod:6163
14772 " guestfs_txz_out (guestfs_h *g,\n"
14773 " const char *directory,\n"
14774 " const char *tarball);\n"
14779 #: ../src/guestfs-actions.pod:6168 ../fish/guestfish-actions.pod:4098
14781 "This command packs the contents of C<directory> and downloads it to local "
14782 "file C<tarball> (as an xz compressed tar archive)."
14786 #: ../src/guestfs-actions.pod:6175
14787 msgid "guestfs_umask"
14791 #: ../src/guestfs-actions.pod:6177
14795 " guestfs_umask (guestfs_h *g,\n"
14801 #: ../src/guestfs-actions.pod:6181 ../fish/guestfish-actions.pod:4107
14803 "This function sets the mask used for creating new files and device nodes to "
14808 #: ../src/guestfs-actions.pod:6184 ../fish/guestfish-actions.pod:4110
14810 "Typical umask values would be C<022> which creates new files with "
14811 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14812 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14816 #: ../src/guestfs-actions.pod:6189 ../fish/guestfish-actions.pod:4115
14818 "The default umask is C<022>. This is important because it means that "
14819 "directories and device nodes will be created with C<0644> or C<0755> mode "
14820 "even if you specify C<0777>."
14824 #: ../src/guestfs-actions.pod:6193
14826 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
14827 "C<guestfs_mkdir>."
14831 #: ../src/guestfs-actions.pod:6196 ../fish/guestfish-actions.pod:4122
14832 msgid "This call returns the previous umask."
14836 #: ../src/guestfs-actions.pod:6202
14837 msgid "guestfs_umount"
14841 #: ../src/guestfs-actions.pod:6204
14845 " guestfs_umount (guestfs_h *g,\n"
14846 " const char *pathordevice);\n"
14851 #: ../src/guestfs-actions.pod:6208 ../fish/guestfish-actions.pod:4130
14853 "This unmounts the given filesystem. The filesystem may be specified either "
14854 "by its mountpoint (path) or the device which contains the filesystem."
14858 #: ../src/guestfs-actions.pod:6216
14859 msgid "guestfs_umount_all"
14863 #: ../src/guestfs-actions.pod:6218
14867 " guestfs_umount_all (guestfs_h *g);\n"
14872 #: ../src/guestfs-actions.pod:6221 ../fish/guestfish-actions.pod:4140
14873 msgid "This unmounts all mounted filesystems."
14877 #: ../src/guestfs-actions.pod:6223 ../fish/guestfish-actions.pod:4142
14878 msgid "Some internal mounts are not unmounted by this call."
14882 #: ../src/guestfs-actions.pod:6229
14883 msgid "guestfs_upload"
14887 #: ../src/guestfs-actions.pod:6231
14891 " guestfs_upload (guestfs_h *g,\n"
14892 " const char *filename,\n"
14893 " const char *remotefilename);\n"
14898 #: ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6255
14899 #: ../fish/guestfish-actions.pod:4148 ../fish/guestfish-actions.pod:4161
14900 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14904 #: ../src/guestfs-actions.pod:6241
14905 msgid "See also C<guestfs_download>."
14909 #: ../src/guestfs-actions.pod:6247
14910 msgid "guestfs_upload_offset"
14914 #: ../src/guestfs-actions.pod:6249
14918 " guestfs_upload_offset (guestfs_h *g,\n"
14919 " const char *filename,\n"
14920 " const char *remotefilename,\n"
14921 " int64_t offset);\n"
14926 #: ../src/guestfs-actions.pod:6258 ../fish/guestfish-actions.pod:4164
14928 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14929 "The intention is to overwrite parts of existing files or devices, although "
14930 "if a non-existant file is specified then it is created with a \"hole\" "
14931 "before C<offset>. The size of the data written is implicit in the size of "
14932 "the source C<filename>."
14936 #: ../src/guestfs-actions.pod:6265
14938 "Note that there is no limit on the amount of data that can be uploaded with "
14939 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
14940 "full amount unless an error occurs."
14944 #: ../src/guestfs-actions.pod:6270
14945 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
14949 #: ../src/guestfs-actions.pod:6276
14950 msgid "guestfs_utimens"
14954 #: ../src/guestfs-actions.pod:6278
14958 " guestfs_utimens (guestfs_h *g,\n"
14959 " const char *path,\n"
14960 " int64_t atsecs,\n"
14961 " int64_t atnsecs,\n"
14962 " int64_t mtsecs,\n"
14963 " int64_t mtnsecs);\n"
14968 #: ../src/guestfs-actions.pod:6286 ../fish/guestfish-actions.pod:4184
14969 msgid "This command sets the timestamps of a file with nanosecond precision."
14973 #: ../src/guestfs-actions.pod:6289 ../fish/guestfish-actions.pod:4187
14975 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14980 #: ../src/guestfs-actions.pod:6292 ../fish/guestfish-actions.pod:4190
14982 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14983 "nanoseconds from the epoch."
14987 #: ../src/guestfs-actions.pod:6295 ../fish/guestfish-actions.pod:4193
14989 "If the C<*nsecs> field contains the special value C<-1> then the "
14990 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14991 "ignored in this case)."
14995 #: ../src/guestfs-actions.pod:6299 ../fish/guestfish-actions.pod:4197
14997 "If the C<*nsecs> field contains the special value C<-2> then the "
14998 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15003 #: ../src/guestfs-actions.pod:6307 ../src/guestfs-structs.pod:175
15004 msgid "guestfs_version"
15008 #: ../src/guestfs-actions.pod:6309
15011 " struct guestfs_version *\n"
15012 " guestfs_version (guestfs_h *g);\n"
15017 #: ../src/guestfs-actions.pod:6312 ../fish/guestfish-actions.pod:4205
15019 "Return the libguestfs version number that the program is linked against."
15023 #: ../src/guestfs-actions.pod:6315 ../fish/guestfish-actions.pod:4208
15025 "Note that because of dynamic linking this is not necessarily the version of "
15026 "libguestfs that you compiled against. You can compile the program, and then "
15027 "at runtime dynamically link against a completely different C<libguestfs.so> "
15032 #: ../src/guestfs-actions.pod:6320 ../fish/guestfish-actions.pod:4213
15034 "This call was added in version C<1.0.58>. In previous versions of "
15035 "libguestfs there was no way to get the version number. From C code you can "
15036 "use dynamic linker functions to find out if this symbol exists (if it "
15037 "doesn't, then it's an earlier version)."
15041 #: ../src/guestfs-actions.pod:6326 ../fish/guestfish-actions.pod:4219
15043 "The call returns a structure with four elements. The first three (C<major>, "
15044 "C<minor> and C<release>) are numbers and correspond to the usual version "
15045 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15046 "but may be used for distro-specific information."
15050 #: ../src/guestfs-actions.pod:6332 ../fish/guestfish-actions.pod:4225
15052 "To construct the original version string: C<$major.$minor.$release$extra>"
15056 #: ../src/guestfs-actions.pod:6335 ../fish/guestfish-actions.pod:4228
15057 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15061 #: ../src/guestfs-actions.pod:6337
15063 "I<Note:> Don't use this call to test for availability of features. In "
15064 "enterprise distributions we backport features from later versions into "
15065 "earlier versions, making this an unreliable way to test for features. Use "
15066 "C<guestfs_available> instead."
15070 #: ../src/guestfs-actions.pod:6343
15072 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15073 "error. I<The caller must call C<guestfs_free_version> after use>."
15077 #: ../src/guestfs-actions.pod:6347
15078 msgid "(Added in 1.0.58)"
15082 #: ../src/guestfs-actions.pod:6349
15083 msgid "guestfs_vfs_label"
15087 #: ../src/guestfs-actions.pod:6351
15091 " guestfs_vfs_label (guestfs_h *g,\n"
15092 " const char *device);\n"
15097 #: ../src/guestfs-actions.pod:6355 ../fish/guestfish-actions.pod:4240
15098 msgid "This returns the filesystem label of the filesystem on C<device>."
15102 #: ../src/guestfs-actions.pod:6358 ../fish/guestfish-actions.pod:4243
15103 msgid "If the filesystem is unlabeled, this returns the empty string."
15107 #: ../src/guestfs-actions.pod:6360
15108 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15112 #: ../src/guestfs-actions.pod:6365 ../src/guestfs-actions.pod:6402
15113 msgid "(Added in 1.3.18)"
15117 #: ../src/guestfs-actions.pod:6367
15118 msgid "guestfs_vfs_type"
15122 #: ../src/guestfs-actions.pod:6369
15126 " guestfs_vfs_type (guestfs_h *g,\n"
15127 " const char *device);\n"
15132 #: ../src/guestfs-actions.pod:6373 ../fish/guestfish-actions.pod:4251
15134 "This command gets the filesystem type corresponding to the filesystem on "
15139 #: ../src/guestfs-actions.pod:6376 ../fish/guestfish-actions.pod:4254
15141 "For most filesystems, the result is the name of the Linux VFS module which "
15142 "would be used to mount this filesystem if you mounted it without specifying "
15143 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15147 #: ../src/guestfs-actions.pod:6386
15148 msgid "guestfs_vfs_uuid"
15152 #: ../src/guestfs-actions.pod:6388
15156 " guestfs_vfs_uuid (guestfs_h *g,\n"
15157 " const char *device);\n"
15162 #: ../src/guestfs-actions.pod:6392 ../fish/guestfish-actions.pod:4263
15163 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15167 #: ../src/guestfs-actions.pod:6395 ../fish/guestfish-actions.pod:4266
15168 msgid "If the filesystem does not have a UUID, this returns the empty string."
15172 #: ../src/guestfs-actions.pod:6397
15173 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15177 #: ../src/guestfs-actions.pod:6404
15178 msgid "guestfs_vg_activate"
15182 #: ../src/guestfs-actions.pod:6406
15186 " guestfs_vg_activate (guestfs_h *g,\n"
15188 " char *const *volgroups);\n"
15193 #: ../src/guestfs-actions.pod:6411 ../fish/guestfish-actions.pod:4274
15195 "This command activates or (if C<activate> is false) deactivates all logical "
15196 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15197 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15198 "deactivated, then those devices disappear."
15202 #: ../src/guestfs-actions.pod:6417 ../fish/guestfish-actions.pod:4280
15203 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15207 #: ../src/guestfs-actions.pod:6419 ../fish/guestfish-actions.pod:4282
15209 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15210 "activated or deactivated."
15214 #: ../src/guestfs-actions.pod:6426
15215 msgid "guestfs_vg_activate_all"
15219 #: ../src/guestfs-actions.pod:6428
15223 " guestfs_vg_activate_all (guestfs_h *g,\n"
15224 " int activate);\n"
15229 #: ../src/guestfs-actions.pod:6432 ../fish/guestfish-actions.pod:4289
15231 "This command activates or (if C<activate> is false) deactivates all logical "
15232 "volumes in all volume groups. If activated, then they are made known to the "
15233 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15234 "those devices disappear."
15238 #: ../src/guestfs-actions.pod:6438 ../fish/guestfish-actions.pod:4295
15239 msgid "This command is the same as running C<vgchange -a y|n>"
15243 #: ../src/guestfs-actions.pod:6444
15244 msgid "guestfs_vgcreate"
15248 #: ../src/guestfs-actions.pod:6446
15252 " guestfs_vgcreate (guestfs_h *g,\n"
15253 " const char *volgroup,\n"
15254 " char *const *physvols);\n"
15259 #: ../src/guestfs-actions.pod:6451 ../fish/guestfish-actions.pod:4301
15261 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15262 "of physical volumes C<physvols>."
15266 #: ../src/guestfs-actions.pod:6458
15267 msgid "guestfs_vglvuuids"
15271 #: ../src/guestfs-actions.pod:6460
15275 " guestfs_vglvuuids (guestfs_h *g,\n"
15276 " const char *vgname);\n"
15281 #: ../src/guestfs-actions.pod:6464 ../fish/guestfish-actions.pod:4308
15283 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15284 "volumes created in this volume group."
15288 #: ../src/guestfs-actions.pod:6467
15290 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15291 "associate logical volumes and volume groups."
15295 #: ../src/guestfs-actions.pod:6470
15296 msgid "See also C<guestfs_vgpvuuids>."
15300 #: ../src/guestfs-actions.pod:6478
15301 msgid "guestfs_vgpvuuids"
15305 #: ../src/guestfs-actions.pod:6480
15309 " guestfs_vgpvuuids (guestfs_h *g,\n"
15310 " const char *vgname);\n"
15315 #: ../src/guestfs-actions.pod:6484 ../fish/guestfish-actions.pod:4320
15317 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15318 "volumes that this volume group resides on."
15322 #: ../src/guestfs-actions.pod:6487
15324 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15325 "associate physical volumes and volume groups."
15329 #: ../src/guestfs-actions.pod:6490
15330 msgid "See also C<guestfs_vglvuuids>."
15334 #: ../src/guestfs-actions.pod:6498
15335 msgid "guestfs_vgremove"
15339 #: ../src/guestfs-actions.pod:6500
15343 " guestfs_vgremove (guestfs_h *g,\n"
15344 " const char *vgname);\n"
15349 #: ../src/guestfs-actions.pod:6504 ../fish/guestfish-actions.pod:4332
15350 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15354 #: ../src/guestfs-actions.pod:6506 ../fish/guestfish-actions.pod:4334
15356 "This also forcibly removes all logical volumes in the volume group (if any)."
15360 #: ../src/guestfs-actions.pod:6513
15361 msgid "guestfs_vgrename"
15365 #: ../src/guestfs-actions.pod:6515
15369 " guestfs_vgrename (guestfs_h *g,\n"
15370 " const char *volgroup,\n"
15371 " const char *newvolgroup);\n"
15376 #: ../src/guestfs-actions.pod:6520 ../fish/guestfish-actions.pod:4341
15377 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15381 #: ../src/guestfs-actions.pod:6526
15382 msgid "guestfs_vgs"
15386 #: ../src/guestfs-actions.pod:6528
15390 " guestfs_vgs (guestfs_h *g);\n"
15395 #: ../src/guestfs-actions.pod:6531 ../fish/guestfish-actions.pod:4347
15397 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15402 #: ../src/guestfs-actions.pod:6534 ../fish/guestfish-actions.pod:4350
15404 "This returns a list of just the volume group names that were detected (eg. "
15409 #: ../src/guestfs-actions.pod:6537
15410 msgid "See also C<guestfs_vgs_full>."
15414 #: ../src/guestfs-actions.pod:6545
15415 msgid "guestfs_vgs_full"
15419 #: ../src/guestfs-actions.pod:6547
15422 " struct guestfs_lvm_vg_list *\n"
15423 " guestfs_vgs_full (guestfs_h *g);\n"
15428 #: ../src/guestfs-actions.pod:6550 ../fish/guestfish-actions.pod:4359
15430 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15431 "> command. The \"full\" version includes all fields."
15435 #: ../src/guestfs-actions.pod:6553
15437 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15438 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
15442 #: ../src/guestfs-actions.pod:6559
15443 msgid "guestfs_vgscan"
15447 #: ../src/guestfs-actions.pod:6561
15451 " guestfs_vgscan (guestfs_h *g);\n"
15456 #: ../src/guestfs-actions.pod:6564 ../fish/guestfish-actions.pod:4366
15458 "This rescans all block devices and rebuilds the list of LVM physical "
15459 "volumes, volume groups and logical volumes."
15463 #: ../src/guestfs-actions.pod:6571
15464 msgid "guestfs_vguuid"
15468 #: ../src/guestfs-actions.pod:6573
15472 " guestfs_vguuid (guestfs_h *g,\n"
15473 " const char *vgname);\n"
15478 #: ../src/guestfs-actions.pod:6577 ../fish/guestfish-actions.pod:4373
15479 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15483 #: ../src/guestfs-actions.pod:6584
15484 msgid "guestfs_wait_ready"
15488 #: ../src/guestfs-actions.pod:6586
15492 " guestfs_wait_ready (guestfs_h *g);\n"
15497 #: ../src/guestfs-actions.pod:6589
15498 msgid "This function is a no op."
15502 #: ../src/guestfs-actions.pod:6591
15504 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
15505 "calling C<guestfs_launch> to wait for the launch to complete. However this "
15506 "is no longer necessary because C<guestfs_launch> now does the waiting."
15510 #: ../src/guestfs-actions.pod:6596
15512 "If you see any calls to this function in code then you can just remove them, "
15513 "unless you want to retain compatibility with older versions of the API."
15517 #: ../src/guestfs-actions.pod:6604
15518 msgid "guestfs_wc_c"
15522 #: ../src/guestfs-actions.pod:6606
15526 " guestfs_wc_c (guestfs_h *g,\n"
15527 " const char *path);\n"
15532 #: ../src/guestfs-actions.pod:6610 ../fish/guestfish-actions.pod:4379
15534 "This command counts the characters in a file, using the C<wc -c> external "
15539 #: ../src/guestfs-actions.pod:6617
15540 msgid "guestfs_wc_l"
15544 #: ../src/guestfs-actions.pod:6619
15548 " guestfs_wc_l (guestfs_h *g,\n"
15549 " const char *path);\n"
15554 #: ../src/guestfs-actions.pod:6623 ../fish/guestfish-actions.pod:4386
15556 "This command counts the lines in a file, using the C<wc -l> external command."
15560 #: ../src/guestfs-actions.pod:6630
15561 msgid "guestfs_wc_w"
15565 #: ../src/guestfs-actions.pod:6632
15569 " guestfs_wc_w (guestfs_h *g,\n"
15570 " const char *path);\n"
15575 #: ../src/guestfs-actions.pod:6636 ../fish/guestfish-actions.pod:4393
15577 "This command counts the words in a file, using the C<wc -w> external command."
15581 #: ../src/guestfs-actions.pod:6643
15582 msgid "guestfs_write"
15586 #: ../src/guestfs-actions.pod:6645
15590 " guestfs_write (guestfs_h *g,\n"
15591 " const char *path,\n"
15592 " const char *content,\n"
15593 " size_t content_size);\n"
15598 #: ../src/guestfs-actions.pod:6651 ../fish/guestfish-actions.pod:4400
15600 "This call creates a file called C<path>. The content of the file is the "
15601 "string C<content> (which can contain any 8 bit data)."
15605 #: ../src/guestfs-actions.pod:6661
15606 msgid "guestfs_write_file"
15610 #: ../src/guestfs-actions.pod:6663
15614 " guestfs_write_file (guestfs_h *g,\n"
15615 " const char *path,\n"
15616 " const char *content,\n"
15622 #: ../src/guestfs-actions.pod:6669 ../fish/guestfish-actions.pod:4410
15624 "This call creates a file called C<path>. The contents of the file is the "
15625 "string C<content> (which can contain any 8 bit data), with length C<size>."
15629 #: ../src/guestfs-actions.pod:6673 ../fish/guestfish-actions.pod:4414
15631 "As a special case, if C<size> is C<0> then the length is calculated using "
15632 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15636 #: ../src/guestfs-actions.pod:6677 ../fish/guestfish-actions.pod:4418
15638 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15639 "I<not> work, even if the length is specified."
15643 #: ../src/guestfs-actions.pod:6685 ../fish/guestfish-actions.pod:4424
15645 "This function is deprecated. In new code, use the C<write> call instead."
15649 #: ../src/guestfs-actions.pod:6694
15650 msgid "guestfs_zegrep"
15654 #: ../src/guestfs-actions.pod:6696
15658 " guestfs_zegrep (guestfs_h *g,\n"
15659 " const char *regex,\n"
15660 " const char *path);\n"
15665 #: ../src/guestfs-actions.pod:6701 ../fish/guestfish-actions.pod:4435
15667 "This calls the external C<zegrep> program and returns the matching lines."
15671 #: ../src/guestfs-actions.pod:6713
15672 msgid "guestfs_zegrepi"
15676 #: ../src/guestfs-actions.pod:6715
15680 " guestfs_zegrepi (guestfs_h *g,\n"
15681 " const char *regex,\n"
15682 " const char *path);\n"
15687 #: ../src/guestfs-actions.pod:6720 ../fish/guestfish-actions.pod:4445
15689 "This calls the external C<zegrep -i> program and returns the matching lines."
15693 #: ../src/guestfs-actions.pod:6732
15694 msgid "guestfs_zero"
15698 #: ../src/guestfs-actions.pod:6734
15702 " guestfs_zero (guestfs_h *g,\n"
15703 " const char *device);\n"
15708 #: ../src/guestfs-actions.pod:6738 ../fish/guestfish-actions.pod:4455
15709 msgid "This command writes zeroes over the first few blocks of C<device>."
15713 #: ../src/guestfs-actions.pod:6740 ../fish/guestfish-actions.pod:4457
15715 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15716 "securely wipe the device). It should be sufficient to remove any partition "
15717 "tables, filesystem superblocks and so on."
15721 #: ../src/guestfs-actions.pod:6744
15722 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
15726 #: ../src/guestfs-actions.pod:6755
15727 msgid "guestfs_zero_device"
15731 #: ../src/guestfs-actions.pod:6757
15735 " guestfs_zero_device (guestfs_h *g,\n"
15736 " const char *device);\n"
15741 #: ../src/guestfs-actions.pod:6761
15743 "This command writes zeroes over the entire C<device>. Compare with "
15744 "C<guestfs_zero> which just zeroes the first few blocks of a device."
15748 #: ../src/guestfs-actions.pod:6775
15749 msgid "(Added in 1.3.1)"
15753 #: ../src/guestfs-actions.pod:6777
15754 msgid "guestfs_zerofree"
15758 #: ../src/guestfs-actions.pod:6779
15762 " guestfs_zerofree (guestfs_h *g,\n"
15763 " const char *device);\n"
15768 #: ../src/guestfs-actions.pod:6783 ../fish/guestfish-actions.pod:4478
15770 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15771 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15772 "possible to compress the filesystem more effectively."
15776 #: ../src/guestfs-actions.pod:6788 ../fish/guestfish-actions.pod:4483
15777 msgid "You should B<not> run this program if the filesystem is mounted."
15781 #: ../src/guestfs-actions.pod:6791 ../fish/guestfish-actions.pod:4486
15783 "It is possible that using this program can damage the filesystem or data on "
15788 #: ../src/guestfs-actions.pod:6798
15789 msgid "guestfs_zfgrep"
15793 #: ../src/guestfs-actions.pod:6800
15797 " guestfs_zfgrep (guestfs_h *g,\n"
15798 " const char *pattern,\n"
15799 " const char *path);\n"
15804 #: ../src/guestfs-actions.pod:6805 ../fish/guestfish-actions.pod:4493
15806 "This calls the external C<zfgrep> program and returns the matching lines."
15810 #: ../src/guestfs-actions.pod:6817
15811 msgid "guestfs_zfgrepi"
15815 #: ../src/guestfs-actions.pod:6819
15819 " guestfs_zfgrepi (guestfs_h *g,\n"
15820 " const char *pattern,\n"
15821 " const char *path);\n"
15826 #: ../src/guestfs-actions.pod:6824 ../fish/guestfish-actions.pod:4503
15828 "This calls the external C<zfgrep -i> program and returns the matching lines."
15832 #: ../src/guestfs-actions.pod:6836
15833 msgid "guestfs_zfile"
15837 #: ../src/guestfs-actions.pod:6838
15841 " guestfs_zfile (guestfs_h *g,\n"
15842 " const char *meth,\n"
15843 " const char *path);\n"
15848 #: ../src/guestfs-actions.pod:6843 ../fish/guestfish-actions.pod:4513
15850 "This command runs C<file> after first decompressing C<path> using C<method>."
15854 #: ../src/guestfs-actions.pod:6846 ../fish/guestfish-actions.pod:4516
15855 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15859 #: ../src/guestfs-actions.pod:6848
15861 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
15866 #: ../src/guestfs-actions.pod:6854 ../fish/guestfish-actions.pod:4521
15868 "This function is deprecated. In new code, use the C<file> call instead."
15872 #: ../src/guestfs-actions.pod:6863
15873 msgid "guestfs_zgrep"
15877 #: ../src/guestfs-actions.pod:6865
15881 " guestfs_zgrep (guestfs_h *g,\n"
15882 " const char *regex,\n"
15883 " const char *path);\n"
15888 #: ../src/guestfs-actions.pod:6870 ../fish/guestfish-actions.pod:4532
15890 "This calls the external C<zgrep> program and returns the matching lines."
15894 #: ../src/guestfs-actions.pod:6882
15895 msgid "guestfs_zgrepi"
15899 #: ../src/guestfs-actions.pod:6884
15903 " guestfs_zgrepi (guestfs_h *g,\n"
15904 " const char *regex,\n"
15905 " const char *path);\n"
15910 #: ../src/guestfs-actions.pod:6889 ../fish/guestfish-actions.pod:4542
15912 "This calls the external C<zgrep -i> program and returns the matching lines."
15916 #: ../src/guestfs-availability.pod:3
15921 #: ../src/guestfs-availability.pod:5
15923 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
15924 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
15925 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
15926 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
15927 "L</guestfs_aug_save> L</guestfs_aug_set>"
15931 #: ../src/guestfs-availability.pod:21
15936 #: ../src/guestfs-availability.pod:23
15938 "The following functions: L</guestfs_inotify_add_watch> L</"
15939 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
15940 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
15944 #: ../src/guestfs-availability.pod:31
15945 msgid "B<linuxfsuuid>"
15949 #: ../src/guestfs-availability.pod:33
15951 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
15952 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
15956 #: ../src/guestfs-availability.pod:40
15957 msgid "B<linuxmodules>"
15961 #: ../src/guestfs-availability.pod:42
15962 msgid "The following functions: L</guestfs_modprobe>"
15966 #: ../src/guestfs-availability.pod:45
15967 msgid "B<linuxxattrs>"
15971 #: ../src/guestfs-availability.pod:47
15973 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
15974 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
15975 "guestfs_removexattr> L</guestfs_setxattr>"
15979 #: ../src/guestfs-availability.pod:56
15984 #: ../src/guestfs-availability.pod:58
15986 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
15987 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
15988 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
15992 #: ../src/guestfs-availability.pod:67
15997 #: ../src/guestfs-availability.pod:69
15999 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16000 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16001 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16002 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16003 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16004 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16005 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16009 #: ../src/guestfs-availability.pod:92
16014 #: ../src/guestfs-availability.pod:94
16016 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16017 "guestfs_mknod_b> L</guestfs_mknod_c>"
16021 #: ../src/guestfs-availability.pod:100
16026 #: ../src/guestfs-availability.pod:102
16027 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16031 #: ../src/guestfs-availability.pod:105
16032 msgid "B<ntfsprogs>"
16036 #: ../src/guestfs-availability.pod:107
16038 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16042 #: ../src/guestfs-availability.pod:111
16043 msgid "B<realpath>"
16047 #: ../src/guestfs-availability.pod:113
16048 msgid "The following functions: L</guestfs_realpath>"
16052 #: ../src/guestfs-availability.pod:116
16057 #: ../src/guestfs-availability.pod:118
16059 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16060 "guestfs_scrub_freespace>"
16064 #: ../src/guestfs-availability.pod:123
16069 #: ../src/guestfs-availability.pod:125
16070 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16074 #: ../src/guestfs-availability.pod:129
16079 #: ../src/guestfs-availability.pod:131
16080 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16084 #: ../src/guestfs-availability.pod:135
16085 msgid "B<zerofree>"
16089 #: ../src/guestfs-availability.pod:137
16090 msgid "The following functions: L</guestfs_zerofree>"
16094 #: ../src/guestfs-structs.pod:1
16095 msgid "guestfs_int_bool"
16099 #: ../src/guestfs-structs.pod:3
16102 " struct guestfs_int_bool {\n"
16110 #: ../src/guestfs-structs.pod:8
16113 " struct guestfs_int_bool_list {\n"
16114 " uint32_t len; /* Number of elements in list. */\n"
16115 " struct guestfs_int_bool *val; /* Elements. */\n"
16121 #: ../src/guestfs-structs.pod:13
16124 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16125 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16130 #: ../src/guestfs-structs.pod:16
16131 msgid "guestfs_lvm_pv"
16135 #: ../src/guestfs-structs.pod:18
16138 " struct guestfs_lvm_pv {\n"
16139 " char *pv_name;\n"
16140 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16141 " char pv_uuid[32];\n"
16143 " uint64_t pv_size;\n"
16144 " uint64_t dev_size;\n"
16145 " uint64_t pv_free;\n"
16146 " uint64_t pv_used;\n"
16147 " char *pv_attr;\n"
16148 " int64_t pv_pe_count;\n"
16149 " int64_t pv_pe_alloc_count;\n"
16150 " char *pv_tags;\n"
16151 " uint64_t pe_start;\n"
16152 " int64_t pv_mda_count;\n"
16153 " uint64_t pv_mda_free;\n"
16159 #: ../src/guestfs-structs.pod:36
16162 " struct guestfs_lvm_pv_list {\n"
16163 " uint32_t len; /* Number of elements in list. */\n"
16164 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16170 #: ../src/guestfs-structs.pod:41
16173 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16174 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16179 #: ../src/guestfs-structs.pod:44
16180 msgid "guestfs_lvm_vg"
16184 #: ../src/guestfs-structs.pod:46
16187 " struct guestfs_lvm_vg {\n"
16188 " char *vg_name;\n"
16189 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16190 " char vg_uuid[32];\n"
16192 " char *vg_attr;\n"
16193 " uint64_t vg_size;\n"
16194 " uint64_t vg_free;\n"
16195 " char *vg_sysid;\n"
16196 " uint64_t vg_extent_size;\n"
16197 " int64_t vg_extent_count;\n"
16198 " int64_t vg_free_count;\n"
16199 " int64_t max_lv;\n"
16200 " int64_t max_pv;\n"
16201 " int64_t pv_count;\n"
16202 " int64_t lv_count;\n"
16203 " int64_t snap_count;\n"
16204 " int64_t vg_seqno;\n"
16205 " char *vg_tags;\n"
16206 " int64_t vg_mda_count;\n"
16207 " uint64_t vg_mda_free;\n"
16213 #: ../src/guestfs-structs.pod:69
16216 " struct guestfs_lvm_vg_list {\n"
16217 " uint32_t len; /* Number of elements in list. */\n"
16218 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16224 #: ../src/guestfs-structs.pod:74
16227 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16228 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16233 #: ../src/guestfs-structs.pod:77
16234 msgid "guestfs_lvm_lv"
16238 #: ../src/guestfs-structs.pod:79
16241 " struct guestfs_lvm_lv {\n"
16242 " char *lv_name;\n"
16243 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16244 " char lv_uuid[32];\n"
16245 " char *lv_attr;\n"
16246 " int64_t lv_major;\n"
16247 " int64_t lv_minor;\n"
16248 " int64_t lv_kernel_major;\n"
16249 " int64_t lv_kernel_minor;\n"
16250 " uint64_t lv_size;\n"
16251 " int64_t seg_count;\n"
16253 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16254 " float snap_percent;\n"
16255 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16256 " float copy_percent;\n"
16257 " char *move_pv;\n"
16258 " char *lv_tags;\n"
16259 " char *mirror_log;\n"
16260 " char *modules;\n"
16266 #: ../src/guestfs-structs.pod:101
16269 " struct guestfs_lvm_lv_list {\n"
16270 " uint32_t len; /* Number of elements in list. */\n"
16271 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16277 #: ../src/guestfs-structs.pod:106
16280 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16281 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16286 #: ../src/guestfs-structs.pod:111
16289 " struct guestfs_stat {\n"
16293 " int64_t nlink;\n"
16298 " int64_t blksize;\n"
16299 " int64_t blocks;\n"
16300 " int64_t atime;\n"
16301 " int64_t mtime;\n"
16302 " int64_t ctime;\n"
16308 #: ../src/guestfs-structs.pod:127
16311 " struct guestfs_stat_list {\n"
16312 " uint32_t len; /* Number of elements in list. */\n"
16313 " struct guestfs_stat *val; /* Elements. */\n"
16319 #: ../src/guestfs-structs.pod:132
16322 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16323 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16328 #: ../src/guestfs-structs.pod:137
16331 " struct guestfs_statvfs {\n"
16332 " int64_t bsize;\n"
16333 " int64_t frsize;\n"
16334 " int64_t blocks;\n"
16335 " int64_t bfree;\n"
16336 " int64_t bavail;\n"
16337 " int64_t files;\n"
16338 " int64_t ffree;\n"
16339 " int64_t favail;\n"
16342 " int64_t namemax;\n"
16348 #: ../src/guestfs-structs.pod:151
16351 " struct guestfs_statvfs_list {\n"
16352 " uint32_t len; /* Number of elements in list. */\n"
16353 " struct guestfs_statvfs *val; /* Elements. */\n"
16359 #: ../src/guestfs-structs.pod:156
16362 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16363 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16368 #: ../src/guestfs-structs.pod:159
16369 msgid "guestfs_dirent"
16373 #: ../src/guestfs-structs.pod:161
16376 " struct guestfs_dirent {\n"
16385 #: ../src/guestfs-structs.pod:167
16388 " struct guestfs_dirent_list {\n"
16389 " uint32_t len; /* Number of elements in list. */\n"
16390 " struct guestfs_dirent *val; /* Elements. */\n"
16396 #: ../src/guestfs-structs.pod:172
16399 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16400 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16405 #: ../src/guestfs-structs.pod:177
16408 " struct guestfs_version {\n"
16409 " int64_t major;\n"
16410 " int64_t minor;\n"
16411 " int64_t release;\n"
16418 #: ../src/guestfs-structs.pod:184
16421 " struct guestfs_version_list {\n"
16422 " uint32_t len; /* Number of elements in list. */\n"
16423 " struct guestfs_version *val; /* Elements. */\n"
16429 #: ../src/guestfs-structs.pod:189
16432 " void guestfs_free_version (struct guestfs_free_version *);\n"
16433 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16438 #: ../src/guestfs-structs.pod:192
16439 msgid "guestfs_xattr"
16443 #: ../src/guestfs-structs.pod:194
16446 " struct guestfs_xattr {\n"
16447 " char *attrname;\n"
16448 " /* The next two fields describe a byte array. */\n"
16449 " uint32_t attrval_len;\n"
16450 " char *attrval;\n"
16456 #: ../src/guestfs-structs.pod:201
16459 " struct guestfs_xattr_list {\n"
16460 " uint32_t len; /* Number of elements in list. */\n"
16461 " struct guestfs_xattr *val; /* Elements. */\n"
16467 #: ../src/guestfs-structs.pod:206
16470 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
16471 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
16476 #: ../src/guestfs-structs.pod:209
16477 msgid "guestfs_inotify_event"
16481 #: ../src/guestfs-structs.pod:211
16484 " struct guestfs_inotify_event {\n"
16485 " int64_t in_wd;\n"
16486 " uint32_t in_mask;\n"
16487 " uint32_t in_cookie;\n"
16488 " char *in_name;\n"
16494 #: ../src/guestfs-structs.pod:218
16497 " struct guestfs_inotify_event_list {\n"
16498 " uint32_t len; /* Number of elements in list. */\n"
16499 " struct guestfs_inotify_event *val; /* Elements. */\n"
16505 #: ../src/guestfs-structs.pod:223
16508 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
16509 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
16514 #: ../src/guestfs-structs.pod:226
16515 msgid "guestfs_partition"
16519 #: ../src/guestfs-structs.pod:228
16522 " struct guestfs_partition {\n"
16523 " int32_t part_num;\n"
16524 " uint64_t part_start;\n"
16525 " uint64_t part_end;\n"
16526 " uint64_t part_size;\n"
16532 #: ../src/guestfs-structs.pod:235
16535 " struct guestfs_partition_list {\n"
16536 " uint32_t len; /* Number of elements in list. */\n"
16537 " struct guestfs_partition *val; /* Elements. */\n"
16543 #: ../src/guestfs-structs.pod:240
16546 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
16547 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
16552 #: ../fish/guestfish.pod:5
16553 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16557 #: ../fish/guestfish.pod:9
16560 " guestfish [--options] [commands]\n"
16565 #: ../fish/guestfish.pod:11
16573 #: ../fish/guestfish.pod:13
16576 " guestfish [--ro|--rw] -a disk.img\n"
16581 #: ../fish/guestfish.pod:15
16584 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16589 #: ../fish/guestfish.pod:17
16592 " guestfish -d libvirt-domain\n"
16597 #: ../fish/guestfish.pod:19
16600 " guestfish [--ro|--rw] -a disk.img -i\n"
16605 #: ../fish/guestfish.pod:21
16608 " guestfish -d libvirt-domain -i\n"
16613 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
16614 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
16615 #: ../tools/virt-rescue.pl:41
16620 #: ../fish/guestfish.pod:25
16622 "Using guestfish in read/write mode on live virtual machines can be "
16623 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16624 "option to use guestfish safely if the disk image or virtual machine might be "
16629 #: ../fish/guestfish.pod:32
16631 "Guestfish is a shell and command-line tool for examining and modifying "
16632 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16633 "functionality of the guestfs API, see L<guestfs(3)>."
16637 #: ../fish/guestfish.pod:36
16639 "Guestfish gives you structured access to the libguestfs API, from shell "
16640 "scripts or the command line or interactively. If you want to rescue a "
16641 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16646 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:846
16647 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
16648 #: ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:45
16653 #: ../fish/guestfish.pod:43
16654 msgid "As an interactive shell"
16658 #: ../fish/guestfish.pod:45
16666 #: ../fish/guestfish.pod:47
16669 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16670 " editing virtual machine filesystems.\n"
16675 #: ../fish/guestfish.pod:50
16678 " Type: 'help' for a list of commands\n"
16679 " 'man' to read the manual\n"
16680 " 'quit' to quit the shell\n"
16685 #: ../fish/guestfish.pod:54
16688 " ><fs> add-ro disk.img\n"
16690 " ><fs> list-filesystems\n"
16691 " /dev/sda1: ext4\n"
16692 " /dev/vg_guest/lv_root: ext4\n"
16693 " /dev/vg_guest/lv_swap: swap\n"
16694 " ><fs> mount /dev/vg_guest/lv_root /\n"
16695 " ><fs> cat /etc/fstab\n"
16697 " # Created by anaconda\n"
16704 #: ../fish/guestfish.pod:67
16705 msgid "From shell scripts"
16709 #: ../fish/guestfish.pod:69
16710 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16714 #: ../fish/guestfish.pod:71
16717 " guestfish <<_EOF_\n"
16720 " mount /dev/vg_guest/lv_root /\n"
16721 " write /etc/motd \"Welcome, new users\"\n"
16727 #: ../fish/guestfish.pod:78
16728 msgid "List the LVM logical volumes in a disk image:"
16732 #: ../fish/guestfish.pod:80
16735 " guestfish -a disk.img --ro <<_EOF_\n"
16743 #: ../fish/guestfish.pod:85
16744 msgid "List all the filesystems in a disk image:"
16748 #: ../fish/guestfish.pod:87
16751 " guestfish -a disk.img --ro <<_EOF_\n"
16753 " list-filesystems\n"
16759 #: ../fish/guestfish.pod:92
16760 msgid "On one command line"
16764 #: ../fish/guestfish.pod:94
16765 msgid "Update C</etc/resolv.conf> in a guest:"
16769 #: ../fish/guestfish.pod:96
16773 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16774 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16779 #: ../fish/guestfish.pod:100
16780 msgid "Edit C</boot/grub/grub.conf> interactively:"
16784 #: ../fish/guestfish.pod:102
16787 " guestfish --rw --add disk.img \\\n"
16788 " --mount /dev/vg_guest/lv_root \\\n"
16789 " --mount /dev/sda1:/boot \\\n"
16790 " edit /boot/grub/grub.conf\n"
16795 #: ../fish/guestfish.pod:107
16796 msgid "Mount disks automatically"
16800 #: ../fish/guestfish.pod:109
16802 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
16806 #: ../fish/guestfish.pod:112
16809 " guestfish --ro -a disk.img -i cat /etc/group\n"
16814 #: ../fish/guestfish.pod:114
16817 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16822 #: ../fish/guestfish.pod:116
16823 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16827 #: ../fish/guestfish.pod:118
16830 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16835 #: ../fish/guestfish.pod:120
16836 msgid "As a script interpreter"
16840 #: ../fish/guestfish.pod:122
16841 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16845 #: ../fish/guestfish.pod:124
16848 " #!/usr/bin/guestfish -f\n"
16849 " sparse test1.img 100M\n"
16851 " part-disk /dev/sda mbr\n"
16852 " mkfs ext2 /dev/sda1\n"
16857 #: ../fish/guestfish.pod:130
16858 msgid "Start with a prepared disk"
16862 #: ../fish/guestfish.pod:132
16864 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16865 "single ext2-formatted partition:"
16869 #: ../fish/guestfish.pod:135
16872 " guestfish -N fs\n"
16877 #: ../fish/guestfish.pod:137
16878 msgid "To list what is available do:"
16882 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:837
16885 " guestfish -N help | less\n"
16890 #: ../fish/guestfish.pod:141
16891 msgid "Remote control"
16895 #: ../fish/guestfish.pod:143
16898 " eval \"`guestfish --listen`\"\n"
16899 " guestfish --remote add-ro disk.img\n"
16900 " guestfish --remote run\n"
16901 " guestfish --remote lvs\n"
16906 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
16907 #: ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68
16908 #: ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171
16909 #: ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257
16910 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-tar.pl:98
16911 #: ../tools/virt-rescue.pl:103 ../tools/virt-make-fs.pl:153
16912 #: ../tools/virt-list-partitions.pl:51
16917 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
16918 #: ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80
16919 #: ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86
16920 #: ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58
16921 #: ../tools/virt-tar.pl:106 ../tools/virt-rescue.pl:111
16922 #: ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:59
16927 #: ../fish/guestfish.pod:154
16928 msgid "Displays general help on options."
16932 #: ../fish/guestfish.pod:156
16933 msgid "B<-h> | B<--cmd-help>"
16937 #: ../fish/guestfish.pod:158
16938 msgid "Lists all available guestfish commands."
16942 #: ../fish/guestfish.pod:160
16943 msgid "B<-h cmd> | B<--cmd-help cmd>"
16947 #: ../fish/guestfish.pod:162
16948 msgid "Displays detailed help on a single command C<cmd>."
16952 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
16953 msgid "B<-a image> | B<--add image>"
16957 #: ../fish/guestfish.pod:166
16958 msgid "Add a block device or virtual machine image to the shell."
16962 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
16964 "The format of the disk image is auto-detected. To override this and force a "
16965 "particular format use the I<--format=..> option."
16969 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
16970 msgid "B<-c URI> | B<--connect URI>"
16974 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
16976 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16977 "URI to use. The default is to use the default libvirt connection."
16981 #: ../fish/guestfish.pod:177
16986 #: ../fish/guestfish.pod:179
16988 "If using the I<--listen> option and a csh-like shell, use this option. See "
16989 "section L</REMOTE CONTROL AND CSH> below."
16993 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
16994 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
16998 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
17000 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17001 "used, then any libvirt domain can be used. However in write mode, only "
17002 "libvirt domains which are shut down can be named here."
17006 #: ../fish/guestfish.pod:188
17007 msgid "B<-D> | B<--no-dest-paths>"
17011 #: ../fish/guestfish.pod:190
17013 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17014 "to hit the tab key to complete paths on the guest filesystem, but this "
17015 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17016 "allow this feature to be disabled."
17020 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
17021 msgid "B<--echo-keys>"
17025 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
17027 "When prompting for keys and passphrases, guestfish normally turns echoing "
17028 "off so you cannot see what you are typing. If you are not worried about "
17029 "Tempest attacks and there is no one else in the room you can specify this "
17030 "flag to see what you are typing."
17034 #: ../fish/guestfish.pod:202
17035 msgid "B<-f file> | B<--file file>"
17039 #: ../fish/guestfish.pod:204
17040 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17044 #: ../fish/guestfish.pod:207
17047 " #!/usr/bin/guestfish -f\n"
17052 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
17053 msgid "B<--format=raw|qcow2|..> | B<--format>"
17057 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
17059 "The default for the I<-a> option is to auto-detect the format of the disk "
17060 "image. Using this forces the disk format for I<-a> options which follow on "
17061 "the command line. Using I<--format> with no argument switches back to auto-"
17062 "detection for subsequent I<-a> options."
17066 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:543
17067 #: ../inspector/virt-inspector.pl:515
17068 msgid "For example:"
17072 #: ../fish/guestfish.pod:218
17075 " guestfish --format=raw -a disk.img\n"
17080 #: ../fish/guestfish.pod:220
17081 msgid "forces raw format (no auto-detection) for C<disk.img>."
17085 #: ../fish/guestfish.pod:222
17088 " guestfish --format=raw -a disk.img --format -a another.img\n"
17093 #: ../fish/guestfish.pod:224
17095 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17096 "detection for C<another.img>."
17100 #: ../fish/guestfish.pod:227
17102 "If you have untrusted raw-format guest disk images, you should use this "
17103 "option to specify the disk format. This avoids a possible security problem "
17104 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17108 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
17109 msgid "B<-i> | B<--inspector>"
17113 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
17115 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17116 "system and mount filesystems as they would be mounted on the real virtual "
17121 #: ../fish/guestfish.pod:238
17122 msgid "Typical usage is either:"
17126 #: ../fish/guestfish.pod:240
17129 " guestfish -d myguest -i\n"
17134 #: ../fish/guestfish.pod:242
17135 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17139 #: ../fish/guestfish.pod:244
17142 " guestfish --ro -d myguest -i\n"
17147 #: ../fish/guestfish.pod:246
17148 msgid "(for active domains, readonly), or specify the block device directly:"
17152 #: ../fish/guestfish.pod:248
17155 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17160 #: ../fish/guestfish.pod:250
17162 "Note that the command line syntax changed slightly over older versions of "
17163 "guestfish. You can still use the old syntax:"
17167 #: ../fish/guestfish.pod:253
17170 " guestfish [--ro] -i disk.img\n"
17175 #: ../fish/guestfish.pod:255
17178 " guestfish [--ro] -i libvirt-domain\n"
17183 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
17184 msgid "B<--keys-from-stdin>"
17188 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
17190 "Read key or passphrase parameters from stdin. The default is to try to read "
17191 "passphrases from the user by opening C</dev/tty>."
17195 #: ../fish/guestfish.pod:262
17196 msgid "B<--listen>"
17200 #: ../fish/guestfish.pod:264
17202 "Fork into the background and listen for remote commands. See section L</"
17203 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17207 #: ../fish/guestfish.pod:267
17208 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
17212 #: ../fish/guestfish.pod:269
17213 msgid "Mount the named partition or logical volume on the given mountpoint."
17217 #: ../fish/guestfish.pod:271
17218 msgid "If the mountpoint is omitted, it defaults to C</>."
17222 #: ../fish/guestfish.pod:273
17223 msgid "You have to mount something on C</> before most commands will work."
17227 #: ../fish/guestfish.pod:275
17229 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17234 #: ../fish/guestfish.pod:278
17236 "If you don't know what filesystems a disk image contains, you can either run "
17237 "guestfish without this option, then list the partitions and LVs available "
17238 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
17239 "list-filesystems(1)> program."
17243 #: ../fish/guestfish.pod:283 ../fuse/guestmount.pod:154
17244 msgid "B<-n> | B<--no-sync>"
17248 #: ../fish/guestfish.pod:285
17250 "Disable autosync. This is enabled by default. See the discussion of "
17251 "autosync in the L<guestfs(3)> manpage."
17255 #: ../fish/guestfish.pod:288
17256 msgid "B<-N type> | B<--new type> | B<-N help>"
17260 #: ../fish/guestfish.pod:290
17262 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17263 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17264 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17269 #: ../fish/guestfish.pod:295
17270 msgid "B<--progress-bars>"
17274 #: ../fish/guestfish.pod:297
17275 msgid "Enable progress bars, even when guestfish is used non-interactively."
17279 #: ../fish/guestfish.pod:299
17281 "Progress bars are enabled by default when guestfish is used as an "
17282 "interactive shell."
17286 #: ../fish/guestfish.pod:302
17287 msgid "B<--no-progress-bars>"
17291 #: ../fish/guestfish.pod:304
17292 msgid "Disable progress bars."
17296 #: ../fish/guestfish.pod:306
17297 msgid "B<--remote[=pid]>"
17301 #: ../fish/guestfish.pod:308
17303 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17304 "CONTROL GUESTFISH OVER A SOCKET> below."
17308 #: ../fish/guestfish.pod:311 ../fuse/guestmount.pod:196
17309 msgid "B<-r> | B<--ro>"
17313 #: ../fish/guestfish.pod:313
17315 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
17316 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
17320 #: ../fish/guestfish.pod:316 ../tools/virt-rescue.pl:187
17322 "The option must always be used if the disk image or virtual machine might be "
17323 "running, and is generally recommended in cases where you don't need write "
17324 "access to the disk."
17328 #: ../fish/guestfish.pod:320
17330 "Note that prepared disk images created with I<-N> are not affected by the "
17335 #: ../fish/guestfish.pod:323
17336 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17340 #: ../fish/guestfish.pod:325 ../fuse/guestmount.pod:208
17341 #: ../tools/virt-rescue.pl:195
17342 msgid "B<--selinux>"
17346 #: ../fish/guestfish.pod:327
17347 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17351 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:212
17352 msgid "B<-v> | B<--verbose>"
17356 #: ../fish/guestfish.pod:331
17358 "Enable very verbose messages. This is particularly useful if you find a bug."
17362 #: ../fish/guestfish.pod:334 ../fuse/guestmount.pod:216
17363 msgid "B<-V> | B<--version>"
17367 #: ../fish/guestfish.pod:336
17368 msgid "Display the guestfish / libguestfs version number and exit."
17372 #: ../fish/guestfish.pod:338 ../fuse/guestmount.pod:220
17373 msgid "B<-w> | B<--rw>"
17377 #: ../fish/guestfish.pod:340
17379 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
17384 #: ../fish/guestfish.pod:343
17389 #: ../fish/guestfish.pod:345
17390 msgid "Echo each command before executing it."
17394 #: ../fish/guestfish.pod:349
17395 msgid "COMMANDS ON COMMAND LINE"
17399 #: ../fish/guestfish.pod:351
17401 "Any additional (non-option) arguments are treated as commands to execute."
17405 #: ../fish/guestfish.pod:354
17407 "Commands to execute should be separated by a colon (C<:>), where the colon "
17408 "is a separate parameter. Thus:"
17412 #: ../fish/guestfish.pod:357
17415 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17420 #: ../fish/guestfish.pod:359
17422 "If there are no additional arguments, then we enter a shell, either an "
17423 "interactive shell with a prompt (if the input is a terminal) or a non-"
17424 "interactive shell."
17428 #: ../fish/guestfish.pod:363
17430 "In either command line mode or non-interactive shell, the first command that "
17431 "gives an error causes the whole shell to exit. In interactive mode (with a "
17432 "prompt) if a command fails, you can continue to enter commands."
17436 #: ../fish/guestfish.pod:368
17437 msgid "USING launch (OR run)"
17441 #: ../fish/guestfish.pod:370
17443 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17444 "then launch it, then mount any disks you need, and finally issue actions/"
17445 "commands. So the general order of the day is:"
17449 #: ../fish/guestfish.pod:378
17450 msgid "add or -a/--add"
17454 #: ../fish/guestfish.pod:382
17455 msgid "launch (aka run)"
17459 #: ../fish/guestfish.pod:386
17460 msgid "mount or -m/--mount"
17464 #: ../fish/guestfish.pod:390
17465 msgid "any other commands"
17469 #: ../fish/guestfish.pod:394
17471 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17472 "guest before mounting or performing any other commands."
17476 #: ../fish/guestfish.pod:397
17478 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17479 "I<--new> options were given then C<run> is done automatically, simply "
17480 "because guestfish can't perform the action you asked for without doing this."
17484 #: ../fish/guestfish.pod:402
17485 msgid "OPENING DISKS FOR READ AND WRITE"
17489 #: ../fish/guestfish.pod:404
17491 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
17492 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
17493 "open disk images read-only or for writing."
17497 #: ../fish/guestfish.pod:408
17499 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
17500 "disk images supplied on the command line for write. To open a disk image "
17501 "read-only you have to do I<-a image --ro>."
17505 #: ../fish/guestfish.pod:412
17507 "This matters: If you accidentally open a live VM disk image writable then "
17508 "you will cause irreversible disk corruption."
17512 #: ../fish/guestfish.pod:415
17514 "By libguestfs 1.8 we intend to change the default the other way. Disk "
17515 "images will be opened read-only. You will have to either specify "
17516 "I<guestfish --rw> or change a configuration file in order to get write "
17517 "access for disk images specified by those other command line options."
17521 #: ../fish/guestfish.pod:420
17523 "This version of guestfish has a I<--rw> option which does nothing (it is "
17524 "already the default). However it is highly recommended that you use this "
17525 "option to indicate that guestfish needs write access, and to prepare your "
17526 "scripts for the day when this option will be required for write access."
17530 #: ../fish/guestfish.pod:426
17532 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17533 "other libguestfs program apart from guestfish and guestmount."
17537 #: ../fish/guestfish.pod:429
17542 #: ../fish/guestfish.pod:431
17544 "You can quote ordinary parameters using either single or double quotes. For "
17549 #: ../fish/guestfish.pod:434
17552 " add \"file with a space.img\"\n"
17557 #: ../fish/guestfish.pod:436
17560 " rm '/file name'\n"
17565 #: ../fish/guestfish.pod:438
17573 #: ../fish/guestfish.pod:440
17575 "A few commands require a list of strings to be passed. For these, use a "
17576 "whitespace-separated list, enclosed in quotes. Strings containing "
17577 "whitespace to be passed through must be enclosed in single quotes. A "
17578 "literal single quote must be escaped with a backslash."
17582 #: ../fish/guestfish.pod:445
17585 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17586 " command \"/bin/echo 'foo bar'\"\n"
17587 " command \"/bin/echo \\'foo\\'\"\n"
17592 #: ../fish/guestfish.pod:449
17593 msgid "OPTIONAL ARGUMENTS"
17597 #: ../fish/guestfish.pod:451
17599 "Some commands take optional arguments. These arguments appear in this "
17600 "documentation as C<[argname:..]>. You can use them as in these examples:"
17604 #: ../fish/guestfish.pod:455
17607 " add-drive-opts filename\n"
17612 #: ../fish/guestfish.pod:457
17615 " add-drive-opts filename readonly:true\n"
17620 #: ../fish/guestfish.pod:459
17623 " add-drive-opts filename format:qcow2 readonly:false\n"
17628 #: ../fish/guestfish.pod:461
17630 "Each optional argument can appear at most once. All optional arguments must "
17631 "appear after the required ones."
17635 #: ../fish/guestfish.pod:464
17640 #: ../fish/guestfish.pod:466
17642 "This section applies to all commands which can take integers as parameters."
17646 #: ../fish/guestfish.pod:469
17647 msgid "SIZE SUFFIX"
17651 #: ../fish/guestfish.pod:471
17653 "When the command takes a parameter measured in bytes, you can use one of the "
17654 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17658 #: ../fish/guestfish.pod:477
17659 msgid "B<k> or B<K> or B<KiB>"
17663 #: ../fish/guestfish.pod:479
17664 msgid "The size in kilobytes (multiplied by 1024)."
17668 #: ../fish/guestfish.pod:481
17673 #: ../fish/guestfish.pod:483
17674 msgid "The size in SI 1000 byte units."
17678 #: ../fish/guestfish.pod:485
17679 msgid "B<M> or B<MiB>"
17683 #: ../fish/guestfish.pod:487
17684 msgid "The size in megabytes (multiplied by 1048576)."
17688 #: ../fish/guestfish.pod:489
17693 #: ../fish/guestfish.pod:491
17694 msgid "The size in SI 1000000 byte units."
17698 #: ../fish/guestfish.pod:493
17699 msgid "B<G> or B<GiB>"
17703 #: ../fish/guestfish.pod:495
17704 msgid "The size in gigabytes (multiplied by 2**30)."
17708 #: ../fish/guestfish.pod:497
17713 #: ../fish/guestfish.pod:499
17714 msgid "The size in SI 10**9 byte units."
17718 #: ../fish/guestfish.pod:501
17719 msgid "B<T> or B<TiB>"
17723 #: ../fish/guestfish.pod:503
17724 msgid "The size in terabytes (multiplied by 2**40)."
17728 #: ../fish/guestfish.pod:505
17733 #: ../fish/guestfish.pod:507
17734 msgid "The size in SI 10**12 byte units."
17738 #: ../fish/guestfish.pod:509
17739 msgid "B<P> or B<PiB>"
17743 #: ../fish/guestfish.pod:511
17744 msgid "The size in petabytes (multiplied by 2**50)."
17748 #: ../fish/guestfish.pod:513
17753 #: ../fish/guestfish.pod:515
17754 msgid "The size in SI 10**15 byte units."
17758 #: ../fish/guestfish.pod:517
17759 msgid "B<E> or B<EiB>"
17763 #: ../fish/guestfish.pod:519
17764 msgid "The size in exabytes (multiplied by 2**60)."
17768 #: ../fish/guestfish.pod:521
17773 #: ../fish/guestfish.pod:523
17774 msgid "The size in SI 10**18 byte units."
17778 #: ../fish/guestfish.pod:525
17779 msgid "B<Z> or B<ZiB>"
17783 #: ../fish/guestfish.pod:527
17784 msgid "The size in zettabytes (multiplied by 2**70)."
17788 #: ../fish/guestfish.pod:529
17793 #: ../fish/guestfish.pod:531
17794 msgid "The size in SI 10**21 byte units."
17798 #: ../fish/guestfish.pod:533
17799 msgid "B<Y> or B<YiB>"
17803 #: ../fish/guestfish.pod:535
17804 msgid "The size in yottabytes (multiplied by 2**80)."
17808 #: ../fish/guestfish.pod:537
17813 #: ../fish/guestfish.pod:539
17814 msgid "The size in SI 10**24 byte units."
17818 #: ../fish/guestfish.pod:545
17821 " truncate-size /file 1G\n"
17826 #: ../fish/guestfish.pod:547
17827 msgid "would truncate the file to 1 gigabyte."
17831 #: ../fish/guestfish.pod:549
17833 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
17834 "the parameter to L</memsize> is specified in megabytes already). Adding a "
17835 "suffix will probably not do what you expect."
17839 #: ../fish/guestfish.pod:553
17840 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17844 #: ../fish/guestfish.pod:555
17846 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17847 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17851 #: ../fish/guestfish.pod:558
17854 " 1234 decimal number 1234\n"
17855 " 02322 octal number, equivalent to decimal 1234\n"
17856 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17861 #: ../fish/guestfish.pod:562
17863 "When using the C<chmod> command, you almost always want to specify an octal "
17864 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17865 "L<chmod(1)> program):"
17869 #: ../fish/guestfish.pod:566
17872 " chmod 0777 /public # OK\n"
17873 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17878 #: ../fish/guestfish.pod:569
17880 "Commands that return numbers usually print them in decimal, but some "
17881 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17882 "octal, preceeded by C<0>)."
17886 #: ../fish/guestfish.pod:573
17887 msgid "WILDCARDS AND GLOBBING"
17891 #: ../fish/guestfish.pod:575
17893 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17894 "(globbing) by default. So for example the following will not do what you "
17899 #: ../fish/guestfish.pod:579
17907 #: ../fish/guestfish.pod:581
17909 "Assuming you don't have a directory called literally C</home/*> then the "
17910 "above command will return an error."
17914 #: ../fish/guestfish.pod:584
17915 msgid "To perform wildcard expansion, use the C<glob> command."
17919 #: ../fish/guestfish.pod:586
17922 " glob rm-rf /home/*\n"
17927 #: ../fish/guestfish.pod:588
17929 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17930 "many times), equivalent to:"
17934 #: ../fish/guestfish.pod:591
17937 " rm-rf /home/jim\n"
17938 " rm-rf /home/joe\n"
17939 " rm-rf /home/mary\n"
17944 #: ../fish/guestfish.pod:595
17945 msgid "C<glob> only works on simple guest paths and not on device names."
17949 #: ../fish/guestfish.pod:597
17951 "If you have several parameters, each containing a wildcard, then glob will "
17952 "perform a Cartesian product."
17956 #: ../fish/guestfish.pod:600
17961 #: ../fish/guestfish.pod:602
17963 "Any line which starts with a I<#> character is treated as a comment and "
17964 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17965 "a command. For example:"
17969 #: ../fish/guestfish.pod:606
17972 " # this is a comment\n"
17973 " # this is a comment\n"
17974 " foo # NOT a comment\n"
17979 #: ../fish/guestfish.pod:610
17980 msgid "Blank lines are also ignored."
17984 #: ../fish/guestfish.pod:612
17985 msgid "RUNNING COMMANDS LOCALLY"
17989 #: ../fish/guestfish.pod:614
17991 "Any line which starts with a I<!> character is treated as a command sent to "
17992 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17996 #: ../fish/guestfish.pod:618
18000 " tgz-out /remote local/remote-data.tar.gz\n"
18005 #: ../fish/guestfish.pod:621
18007 "will create a directory C<local> on the host, and then export the contents "
18008 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18009 "(See C<tgz-out>)."
18013 #: ../fish/guestfish.pod:625
18015 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18016 "effect, due to the way that subprocesses work in Unix."
18020 #: ../fish/guestfish.pod:628
18025 #: ../fish/guestfish.pod:630
18027 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18028 "command (a guestfish command) to the second command (any host command). For "
18033 #: ../fish/guestfish.pod:634
18036 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18041 #: ../fish/guestfish.pod:636
18043 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18044 "program). The above command would list all accounts in the guest filesystem "
18045 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18049 #: ../fish/guestfish.pod:641
18052 " hexdump /bin/ls | head\n"
18053 " list-devices | tail -1\n"
18054 " tgz-out / - | tar ztf -\n"
18059 #: ../fish/guestfish.pod:645
18061 "The space before the pipe symbol is required, any space after the pipe "
18062 "symbol is optional. Everything after the pipe symbol is just passed "
18063 "straight to the host shell, so it can contain redirections, globs and "
18064 "anything else that makes sense on the host side."
18068 #: ../fish/guestfish.pod:650
18070 "To use a literal argument which begins with a pipe symbol, you have to quote "
18075 #: ../fish/guestfish.pod:653
18083 #: ../fish/guestfish.pod:655
18084 msgid "HOME DIRECTORIES"
18088 #: ../fish/guestfish.pod:657
18090 "If a parameter starts with the character C<~> then the tilde may be expanded "
18091 "as a home directory path (either C<~> for the current user's home directory, "
18092 "or C<~user> for another user)."
18096 #: ../fish/guestfish.pod:661
18098 "Note that home directory expansion happens for users known I<on the host>, "
18099 "not in the guest filesystem."
18103 #: ../fish/guestfish.pod:664
18105 "To use a literal argument which begins with a tilde, you have to quote it, "
18110 #: ../fish/guestfish.pod:667
18118 #: ../fish/guestfish.pod:671
18120 "Libguestfs has some support for Linux guests encrypted according to the "
18121 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18122 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18123 "LUKS is supported."
18127 #: ../fish/guestfish.pod:676
18128 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18132 #: ../fish/guestfish.pod:678
18135 " ><fs> vfs-type /dev/sda2\n"
18141 #: ../fish/guestfish.pod:681
18143 "Then open those devices using L</luks-open>. This creates a device-mapper "
18144 "device called C</dev/mapper/luksdev>."
18148 #: ../fish/guestfish.pod:684
18151 " ><fs> luks-open /dev/sda2 luksdev\n"
18152 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18157 #: ../fish/guestfish.pod:687
18159 "Finally you have to tell LVM to scan for volume groups on the newly created "
18164 #: ../fish/guestfish.pod:690
18168 " vg-activate-all true\n"
18173 #: ../fish/guestfish.pod:693
18174 msgid "The logical volume(s) can now be mounted in the usual way."
18178 #: ../fish/guestfish.pod:695
18180 "Before closing a LUKS device you must unmount any logical volumes on it and "
18181 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18182 "one. Then you can close the mapper device:"
18186 #: ../fish/guestfish.pod:699
18189 " vg-activate false /dev/VG\n"
18190 " luks-close /dev/mapper/luksdev\n"
18195 #: ../fish/guestfish.pod:702
18196 msgid "WINDOWS PATHS"
18200 #: ../fish/guestfish.pod:704
18202 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18203 "(with some limitations). The following commands are equivalent:"
18207 #: ../fish/guestfish.pod:707
18210 " file /WINDOWS/system32/config/system.LOG\n"
18215 #: ../fish/guestfish.pod:709
18218 " file win:/windows/system32/config/system.log\n"
18223 #: ../fish/guestfish.pod:711
18226 " file win:\\windows\\system32\\config\\system.log\n"
18231 #: ../fish/guestfish.pod:713
18234 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18239 #: ../fish/guestfish.pod:715
18241 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18242 "handles case insensitivity like Windows would. This only works in argument "
18243 "positions that expect a path."
18247 #: ../fish/guestfish.pod:719
18248 msgid "UPLOADING AND DOWNLOADING FILES"
18252 #: ../fish/guestfish.pod:721
18254 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18255 "others which upload from or download to a local file, you can use the "
18256 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18260 #: ../fish/guestfish.pod:725
18268 #: ../fish/guestfish.pod:727
18270 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18274 #: ../fish/guestfish.pod:730
18277 " tar-out /etc - | tar tf -\n"
18282 #: ../fish/guestfish.pod:732
18284 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18285 "command (see L</PIPES>)."
18289 #: ../fish/guestfish.pod:735
18291 "When using C<-> to read from stdin, the input is read up to the end of "
18292 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18293 "some arbitrary end marker:"
18297 #: ../fish/guestfish.pod:739
18300 " upload -<<END /foo\n"
18309 #: ../fish/guestfish.pod:745
18311 "Any string of characters can be used instead of C<END>. The end marker must "
18312 "appear on a line of its own, without any preceeding or following characters "
18313 "(not even spaces)."
18317 #: ../fish/guestfish.pod:749
18319 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18320 "upload local files (so-called \"FileIn\" parameters in the generator)."
18324 #: ../fish/guestfish.pod:752
18325 msgid "EXIT ON ERROR BEHAVIOUR"
18329 #: ../fish/guestfish.pod:754
18331 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18332 "taking commands from a human over a tty), and will exit on the first error "
18333 "in non-interactive mode (scripts, commands given on the command line)."
18337 #: ../fish/guestfish.pod:759
18339 "If you prefix a command with a I<-> character, then that command will not "
18340 "cause guestfish to exit, even if that (one) command returns an error."
18344 #: ../fish/guestfish.pod:763
18345 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18349 #: ../fish/guestfish.pod:765
18351 "Guestfish can be remote-controlled over a socket. This is useful "
18352 "particularly in shell scripts where you want to make several different "
18353 "changes to a filesystem, but you don't want the overhead of starting up a "
18354 "guestfish process each time."
18358 #: ../fish/guestfish.pod:770
18359 msgid "Start a guestfish server process using:"
18363 #: ../fish/guestfish.pod:772
18366 " eval \"`guestfish --listen`\"\n"
18371 #: ../fish/guestfish.pod:774
18372 msgid "and then send it commands by doing:"
18376 #: ../fish/guestfish.pod:776
18379 " guestfish --remote cmd [...]\n"
18384 #: ../fish/guestfish.pod:778
18385 msgid "To cause the server to exit, send it the exit command:"
18389 #: ../fish/guestfish.pod:780
18392 " guestfish --remote exit\n"
18397 #: ../fish/guestfish.pod:782
18399 "Note that the server will normally exit if there is an error in a command. "
18400 "You can change this in the usual way. See section L</EXIT ON ERROR "
18405 #: ../fish/guestfish.pod:786
18406 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18410 #: ../fish/guestfish.pod:788
18412 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18413 "is how the I<--remote> option knows where to send the commands. You can "
18414 "have several guestfish listener processes running using:"
18418 #: ../fish/guestfish.pod:792
18421 " eval \"`guestfish --listen`\"\n"
18422 " pid1=$GUESTFISH_PID\n"
18423 " eval \"`guestfish --listen`\"\n"
18424 " pid2=$GUESTFISH_PID\n"
18426 " guestfish --remote=$pid1 cmd\n"
18427 " guestfish --remote=$pid2 cmd\n"
18432 #: ../fish/guestfish.pod:800
18433 msgid "REMOTE CONTROL AND CSH"
18437 #: ../fish/guestfish.pod:802
18439 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18444 #: ../fish/guestfish.pod:805
18447 " eval \"`guestfish --listen --csh`\"\n"
18452 #: ../fish/guestfish.pod:807
18453 msgid "REMOTE CONTROL DETAILS"
18457 #: ../fish/guestfish.pod:809
18459 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18460 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18461 "and C<$PID> is the process ID of the server."
18465 #: ../fish/guestfish.pod:813
18466 msgid "Guestfish client and server versions must match exactly."
18470 #: ../fish/guestfish.pod:815
18471 msgid "PREPARED DISK IMAGES"
18475 #: ../fish/guestfish.pod:817
18477 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18478 "preformatted disk images that guestfish can make for you to save typing. "
18479 "This is particularly useful for testing purposes. This option is used "
18480 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18481 "can be mixed with I<-a>)."
18485 #: ../fish/guestfish.pod:823
18487 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18488 "the second and so on. Existing files in the current directory are "
18493 #: ../fish/guestfish.pod:827
18495 "The type briefly describes how the disk should be sized, partitioned, how "
18496 "filesystem(s) should be created, and how content should be added. "
18497 "Optionally the type can be followed by extra parameters, separated by C<:> "
18498 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18499 "allocated disk, containing a single partition, with the partition formatted "
18500 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18505 #: ../fish/guestfish.pod:835
18506 msgid "To list the available types and any extra parameters they take, run:"
18510 #: ../fish/guestfish.pod:839
18512 "Note that the prepared filesystem is not mounted. You would usually have to "
18513 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18517 #: ../fish/guestfish.pod:843
18519 "If any I<-N> or I<--new> options are given, the guest is automatically "
18524 #: ../fish/guestfish.pod:848
18525 msgid "Create a 100MB disk with an ext4-formatted partition:"
18529 #: ../fish/guestfish.pod:850
18532 " guestfish -N fs:ext4\n"
18537 #: ../fish/guestfish.pod:852
18538 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18542 #: ../fish/guestfish.pod:854
18545 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18550 #: ../fish/guestfish.pod:856
18551 msgid "Create a blank 200MB disk:"
18555 #: ../fish/guestfish.pod:858
18558 " guestfish -N disk:200M\n"
18563 #: ../fish/guestfish.pod:860
18564 msgid "PROGRESS BARS"
18568 #: ../fish/guestfish.pod:862
18570 "Some (not all) long-running commands send progress notification messages as "
18571 "they are running. Guestfish turns these messages into progress bars."
18575 #: ../fish/guestfish.pod:866
18577 "When a command that supports progress bars takes longer than two seconds to "
18578 "run, and if progress bars are enabled, then you will see one appearing below "
18583 #: ../fish/guestfish.pod:870
18586 " ><fs> copy-size /large-file /another-file 2048M\n"
18587 " / 10% [#####-----------------------------------------] 00:30\n"
18592 #: ../fish/guestfish.pod:873
18594 "The spinner on the left hand side moves round once for every progress "
18595 "notification received from the backend. This is a (reasonably) golden "
18596 "assurance that the command is \"doing something\" even if the progress bar "
18597 "is not moving, because the command is able to send the progress "
18598 "notifications. When the bar reaches 100% and the command finishes, the "
18599 "spinner disappears."
18603 #: ../fish/guestfish.pod:880
18605 "Progress bars are enabled by default when guestfish is used interactively. "
18606 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18607 "and you can disable them completely using I<--no-progress-bars>."
18611 #: ../fish/guestfish.pod:885
18612 msgid "GUESTFISH COMMANDS"
18616 #: ../fish/guestfish.pod:887
18618 "The commands in this section are guestfish convenience commands, in other "
18619 "words, they are not part of the L<guestfs(3)> API."
18623 #: ../fish/guestfish.pod:890
18628 #: ../fish/guestfish.pod:892
18637 #: ../fish/guestfish.pod:895
18638 msgid "Without any parameter, this provides general help."
18642 #: ../fish/guestfish.pod:897
18643 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18647 #: ../fish/guestfish.pod:899
18648 msgid "quit | exit"
18652 #: ../fish/guestfish.pod:901
18653 msgid "This exits guestfish. You can also use C<^D> key."
18657 #: ../fish/guestfish.pod:903
18658 msgid "@FISH_COMMANDS@"
18662 #: ../fish/guestfish.pod:905
18667 #: ../fish/guestfish.pod:909 ../test-tool/libguestfs-test-tool.pod:83
18672 #: ../fish/guestfish.pod:911
18674 "guestfish returns 0 if the commands completed without error, or 1 if there "
18679 #: ../fish/guestfish.pod:918
18684 #: ../fish/guestfish.pod:920
18686 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18691 #: ../fish/guestfish.pod:923
18692 msgid "GUESTFISH_PID"
18696 #: ../fish/guestfish.pod:925
18698 "Used with the I<--remote> option to specify the remote guestfish process to "
18699 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18703 #: ../fish/guestfish.pod:929
18708 #: ../fish/guestfish.pod:931
18710 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18711 "not specified, the external L<hexedit(1)> program is used."
18715 #: ../fish/guestfish.pod:935
18720 #: ../fish/guestfish.pod:937
18722 "If compiled with GNU readline support, various files in the home directory "
18723 "can be used. See L</FILES>."
18727 #: ../fish/guestfish.pod:946
18729 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18730 "effect as using the B<-v> option."
18734 #: ../fish/guestfish.pod:958
18736 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18737 "the discussion of paths in L<guestfs(3)>."
18741 #: ../fish/guestfish.pod:969
18742 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18746 #: ../fish/guestfish.pod:971
18751 #: ../fish/guestfish.pod:973
18753 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18758 #: ../fish/guestfish.pod:988 ../test-tool/libguestfs-test-tool.pod:88
18763 #: ../fish/guestfish.pod:992
18764 msgid "$HOME/.guestfish"
18768 #: ../fish/guestfish.pod:994
18770 "If compiled with GNU readline support, then the command history is saved in "
18775 #: ../fish/guestfish.pod:997
18776 msgid "$HOME/.inputrc"
18780 #: ../fish/guestfish.pod:999
18781 msgid "/etc/inputrc"
18785 #: ../fish/guestfish.pod:1001
18787 "If compiled with GNU readline support, then these files can be used to "
18788 "configure readline. For further information, please see L<readline(3)/"
18789 "INITIALIZATION FILE>."
18793 #: ../fish/guestfish.pod:1005
18794 msgid "To write rules which only apply to guestfish, use:"
18798 #: ../fish/guestfish.pod:1007
18808 #: ../fish/guestfish.pod:1011
18810 "Variables that you can set in inputrc that change the behaviour of guestfish "
18811 "in useful ways include:"
18815 #: ../fish/guestfish.pod:1016
18816 msgid "completion-ignore-case (default: on)"
18820 #: ../fish/guestfish.pod:1018
18822 "By default, guestfish will ignore case when tab-completing paths on the "
18827 #: ../fish/guestfish.pod:1021
18830 " set completion-ignore-case off\n"
18835 #: ../fish/guestfish.pod:1023
18836 msgid "to make guestfish case sensitive."
18840 #: ../fish/guestfish.pod:1027
18845 #: ../fish/guestfish.pod:1029
18846 msgid "test2.img (etc)"
18850 #: ../fish/guestfish.pod:1031
18852 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
18853 "will be created in the file C<test1.img> in the current directory. The "
18854 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
18855 "the same name will be overwritten."
18859 #: ../fish/guestfish.pod:1040
18861 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
18862 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
18863 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
18864 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
18868 #: ../fish/guestfish.pod:1064 ../test-tool/libguestfs-test-tool.pod:124
18869 #: ../fuse/guestmount.pod:253 ../inspector/virt-inspector.pl:564
18870 #: ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518
18871 #: ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251
18872 #: ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206
18873 #: ../tools/virt-tar.pl:300 ../tools/virt-rescue.pl:285
18874 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:273
18876 "This program is free software; you can redistribute it and/or modify it "
18877 "under the terms of the GNU General Public License as published by the Free "
18878 "Software Foundation; either version 2 of the License, or (at your option) "
18879 "any later version."
18883 #: ../fish/guestfish.pod:1069 ../test-tool/libguestfs-test-tool.pod:129
18884 #: ../fuse/guestmount.pod:258 ../inspector/virt-inspector.pl:569
18885 #: ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523
18886 #: ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256
18887 #: ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211
18888 #: ../tools/virt-tar.pl:305 ../tools/virt-rescue.pl:290
18889 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:278
18891 "This program is distributed in the hope that it will be useful, but WITHOUT "
18892 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
18893 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
18898 #: ../fish/guestfish.pod:1074 ../test-tool/libguestfs-test-tool.pod:134
18899 #: ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pl:574
18900 #: ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528
18901 #: ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261
18902 #: ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216
18903 #: ../tools/virt-tar.pl:310 ../tools/virt-rescue.pl:295
18904 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:283
18906 "You should have received a copy of the GNU General Public License along with "
18907 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
18908 "Ave, Cambridge, MA 02139, USA."
18912 #: ../fish/guestfish-actions.pod:1
18917 #: ../fish/guestfish-actions.pod:3
18920 " add-cdrom filename\n"
18925 #: ../fish/guestfish-actions.pod:15
18927 "This call checks for the existence of C<filename>. This stops you from "
18928 "specifying other types of drive which are supported by qemu such as C<nbd:> "
18929 "and C<http:> URLs. To specify those, use the general L</config> call "
18934 #: ../fish/guestfish-actions.pod:22
18936 "If you just want to add an ISO file (often you use this as an efficient way "
18937 "to transfer large files into the guest), then you should probably use L</add-"
18938 "drive-ro> instead."
18942 #: ../fish/guestfish-actions.pod:35
18947 #: ../fish/guestfish-actions.pod:37
18952 #: ../fish/guestfish-actions.pod:39
18955 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
18960 #: ../fish/guestfish-actions.pod:41
18962 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
18963 "It works by connecting to libvirt, requesting the domain and domain XML from "
18964 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
18968 #: ../fish/guestfish-actions.pod:58
18970 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
18971 "libvirt.org/uri.html>). If this is not set then we connect to the default "
18972 "libvirt URI (or one set through an environment variable, see the libvirt "
18973 "documentation for full details). If you are using the C API directly then "
18974 "it is more flexible to create the libvirt connection object yourself, get "
18975 "the domain object, and call L</add-libvirt-dom>."
18979 #: ../fish/guestfish-actions.pod:66
18981 "The other optional parameters are passed directly through to L</add-drive-"
18986 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
18988 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
18992 #: ../fish/guestfish-actions.pod:71
18997 #: ../fish/guestfish-actions.pod:73
19000 " add-drive filename\n"
19005 #: ../fish/guestfish-actions.pod:75
19007 "This function is the equivalent of calling L</add-drive-opts> with no "
19008 "optional parameters, so the disk is added writable, with the format being "
19009 "detected automatically."
19013 #: ../fish/guestfish-actions.pod:79
19015 "Automatic detection of the format opens you up to a potential security hole "
19016 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19017 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19018 "you should think about replacing calls to this function with calls to L</add-"
19019 "drive-opts>, and specifying the format."
19023 #: ../fish/guestfish-actions.pod:86
19024 msgid "add-drive-opts"
19028 #: ../fish/guestfish-actions.pod:88
19033 #: ../fish/guestfish-actions.pod:90
19036 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19041 #: ../fish/guestfish-actions.pod:117
19043 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19044 "add-drive-ro>) then the format is automatically detected. Possible formats "
19045 "include C<raw> and C<qcow2>."
19049 #: ../fish/guestfish-actions.pod:128
19051 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19052 "add-drive-with-if> call (q.v.)"
19056 #: ../fish/guestfish-actions.pod:135
19057 msgid "add-drive-ro"
19061 #: ../fish/guestfish-actions.pod:137
19066 #: ../fish/guestfish-actions.pod:139
19069 " add-drive-ro filename\n"
19074 #: ../fish/guestfish-actions.pod:141
19076 "This function is the equivalent of calling L</add-drive-opts> with the "
19077 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19078 "is added read-only, with the format being detected automatically."
19082 #: ../fish/guestfish-actions.pod:146
19083 msgid "add-drive-ro-with-if"
19087 #: ../fish/guestfish-actions.pod:148
19090 " add-drive-ro-with-if filename iface\n"
19095 #: ../fish/guestfish-actions.pod:150
19097 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19098 "interface emulation to use at run time."
19102 #: ../fish/guestfish-actions.pod:160
19103 msgid "add-drive-with-if"
19107 #: ../fish/guestfish-actions.pod:162
19110 " add-drive-with-if filename iface\n"
19115 #: ../fish/guestfish-actions.pod:164
19117 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19118 "interface emulation to use at run time."
19122 #: ../fish/guestfish-actions.pod:174
19127 #: ../fish/guestfish-actions.pod:176
19130 " aug-clear augpath\n"
19135 #: ../fish/guestfish-actions.pod:181
19140 #: ../fish/guestfish-actions.pod:183
19148 #: ../fish/guestfish-actions.pod:185
19150 "Close the current Augeas handle and free up any resources used by it. After "
19151 "calling this, you have to call L</aug-init> again before you can use any "
19152 "other Augeas functions."
19156 #: ../fish/guestfish-actions.pod:190
19157 msgid "aug-defnode"
19161 #: ../fish/guestfish-actions.pod:192
19164 " aug-defnode name expr val\n"
19169 #: ../fish/guestfish-actions.pod:197
19171 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19172 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19173 "containing that single node."
19177 #: ../fish/guestfish-actions.pod:205
19182 #: ../fish/guestfish-actions.pod:207
19185 " aug-defvar name expr\n"
19190 #: ../fish/guestfish-actions.pod:216
19195 #: ../fish/guestfish-actions.pod:218
19198 " aug-get augpath\n"
19203 #: ../fish/guestfish-actions.pod:223
19208 #: ../fish/guestfish-actions.pod:225
19211 " aug-init root flags\n"
19216 #: ../fish/guestfish-actions.pod:231
19217 msgid "You must call this before using any other L</aug-*> commands."
19221 #: ../fish/guestfish-actions.pod:266
19222 msgid "Do not load the tree in L</aug-init>."
19226 #: ../fish/guestfish-actions.pod:270
19227 msgid "To close the handle, you can call L</aug-close>."
19231 #: ../fish/guestfish-actions.pod:274
19236 #: ../fish/guestfish-actions.pod:276
19239 " aug-insert augpath label true|false\n"
19244 #: ../fish/guestfish-actions.pod:286
19249 #: ../fish/guestfish-actions.pod:288
19257 #: ../fish/guestfish-actions.pod:295
19262 #: ../fish/guestfish-actions.pod:297
19265 " aug-ls augpath\n"
19270 #: ../fish/guestfish-actions.pod:299
19272 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19273 "resulting nodes into alphabetical order."
19277 #: ../fish/guestfish-actions.pod:302
19282 #: ../fish/guestfish-actions.pod:304
19285 " aug-match augpath\n"
19290 #: ../fish/guestfish-actions.pod:310
19295 #: ../fish/guestfish-actions.pod:312
19298 " aug-mv src dest\n"
19303 #: ../fish/guestfish-actions.pod:317
19308 #: ../fish/guestfish-actions.pod:319
19311 " aug-rm augpath\n"
19316 #: ../fish/guestfish-actions.pod:325
19321 #: ../fish/guestfish-actions.pod:327
19329 #: ../fish/guestfish-actions.pod:331
19331 "The flags which were passed to L</aug-init> affect exactly how files are "
19336 #: ../fish/guestfish-actions.pod:334
19341 #: ../fish/guestfish-actions.pod:336
19344 " aug-set augpath val\n"
19349 #: ../fish/guestfish-actions.pod:340
19351 "In the Augeas API, it is possible to clear a node by setting the value to "
19352 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
19353 "this call. Instead you must use the L</aug-clear> call."
19357 #: ../fish/guestfish-actions.pod:345
19362 #: ../fish/guestfish-actions.pod:347
19365 " available 'groups ...'\n"
19370 #: ../fish/guestfish-actions.pod:353
19372 "The libguestfs groups, and the functions that those groups correspond to, "
19373 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
19374 "runtime by calling L</available-all-groups>."
19378 #: ../fish/guestfish-actions.pod:377
19379 msgid "You must call L</launch> before calling this function."
19383 #: ../fish/guestfish-actions.pod:399
19385 "This call was added in version C<1.0.80>. In previous versions of "
19386 "libguestfs all you could do would be to speculatively execute a command to "
19387 "find out if the daemon implemented it. See also L</version>."
19391 #: ../fish/guestfish-actions.pod:406
19392 msgid "available-all-groups"
19396 #: ../fish/guestfish-actions.pod:408
19399 " available-all-groups\n"
19404 #: ../fish/guestfish-actions.pod:410
19406 "This command returns a list of all optional groups that this daemon knows "
19407 "about. Note this returns both supported and unsupported groups. To find "
19408 "out which ones the daemon can actually support you have to call L</"
19409 "available> on each member of the returned list."
19413 #: ../fish/guestfish-actions.pod:416
19414 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
19418 #: ../fish/guestfish-actions.pod:418
19423 #: ../fish/guestfish-actions.pod:420
19426 " base64-in (base64file|-) filename\n"
19431 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
19432 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
19433 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
19434 #: ../fish/guestfish-actions.pod:4006 ../fish/guestfish-actions.pod:4018
19435 #: ../fish/guestfish-actions.pod:4029 ../fish/guestfish-actions.pod:4040
19436 #: ../fish/guestfish-actions.pod:4092 ../fish/guestfish-actions.pod:4101
19437 #: ../fish/guestfish-actions.pod:4155 ../fish/guestfish-actions.pod:4178
19438 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
19442 #: ../fish/guestfish-actions.pod:427
19447 #: ../fish/guestfish-actions.pod:429
19450 " base64-out filename (base64file|-)\n"
19455 #: ../fish/guestfish-actions.pod:436
19456 msgid "blockdev-flushbufs"
19460 #: ../fish/guestfish-actions.pod:438
19463 " blockdev-flushbufs device\n"
19468 #: ../fish/guestfish-actions.pod:445
19469 msgid "blockdev-getbsz"
19473 #: ../fish/guestfish-actions.pod:447
19476 " blockdev-getbsz device\n"
19481 #: ../fish/guestfish-actions.pod:456
19482 msgid "blockdev-getro"
19486 #: ../fish/guestfish-actions.pod:458
19489 " blockdev-getro device\n"
19494 #: ../fish/guestfish-actions.pod:465
19495 msgid "blockdev-getsize64"
19499 #: ../fish/guestfish-actions.pod:467
19502 " blockdev-getsize64 device\n"
19507 #: ../fish/guestfish-actions.pod:471
19508 msgid "See also L</blockdev-getsz>."
19512 #: ../fish/guestfish-actions.pod:475
19513 msgid "blockdev-getss"
19517 #: ../fish/guestfish-actions.pod:477
19520 " blockdev-getss device\n"
19525 #: ../fish/guestfish-actions.pod:482
19527 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
19531 #: ../fish/guestfish-actions.pod:487
19532 msgid "blockdev-getsz"
19536 #: ../fish/guestfish-actions.pod:489
19539 " blockdev-getsz device\n"
19544 #: ../fish/guestfish-actions.pod:494
19546 "See also L</blockdev-getss> for the real sector size of the device, and L</"
19547 "blockdev-getsize64> for the more useful I<size in bytes>."
19551 #: ../fish/guestfish-actions.pod:500
19552 msgid "blockdev-rereadpt"
19556 #: ../fish/guestfish-actions.pod:502
19559 " blockdev-rereadpt device\n"
19564 #: ../fish/guestfish-actions.pod:508
19565 msgid "blockdev-setbsz"
19569 #: ../fish/guestfish-actions.pod:510
19572 " blockdev-setbsz device blocksize\n"
19577 #: ../fish/guestfish-actions.pod:519
19578 msgid "blockdev-setro"
19582 #: ../fish/guestfish-actions.pod:521
19585 " blockdev-setro device\n"
19590 #: ../fish/guestfish-actions.pod:527
19591 msgid "blockdev-setrw"
19595 #: ../fish/guestfish-actions.pod:529
19598 " blockdev-setrw device\n"
19603 #: ../fish/guestfish-actions.pod:535
19604 msgid "case-sensitive-path"
19608 #: ../fish/guestfish-actions.pod:537
19611 " case-sensitive-path path\n"
19616 #: ../fish/guestfish-actions.pod:561
19618 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
19619 "WINDOWS/system32\"> (the exact return value would depend on details of how "
19620 "the directories were originally created under Windows)."
19624 #: ../fish/guestfish-actions.pod:569
19625 msgid "See also L</realpath>."
19629 #: ../fish/guestfish-actions.pod:571
19634 #: ../fish/guestfish-actions.pod:573
19642 #: ../fish/guestfish-actions.pod:577
19644 "Note that this function cannot correctly handle binary files (specifically, "
19645 "files containing C<\\0> character which is treated as end of string). For "
19646 "those you need to use the L</read-file> or L</download> functions which have "
19647 "a more complex interface."
19651 #: ../fish/guestfish-actions.pod:585
19656 #: ../fish/guestfish-actions.pod:587
19659 " checksum csumtype path\n"
19664 #: ../fish/guestfish-actions.pod:630
19665 msgid "To get the checksum for a device, use L</checksum-device>."
19669 #: ../fish/guestfish-actions.pod:632
19670 msgid "To get the checksums for many files, use L</checksums-out>."
19674 #: ../fish/guestfish-actions.pod:634
19675 msgid "checksum-device"
19679 #: ../fish/guestfish-actions.pod:636
19682 " checksum-device csumtype device\n"
19687 #: ../fish/guestfish-actions.pod:638
19689 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
19690 "device named C<device>. For the types of checksums supported see the L</"
19691 "checksum> command."
19695 #: ../fish/guestfish-actions.pod:642
19696 msgid "checksums-out"
19700 #: ../fish/guestfish-actions.pod:644
19703 " checksums-out csumtype directory (sumsfile|-)\n"
19708 #: ../fish/guestfish-actions.pod:660
19713 #: ../fish/guestfish-actions.pod:662
19716 " chmod mode path\n"
19721 #: ../fish/guestfish-actions.pod:673
19726 #: ../fish/guestfish-actions.pod:675
19729 " chown owner group path\n"
19734 #: ../fish/guestfish-actions.pod:683
19739 #: ../fish/guestfish-actions.pod:685
19742 " command 'arguments ...'\n"
19747 #: ../fish/guestfish-actions.pod:692
19749 "The single parameter is an argv-style list of arguments. The first element "
19750 "is the name of the program to run. Subsequent elements are parameters. The "
19751 "list must be non-empty (ie. must contain a program name). Note that the "
19752 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
19756 #: ../fish/guestfish-actions.pod:720
19757 msgid "command-lines"
19761 #: ../fish/guestfish-actions.pod:722
19764 " command-lines 'arguments ...'\n"
19769 #: ../fish/guestfish-actions.pod:724
19771 "This is the same as L</command>, but splits the result into a list of lines."
19775 #: ../fish/guestfish-actions.pod:727
19776 msgid "See also: L</sh-lines>"
19780 #: ../fish/guestfish-actions.pod:732
19785 #: ../fish/guestfish-actions.pod:734
19788 " config qemuparam qemuvalue\n"
19793 #: ../fish/guestfish-actions.pod:745
19798 #: ../fish/guestfish-actions.pod:747
19801 " copy-size src dest size\n"
19806 #: ../fish/guestfish-actions.pod:755
19811 #: ../fish/guestfish-actions.pod:757
19819 #: ../fish/guestfish-actions.pod:762
19824 #: ../fish/guestfish-actions.pod:764
19832 #: ../fish/guestfish-actions.pod:769
19837 #: ../fish/guestfish-actions.pod:771
19845 #: ../fish/guestfish-actions.pod:778
19847 "If the destination is a device, it must be as large or larger than the "
19848 "source file or device, otherwise the copy will fail. This command cannot do "
19849 "partial copies (see L</copy-size>)."
19853 #: ../fish/guestfish-actions.pod:782
19858 #: ../fish/guestfish-actions.pod:784
19866 #: ../fish/guestfish-actions.pod:792
19871 #: ../fish/guestfish-actions.pod:794
19879 #: ../fish/guestfish-actions.pod:803
19884 #: ../fish/guestfish-actions.pod:805
19892 #: ../fish/guestfish-actions.pod:811
19894 "Another way to get the same information is to enable verbose messages with "
19895 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
19896 "before running the program."
19900 #: ../fish/guestfish-actions.pod:816
19905 #: ../fish/guestfish-actions.pod:818
19908 " download remotefilename (filename|-)\n"
19913 #: ../fish/guestfish-actions.pod:825
19914 msgid "See also L</upload>, L</cat>."
19918 #: ../fish/guestfish-actions.pod:829
19919 msgid "download-offset"
19923 #: ../fish/guestfish-actions.pod:831
19926 " download-offset remotefilename (filename|-) offset size\n"
19931 #: ../fish/guestfish-actions.pod:839
19933 "Note that there is no limit on the amount of data that can be downloaded "
19934 "with this call, unlike with L</pread>, and this call always reads the full "
19935 "amount unless an error occurs."
19939 #: ../fish/guestfish-actions.pod:844
19940 msgid "See also L</download>, L</pread>."
19944 #: ../fish/guestfish-actions.pod:848
19945 msgid "drop-caches"
19949 #: ../fish/guestfish-actions.pod:850
19952 " drop-caches whattodrop\n"
19957 #: ../fish/guestfish-actions.pod:862
19962 #: ../fish/guestfish-actions.pod:864
19970 #: ../fish/guestfish-actions.pod:876
19975 #: ../fish/guestfish-actions.pod:878
19978 " e2fsck-f device\n"
19983 #: ../fish/guestfish-actions.pod:884
19985 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
19986 "should use L</fsck>."
19990 #: ../fish/guestfish-actions.pod:887
19991 msgid "echo-daemon"
19995 #: ../fish/guestfish-actions.pod:889
19998 " echo-daemon 'words ...'\n"
20003 #: ../fish/guestfish-actions.pod:896
20004 msgid "See also L</ping-daemon>."
20008 #: ../fish/guestfish-actions.pod:898
20013 #: ../fish/guestfish-actions.pod:900
20016 " egrep regex path\n"
20021 #: ../fish/guestfish-actions.pod:908
20026 #: ../fish/guestfish-actions.pod:910
20029 " egrepi regex path\n"
20034 #: ../fish/guestfish-actions.pod:918
20039 #: ../fish/guestfish-actions.pod:920
20042 " equal file1 file2\n"
20047 #: ../fish/guestfish-actions.pod:927
20052 #: ../fish/guestfish-actions.pod:929
20060 #: ../fish/guestfish-actions.pod:934
20061 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20065 #: ../fish/guestfish-actions.pod:936
20070 #: ../fish/guestfish-actions.pod:938
20073 " fallocate path len\n"
20078 #: ../fish/guestfish-actions.pod:955
20079 msgid "fallocate64"
20083 #: ../fish/guestfish-actions.pod:957
20086 " fallocate64 path len\n"
20091 #: ../fish/guestfish-actions.pod:963
20093 "Note that this call allocates disk blocks for the file. To create a sparse "
20094 "file use L</truncate-size> instead."
20098 #: ../fish/guestfish-actions.pod:966
20100 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20101 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20102 "maximum size of files created through that call to 1GB."
20106 #: ../fish/guestfish-actions.pod:975
20111 #: ../fish/guestfish-actions.pod:977
20114 " fgrep pattern path\n"
20119 #: ../fish/guestfish-actions.pod:985
20124 #: ../fish/guestfish-actions.pod:987
20127 " fgrepi pattern path\n"
20132 #: ../fish/guestfish-actions.pod:995
20137 #: ../fish/guestfish-actions.pod:997
20145 #: ../fish/guestfish-actions.pod:1009
20147 "This command can also be used on C</dev/> devices (and partitions, LV "
20148 "names). You can for example use this to determine if a device contains a "
20149 "filesystem, although it's usually better to use L</vfs-type>."
20153 #: ../fish/guestfish-actions.pod:1019
20154 msgid "file-architecture"
20158 #: ../fish/guestfish-actions.pod:1021
20161 " file-architecture filename\n"
20166 #: ../fish/guestfish-actions.pod:1124
20171 #: ../fish/guestfish-actions.pod:1126
20179 #: ../fish/guestfish-actions.pod:1130
20181 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20182 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20186 #: ../fish/guestfish-actions.pod:1134
20191 #: ../fish/guestfish-actions.pod:1136
20194 " fill c len path\n"
20199 #: ../fish/guestfish-actions.pod:1142
20201 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20202 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20203 "L</fill-pattern>."
20207 #: ../fish/guestfish-actions.pod:1147
20208 msgid "fill-pattern"
20212 #: ../fish/guestfish-actions.pod:1149
20215 " fill-pattern pattern len path\n"
20220 #: ../fish/guestfish-actions.pod:1151
20222 "This function is like L</fill> except that it creates a new file of length "
20223 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20224 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20229 #: ../fish/guestfish-actions.pod:1156
20234 #: ../fish/guestfish-actions.pod:1158
20237 " find directory\n"
20242 #: ../fish/guestfish-actions.pod:1172
20243 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20247 #: ../fish/guestfish-actions.pod:1185
20248 msgid "See also L</find0>."
20252 #: ../fish/guestfish-actions.pod:1190
20257 #: ../fish/guestfish-actions.pod:1192
20260 " find0 directory (files|-)\n"
20265 #: ../fish/guestfish-actions.pod:1198
20267 "This command works the same way as L</find> with the following exceptions:"
20271 #: ../fish/guestfish-actions.pod:1225
20272 msgid "findfs-label"
20276 #: ../fish/guestfish-actions.pod:1227
20279 " findfs-label label\n"
20284 #: ../fish/guestfish-actions.pod:1233
20285 msgid "To find the label of a filesystem, use L</vfs-label>."
20289 #: ../fish/guestfish-actions.pod:1235
20290 msgid "findfs-uuid"
20294 #: ../fish/guestfish-actions.pod:1237
20297 " findfs-uuid uuid\n"
20302 #: ../fish/guestfish-actions.pod:1243
20303 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
20307 #: ../fish/guestfish-actions.pod:1245
20312 #: ../fish/guestfish-actions.pod:1247
20315 " fsck fstype device\n"
20320 #: ../fish/guestfish-actions.pod:1277
20325 #: ../fish/guestfish-actions.pod:1279
20333 #: ../fish/guestfish-actions.pod:1286
20334 msgid "get-autosync"
20338 #: ../fish/guestfish-actions.pod:1288
20346 #: ../fish/guestfish-actions.pod:1292
20351 #: ../fish/guestfish-actions.pod:1294
20359 #: ../fish/guestfish-actions.pod:1298
20360 msgid "get-e2label"
20364 #: ../fish/guestfish-actions.pod:1300
20367 " get-e2label device\n"
20372 #: ../fish/guestfish-actions.pod:1312
20377 #: ../fish/guestfish-actions.pod:1314
20380 " get-e2uuid device\n"
20385 #: ../fish/guestfish-actions.pod:1326
20386 msgid "get-memsize"
20390 #: ../fish/guestfish-actions.pod:1328
20398 #: ../fish/guestfish-actions.pod:1333
20400 "If L</set-memsize> was not called on this handle, and if "
20401 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
20402 "value for memsize."
20406 #: ../fish/guestfish-actions.pod:1340
20407 msgid "get-network"
20411 #: ../fish/guestfish-actions.pod:1342
20419 #: ../fish/guestfish-actions.pod:1346
20424 #: ../fish/guestfish-actions.pod:1348
20432 #: ../fish/guestfish-actions.pod:1355
20437 #: ../fish/guestfish-actions.pod:1357
20442 #: ../fish/guestfish-actions.pod:1359
20450 #: ../fish/guestfish-actions.pod:1366
20455 #: ../fish/guestfish-actions.pod:1368
20463 #: ../fish/guestfish-actions.pod:1375
20464 msgid "get-recovery-proc"
20468 #: ../fish/guestfish-actions.pod:1377
20471 " get-recovery-proc\n"
20476 #: ../fish/guestfish-actions.pod:1381
20477 msgid "get-selinux"
20481 #: ../fish/guestfish-actions.pod:1383
20489 #: ../fish/guestfish-actions.pod:1385
20491 "This returns the current setting of the selinux flag which is passed to the "
20492 "appliance at boot time. See L</set-selinux>."
20496 #: ../fish/guestfish-actions.pod:1391
20501 #: ../fish/guestfish-actions.pod:1393
20509 #: ../fish/guestfish-actions.pod:1400
20514 #: ../fish/guestfish-actions.pod:1402
20522 #: ../fish/guestfish-actions.pod:1406
20527 #: ../fish/guestfish-actions.pod:1408
20535 #: ../fish/guestfish-actions.pod:1410
20537 "Return the current umask. By default the umask is C<022> unless it has been "
20538 "set by calling L</umask>."
20542 #: ../fish/guestfish-actions.pod:1413
20543 msgid "get-verbose"
20547 #: ../fish/guestfish-actions.pod:1415
20555 #: ../fish/guestfish-actions.pod:1419
20560 #: ../fish/guestfish-actions.pod:1421
20568 #: ../fish/guestfish-actions.pod:1425
20569 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
20573 #: ../fish/guestfish-actions.pod:1428
20578 #: ../fish/guestfish-actions.pod:1430
20581 " getxattrs path\n"
20586 #: ../fish/guestfish-actions.pod:1438
20587 msgid "See also: L</lgetxattrs>, L<attr(5)>."
20591 #: ../fish/guestfish-actions.pod:1440
20592 msgid "glob-expand"
20596 #: ../fish/guestfish-actions.pod:1442
20599 " glob-expand pattern\n"
20604 #: ../fish/guestfish-actions.pod:1455
20609 #: ../fish/guestfish-actions.pod:1457
20612 " grep regex path\n"
20617 #: ../fish/guestfish-actions.pod:1465
20622 #: ../fish/guestfish-actions.pod:1467
20625 " grepi regex path\n"
20630 #: ../fish/guestfish-actions.pod:1475
20631 msgid "grub-install"
20635 #: ../fish/guestfish-actions.pod:1477
20638 " grub-install root device\n"
20643 #: ../fish/guestfish-actions.pod:1493
20648 #: ../fish/guestfish-actions.pod:1495
20656 #: ../fish/guestfish-actions.pod:1503
20661 #: ../fish/guestfish-actions.pod:1505
20664 " head-n nrlines path\n"
20669 #: ../fish/guestfish-actions.pod:1518
20674 #: ../fish/guestfish-actions.pod:1520
20682 #: ../fish/guestfish-actions.pod:1528
20687 #: ../fish/guestfish-actions.pod:1530
20690 " initrd-cat initrdpath filename\n"
20695 #: ../fish/guestfish-actions.pod:1542
20696 msgid "See also L</initrd-list>."
20700 #: ../fish/guestfish-actions.pod:1547
20701 msgid "initrd-list"
20705 #: ../fish/guestfish-actions.pod:1549
20708 " initrd-list path\n"
20713 #: ../fish/guestfish-actions.pod:1561
20714 msgid "inotify-add-watch"
20718 #: ../fish/guestfish-actions.pod:1563
20721 " inotify-add-watch path mask\n"
20726 #: ../fish/guestfish-actions.pod:1575
20727 msgid "inotify-close"
20731 #: ../fish/guestfish-actions.pod:1577
20739 #: ../fish/guestfish-actions.pod:1583
20740 msgid "inotify-files"
20744 #: ../fish/guestfish-actions.pod:1585
20752 #: ../fish/guestfish-actions.pod:1587
20754 "This function is a helpful wrapper around L</inotify-read> which just "
20755 "returns a list of pathnames of objects that were touched. The returned "
20756 "pathnames are sorted and deduplicated."
20760 #: ../fish/guestfish-actions.pod:1591
20761 msgid "inotify-init"
20765 #: ../fish/guestfish-actions.pod:1593
20768 " inotify-init maxevents\n"
20773 #: ../fish/guestfish-actions.pod:1599
20775 "C<maxevents> is the maximum number of events which will be queued up between "
20776 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
20777 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
20778 "default was 16384 events. Beyond this limit, the kernel throws away events, "
20779 "but records the fact that it threw them away by setting a flag "
20780 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
20784 #: ../fish/guestfish-actions.pod:1609
20786 "Before any events are generated, you have to add some watches to the "
20787 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
20788 "L</inotify-watch-all>."
20792 #: ../fish/guestfish-actions.pod:1615
20794 "Queued up events should be read periodically by calling L</inotify-read> (or "
20795 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
20796 "If you don't read the events out often enough then you risk the internal "
20797 "queue overflowing."
20801 #: ../fish/guestfish-actions.pod:1622
20803 "The handle should be closed after use by calling L</inotify-close>. This "
20804 "also removes any watches automatically."
20808 #: ../fish/guestfish-actions.pod:1631
20809 msgid "inotify-read"
20813 #: ../fish/guestfish-actions.pod:1633
20821 #: ../fish/guestfish-actions.pod:1646
20822 msgid "inotify-rm-watch"
20826 #: ../fish/guestfish-actions.pod:1648
20829 " inotify-rm-watch wd\n"
20834 #: ../fish/guestfish-actions.pod:1650
20835 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
20839 #: ../fish/guestfish-actions.pod:1653
20840 msgid "inspect-get-arch"
20844 #: ../fish/guestfish-actions.pod:1655
20847 " inspect-get-arch root\n"
20852 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673
20853 #: ../fish/guestfish-actions.pod:1739 ../fish/guestfish-actions.pod:1757
20854 #: ../fish/guestfish-actions.pod:1778 ../fish/guestfish-actions.pod:1793
20855 #: ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1838
20856 #: ../fish/guestfish-actions.pod:1862 ../fish/guestfish-actions.pod:1892
20857 #: ../fish/guestfish-actions.pod:1927
20859 "This function should only be called with a root device string as returned by "
20864 #: ../fish/guestfish-actions.pod:1660
20866 "This returns the architecture of the inspected operating system. The "
20867 "possible return values are listed under L</file-architecture>."
20871 #: ../fish/guestfish-actions.pod:1669
20872 msgid "inspect-get-distro"
20876 #: ../fish/guestfish-actions.pod:1671
20879 " inspect-get-distro root\n"
20884 #: ../fish/guestfish-actions.pod:1735
20885 msgid "inspect-get-filesystems"
20889 #: ../fish/guestfish-actions.pod:1737
20892 " inspect-get-filesystems root\n"
20897 #: ../fish/guestfish-actions.pod:1750
20899 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
20900 "get-mountpoints>."
20904 #: ../fish/guestfish-actions.pod:1753
20905 msgid "inspect-get-major-version"
20909 #: ../fish/guestfish-actions.pod:1755
20912 " inspect-get-major-version root\n"
20917 #: ../fish/guestfish-actions.pod:1774
20918 msgid "inspect-get-minor-version"
20922 #: ../fish/guestfish-actions.pod:1776
20925 " inspect-get-minor-version root\n"
20930 #: ../fish/guestfish-actions.pod:1786
20932 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
20933 "get-major-version>."
20937 #: ../fish/guestfish-actions.pod:1789
20938 msgid "inspect-get-mountpoints"
20942 #: ../fish/guestfish-actions.pod:1791
20945 " inspect-get-mountpoints root\n"
20950 #: ../fish/guestfish-actions.pod:1809
20952 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
20953 "get-filesystems>."
20957 #: ../fish/guestfish-actions.pod:1812
20958 msgid "inspect-get-package-format"
20962 #: ../fish/guestfish-actions.pod:1814
20965 " inspect-get-package-format root\n"
20970 #: ../fish/guestfish-actions.pod:1819
20972 "This function and L</inspect-get-package-management> return the package "
20973 "format and package management tool used by the inspected operating system. "
20974 "For example for Fedora these functions would return C<rpm> (package format) "
20975 "and C<yum> (package management)."
20979 #: ../fish/guestfish-actions.pod:1834
20980 msgid "inspect-get-package-management"
20984 #: ../fish/guestfish-actions.pod:1836
20987 " inspect-get-package-management root\n"
20992 #: ../fish/guestfish-actions.pod:1841
20994 "L</inspect-get-package-format> and this function return the package format "
20995 "and package management tool used by the inspected operating system. For "
20996 "example for Fedora these functions would return C<rpm> (package format) and "
20997 "C<yum> (package management)."
21001 #: ../fish/guestfish-actions.pod:1858
21002 msgid "inspect-get-product-name"
21006 #: ../fish/guestfish-actions.pod:1860
21009 " inspect-get-product-name root\n"
21014 #: ../fish/guestfish-actions.pod:1875
21015 msgid "inspect-get-roots"
21019 #: ../fish/guestfish-actions.pod:1877
21022 " inspect-get-roots\n"
21027 #: ../fish/guestfish-actions.pod:1879
21029 "This function is a convenient way to get the list of root devices, as "
21030 "returned from a previous call to L</inspect-os>, but without redoing the "
21031 "whole inspection process."
21035 #: ../fish/guestfish-actions.pod:1883
21037 "This returns an empty list if either no root devices were found or the "
21038 "caller has not called L</inspect-os>."
21042 #: ../fish/guestfish-actions.pod:1888
21043 msgid "inspect-get-type"
21047 #: ../fish/guestfish-actions.pod:1890
21050 " inspect-get-type root\n"
21055 #: ../fish/guestfish-actions.pod:1923
21056 msgid "inspect-get-windows-systemroot"
21060 #: ../fish/guestfish-actions.pod:1925
21063 " inspect-get-windows-systemroot root\n"
21068 #: ../fish/guestfish-actions.pod:1939
21073 #: ../fish/guestfish-actions.pod:1941
21081 #: ../fish/guestfish-actions.pod:1956
21083 "You can pass the root string(s) returned to other L</inspect-get-*> "
21084 "functions in order to query further information about each operating system, "
21085 "such as the name and version."
21089 #: ../fish/guestfish-actions.pod:1961
21091 "This function uses other libguestfs features such as L</mount-ro> and L</"
21092 "umount-all> in order to mount and unmount filesystems and look at the "
21093 "contents. This should be called with no disks currently mounted. The "
21094 "function may also use Augeas, so any existing Augeas handle will be closed."
21098 #: ../fish/guestfish-actions.pod:1973 ../fish/guestfish-actions.pod:2129
21099 #: ../fish/guestfish-actions.pod:2175
21100 msgid "See also L</list-filesystems>."
21104 #: ../fish/guestfish-actions.pod:1975
21105 msgid "is-blockdev"
21109 #: ../fish/guestfish-actions.pod:1977
21112 " is-blockdev path\n"
21117 #: ../fish/guestfish-actions.pod:1982 ../fish/guestfish-actions.pod:2000
21118 #: ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2028
21119 #: ../fish/guestfish-actions.pod:2038 ../fish/guestfish-actions.pod:2072
21120 #: ../fish/guestfish-actions.pod:2081
21121 msgid "See also L</stat>."
21125 #: ../fish/guestfish-actions.pod:1984
21130 #: ../fish/guestfish-actions.pod:1986
21138 #: ../fish/guestfish-actions.pod:1993
21143 #: ../fish/guestfish-actions.pod:1995
21146 " is-chardev path\n"
21151 #: ../fish/guestfish-actions.pod:2002
21156 #: ../fish/guestfish-actions.pod:2004
21164 #: ../fish/guestfish-actions.pod:2011
21169 #: ../fish/guestfish-actions.pod:2013
21177 #: ../fish/guestfish-actions.pod:2021
21182 #: ../fish/guestfish-actions.pod:2023
21190 #: ../fish/guestfish-actions.pod:2030
21195 #: ../fish/guestfish-actions.pod:2032
21203 #: ../fish/guestfish-actions.pod:2040
21204 msgid "is-launching"
21208 #: ../fish/guestfish-actions.pod:2042
21216 #: ../fish/guestfish-actions.pod:2049
21221 #: ../fish/guestfish-actions.pod:2051
21229 #: ../fish/guestfish-actions.pod:2056
21234 #: ../fish/guestfish-actions.pod:2058
21242 #: ../fish/guestfish-actions.pod:2065
21247 #: ../fish/guestfish-actions.pod:2067
21250 " is-socket path\n"
21255 #: ../fish/guestfish-actions.pod:2074
21260 #: ../fish/guestfish-actions.pod:2076
21263 " is-symlink path\n"
21268 #: ../fish/guestfish-actions.pod:2083
21269 msgid "kill-subprocess"
21273 #: ../fish/guestfish-actions.pod:2085
21276 " kill-subprocess\n"
21281 #: ../fish/guestfish-actions.pod:2089
21286 #: ../fish/guestfish-actions.pod:2091
21291 #: ../fish/guestfish-actions.pod:2093
21299 #: ../fish/guestfish-actions.pod:2101
21304 #: ../fish/guestfish-actions.pod:2103
21307 " lchown owner group path\n"
21312 #: ../fish/guestfish-actions.pod:2105
21314 "Change the file owner to C<owner> and group to C<group>. This is like L</"
21315 "chown> but if C<path> is a symlink then the link itself is changed, not the "
21320 #: ../fish/guestfish-actions.pod:2113
21325 #: ../fish/guestfish-actions.pod:2115
21328 " lgetxattrs path\n"
21333 #: ../fish/guestfish-actions.pod:2117
21335 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
21336 "it returns the extended attributes of the link itself."
21340 #: ../fish/guestfish-actions.pod:2121
21341 msgid "list-devices"
21345 #: ../fish/guestfish-actions.pod:2123
21353 #: ../fish/guestfish-actions.pod:2131
21354 msgid "list-filesystems"
21358 #: ../fish/guestfish-actions.pod:2133
21361 " list-filesystems\n"
21366 #: ../fish/guestfish-actions.pod:2152
21368 "This command runs other libguestfs commands, which might include L</mount> "
21369 "and L</umount>, and therefore you should use this soon after launch and only "
21370 "when nothing is mounted."
21374 #: ../fish/guestfish-actions.pod:2156
21376 "Not all of the filesystems returned will be mountable. In particular, swap "
21377 "partitions are returned in the list. Also this command does not check that "
21378 "each filesystem found is valid and mountable, and some filesystems might be "
21379 "mountable but require special options. Filesystems may not all belong to a "
21380 "single logical operating system (use L</inspect-os> to look for OSes)."
21384 #: ../fish/guestfish-actions.pod:2164
21385 msgid "list-partitions"
21389 #: ../fish/guestfish-actions.pod:2166
21392 " list-partitions\n"
21397 #: ../fish/guestfish-actions.pod:2172
21399 "This does not return logical volumes. For that you will need to call L</"
21404 #: ../fish/guestfish-actions.pod:2177
21409 #: ../fish/guestfish-actions.pod:2179
21417 #: ../fish/guestfish-actions.pod:2187
21422 #: ../fish/guestfish-actions.pod:2189
21425 " ln target linkname\n"
21430 #: ../fish/guestfish-actions.pod:2193
21435 #: ../fish/guestfish-actions.pod:2195
21438 " ln-f target linkname\n"
21443 #: ../fish/guestfish-actions.pod:2200
21448 #: ../fish/guestfish-actions.pod:2202
21451 " ln-s target linkname\n"
21456 #: ../fish/guestfish-actions.pod:2206
21461 #: ../fish/guestfish-actions.pod:2208
21464 " ln-sf target linkname\n"
21469 #: ../fish/guestfish-actions.pod:2213
21470 msgid "lremovexattr"
21474 #: ../fish/guestfish-actions.pod:2215
21477 " lremovexattr xattr path\n"
21482 #: ../fish/guestfish-actions.pod:2217
21484 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
21485 "it removes an extended attribute of the link itself."
21489 #: ../fish/guestfish-actions.pod:2221
21494 #: ../fish/guestfish-actions.pod:2223
21502 #: ../fish/guestfish-actions.pod:2229
21504 "This command is mostly useful for interactive sessions. Programs should "
21505 "probably use L</readdir> instead."
21509 #: ../fish/guestfish-actions.pod:2232
21514 #: ../fish/guestfish-actions.pod:2234
21517 " lsetxattr xattr val vallen path\n"
21522 #: ../fish/guestfish-actions.pod:2236
21524 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
21525 "sets an extended attribute of the link itself."
21529 #: ../fish/guestfish-actions.pod:2240
21534 #: ../fish/guestfish-actions.pod:2242
21542 #: ../fish/guestfish-actions.pod:2246
21544 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
21545 "the link is stat-ed, not the file it refers to."
21549 #: ../fish/guestfish-actions.pod:2252
21554 #: ../fish/guestfish-actions.pod:2254
21557 " lstatlist path 'names ...'\n"
21562 #: ../fish/guestfish-actions.pod:2256
21564 "This call allows you to perform the L</lstat> operation on multiple files, "
21565 "where all files are in the directory C<path>. C<names> is the list of files "
21566 "from this directory."
21570 #: ../fish/guestfish-actions.pod:2265
21572 "This call is intended for programs that want to efficiently list a directory "
21573 "contents without making many round-trips. See also L</lxattrlist> for a "
21574 "similarly efficient call for getting extended attributes. Very long "
21575 "directory listings might cause the protocol message size to be exceeded, "
21576 "causing this call to fail. The caller must split up such requests into "
21577 "smaller groups of names."
21581 #: ../fish/guestfish-actions.pod:2273
21582 msgid "luks-add-key"
21586 #: ../fish/guestfish-actions.pod:2275
21589 " luks-add-key device keyslot\n"
21594 #: ../fish/guestfish-actions.pod:2282
21596 "Note that if C<keyslot> already contains a key, then this command will "
21597 "fail. You have to use L</luks-kill-slot> first to remove that key."
21601 #: ../fish/guestfish-actions.pod:2286 ../fish/guestfish-actions.pod:2308
21602 #: ../fish/guestfish-actions.pod:2321 ../fish/guestfish-actions.pod:2335
21603 #: ../fish/guestfish-actions.pod:2358 ../fish/guestfish-actions.pod:2368
21605 "This command has one or more key or passphrase parameters. Guestfish will "
21606 "prompt for these separately."
21610 #: ../fish/guestfish-actions.pod:2289
21615 #: ../fish/guestfish-actions.pod:2291
21618 " luks-close device\n"
21623 #: ../fish/guestfish-actions.pod:2293
21625 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
21626 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
21627 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
21632 #: ../fish/guestfish-actions.pod:2299
21633 msgid "luks-format"
21637 #: ../fish/guestfish-actions.pod:2301
21640 " luks-format device keyslot\n"
21645 #: ../fish/guestfish-actions.pod:2314
21646 msgid "luks-format-cipher"
21650 #: ../fish/guestfish-actions.pod:2316
21653 " luks-format-cipher device keyslot cipher\n"
21658 #: ../fish/guestfish-actions.pod:2318
21660 "This command is the same as L</luks-format> but it also allows you to set "
21661 "the C<cipher> used."
21665 #: ../fish/guestfish-actions.pod:2327
21666 msgid "luks-kill-slot"
21670 #: ../fish/guestfish-actions.pod:2329
21673 " luks-kill-slot device keyslot\n"
21678 #: ../fish/guestfish-actions.pod:2338
21683 #: ../fish/guestfish-actions.pod:2340
21686 " luks-open device mapname\n"
21691 #: ../fish/guestfish-actions.pod:2354
21693 "If this block device contains LVM volume groups, then calling L</vgscan> "
21694 "followed by L</vg-activate-all> will make them visible."
21698 #: ../fish/guestfish-actions.pod:2361
21699 msgid "luks-open-ro"
21703 #: ../fish/guestfish-actions.pod:2363
21706 " luks-open-ro device mapname\n"
21711 #: ../fish/guestfish-actions.pod:2365
21713 "This is the same as L</luks-open> except that a read-only mapping is created."
21717 #: ../fish/guestfish-actions.pod:2371
21722 #: ../fish/guestfish-actions.pod:2373
21725 " lvcreate logvol volgroup mbytes\n"
21730 #: ../fish/guestfish-actions.pod:2378
21731 msgid "lvm-canonical-lv-name"
21735 #: ../fish/guestfish-actions.pod:2380
21738 " lvm-canonical-lv-name lvname\n"
21743 #: ../fish/guestfish-actions.pod:2389
21744 msgid "See also L</is-lv>."
21748 #: ../fish/guestfish-actions.pod:2391
21749 msgid "lvm-clear-filter"
21753 #: ../fish/guestfish-actions.pod:2393
21756 " lvm-clear-filter\n"
21761 #: ../fish/guestfish-actions.pod:2395
21763 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
21768 #: ../fish/guestfish-actions.pod:2401
21769 msgid "lvm-remove-all"
21773 #: ../fish/guestfish-actions.pod:2403
21776 " lvm-remove-all\n"
21781 #: ../fish/guestfish-actions.pod:2411
21782 msgid "lvm-set-filter"
21786 #: ../fish/guestfish-actions.pod:2413
21789 " lvm-set-filter 'devices ...'\n"
21794 #: ../fish/guestfish-actions.pod:2438
21799 #: ../fish/guestfish-actions.pod:2440
21802 " lvremove device\n"
21807 #: ../fish/guestfish-actions.pod:2448
21812 #: ../fish/guestfish-actions.pod:2450
21815 " lvrename logvol newlogvol\n"
21820 #: ../fish/guestfish-actions.pod:2454
21825 #: ../fish/guestfish-actions.pod:2456
21828 " lvresize device mbytes\n"
21833 #: ../fish/guestfish-actions.pod:2462
21834 msgid "lvresize-free"
21838 #: ../fish/guestfish-actions.pod:2464
21841 " lvresize-free lv percent\n"
21846 #: ../fish/guestfish-actions.pod:2472
21851 #: ../fish/guestfish-actions.pod:2474
21859 #: ../fish/guestfish-actions.pod:2482
21860 msgid "See also L</lvs-full>, L</list-filesystems>."
21864 #: ../fish/guestfish-actions.pod:2484
21869 #: ../fish/guestfish-actions.pod:2486
21877 #: ../fish/guestfish-actions.pod:2491
21882 #: ../fish/guestfish-actions.pod:2493
21890 #: ../fish/guestfish-actions.pod:2497
21895 #: ../fish/guestfish-actions.pod:2499
21898 " lxattrlist path 'names ...'\n"
21903 #: ../fish/guestfish-actions.pod:2515
21905 "This call is intended for programs that want to efficiently list a directory "
21906 "contents without making many round-trips. See also L</lstatlist> for a "
21907 "similarly efficient call for getting standard stats. Very long directory "
21908 "listings might cause the protocol message size to be exceeded, causing this "
21909 "call to fail. The caller must split up such requests into smaller groups of "
21914 #: ../fish/guestfish-actions.pod:2523
21919 #: ../fish/guestfish-actions.pod:2525
21927 #: ../fish/guestfish-actions.pod:2529
21932 #: ../fish/guestfish-actions.pod:2531
21935 " mkdir-mode path mode\n"
21940 #: ../fish/guestfish-actions.pod:2540
21941 msgid "See also L</mkdir>, L</umask>"
21945 #: ../fish/guestfish-actions.pod:2542
21950 #: ../fish/guestfish-actions.pod:2544
21958 #: ../fish/guestfish-actions.pod:2549
21963 #: ../fish/guestfish-actions.pod:2551
21966 " mkdtemp template\n"
21971 #: ../fish/guestfish-actions.pod:2572
21976 #: ../fish/guestfish-actions.pod:2574
21979 " mke2fs-J fstype blocksize device journal\n"
21984 #: ../fish/guestfish-actions.pod:2582
21985 msgid "See also L</mke2journal>."
21989 #: ../fish/guestfish-actions.pod:2584
21994 #: ../fish/guestfish-actions.pod:2586
21997 " mke2fs-JL fstype blocksize device label\n"
22002 #: ../fish/guestfish-actions.pod:2591
22003 msgid "See also L</mke2journal-L>."
22007 #: ../fish/guestfish-actions.pod:2593
22012 #: ../fish/guestfish-actions.pod:2595
22015 " mke2fs-JU fstype blocksize device uuid\n"
22020 #: ../fish/guestfish-actions.pod:2600
22021 msgid "See also L</mke2journal-U>."
22025 #: ../fish/guestfish-actions.pod:2602
22026 msgid "mke2journal"
22030 #: ../fish/guestfish-actions.pod:2604
22033 " mke2journal blocksize device\n"
22038 #: ../fish/guestfish-actions.pod:2611
22039 msgid "mke2journal-L"
22043 #: ../fish/guestfish-actions.pod:2613
22046 " mke2journal-L blocksize label device\n"
22051 #: ../fish/guestfish-actions.pod:2617
22052 msgid "mke2journal-U"
22056 #: ../fish/guestfish-actions.pod:2619
22059 " mke2journal-U blocksize uuid device\n"
22064 #: ../fish/guestfish-actions.pod:2623
22069 #: ../fish/guestfish-actions.pod:2625
22072 " mkfifo mode path\n"
22077 #: ../fish/guestfish-actions.pod:2627
22079 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22080 "is just a convenient wrapper around L</mknod>."
22084 #: ../fish/guestfish-actions.pod:2633
22089 #: ../fish/guestfish-actions.pod:2635
22092 " mkfs fstype device\n"
22097 #: ../fish/guestfish-actions.pod:2641
22102 #: ../fish/guestfish-actions.pod:2643
22105 " mkfs-b fstype blocksize device\n"
22110 #: ../fish/guestfish-actions.pod:2645
22112 "This call is similar to L</mkfs>, but it allows you to control the block "
22113 "size of the resulting filesystem. Supported block sizes depend on the "
22114 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22118 #: ../fish/guestfish-actions.pod:2653
22119 msgid "mkmountpoint"
22123 #: ../fish/guestfish-actions.pod:2655
22126 " mkmountpoint exemptpath\n"
22131 #: ../fish/guestfish-actions.pod:2657
22133 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22134 "to create extra mountpoints before mounting the first filesystem."
22138 #: ../fish/guestfish-actions.pod:2681
22140 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22141 "unexpected errors if you try to mix these calls. It is safest to manually "
22142 "unmount filesystems and remove mountpoints after use."
22146 #: ../fish/guestfish-actions.pod:2685
22148 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22149 "for this to work for manual mountpoints, you must ensure that the innermost "
22150 "mountpoints have the longest pathnames, as in the example code above."
22154 #: ../fish/guestfish-actions.pod:2692
22156 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22157 "that L</umount-all> is called when the handle is closed which can also "
22158 "trigger these issues."
22162 #: ../fish/guestfish-actions.pod:2696
22167 #: ../fish/guestfish-actions.pod:2698
22170 " mknod mode devmajor devminor path\n"
22175 #: ../fish/guestfish-actions.pod:2708
22177 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22178 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22179 "regular file). These constants are available in the standard Linux header "
22180 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22181 "wrappers around this command which bitwise OR in the appropriate constant "
22186 #: ../fish/guestfish-actions.pod:2718
22191 #: ../fish/guestfish-actions.pod:2720
22194 " mknod-b mode devmajor devminor path\n"
22199 #: ../fish/guestfish-actions.pod:2722
22201 "This call creates a block device node called C<path> with mode C<mode> and "
22202 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22203 "wrapper around L</mknod>."
22207 #: ../fish/guestfish-actions.pod:2728
22212 #: ../fish/guestfish-actions.pod:2730
22215 " mknod-c mode devmajor devminor path\n"
22220 #: ../fish/guestfish-actions.pod:2732
22222 "This call creates a char device node called C<path> with mode C<mode> and "
22223 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22224 "wrapper around L</mknod>."
22228 #: ../fish/guestfish-actions.pod:2738
22233 #: ../fish/guestfish-actions.pod:2740
22241 #: ../fish/guestfish-actions.pod:2744
22246 #: ../fish/guestfish-actions.pod:2746
22249 " mkswap-L label device\n"
22254 #: ../fish/guestfish-actions.pod:2754
22259 #: ../fish/guestfish-actions.pod:2756
22262 " mkswap-U uuid device\n"
22267 #: ../fish/guestfish-actions.pod:2760
22268 msgid "mkswap-file"
22272 #: ../fish/guestfish-actions.pod:2762
22275 " mkswap-file path\n"
22280 #: ../fish/guestfish-actions.pod:2766
22282 "This command just writes a swap file signature to an existing file. To "
22283 "create the file itself, use something like L</fallocate>."
22287 #: ../fish/guestfish-actions.pod:2769
22292 #: ../fish/guestfish-actions.pod:2771
22295 " modprobe modulename\n"
22300 #: ../fish/guestfish-actions.pod:2778
22305 #: ../fish/guestfish-actions.pod:2780
22308 " mount device mountpoint\n"
22313 #: ../fish/guestfish-actions.pod:2796
22315 "B<Important note:> When you use this call, the filesystem options C<sync> "
22316 "and C<noatime> are set implicitly. This was originally done because we "
22317 "thought it would improve reliability, but it turns out that I<-o sync> has a "
22318 "very large negative performance impact and negligible effect on "
22319 "reliability. Therefore we recommend that you avoid using L</mount> in any "
22320 "code that needs performance, and instead use L</mount-options> (use an empty "
22321 "string for the first parameter if you don't want any options)."
22325 #: ../fish/guestfish-actions.pod:2806
22330 #: ../fish/guestfish-actions.pod:2808
22333 " mount-loop file mountpoint\n"
22338 #: ../fish/guestfish-actions.pod:2814
22339 msgid "mount-options"
22343 #: ../fish/guestfish-actions.pod:2816
22346 " mount-options options device mountpoint\n"
22351 #: ../fish/guestfish-actions.pod:2818
22353 "This is the same as the L</mount> command, but it allows you to set the "
22354 "mount options as for the L<mount(8)> I<-o> flag."
22358 #: ../fish/guestfish-actions.pod:2826
22363 #: ../fish/guestfish-actions.pod:2828
22366 " mount-ro device mountpoint\n"
22371 #: ../fish/guestfish-actions.pod:2830
22373 "This is the same as the L</mount> command, but it mounts the filesystem with "
22374 "the read-only (I<-o ro>) flag."
22378 #: ../fish/guestfish-actions.pod:2833
22383 #: ../fish/guestfish-actions.pod:2835
22386 " mount-vfs options vfstype device mountpoint\n"
22391 #: ../fish/guestfish-actions.pod:2837
22393 "This is the same as the L</mount> command, but it allows you to set both the "
22394 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
22398 #: ../fish/guestfish-actions.pod:2841
22399 msgid "mountpoints"
22403 #: ../fish/guestfish-actions.pod:2843
22411 #: ../fish/guestfish-actions.pod:2845
22413 "This call is similar to L</mounts>. That call returns a list of devices. "
22414 "This one returns a hash table (map) of device name to directory where the "
22415 "device is mounted."
22419 #: ../fish/guestfish-actions.pod:2849
22424 #: ../fish/guestfish-actions.pod:2851
22432 #: ../fish/guestfish-actions.pod:2858
22433 msgid "See also: L</mountpoints>"
22437 #: ../fish/guestfish-actions.pod:2860
22442 #: ../fish/guestfish-actions.pod:2862
22450 #: ../fish/guestfish-actions.pod:2867
22451 msgid "ntfs-3g-probe"
22455 #: ../fish/guestfish-actions.pod:2869
22458 " ntfs-3g-probe true|false device\n"
22463 #: ../fish/guestfish-actions.pod:2883
22468 #: ../fish/guestfish-actions.pod:2885
22471 " ntfsresize device\n"
22476 #: ../fish/guestfish-actions.pod:2891
22477 msgid "ntfsresize-size"
22481 #: ../fish/guestfish-actions.pod:2893
22484 " ntfsresize-size device size\n"
22489 #: ../fish/guestfish-actions.pod:2895
22491 "This command is the same as L</ntfsresize> except that it allows you to "
22492 "specify the new size (in bytes) explicitly."
22496 #: ../fish/guestfish-actions.pod:2898
22501 #: ../fish/guestfish-actions.pod:2900
22504 " part-add device prlogex startsect endsect\n"
22509 #: ../fish/guestfish-actions.pod:2902
22511 "This command adds a partition to C<device>. If there is no partition table "
22512 "on the device, call L</part-init> first."
22516 #: ../fish/guestfish-actions.pod:2914
22518 "Creating a partition which covers the whole disk is not so easy. Use L</"
22519 "part-disk> to do that."
22523 #: ../fish/guestfish-actions.pod:2917
22528 #: ../fish/guestfish-actions.pod:2919
22531 " part-del device partnum\n"
22536 #: ../fish/guestfish-actions.pod:2927
22541 #: ../fish/guestfish-actions.pod:2929
22544 " part-disk device parttype\n"
22549 #: ../fish/guestfish-actions.pod:2931
22551 "This command is simply a combination of L</part-init> followed by L</part-"
22552 "add> to create a single primary partition covering the whole disk."
22556 #: ../fish/guestfish-actions.pod:2935
22558 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
22559 "possible values are described in L</part-init>."
22563 #: ../fish/guestfish-actions.pod:2941
22564 msgid "part-get-bootable"
22568 #: ../fish/guestfish-actions.pod:2943
22571 " part-get-bootable device partnum\n"
22576 #: ../fish/guestfish-actions.pod:2948
22577 msgid "See also L</part-set-bootable>."
22581 #: ../fish/guestfish-actions.pod:2950
22582 msgid "part-get-mbr-id"
22586 #: ../fish/guestfish-actions.pod:2952
22589 " part-get-mbr-id device partnum\n"
22594 #: ../fish/guestfish-actions.pod:2957 ../fish/guestfish-actions.pod:3095
22596 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
22597 "undefined results for other partition table types (see L</part-get-"
22602 #: ../fish/guestfish-actions.pod:2961
22603 msgid "part-get-parttype"
22607 #: ../fish/guestfish-actions.pod:2963
22610 " part-get-parttype device\n"
22615 #: ../fish/guestfish-actions.pod:2968
22617 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
22618 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
22619 "possible, although unusual. See L</part-init> for a full list."
22623 #: ../fish/guestfish-actions.pod:2973
22628 #: ../fish/guestfish-actions.pod:2975
22631 " part-init device parttype\n"
22636 #: ../fish/guestfish-actions.pod:2981
22638 "Initially there are no partitions. Following this, you should call L</part-"
22639 "add> for each partition required."
22643 #: ../fish/guestfish-actions.pod:3044
22648 #: ../fish/guestfish-actions.pod:3046
22651 " part-list device\n"
22656 #: ../fish/guestfish-actions.pod:3061
22658 "Start of the partition I<in bytes>. To get sectors you have to divide by "
22659 "the device's sector size, see L</blockdev-getss>."
22663 #: ../fish/guestfish-actions.pod:3074
22664 msgid "part-set-bootable"
22668 #: ../fish/guestfish-actions.pod:3076
22671 " part-set-bootable device partnum true|false\n"
22676 #: ../fish/guestfish-actions.pod:3085
22677 msgid "part-set-mbr-id"
22681 #: ../fish/guestfish-actions.pod:3087
22684 " part-set-mbr-id device partnum idbyte\n"
22689 #: ../fish/guestfish-actions.pod:3099
22690 msgid "part-set-name"
22694 #: ../fish/guestfish-actions.pod:3101
22697 " part-set-name device partnum name\n"
22702 #: ../fish/guestfish-actions.pod:3109
22703 msgid "part-to-dev"
22707 #: ../fish/guestfish-actions.pod:3111
22710 " part-to-dev partition\n"
22715 #: ../fish/guestfish-actions.pod:3117
22717 "The named partition must exist, for example as a string returned from L</"
22718 "list-partitions>."
22722 #: ../fish/guestfish-actions.pod:3120
22723 msgid "ping-daemon"
22727 #: ../fish/guestfish-actions.pod:3122
22735 #: ../fish/guestfish-actions.pod:3129
22740 #: ../fish/guestfish-actions.pod:3131
22743 " pread path count offset\n"
22748 #: ../fish/guestfish-actions.pod:3139
22749 msgid "See also L</pwrite>, L</pread-device>."
22753 #: ../fish/guestfish-actions.pod:3144
22754 msgid "pread-device"
22758 #: ../fish/guestfish-actions.pod:3146
22761 " pread-device device count offset\n"
22766 #: ../fish/guestfish-actions.pod:3154
22767 msgid "See also L</pread>."
22771 #: ../fish/guestfish-actions.pod:3159
22776 #: ../fish/guestfish-actions.pod:3161
22779 " pvcreate device\n"
22784 #: ../fish/guestfish-actions.pod:3167
22789 #: ../fish/guestfish-actions.pod:3169
22792 " pvremove device\n"
22797 #: ../fish/guestfish-actions.pod:3178
22802 #: ../fish/guestfish-actions.pod:3180
22805 " pvresize device\n"
22810 #: ../fish/guestfish-actions.pod:3185
22811 msgid "pvresize-size"
22815 #: ../fish/guestfish-actions.pod:3187
22818 " pvresize-size device size\n"
22823 #: ../fish/guestfish-actions.pod:3189
22825 "This command is the same as L</pvresize> except that it allows you to "
22826 "specify the new size (in bytes) explicitly."
22830 #: ../fish/guestfish-actions.pod:3192
22835 #: ../fish/guestfish-actions.pod:3194
22843 #: ../fish/guestfish-actions.pod:3202
22844 msgid "See also L</pvs-full>."
22848 #: ../fish/guestfish-actions.pod:3204
22853 #: ../fish/guestfish-actions.pod:3206
22861 #: ../fish/guestfish-actions.pod:3211
22866 #: ../fish/guestfish-actions.pod:3213
22874 #: ../fish/guestfish-actions.pod:3217
22879 #: ../fish/guestfish-actions.pod:3219
22882 " pwrite path content offset\n"
22887 #: ../fish/guestfish-actions.pod:3230
22888 msgid "See also L</pread>, L</pwrite-device>."
22892 #: ../fish/guestfish-actions.pod:3235
22893 msgid "pwrite-device"
22897 #: ../fish/guestfish-actions.pod:3237
22900 " pwrite-device device content offset\n"
22905 #: ../fish/guestfish-actions.pod:3247
22906 msgid "See also L</pwrite>."
22910 #: ../fish/guestfish-actions.pod:3252
22915 #: ../fish/guestfish-actions.pod:3254
22918 " read-file path\n"
22923 #: ../fish/guestfish-actions.pod:3259
22925 "Unlike L</cat>, this function can correctly handle files that contain "
22926 "embedded ASCII NUL characters. However unlike L</download>, this function "
22927 "is limited in the total size of file that can be handled."
22931 #: ../fish/guestfish-actions.pod:3267
22936 #: ../fish/guestfish-actions.pod:3269
22939 " read-lines path\n"
22944 #: ../fish/guestfish-actions.pod:3276
22946 "Note that this function cannot correctly handle binary files (specifically, "
22947 "files containing C<\\0> character which is treated as end of line). For "
22948 "those you need to use the L</read-file> function which has a more complex "
22953 #: ../fish/guestfish-actions.pod:3281
22958 #: ../fish/guestfish-actions.pod:3283
22966 #: ../fish/guestfish-actions.pod:3335
22968 "This function is primarily intended for use by programs. To get a simple "
22969 "list of names, use L</ls>. To get a printable directory for human "
22970 "consumption, use L</ll>."
22974 #: ../fish/guestfish-actions.pod:3339
22979 #: ../fish/guestfish-actions.pod:3341
22987 #: ../fish/guestfish-actions.pod:3345
22988 msgid "readlinklist"
22992 #: ../fish/guestfish-actions.pod:3347
22995 " readlinklist path 'names ...'\n"
23000 #: ../fish/guestfish-actions.pod:3371
23005 #: ../fish/guestfish-actions.pod:3373
23013 #: ../fish/guestfish-actions.pod:3378
23014 msgid "removexattr"
23018 #: ../fish/guestfish-actions.pod:3380
23021 " removexattr xattr path\n"
23026 #: ../fish/guestfish-actions.pod:3385
23027 msgid "See also: L</lremovexattr>, L<attr(5)>."
23031 #: ../fish/guestfish-actions.pod:3387
23036 #: ../fish/guestfish-actions.pod:3389
23039 " resize2fs device\n"
23044 #: ../fish/guestfish-actions.pod:3394
23046 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23047 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23048 "gives an error about this and sometimes not. In any case, it is always safe "
23049 "to call L</e2fsck-f> before calling this function."
23053 #: ../fish/guestfish-actions.pod:3400
23054 msgid "resize2fs-size"
23058 #: ../fish/guestfish-actions.pod:3402
23061 " resize2fs-size device size\n"
23066 #: ../fish/guestfish-actions.pod:3404
23068 "This command is the same as L</resize2fs> except that it allows you to "
23069 "specify the new size (in bytes) explicitly."
23073 #: ../fish/guestfish-actions.pod:3407
23078 #: ../fish/guestfish-actions.pod:3409
23086 #: ../fish/guestfish-actions.pod:3413
23091 #: ../fish/guestfish-actions.pod:3415
23099 #: ../fish/guestfish-actions.pod:3421
23104 #: ../fish/guestfish-actions.pod:3423
23112 #: ../fish/guestfish-actions.pod:3427
23113 msgid "rmmountpoint"
23117 #: ../fish/guestfish-actions.pod:3429
23120 " rmmountpoint exemptpath\n"
23125 #: ../fish/guestfish-actions.pod:3431
23127 "This calls removes a mountpoint that was previously created with L</"
23128 "mkmountpoint>. See L</mkmountpoint> for full details."
23132 #: ../fish/guestfish-actions.pod:3435
23133 msgid "scrub-device"
23137 #: ../fish/guestfish-actions.pod:3437
23140 " scrub-device device\n"
23145 #: ../fish/guestfish-actions.pod:3448
23150 #: ../fish/guestfish-actions.pod:3450
23153 " scrub-file file\n"
23158 #: ../fish/guestfish-actions.pod:3460
23159 msgid "scrub-freespace"
23163 #: ../fish/guestfish-actions.pod:3462
23166 " scrub-freespace dir\n"
23171 #: ../fish/guestfish-actions.pod:3464
23173 "This command creates the directory C<dir> and then fills it with files until "
23174 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23175 "deletes them. The intention is to scrub any free space on the partition "
23176 "containing C<dir>."
23180 #: ../fish/guestfish-actions.pod:3473
23185 #: ../fish/guestfish-actions.pod:3475
23190 #: ../fish/guestfish-actions.pod:3477
23193 " set-append append\n"
23198 #: ../fish/guestfish-actions.pod:3488
23199 msgid "set-autosync"
23203 #: ../fish/guestfish-actions.pod:3490
23208 #: ../fish/guestfish-actions.pod:3492
23211 " set-autosync true|false\n"
23216 #: ../fish/guestfish-actions.pod:3494
23218 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
23219 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
23220 "closed (also if the program exits without closing handles)."
23224 #: ../fish/guestfish-actions.pod:3502
23229 #: ../fish/guestfish-actions.pod:3504
23234 #: ../fish/guestfish-actions.pod:3506
23237 " set-direct true|false\n"
23242 #: ../fish/guestfish-actions.pod:3512
23244 "One consequence of this is that log messages aren't caught by the library "
23245 "and handled by L</set-log-message-callback>, but go straight to stdout."
23249 #: ../fish/guestfish-actions.pod:3521
23250 msgid "set-e2label"
23254 #: ../fish/guestfish-actions.pod:3523
23257 " set-e2label device label\n"
23262 #: ../fish/guestfish-actions.pod:3529
23264 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
23265 "label on a filesystem."
23269 #: ../fish/guestfish-actions.pod:3532
23274 #: ../fish/guestfish-actions.pod:3534
23277 " set-e2uuid device uuid\n"
23282 #: ../fish/guestfish-actions.pod:3541
23284 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
23285 "UUID of a filesystem."
23289 #: ../fish/guestfish-actions.pod:3544
23290 msgid "set-memsize"
23294 #: ../fish/guestfish-actions.pod:3546
23299 #: ../fish/guestfish-actions.pod:3548
23302 " set-memsize memsize\n"
23307 #: ../fish/guestfish-actions.pod:3550
23309 "This sets the memory size in megabytes allocated to the qemu subprocess. "
23310 "This only has any effect if called before L</launch>."
23314 #: ../fish/guestfish-actions.pod:3561
23315 msgid "set-network"
23319 #: ../fish/guestfish-actions.pod:3563
23324 #: ../fish/guestfish-actions.pod:3565
23327 " set-network true|false\n"
23332 #: ../fish/guestfish-actions.pod:3573
23334 "You must call this before calling L</launch>, otherwise it has no effect."
23338 #: ../fish/guestfish-actions.pod:3576
23343 #: ../fish/guestfish-actions.pod:3578
23348 #: ../fish/guestfish-actions.pod:3580
23351 " set-path searchpath\n"
23356 #: ../fish/guestfish-actions.pod:3589
23361 #: ../fish/guestfish-actions.pod:3591
23366 #: ../fish/guestfish-actions.pod:3593
23374 #: ../fish/guestfish-actions.pod:3613
23375 msgid "set-recovery-proc"
23379 #: ../fish/guestfish-actions.pod:3615
23380 msgid "recovery-proc"
23384 #: ../fish/guestfish-actions.pod:3617
23387 " set-recovery-proc true|false\n"
23392 #: ../fish/guestfish-actions.pod:3619
23394 "If this is called with the parameter C<false> then L</launch> does not "
23395 "create a recovery process. The purpose of the recovery process is to stop "
23396 "runaway qemu processes in the case where the main program aborts abruptly."
23400 #: ../fish/guestfish-actions.pod:3624
23402 "This only has any effect if called before L</launch>, and the default is "
23407 #: ../fish/guestfish-actions.pod:3633
23408 msgid "set-selinux"
23412 #: ../fish/guestfish-actions.pod:3635
23417 #: ../fish/guestfish-actions.pod:3637
23420 " set-selinux true|false\n"
23425 #: ../fish/guestfish-actions.pod:3648
23430 #: ../fish/guestfish-actions.pod:3650
23435 #: ../fish/guestfish-actions.pod:3652
23438 " set-trace true|false\n"
23443 #: ../fish/guestfish-actions.pod:3668
23444 msgid "set-verbose"
23448 #: ../fish/guestfish-actions.pod:3670
23453 #: ../fish/guestfish-actions.pod:3672
23456 " set-verbose true|false\n"
23461 #: ../fish/guestfish-actions.pod:3679
23466 #: ../fish/guestfish-actions.pod:3681
23469 " setcon context\n"
23474 #: ../fish/guestfish-actions.pod:3688
23479 #: ../fish/guestfish-actions.pod:3690
23482 " setxattr xattr val vallen path\n"
23487 #: ../fish/guestfish-actions.pod:3696
23488 msgid "See also: L</lsetxattr>, L<attr(5)>."
23492 #: ../fish/guestfish-actions.pod:3698
23497 #: ../fish/guestfish-actions.pod:3700
23500 " sfdisk device cyls heads sectors 'lines ...'\n"
23505 #: ../fish/guestfish-actions.pod:3722
23506 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
23510 #: ../fish/guestfish-actions.pod:3728
23515 #: ../fish/guestfish-actions.pod:3730
23518 " sfdiskM device 'lines ...'\n"
23523 #: ../fish/guestfish-actions.pod:3732
23525 "This is a simplified interface to the L</sfdisk> command, where partition "
23526 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
23527 "you don't need to specify the cyls, heads and sectors parameters which were "
23528 "rarely if ever used anyway."
23532 #: ../fish/guestfish-actions.pod:3738
23533 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
23537 #: ../fish/guestfish-actions.pod:3744
23542 #: ../fish/guestfish-actions.pod:3746
23545 " sfdisk-N device partnum cyls heads sectors line\n"
23550 #: ../fish/guestfish-actions.pod:3751
23552 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
23553 "cyls/heads/sectors parameters."
23557 #: ../fish/guestfish-actions.pod:3754
23558 msgid "See also: L</part-add>"
23562 #: ../fish/guestfish-actions.pod:3759
23563 msgid "sfdisk-disk-geometry"
23567 #: ../fish/guestfish-actions.pod:3761
23570 " sfdisk-disk-geometry device\n"
23575 #: ../fish/guestfish-actions.pod:3763
23577 "This displays the disk geometry of C<device> read from the partition table. "
23578 "Especially in the case where the underlying block device has been resized, "
23579 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
23580 "kernel-geometry>)."
23584 #: ../fish/guestfish-actions.pod:3771
23585 msgid "sfdisk-kernel-geometry"
23589 #: ../fish/guestfish-actions.pod:3773
23592 " sfdisk-kernel-geometry device\n"
23597 #: ../fish/guestfish-actions.pod:3780
23602 #: ../fish/guestfish-actions.pod:3782
23605 " sfdisk-l device\n"
23610 #: ../fish/guestfish-actions.pod:3788
23611 msgid "See also: L</part-list>"
23615 #: ../fish/guestfish-actions.pod:3790
23620 #: ../fish/guestfish-actions.pod:3792
23628 #: ../fish/guestfish-actions.pod:3797
23629 msgid "This is like L</command>, but passes the command to:"
23633 #: ../fish/guestfish-actions.pod:3805
23634 msgid "All the provisos about L</command> apply to this call."
23638 #: ../fish/guestfish-actions.pod:3807
23643 #: ../fish/guestfish-actions.pod:3809
23646 " sh-lines command\n"
23651 #: ../fish/guestfish-actions.pod:3811
23652 msgid "This is the same as L</sh>, but splits the result into a list of lines."
23656 #: ../fish/guestfish-actions.pod:3814
23657 msgid "See also: L</command-lines>"
23661 #: ../fish/guestfish-actions.pod:3816
23666 #: ../fish/guestfish-actions.pod:3818
23674 #: ../fish/guestfish-actions.pod:3822
23679 #: ../fish/guestfish-actions.pod:3824
23687 #: ../fish/guestfish-actions.pod:3830
23692 #: ../fish/guestfish-actions.pod:3832
23700 #: ../fish/guestfish-actions.pod:3840
23705 #: ../fish/guestfish-actions.pod:3842
23713 #: ../fish/guestfish-actions.pod:3850
23718 #: ../fish/guestfish-actions.pod:3852
23721 " strings-e encoding path\n"
23726 #: ../fish/guestfish-actions.pod:3854
23728 "This is like the L</strings> command, but allows you to specify the encoding "
23729 "of strings that are looked for in the source file C<path>."
23733 #: ../fish/guestfish-actions.pod:3864
23735 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
23736 "ISO-8859-X (this is what L</strings> uses)."
23740 #: ../fish/guestfish-actions.pod:3896
23741 msgid "swapoff-device"
23745 #: ../fish/guestfish-actions.pod:3898
23748 " swapoff-device device\n"
23753 #: ../fish/guestfish-actions.pod:3900
23755 "This command disables the libguestfs appliance swap device or partition "
23756 "named C<device>. See L</swapon-device>."
23760 #: ../fish/guestfish-actions.pod:3904
23761 msgid "swapoff-file"
23765 #: ../fish/guestfish-actions.pod:3906
23768 " swapoff-file file\n"
23773 #: ../fish/guestfish-actions.pod:3910
23774 msgid "swapoff-label"
23778 #: ../fish/guestfish-actions.pod:3912
23781 " swapoff-label label\n"
23786 #: ../fish/guestfish-actions.pod:3917
23787 msgid "swapoff-uuid"
23791 #: ../fish/guestfish-actions.pod:3919
23794 " swapoff-uuid uuid\n"
23799 #: ../fish/guestfish-actions.pod:3924
23800 msgid "swapon-device"
23804 #: ../fish/guestfish-actions.pod:3926
23807 " swapon-device device\n"
23812 #: ../fish/guestfish-actions.pod:3928
23814 "This command enables the libguestfs appliance to use the swap device or "
23815 "partition named C<device>. The increased memory is made available for all "
23816 "commands, for example those run using L</command> or L</sh>."
23820 #: ../fish/guestfish-actions.pod:3940
23821 msgid "swapon-file"
23825 #: ../fish/guestfish-actions.pod:3942
23828 " swapon-file file\n"
23833 #: ../fish/guestfish-actions.pod:3944
23835 "This command enables swap to a file. See L</swapon-device> for other notes."
23839 #: ../fish/guestfish-actions.pod:3947
23840 msgid "swapon-label"
23844 #: ../fish/guestfish-actions.pod:3949
23847 " swapon-label label\n"
23852 #: ../fish/guestfish-actions.pod:3951
23854 "This command enables swap to a labeled swap partition. See L</swapon-"
23855 "device> for other notes."
23859 #: ../fish/guestfish-actions.pod:3954
23860 msgid "swapon-uuid"
23864 #: ../fish/guestfish-actions.pod:3956
23867 " swapon-uuid uuid\n"
23872 #: ../fish/guestfish-actions.pod:3958
23874 "This command enables swap to a swap partition with the given UUID. See L</"
23875 "swapon-device> for other notes."
23879 #: ../fish/guestfish-actions.pod:3961
23884 #: ../fish/guestfish-actions.pod:3963
23892 #: ../fish/guestfish-actions.pod:3971
23897 #: ../fish/guestfish-actions.pod:3973
23905 #: ../fish/guestfish-actions.pod:3981
23910 #: ../fish/guestfish-actions.pod:3983
23913 " tail-n nrlines path\n"
23918 #: ../fish/guestfish-actions.pod:3996
23923 #: ../fish/guestfish-actions.pod:3998
23926 " tar-in (tarfile|-) directory\n"
23931 #: ../fish/guestfish-actions.pod:4003
23932 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
23936 #: ../fish/guestfish-actions.pod:4008
23941 #: ../fish/guestfish-actions.pod:4010
23944 " tar-out directory (tarfile|-)\n"
23949 #: ../fish/guestfish-actions.pod:4015
23950 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
23954 #: ../fish/guestfish-actions.pod:4020
23959 #: ../fish/guestfish-actions.pod:4022
23962 " tgz-in (tarball|-) directory\n"
23967 #: ../fish/guestfish-actions.pod:4027
23968 msgid "To upload an uncompressed tarball, use L</tar-in>."
23972 #: ../fish/guestfish-actions.pod:4031
23977 #: ../fish/guestfish-actions.pod:4033
23980 " tgz-out directory (tarball|-)\n"
23985 #: ../fish/guestfish-actions.pod:4038
23986 msgid "To download an uncompressed tarball, use L</tar-out>."
23990 #: ../fish/guestfish-actions.pod:4042
23995 #: ../fish/guestfish-actions.pod:4044
24003 #: ../fish/guestfish-actions.pod:4053
24008 #: ../fish/guestfish-actions.pod:4055
24016 #: ../fish/guestfish-actions.pod:4060
24017 msgid "truncate-size"
24021 #: ../fish/guestfish-actions.pod:4062
24024 " truncate-size path size\n"
24029 #: ../fish/guestfish-actions.pod:4067
24031 "If the current file size is less than C<size> then the file is extended to "
24032 "the required size with zero bytes. This creates a sparse file (ie. disk "
24033 "blocks are not allocated for the file until you write to it). To create a "
24034 "non-sparse file of zeroes, use L</fallocate64> instead."
24038 #: ../fish/guestfish-actions.pod:4073
24043 #: ../fish/guestfish-actions.pod:4075
24046 " tune2fs-l device\n"
24051 #: ../fish/guestfish-actions.pod:4085
24056 #: ../fish/guestfish-actions.pod:4087
24059 " txz-in (tarball|-) directory\n"
24064 #: ../fish/guestfish-actions.pod:4094
24069 #: ../fish/guestfish-actions.pod:4096
24072 " txz-out directory (tarball|-)\n"
24077 #: ../fish/guestfish-actions.pod:4103
24082 #: ../fish/guestfish-actions.pod:4105
24090 #: ../fish/guestfish-actions.pod:4119
24091 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24095 #: ../fish/guestfish-actions.pod:4124
24100 #: ../fish/guestfish-actions.pod:4126
24105 #: ../fish/guestfish-actions.pod:4128
24108 " umount pathordevice\n"
24113 #: ../fish/guestfish-actions.pod:4134
24118 #: ../fish/guestfish-actions.pod:4136
24119 msgid "unmount-all"
24123 #: ../fish/guestfish-actions.pod:4138
24131 #: ../fish/guestfish-actions.pod:4144
24136 #: ../fish/guestfish-actions.pod:4146
24139 " upload (filename|-) remotefilename\n"
24144 #: ../fish/guestfish-actions.pod:4153
24145 msgid "See also L</download>."
24149 #: ../fish/guestfish-actions.pod:4157
24150 msgid "upload-offset"
24154 #: ../fish/guestfish-actions.pod:4159
24157 " upload-offset (filename|-) remotefilename offset\n"
24162 #: ../fish/guestfish-actions.pod:4171
24164 "Note that there is no limit on the amount of data that can be uploaded with "
24165 "this call, unlike with L</pwrite>, and this call always writes the full "
24166 "amount unless an error occurs."
24170 #: ../fish/guestfish-actions.pod:4176
24171 msgid "See also L</upload>, L</pwrite>."
24175 #: ../fish/guestfish-actions.pod:4180
24180 #: ../fish/guestfish-actions.pod:4182
24183 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24188 #: ../fish/guestfish-actions.pod:4201
24193 #: ../fish/guestfish-actions.pod:4203
24201 #: ../fish/guestfish-actions.pod:4230
24203 "I<Note:> Don't use this call to test for availability of features. In "
24204 "enterprise distributions we backport features from later versions into "
24205 "earlier versions, making this an unreliable way to test for features. Use "
24206 "L</available> instead."
24210 #: ../fish/guestfish-actions.pod:4236
24215 #: ../fish/guestfish-actions.pod:4238
24218 " vfs-label device\n"
24223 #: ../fish/guestfish-actions.pod:4245
24224 msgid "To find a filesystem from the label, use L</findfs-label>."
24228 #: ../fish/guestfish-actions.pod:4247
24233 #: ../fish/guestfish-actions.pod:4249
24236 " vfs-type device\n"
24241 #: ../fish/guestfish-actions.pod:4259
24246 #: ../fish/guestfish-actions.pod:4261
24249 " vfs-uuid device\n"
24254 #: ../fish/guestfish-actions.pod:4268
24255 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
24259 #: ../fish/guestfish-actions.pod:4270
24260 msgid "vg-activate"
24264 #: ../fish/guestfish-actions.pod:4272
24267 " vg-activate true|false 'volgroups ...'\n"
24272 #: ../fish/guestfish-actions.pod:4285
24273 msgid "vg-activate-all"
24277 #: ../fish/guestfish-actions.pod:4287
24280 " vg-activate-all true|false\n"
24285 #: ../fish/guestfish-actions.pod:4297
24290 #: ../fish/guestfish-actions.pod:4299
24293 " vgcreate volgroup 'physvols ...'\n"
24298 #: ../fish/guestfish-actions.pod:4304
24303 #: ../fish/guestfish-actions.pod:4306
24306 " vglvuuids vgname\n"
24311 #: ../fish/guestfish-actions.pod:4311
24313 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
24314 "logical volumes and volume groups."
24318 #: ../fish/guestfish-actions.pod:4314
24319 msgid "See also L</vgpvuuids>."
24323 #: ../fish/guestfish-actions.pod:4316
24328 #: ../fish/guestfish-actions.pod:4318
24331 " vgpvuuids vgname\n"
24336 #: ../fish/guestfish-actions.pod:4323
24338 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
24339 "physical volumes and volume groups."
24343 #: ../fish/guestfish-actions.pod:4326
24344 msgid "See also L</vglvuuids>."
24348 #: ../fish/guestfish-actions.pod:4328
24353 #: ../fish/guestfish-actions.pod:4330
24356 " vgremove vgname\n"
24361 #: ../fish/guestfish-actions.pod:4337
24366 #: ../fish/guestfish-actions.pod:4339
24369 " vgrename volgroup newvolgroup\n"
24374 #: ../fish/guestfish-actions.pod:4343
24379 #: ../fish/guestfish-actions.pod:4345
24387 #: ../fish/guestfish-actions.pod:4353
24388 msgid "See also L</vgs-full>."
24392 #: ../fish/guestfish-actions.pod:4355
24397 #: ../fish/guestfish-actions.pod:4357
24405 #: ../fish/guestfish-actions.pod:4362
24410 #: ../fish/guestfish-actions.pod:4364
24418 #: ../fish/guestfish-actions.pod:4369
24423 #: ../fish/guestfish-actions.pod:4371
24431 #: ../fish/guestfish-actions.pod:4375
24436 #: ../fish/guestfish-actions.pod:4377
24444 #: ../fish/guestfish-actions.pod:4382
24449 #: ../fish/guestfish-actions.pod:4384
24457 #: ../fish/guestfish-actions.pod:4389
24462 #: ../fish/guestfish-actions.pod:4391
24470 #: ../fish/guestfish-actions.pod:4396
24475 #: ../fish/guestfish-actions.pod:4398
24478 " write path content\n"
24483 #: ../fish/guestfish-actions.pod:4406
24488 #: ../fish/guestfish-actions.pod:4408
24491 " write-file path content size\n"
24496 #: ../fish/guestfish-actions.pod:4431
24501 #: ../fish/guestfish-actions.pod:4433
24504 " zegrep regex path\n"
24509 #: ../fish/guestfish-actions.pod:4441
24514 #: ../fish/guestfish-actions.pod:4443
24517 " zegrepi regex path\n"
24522 #: ../fish/guestfish-actions.pod:4451
24527 #: ../fish/guestfish-actions.pod:4453
24535 #: ../fish/guestfish-actions.pod:4461
24536 msgid "See also: L</zero-device>, L</scrub-device>."
24540 #: ../fish/guestfish-actions.pod:4463
24541 msgid "zero-device"
24545 #: ../fish/guestfish-actions.pod:4465
24548 " zero-device device\n"
24553 #: ../fish/guestfish-actions.pod:4467
24555 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
24556 "which just zeroes the first few blocks of a device."
24560 #: ../fish/guestfish-actions.pod:4474
24565 #: ../fish/guestfish-actions.pod:4476
24568 " zerofree device\n"
24573 #: ../fish/guestfish-actions.pod:4489
24578 #: ../fish/guestfish-actions.pod:4491
24581 " zfgrep pattern path\n"
24586 #: ../fish/guestfish-actions.pod:4499
24591 #: ../fish/guestfish-actions.pod:4501
24594 " zfgrepi pattern path\n"
24599 #: ../fish/guestfish-actions.pod:4509
24604 #: ../fish/guestfish-actions.pod:4511
24607 " zfile meth path\n"
24612 #: ../fish/guestfish-actions.pod:4518
24614 "Since 1.0.63, use L</file> instead which can now process compressed files."
24618 #: ../fish/guestfish-actions.pod:4528
24623 #: ../fish/guestfish-actions.pod:4530
24626 " zgrep regex path\n"
24631 #: ../fish/guestfish-actions.pod:4538
24636 #: ../fish/guestfish-actions.pod:4540
24639 " zgrepi regex path\n"
24644 #: ../fish/guestfish-commands.pod:1
24649 #: ../fish/guestfish-commands.pod:3
24654 #: ../fish/guestfish-commands.pod:5
24657 " alloc filename size\n"
24662 #: ../fish/guestfish-commands.pod:7
24664 "This creates an empty (zeroed) file of the given size, and then adds so it "
24665 "can be further examined."
24669 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
24670 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
24674 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
24675 msgid "Size can be specified using standard suffixes, eg. C<1M>."
24679 #: ../fish/guestfish-commands.pod:14
24681 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
24682 "image, see L</PREPARED DISK IMAGES>."
24686 #: ../fish/guestfish-commands.pod:17
24691 #: ../fish/guestfish-commands.pod:19
24694 " copy-in local [local ...] /remotedir\n"
24699 #: ../fish/guestfish-commands.pod:21
24701 "C<copy-in> copies local files or directories recursively into the disk "
24702 "image, placing them in the directory called C</remotedir> (which must "
24703 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
24704 "other commands as necessary."
24708 #: ../fish/guestfish-commands.pod:26
24710 "Multiple local files and directories can be specified, but the last "
24711 "parameter must always be a remote directory. Wildcards cannot be used."
24715 #: ../fish/guestfish-commands.pod:30
24720 #: ../fish/guestfish-commands.pod:32
24723 " copy-out remote [remote ...] localdir\n"
24728 #: ../fish/guestfish-commands.pod:34
24730 "C<copy-out> copies remote files or directories recursively out of the disk "
24731 "image, placing them on the host disk in a local directory called C<localdir> "
24732 "(which must exist). This guestfish meta-command turns into a sequence of L</"
24733 "download>, L</tar-out> and other commands as necessary."
24737 #: ../fish/guestfish-commands.pod:40
24739 "Multiple remote files and directories can be specified, but the last "
24740 "parameter must always be a local directory. To download to the current "
24741 "directory, use C<.> as in:"
24745 #: ../fish/guestfish-commands.pod:44
24748 " copy-out /home .\n"
24753 #: ../fish/guestfish-commands.pod:46
24755 "Wildcards cannot be used in the ordinary command, but you can use them with "
24756 "the help of L</glob> like this:"
24760 #: ../fish/guestfish-commands.pod:49
24763 " glob copy-out /home/* .\n"
24768 #: ../fish/guestfish-commands.pod:51
24773 #: ../fish/guestfish-commands.pod:53
24776 " echo [params ...]\n"
24781 #: ../fish/guestfish-commands.pod:55
24782 msgid "This echos the parameters to the terminal."
24786 #: ../fish/guestfish-commands.pod:57
24791 #: ../fish/guestfish-commands.pod:59
24796 #: ../fish/guestfish-commands.pod:61
24801 #: ../fish/guestfish-commands.pod:63
24809 #: ../fish/guestfish-commands.pod:65
24811 "This is used to edit a file. It downloads the file, edits it locally using "
24812 "your editor, then uploads the result."
24816 #: ../fish/guestfish-commands.pod:68
24818 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
24819 "or C<emacs> you will get those corresponding editors."
24823 #: ../fish/guestfish-commands.pod:72
24828 #: ../fish/guestfish-commands.pod:74
24831 " glob command args...\n"
24836 #: ../fish/guestfish-commands.pod:76
24838 "Expand wildcards in any paths in the args list, and run C<command> "
24839 "repeatedly on each matching path."
24843 #: ../fish/guestfish-commands.pod:79
24844 msgid "See L</WILDCARDS AND GLOBBING>."
24848 #: ../fish/guestfish-commands.pod:81
24853 #: ../fish/guestfish-commands.pod:83
24856 " hexedit <filename|device>\n"
24857 " hexedit <filename|device> <max>\n"
24858 " hexedit <filename|device> <start> <max>\n"
24863 #: ../fish/guestfish-commands.pod:87
24865 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
24870 #: ../fish/guestfish-commands.pod:90
24872 "This command works by downloading potentially the whole file or device, "
24873 "editing it locally, then uploading it. If the file or device is large, you "
24874 "have to specify which part you wish to edit by using C<max> and/or C<start> "
24875 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
24876 "usual modifiers allowed such as C<1M> (1 megabyte)."
24880 #: ../fish/guestfish-commands.pod:97
24881 msgid "For example to edit the first few sectors of a disk you might do:"
24885 #: ../fish/guestfish-commands.pod:100
24888 " hexedit /dev/sda 1M\n"
24893 #: ../fish/guestfish-commands.pod:102
24895 "which would allow you to edit anywhere within the first megabyte of the disk."
24899 #: ../fish/guestfish-commands.pod:105
24900 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
24904 #: ../fish/guestfish-commands.pod:107
24907 " hexedit /dev/sda1 0x400 0x400\n"
24912 #: ../fish/guestfish-commands.pod:109
24913 msgid "(assuming the superblock is in the standard location)."
24917 #: ../fish/guestfish-commands.pod:111
24919 "This command requires the external L<hexedit(1)> program. You can specify "
24920 "another program to use by setting the C<HEXEDITOR> environment variable."
24924 #: ../fish/guestfish-commands.pod:115
24925 msgid "See also L</hexdump>."
24929 #: ../fish/guestfish-commands.pod:117
24934 #: ../fish/guestfish-commands.pod:119
24942 #: ../fish/guestfish-commands.pod:121
24944 "Change the local directory, ie. the current directory of guestfish itself."
24948 #: ../fish/guestfish-commands.pod:124
24949 msgid "Note that C<!cd> won't do what you might expect."
24953 #: ../fish/guestfish-commands.pod:126
24958 #: ../fish/guestfish-commands.pod:128
24963 #: ../fish/guestfish-commands.pod:130
24971 #: ../fish/guestfish-commands.pod:132
24972 msgid "Opens the manual page for guestfish."
24976 #: ../fish/guestfish-commands.pod:134
24981 #: ../fish/guestfish-commands.pod:136
24986 #: ../fish/guestfish-commands.pod:138
24994 #: ../fish/guestfish-commands.pod:140
25002 #: ../fish/guestfish-commands.pod:142
25003 msgid "This is used to view a file."
25007 #: ../fish/guestfish-commands.pod:144
25009 "The default viewer is C<$PAGER>. However if you use the alternate command "
25010 "C<less> you will get the C<less> command specifically."
25014 #: ../fish/guestfish-commands.pod:147
25019 #: ../fish/guestfish-commands.pod:149
25027 #: ../fish/guestfish-commands.pod:151
25029 "Close and reopen the libguestfs handle. It is not necessary to use this "
25030 "normally, because the handle is closed properly when guestfish exits. "
25031 "However this is occasionally useful for testing."
25035 #: ../fish/guestfish-commands.pod:155
25040 #: ../fish/guestfish-commands.pod:157
25043 " sparse filename size\n"
25048 #: ../fish/guestfish-commands.pod:159
25050 "This creates an empty sparse file of the given size, and then adds so it can "
25051 "be further examined."
25055 #: ../fish/guestfish-commands.pod:162
25057 "In all respects it works the same as the L</alloc> command, except that the "
25058 "image file is allocated sparsely, which means that disk blocks are not "
25059 "assigned to the file until they are needed. Sparse disk files only use "
25060 "space when written to, but they are slower and there is a danger you could "
25061 "run out of real disk space during a write operation."
25065 #: ../fish/guestfish-commands.pod:172
25070 #: ../fish/guestfish-commands.pod:174
25078 #: ../fish/guestfish-commands.pod:176
25080 "This command returns a list of the optional groups known to the daemon, and "
25081 "indicates which ones are supported by this build of the libguestfs appliance."
25085 #: ../fish/guestfish-commands.pod:180
25086 msgid "See also L<guestfs(3)/AVAILABILITY>."
25090 #: ../fish/guestfish-commands.pod:182
25095 #: ../fish/guestfish-commands.pod:184
25098 " time command args...\n"
25103 #: ../fish/guestfish-commands.pod:186
25105 "Run the command as usual, but print the elapsed time afterwards. This can "
25106 "be useful for benchmarking operations."
25110 #: ../test-tool/libguestfs-test-tool.pod:5
25111 msgid "libguestfs-test-tool - End user tests for libguestfs"
25115 #: ../test-tool/libguestfs-test-tool.pod:9
25118 " libguestfs-test-tool [--options]\n"
25123 #: ../test-tool/libguestfs-test-tool.pod:13
25125 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25126 "and developers, to allow them to check basic libguestfs functionality is "
25127 "working. This is needed because libguestfs occasionally breaks for reasons "
25128 "beyond our control: usually because of changes in the underlying qemu or "
25129 "kernel packages, or the host environment."
25133 #: ../test-tool/libguestfs-test-tool.pod:20
25134 msgid "If you suspect a problem in libguestfs, then just run:"
25138 #: ../test-tool/libguestfs-test-tool.pod:22
25141 " libguestfs-test-tool\n"
25146 #: ../test-tool/libguestfs-test-tool.pod:24
25147 msgid "It will print lots of diagnostic messages."
25151 #: ../test-tool/libguestfs-test-tool.pod:26
25152 msgid "If it runs to completion successfully, you will see this near the end:"
25156 #: ../test-tool/libguestfs-test-tool.pod:28
25159 " ===== TEST FINISHED OK =====\n"
25164 #: ../test-tool/libguestfs-test-tool.pod:30
25165 msgid "and the test tool will exit with code 0."
25169 #: ../test-tool/libguestfs-test-tool.pod:32
25171 "If it fails (and/or exits with non-zero error code), please paste the "
25172 "B<complete, unedited> output of the test tool into a bug report. More "
25173 "information about reporting bugs can be found on the L<http://libguestfs.org/"
25178 #: ../test-tool/libguestfs-test-tool.pod:41
25183 #: ../test-tool/libguestfs-test-tool.pod:43
25184 msgid "Display short usage information and exit."
25188 #: ../test-tool/libguestfs-test-tool.pod:45
25189 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
25193 #: ../test-tool/libguestfs-test-tool.pod:47
25195 "Pass an alternate name for the helper program. libguestfs-test-tool will "
25196 "normally look in the C<$libexec> directory that was configured when the tool "
25201 #: ../test-tool/libguestfs-test-tool.pod:51
25202 msgid "I<--qemu qemu_binary>"
25206 #: ../test-tool/libguestfs-test-tool.pod:53
25208 "If you have downloaded another qemu binary, point this option at the full "
25209 "path of the binary to try it."
25213 #: ../test-tool/libguestfs-test-tool.pod:56
25214 msgid "I<--qemudir qemu_source_dir>"
25218 #: ../test-tool/libguestfs-test-tool.pod:58
25220 "If you have compiled qemu from source, point this option at the source "
25221 "directory to try it."
25225 #: ../test-tool/libguestfs-test-tool.pod:61
25226 msgid "I<--timeout N>"
25230 #: ../test-tool/libguestfs-test-tool.pod:63
25232 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
25233 "does not usually need to be adjusted unless your machine is very slow."
25237 #: ../test-tool/libguestfs-test-tool.pod:69
25238 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
25242 #: ../test-tool/libguestfs-test-tool.pod:71
25244 "If you have compiled another version of qemu from source and would like to "
25245 "try that, then you can use the I<--qemudir> option to point to the qemu "
25246 "source directory."
25250 #: ../test-tool/libguestfs-test-tool.pod:75
25252 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
25253 "option to point to the binary."
25257 #: ../test-tool/libguestfs-test-tool.pod:78
25259 "When using an alternate qemu with libguestfs, usually you would need to "
25260 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
25261 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
25262 "use either of the I<--qemudir> or I<--qemu> options."
25266 #: ../test-tool/libguestfs-test-tool.pod:85
25268 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
25269 "I<1> if there was an error."
25273 #: ../test-tool/libguestfs-test-tool.pod:92
25274 msgid "/usr/libexec/libguestfs-test-tool-helper"
25278 #: ../test-tool/libguestfs-test-tool.pod:94
25280 "This helper program is run inside the appliance and provides additional "
25285 #: ../test-tool/libguestfs-test-tool.pod:97
25286 msgid "/usr/bin/mkisofs"
25290 #: ../test-tool/libguestfs-test-tool.pod:99
25292 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
25293 "which is used as part of the tests."
25297 #: ../test-tool/libguestfs-test-tool.pod:106
25299 "For the full list of environment variables which may affect libguestfs, "
25300 "please see the L<guestfs(3)> manual page."
25304 #: ../test-tool/libguestfs-test-tool.pod:111
25305 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
25309 #: ../test-tool/libguestfs-test-tool.pod:121
25310 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
25314 #: ../fuse/guestmount.pod:5
25316 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
25320 #: ../fuse/guestmount.pod:9
25323 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
25328 #: ../fuse/guestmount.pod:11
25331 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
25336 #: ../fuse/guestmount.pod:13
25339 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
25344 #: ../fuse/guestmount.pod:17
25346 "You must I<not> use C<guestmount> in read-write mode on live virtual "
25347 "machines. If you do this, you risk disk corruption in the VM."
25351 #: ../fuse/guestmount.pod:22
25353 "The guestmount program can be used to mount virtual machine filesystems and "
25354 "other disk images on the host. It uses libguestfs for access to the guest "
25355 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
25356 "a mountable device."
25360 #: ../fuse/guestmount.pod:27
25362 "Along with other options, you have to give at least one device (I<-a> "
25363 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
25364 "option) or use the I<-i> inspection option. How this works is better "
25365 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
25370 #: ../fuse/guestmount.pod:33
25372 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
25373 "by you, and the filesystem will not be visible to any other users unless you "
25374 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
25375 "the filesystem, use the C<fusermount -u> command."
25379 #: ../fuse/guestmount.pod:41
25381 "For a typical Windows guest which has its main filesystem on the first "
25386 #: ../fuse/guestmount.pod:44
25389 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
25394 #: ../fuse/guestmount.pod:46
25396 "For a typical Linux guest which has a /boot filesystem on the first "
25397 "partition, and the root filesystem on a logical volume:"
25401 #: ../fuse/guestmount.pod:49
25404 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
25409 #: ../fuse/guestmount.pod:51
25410 msgid "To get libguestfs to detect guest mountpoints for you:"
25414 #: ../fuse/guestmount.pod:53
25417 " guestmount -a guest.img -i --ro /mnt\n"
25422 #: ../fuse/guestmount.pod:55
25423 msgid "For a libvirt guest called \"Guest\" you could do:"
25427 #: ../fuse/guestmount.pod:57
25430 " guestmount -d Guest -i --ro /mnt\n"
25435 #: ../fuse/guestmount.pod:59
25437 "If you don't know what filesystems are contained in a guest or disk image, "
25438 "use L<virt-list-filesystems(1)> first:"
25442 #: ../fuse/guestmount.pod:62
25445 " virt-list-filesystems MyGuest\n"
25450 #: ../fuse/guestmount.pod:64
25452 "If you want to trace the libguestfs calls but without excessive debugging "
25453 "information, we recommend:"
25457 #: ../fuse/guestmount.pod:67
25460 " guestmount [...] --trace /mnt\n"
25465 #: ../fuse/guestmount.pod:69
25466 msgid "If you want to debug the program, we recommend:"
25470 #: ../fuse/guestmount.pod:71
25473 " guestmount [...] --trace --verbose /mnt\n"
25478 #: ../fuse/guestmount.pod:79
25479 msgid "Add a block device or virtual machine image."
25483 #: ../fuse/guestmount.pod:96
25484 msgid "B<--dir-cache-timeout N>"
25488 #: ../fuse/guestmount.pod:98
25490 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
25491 "seconds. The readdir cache [actually, there are several semi-independent "
25492 "caches] is populated after a readdir(2) call with the stat and extended "
25493 "attributes of the files in the directory, in anticipation that they will be "
25494 "requested soon after."
25498 #: ../fuse/guestmount.pod:104
25500 "There is also a different attribute cache implemented by FUSE (see the FUSE "
25501 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
25502 "requests, only cache existing ones."
25506 #: ../fuse/guestmount.pod:122
25508 "If you have untrusted raw-format guest disk images, you should use this "
25509 "option to specify the disk format. This avoids a possible security problem "
25510 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
25511 "guestfs_add_drive_opts>."
25515 #: ../fuse/guestmount.pod:127
25516 msgid "B<--fuse-help>"
25520 #: ../fuse/guestmount.pod:129
25521 msgid "Display help on special FUSE options (see I<-o> below)."
25525 #: ../fuse/guestmount.pod:133
25526 msgid "Display brief help and exit."
25530 #: ../fuse/guestmount.pod:146
25531 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
25535 #: ../fuse/guestmount.pod:148
25537 "Mount the named partition or logical volume on the given mountpoint B<in the "
25538 "guest> (this has nothing to do with mountpoints in the host)."
25542 #: ../fuse/guestmount.pod:151
25544 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
25545 "something on C</>."
25549 #: ../fuse/guestmount.pod:156
25551 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
25552 "unmounted. If you specify this option, then we don't attempt to sync the "
25553 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
25557 #: ../fuse/guestmount.pod:161
25558 msgid "B<-o option> | B<--option option>"
25562 #: ../fuse/guestmount.pod:163
25563 msgid "Pass extra options to FUSE."
25567 #: ../fuse/guestmount.pod:165
25569 "To get a list of all the extra options supported by FUSE, use the command "
25570 "below. Note that only the FUSE I<-o> options can be passed, and only some "
25571 "of them are a good idea."
25575 #: ../fuse/guestmount.pod:169
25578 " guestmount --fuse-help\n"
25583 #: ../fuse/guestmount.pod:171
25584 msgid "Some potentially useful FUSE options:"
25588 #: ../fuse/guestmount.pod:175
25589 msgid "B<-o allow_other>"
25593 #: ../fuse/guestmount.pod:177
25594 msgid "Allow other users to see the filesystem."
25598 #: ../fuse/guestmount.pod:179
25599 msgid "B<-o attr_timeout=N>"
25603 #: ../fuse/guestmount.pod:181
25604 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
25608 #: ../fuse/guestmount.pod:183
25609 msgid "B<-o kernel_cache>"
25613 #: ../fuse/guestmount.pod:185
25615 "Allow the kernel to cache files (reduces the number of reads that have to go "
25616 "through the L<guestfs(3)> API). This is generally a good idea if you can "
25617 "afford the extra memory usage."
25621 #: ../fuse/guestmount.pod:189
25622 msgid "B<-o uid=N> B<-o gid=N>"
25626 #: ../fuse/guestmount.pod:191
25628 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
25629 "the chosen values."
25633 #: ../fuse/guestmount.pod:198
25635 "Add devices and mount everything read-only. Also disallow writes and make "
25636 "the disk appear read-only to FUSE."
25640 #: ../fuse/guestmount.pod:201
25642 "This is highly recommended if you are not going to edit the guest disk. If "
25643 "the guest is running and this option is I<not> supplied, then there is a "
25644 "strong risk of disk corruption in the guest. We try to prevent this from "
25645 "happening, but it is not always possible."
25649 #: ../fuse/guestmount.pod:206
25650 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
25654 #: ../fuse/guestmount.pod:210
25655 msgid "Enable SELinux support for the guest."
25659 #: ../fuse/guestmount.pod:214
25660 msgid "Enable verbose messages from underlying libguestfs."
25664 #: ../fuse/guestmount.pod:218
25665 msgid "Display the program version and exit."
25669 #: ../fuse/guestmount.pod:222
25671 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
25672 "FOR READ AND WRITE>."
25676 #: ../fuse/guestmount.pod:225
25677 msgid "B<-x> | B<--trace>"
25681 #: ../fuse/guestmount.pod:227
25682 msgid "Trace libguestfs calls."
25686 #: ../fuse/guestmount.pod:229
25687 msgid "This also stops the daemon from forking into the background."
25691 #: ../fuse/guestmount.pod:235
25693 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
25694 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
25699 #: ../inspector/virt-inspector.pl:35
25701 "virt-inspector - Display operating system version and other information "
25702 "about a virtual machine"
25706 #: ../inspector/virt-inspector.pl:39
25709 " virt-inspector [--connect URI] domname\n"
25714 #: ../inspector/virt-inspector.pl:41
25717 " virt-inspector guest.img [guest.img ...]\n"
25722 #: ../inspector/virt-inspector.pl:45
25724 "B<virt-inspector> examines a virtual machine or disk image and tries to "
25725 "determine the version of the operating system and other information about "
25726 "the virtual machine."
25730 #: ../inspector/virt-inspector.pl:49
25731 msgid "Virt-inspector produces XML output for feeding into other programs."
25735 #: ../inspector/virt-inspector.pl:51
25737 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
25738 "libvirt domain (see: C<virsh list --all>)."
25742 #: ../inspector/virt-inspector.pl:54
25744 "You can also run virt-inspector directly on disk images from a single "
25745 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
25746 "has several block devices, in which case you should list them one after "
25747 "another, with the first corresponding to the guest's C</dev/sda>, the second "
25748 "to the guest's C</dev/sdb> and so on."
25752 #: ../inspector/virt-inspector.pl:60
25754 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
25755 "inspect several virtual machines, you have to run virt-inspector several "
25756 "times (for example, from a shell script for-loop)."
25760 #: ../inspector/virt-inspector.pl:65
25762 "Because virt-inspector needs direct access to guest images, it won't "
25763 "normally work over remote libvirt connections."
25767 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82
25768 #: ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88
25769 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-tar.pl:108
25770 #: ../tools/virt-rescue.pl:113 ../tools/virt-make-fs.pl:163
25771 #: ../tools/virt-list-partitions.pl:61
25772 msgid "Display brief help."
25776 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88
25777 #: ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94
25778 #: ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66
25779 #: ../tools/virt-tar.pl:114 ../tools/virt-rescue.pl:119
25780 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:67
25781 msgid "B<--version>"
25785 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90
25786 #: ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96
25787 #: ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68
25788 #: ../tools/virt-tar.pl:116 ../tools/virt-rescue.pl:121
25789 #: ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:69
25790 msgid "Display version number and exit."
25794 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112
25795 #: ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102
25796 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-tar.pl:122
25797 #: ../tools/virt-rescue.pl:135 ../tools/virt-list-partitions.pl:75
25798 msgid "B<--connect URI> | B<-c URI>"
25802 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114
25803 #: ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104
25804 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-tar.pl:124
25805 #: ../tools/virt-rescue.pl:137 ../tools/virt-list-partitions.pl:77
25807 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
25808 "to the default libvirt hypervisor."
25812 #: ../inspector/virt-inspector.pl:97
25814 "Libvirt is only used if you specify a C<domname> on the command line. If "
25815 "you specify guest block devices directly, then libvirt is not used at all."
25819 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124
25820 #: ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117
25821 #: ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523
25822 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-tar.pl:134
25823 #: ../tools/virt-rescue.pl:147 ../tools/virt-list-partitions.pl:87
25824 msgid "B<--format> raw"
25828 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126
25829 #: ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119
25830 #: ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88
25831 #: ../tools/virt-tar.pl:136 ../tools/virt-rescue.pl:149
25832 #: ../tools/virt-list-partitions.pl:89
25834 "Specify the format of disk images given on the command line. If this is "
25835 "omitted then the format is autodetected from the content of the disk image."
25839 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130
25840 #: ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123
25841 #: ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92
25842 #: ../tools/virt-tar.pl:140 ../tools/virt-rescue.pl:153
25843 #: ../tools/virt-list-partitions.pl:93
25845 "If disk images are requested from libvirt, then this program asks libvirt "
25846 "for this information. In this case, the value of the format parameter is "
25851 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134
25852 #: ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127
25853 #: ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528
25854 #: ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96
25855 #: ../tools/virt-tar.pl:144 ../tools/virt-rescue.pl:157
25856 #: ../tools/virt-list-partitions.pl:97
25858 "If working with untrusted raw-format guest disk images, you should ensure "
25859 "the format is always specified."
25863 #: ../inspector/virt-inspector.pl:149
25868 #: ../inspector/virt-inspector.pl:151
25870 "The virt-inspector XML is described precisely in a RELAX NG schema which is "
25871 "supplied with libguestfs. This section is just an overview."
25875 #: ../inspector/virt-inspector.pl:154
25877 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
25878 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
25879 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
25880 "which is vanishingly rare in real world VMs."
25884 #: ../inspector/virt-inspector.pl:159
25885 msgid "E<lt>operatingsystemE<gt>"
25889 #: ../inspector/virt-inspector.pl:161
25891 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
25892 "describe the operating system, its architecture, the descriptive \"product "
25893 "name\" string, the type of OS and so on, as in this example:"
25897 #: ../inspector/virt-inspector.pl:165
25900 " <operatingsystems>\n"
25901 " <operatingsystem>\n"
25902 " <root>/dev/sda2</root>\n"
25903 " <name>windows</name>\n"
25904 " <arch>i386</arch>\n"
25905 " <distro>windows</distro>\n"
25906 " <product_name>Windows 7 Enterprise</product_name>\n"
25907 " <major_version>6</major_version>\n"
25908 " <minor_version>1</minor_version>\n"
25909 " <windows_systemroot>/Windows</windows_systemroot>\n"
25914 #: ../inspector/virt-inspector.pl:176
25916 "These fields are derived from the libguestfs inspection API, and you can "
25917 "find more details in L<guestfs(3)/INSPECTION>."
25921 #: ../inspector/virt-inspector.pl:179
25923 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
25924 "of view of libguestfs (block devices may have completely different names "
25925 "inside the VM itself)."
25929 #: ../inspector/virt-inspector.pl:240
25930 msgid "E<lt>mountpointsE<gt>"
25934 #: ../inspector/virt-inspector.pl:242
25936 "Un*x-like guests typically have multiple filesystems which are mounted at "
25937 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
25938 "element which looks like this:"
25942 #: ../inspector/virt-inspector.pl:246
25945 " <operatingsystems>\n"
25946 " <operatingsystem>\n"
25949 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
25950 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
25951 " </mountpoints>\n"
25956 #: ../inspector/virt-inspector.pl:254
25958 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
25959 "and may have completely different names inside the guest. Only mountable "
25960 "filesystems appear in this list, not things like swap devices."
25964 #: ../inspector/virt-inspector.pl:276
25965 msgid "E<lt>filesystemsE<gt>"
25969 #: ../inspector/virt-inspector.pl:278
25971 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
25972 "filesystems belonging to the guest, including swap and empty partitions. "
25973 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
25974 "this OS or shared by this OS and other OSes)."
25978 #: ../inspector/virt-inspector.pl:283
25979 msgid "You might see something like this:"
25983 #: ../inspector/virt-inspector.pl:285
25986 " <operatingsystems>\n"
25987 " <operatingsystem>\n"
25990 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
25991 " <type>ext4</type>\n"
25992 " <label>Fedora-13-x86_64</label>\n"
25993 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
25999 #: ../inspector/virt-inspector.pl:295
26001 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
26002 "the label, and the UUID."
26006 #: ../inspector/virt-inspector.pl:337
26007 msgid "E<lt>applicationsE<gt>"
26011 #: ../inspector/virt-inspector.pl:339
26013 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
26014 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
26015 "machine. At the moment we are only able to list RPMs and Debian packages "
26016 "installed, but in future we will support other Linux distros and Windows."
26020 #: ../inspector/virt-inspector.pl:345
26022 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
26023 "Typical values would be C<rpm> and C<deb>."
26027 #: ../inspector/virt-inspector.pl:348
26029 "E<lt>package_managementE<gt>, if present, describes the package manager. "
26030 "Typical values include C<yum>, C<up2date> and C<apt>"
26034 #: ../inspector/virt-inspector.pl:351
26035 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
26039 #: ../inspector/virt-inspector.pl:354
26042 " <operatingsystems>\n"
26043 " <operatingsystem>\n"
26045 " <applications>\n"
26047 " <name>coreutils</name>\n"
26048 " <version>8.5</version>\n"
26049 " <release>1</release>\n"
26050 " </application>\n"
26055 #: ../inspector/virt-inspector.pl:364
26057 "(The version and release fields may not be available for some package types)."
26061 #: ../inspector/virt-inspector.pl:510
26062 msgid "USING XPATH"
26066 #: ../inspector/virt-inspector.pl:512
26068 "You can use the XPath query language, and/or the xpath tool, in order to "
26069 "select parts of the XML."
26073 #: ../inspector/virt-inspector.pl:517
26076 " $ virt-inspector Guest | xpath //filesystems\n"
26077 " Found 1 nodes:\n"
26080 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
26081 " <type>ext4</type>\n"
26087 #: ../inspector/virt-inspector.pl:525
26090 " $ virt-inspector Guest | \\\n"
26091 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
26092 " Query didn't return a nodeset. Value: ext4\n"
26097 #: ../inspector/virt-inspector.pl:529 ../tools/virt-edit.pl:343
26098 #: ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477
26099 #: ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225
26100 #: ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179
26101 #: ../tools/virt-tar.pl:274 ../tools/virt-rescue.pl:260
26102 #: ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:247
26103 msgid "SHELL QUOTING"
26107 #: ../inspector/virt-inspector.pl:531 ../tools/virt-edit.pl:345
26108 #: ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635
26109 #: ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481
26110 #: ../tools/virt-list-filesystems.pl:181 ../tools/virt-tar.pl:276
26111 #: ../tools/virt-rescue.pl:262 ../tools/virt-make-fs.pl:529
26112 #: ../tools/virt-list-partitions.pl:249
26114 "Libvirt guest names can contain arbitrary characters, some of which have "
26115 "meaning to the shell such as C<#> and space. You may need to quote or "
26116 "escape these characters on the command line. See the shell manual page L<sh"
26117 "(1)> for details."
26121 #: ../inspector/virt-inspector.pl:538
26123 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
26124 "L<Sys::Virt(3)>, L<http://www.w3.org/TR/xpath/>, L<http://libguestfs.org/>."
26128 #: ../inspector/virt-inspector.pl:552 ../tools/virt-edit.pl:364
26129 #: ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651
26130 #: ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510
26131 #: ../tools/virt-list-filesystems.pl:200 ../tools/virt-tar.pl:294
26132 #: ../tools/virt-rescue.pl:279 ../tools/virt-make-fs.pl:561
26133 #: ../tools/virt-list-partitions.pl:267
26134 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26138 #: ../inspector/virt-inspector.pl:556
26139 msgid "Matthew Booth L<mbooth@redhat.com>"
26143 #: ../inspector/virt-inspector.pl:562 ../tools/virt-win-reg.pl:516
26144 #: ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
26145 msgid "Copyright (C) 2010 Red Hat Inc."
26149 #: ../tools/virt-edit.pl:34
26150 msgid "virt-edit - Edit a file in a virtual machine"
26154 #: ../tools/virt-edit.pl:38
26157 " virt-edit [--options] domname file\n"
26162 #: ../tools/virt-edit.pl:40
26165 " virt-edit [--options] disk.img [disk.img ...] file\n"
26170 #: ../tools/virt-edit.pl:42
26173 " virt-edit [domname|disk.img] file -e 'expr'\n"
26178 #: ../tools/virt-edit.pl:46
26180 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26181 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26182 "doing this, but doesn't catch all cases."
26186 #: ../tools/virt-edit.pl:52
26188 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26189 "the named virtual machine (or disk image)."
26193 #: ../tools/virt-edit.pl:55
26195 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26196 "you should look at the L<guestfish(1)> tool."
26200 #: ../tools/virt-edit.pl:60
26201 msgid "Edit the named files interactively:"
26205 #: ../tools/virt-edit.pl:62
26208 " virt-edit mydomain /boot/grub/grub.conf\n"
26213 #: ../tools/virt-edit.pl:64
26216 " virt-edit mydomain /etc/passwd\n"
26221 #: ../tools/virt-edit.pl:66
26223 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26224 "below). To change the init default level to 5:"
26228 #: ../tools/virt-edit.pl:70
26231 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26236 #: ../tools/virt-edit.pl:96
26237 msgid "B<--backup extension> | B<-b extension>"
26241 #: ../tools/virt-edit.pl:98
26243 "Create a backup of the original file I<in the guest disk image>. The backup "
26244 "has the original filename with C<extension> added."
26248 #: ../tools/virt-edit.pl:101
26250 "Usually the first character of C<extension> would be a dot C<.> so you would "
26255 #: ../tools/virt-edit.pl:104
26258 " virt-edit -b .orig [etc]\n"
26263 #: ../tools/virt-edit.pl:106
26264 msgid "By default, no backup file is made."
26268 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
26269 #: ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107
26270 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:127
26271 #: ../tools/virt-rescue.pl:140 ../tools/virt-list-partitions.pl:80
26273 "If you specify guest block devices directly, then libvirt is not used at all."
26277 #: ../tools/virt-edit.pl:141
26278 msgid "B<--expr EXPR> | B<-e EXPR>"
26282 #: ../tools/virt-edit.pl:143
26284 "Instead of launching the external editor, non-interactively apply the Perl "
26285 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26290 #: ../tools/virt-edit.pl:147
26292 "Be careful to properly quote the expression to prevent it from being altered "
26297 #: ../tools/virt-edit.pl:268
26298 msgid "NON-INTERACTIVE EDITING"
26302 #: ../tools/virt-edit.pl:270
26304 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26305 "administrator can interactively edit the file."
26309 #: ../tools/virt-edit.pl:273
26311 "There are two ways also to use C<virt-edit> from scripts in order to make "
26312 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26313 "like this, it's less error-prone to write scripts directly using the "
26314 "libguestfs API and Augeas for configuration file editing.)"
26318 #: ../tools/virt-edit.pl:279
26320 "The first method is to temporarily set C<$EDITOR> to any script or program "
26321 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26322 "update C<tmpfile> in place however it likes."
26326 #: ../tools/virt-edit.pl:283
26328 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26329 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26330 "instances of C<foo> with C<bar> in a file:"
26334 #: ../tools/virt-edit.pl:287
26337 " virt-edit domname filename -e 's/foo/bar/'\n"
26342 #: ../tools/virt-edit.pl:289
26344 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26345 "For example to delete root's password you could do:"
26349 #: ../tools/virt-edit.pl:292
26352 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26357 #: ../tools/virt-edit.pl:294
26359 "What really happens is that the snippet is evaluated as a Perl expression "
26360 "for each line of the file. The line, including the final C<\\n>, is passed "
26361 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26365 #: ../tools/virt-edit.pl:299
26367 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26368 "C<apache> user account from the password file you can do:"
26372 #: ../tools/virt-edit.pl:302
26375 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26380 #: ../tools/virt-edit.pl:304
26382 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26383 "the end of the file is rather difficult this way since there is no concept "
26384 "of \"last line of the file\" - your expression just doesn't get called "
26385 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26390 #: ../tools/virt-edit.pl:310
26392 "The variable C<$lineno> contains the current line number. As is "
26393 "traditional, the first line in the file is number C<1>."
26397 #: ../tools/virt-edit.pl:313
26399 "The return value from the expression is ignored, but the expression may call "
26400 "C<die> in order to abort the whole program, leaving the original file "
26405 #: ../tools/virt-edit.pl:317
26407 "Remember when matching the end of a line that C<$_> may contain the final C<"
26408 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26409 "newline then neither of these. Thus to match or substitute some text at the "
26410 "end of a line, use this regular expression:"
26414 #: ../tools/virt-edit.pl:322
26417 " /some text(\\r?\\n)?$/\n"
26422 #: ../tools/virt-edit.pl:324
26424 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26425 "$_> itself (since that would remove all newlines from the file):"
26429 #: ../tools/virt-edit.pl:328
26432 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26437 #: ../tools/virt-edit.pl:334
26442 #: ../tools/virt-edit.pl:336
26444 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26449 #: ../tools/virt-edit.pl:339
26450 msgid "If not set, C<vi> is used."
26454 #: ../tools/virt-edit.pl:352
26456 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26457 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
26462 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
26463 #: ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243
26464 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198
26465 #: ../tools/virt-tar.pl:292 ../tools/virt-rescue.pl:277
26466 #: ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:265
26471 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655
26472 #: ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
26473 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26477 #: ../tools/virt-win-reg.pl:37
26479 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26483 #: ../tools/virt-win-reg.pl:41
26486 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26491 #: ../tools/virt-win-reg.pl:43
26494 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26499 #: ../tools/virt-win-reg.pl:45
26502 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26507 #: ../tools/virt-win-reg.pl:47
26510 " virt-win-reg --merge domname [input.reg ...]\n"
26515 #: ../tools/virt-win-reg.pl:49
26518 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26523 #: ../tools/virt-win-reg.pl:53
26525 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26526 "virtual machines. If you do this, you I<will> get irreversible disk "
26527 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26528 "but doesn't catch all cases."
26532 #: ../tools/virt-win-reg.pl:58
26534 "Modifying the Windows Registry is an inherently risky operation. The format "
26535 "is deliberately obscure and undocumented, and Registry changes can leave the "
26536 "system unbootable. Therefore when using the C<--merge> option, make sure "
26537 "you have a reliable backup first."
26541 #: ../tools/virt-win-reg.pl:65
26543 "This program can export and merge Windows Registry entries from a Windows "
26548 #: ../tools/virt-win-reg.pl:68
26550 "The first parameter is the libvirt guest name or the raw disk image of a "
26555 #: ../tools/virt-win-reg.pl:71
26557 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26558 "exported (recursively). For example:"
26562 #: ../tools/virt-win-reg.pl:74
26565 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26570 #: ../tools/virt-win-reg.pl:76
26572 "You can also display single values from within registry keys, for example:"
26576 #: ../tools/virt-win-reg.pl:79
26579 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26580 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26581 " Windows 7 Enterprise\n"
26586 #: ../tools/virt-win-reg.pl:83
26588 "With C<--merge>, you can merge a textual regedit file into the Windows "
26593 #: ../tools/virt-win-reg.pl:86
26596 " $ virt-win-reg --merge Windows7 changes.reg\n"
26601 #: ../tools/virt-win-reg.pl:88
26602 msgid "SUPPORTED SYSTEMS"
26606 #: ../tools/virt-win-reg.pl:90
26608 "The program currently supports Windows NT-derived guests starting with "
26609 "Windows XP through to at least Windows 7."
26613 #: ../tools/virt-win-reg.pl:93
26615 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26616 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26617 "and C<HKEY_USERS\\.DEFAULT>."
26621 #: ../tools/virt-win-reg.pl:97
26623 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26628 #: ../tools/virt-win-reg.pl:100
26630 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26635 #: ../tools/virt-win-reg.pl:103
26640 #: ../tools/virt-win-reg.pl:105
26642 "This program is only meant for simple access to the registry. If you want "
26643 "to do complicated things with the registry, we suggest you download the "
26644 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26645 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26646 "L<hivexregedit(1)>."
26650 #: ../tools/virt-win-reg.pl:111
26655 #: ../tools/virt-win-reg.pl:113
26657 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26658 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26659 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26660 "Windows-style line endings, you may need to reencode the whole file before "
26661 "or after processing."
26665 #: ../tools/virt-win-reg.pl:119
26667 "To reencode a file from Windows format to Linux (before processing it with "
26668 "the C<--merge> option), you would do something like this:"
26672 #: ../tools/virt-win-reg.pl:122
26675 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26680 #: ../tools/virt-win-reg.pl:124
26682 "To go in the opposite direction, after exporting and before sending the file "
26683 "to a Windows user, do something like this:"
26687 #: ../tools/virt-win-reg.pl:127
26690 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26695 #: ../tools/virt-win-reg.pl:129
26696 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26700 #: ../tools/virt-win-reg.pl:131
26702 "If you are unsure about the current encoding, use the L<file(1)> command. "
26703 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26704 "style (CRLF) line endings, like this:"
26708 #: ../tools/virt-win-reg.pl:135
26711 " $ file software.reg\n"
26712 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26713 " with CRLF line terminators\n"
26718 #: ../tools/virt-win-reg.pl:139
26719 msgid "This file would need conversion before you could C<--merge> it."
26723 #: ../tools/virt-win-reg.pl:143
26725 "Be careful when passing parameters containing C<\\> (backslash) in the "
26726 "shell. Usually you will have to use 'single quotes' or double backslashes "
26727 "(but not both) to protect them from the shell."
26731 #: ../tools/virt-win-reg.pl:147
26732 msgid "Paths and value names are case-insensitive."
26736 #: ../tools/virt-win-reg.pl:149
26737 msgid "CurrentControlSet etc."
26741 #: ../tools/virt-win-reg.pl:151
26743 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26744 "Registry at the level of the hive file, and therefore you cannot modify "
26749 #: ../tools/virt-win-reg.pl:155
26751 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26752 "circumstances it might refer to another control set. The way to find out is "
26753 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26757 #: ../tools/virt-win-reg.pl:159
26760 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26761 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26762 " \"Current\"=dword:00000001\n"
26763 " \"Default\"=dword:00000001\n"
26764 " \"Failed\"=dword:00000000\n"
26765 " \"LastKnownGood\"=dword:00000002\n"
26770 #: ../tools/virt-win-reg.pl:166
26771 msgid "\"Current\" is the one which Windows will choose when it boots."
26775 #: ../tools/virt-win-reg.pl:168
26777 "Similarly, other C<Current...> keys in the path may need to be replaced."
26781 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
26786 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
26787 msgid "Enable debugging messages."
26791 #: ../tools/virt-win-reg.pl:232
26796 #: ../tools/virt-win-reg.pl:234
26798 "In merge mode, this merges a textual regedit file into the Windows Registry "
26799 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26800 "displays or exports Registry entries instead."
26804 #: ../tools/virt-win-reg.pl:238
26806 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26807 "result in disk corruption. However exporting (without this flag) is always "
26812 #: ../tools/virt-win-reg.pl:246
26813 msgid "B<--encoding> UTF-16LE|ASCII"
26817 #: ../tools/virt-win-reg.pl:248
26819 "When merging (only), you may need to specify the encoding for strings to be "
26820 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26821 "(3)/ENCODING STRINGS>."
26825 #: ../tools/virt-win-reg.pl:252
26827 "The default is to use UTF-16LE, which should work with recent versions of "
26832 #: ../tools/virt-win-reg.pl:486
26834 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26835 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26836 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26840 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
26842 "When reporting bugs, please enable debugging and capture the I<complete> "
26847 #: ../tools/virt-win-reg.pl:504
26850 " export LIBGUESTFS_DEBUG=1\n"
26851 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26856 #: ../tools/virt-win-reg.pl:507
26858 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
26863 #: ../tools/virt-df.pl:36
26864 msgid "virt-df - Display free space on virtual filesystems"
26868 #: ../tools/virt-df.pl:40
26871 " virt-df [--options]\n"
26876 #: ../tools/virt-df.pl:42
26879 " virt-df [--options] domname\n"
26884 #: ../tools/virt-df.pl:44
26887 " virt-df [--options] disk.img [disk.img ...]\n"
26892 #: ../tools/virt-df.pl:48
26894 "C<virt-df> is a command line tool to display free space on virtual machine "
26895 "filesystems. Unlike other tools, it doesn't just display the amount of "
26896 "space allocated to a virtual machine, but can look inside the virtual "
26897 "machine to see how much space is really being used."
26901 #: ../tools/virt-df.pl:53
26903 "It is like the L<df(1)> command, but for virtual machines, except that it "
26904 "also works for Windows virtual machines."
26908 #: ../tools/virt-df.pl:56
26910 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
26911 "of all active and inactive guests, and performs a C<df>-type operation on "
26912 "each one in turn, printing out the results."
26916 #: ../tools/virt-df.pl:60
26918 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
26919 "either the single named libvirt domain, or on the disk image(s) listed on "
26920 "the command line (which must all belong to a single VM). In this mode (with "
26921 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
26922 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
26926 #: ../tools/virt-df.pl:67
26928 "Use the C<--csv> option to get a format which can be easily parsed by other "
26929 "programs. Other options are mostly similar to standard C<df> options. See "
26930 "below for the complete list."
26934 #: ../tools/virt-df.pl:107
26939 #: ../tools/virt-df.pl:109
26941 "Write out the results in CSV format (comma-separated values). This format "
26942 "can be imported easily into databases and spreadsheets, but read L</NOTE "
26943 "ABOUT CSV FORMAT> below."
26947 #: ../tools/virt-df.pl:134
26948 msgid "B<--human-readable> | B<-h>"
26952 #: ../tools/virt-df.pl:136
26953 msgid "Print sizes in human-readable format."
26957 #: ../tools/virt-df.pl:138
26958 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
26962 #: ../tools/virt-df.pl:144
26963 msgid "B<--inodes> | B<-i>"
26967 #: ../tools/virt-df.pl:146
26968 msgid "Print inodes instead of blocks."
26972 #: ../tools/virt-df.pl:152
26973 msgid "B<--one-per-guest>"
26977 #: ../tools/virt-df.pl:154
26979 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
26980 "disks from several guests to a single libguestfs appliance."
26984 #: ../tools/virt-df.pl:157
26985 msgid "You might use this option in the following circumstances:"
26989 #: ../tools/virt-df.pl:163
26991 "If you think an untrusted guest might actively try to exploit the libguestfs "
26992 "appliance kernel, then this prevents one guest from interfering with the "
26993 "stats printed for another guest."
26997 #: ../tools/virt-df.pl:169
26999 "If the kernel has a bug which stops it from accessing a filesystem in one "
27000 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
27001 "and report stats for further guests."
27005 #: ../tools/virt-df.pl:180
27010 #: ../tools/virt-df.pl:182
27012 "Print UUIDs instead of names. This is useful for following a guest even "
27013 "when the guest is migrated or renamed, or when two guests happen to have the "
27018 #: ../tools/virt-df.pl:186
27020 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
27021 "images, we still print the disk image name even when this option is "
27026 #: ../tools/virt-df.pl:609
27027 msgid "NOTE ABOUT CSV FORMAT"
27031 #: ../tools/virt-df.pl:611
27033 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
27034 "should be easy to parse, but it is definitely not easy to parse."
27038 #: ../tools/virt-df.pl:614
27040 "Myth: Just split fields at commas. Reality: This does I<not> work "
27041 "reliably. This example has two columns:"
27045 #: ../tools/virt-df.pl:617
27048 " \"foo,bar\",baz\n"
27053 #: ../tools/virt-df.pl:619
27055 "Myth: Read the file one line at a time. Reality: This does I<not> work "
27056 "reliably. This example has one row:"
27060 #: ../tools/virt-df.pl:622
27069 #: ../tools/virt-df.pl:625
27071 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
27072 "packaged in major Linux distributions)."
27076 #: ../tools/virt-df.pl:628
27078 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
27079 "or Python's built-in csv library)."
27083 #: ../tools/virt-df.pl:631
27084 msgid "Most spreadsheets and databases can import CSV directly."
27088 #: ../tools/virt-df.pl:642
27090 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27091 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27095 #: ../tools/virt-ls.pl:34
27096 msgid "virt-ls - List files in a virtual machine"
27100 #: ../tools/virt-ls.pl:38
27103 " virt-ls [--options] domname directory\n"
27108 #: ../tools/virt-ls.pl:40
27111 " virt-ls [--options] disk.img [disk.img ...] directory\n"
27116 #: ../tools/virt-ls.pl:44
27118 "C<virt-ls> is a command line tool to list the names of files in a directory "
27119 "inside a virtual machine or disk image."
27123 #: ../tools/virt-ls.pl:47
27125 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
27126 "For more complex cases you should look at the L<guestfish(1)> tool."
27130 #: ../tools/virt-ls.pl:51
27132 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
27133 "simple listing is like the ordinary L<ls(1)> command:"
27137 #: ../tools/virt-ls.pl:54
27140 " $ virt-ls myguest /\n"
27148 #: ../tools/virt-ls.pl:59
27149 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
27153 #: ../tools/virt-ls.pl:61
27156 " $ virt-ls -l myguest /\n"
27158 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
27159 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
27165 #: ../tools/virt-ls.pl:67
27167 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
27168 "and directories recursively:"
27172 #: ../tools/virt-ls.pl:70
27175 " $ virt-ls -R myguest /tmp\n"
27183 #: ../tools/virt-ls.pl:75
27185 "You I<cannot> combine these options. To do more complicated things, use "
27190 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103
27191 #: ../tools/virt-list-partitions.pl:112
27192 msgid "B<-l> | B<--long>"
27196 #: ../tools/virt-ls.pl:133
27197 msgid "B<-R> | B<--recursive>"
27201 #: ../tools/virt-ls.pl:135
27203 "Select the mode. With neither of these options, C<virt-ls> produces a "
27204 "simple, flat list of the files in the named directory."
27208 #: ../tools/virt-ls.pl:138
27210 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
27211 "like the plain C<ls -l> command)."
27215 #: ../tools/virt-ls.pl:141
27217 "C<virt-ls -R> produces a recursive list of files starting at the named "
27218 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
27223 #: ../tools/virt-ls.pl:145
27224 msgid "You cannot combine these options."
27228 #: ../tools/virt-ls.pl:234
27230 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
27231 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
27236 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204
27237 #: ../tools/virt-tar.pl:298
27238 msgid "Copyright (C) 2009 Red Hat Inc."
27242 #: ../tools/virt-resize.pl:42
27243 msgid "virt-resize - Resize a virtual machine disk"
27247 #: ../tools/virt-resize.pl:46
27250 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27251 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27252 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27257 #: ../tools/virt-resize.pl:52
27259 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27260 "larger or smaller overall, and resizing or deleting any partitions contained "
27265 #: ../tools/virt-resize.pl:56
27267 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27268 "not> be used on live virtual machines - for consistent results, shut the "
27269 "virtual machine down before resizing it."
27273 #: ../tools/virt-resize.pl:60
27275 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
27276 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
27277 "read those manual pages first."
27281 #: ../tools/virt-resize.pl:68
27283 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27284 "fill the extra 5GB of space."
27288 #: ../tools/virt-resize.pl:71
27291 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27292 " virt-list-partitions -lht olddisk\n"
27293 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27294 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27299 #: ../tools/virt-resize.pl:76
27301 "As above, but make the /boot partition 200MB bigger, while giving the "
27302 "remaining space to /dev/sda2:"
27306 #: ../tools/virt-resize.pl:79
27309 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27314 #: ../tools/virt-resize.pl:81
27315 msgid "As above, but the output format will be uncompressed qcow2:"
27319 #: ../tools/virt-resize.pl:83
27322 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27323 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27328 #: ../tools/virt-resize.pl:86
27329 msgid "DETAILED USAGE"
27333 #: ../tools/virt-resize.pl:88
27334 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27338 #: ../tools/virt-resize.pl:92
27339 msgid "1. Shut down the virtual machine"
27343 #: ../tools/virt-resize.pl:94
27344 msgid "2. Locate input disk image"
27348 #: ../tools/virt-resize.pl:96
27350 "Locate the input disk image (ie. the file or device on the host containing "
27351 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27352 "dumpxml> like this to find the disk image name:"
27356 #: ../tools/virt-resize.pl:100
27359 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27360 " Found 1 nodes:\n"
27362 " <source dev=\"/dev/vg/lv_guest\" />\n"
27367 #: ../tools/virt-resize.pl:105
27368 msgid "3. Look at current sizing"
27372 #: ../tools/virt-resize.pl:107
27374 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
27378 #: ../tools/virt-resize.pl:110
27381 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
27382 " /dev/sda1 ext3 101.9M\n"
27383 " /dev/sda2 pv 7.9G\n"
27384 " /dev/sda device 8.0G\n"
27389 #: ../tools/virt-resize.pl:115
27391 "(This example is a virtual machine with an 8 GB disk which we would like to "
27392 "expand up to 10 GB)."
27396 #: ../tools/virt-resize.pl:118
27397 msgid "4. Create output disk"
27401 #: ../tools/virt-resize.pl:120
27403 "Virt-resize cannot do in-place disk modifications. You have to have space "
27404 "to store the resized output disk."
27408 #: ../tools/virt-resize.pl:123
27410 "To store the resized disk image in a file, create a file of a suitable size:"
27414 #: ../tools/virt-resize.pl:126
27417 " # rm -f outdisk\n"
27418 " # truncate -s 10G outdisk\n"
27423 #: ../tools/virt-resize.pl:129
27424 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27428 #: ../tools/virt-resize.pl:131
27431 " # lvcreate -L 10G -n lv_name vg_name\n"
27436 #: ../tools/virt-resize.pl:133
27437 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27441 #: ../tools/virt-resize.pl:135
27444 " # virsh pool-list\n"
27445 " # virsh vol-create-as poolname newvol 10G\n"
27450 #: ../tools/virt-resize.pl:138
27455 #: ../tools/virt-resize.pl:140
27457 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27458 "file) and the output disk. The output disk is the one created in the "
27463 #: ../tools/virt-resize.pl:144
27466 " # virt-resize indisk outdisk\n"
27471 #: ../tools/virt-resize.pl:146
27473 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27474 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27475 "larger, then an extra, empty partition is created at the end of the disk "
27476 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27481 #: ../tools/virt-resize.pl:152
27483 "More realistically you'd want to expand existing partitions in the disk "
27484 "image by passing extra options (for the full list see the L</OPTIONS> "
27489 #: ../tools/virt-resize.pl:156
27491 "L</--expand> is the most useful option. It expands the named partition "
27492 "within the disk to fill any extra space:"
27496 #: ../tools/virt-resize.pl:159
27499 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27504 #: ../tools/virt-resize.pl:161
27506 "(In this case, an extra partition is I<not> created at the end of the disk, "
27507 "because there will be no unused space)."
27511 #: ../tools/virt-resize.pl:164
27513 "L</--resize> is the other commonly used option. The following would "
27514 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27515 "rest of the available space:"
27519 #: ../tools/virt-resize.pl:168
27522 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27523 " indisk outdisk\n"
27528 #: ../tools/virt-resize.pl:171
27530 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27531 "if virt-resize knows how, it will resize the contents, the equivalent of "
27532 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27533 ">. However virt-resize does not know how to resize some filesystems, so you "
27534 "would have to online resize them after booting the guest. And virt-resize "
27535 "also does not resize anything inside an LVM PV, it just resizes the PV "
27536 "itself and leaves the user to resize any LVs inside that PV as desired."
27540 #: ../tools/virt-resize.pl:180
27541 msgid "Other options are covered below."
27545 #: ../tools/virt-resize.pl:182
27550 #: ../tools/virt-resize.pl:184
27551 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27555 #: ../tools/virt-resize.pl:186
27556 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27560 #: ../tools/virt-resize.pl:188
27563 " # virsh edit guestname\n"
27568 #: ../tools/virt-resize.pl:190
27570 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27571 "html#elementsDisks>"
27575 #: ../tools/virt-resize.pl:193
27576 msgid "Then start up the domain with the new, resized disk:"
27580 #: ../tools/virt-resize.pl:195
27583 " # virsh start guestname\n"
27588 #: ../tools/virt-resize.pl:197
27590 "and check that it still works. See also the L</NOTES> section below for "
27591 "additional information."
27595 #: ../tools/virt-resize.pl:200
27596 msgid "7. Resize LVs etc inside the guest"
27600 #: ../tools/virt-resize.pl:202
27601 msgid "(This can also be done offline using L<guestfish(1)>)"
27605 #: ../tools/virt-resize.pl:204
27607 "Once the guest has booted you should see the new space available, at least "
27608 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27609 "may need to resize LVs inside PVs, and also resize filesystem types that "
27610 "virt-resize does not know how to expand."
27614 #: ../tools/virt-resize.pl:211
27615 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27619 #: ../tools/virt-resize.pl:213
27621 "Shrinking is somewhat more complex than expanding, and only an overview is "
27626 #: ../tools/virt-resize.pl:216
27628 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27629 "filesystems). The user has to shrink content before passing the disk image "
27630 "to virt-resize, and virt-resize will check that the content has been shrunk "
27635 #: ../tools/virt-resize.pl:221
27636 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27640 #: ../tools/virt-resize.pl:223
27642 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27643 "steps 3 and 4 above to allocate a new disk image."
27647 #: ../tools/virt-resize.pl:226
27649 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
27653 #: ../tools/virt-resize.pl:229
27654 msgid "IGNORING OR DELETING PARTITIONS"
27658 #: ../tools/virt-resize.pl:231
27660 "virt-resize also gives a convenient way to ignore or delete partitions when "
27661 "copying from the input disk to the output disk. Ignoring a partition speeds "
27662 "up the copy where you don't care about the existing contents of a "
27663 "partition. Deleting a partition removes it completely, but note that it "
27664 "also renumbers any partitions after the one which is deleted, which can "
27665 "leave some guests unbootable."
27669 #: ../tools/virt-resize.pl:238
27670 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
27674 #: ../tools/virt-resize.pl:240
27676 "If the input disk is in qcow2 format, then you may prefer that the output is "
27677 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
27678 "the fly. The output format is simply determined by the format of the empty "
27679 "output container that you provide. Thus to create qcow2 output, use:"
27683 #: ../tools/virt-resize.pl:246
27686 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
27691 #: ../tools/virt-resize.pl:248
27692 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
27696 #: ../tools/virt-resize.pl:250
27697 msgid "Similarly, to get non-sparse raw output use:"
27701 #: ../tools/virt-resize.pl:252
27704 " fallocate -l size outdisk\n"
27709 #: ../tools/virt-resize.pl:254
27711 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
27712 "dev/zero of=outdisk bs=1M count=..>)"
27716 #: ../tools/virt-resize.pl:267
27717 msgid "Display help."
27721 #: ../tools/virt-resize.pl:281
27722 msgid "B<--resize part=size>"
27726 #: ../tools/virt-resize.pl:283
27728 "Resize the named partition (expanding or shrinking it) so that it has the "
27733 #: ../tools/virt-resize.pl:286
27735 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
27736 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
27737 "Exabytes; or as a percentage of the current size; or as a relative number or "
27738 "percentage. For example:"
27742 #: ../tools/virt-resize.pl:291
27745 " --resize /dev/sda2=10G\n"
27750 #: ../tools/virt-resize.pl:293
27753 " --resize /dev/sda4=90%\n"
27758 #: ../tools/virt-resize.pl:295
27761 " --resize /dev/sda2=+1G\n"
27766 #: ../tools/virt-resize.pl:297
27769 " --resize /dev/sda2=-200M\n"
27774 #: ../tools/virt-resize.pl:299
27777 " --resize /dev/sda1=+128K\n"
27782 #: ../tools/virt-resize.pl:301
27785 " --resize /dev/sda1=+10%\n"
27790 #: ../tools/virt-resize.pl:303
27793 " --resize /dev/sda1=-10%\n"
27798 #: ../tools/virt-resize.pl:305
27800 "You can increase the size of any partition. Virt-resize will expand the "
27801 "direct content of the partition if it knows how (see C<--expand> below)."
27805 #: ../tools/virt-resize.pl:309
27807 "You can only I<decrease> the size of partitions that contain filesystems or "
27808 "PVs which have already been shrunk. Virt-resize will check this has been "
27809 "done before proceeding, or else will print an error (see also C<--resize-"
27814 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406
27815 #: ../tools/virt-resize.pl:423
27816 msgid "You can give this option multiple times."
27820 #: ../tools/virt-resize.pl:320
27821 msgid "B<--resize-force part=size>"
27825 #: ../tools/virt-resize.pl:322
27827 "This is the same as C<--resize> except that it will let you decrease the "
27828 "size of any partition. Generally this means you will lose any data which "
27829 "was at the end of the partition you shrink, but you may not care about that "
27830 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
27831 "as a swap partition)."
27835 #: ../tools/virt-resize.pl:328
27836 msgid "See also the C<--ignore> option."
27840 #: ../tools/virt-resize.pl:334
27841 msgid "B<--expand part>"
27845 #: ../tools/virt-resize.pl:336
27847 "Expand the named partition so it uses up all extra space (space left over "
27848 "after any other resize changes that you request have been done)."
27852 #: ../tools/virt-resize.pl:339
27854 "If virt-resize knows how, it will expand the direct content of the "
27855 "partition. For example, if the partition is an LVM PV, it will expand the "
27856 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
27857 "content it doesn't know about alone."
27861 #: ../tools/virt-resize.pl:344
27862 msgid "Currently virt-resize can resize:"
27866 #: ../tools/virt-resize.pl:350
27868 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
27873 #: ../tools/virt-resize.pl:355
27875 "NTFS filesystems contained directly in a partition, if libguestfs was "
27876 "compiled with support for NTFS."
27880 #: ../tools/virt-resize.pl:358
27882 "The filesystem must have been shut down consistently last time it was used. "
27883 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
27884 "consistency check, so at the first boot after resizing Windows will check "
27889 #: ../tools/virt-resize.pl:365
27891 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
27892 "inside the PV. The user will have to resize LVs as desired."
27896 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
27897 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
27901 #: ../tools/virt-resize.pl:377
27902 msgid "B<--shrink part>"
27906 #: ../tools/virt-resize.pl:379
27908 "Shrink the named partition until the overall disk image fits in the "
27909 "destination. The named partition B<must> contain a filesystem or PV which "
27910 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
27911 "online tools). Virt-resize will check this and give an error if it has not "
27916 #: ../tools/virt-resize.pl:385
27918 "The amount by which the overall disk must be shrunk (after carrying out all "
27919 "other operations requested by the user) is called the \"deficit\". For "
27920 "example, a straight copy (assume no other operations) from a 5GB disk image "
27921 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
27922 "would give an error unless the user specified a partition to shrink and that "
27923 "partition had more than a gigabyte of free space."
27927 #: ../tools/virt-resize.pl:399
27928 msgid "B<--ignore part>"
27932 #: ../tools/virt-resize.pl:401
27934 "Ignore the named partition. Effectively this means the partition is "
27935 "allocated on the destination disk, but the content is not copied across from "
27936 "the source disk. The content of the partition will be blank (all zero "
27941 #: ../tools/virt-resize.pl:412
27942 msgid "B<--delete part>"
27946 #: ../tools/virt-resize.pl:414
27948 "Delete the named partition. It would be more accurate to describe this as "
27949 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
27950 "the original disk image is left intact."
27954 #: ../tools/virt-resize.pl:418
27956 "Note that when you delete a partition, then anything contained in the "
27957 "partition is also deleted. Furthermore, this causes any partitions that "
27958 "come after to be I<renumbered>, which can easily make your guest unbootable."
27962 #: ../tools/virt-resize.pl:429
27963 msgid "B<--LV-expand logvol>"
27967 #: ../tools/virt-resize.pl:431
27969 "This takes the logical volume and, as a final step, expands it to fill all "
27970 "the space available in its volume group. A typical usage, assuming a Linux "
27971 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
27972 "lv_root> would be:"
27976 #: ../tools/virt-resize.pl:436
27979 " virt-resize indisk outdisk \\\n"
27980 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
27985 #: ../tools/virt-resize.pl:439
27987 "This would first expand the partition (and PV), and then expand the root "
27988 "device to fill the extra space in the PV."
27992 #: ../tools/virt-resize.pl:442
27994 "The contents of the LV are also resized if virt-resize knows how to do "
27995 "that. You can stop virt-resize from trying to expand the content by using "
27996 "the option C<--no-expand-content>."
28000 #: ../tools/virt-resize.pl:446
28001 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
28005 #: ../tools/virt-resize.pl:449
28007 "You can give this option multiple times, I<but> it doesn't make sense to do "
28008 "this unless the logical volumes you specify are all in different volume "
28013 #: ../tools/virt-resize.pl:457
28014 msgid "B<--no-copy-boot-loader>"
28018 #: ../tools/virt-resize.pl:459
28020 "By default, virt-resize copies over some sectors at the start of the disk "
28021 "(up to the beginning of the first partition). Commonly these sectors "
28022 "contain the Master Boot Record (MBR) and the boot loader, and are required "
28023 "in order for the guest to boot correctly."
28027 #: ../tools/virt-resize.pl:464
28029 "If you specify this flag, then this initial copy is not done. You may need "
28030 "to reinstall the boot loader in this case."
28034 #: ../tools/virt-resize.pl:472
28035 msgid "B<--no-extra-partition>"
28039 #: ../tools/virt-resize.pl:474
28041 "By default, virt-resize creates an extra partition if there is any extra, "
28042 "unused space after all resizing has happened. Use this option to prevent "
28043 "the extra partition from being created. If you do this then the extra space "
28044 "will be inaccessible until you run fdisk, parted, or some other partitioning "
28045 "tool in the guest."
28049 #: ../tools/virt-resize.pl:480
28051 "Note that if the surplus space is smaller than 10 MB, no extra partition "
28056 #: ../tools/virt-resize.pl:487
28057 msgid "B<--no-expand-content>"
28061 #: ../tools/virt-resize.pl:489
28063 "By default, virt-resize will try to expand the direct contents of "
28064 "partitions, if it knows how (see C<--expand> option above)."
28068 #: ../tools/virt-resize.pl:492
28070 "If you give the C<--no-expand-content> option then virt-resize will not "
28075 #: ../tools/virt-resize.pl:499
28076 msgid "B<-d> | B<--debug>"
28080 #: ../tools/virt-resize.pl:507
28081 msgid "B<-n> | B<--dryrun>"
28085 #: ../tools/virt-resize.pl:509
28086 msgid "Print a summary of what would be done, but don't do anything."
28090 #: ../tools/virt-resize.pl:515
28091 msgid "B<-q> | B<--quiet>"
28095 #: ../tools/virt-resize.pl:517
28096 msgid "Don't print the summary."
28100 #: ../tools/virt-resize.pl:525
28102 "Specify the format of the input disk image. If this flag is not given then "
28103 "it is auto-detected from the image itself."
28107 #: ../tools/virt-resize.pl:531
28109 "Note that this option I<does not> affect the output format. See L</QCOW2 "
28110 "AND NON-SPARSE RAW FORMATS>."
28114 #: ../tools/virt-resize.pl:538
28115 msgid "B<--output-format> raw"
28119 #: ../tools/virt-resize.pl:540
28121 "Specify the format of the output disk image. If this flag is not given then "
28122 "it is auto-detected from the image itself."
28126 #: ../tools/virt-resize.pl:546
28128 "Note that you still need to create the output disk with the right format. "
28129 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
28133 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
28138 #: ../tools/virt-resize.pl:1424
28139 msgid "\"Partition 1 does not end on cylinder boundary.\""
28143 #: ../tools/virt-resize.pl:1426
28145 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
28146 "means the partitions will not be aligned to the ancient CHS geometry. "
28147 "However CHS geometry is meaningless for disks manufactured since the early "
28148 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
28149 "cylinders is not required by any modern operating system."
28153 #: ../tools/virt-resize.pl:1433
28154 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
28158 #: ../tools/virt-resize.pl:1435
28160 "In Windows Vista and later versions, Microsoft switched to using a separate "
28161 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
28162 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
28163 "the boot partition. Doing so seems to break the guest completely. However "
28164 "expanding the second partition (ie. C: drive) should work."
28168 #: ../tools/virt-resize.pl:1442
28170 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
28171 "NTFS partitions have been expanded. This is just a safety check and (unless "
28172 "it find errors) is nothing to worry about."
28176 #: ../tools/virt-resize.pl:1446
28177 msgid "GUEST BOOT STUCK AT \"GRUB\""
28181 #: ../tools/virt-resize.pl:1448
28183 "If a Linux guest does not boot after resizing, and the boot is stuck after "
28184 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
28185 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
28186 "although we think is to do with partition alignment."
28190 #: ../tools/virt-resize.pl:1453
28193 " guestfish -i -a newdisk\n"
28194 " ><fs> cat /boot/grub/device.map\n"
28195 " # check the contents of this file are sensible or\n"
28196 " # edit the file if necessary\n"
28197 " ><fs> grub-install / /dev/vda\n"
28203 #: ../tools/virt-resize.pl:1460
28205 "For more flexible guest reconfiguration, including if you need to specify "
28206 "other parameters to grub-install, use L<virt-rescue(1)>."
28210 #: ../tools/virt-resize.pl:1463
28211 msgid "ALTERNATIVE TOOLS"
28215 #: ../tools/virt-resize.pl:1465
28217 "There are several proprietary tools for resizing partitions. We won't "
28218 "mention any here."
28222 #: ../tools/virt-resize.pl:1468
28224 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
28225 "operations on disk images. They can resize and move partitions, but I don't "
28226 "think they can do anything with the contents, and they certainly don't "
28231 #: ../tools/virt-resize.pl:1473
28233 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
28234 "but at a much lower level. You will probably end up hand-calculating sector "
28235 "offsets, which is something that virt-resize was designed to avoid. If you "
28236 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28241 #: ../tools/virt-resize.pl:1488
28243 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
28244 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
28245 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)"
28246 ">, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
28247 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28251 #: ../tools/virt-list-filesystems.pl:32
28253 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28257 #: ../tools/virt-list-filesystems.pl:36
28260 " virt-list-filesystems [--options] domname\n"
28265 #: ../tools/virt-list-filesystems.pl:38
28268 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28273 #: ../tools/virt-list-filesystems.pl:42
28275 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28276 "are contained in a virtual machine or disk image."
28280 #: ../tools/virt-list-filesystems.pl:46
28282 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28283 "functionality. For more complex cases you should look at the L<guestfish(1)"
28288 #: ../tools/virt-list-filesystems.pl:105
28290 "With this option, C<virt-list-filesystems> displays the type of each "
28291 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28295 #: ../tools/virt-list-filesystems.pl:112
28296 msgid "B<-a> | B<--all>"
28300 #: ../tools/virt-list-filesystems.pl:114
28302 "Normally we only show mountable filesystems. If this option is given then "
28303 "swap devices are shown too."
28307 #: ../tools/virt-list-filesystems.pl:188
28309 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
28310 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
28311 ">, L<http://libguestfs.org/>."
28315 #: ../tools/virt-tar.pl:33
28316 msgid "virt-tar - Extract or upload files to a virtual machine"
28320 #: ../tools/virt-tar.pl:37
28323 " virt-tar [--options] -x domname directory tarball\n"
28328 #: ../tools/virt-tar.pl:39
28331 " virt-tar [--options] -u domname tarball directory\n"
28336 #: ../tools/virt-tar.pl:41
28339 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28344 #: ../tools/virt-tar.pl:43
28347 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28352 #: ../tools/virt-tar.pl:47
28353 msgid "Download C</home> from the VM into a local tarball:"
28357 #: ../tools/virt-tar.pl:49
28360 " virt-tar -x domname /home home.tar\n"
28365 #: ../tools/virt-tar.pl:51
28368 " virt-tar -zx domname /home home.tar.gz\n"
28373 #: ../tools/virt-tar.pl:53
28374 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28378 #: ../tools/virt-tar.pl:55
28381 " virt-tar -u domname uploadstuff.tar /tmp\n"
28386 #: ../tools/virt-tar.pl:57
28389 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28394 #: ../tools/virt-tar.pl:61
28396 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28397 "virtual machines. If you do this, you risk disk corruption in the VM. "
28398 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28402 #: ../tools/virt-tar.pl:66
28404 "You can use C<-x> (extract) on live virtual machines, but you might get "
28405 "inconsistent results or errors if there is filesystem activity inside the "
28406 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28407 "work, but the only way to guarantee consistent results is if the virtual "
28408 "machine is shut down."
28412 #: ../tools/virt-tar.pl:74
28414 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28415 "parts of a guest filesystem. There are many possibilities: making backups, "
28416 "uploading data files, snooping on guest activity, fixing or customizing "
28421 #: ../tools/virt-tar.pl:79
28423 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28424 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28425 "should look at the L<guestfish(1)> tool."
28429 #: ../tools/virt-tar.pl:83
28431 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28432 "its contents (recursively) from the virtual machine into a local tarball. "
28433 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28434 "virtual machine. You cannot use these two options together."
28438 #: ../tools/virt-tar.pl:89
28440 "In addition, you may need to use the C<-z> (gZip) option to enable "
28441 "compression. When uploading, you have to specify C<-z> if the upload file "
28442 "is compressed because virt-tar won't detect this on its own."
28446 #: ../tools/virt-tar.pl:93
28448 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28449 "example it cannot do PKZip files or bzip2 compression. If you want that "
28450 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28451 "the L<libguestfs(3)> API)."
28455 #: ../tools/virt-tar.pl:151
28456 msgid "B<-x> | B<--extract> | B<--download>"
28460 #: ../tools/virt-tar.pl:153
28461 msgid "B<-u> | B<--upload>"
28465 #: ../tools/virt-tar.pl:155
28467 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28472 #: ../tools/virt-tar.pl:158
28474 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28475 "Please read the L</WARNING> section above before using this option."
28479 #: ../tools/virt-tar.pl:162
28480 msgid "You must specify exactly one of these options."
28484 #: ../tools/virt-tar.pl:168
28485 msgid "B<-z> | B<--gzip>"
28489 #: ../tools/virt-tar.pl:170
28490 msgid "Specify that the input or output tarball is gzip-compressed."
28494 #: ../tools/virt-tar.pl:283
28496 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28497 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28502 #: ../tools/virt-rescue.pl:33
28503 msgid "virt-rescue - Run a rescue shell on a virtual machine"
28507 #: ../tools/virt-rescue.pl:37
28510 " virt-rescue [--options] domname\n"
28515 #: ../tools/virt-rescue.pl:39
28518 " virt-rescue [--options] disk.img [disk.img ...]\n"
28523 #: ../tools/virt-rescue.pl:43
28525 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
28526 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
28527 "you from doing this, but doesn't catch all cases."
28531 #: ../tools/virt-rescue.pl:47
28533 "However if you use the I<--ro> (read only) option, then you can attach a "
28534 "shell to a live virtual machine. The results might be strange or "
28535 "inconsistent at times but you won't get disk corruption."
28539 #: ../tools/virt-rescue.pl:53
28541 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
28542 "need for a CD. virt-rescue gives you a rescue shell and some simple "
28543 "recovery tools which you can use to examine or rescue a virtual machine or "
28548 #: ../tools/virt-rescue.pl:58
28550 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
28551 "on disk image(s):"
28555 #: ../tools/virt-rescue.pl:61
28558 " virt-rescue GuestName\n"
28563 #: ../tools/virt-rescue.pl:63
28566 " virt-rescue --ro /path/to/disk.img\n"
28571 #: ../tools/virt-rescue.pl:65
28574 " virt-rescue /dev/sdc\n"
28579 #: ../tools/virt-rescue.pl:67
28580 msgid "For live VMs you I<must> use the --ro option."
28584 #: ../tools/virt-rescue.pl:69
28586 "When you run virt-rescue on a virtual machine or disk image, you are placed "
28587 "in an interactive bash shell where you can use many ordinary Linux "
28588 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
28589 "appliance. You must mount the virtual machine's filesystems by hand. There "
28590 "is an empty directory called C</sysroot> where you can mount filesystems."
28594 #: ../tools/virt-rescue.pl:76
28596 "In the example below, we list logical volumes, then choose one to mount "
28597 "under C</sysroot>:"
28601 #: ../tools/virt-rescue.pl:79
28605 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
28606 " lv_root vg_f11x64 -wi-a- 8.83G\n"
28607 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
28608 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
28609 " ><rescue> ls /sysroot\n"
28614 #: ../tools/virt-rescue.pl:86
28616 "If you don't know what filesystems are available on the virtual machine then "
28617 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
28621 #: ../tools/virt-rescue.pl:92
28623 "Virt-rescue can be used on I<any> disk image file or device, not just a "
28624 "virtual machine. For example you can use it on a blank file if you want to "
28625 "partition that file (although we would recommend using L<guestfish(1)> "
28626 "instead as it is more suitable for this purpose). You can even use virt-"
28627 "rescue on things like SD cards."
28631 #: ../tools/virt-rescue.pl:98
28633 "This tool is just designed for quick interactive hacking on a virtual "
28634 "machine. For more structured access to a virtual machine disk image, you "
28635 "should use L<guestfs(3)>. To get a structured shell that you can use to "
28636 "make scripted changes to guests, use L<guestfish(1)>."
28640 #: ../tools/virt-rescue.pl:127
28641 msgid "B<--append kernelopts>"
28645 #: ../tools/virt-rescue.pl:129
28646 msgid "Pass additional options to the rescue kernel."
28650 #: ../tools/virt-rescue.pl:164
28651 msgid "B<--memsize MB> | B<-m MB>"
28655 #: ../tools/virt-rescue.pl:166
28657 "Change the amount of memory allocated to the rescue system. The default is "
28658 "set by libguestfs and is small but adequate for running system tools. The "
28659 "occasional program might need more memory. The parameter is specified in "
28664 #: ../tools/virt-rescue.pl:175
28665 msgid "B<--network MB>"
28669 #: ../tools/virt-rescue.pl:177
28670 msgid "Enable QEMU user networking in the guest."
28674 #: ../tools/virt-rescue.pl:183
28675 msgid "B<--ro> | B<-r>"
28679 #: ../tools/virt-rescue.pl:185
28680 msgid "Open the image read-only."
28684 #: ../tools/virt-rescue.pl:197
28686 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
28687 "SELINUX> before using this option."
28691 #: ../tools/virt-rescue.pl:257
28693 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
28694 "ENVIRONMENT VARIABLES> for the complete list."
28698 #: ../tools/virt-rescue.pl:269
28700 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
28701 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28705 #: ../tools/virt-make-fs.pl:37
28706 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
28710 #: ../tools/virt-make-fs.pl:41
28713 " virt-make-fs [--options] input.tar output.img\n"
28718 #: ../tools/virt-make-fs.pl:43
28721 " virt-make-fs [--options] input.tar.gz output.img\n"
28726 #: ../tools/virt-make-fs.pl:45
28729 " virt-make-fs [--options] directory output.img\n"
28734 #: ../tools/virt-make-fs.pl:49
28736 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
28737 "archive or some files in a directory. It is similar to tools like L<mkisofs"
28738 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
28739 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
28740 "you want to attach these filesystems to existing virtual machines (eg. to "
28741 "import large amounts of read-only data to a VM)."
28745 #: ../tools/virt-make-fs.pl:57
28746 msgid "Basic usage is:"
28750 #: ../tools/virt-make-fs.pl:59
28753 " virt-make-fs input output\n"
28758 #: ../tools/virt-make-fs.pl:61
28760 "where C<input> is either a directory containing files that you want to add, "
28761 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
28762 "C<output> is a disk image. The input type is detected automatically. The "
28763 "output disk image defaults to a raw ext2 image unless you specify extra "
28764 "flags (see L</OPTIONS> below)."
28768 #: ../tools/virt-make-fs.pl:67
28769 msgid "EXTRA SPACE"
28773 #: ../tools/virt-make-fs.pl:69
28775 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
28776 "the files that it contains, but might have extra space. Depending on how "
28777 "you are going to use the output, you might think this extra space is wasted "
28778 "and want to minimize it, or you might want to leave space so that more files "
28779 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
28780 "but you can use the C<--size> flag to leave space in the filesystem if you "
28785 #: ../tools/virt-make-fs.pl:77
28787 "An alternative way to leave extra space but not make the output image any "
28788 "bigger is to use an alternative disk image format (instead of the default "
28789 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
28790 "image format (check your hypervisor supports this before using it). This "
28791 "allows you to choose a large C<--size> but the extra space won't actually be "
28792 "allocated in the image until you try to store something in it."
28796 #: ../tools/virt-make-fs.pl:85
28798 "Don't forget that you can also use local commands including L<resize2fs(8)> "
28799 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
28800 "resize to build another image from scratch."
28804 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
28805 #: ../tools/virt-make-fs.pl:142
28810 #: ../tools/virt-make-fs.pl:91
28813 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
28818 #: ../tools/virt-make-fs.pl:93
28819 msgid "FILESYSTEM TYPE"
28823 #: ../tools/virt-make-fs.pl:95
28825 "The default filesystem type is C<ext2>. Just about any filesystem type that "
28826 "libguestfs supports can be used (but I<not> read-only formats like "
28827 "ISO9660). Here are some of the more common choices:"
28831 #: ../tools/virt-make-fs.pl:101
28836 #: ../tools/virt-make-fs.pl:103
28838 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
28839 "you are not going to use the filesystem in a way that requires the journal, "
28840 "then this is just wasted overhead."
28844 #: ../tools/virt-make-fs.pl:107
28845 msgid "I<ntfs> or I<vfat>"
28849 #: ../tools/virt-make-fs.pl:109
28850 msgid "Useful if exporting data to a Windows guest."
28854 #: ../tools/virt-make-fs.pl:111
28856 "I<Note for vfat>: The tar archive or local directory must only contain files "
28857 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
28858 "program running within libguestfs is unable to change the ownership of non-"
28859 "root files, since vfat itself does not support this."
28863 #: ../tools/virt-make-fs.pl:116
28868 #: ../tools/virt-make-fs.pl:118
28870 "Lower overhead than C<ext2>, but certain limitations on filename length and "
28871 "total filesystem size."
28875 #: ../tools/virt-make-fs.pl:125
28878 " virt-make-fs --type=minix input minixfs.img\n"
28883 #: ../tools/virt-make-fs.pl:127
28884 msgid "TO PARTITION OR NOT TO PARTITION"
28888 #: ../tools/virt-make-fs.pl:129
28889 msgid "Optionally virt-make-fs can add a partition table to the output disk."
28893 #: ../tools/virt-make-fs.pl:131
28895 "Adding a partition can make the disk image more compatible with certain "
28896 "virtualized operating systems which don't expect to see a filesystem "
28897 "directly located on a block device (Linux doesn't care and will happily "
28898 "handle both types)."
28902 #: ../tools/virt-make-fs.pl:136
28904 "On the other hand, if you have a partition table then the output image is no "
28905 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
28906 "directly on a partitioned disk image. (However libguestfs tools such as "
28907 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
28911 #: ../tools/virt-make-fs.pl:144
28912 msgid "Add an MBR partition:"
28916 #: ../tools/virt-make-fs.pl:146
28919 " virt-make-fs --partition -- input disk.img\n"
28924 #: ../tools/virt-make-fs.pl:148
28926 "If the output disk image could be terabyte-sized or larger, it's better to "
28927 "use an EFI/GPT-compatible partition table:"
28931 #: ../tools/virt-make-fs.pl:151
28934 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
28939 #: ../tools/virt-make-fs.pl:179
28940 msgid "Enable debugging information."
28944 #: ../tools/virt-make-fs.pl:185
28945 msgid "B<--size=E<lt>NE<gt>>"
28949 #: ../tools/virt-make-fs.pl:187
28950 msgid "B<--size=+E<lt>NE<gt>>"
28954 #: ../tools/virt-make-fs.pl:189
28955 msgid "B<-s E<lt>NE<gt>>"
28959 #: ../tools/virt-make-fs.pl:191
28960 msgid "B<-s +E<lt>NE<gt>>"
28964 #: ../tools/virt-make-fs.pl:193
28966 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
28970 #: ../tools/virt-make-fs.pl:196
28972 "If this option is I<not> given, then the output image will be just large "
28973 "enough to contain all the files, with not much wasted space."
28977 #: ../tools/virt-make-fs.pl:199
28979 "To choose a fixed size output disk, specify an absolute number followed by b/"
28980 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28981 "Petabytes or Exabytes. This must be large enough to contain all the input "
28982 "files, else you will get an error."
28986 #: ../tools/virt-make-fs.pl:204
28988 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
28989 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28990 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
28991 "the input files, and (approximately) an extra 200 MB free space."
28995 #: ../tools/virt-make-fs.pl:210
28997 "Note that virt-make-fs estimates free space, and therefore will not produce "
28998 "filesystems containing precisely the free space requested. (It is much more "
28999 "expensive and time-consuming to produce a filesystem which has precisely the "
29000 "desired free space)."
29004 #: ../tools/virt-make-fs.pl:219
29005 msgid "B<--format=E<lt>fmtE<gt>>"
29009 #: ../tools/virt-make-fs.pl:221
29010 msgid "B<-F E<lt>fmtE<gt>>"
29014 #: ../tools/virt-make-fs.pl:223
29015 msgid "Choose the output disk image format."
29019 #: ../tools/virt-make-fs.pl:225
29020 msgid "The default is C<raw> (raw disk image)."
29024 #: ../tools/virt-make-fs.pl:227
29026 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29027 "that would really make sense here is C<qcow2>."
29031 #: ../tools/virt-make-fs.pl:234
29032 msgid "B<--type=E<lt>fsE<gt>>"
29036 #: ../tools/virt-make-fs.pl:236
29037 msgid "B<-t E<lt>fsE<gt>>"
29041 #: ../tools/virt-make-fs.pl:238
29042 msgid "Choose the output filesystem type."
29046 #: ../tools/virt-make-fs.pl:240
29047 msgid "The default is C<ext2>."
29051 #: ../tools/virt-make-fs.pl:242
29053 "Any filesystem which is supported read-write by libguestfs can be used here."
29057 #: ../tools/virt-make-fs.pl:249
29058 msgid "B<--partition>"
29062 #: ../tools/virt-make-fs.pl:251
29063 msgid "B<--partition=E<lt>parttypeE<gt>>"
29067 #: ../tools/virt-make-fs.pl:253
29069 "If specified, this flag adds an MBR partition table to the output disk image."
29073 #: ../tools/virt-make-fs.pl:256
29075 "You can change the partition table type, eg. C<--partition=gpt> for large "
29080 #: ../tools/virt-make-fs.pl:259
29082 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29083 "might consider the next parameter to be the partition type. For example:"
29087 #: ../tools/virt-make-fs.pl:263
29090 " virt-make-fs --partition input.tar ...\n"
29095 #: ../tools/virt-make-fs.pl:265
29097 "would cause virt-make-fs to think you wanted to use a partition type of "
29098 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29099 "dash) between options and the input file argument:"
29103 #: ../tools/virt-make-fs.pl:269
29106 " virt-make-fs --partition -- input.tar ...\n"
29111 #: ../tools/virt-make-fs.pl:536
29113 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
29114 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
29115 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29119 #: ../tools/virt-make-fs.pl:553
29122 " export LIBGUESTFS_DEBUG=1\n"
29123 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29128 #: ../tools/virt-make-fs.pl:556
29130 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
29135 #: ../tools/virt-list-partitions.pl:32
29137 "virt-list-partitions - List partitions in a virtual machine or disk image"
29141 #: ../tools/virt-list-partitions.pl:36
29144 " virt-list-partitions [--options] domname\n"
29149 #: ../tools/virt-list-partitions.pl:38
29152 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29157 #: ../tools/virt-list-partitions.pl:42
29159 "C<virt-list-partitions> is a command line tool to list the partitions that "
29160 "are contained in a virtual machine or disk image. It is mainly useful as a "
29161 "first step to using L<virt-resize(1)>."
29165 #: ../tools/virt-list-partitions.pl:47
29167 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
29168 "functionality. For more complex cases you should look at the L<guestfish(1)"
29173 #: ../tools/virt-list-partitions.pl:104
29174 msgid "B<-h> | B<--human-readable>"
29178 #: ../tools/virt-list-partitions.pl:106
29179 msgid "Show sizes in human-readable form (eg. \"1G\")."
29183 #: ../tools/virt-list-partitions.pl:114
29185 "With this option, C<virt-list-partitions> displays the type and size of each "
29186 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
29190 #: ../tools/virt-list-partitions.pl:121
29191 msgid "B<-t> | B<--total>"
29195 #: ../tools/virt-list-partitions.pl:123
29197 "Display the total size of each block device (as a separate row or rows)."
29201 #: ../tools/virt-list-partitions.pl:256
29203 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
29204 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
29205 "libguestfs.org/>."