1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.7.21\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2010-12-10 13:42+0000\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=utf-8\n"
17 "Content-Transfer-Encoding: ENCODING"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1 ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1 ../tools/virt-edit.pl:30 ../tools/virt-win-reg.pl:33 ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28 ../tools/virt-tar.pl:29 ../tools/virt-make-fs.pl:33 ../tools/virt-list-partitions.pl:28
25 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35 ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30 ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
30 #: ../src/guestfs.pod:5
31 msgid "guestfs - Library for accessing and modifying virtual machine images"
35 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39 ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34 ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
40 #: ../src/guestfs.pod:9
43 " #include <guestfs.h>\n"
48 #: ../src/guestfs.pod:11
51 " guestfs_h *g = guestfs_create ();\n"
52 " guestfs_add_drive (g, \"guest.img\");\n"
53 " guestfs_launch (g);\n"
54 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
55 " guestfs_touch (g, \"/hello\");\n"
56 " guestfs_umount (g, \"/\");\n"
57 " guestfs_close (g);\n"
62 #: ../src/guestfs.pod:19
65 " cc prog.c -o prog -lguestfs\n"
67 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
72 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20 ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63 ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40 ../tools/virt-tar.pl:72 ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
77 #: ../src/guestfs.pod:25
79 "Libguestfs is a library for accessing and modifying guest disk images. "
80 "Amongst the things this is good for: making batch configuration changes to "
81 "guests, getting disk used/free statistics (see also: virt-df), migrating "
82 "between virtualization systems (see also: virt-p2v), performing partial "
83 "backups, performing partial guest clones, cloning guests and changing "
84 "registry/UUID/hostname info, and much else besides."
88 #: ../src/guestfs.pod:33
90 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
91 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
92 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
97 #: ../src/guestfs.pod:38
99 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
100 "what filesystem is in each LV, etc.). It can also run commands in the "
101 "context of the guest. Also you can access filesystems over FUSE."
105 #: ../src/guestfs.pod:43
107 "Libguestfs is a library that can be linked with C and C++ management "
108 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
109 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
114 #: ../src/guestfs.pod:48
116 "You don't need to be root to use libguestfs, although obviously you do need "
117 "enough permissions to access the disk images."
121 #: ../src/guestfs.pod:51
123 "Libguestfs is a large API because it can do many things. For a gentle "
124 "introduction, please read the L</API OVERVIEW> section next."
128 #: ../src/guestfs.pod:54
130 "There are also some example programs in the L<guestfs-examples(3)> manual "
135 #: ../src/guestfs.pod:57
140 #: ../src/guestfs.pod:59
142 "This section provides a gentler overview of the libguestfs API. We also try "
143 "to group API calls together, where that may not be obvious from reading "
144 "about the individual calls in the main section of this manual."
148 #: ../src/guestfs.pod:64
153 #: ../src/guestfs.pod:66
155 "Before you can use libguestfs calls, you have to create a handle. Then you "
156 "must add at least one disk image to the handle, followed by launching the "
157 "handle, then performing whatever operations you want, and finally closing "
158 "the handle. By convention we use the single letter C<g> for the name of the "
159 "handle variable, although of course you can use any name you want."
163 #: ../src/guestfs.pod:73
164 msgid "The general structure of all libguestfs-using programs looks like this:"
168 #: ../src/guestfs.pod:76
171 " guestfs_h *g = guestfs_create ();\n"
176 #: ../src/guestfs.pod:78
179 " /* Call guestfs_add_drive additional times if there are\n"
180 " * multiple disk images.\n"
182 " guestfs_add_drive (g, \"guest.img\");\n"
187 #: ../src/guestfs.pod:83
190 " /* Most manipulation calls won't work until you've launched\n"
191 " * the handle 'g'. You have to do this _after_ adding drives\n"
192 " * and _before_ other commands.\n"
194 " guestfs_launch (g);\n"
199 #: ../src/guestfs.pod:89
202 " /* Now you can examine what partitions, LVs etc are available.\n"
204 " char **partitions = guestfs_list_partitions (g);\n"
205 " char **logvols = guestfs_lvs (g);\n"
210 #: ../src/guestfs.pod:94
213 " /* To access a filesystem in the image, you must mount it.\n"
215 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
220 #: ../src/guestfs.pod:98
223 " /* Now you can perform filesystem actions on the guest\n"
226 " guestfs_touch (g, \"/hello\");\n"
231 #: ../src/guestfs.pod:103
234 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
235 " * it is done automatically when you close the handle. See\n"
236 " * discussion of autosync in this page.\n"
238 " guestfs_sync (g);\n"
243 #: ../src/guestfs.pod:109
246 " /* Close the handle 'g'. */\n"
247 " guestfs_close (g);\n"
252 #: ../src/guestfs.pod:112
254 "The code above doesn't include any error checking. In real code you should "
255 "check return values carefully for errors. In general all functions that "
256 "return integers return C<-1> on error, and all functions that return "
257 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
258 "how to handle errors, and consult the documentation for each function call "
259 "below to see precisely how they return error indications. See "
260 "L<guestfs-examples(3)> for fully worked examples."
264 #: ../src/guestfs.pod:121
269 #: ../src/guestfs.pod:123
271 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
272 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
273 "actual block device, or simply an empty file of zeroes that you have created "
274 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
279 #: ../src/guestfs.pod:129
281 "The call you should use in modern code for adding drives is "
282 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
283 "specifying that the format is raw, do:"
287 #: ../src/guestfs.pod:133
290 " guestfs_add_drive_opts (g, filename,\n"
291 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
297 #: ../src/guestfs.pod:137
298 msgid "You can add a disk read-only using:"
302 #: ../src/guestfs.pod:139
305 " guestfs_add_drive_opts (g, filename,\n"
306 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
307 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
313 #: ../src/guestfs.pod:144
315 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
316 "libguestfs won't modify the file."
320 #: ../src/guestfs.pod:147
322 "Be extremely cautious if the disk image is in use, eg. if it is being used "
323 "by a virtual machine. Adding it read-write will almost certainly cause disk "
324 "corruption, but adding it read-only is safe."
328 #: ../src/guestfs.pod:151
330 "You must add at least one disk image, and you may add multiple disk images. "
331 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
332 "first one you added), C</dev/sdb> (for the second one you added), etc."
336 #: ../src/guestfs.pod:156
338 "Once L</guestfs_launch> has been called you cannot add any more images. You "
339 "can call L</guestfs_list_devices> to get a list of the device names, in the "
340 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
344 #: ../src/guestfs.pod:161
349 #: ../src/guestfs.pod:163
351 "Before you can read or write files, create directories and so on in a disk "
352 "image that contains filesystems, you have to mount those filesystems using "
353 "L</guestfs_mount>. If you already know that a disk image contains (for "
354 "example) one partition with a filesystem on that partition, then you can "
359 #: ../src/guestfs.pod:169
362 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
367 #: ../src/guestfs.pod:171
369 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
370 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
371 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
375 #: ../src/guestfs.pod:175
377 "If you are given a disk image and you don't know what it contains then you "
378 "have to find out. Libguestfs can do that too: use "
379 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
380 "and LVs, and either try mounting each to see what is mountable, or else "
381 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also "
382 "has a set of APIs for inspection of disk images (see L</INSPECTION> below). "
383 "But you might find it easier to look at higher level programs built on top "
384 "of libguestfs, in particular L<virt-inspector(1)>."
388 #: ../src/guestfs.pod:185
390 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
391 "several other variations of the C<guestfs_mount_*> call."
395 #: ../src/guestfs.pod:188
396 msgid "FILESYSTEM ACCESS AND MODIFICATION"
400 #: ../src/guestfs.pod:190
402 "The majority of the libguestfs API consists of fairly low-level calls for "
403 "accessing and modifying the files, directories, symlinks etc on mounted "
404 "filesystems. There are over a hundred such calls which you can find listed "
405 "in detail below in this man page, and we don't even pretend to cover them "
406 "all in this overview."
410 #: ../src/guestfs.pod:196
412 "Specify filenames as full paths, starting with C<\"/\"> and including the "
417 #: ../src/guestfs.pod:199
419 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
420 "the file called C<\"etc/passwd\"> then you could do:"
424 #: ../src/guestfs.pod:202
427 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
432 #: ../src/guestfs.pod:204
434 "This would return C<data> as a newly allocated buffer containing the full "
435 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
436 "or C<NULL> if there was an error."
440 #: ../src/guestfs.pod:208
442 "As another example, to create a top-level directory on that filesystem "
443 "called C<\"var\"> you would do:"
447 #: ../src/guestfs.pod:211
450 " guestfs_mkdir (g, \"/var\");\n"
455 #: ../src/guestfs.pod:213
456 msgid "To create a symlink you could do:"
460 #: ../src/guestfs.pod:215
463 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
464 " \"/etc/rc3.d/S30portmap\");\n"
469 #: ../src/guestfs.pod:218
471 "Libguestfs will reject attempts to use relative paths and there is no "
472 "concept of a current working directory."
476 #: ../src/guestfs.pod:221
478 "Libguestfs can return errors in many situations: for example if the "
479 "filesystem isn't writable, or if a file or directory that you requested "
480 "doesn't exist. If you are using the C API (documented here) you have to "
481 "check for those error conditions after each call. (Other language bindings "
482 "turn these errors into exceptions)."
486 #: ../src/guestfs.pod:227
488 "File writes are affected by the per-handle umask, set by calling "
489 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
493 #: ../src/guestfs.pod:230
498 #: ../src/guestfs.pod:232
500 "Libguestfs contains API calls to read, create and modify partition tables on "
505 #: ../src/guestfs.pod:235
507 "In the common case where you want to create a single partition covering the "
508 "whole disk, you should use the L</guestfs_part_disk> call:"
512 #: ../src/guestfs.pod:239
515 " const char *parttype = \"mbr\";\n"
516 " if (disk_is_larger_than_2TB)\n"
517 " parttype = \"gpt\";\n"
518 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
523 #: ../src/guestfs.pod:244
525 "Obviously this effectively wipes anything that was on that disk image "
530 #: ../src/guestfs.pod:247
535 #: ../src/guestfs.pod:249
537 "Libguestfs provides access to a large part of the LVM2 API, such as "
538 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
539 "unless you familiarize yourself with the concepts of physical volumes, "
540 "volume groups and logical volumes."
544 #: ../src/guestfs.pod:254
546 "This author strongly recommends reading the LVM HOWTO, online at "
547 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
551 #: ../src/guestfs.pod:257
556 #: ../src/guestfs.pod:259
558 "Use L</guestfs_cat> to download small, text only files. This call is "
559 "limited to files which are less than 2 MB and which cannot contain any ASCII "
560 "NUL (C<\\0>) characters. However it has a very simple to use API."
564 #: ../src/guestfs.pod:264
566 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
567 "bit data, since it returns a (pointer, size) pair. However it is still "
568 "limited to \"small\" files, less than 2 MB."
572 #: ../src/guestfs.pod:268
574 "L</guestfs_download> can be used to download any file, with no limits on "
575 "content or size (even files larger than 4 GB)."
579 #: ../src/guestfs.pod:271
580 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
584 #: ../src/guestfs.pod:274
589 #: ../src/guestfs.pod:276
591 "It's often the case that you want to write a file or files to the disk "
596 #: ../src/guestfs.pod:279
598 "To write a small file with fixed content, use L</guestfs_write>. To create "
599 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
600 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
601 "variety of other functions for creating test files, for example "
602 "L</guestfs_fill> and L</guestfs_fill_pattern>."
606 #: ../src/guestfs.pod:285
608 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
609 "file content or size (even files larger than 4 GB)."
613 #: ../src/guestfs.pod:288
614 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
618 #: ../src/guestfs.pod:290
620 "However the fastest way to upload I<large numbers of arbitrary files> is to "
621 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
622 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
623 "the drive in a predictable way (eg. adding it last after all other drives) "
624 "then you can get the device name from L</guestfs_list_devices> and mount it "
625 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
626 "sometimes non-portable between kernel versions, and they don't support "
627 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
628 "using a label or UUID, use an ISO image instead."
632 #: ../src/guestfs.pod:301
637 #: ../src/guestfs.pod:303
639 "There are various different commands for copying between files and devices "
640 "and in and out of the guest filesystem. These are summarised in the table "
645 #: ../src/guestfs.pod:309
646 msgid "B<file> to B<file>"
650 #: ../src/guestfs.pod:311
652 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
653 "directories recursively."
657 #: ../src/guestfs.pod:314
658 msgid "B<file or device> to B<file or device>"
662 #: ../src/guestfs.pod:316
664 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
665 "devices in the guest."
669 #: ../src/guestfs.pod:319
670 msgid "Example: duplicate the contents of an LV:"
674 #: ../src/guestfs.pod:321
677 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
682 #: ../src/guestfs.pod:323
684 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
685 "(C</dev/VG/Original>). To copy less than the whole source device, use "
686 "L</guestfs_copy_size>."
690 #: ../src/guestfs.pod:327
691 msgid "B<file on the host> to B<file or device>"
695 #: ../src/guestfs.pod:329
696 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
700 #: ../src/guestfs.pod:331
701 msgid "B<file or device> to B<file on the host>"
705 #: ../src/guestfs.pod:333
706 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
710 #: ../src/guestfs.pod:337
711 msgid "LISTING FILES"
715 #: ../src/guestfs.pod:339
717 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
718 "L<guestfish(1)>-equivalent command C<ll>)."
722 #: ../src/guestfs.pod:342
724 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
725 "programs, as a flat list of strings."
729 #: ../src/guestfs.pod:345
731 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
732 "directory, plus additional information about each one. It is more "
733 "equivalent to using the L<readdir(3)> call on a local filesystem."
737 #: ../src/guestfs.pod:349
739 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
744 #: ../src/guestfs.pod:352
745 msgid "RUNNING COMMANDS"
749 #: ../src/guestfs.pod:354
751 "Although libguestfs is primarily an API for manipulating files inside guest "
752 "images, we also provide some limited facilities for running commands inside "
757 #: ../src/guestfs.pod:358
758 msgid "There are many limitations to this:"
762 #: ../src/guestfs.pod:362 ../src/guestfs.pod:367 ../src/guestfs.pod:372 ../src/guestfs.pod:376 ../src/guestfs.pod:381 ../src/guestfs.pod:385 ../src/guestfs.pod:390 ../src/guestfs.pod:395 ../src/guestfs.pod:954 ../src/guestfs.pod:958 ../src/guestfs.pod:962 ../src/guestfs.pod:967 ../src/guestfs.pod:975 ../src/guestfs.pod:994 ../src/guestfs.pod:1002 ../src/guestfs.pod:1024 ../src/guestfs.pod:1028 ../src/guestfs.pod:1032 ../src/guestfs.pod:1036 ../src/guestfs.pod:1040 ../src/guestfs.pod:1044 ../src/guestfs.pod:1526 ../src/guestfs.pod:1531 ../src/guestfs.pod:1535 ../src/guestfs.pod:1645 ../src/guestfs.pod:1650 ../src/guestfs.pod:1654 ../src/guestfs.pod:2006 ../src/guestfs.pod:2012 ../src/guestfs.pod:2017 ../src/guestfs.pod:2023 ../src/guestfs.pod:2135 ../src/guestfs.pod:2139 ../src/guestfs.pod:2143 ../src/guestfs.pod:2147 ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:579 ../src/guestfs-actions.pod:586 ../src/guestfs-actions.pod:593 ../src/guestfs-actions.pod:1589 ../src/guestfs-actions.pod:1593 ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:1601 ../src/guestfs-actions.pod:1609 ../src/guestfs-actions.pod:1613 ../src/guestfs-actions.pod:1617 ../src/guestfs-actions.pod:1627 ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1635 ../src/guestfs-actions.pod:1773 ../src/guestfs-actions.pod:1777 ../src/guestfs-actions.pod:1782 ../src/guestfs-actions.pod:1787 ../src/guestfs-actions.pod:1848 ../src/guestfs-actions.pod:1852 ../src/guestfs-actions.pod:1857 ../fish/guestfish.pod:377 ../fish/guestfish.pod:381 ../fish/guestfish.pod:385 ../fish/guestfish.pod:389 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:375 ../fish/guestfish-actions.pod:383 ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:397 ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1071 ../fish/guestfish-actions.pod:1075 ../fish/guestfish-actions.pod:1079 ../fish/guestfish-actions.pod:1087 ../fish/guestfish-actions.pod:1091 ../fish/guestfish-actions.pod:1095 ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1109 ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1203 ../fish/guestfish-actions.pod:1207 ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1259 ../fish/guestfish-actions.pod:1263 ../fish/guestfish-actions.pod:1268 ../tools/virt-resize.pl:345 ../tools/virt-resize.pl:350 ../tools/virt-resize.pl:360
767 #: ../src/guestfs.pod:364
769 "The kernel version that the command runs under will be different from what "
774 #: ../src/guestfs.pod:369
776 "If the command needs to communicate with daemons, then most likely they "
781 #: ../src/guestfs.pod:374
782 msgid "The command will be running in limited memory."
786 #: ../src/guestfs.pod:378
788 "The network may not be available unless you enable it (see "
789 "L</guestfs_set_network>)."
793 #: ../src/guestfs.pod:383
794 msgid "Only supports Linux guests (not Windows, BSD, etc)."
798 #: ../src/guestfs.pod:387
799 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
803 #: ../src/guestfs.pod:392
805 "For SELinux guests, you may need to enable SELinux and load policy first. "
806 "See L</SELINUX> in this manpage."
810 #: ../src/guestfs.pod:397
812 "I<Security:> It is not safe to run commands from untrusted, possibly "
813 "malicious guests. These commands may attempt to exploit your program by "
814 "sending unexpected output. They could also try to exploit the Linux kernel "
815 "or qemu provided by the libguestfs appliance. They could use the network "
816 "provided by the libguestfs appliance to bypass ordinary network partitions "
817 "and firewalls. They could use the elevated privileges or different SELinux "
818 "context of your program to their advantage."
822 #: ../src/guestfs.pod:406
824 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
825 "(a script which runs when the guest next boots normally), and to have this "
826 "script run the commands you want in the normal context of the running guest, "
827 "network security and so on. For information about other security issues, "
832 #: ../src/guestfs.pod:414
834 "The two main API calls to run commands are L</guestfs_command> and "
835 "L</guestfs_sh> (there are also variations)."
839 #: ../src/guestfs.pod:417
841 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
842 "shell globs, redirections, etc will work."
846 #: ../src/guestfs.pod:420
847 msgid "CONFIGURATION FILES"
851 #: ../src/guestfs.pod:422
853 "To read and write configuration files in Linux guest filesystems, we "
854 "strongly recommend using Augeas. For example, Augeas understands how to "
855 "read and write, say, a Linux shadow password file or X.org configuration "
856 "file, and so avoids you having to write that code."
860 #: ../src/guestfs.pod:427
862 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
863 "document Augeas itself here because there is excellent documentation on the "
864 "L<http://augeas.net/> website."
868 #: ../src/guestfs.pod:431
870 "If you don't want to use Augeas (you fool!) then try calling "
871 "L</guestfs_read_lines> to get the file as a list of lines which you can "
876 #: ../src/guestfs.pod:435
881 #: ../src/guestfs.pod:437
883 "We support SELinux guests. To ensure that labeling happens correctly in "
884 "SELinux guests, you need to enable SELinux and load the guest's policy:"
888 #: ../src/guestfs.pod:443 ../src/guestfs.pod:1147 ../src/guestfs.pod:1278
893 #: ../src/guestfs.pod:445
894 msgid "Before launching, do:"
898 #: ../src/guestfs.pod:447
901 " guestfs_set_selinux (g, 1);\n"
906 #: ../src/guestfs.pod:449 ../src/guestfs.pod:1151 ../src/guestfs.pod:1282
911 #: ../src/guestfs.pod:451
913 "After mounting the guest's filesystem(s), load the policy. This is best "
914 "done by running the L<load_policy(8)> command in the guest itself:"
918 #: ../src/guestfs.pod:455
921 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
926 #: ../src/guestfs.pod:457
928 "(Older versions of C<load_policy> require you to specify the name of the "
933 #: ../src/guestfs.pod:460 ../src/guestfs.pod:1288
938 #: ../src/guestfs.pod:462
940 "Optionally, set the security context for the API. The correct security "
941 "context to use can only be known by inspecting the guest. As an example:"
945 #: ../src/guestfs.pod:466
948 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
953 #: ../src/guestfs.pod:470
954 msgid "This will work for running commands and editing existing files."
958 #: ../src/guestfs.pod:472
960 "When new files are created, you may need to label them explicitly, for "
961 "example by running the external command C<restorecon pathname>."
965 #: ../src/guestfs.pod:476
970 #: ../src/guestfs.pod:478
972 "Certain calls are affected by the current file mode creation mask (the "
973 "\"umask\"). In particular ones which create files or directories, such as "
974 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
975 "either the default mode that the file is created with or modifies the mode "
980 #: ../src/guestfs.pod:484
982 "The default umask is C<022>, so files are created with modes such as C<0644> "
983 "and directories with C<0755>."
987 #: ../src/guestfs.pod:487
989 "There are two ways to avoid being affected by umask. Either set umask to 0 "
990 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
991 "L</guestfs_chmod> after creating each file or directory."
995 #: ../src/guestfs.pod:491
996 msgid "For more information about umask, see L<umask(2)>."
1000 #: ../src/guestfs.pod:493 ../fish/guestfish.pod:670
1001 msgid "ENCRYPTED DISKS"
1005 #: ../src/guestfs.pod:495
1007 "Libguestfs allows you to access Linux guests which have been encrypted using "
1008 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1009 "standard. This includes nearly all whole disk encryption systems used by "
1010 "modern Linux guests."
1014 #: ../src/guestfs.pod:501
1016 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1017 "returns the string C<crypto_LUKS>)."
1021 #: ../src/guestfs.pod:504
1023 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1024 "will require the passphrase!"
1028 #: ../src/guestfs.pod:507
1030 "Opening a LUKS device creates a new device mapper device called "
1031 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
1032 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
1033 "decrypted from and encrypted to the underlying block device respectively."
1037 #: ../src/guestfs.pod:513
1039 "LVM volume groups on the device can be made visible by calling "
1040 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
1041 "volume(s) can now be mounted in the usual way."
1045 #: ../src/guestfs.pod:517
1047 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1048 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1049 "[\"/dev/VG\"])>. Then close the mapper device by calling "
1050 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1051 "underlying encrypted block device)."
1055 #: ../src/guestfs.pod:524
1060 #: ../src/guestfs.pod:526
1062 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1063 "contains operating systems. (These APIs used to be in a separate Perl-only "
1064 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1065 "frequently used part of this library has been rewritten in C and moved into "
1070 #: ../src/guestfs.pod:532
1072 "Add all disks belonging to the unknown virtual machine and call "
1073 "L</guestfs_launch> in the usual way."
1077 #: ../src/guestfs.pod:535
1079 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1080 "and certain heuristics, and returns a list of operating systems that were "
1081 "found. An empty list means none were found. A single element is the root "
1082 "filesystem of the operating system. For dual- or multi-boot guests, "
1083 "multiple roots can be returned, each one corresponding to a separate "
1084 "operating system. (Multi-boot virtual machines are extremely rare in the "
1085 "world of virtualization, but since this scenario can happen, we have built "
1086 "libguestfs to deal with it.)"
1090 #: ../src/guestfs.pod:544
1092 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1093 "to get additional details about that operating system. For example, call "
1094 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1095 "Windows and Linux-based operating systems respectively."
1099 #: ../src/guestfs.pod:550
1101 "Un*x-like and Linux-based operating systems usually consist of several "
1102 "filesystems which are mounted at boot time (for example, a separate boot "
1103 "partition mounted on C</boot>). The inspection rules are able to detect how "
1104 "filesystems correspond to mount points. Call "
1105 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1106 "hash table like this example:"
1110 #: ../src/guestfs.pod:557
1113 " /boot => /dev/sda1\n"
1114 " / => /dev/vg_guest/lv_root\n"
1115 " /usr => /dev/vg_guest/lv_usr\n"
1120 #: ../src/guestfs.pod:561
1122 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1123 "filesystems as suggested."
1127 #: ../src/guestfs.pod:564
1129 "Be careful to mount filesystems in the right order (eg. C</> before "
1130 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1135 #: ../src/guestfs.pod:568
1137 "Inspection currently only works for some common operating systems. "
1138 "Contributors are welcome to send patches for other operating systems that we "
1139 "currently cannot detect."
1143 #: ../src/guestfs.pod:572
1145 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1146 "for more details. The L</guestfs_inspect_os> function just ignores any "
1147 "encrypted devices."
1151 #: ../src/guestfs.pod:576
1153 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1154 "inspection and caches the results in the guest handle. Subsequent calls to "
1155 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1156 "re-read the disks. If you change the content of the guest disks, you can "
1157 "redo inspection by calling L</guestfs_inspect_os> again. "
1158 "(L</guestfs_inspect_list_applications> works a little differently from the "
1159 "other calls and does read the disks. See documentation for that function "
1164 #: ../src/guestfs.pod:585
1165 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1169 #: ../src/guestfs.pod:587
1171 "Libguestfs can mount NTFS partitions. It does this using the "
1172 "L<http://www.ntfs-3g.org/> driver."
1176 #: ../src/guestfs.pod:590
1178 "DOS and Windows still use drive letters, and the filesystems are always "
1179 "treated as case insensitive by Windows itself, and therefore you might find "
1180 "a Windows configuration file referring to a path like "
1181 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1182 "that directory might be referred to as C</WINDOWS/System32>."
1186 #: ../src/guestfs.pod:596
1188 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1189 "libguestfs to read the appropriate Windows Registry and configuration files, "
1190 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1191 "L<virt-inspector(1)>)."
1195 #: ../src/guestfs.pod:601
1197 "Replacing backslash characters with forward slash characters is also outside "
1198 "the scope of libguestfs, but something that you can easily do."
1202 #: ../src/guestfs.pod:604
1204 "Where we can help is in resolving the case insensitivity of paths. For "
1205 "this, call L</guestfs_case_sensitive_path>."
1209 #: ../src/guestfs.pod:607
1211 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1212 "files, through the library C<hivex> which is part of the libguestfs project "
1213 "although ships as a separate tarball. You have to locate and download the "
1214 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1215 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1216 "L<virt-win-reg(1)> for more help on this issue."
1220 #: ../src/guestfs.pod:615
1221 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1225 #: ../src/guestfs.pod:617
1227 "Although we don't want to discourage you from using the C API, we will "
1228 "mention here that the same API is also available in other languages."
1232 #: ../src/guestfs.pod:620
1234 "The API is broadly identical in all supported languages. This means that "
1235 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, "
1236 "C<g.mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1237 "words, a straightforward, predictable isomorphism between each language."
1241 #: ../src/guestfs.pod:626
1243 "Error messages are automatically transformed into exceptions if the language "
1248 #: ../src/guestfs.pod:629
1250 "We don't try to \"object orientify\" parts of the API in OO languages, "
1251 "although contributors are welcome to write higher level APIs above what we "
1252 "provide in their favourite languages if they wish."
1256 #: ../src/guestfs.pod:635
1261 #: ../src/guestfs.pod:637
1263 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1264 "identical to the C API. C++ classes and exceptions are not used."
1268 #: ../src/guestfs.pod:641
1273 #: ../src/guestfs.pod:643
1275 "The C# bindings are highly experimental. Please read the warnings at the "
1276 "top of C<csharp/Libguestfs.cs>."
1280 #: ../src/guestfs.pod:646
1285 #: ../src/guestfs.pod:648
1287 "This is the only language binding that is working but incomplete. Only "
1288 "calls which return simple integers have been bound in Haskell, and we are "
1289 "looking for help to complete this binding."
1293 #: ../src/guestfs.pod:652
1298 #: ../src/guestfs.pod:654
1300 "Full documentation is contained in the Javadoc which is distributed with "
1305 #: ../src/guestfs.pod:657
1310 #: ../src/guestfs.pod:659
1311 msgid "For documentation see L<guestfs-ocaml(3)>."
1315 #: ../src/guestfs.pod:661
1320 #: ../src/guestfs.pod:663
1321 msgid "For documentation see L<Sys::Guestfs(3)>."
1325 #: ../src/guestfs.pod:665
1330 #: ../src/guestfs.pod:667
1332 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1333 "the php-libguestfs package for your distribution."
1337 #: ../src/guestfs.pod:670
1338 msgid "The PHP binding only works correctly on 64 bit machines."
1342 #: ../src/guestfs.pod:672
1347 #: ../src/guestfs.pod:674
1348 msgid "For documentation see L<guestfs-python(3)>."
1352 #: ../src/guestfs.pod:676
1357 #: ../src/guestfs.pod:678
1358 msgid "For documentation see L<guestfs-ruby(3)>."
1362 #: ../src/guestfs.pod:680
1363 msgid "B<shell scripts>"
1367 #: ../src/guestfs.pod:682
1368 msgid "For documentation see L<guestfish(1)>."
1372 #: ../src/guestfs.pod:686
1373 msgid "LIBGUESTFS GOTCHAS"
1377 #: ../src/guestfs.pod:688
1379 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1380 "system [...] that works in the way it is documented but is counterintuitive "
1381 "and almost invites mistakes.\""
1385 #: ../src/guestfs.pod:692
1387 "Since we developed libguestfs and the associated tools, there are several "
1388 "things we would have designed differently, but are now stuck with for "
1389 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1390 "release, you can expect these to change. Beware of them."
1394 #: ../src/guestfs.pod:700
1395 msgid "Autosync / forgetting to sync."
1399 #: ../src/guestfs.pod:702
1401 "When modifying a filesystem from C or another language, you B<must> unmount "
1402 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1403 "libguestfs handle. You can also call:"
1407 #: ../src/guestfs.pod:706
1410 " guestfs_set_autosync (g, 1);\n"
1415 #: ../src/guestfs.pod:708
1417 "to have the unmount/sync done automatically for you when the handle 'g' is "
1418 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1423 #: ../src/guestfs.pod:712
1425 "If you forget to do this, then it is entirely possible that your changes "
1426 "won't be written out, or will be partially written, or (very rarely) that "
1427 "you'll get disk corruption."
1431 #: ../src/guestfs.pod:716
1433 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1434 "guestfish scripts that forget to sync will work just fine, which can make "
1435 "this very puzzling if you are trying to debug a problem."
1439 #: ../src/guestfs.pod:720
1441 "Update: Autosync is enabled by default for all API users starting from "
1442 "libguestfs 1.5.24."
1446 #: ../src/guestfs.pod:723
1447 msgid "Mount option C<-o sync> should not be the default."
1451 #: ../src/guestfs.pod:725
1453 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1454 "However C<-o sync> does not add any reliability benefit, but does have a "
1455 "very large performance impact."
1459 #: ../src/guestfs.pod:729
1461 "The work around is to use L</guestfs_mount_options> and set the mount "
1462 "options that you actually want to use."
1466 #: ../src/guestfs.pod:732
1467 msgid "Read-only should be the default."
1471 #: ../src/guestfs.pod:734
1473 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1474 "specify I<--rw> if you want to make changes to the image."
1478 #: ../src/guestfs.pod:737
1479 msgid "This would reduce the potential to corrupt live VM images."
1483 #: ../src/guestfs.pod:739
1485 "Note that many filesystems change the disk when you just mount and unmount, "
1486 "even if you didn't perform any writes. You need to use "
1487 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1491 #: ../src/guestfs.pod:743
1492 msgid "guestfish command line is hard to use."
1496 #: ../src/guestfs.pod:745
1498 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1499 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1500 "exist, so it fails. In earlier versions of guestfish the error message was "
1501 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1502 "we should have used C<guestfish -c command> to run commands."
1506 #: ../src/guestfs.pod:752
1507 msgid "guestfish megabyte modifiers don't work right on all commands"
1511 #: ../src/guestfs.pod:754
1513 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1514 "other modifiers). What guestfish actually does is to multiply the number "
1515 "part by the modifier part and pass the result to the C API. However this "
1516 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1517 "expecting some other unit (eg. megabytes)."
1521 #: ../src/guestfs.pod:761
1522 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1526 #: ../src/guestfs.pod:763
1529 " lvcreate LV VG 100M\n"
1534 #: ../src/guestfs.pod:765
1536 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1537 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1538 "megabytes * megabytes) logical volume. The error message you get from this "
1539 "is also a little obscure."
1543 #: ../src/guestfs.pod:770
1545 "This could be fixed in the generator by specially marking parameters and "
1546 "return values which take bytes or other units."
1550 #: ../src/guestfs.pod:773
1551 msgid "Ambiguity between devices and paths"
1555 #: ../src/guestfs.pod:775
1557 "There is a subtle ambiguity in the API between a device name "
1558 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1559 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1563 #: ../src/guestfs.pod:780
1565 "In the current API we usually resolve this ambiguity by having two separate "
1566 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1567 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1568 "detecting if the path supplied begins with C</dev/>."
1572 #: ../src/guestfs.pod:786
1574 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1575 "make paths/devices into structured names. One way to do this would be to "
1576 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1577 "aspect of grub. Another way would be to use a structured type, equivalent "
1578 "to this OCaml type:"
1582 #: ../src/guestfs.pod:792
1585 " type path = Path of string | Device of int | Partition of int * int\n"
1590 #: ../src/guestfs.pod:794
1591 msgid "which would allow you to pass arguments like:"
1595 #: ../src/guestfs.pod:796
1598 " Path \"/foo/bar\"\n"
1599 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1600 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1601 " Path \"/dev/sdb2\" (* not a device *)\n"
1606 #: ../src/guestfs.pod:801
1608 "As you can see there are still problems to resolve even with this "
1609 "representation. Also consider how it might work in guestfish."
1613 #: ../src/guestfs.pod:806
1614 msgid "PROTOCOL LIMITS"
1618 #: ../src/guestfs.pod:808
1620 "Internally libguestfs uses a message-based protocol to pass API calls and "
1621 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1622 "plenty more detail about this). The maximum message size used by the "
1623 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1624 "aware of this limit. The API calls which may be affected are individually "
1625 "documented, with a link back to this section of the documentation."
1629 #: ../src/guestfs.pod:816
1631 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1632 "a simple string. Because this string is at some point internally encoded as "
1633 "a message, the maximum size that it can return is slightly under 4 MB. If "
1634 "the requested file is larger than this then you will get an error."
1638 #: ../src/guestfs.pod:822
1640 "In order to transfer large files into and out of the guest filesystem, you "
1641 "need to use particular calls that support this. The sections L</UPLOADING> "
1642 "and L</DOWNLOADING> document how to do this."
1646 #: ../src/guestfs.pod:826
1648 "You might also consider mounting the disk image using our FUSE filesystem "
1649 "support (L<guestmount(1)>)."
1653 #: ../src/guestfs.pod:829
1654 msgid "KEYS AND PASSPHRASES"
1658 #: ../src/guestfs.pod:831
1660 "Certain libguestfs calls take a parameter that contains sensitive key "
1661 "material, passed in as a C string."
1665 #: ../src/guestfs.pod:834
1667 "In the future we would hope to change the libguestfs implementation so that "
1668 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1669 "swap. However this is I<not> done at the moment, because of the complexity "
1670 "of such an implementation."
1674 #: ../src/guestfs.pod:839
1676 "Therefore you should be aware that any key parameter you pass to libguestfs "
1677 "might end up being written out to the swap partition. If this is a concern, "
1678 "scrub the swap partition or don't use libguestfs on encrypted devices."
1682 #: ../src/guestfs.pod:844
1683 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1687 #: ../src/guestfs.pod:846
1689 "All high-level libguestfs actions are synchronous. If you want to use "
1690 "libguestfs asynchronously then you must create a thread."
1694 #: ../src/guestfs.pod:849
1696 "Only use the handle from a single thread. Either use the handle exclusively "
1697 "from one thread, or provide your own mutex so that two threads cannot issue "
1698 "calls on the same handle at the same time."
1702 #: ../src/guestfs.pod:853
1704 "See the graphical program guestfs-browser for one possible architecture for "
1705 "multithreaded programs using libvirt and libguestfs."
1709 #: ../src/guestfs.pod:856
1714 #: ../src/guestfs.pod:858
1716 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1721 #: ../src/guestfs.pod:861
1723 "By default it looks for these in the directory C<$libdir/guestfs> "
1724 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1728 #: ../src/guestfs.pod:864
1730 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1731 "to change the directories that libguestfs will search in. The value is a "
1732 "colon-separated list of paths. The current directory is I<not> searched "
1733 "unless the path contains an empty element or C<.>. For example "
1734 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1735 "then C</usr/lib/guestfs>."
1739 #: ../src/guestfs.pod:871
1740 msgid "QEMU WRAPPERS"
1744 #: ../src/guestfs.pod:873
1746 "If you want to compile your own qemu, run qemu from a non-standard location, "
1747 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1752 #: ../src/guestfs.pod:877
1754 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1755 "last command in the shell script (so that qemu replaces the shell and "
1756 "becomes the direct child of the libguestfs-using program). If you don't do "
1757 "this, then the qemu process won't be cleaned up correctly."
1761 #: ../src/guestfs.pod:882
1763 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1768 #: ../src/guestfs.pod:885
1772 " qemudir=/home/rjones/d/qemu\n"
1773 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
1779 #: ../src/guestfs.pod:889
1781 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1782 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1787 #: ../src/guestfs.pod:893
1790 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1795 #: ../src/guestfs.pod:895
1797 "Note that libguestfs also calls qemu with the -help and -version options in "
1798 "order to determine features."
1802 #: ../src/guestfs.pod:898
1803 msgid "ABI GUARANTEE"
1807 #: ../src/guestfs.pod:900
1809 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1810 "actions as outlined in this section. Although we will deprecate some "
1811 "actions, for example if they get replaced by newer calls, we will keep the "
1812 "old actions forever. This allows you the developer to program in confidence "
1813 "against the libguestfs API."
1817 #: ../src/guestfs.pod:906
1818 msgid "BLOCK DEVICE NAMING"
1822 #: ../src/guestfs.pod:908
1824 "In the kernel there is now quite a profusion of schemata for naming block "
1825 "devices (in this context, by I<block device> I mean a physical or virtual "
1826 "hard drive). The original Linux IDE driver used names starting with "
1827 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
1828 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
1829 "replacement for the old IDE driver (particularly for SATA devices) those "
1830 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
1831 "machines with paravirtualized drivers. This has created several different "
1832 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
1837 #: ../src/guestfs.pod:920
1839 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1840 "Linux kernel to access block devices. We can run a variety of appliances "
1841 "based on a variety of Linux kernels."
1845 #: ../src/guestfs.pod:924
1847 "This causes a problem for libguestfs because many API calls use device or "
1848 "partition names. Working scripts and the recipe (example) scripts that we "
1849 "make available over the internet could fail if the naming scheme changes."
1853 #: ../src/guestfs.pod:929
1855 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1856 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1857 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1858 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1862 #: ../src/guestfs.pod:935
1864 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1865 "L</guestfs_list_partitions> and similar calls return the true names of the "
1866 "devices and partitions as known to the appliance."
1870 #: ../src/guestfs.pod:940
1871 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1875 #: ../src/guestfs.pod:942
1877 "Usually this translation is transparent. However in some (very rare) cases "
1878 "you may need to know the exact algorithm. Such cases include where you use "
1879 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
1880 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
1885 #: ../src/guestfs.pod:948
1887 "The algorithm is applied only to I<parameters> which are known to be either "
1888 "device or partition names. Return values from functions such as "
1889 "L</guestfs_list_devices> are never changed."
1893 #: ../src/guestfs.pod:956
1894 msgid "Is the string a parameter which is a device or partition name?"
1898 #: ../src/guestfs.pod:960
1899 msgid "Does the string begin with C</dev/sd>?"
1903 #: ../src/guestfs.pod:964
1905 "Does the named device exist? If so, we use that device. However if I<not> "
1906 "then we continue with this algorithm."
1910 #: ../src/guestfs.pod:969
1911 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
1915 #: ../src/guestfs.pod:971
1916 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
1920 #: ../src/guestfs.pod:973
1921 msgid "If that named device exists, use it. If not, continue."
1925 #: ../src/guestfs.pod:977
1926 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
1930 #: ../src/guestfs.pod:979
1931 msgid "If that named device exists, use it. If not, return an error."
1935 #: ../src/guestfs.pod:983
1936 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
1940 #: ../src/guestfs.pod:985
1942 "Although the standard naming scheme and automatic translation is useful for "
1943 "simple programs and guestfish scripts, for larger programs it is best not to "
1944 "rely on this mechanism."
1948 #: ../src/guestfs.pod:989
1950 "Where possible for maximum future portability programs using libguestfs "
1951 "should use these future-proof techniques:"
1955 #: ../src/guestfs.pod:996
1957 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
1958 "device names, and then use those names directly."
1962 #: ../src/guestfs.pod:999
1963 msgid "Since those device names exist by definition, they will never be translated."
1967 #: ../src/guestfs.pod:1004
1969 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
1970 "filesystem labels."
1974 #: ../src/guestfs.pod:1009
1979 #: ../src/guestfs.pod:1011
1981 "This section discusses security implications of using libguestfs, "
1982 "particularly with untrusted or malicious guests or disk images."
1986 #: ../src/guestfs.pod:1014
1987 msgid "GENERAL SECURITY CONSIDERATIONS"
1991 #: ../src/guestfs.pod:1016
1993 "Be careful with any files or data that you download from a guest (by "
1994 "\"download\" we mean not just the L</guestfs_download> command but any "
1995 "command that reads files, filenames, directories or anything else from a "
1996 "disk image). An attacker could manipulate the data to fool your program "
1997 "into doing the wrong thing. Consider cases such as:"
2001 #: ../src/guestfs.pod:1026
2002 msgid "the data (file etc) not being present"
2006 #: ../src/guestfs.pod:1030
2007 msgid "being present but empty"
2011 #: ../src/guestfs.pod:1034
2012 msgid "being much larger than normal"
2016 #: ../src/guestfs.pod:1038
2017 msgid "containing arbitrary 8 bit data"
2021 #: ../src/guestfs.pod:1042
2022 msgid "being in an unexpected character encoding"
2026 #: ../src/guestfs.pod:1046
2027 msgid "containing homoglyphs."
2031 #: ../src/guestfs.pod:1050
2032 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2036 #: ../src/guestfs.pod:1052
2038 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2039 "(VFS) module can sometimes be escalated into exploits by deliberately "
2040 "creating a malicious, malformed filesystem. These exploits are very severe "
2041 "for two reasons. Firstly there are very many filesystem drivers in the "
2042 "kernel, and many of them are infrequently used and not much developer "
2043 "attention has been paid to the code. Linux userspace helps potential "
2044 "crackers by detecting the filesystem type and automatically choosing the "
2045 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2046 "the administrator. Secondly, a kernel-level exploit is like a local root "
2047 "exploit (worse in some ways), giving immediate and total access to the "
2048 "system right down to the hardware level."
2052 #: ../src/guestfs.pod:1065
2054 "That explains why you should never mount a filesystem from an untrusted "
2055 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2056 "inside a qemu virtual machine, usually running as a non-root user. The "
2057 "attacker would need to write a filesystem which first exploited the kernel, "
2058 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2059 "the libguestfs protocol, and finally to be as serious as the host kernel "
2060 "exploit it would need to escalate its privileges to root. This multi-step "
2061 "escalation, performed by a static piece of data, is thought to be extremely "
2062 "hard to do, although we never say 'never' about security issues."
2066 #: ../src/guestfs.pod:1076
2068 "In any case callers can reduce the attack surface by forcing the filesystem "
2069 "type when mounting (use L</guestfs_mount_vfs>)."
2073 #: ../src/guestfs.pod:1079
2074 msgid "PROTOCOL SECURITY"
2078 #: ../src/guestfs.pod:1081
2080 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2081 "defined upper message size. However a program that uses libguestfs must "
2082 "also take care - for example you can write a program that downloads a binary "
2083 "from a disk image and executes it locally, and no amount of protocol "
2084 "security will save you from the consequences."
2088 #: ../src/guestfs.pod:1087
2089 msgid "INSPECTION SECURITY"
2093 #: ../src/guestfs.pod:1089
2095 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2096 "directly from the guest, and these could contain any 8 bit data. Callers "
2097 "should be careful to escape these before printing them to a structured file "
2098 "(for example, use HTML escaping if creating a web page)."
2102 #: ../src/guestfs.pod:1095
2104 "Guest configuration may be altered in unusual ways by the administrator of "
2105 "the virtual machine, and may not reflect reality (particularly for untrusted "
2106 "or actively malicious guests). For example we parse the hostname from "
2107 "configuration files like C</etc/sysconfig/network> that we find in the "
2108 "guest, but the guest administrator can easily manipulate these files to "
2109 "provide the wrong hostname."
2113 #: ../src/guestfs.pod:1103
2115 "The inspection API parses guest configuration using two external libraries: "
2116 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2117 "designed to be robust in the face of malicious data, although denial of "
2118 "service attacks are still possible, for example with oversized configuration "
2123 #: ../src/guestfs.pod:1109
2124 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2128 #: ../src/guestfs.pod:1111
2130 "Be very cautious about running commands from the guest. By running a "
2131 "command in the guest, you are giving CPU time to a binary that you do not "
2132 "control, under the same user account as the library, albeit wrapped in qemu "
2133 "virtualization. More information and alternatives can be found in the "
2134 "section L</RUNNING COMMANDS>."
2138 #: ../src/guestfs.pod:1117
2139 msgid "CVE-2010-3851"
2143 #: ../src/guestfs.pod:1119
2144 msgid "https://bugzilla.redhat.com/642934"
2148 #: ../src/guestfs.pod:1121
2150 "This security bug concerns the automatic disk format detection that qemu "
2151 "does on disk images."
2155 #: ../src/guestfs.pod:1124
2157 "A raw disk image is just the raw bytes, there is no header. Other disk "
2158 "images like qcow2 contain a special header. Qemu deals with this by looking "
2159 "for one of the known headers, and if none is found then assuming the disk "
2160 "image must be raw."
2164 #: ../src/guestfs.pod:1129
2166 "This allows a guest which has been given a raw disk image to write some "
2167 "other header. At next boot (or when the disk image is accessed by "
2168 "libguestfs) qemu would do autodetection and think the disk image format was, "
2169 "say, qcow2 based on the header written by the guest."
2173 #: ../src/guestfs.pod:1134
2175 "This in itself would not be a problem, but qcow2 offers many features, one "
2176 "of which is to allow a disk image to refer to another image (called the "
2177 "\"backing disk\"). It does this by placing the path to the backing disk "
2178 "into the qcow2 header. This path is not validated and could point to any "
2179 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2180 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2181 "control of the attacker."
2185 #: ../src/guestfs.pod:1142
2186 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
2190 #: ../src/guestfs.pod:1149
2191 msgid "You have enabled the network or have opened the disk in write mode."
2195 #: ../src/guestfs.pod:1153
2197 "You are also running untrusted code from the guest (see L</RUNNING "
2202 #: ../src/guestfs.pod:1158
2204 "The way to avoid this is to specify the expected disk format when adding "
2205 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2206 "should always do this if the disk is raw format, and it's a good idea for "
2211 #: ../src/guestfs.pod:1163
2213 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2214 "format is fetched from libvirt and passed through."
2218 #: ../src/guestfs.pod:1166
2220 "For libguestfs tools, use the I<--format> command line parameter as "
2225 #: ../src/guestfs.pod:1169
2226 msgid "CONNECTION MANAGEMENT"
2230 #: ../src/guestfs.pod:1171
2235 #: ../src/guestfs.pod:1173
2237 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2238 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2239 "handle and release all resources used."
2243 #: ../src/guestfs.pod:1177
2245 "For information on using multiple handles and threads, see the section "
2246 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2250 #: ../src/guestfs.pod:1180
2251 msgid "guestfs_create"
2255 #: ../src/guestfs.pod:1182
2258 " guestfs_h *guestfs_create (void);\n"
2263 #: ../src/guestfs.pod:1184
2264 msgid "Create a connection handle."
2268 #: ../src/guestfs.pod:1186
2270 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2271 "on the handle at least once."
2275 #: ../src/guestfs.pod:1189
2277 "This function returns a non-NULL pointer to a handle on success or NULL on "
2282 #: ../src/guestfs.pod:1192
2283 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2287 #: ../src/guestfs.pod:1194
2289 "You may also want to configure error handling for the handle. See L</ERROR "
2290 "HANDLING> section below."
2294 #: ../src/guestfs.pod:1197
2295 msgid "guestfs_close"
2299 #: ../src/guestfs.pod:1199
2302 " void guestfs_close (guestfs_h *g);\n"
2307 #: ../src/guestfs.pod:1201
2308 msgid "This closes the connection handle and frees up all resources used."
2312 #: ../src/guestfs.pod:1203
2313 msgid "ERROR HANDLING"
2317 #: ../src/guestfs.pod:1205
2319 "API functions can return errors. For example, almost all functions that "
2320 "return C<int> will return C<-1> to indicate an error."
2324 #: ../src/guestfs.pod:1208
2326 "Additional information is available for errors: an error message string and "
2327 "optionally an error number (errno) if the thing that failed was a system "
2332 #: ../src/guestfs.pod:1212
2334 "You can get at the additional information about the last error on the handle "
2335 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2336 "up an error handler with L</guestfs_set_error_handler>."
2340 #: ../src/guestfs.pod:1217
2342 "When the handle is created, a default error handler is installed which "
2343 "prints the error message string to C<stderr>. For small short-running "
2344 "command line programs it is sufficient to do:"
2348 #: ../src/guestfs.pod:1221
2351 " if (guestfs_launch (g) == -1)\n"
2352 " exit (EXIT_FAILURE);\n"
2357 #: ../src/guestfs.pod:1224
2359 "since the default error handler will ensure that an error message has been "
2360 "printed to C<stderr> before the program exits."
2364 #: ../src/guestfs.pod:1227
2366 "For other programs the caller will almost certainly want to install an "
2367 "alternate error handler or do error handling in-line like this:"
2371 #: ../src/guestfs.pod:1230
2374 " g = guestfs_create ();\n"
2379 #: ../src/guestfs.pod:1232
2382 " /* This disables the default behaviour of printing errors\n"
2384 " guestfs_set_error_handler (g, NULL, NULL);\n"
2389 #: ../src/guestfs.pod:1236
2392 " if (guestfs_launch (g) == -1) {\n"
2393 " /* Examine the error message and print it etc. */\n"
2394 " char *msg = guestfs_last_error (g);\n"
2395 " int errnum = guestfs_last_errno (g);\n"
2396 " fprintf (stderr, \"%s\\n\", msg);\n"
2403 #: ../src/guestfs.pod:1244
2405 "Out of memory errors are handled differently. The default action is to call "
2406 "L<abort(3)>. If this is undesirable, then you can set a handler using "
2407 "L</guestfs_set_out_of_memory_handler>."
2411 #: ../src/guestfs.pod:1248
2413 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2414 "because there is no handle if this happens there is no way to get additional "
2415 "error information. However L</guestfs_create> is supposed to be a "
2416 "lightweight operation which can only fail because of insufficient memory (it "
2417 "returns NULL in this case)."
2421 #: ../src/guestfs.pod:1254
2422 msgid "guestfs_last_error"
2426 #: ../src/guestfs.pod:1256
2429 " const char *guestfs_last_error (guestfs_h *g);\n"
2434 #: ../src/guestfs.pod:1258
2436 "This returns the last error message that happened on C<g>. If there has not "
2437 "been an error since the handle was created, then this returns C<NULL>."
2441 #: ../src/guestfs.pod:1262
2443 "The lifetime of the returned string is until the next error occurs, or "
2444 "L</guestfs_close> is called."
2448 #: ../src/guestfs.pod:1265
2449 msgid "guestfs_last_errno"
2453 #: ../src/guestfs.pod:1267
2456 " int guestfs_last_errno (guestfs_h *g);\n"
2461 #: ../src/guestfs.pod:1269
2462 msgid "This returns the last error number (errno) that happened on C<g>."
2466 #: ../src/guestfs.pod:1271
2467 msgid "If successful, an errno integer not equal to zero is returned."
2471 #: ../src/guestfs.pod:1273
2472 msgid "If no error, this returns 0. This call can return 0 in three situations:"
2476 #: ../src/guestfs.pod:1280
2477 msgid "There has not been any error on the handle."
2481 #: ../src/guestfs.pod:1284
2483 "There has been an error but the errno was meaningless. This corresponds to "
2484 "the case where the error did not come from a failed system call, but for "
2485 "some other reason."
2489 #: ../src/guestfs.pod:1290
2491 "There was an error from a failed system call, but for some reason the errno "
2492 "was not captured and returned. This usually indicates a bug in libguestfs."
2496 #: ../src/guestfs.pod:1296
2498 "Libguestfs tries to convert the errno from inside the applicance into a "
2499 "corresponding errno for the caller (not entirely trivial: the appliance "
2500 "might be running a completely different operating system from the library "
2501 "and error numbers are not standardized across Un*xen). If this could not be "
2502 "done, then the error is translated to C<EINVAL>. In practice this should "
2503 "only happen in very rare circumstances."
2507 #: ../src/guestfs.pod:1304
2508 msgid "guestfs_set_error_handler"
2512 #: ../src/guestfs.pod:1306
2515 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2517 " const char *msg);\n"
2518 " void guestfs_set_error_handler (guestfs_h *g,\n"
2519 " guestfs_error_handler_cb cb,\n"
2525 #: ../src/guestfs.pod:1313
2527 "The callback C<cb> will be called if there is an error. The parameters "
2528 "passed to the callback are an opaque data pointer and the error message "
2533 #: ../src/guestfs.pod:1317
2535 "C<errno> is not passed to the callback. To get that the callback must call "
2536 "L</guestfs_last_errno>."
2540 #: ../src/guestfs.pod:1320
2542 "Note that the message string C<msg> is freed as soon as the callback "
2543 "function returns, so if you want to stash it somewhere you must make your "
2548 #: ../src/guestfs.pod:1324
2549 msgid "The default handler prints messages on C<stderr>."
2553 #: ../src/guestfs.pod:1326
2554 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2558 #: ../src/guestfs.pod:1328
2559 msgid "guestfs_get_error_handler"
2563 #: ../src/guestfs.pod:1330
2566 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2567 " void **opaque_rtn);\n"
2572 #: ../src/guestfs.pod:1333
2573 msgid "Returns the current error handler callback."
2577 #: ../src/guestfs.pod:1335
2578 msgid "guestfs_set_out_of_memory_handler"
2582 #: ../src/guestfs.pod:1337
2585 " typedef void (*guestfs_abort_cb) (void);\n"
2586 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2587 " guestfs_abort_cb);\n"
2592 #: ../src/guestfs.pod:1341
2594 "The callback C<cb> will be called if there is an out of memory situation. "
2595 "I<Note this callback must not return>."
2599 #: ../src/guestfs.pod:1344
2600 msgid "The default is to call L<abort(3)>."
2604 #: ../src/guestfs.pod:1346
2605 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2609 #: ../src/guestfs.pod:1349
2610 msgid "guestfs_get_out_of_memory_handler"
2614 #: ../src/guestfs.pod:1351
2617 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2622 #: ../src/guestfs.pod:1353
2623 msgid "This returns the current out of memory handler."
2627 #: ../src/guestfs.pod:1355
2632 #: ../src/guestfs.pod:1357 ../fish/guestfish.pod:908
2637 #: ../src/guestfs.pod:1359
2642 #: ../src/guestfs.pod:1361
2647 #: ../src/guestfs.pod:1363
2648 msgid "AVAILABILITY"
2652 #: ../src/guestfs.pod:1365
2653 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2657 #: ../src/guestfs.pod:1367
2659 "Using L</guestfs_available> you can test availability of the following "
2660 "groups of functions. This test queries the appliance to see if the "
2661 "appliance you are currently using supports the functionality."
2665 #: ../src/guestfs.pod:1372
2666 msgid "@AVAILABILITY@"
2670 #: ../src/guestfs.pod:1374
2671 msgid "GUESTFISH supported COMMAND"
2675 #: ../src/guestfs.pod:1376
2677 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2678 "prints out the available groups and whether they are supported by this build "
2679 "of libguestfs. Note however that you have to do C<run> first."
2683 #: ../src/guestfs.pod:1381
2684 msgid "SINGLE CALLS AT COMPILE TIME"
2688 #: ../src/guestfs.pod:1383
2690 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2691 "function, such as:"
2695 #: ../src/guestfs.pod:1386
2698 " #define LIBGUESTFS_HAVE_DD 1\n"
2703 #: ../src/guestfs.pod:1388
2704 msgid "if L</guestfs_dd> is available."
2708 #: ../src/guestfs.pod:1390
2710 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2711 "function is available at compile time, we recommended using build tools such "
2712 "as autoconf or cmake. For example in autotools you could use:"
2716 #: ../src/guestfs.pod:1395
2719 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2720 " AC_CHECK_FUNCS([guestfs_dd])\n"
2725 #: ../src/guestfs.pod:1398
2727 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2732 #: ../src/guestfs.pod:1401
2733 msgid "SINGLE CALLS AT RUN TIME"
2737 #: ../src/guestfs.pod:1403
2739 "Testing at compile time doesn't guarantee that a function really exists in "
2740 "the library. The reason is that you might be dynamically linked against a "
2741 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2742 "This situation unfortunately results in a segmentation fault, which is a "
2743 "shortcoming of the C dynamic linking system itself."
2747 #: ../src/guestfs.pod:1410
2749 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2750 "in this example program (note that you still need the compile time check as "
2755 #: ../src/guestfs.pod:1414
2758 " #include <stdio.h>\n"
2759 " #include <stdlib.h>\n"
2760 " #include <unistd.h>\n"
2761 " #include <dlfcn.h>\n"
2762 " #include <guestfs.h>\n"
2767 #: ../src/guestfs.pod:1420
2772 " #ifdef LIBGUESTFS_HAVE_DD\n"
2774 " int has_function;\n"
2779 #: ../src/guestfs.pod:1426
2782 " /* Test if the function guestfs_dd is really available. */\n"
2783 " dl = dlopen (NULL, RTLD_LAZY);\n"
2785 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2786 " exit (EXIT_FAILURE);\n"
2788 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2794 #: ../src/guestfs.pod:1435
2797 " if (!has_function)\n"
2798 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2800 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2801 " /* Now it's safe to call\n"
2802 " guestfs_dd (g, \"foo\", \"bar\");\n"
2806 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2813 #: ../src/guestfs.pod:1448
2815 "You may think the above is an awful lot of hassle, and it is. There are "
2816 "other ways outside of the C linking system to ensure that this kind of "
2817 "incompatibility never arises, such as using package versioning:"
2821 #: ../src/guestfs.pod:1453
2824 " Requires: libguestfs >= 1.0.80\n"
2829 #: ../src/guestfs.pod:1455
2830 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2834 #: ../src/guestfs.pod:1457
2836 "A recent feature of the API is the introduction of calls which take optional "
2837 "arguments. In C these are declared 3 ways. The main way is as a call which "
2838 "takes variable arguments (ie. C<...>), as in this example:"
2842 #: ../src/guestfs.pod:1462
2845 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2850 #: ../src/guestfs.pod:1464
2852 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2853 "call with no optional arguments specified:"
2857 #: ../src/guestfs.pod:1467
2860 " guestfs_add_drive_opts (g, filename, -1);\n"
2865 #: ../src/guestfs.pod:1469
2866 msgid "With a single optional argument:"
2870 #: ../src/guestfs.pod:1471
2873 " guestfs_add_drive_opts (g, filename,\n"
2874 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2880 #: ../src/guestfs.pod:1475
2885 #: ../src/guestfs.pod:1477
2888 " guestfs_add_drive_opts (g, filename,\n"
2889 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2890 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2896 #: ../src/guestfs.pod:1482
2898 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2903 #: ../src/guestfs.pod:1485
2904 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2908 #: ../src/guestfs.pod:1487
2910 "The second variant has the same name with the suffix C<_va>, which works the "
2911 "same way but takes a C<va_list>. See the C manual for details. For the "
2912 "example function, this is declared:"
2916 #: ../src/guestfs.pod:1491
2919 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2925 #: ../src/guestfs.pod:1494
2926 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2930 #: ../src/guestfs.pod:1496
2932 "The third variant is useful where you need to construct these calls. You "
2933 "pass in a structure where you fill in the optional fields. The structure "
2934 "has a bitmask as the first element which you must set to indicate which "
2935 "fields you have filled in. For our example function the structure and call "
2940 #: ../src/guestfs.pod:1502
2943 " struct guestfs_add_drive_opts_argv {\n"
2944 " uint64_t bitmask;\n"
2946 " const char *format;\n"
2949 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
2950 " const struct guestfs_add_drive_opts_argv *optargs);\n"
2955 #: ../src/guestfs.pod:1511
2956 msgid "You could call it like this:"
2960 #: ../src/guestfs.pod:1513
2963 " struct guestfs_add_drive_opts_argv optargs = {\n"
2964 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
2965 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
2967 " .format = \"qcow2\"\n"
2973 #: ../src/guestfs.pod:1520
2976 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
2981 #: ../src/guestfs.pod:1522 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1255
2986 #: ../src/guestfs.pod:1528
2987 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
2991 #: ../src/guestfs.pod:1533
2992 msgid "You do not need to fill in all fields of the structure."
2996 #: ../src/guestfs.pod:1537
2998 "There must be a one-to-one correspondence between fields of the structure "
2999 "that are filled in, and bits set in the bitmask."
3003 #: ../src/guestfs.pod:1542
3004 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3008 #: ../src/guestfs.pod:1544
3010 "In other languages, optional arguments are expressed in the way that is "
3011 "natural for that language. We refer you to the language-specific "
3012 "documentation for more details on that."
3016 #: ../src/guestfs.pod:1548
3017 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3021 #: ../src/guestfs.pod:1550
3022 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3026 #: ../src/guestfs.pod:1552
3028 "The child process generates events in some situations. Current events "
3029 "include: receiving a log message, the child process exits."
3033 #: ../src/guestfs.pod:1555
3035 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3040 #: ../src/guestfs.pod:1558
3042 "Only I<one callback of each type> can be registered for each handle. "
3043 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3044 "that type. Cancel all callbacks of this type by calling this function with "
3045 "C<cb> set to C<NULL>."
3049 #: ../src/guestfs.pod:1563
3050 msgid "guestfs_set_log_message_callback"
3054 #: ../src/guestfs.pod:1565
3057 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3058 " char *buf, int len);\n"
3059 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3060 " guestfs_log_message_cb cb,\n"
3066 #: ../src/guestfs.pod:1571
3068 "The callback function C<cb> will be called whenever qemu or the guest writes "
3069 "anything to the console."
3073 #: ../src/guestfs.pod:1574
3074 msgid "Use this function to capture kernel messages and similar."
3078 #: ../src/guestfs.pod:1576
3080 "Normally there is no log message handler, and log messages are just "
3085 #: ../src/guestfs.pod:1579
3086 msgid "guestfs_set_subprocess_quit_callback"
3090 #: ../src/guestfs.pod:1581
3093 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3094 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3095 " guestfs_subprocess_quit_cb cb,\n"
3101 #: ../src/guestfs.pod:1586
3103 "The callback function C<cb> will be called when the child process quits, "
3104 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3105 "corresponds to a transition from any state to the CONFIG state)."
3109 #: ../src/guestfs.pod:1591
3110 msgid "guestfs_set_launch_done_callback"
3114 #: ../src/guestfs.pod:1593
3117 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3118 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3119 " guestfs_launch_done_cb cb,\n"
3125 #: ../src/guestfs.pod:1598
3127 "The callback function C<cb> will be called when the child process becomes "
3128 "ready first time after it has been launched. (This corresponds to a "
3129 "transition from LAUNCHING to the READY state)."
3133 #: ../src/guestfs.pod:1602
3134 msgid "guestfs_set_close_callback"
3138 #: ../src/guestfs.pod:1604
3141 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3142 " void guestfs_set_close_callback (guestfs_h *g,\n"
3143 " guestfs_close_cb cb,\n"
3149 #: ../src/guestfs.pod:1609
3151 "The callback function C<cb> will be called while the handle is being closed "
3152 "(synchronously from L</guestfs_close>)."
3156 #: ../src/guestfs.pod:1612
3158 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3159 "handles that are open when the program exits. This means that this callback "
3160 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3161 "problems in higher-level languages (eg. if your HLL interpreter has already "
3162 "been cleaned up by the time this is called, and if your callback then jumps "
3163 "into some HLL function)."
3167 #: ../src/guestfs.pod:1620
3168 msgid "guestfs_set_progress_callback"
3172 #: ../src/guestfs.pod:1622
3175 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3176 " int proc_nr, int serial,\n"
3177 " uint64_t position, uint64_t total);\n"
3178 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3179 " guestfs_progress_cb cb,\n"
3185 #: ../src/guestfs.pod:1629
3187 "Some long-running operations can generate progress messages. If this "
3188 "callback is registered, then it will be called each time a progress message "
3189 "is generated (usually two seconds after the operation started, and three "
3190 "times per second thereafter until it completes, although the frequency may "
3191 "change in future versions)."
3195 #: ../src/guestfs.pod:1635
3197 "The callback receives two numbers: C<position> and C<total>. The units of "
3198 "C<total> are not defined, although for some operations C<total> may relate "
3199 "in some way to the amount of data to be transferred (eg. in bytes or "
3200 "megabytes), and C<position> may be the portion which has been transferred."
3204 #: ../src/guestfs.pod:1641
3205 msgid "The only defined and stable parts of the API are:"
3209 #: ../src/guestfs.pod:1647
3211 "The callback can display to the user some type of progress bar or indicator "
3212 "which shows the ratio of C<position>:C<total>."
3216 #: ../src/guestfs.pod:1652
3217 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3221 #: ../src/guestfs.pod:1656
3223 "If any progress notification is sent during a call, then a final progress "
3224 "notification is always sent when C<position> = C<total>."
3228 #: ../src/guestfs.pod:1659
3230 "This is to simplify caller code, so callers can easily set the progress "
3231 "indicator to \"100%\" at the end of the operation, without requiring special "
3232 "code to detect this case."
3236 #: ../src/guestfs.pod:1665
3238 "The callback also receives the procedure number and serial number of the "
3239 "call. These are only useful for debugging protocol issues, and the callback "
3240 "can normally ignore them. The callback may want to print these numbers in "
3241 "error messages or debugging messages."
3245 #: ../src/guestfs.pod:1670
3246 msgid "PRIVATE DATA AREA"
3250 #: ../src/guestfs.pod:1672
3252 "You can attach named pieces of private data to the libguestfs handle, and "
3253 "fetch them by name for the lifetime of the handle. This is called the "
3254 "private data area and is only available from the C API."
3258 #: ../src/guestfs.pod:1676
3259 msgid "To attach a named piece of data, use the following call:"
3263 #: ../src/guestfs.pod:1678
3266 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3271 #: ../src/guestfs.pod:1680
3273 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3274 "pointer (which can be C<NULL>). Any previous item with the same name is "
3279 #: ../src/guestfs.pod:1684
3281 "You can use any C<key> you want, but names beginning with an underscore "
3282 "character are reserved for internal libguestfs purposes (for implementing "
3283 "language bindings). It is recommended to prefix the name with some unique "
3284 "string to avoid collisions with other users."
3288 #: ../src/guestfs.pod:1689
3289 msgid "To retrieve the pointer, use:"
3293 #: ../src/guestfs.pod:1691
3296 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3301 #: ../src/guestfs.pod:1693
3303 "This function returns C<NULL> if either no data is found associated with "
3304 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3309 #: ../src/guestfs.pod:1697
3311 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3312 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3313 "all. In particular, libguestfs does I<not> try to free the data when the "
3314 "handle is closed. If the data must be freed, then the caller must either "
3315 "free it before calling L</guestfs_close> or must set up a close callback to "
3316 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3317 "can be registered for a handle)."
3321 #: ../src/guestfs.pod:1705
3323 "The private data area is implemented using a hash table, and should be "
3324 "reasonably efficient for moderate numbers of keys."
3328 #: ../src/guestfs.pod:1708 ../src/guestfs.pod:1713
3333 #: ../src/guestfs.pod:1710
3335 "<!-- old anchor for the next section --> <a "
3336 "name=\"state_machine_and_low_level_event_api\"/>"
3340 #: ../src/guestfs.pod:1715
3341 msgid "ARCHITECTURE"
3345 #: ../src/guestfs.pod:1717
3347 "Internally, libguestfs is implemented by running an appliance (a special "
3348 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3349 "process of the main program."
3353 #: ../src/guestfs.pod:1721
3356 " ___________________\n"
3358 " | main program |\n"
3360 " | | child process / appliance\n"
3361 " | | __________________________\n"
3363 " +-------------------+ RPC | +-----------------+ |\n"
3364 " | libguestfs <--------------------> guestfsd | |\n"
3365 " | | | +-----------------+ |\n"
3366 " \\___________________/ | | Linux kernel | |\n"
3367 " | +--^--------------+ |\n"
3368 " \\_________|________________/\n"
3374 " \\______________/\n"
3379 #: ../src/guestfs.pod:1741
3381 "The library, linked to the main program, creates the child process and hence "
3382 "the appliance in the L</guestfs_launch> function."
3386 #: ../src/guestfs.pod:1744
3388 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3389 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3390 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3391 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3392 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3393 "attached to the qemu process which translates device access by the "
3394 "appliance's Linux kernel into accesses to the image."
3398 #: ../src/guestfs.pod:1753
3400 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3401 "Although the disk image you are attached to might also be used by some "
3402 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3403 "care if both libguestfs's qemu process and your virtual machine are trying "
3404 "to update the disk image at the same time, since these usually results in "
3405 "massive disk corruption)."
3409 #: ../src/guestfs.pod:1760
3410 msgid "STATE MACHINE"
3414 #: ../src/guestfs.pod:1762
3415 msgid "libguestfs uses a state machine to model the child process:"
3419 #: ../src/guestfs.pod:1764
3431 " / | \\ \\ guestfs_launch\n"
3432 " / | _\\__V______\n"
3434 " / | | LAUNCHING |\n"
3435 " / | \\___________/\n"
3437 " / | guestfs_launch\n"
3439 " ______ / __|____V\n"
3440 " / \\ ------> / \\\n"
3441 " | BUSY | | READY |\n"
3442 " \\______/ <------ \\________/\n"
3447 #: ../src/guestfs.pod:1786
3449 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3450 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3451 "(3) alternating between READY and BUSY as commands are issued to, and "
3452 "carried out by, the child process."
3456 #: ../src/guestfs.pod:1791
3458 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3459 "asynchronously at any time (eg. due to some internal error), and that causes "
3460 "the state to transition back to CONFIG."
3464 #: ../src/guestfs.pod:1795
3466 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3467 "issued when in the CONFIG state."
3471 #: ../src/guestfs.pod:1798
3473 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3474 "L</guestfs_launch> blocks until the child process is READY to accept "
3475 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3476 "moves the state from CONFIG to LAUNCHING while it is running."
3480 #: ../src/guestfs.pod:1804
3482 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3483 "state. These API calls block waiting for the command to be carried out "
3484 "(ie. the state to transition to BUSY and then back to READY). There are no "
3485 "non-blocking versions, and no way to issue more than one command per handle "
3490 #: ../src/guestfs.pod:1810
3492 "Finally, the child process sends asynchronous messages back to the main "
3493 "program, such as kernel log messages. You can register a callback to "
3494 "receive these messages."
3498 #: ../src/guestfs.pod:1814
3503 #: ../src/guestfs.pod:1816
3504 msgid "COMMUNICATION PROTOCOL"
3508 #: ../src/guestfs.pod:1818
3510 "Don't rely on using this protocol directly. This section documents how it "
3511 "currently works, but it may change at any time."
3515 #: ../src/guestfs.pod:1821
3517 "The protocol used to talk between the library and the daemon running inside "
3518 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3519 "1014, RFC 1832, RFC 4506)."
3523 #: ../src/guestfs.pod:1825
3525 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3526 "this file is automatically generated)."
3530 #: ../src/guestfs.pod:1828
3532 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3533 "and C<FileOut> parameters, which are handled with very simple request/reply "
3534 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3535 "parameters, which use the same request and reply messages, but they may also "
3536 "be followed by files sent using a chunked encoding."
3540 #: ../src/guestfs.pod:1835
3541 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3545 #: ../src/guestfs.pod:1837
3546 msgid "For ordinary functions, the request message is:"
3550 #: ../src/guestfs.pod:1839
3553 " total length (header + arguments,\n"
3554 " but not including the length word itself)\n"
3555 " struct guestfs_message_header (encoded as XDR)\n"
3556 " struct guestfs_<foo>_args (encoded as XDR)\n"
3561 #: ../src/guestfs.pod:1844
3563 "The total length field allows the daemon to allocate a fixed size buffer "
3564 "into which it slurps the rest of the message. As a result, the total length "
3565 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3566 "effective size of any request is limited to somewhere under this size."
3570 #: ../src/guestfs.pod:1850
3572 "Note also that many functions don't take any arguments, in which case the "
3573 "C<guestfs_I<foo>_args> is completely omitted."
3577 #: ../src/guestfs.pod:1853
3579 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3580 "receiver knows what type of args structure to expect, or none at all."
3584 #: ../src/guestfs.pod:1857
3586 "For functions that take optional arguments, the optional arguments are "
3587 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
3588 "arguments. A bitmask in the header indicates which optional arguments are "
3589 "meaningful. The bitmask is also checked to see if it contains bits set "
3590 "which the daemon does not know about (eg. if more optional arguments were "
3591 "added in a later version of the library), and this causes the call to be "
3596 #: ../src/guestfs.pod:1865
3597 msgid "The reply message for ordinary functions is:"
3601 #: ../src/guestfs.pod:1867
3604 " total length (header + ret,\n"
3605 " but not including the length word itself)\n"
3606 " struct guestfs_message_header (encoded as XDR)\n"
3607 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3612 #: ../src/guestfs.pod:1872
3614 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3615 "functions that return no formal return values."
3619 #: ../src/guestfs.pod:1875
3620 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3624 #: ../src/guestfs.pod:1878
3626 "In the case of an error, a flag is set in the header, and the reply message "
3627 "is slightly changed:"
3631 #: ../src/guestfs.pod:1881
3634 " total length (header + error,\n"
3635 " but not including the length word itself)\n"
3636 " struct guestfs_message_header (encoded as XDR)\n"
3637 " struct guestfs_message_error (encoded as XDR)\n"
3642 #: ../src/guestfs.pod:1886
3644 "The C<guestfs_message_error> structure contains the error message as a "
3649 #: ../src/guestfs.pod:1889
3650 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3654 #: ../src/guestfs.pod:1891
3656 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3657 "The normal request message is sent (see above). However this is followed by "
3658 "a sequence of file chunks."
3662 #: ../src/guestfs.pod:1895
3665 " total length (header + arguments,\n"
3666 " but not including the length word itself,\n"
3667 " and not including the chunks)\n"
3668 " struct guestfs_message_header (encoded as XDR)\n"
3669 " struct guestfs_<foo>_args (encoded as XDR)\n"
3670 " sequence of chunks for FileIn param #0\n"
3671 " sequence of chunks for FileIn param #1 etc.\n"
3676 #: ../src/guestfs.pod:1903
3677 msgid "The \"sequence of chunks\" is:"
3681 #: ../src/guestfs.pod:1905
3684 " length of chunk (not including length word itself)\n"
3685 " struct guestfs_chunk (encoded as XDR)\n"
3686 " length of chunk\n"
3687 " struct guestfs_chunk (encoded as XDR)\n"
3689 " length of chunk\n"
3690 " struct guestfs_chunk (with data.data_len == 0)\n"
3695 #: ../src/guestfs.pod:1913
3697 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3698 "is set in the final chunk to indicate either successful completion or early "
3703 #: ../src/guestfs.pod:1917
3705 "At time of writing there are no functions that have more than one FileIn "
3706 "parameter. However this is (theoretically) supported, by sending the "
3707 "sequence of chunks for each FileIn parameter one after another (from left to "
3712 #: ../src/guestfs.pod:1922
3714 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3715 "transfer. The library does this by sending a chunk with a special flag set "
3716 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3717 "RPC, does I<not> send any reply, and goes back to reading the next request."
3721 #: ../src/guestfs.pod:1928
3723 "The daemon may also cancel. It does this by writing a special word "
3724 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3725 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3726 "cancel chunk). The special word is chosen so that even if cancellation "
3727 "happens right at the end of the transfer (after the library has finished "
3728 "writing and has started listening for the reply), the \"spurious\" cancel "
3729 "flag will not be confused with the reply message."
3733 #: ../src/guestfs.pod:1937
3735 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3736 "limit), and also files where the size is not known in advance (eg. from "
3737 "pipes or sockets). However the chunks are rather small "
3738 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3739 "to keep much in memory."
3743 #: ../src/guestfs.pod:1943
3744 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3748 #: ../src/guestfs.pod:1945
3750 "The protocol for FileOut parameters is exactly the same as for FileIn "
3751 "parameters, but with the roles of daemon and library reversed."
3755 #: ../src/guestfs.pod:1948
3758 " total length (header + ret,\n"
3759 " but not including the length word itself,\n"
3760 " and not including the chunks)\n"
3761 " struct guestfs_message_header (encoded as XDR)\n"
3762 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3763 " sequence of chunks for FileOut param #0\n"
3764 " sequence of chunks for FileOut param #1 etc.\n"
3769 #: ../src/guestfs.pod:1956
3770 msgid "INITIAL MESSAGE"
3774 #: ../src/guestfs.pod:1958
3776 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3777 "which indicates that the guest and daemon is alive. This is what "
3778 "L</guestfs_launch> waits for."
3782 #: ../src/guestfs.pod:1962
3783 msgid "PROGRESS NOTIFICATION MESSAGES"
3787 #: ../src/guestfs.pod:1964
3789 "The daemon may send progress notification messages at any time. These are "
3790 "distinguished by the normal length word being replaced by "
3791 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3795 #: ../src/guestfs.pod:1968
3797 "The library turns them into progress callbacks (see "
3798 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3799 "discards them if not."
3803 #: ../src/guestfs.pod:1972
3805 "The daemon self-limits the frequency of progress messages it sends (see "
3806 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3811 #: ../src/guestfs.pod:1976
3812 msgid "LIBGUESTFS VERSION NUMBERS"
3816 #: ../src/guestfs.pod:1978
3818 "Since April 2010, libguestfs has started to make separate development and "
3819 "stable releases, along with corresponding branches in our git repository. "
3820 "These separate releases can be identified by version number:"
3824 #: ../src/guestfs.pod:1983
3827 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3828 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3834 " | `-------- sub-version\n"
3836 " `------ always '1' because we don't change the ABI\n"
3841 #: ../src/guestfs.pod:1994
3842 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3846 #: ../src/guestfs.pod:1996
3848 "As time passes we cherry pick fixes from the development branch and backport "
3849 "those into the stable branch, the effect being that the stable branch should "
3850 "get more stable and less buggy over time. So the stable releases are ideal "
3851 "for people who don't need new features but would just like the software to "
3856 #: ../src/guestfs.pod:2002
3857 msgid "Our criteria for backporting changes are:"
3861 #: ../src/guestfs.pod:2008
3863 "Documentation changes which don't affect any code are backported unless the "
3864 "documentation refers to a future feature which is not in stable."
3868 #: ../src/guestfs.pod:2014
3870 "Bug fixes which are not controversial, fix obvious problems, and have been "
3871 "well tested are backported."
3875 #: ../src/guestfs.pod:2019
3877 "Simple rearrangements of code which shouldn't affect how it works get "
3878 "backported. This is so that the code in the two branches doesn't get too "
3879 "far out of step, allowing us to backport future fixes more easily."
3883 #: ../src/guestfs.pod:2025
3885 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3886 "exceptional case: the new feature is required in order to implement an "
3887 "important bug fix."
3891 #: ../src/guestfs.pod:2031
3893 "A new stable branch starts when we think the new features in development are "
3894 "substantial and compelling enough over the current stable branch to warrant "
3895 "it. When that happens we create new stable and development versions 1.N.0 "
3896 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3897 "stable at this point, but by backporting fixes from development, that branch "
3898 "will stabilize over time."
3902 #: ../src/guestfs.pod:2039 ../fish/guestfish.pod:915 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3903 msgid "ENVIRONMENT VARIABLES"
3907 #: ../src/guestfs.pod:2043 ../fish/guestfish.pod:941
3908 msgid "LIBGUESTFS_APPEND"
3912 #: ../src/guestfs.pod:2045 ../fish/guestfish.pod:943
3913 msgid "Pass additional options to the guest kernel."
3917 #: ../src/guestfs.pod:2047 ../fish/guestfish.pod:945
3918 msgid "LIBGUESTFS_DEBUG"
3922 #: ../src/guestfs.pod:2049
3924 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3925 "effect as calling C<guestfs_set_verbose (g, 1)>."
3929 #: ../src/guestfs.pod:2052 ../fish/guestfish.pod:950
3930 msgid "LIBGUESTFS_MEMSIZE"
3934 #: ../src/guestfs.pod:2054 ../fish/guestfish.pod:952
3935 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
3939 #: ../src/guestfs.pod:2057 ../fish/guestfish.pod:955
3942 " LIBGUESTFS_MEMSIZE=700\n"
3947 #: ../src/guestfs.pod:2059 ../fish/guestfish.pod:957
3948 msgid "LIBGUESTFS_PATH"
3952 #: ../src/guestfs.pod:2061
3954 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3955 "the discussion of paths in section PATH above."
3959 #: ../src/guestfs.pod:2064 ../fish/guestfish.pod:962
3960 msgid "LIBGUESTFS_QEMU"
3964 #: ../src/guestfs.pod:2066 ../fish/guestfish.pod:964
3966 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3967 "which was found at compile time by the configure script is used."
3971 #: ../src/guestfs.pod:2070
3972 msgid "See also L</QEMU WRAPPERS> above."
3976 #: ../src/guestfs.pod:2072 ../fish/guestfish.pod:968
3977 msgid "LIBGUESTFS_TRACE"
3981 #: ../src/guestfs.pod:2074
3983 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3984 "effect as calling C<guestfs_set_trace (g, 1)>."
3988 #: ../src/guestfs.pod:2077 ../fish/guestfish.pod:977
3993 #: ../src/guestfs.pod:2079 ../fish/guestfish.pod:979
3994 msgid "Location of temporary directory, defaults to C</tmp>."
3998 #: ../src/guestfs.pod:2081 ../fish/guestfish.pod:981
4000 "If libguestfs was compiled to use the supermin appliance then the real "
4001 "appliance is cached in this directory, shared between all handles belonging "
4002 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4003 "use in case C</tmp> is not large enough."
4007 #: ../src/guestfs.pod:2089 ../fish/guestfish.pod:1039 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233 ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484 ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189 ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:257
4012 #: ../src/guestfs.pod:2091
4014 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
4015 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, "
4016 "L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
4017 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
4018 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
4019 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
4020 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
4024 #: ../src/guestfs.pod:2114
4026 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
4027 "L<lvm(8)>, L<disktype(1)>."
4031 #: ../src/guestfs.pod:2121 ../tools/virt-win-reg.pl:499 ../tools/virt-make-fs.pl:548
4036 #: ../src/guestfs.pod:2123
4037 msgid "To get a list of bugs against libguestfs use this link:"
4041 #: ../src/guestfs.pod:2125
4042 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
4046 #: ../src/guestfs.pod:2127
4047 msgid "To report a new bug against libguestfs use this link:"
4051 #: ../src/guestfs.pod:2129
4052 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
4056 #: ../src/guestfs.pod:2131
4057 msgid "When reporting a bug, please check:"
4061 #: ../src/guestfs.pod:2137
4062 msgid "That the bug hasn't been reported already."
4066 #: ../src/guestfs.pod:2141
4067 msgid "That you are testing a recent version."
4071 #: ../src/guestfs.pod:2145
4072 msgid "Describe the bug accurately, and give a way to reproduce it."
4076 #: ../src/guestfs.pod:2149
4078 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4083 #: ../src/guestfs.pod:2154 ../fish/guestfish.pod:1058 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4088 #: ../src/guestfs.pod:2156 ../fish/guestfish.pod:1060 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4089 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4093 #: ../src/guestfs.pod:2158 ../fish/guestfish.pod:1062 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248 ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:514 ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:296 ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:273
4098 #: ../src/guestfs.pod:2160 ../fish/guestfish.pod:1064 ../fuse/guestmount.pod:250
4099 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4103 #: ../src/guestfs.pod:2163
4105 "This library is free software; you can redistribute it and/or modify it "
4106 "under the terms of the GNU Lesser General Public License as published by the "
4107 "Free Software Foundation; either version 2 of the License, or (at your "
4108 "option) any later version."
4112 #: ../src/guestfs.pod:2168
4114 "This library is distributed in the hope that it will be useful, but WITHOUT "
4115 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4116 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4121 #: ../src/guestfs.pod:2173
4123 "You should have received a copy of the GNU Lesser General Public License "
4124 "along with this library; if not, write to the Free Software Foundation, "
4125 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4129 #: ../src/guestfs-actions.pod:1
4130 msgid "guestfs_add_cdrom"
4134 #: ../src/guestfs-actions.pod:3
4138 " guestfs_add_cdrom (guestfs_h *g,\n"
4139 " const char *filename);\n"
4144 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4145 msgid "This function adds a virtual CD-ROM disk image to the guest."
4149 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4150 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4154 #: ../src/guestfs-actions.pod:17
4156 "This call checks for the existence of C<filename>. This stops you from "
4157 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4158 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4163 #: ../src/guestfs-actions.pod:24
4165 "If you just want to add an ISO file (often you use this as an efficient way "
4166 "to transfer large files into the guest), then you should probably use "
4167 "C<guestfs_add_drive_ro> instead."
4171 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:128 ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:226 ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535 ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781 ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809 ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:990 ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1163 ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1326 ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1466 ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:2215 ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2420 ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3229 ../src/guestfs-actions.pod:3354 ../src/guestfs-actions.pod:3368 ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3446 ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3538 ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3633 ../src/guestfs-actions.pod:3652 ../src/guestfs-actions.pod:3671 ../src/guestfs-actions.pod:3706 ../src/guestfs-actions.pod:3718 ../src/guestfs-actions.pod:3754 ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3798 ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3928 ../src/guestfs-actions.pod:3941 ../src/guestfs-actions.pod:3992 ../src/guestfs-actions.pod:4010 ../src/guestfs-actions.pod:4028 ../src/guestfs-actions.pod:4044 ../src/guestfs-actions.pod:4058 ../src/guestfs-actions.pod:4072 ../src/guestfs-actions.pod:4089 ../src/guestfs-actions.pod:4104 ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:4168 ../src/guestfs-actions.pod:4239 ../src/guestfs-actions.pod:4270 ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:4308 ../src/guestfs-actions.pod:4320 ../src/guestfs-actions.pod:4337 ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4365 ../src/guestfs-actions.pod:4380 ../src/guestfs-actions.pod:4415 ../src/guestfs-actions.pod:4430 ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:4464 ../src/guestfs-actions.pod:4481 ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4567 ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4609 ../src/guestfs-actions.pod:4626 ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:4778 ../src/guestfs-actions.pod:4835 ../src/guestfs-actions.pod:4857 ../src/guestfs-actions.pod:4875 ../src/guestfs-actions.pod:4907 ../src/guestfs-actions.pod:4973 ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5003 ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5339 ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5365 ../src/guestfs-actions.pod:5377 ../src/guestfs-actions.pod:5391 ../src/guestfs-actions.pod:5407 ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5507 ../src/guestfs-actions.pod:5525 ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:5584 ../src/guestfs-actions.pod:5601 ../src/guestfs-actions.pod:5629 ../src/guestfs-actions.pod:5653 ../src/guestfs-actions.pod:5672 ../src/guestfs-actions.pod:5696 ../src/guestfs-actions.pod:5711 ../src/guestfs-actions.pod:5726 ../src/guestfs-actions.pod:5745 ../src/guestfs-actions.pod:5782 ../src/guestfs-actions.pod:5805 ../src/guestfs-actions.pod:5831 ../src/guestfs-actions.pod:5939 ../src/guestfs-actions.pod:6060 ../src/guestfs-actions.pod:6072 ../src/guestfs-actions.pod:6085 ../src/guestfs-actions.pod:6098 ../src/guestfs-actions.pod:6120 ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6146 ../src/guestfs-actions.pod:6159 ../src/guestfs-actions.pod:6174 ../src/guestfs-actions.pod:6233 ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6266 ../src/guestfs-actions.pod:6282 ../src/guestfs-actions.pod:6299 ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6332 ../src/guestfs-actions.pod:6368 ../src/guestfs-actions.pod:6382 ../src/guestfs-actions.pod:6423 ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:6454 ../src/guestfs-actions.pod:6488 ../src/guestfs-actions.pod:6524 ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6661 ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:6730 ../src/guestfs-actions.pod:6743 ../src/guestfs-actions.pod:6788 ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6875 ../src/guestfs-actions.pod:6901 ../src/guestfs-actions.pod:6967 ../src/guestfs-actions.pod:6986 ../src/guestfs-actions.pod:7015
4172 msgid "This function returns 0 on success or -1 on error."
4176 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:242 ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4178 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4183 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:245 ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:1437 ../src/guestfs-actions.pod:1923 ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:4129 ../src/guestfs-actions.pod:6909 ../src/guestfs-actions.pod:7078 ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:156 ../fish/guestfish-actions.pod:170 ../fish/guestfish-actions.pod:951 ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1322 ../fish/guestfish-actions.pod:2778 ../fish/guestfish-actions.pod:4580 ../fish/guestfish-actions.pod:4677
4185 "Deprecated functions will not be removed from the API, but the fact that "
4186 "they are deprecated indicates that there are problems with correct use of "
4191 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:130 ../src/guestfs-actions.pod:1094 ../src/guestfs-actions.pod:1895 ../src/guestfs-actions.pod:1993 ../src/guestfs-actions.pod:2096 ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3211 ../src/guestfs-actions.pod:4417 ../src/guestfs-actions.pod:5486 ../src/guestfs-actions.pod:5603 ../src/guestfs-actions.pod:5713 ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6301 ../src/guestfs-actions.pod:6823
4192 msgid "(Added in 0.3)"
4196 #: ../src/guestfs-actions.pod:41
4197 msgid "guestfs_add_domain"
4201 #: ../src/guestfs-actions.pod:43
4205 " guestfs_add_domain (guestfs_h *g,\n"
4206 " const char *dom,\n"
4212 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:139 ../src/guestfs-actions.pod:4143
4214 "You may supply a list of optional arguments to this call. Use zero or more "
4215 "of the following pairs of parameters, and terminate the list with C<-1> on "
4216 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4220 #: ../src/guestfs-actions.pod:53
4223 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4224 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4225 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4230 #: ../src/guestfs-actions.pod:57
4232 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4233 "It works by connecting to libvirt, requesting the domain and domain XML from "
4234 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4239 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4241 "The number of disks added is returned. This operation is atomic: if an "
4242 "error is returned, then no disks are added."
4246 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4248 "This function does some minimal checks to make sure the libvirt domain is "
4249 "not running (unless C<readonly> is true). In a future version we will try "
4250 "to acquire the libvirt lock on each disk."
4254 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4256 "Disks must be accessible locally. This often means that adding disks from a "
4257 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4258 "unless those disks are accessible via the same device path locally too."
4262 #: ../src/guestfs-actions.pod:74
4264 "The optional C<libvirturi> parameter sets the libvirt URI (see "
4265 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
4266 "default libvirt URI (or one set through an environment variable, see the "
4267 "libvirt documentation for full details). If you are using the C API "
4268 "directly then it is more flexible to create the libvirt connection object "
4269 "yourself, get the domain object, and call C<guestfs_add_libvirt_dom>."
4273 #: ../src/guestfs-actions.pod:82
4275 "The other optional parameters are passed directly through to "
4276 "C<guestfs_add_drive_opts>."
4280 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:681 ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:2005 ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2655 ../src/guestfs-actions.pod:4553 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:5087 ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6409 ../src/guestfs-actions.pod:6834 ../src/guestfs-actions.pod:6847 ../src/guestfs-actions.pod:6860
4281 msgid "On error this function returns -1."
4285 #: ../src/guestfs-actions.pod:87
4286 msgid "(Added in 1.7.4)"
4290 #: ../src/guestfs-actions.pod:89
4291 msgid "guestfs_add_domain_va"
4295 #: ../src/guestfs-actions.pod:91
4299 " guestfs_add_domain_va (guestfs_h *g,\n"
4300 " const char *dom,\n"
4306 #: ../src/guestfs-actions.pod:96
4307 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4311 #: ../src/guestfs-actions.pod:98 ../src/guestfs-actions.pod:109 ../src/guestfs-actions.pod:202 ../src/guestfs-actions.pod:213 ../src/guestfs-actions.pod:4180 ../src/guestfs-actions.pod:4192
4312 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4316 #: ../src/guestfs-actions.pod:100
4317 msgid "guestfs_add_domain_argv"
4321 #: ../src/guestfs-actions.pod:102
4325 " guestfs_add_domain_argv (guestfs_h *g,\n"
4326 " const char *dom,\n"
4327 " const struct guestfs_add_domain_argv *optargs);\n"
4332 #: ../src/guestfs-actions.pod:107
4333 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4337 #: ../src/guestfs-actions.pod:111
4338 msgid "guestfs_add_drive"
4342 #: ../src/guestfs-actions.pod:113
4346 " guestfs_add_drive (guestfs_h *g,\n"
4347 " const char *filename);\n"
4352 #: ../src/guestfs-actions.pod:117
4354 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4355 "optional parameters, so the disk is added writable, with the format being "
4356 "detected automatically."
4360 #: ../src/guestfs-actions.pod:121
4362 "Automatic detection of the format opens you up to a potential security hole "
4363 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4364 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4365 "you should think about replacing calls to this function with calls to "
4366 "C<guestfs_add_drive_opts>, and specifying the format."
4370 #: ../src/guestfs-actions.pod:132
4371 msgid "guestfs_add_drive_opts"
4375 #: ../src/guestfs-actions.pod:134
4379 " guestfs_add_drive_opts (guestfs_h *g,\n"
4380 " const char *filename,\n"
4386 #: ../src/guestfs-actions.pod:144
4389 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4390 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4391 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4396 #: ../src/guestfs-actions.pod:148 ../fish/guestfish-actions.pod:92
4398 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4399 "The first time you call this function, the disk appears as C</dev/sda>, the "
4400 "second time as C</dev/sdb>, and so on."
4404 #: ../src/guestfs-actions.pod:153 ../fish/guestfish-actions.pod:97
4406 "You don't necessarily need to be root when using libguestfs. However you "
4407 "obviously do need sufficient permissions to access the filename for whatever "
4408 "operations you want to perform (ie. read access if you just want to read the "
4409 "image or write access if you want to modify the image)."
4413 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:103
4414 msgid "This call checks that C<filename> exists."
4418 #: ../src/guestfs-actions.pod:161 ../src/guestfs-actions.pod:4153 ../fish/guestfish-actions.pod:105 ../fish/guestfish-actions.pod:2789
4419 msgid "The optional arguments are:"
4423 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
4428 #: ../src/guestfs-actions.pod:167 ../fish/guestfish-actions.pod:111
4430 "If true then the image is treated as read-only. Writes are still allowed, "
4431 "but they are stored in a temporary snapshot overlay which is discarded at "
4432 "the end. The disk that you add is not modified."
4436 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:115
4441 #: ../src/guestfs-actions.pod:173
4443 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4444 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4445 "Possible formats include C<raw> and C<qcow2>."
4449 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:121
4451 "Automatic detection of the format opens you up to a potential security hole "
4452 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4453 "RHBZ#642934. Specifying the format closes this security hole."
4457 #: ../src/guestfs-actions.pod:182 ../fish/guestfish-actions.pod:126
4462 #: ../src/guestfs-actions.pod:184
4464 "This rarely-used option lets you emulate the behaviour of the deprecated "
4465 "C<guestfs_add_drive_with_if> call (q.v.)"
4469 #: ../src/guestfs-actions.pod:191
4470 msgid "(Added in 1.5.23)"
4474 #: ../src/guestfs-actions.pod:193
4475 msgid "guestfs_add_drive_opts_va"
4479 #: ../src/guestfs-actions.pod:195
4483 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4484 " const char *filename,\n"
4490 #: ../src/guestfs-actions.pod:200
4491 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4495 #: ../src/guestfs-actions.pod:204
4496 msgid "guestfs_add_drive_opts_argv"
4500 #: ../src/guestfs-actions.pod:206
4504 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4505 " const char *filename,\n"
4506 " const struct guestfs_add_drive_opts_argv "
4512 #: ../src/guestfs-actions.pod:211
4513 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4517 #: ../src/guestfs-actions.pod:215
4518 msgid "guestfs_add_drive_ro"
4522 #: ../src/guestfs-actions.pod:217
4526 " guestfs_add_drive_ro (guestfs_h *g,\n"
4527 " const char *filename);\n"
4532 #: ../src/guestfs-actions.pod:221
4534 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4535 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4536 "disk is added read-only, with the format being detected automatically."
4540 #: ../src/guestfs-actions.pod:228
4541 msgid "(Added in 1.0.38)"
4545 #: ../src/guestfs-actions.pod:230
4546 msgid "guestfs_add_drive_ro_with_if"
4550 #: ../src/guestfs-actions.pod:232
4554 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4555 " const char *filename,\n"
4556 " const char *iface);\n"
4561 #: ../src/guestfs-actions.pod:237
4563 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4564 "QEMU interface emulation to use at run time."
4568 #: ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270 ../src/guestfs-actions.pod:2305
4569 msgid "(Added in 1.0.84)"
4573 #: ../src/guestfs-actions.pod:251
4574 msgid "guestfs_add_drive_with_if"
4578 #: ../src/guestfs-actions.pod:253
4582 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4583 " const char *filename,\n"
4584 " const char *iface);\n"
4589 #: ../src/guestfs-actions.pod:258
4591 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4592 "QEMU interface emulation to use at run time."
4596 #: ../src/guestfs-actions.pod:272
4597 msgid "guestfs_aug_clear"
4601 #: ../src/guestfs-actions.pod:274
4605 " guestfs_aug_clear (guestfs_h *g,\n"
4606 " const char *augpath);\n"
4611 #: ../src/guestfs-actions.pod:278 ../fish/guestfish-actions.pod:178
4613 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4614 "L<augtool(1)> C<clear> command."
4618 #: ../src/guestfs-actions.pod:283 ../src/guestfs-actions.pod:2085
4619 msgid "(Added in 1.3.4)"
4623 #: ../src/guestfs-actions.pod:285
4624 msgid "guestfs_aug_close"
4628 #: ../src/guestfs-actions.pod:287
4632 " guestfs_aug_close (guestfs_h *g);\n"
4637 #: ../src/guestfs-actions.pod:290
4639 "Close the current Augeas handle and free up any resources used by it. After "
4640 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4641 "any other Augeas functions."
4645 #: ../src/guestfs-actions.pod:297 ../src/guestfs-actions.pod:322 ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:354 ../src/guestfs-actions.pod:412 ../src/guestfs-actions.pod:432 ../src/guestfs-actions.pod:446 ../src/guestfs-actions.pod:477 ../src/guestfs-actions.pod:491 ../src/guestfs-actions.pod:505 ../src/guestfs-actions.pod:519 ../src/guestfs-actions.pod:537 ../src/guestfs-actions.pod:5164
4646 msgid "(Added in 0.7)"
4650 #: ../src/guestfs-actions.pod:299
4651 msgid "guestfs_aug_defnode"
4655 #: ../src/guestfs-actions.pod:301
4658 " struct guestfs_int_bool *\n"
4659 " guestfs_aug_defnode (guestfs_h *g,\n"
4660 " const char *name,\n"
4661 " const char *expr,\n"
4662 " const char *val);\n"
4667 #: ../src/guestfs-actions.pod:307 ../fish/guestfish-actions.pod:194
4668 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4672 #: ../src/guestfs-actions.pod:310
4674 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4675 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4676 "containing that single node."
4680 #: ../src/guestfs-actions.pod:314 ../fish/guestfish-actions.pod:201
4682 "On success this returns a pair containing the number of nodes in the "
4683 "nodeset, and a boolean flag if a node was created."
4687 #: ../src/guestfs-actions.pod:318
4689 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4690 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4694 #: ../src/guestfs-actions.pod:324
4695 msgid "guestfs_aug_defvar"
4699 #: ../src/guestfs-actions.pod:326
4703 " guestfs_aug_defvar (guestfs_h *g,\n"
4704 " const char *name,\n"
4705 " const char *expr);\n"
4710 #: ../src/guestfs-actions.pod:331 ../fish/guestfish-actions.pod:209
4712 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4713 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4717 #: ../src/guestfs-actions.pod:335 ../fish/guestfish-actions.pod:213
4719 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4720 "evaluates to something which is not a nodeset."
4724 #: ../src/guestfs-actions.pod:342
4725 msgid "guestfs_aug_get"
4729 #: ../src/guestfs-actions.pod:344
4733 " guestfs_aug_get (guestfs_h *g,\n"
4734 " const char *augpath);\n"
4739 #: ../src/guestfs-actions.pod:348 ../fish/guestfish-actions.pod:220
4741 "Look up the value associated with C<path>. If C<path> matches exactly one "
4742 "node, the C<value> is returned."
4746 #: ../src/guestfs-actions.pod:351 ../src/guestfs-actions.pod:851 ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:929 ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1048 ../src/guestfs-actions.pod:1178 ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1343 ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:1646 ../src/guestfs-actions.pod:1809 ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:1938 ../src/guestfs-actions.pod:2108 ../src/guestfs-actions.pod:2270 ../src/guestfs-actions.pod:2477 ../src/guestfs-actions.pod:2558 ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2716 ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2771 ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2856 ../src/guestfs-actions.pod:3340 ../src/guestfs-actions.pod:3690 ../src/guestfs-actions.pod:3860 ../src/guestfs-actions.pod:3970 ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4892 ../src/guestfs-actions.pod:5062 ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:5289 ../src/guestfs-actions.pod:5852 ../src/guestfs-actions.pod:5868 ../src/guestfs-actions.pod:5885 ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:6583 ../src/guestfs-actions.pod:6602 ../src/guestfs-actions.pod:6620 ../src/guestfs-actions.pod:6800 ../src/guestfs-actions.pod:7072
4748 "This function returns a string, or NULL on error. I<The caller must free "
4749 "the returned string after use>."
4753 #: ../src/guestfs-actions.pod:356
4754 msgid "guestfs_aug_init"
4758 #: ../src/guestfs-actions.pod:358
4762 " guestfs_aug_init (guestfs_h *g,\n"
4763 " const char *root,\n"
4769 #: ../src/guestfs-actions.pod:363 ../fish/guestfish-actions.pod:227
4771 "Create a new Augeas handle for editing configuration files. If there was "
4772 "any previous Augeas handle associated with this guestfs session, then it is "
4777 #: ../src/guestfs-actions.pod:367
4778 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4782 #: ../src/guestfs-actions.pod:370 ../fish/guestfish-actions.pod:234
4783 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4787 #: ../src/guestfs-actions.pod:373 ../fish/guestfish-actions.pod:237
4789 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4790 "logical I<or> of the following integers:"
4794 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
4795 msgid "C<AUG_SAVE_BACKUP> = 1"
4799 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
4800 msgid "Keep the original file with a C<.augsave> extension."
4804 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
4805 msgid "C<AUG_SAVE_NEWFILE> = 2"
4809 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:249
4811 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4812 "original. Overrides C<AUG_SAVE_BACKUP>."
4816 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
4817 msgid "C<AUG_TYPE_CHECK> = 4"
4821 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
4822 msgid "Typecheck lenses (can be expensive)."
4826 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
4827 msgid "C<AUG_NO_STDINC> = 8"
4831 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
4832 msgid "Do not use standard load path for modules."
4836 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
4837 msgid "C<AUG_SAVE_NOOP> = 16"
4841 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
4842 msgid "Make save a no-op, just record what would have been changed."
4846 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:264
4847 msgid "C<AUG_NO_LOAD> = 32"
4851 #: ../src/guestfs-actions.pod:402
4852 msgid "Do not load the tree in C<guestfs_aug_init>."
4856 #: ../src/guestfs-actions.pod:406
4857 msgid "To close the handle, you can call C<guestfs_aug_close>."
4861 #: ../src/guestfs-actions.pod:408 ../fish/guestfish-actions.pod:272
4862 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4866 #: ../src/guestfs-actions.pod:414
4867 msgid "guestfs_aug_insert"
4871 #: ../src/guestfs-actions.pod:416
4875 " guestfs_aug_insert (guestfs_h *g,\n"
4876 " const char *augpath,\n"
4877 " const char *label,\n"
4883 #: ../src/guestfs-actions.pod:422 ../fish/guestfish-actions.pod:278
4885 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4886 "or after C<path> (depending on the boolean flag C<before>)."
4890 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:282
4892 "C<path> must match exactly one existing node in the tree, and C<label> must "
4893 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4897 #: ../src/guestfs-actions.pod:434
4898 msgid "guestfs_aug_load"
4902 #: ../src/guestfs-actions.pod:436
4906 " guestfs_aug_load (guestfs_h *g);\n"
4911 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
4912 msgid "Load files into the tree."
4916 #: ../src/guestfs-actions.pod:441 ../fish/guestfish-actions.pod:292
4917 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4921 #: ../src/guestfs-actions.pod:448
4922 msgid "guestfs_aug_ls"
4926 #: ../src/guestfs-actions.pod:450
4930 " guestfs_aug_ls (guestfs_h *g,\n"
4931 " const char *augpath);\n"
4936 #: ../src/guestfs-actions.pod:454
4938 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4939 "sorting the resulting nodes into alphabetical order."
4943 #: ../src/guestfs-actions.pod:457 ../src/guestfs-actions.pod:473 ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:1067 ../src/guestfs-actions.pod:1358 ../src/guestfs-actions.pod:1377 ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1499 ../src/guestfs-actions.pod:1748 ../src/guestfs-actions.pod:2150 ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:2228 ../src/guestfs-actions.pod:2252 ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2372 ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:2790 ../src/guestfs-actions.pod:3005 ../src/guestfs-actions.pod:3260 ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3427 ../src/guestfs-actions.pod:3832 ../src/guestfs-actions.pod:4514 ../src/guestfs-actions.pod:5034 ../src/guestfs-actions.pod:5160 ../src/guestfs-actions.pod:5274 ../src/guestfs-actions.pod:5925 ../src/guestfs-actions.pod:5986 ../src/guestfs-actions.pod:6041 ../src/guestfs-actions.pod:6187 ../src/guestfs-actions.pod:6211 ../src/guestfs-actions.pod:6693 ../src/guestfs-actions.pod:6713 ../src/guestfs-actions.pod:6760 ../src/guestfs-actions.pod:6925 ../src/guestfs-actions.pod:6944 ../src/guestfs-actions.pod:7029 ../src/guestfs-actions.pod:7048 ../src/guestfs-actions.pod:7094 ../src/guestfs-actions.pod:7113
4945 "This function returns a NULL-terminated array of strings (like "
4946 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
4947 "strings and the array after use>."
4951 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:992 ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:1415 ../src/guestfs-actions.pod:3083 ../src/guestfs-actions.pod:3114 ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3723 ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3943 ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4518 ../src/guestfs-actions.pod:4975 ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:5367 ../src/guestfs-actions.pod:5379 ../src/guestfs-actions.pod:5787 ../src/guestfs-actions.pod:6425 ../src/guestfs-actions.pod:6438 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6913
4952 msgid "(Added in 0.8)"
4956 #: ../src/guestfs-actions.pod:463
4957 msgid "guestfs_aug_match"
4961 #: ../src/guestfs-actions.pod:465
4965 " guestfs_aug_match (guestfs_h *g,\n"
4966 " const char *augpath);\n"
4971 #: ../src/guestfs-actions.pod:469 ../fish/guestfish-actions.pod:306
4973 "Returns a list of paths which match the path expression C<path>. The "
4974 "returned paths are sufficiently qualified so that they match exactly one "
4975 "node in the current tree."
4979 #: ../src/guestfs-actions.pod:479
4980 msgid "guestfs_aug_mv"
4984 #: ../src/guestfs-actions.pod:481
4988 " guestfs_aug_mv (guestfs_h *g,\n"
4989 " const char *src,\n"
4990 " const char *dest);\n"
4995 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:314
4997 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4998 "C<dest> is overwritten if it exists."
5002 #: ../src/guestfs-actions.pod:493
5003 msgid "guestfs_aug_rm"
5007 #: ../src/guestfs-actions.pod:495
5011 " guestfs_aug_rm (guestfs_h *g,\n"
5012 " const char *augpath);\n"
5017 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
5018 msgid "Remove C<path> and all of its children."
5022 #: ../src/guestfs-actions.pod:501 ../fish/guestfish-actions.pod:323
5023 msgid "On success this returns the number of entries which were removed."
5027 #: ../src/guestfs-actions.pod:507
5028 msgid "guestfs_aug_save"
5032 #: ../src/guestfs-actions.pod:509
5036 " guestfs_aug_save (guestfs_h *g);\n"
5041 #: ../src/guestfs-actions.pod:512 ../fish/guestfish-actions.pod:329
5042 msgid "This writes all pending changes to disk."
5046 #: ../src/guestfs-actions.pod:514
5048 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5053 #: ../src/guestfs-actions.pod:521
5054 msgid "guestfs_aug_set"
5058 #: ../src/guestfs-actions.pod:523
5062 " guestfs_aug_set (guestfs_h *g,\n"
5063 " const char *augpath,\n"
5064 " const char *val);\n"
5069 #: ../src/guestfs-actions.pod:528 ../fish/guestfish-actions.pod:338
5070 msgid "Set the value associated with C<path> to C<val>."
5074 #: ../src/guestfs-actions.pod:530
5076 "In the Augeas API, it is possible to clear a node by setting the value to "
5077 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5078 "this call. Instead you must use the C<guestfs_aug_clear> call."
5082 #: ../src/guestfs-actions.pod:539
5083 msgid "guestfs_available"
5087 #: ../src/guestfs-actions.pod:541
5091 " guestfs_available (guestfs_h *g,\n"
5092 " char *const *groups);\n"
5097 #: ../src/guestfs-actions.pod:545 ../fish/guestfish-actions.pod:349
5099 "This command is used to check the availability of some groups of "
5100 "functionality in the appliance, which not all builds of the libguestfs "
5101 "appliance will be able to provide."
5105 #: ../src/guestfs-actions.pod:549
5107 "The libguestfs groups, and the functions that those groups correspond to, "
5108 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5109 "runtime by calling C<guestfs_available_all_groups>."
5113 #: ../src/guestfs-actions.pod:554 ../fish/guestfish-actions.pod:358
5115 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
5116 "\"augeas\"]> would check for the availability of the Linux inotify functions "
5117 "and Augeas (configuration file editing) functions."
5121 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
5122 msgid "The command returns no error if I<all> requested groups are available."
5126 #: ../src/guestfs-actions.pod:561 ../fish/guestfish-actions.pod:365
5128 "It fails with an error if one or more of the requested groups is unavailable "
5133 #: ../src/guestfs-actions.pod:564 ../fish/guestfish-actions.pod:368
5135 "If an unknown group name is included in the list of groups then an error is "
5140 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:371
5145 #: ../src/guestfs-actions.pod:573
5146 msgid "You must call C<guestfs_launch> before calling this function."
5150 #: ../src/guestfs-actions.pod:575 ../fish/guestfish-actions.pod:379
5152 "The reason is because we don't know what groups are supported by the "
5153 "appliance/daemon until it is running and can be queried."
5157 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:385
5159 "If a group of functions is available, this does not necessarily mean that "
5160 "they will work. You still have to check for errors when calling individual "
5161 "API functions even if they are available."
5165 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:392
5167 "It is usually the job of distro packagers to build complete functionality "
5168 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5169 "with all requirements satisfied, will support everything."
5173 #: ../src/guestfs-actions.pod:595
5175 "This call was added in version C<1.0.80>. In previous versions of "
5176 "libguestfs all you could do would be to speculatively execute a command to "
5177 "find out if the daemon implemented it. See also C<guestfs_version>."
5181 #: ../src/guestfs-actions.pod:604 ../src/guestfs-actions.pod:1165
5182 msgid "(Added in 1.0.80)"
5186 #: ../src/guestfs-actions.pod:606
5187 msgid "guestfs_available_all_groups"
5191 #: ../src/guestfs-actions.pod:608
5195 " guestfs_available_all_groups (guestfs_h *g);\n"
5200 #: ../src/guestfs-actions.pod:611
5202 "This command returns a list of all optional groups that this daemon knows "
5203 "about. Note this returns both supported and unsupported groups. To find "
5204 "out which ones the daemon can actually support you have to call "
5205 "C<guestfs_available> on each member of the returned list."
5209 #: ../src/guestfs-actions.pod:617
5210 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5214 #: ../src/guestfs-actions.pod:623
5215 msgid "(Added in 1.3.15)"
5219 #: ../src/guestfs-actions.pod:625
5220 msgid "guestfs_base64_in"
5224 #: ../src/guestfs-actions.pod:627
5228 " guestfs_base64_in (guestfs_h *g,\n"
5229 " const char *base64file,\n"
5230 " const char *filename);\n"
5235 #: ../src/guestfs-actions.pod:632 ../fish/guestfish-actions.pod:422
5236 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
5240 #: ../src/guestfs-actions.pod:637 ../src/guestfs-actions.pod:651
5241 msgid "(Added in 1.3.5)"
5245 #: ../src/guestfs-actions.pod:639
5246 msgid "guestfs_base64_out"
5250 #: ../src/guestfs-actions.pod:641
5254 " guestfs_base64_out (guestfs_h *g,\n"
5255 " const char *filename,\n"
5256 " const char *base64file);\n"
5261 #: ../src/guestfs-actions.pod:646 ../fish/guestfish-actions.pod:431
5263 "This command downloads the contents of C<filename>, writing it out to local "
5264 "file C<base64file> encoded as base64."
5268 #: ../src/guestfs-actions.pod:653
5269 msgid "guestfs_blockdev_flushbufs"
5273 #: ../src/guestfs-actions.pod:655
5277 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5278 " const char *device);\n"
5283 #: ../src/guestfs-actions.pod:659 ../fish/guestfish-actions.pod:440
5284 msgid "This tells the kernel to flush internal buffers associated with C<device>."
5288 #: ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779 ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807 ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454 ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473 ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498 ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517 ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5289 msgid "This uses the L<blockdev(8)> command."
5293 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:714 ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:765 ../src/guestfs-actions.pod:783 ../src/guestfs-actions.pod:797 ../src/guestfs-actions.pod:811
5294 msgid "(Added in 0.9.3)"
5298 #: ../src/guestfs-actions.pod:668
5299 msgid "guestfs_blockdev_getbsz"
5303 #: ../src/guestfs-actions.pod:670
5307 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5308 " const char *device);\n"
5313 #: ../src/guestfs-actions.pod:674 ../fish/guestfish-actions.pod:449
5314 msgid "This returns the block size of a device."
5318 #: ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:776 ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5320 "(Note this is different from both I<size in blocks> and I<filesystem block "
5325 #: ../src/guestfs-actions.pod:685
5326 msgid "guestfs_blockdev_getro"
5330 #: ../src/guestfs-actions.pod:687
5334 " guestfs_blockdev_getro (guestfs_h *g,\n"
5335 " const char *device);\n"
5340 #: ../src/guestfs-actions.pod:691 ../fish/guestfish-actions.pod:460
5342 "Returns a boolean indicating if the block device is read-only (true if "
5343 "read-only, false if not)."
5347 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:3022 ../src/guestfs-actions.pod:3036 ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3065 ../src/guestfs-actions.pod:3081 ../src/guestfs-actions.pod:3096 ../src/guestfs-actions.pod:3112 ../src/guestfs-actions.pod:3126 ../src/guestfs-actions.pod:3139 ../src/guestfs-actions.pod:3153 ../src/guestfs-actions.pod:3168 ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:4663
5348 msgid "This function returns a C truth value on success or -1 on error."
5352 #: ../src/guestfs-actions.pod:700
5353 msgid "guestfs_blockdev_getsize64"
5357 #: ../src/guestfs-actions.pod:702
5361 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5362 " const char *device);\n"
5367 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:469
5368 msgid "This returns the size of the device in bytes."
5372 #: ../src/guestfs-actions.pod:708
5373 msgid "See also C<guestfs_blockdev_getsz>."
5377 #: ../src/guestfs-actions.pod:716
5378 msgid "guestfs_blockdev_getss"
5382 #: ../src/guestfs-actions.pod:718
5386 " guestfs_blockdev_getss (guestfs_h *g,\n"
5387 " const char *device);\n"
5392 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:479
5394 "This returns the size of sectors on a block device. Usually 512, but can be "
5395 "larger for modern devices."
5399 #: ../src/guestfs-actions.pod:725
5401 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5406 #: ../src/guestfs-actions.pod:734
5407 msgid "guestfs_blockdev_getsz"
5411 #: ../src/guestfs-actions.pod:736
5415 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5416 " const char *device);\n"
5421 #: ../src/guestfs-actions.pod:740 ../fish/guestfish-actions.pod:491
5423 "This returns the size of the device in units of 512-byte sectors (even if "
5424 "the sectorsize isn't 512 bytes ... weird)."
5428 #: ../src/guestfs-actions.pod:743
5430 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5431 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5435 #: ../src/guestfs-actions.pod:753
5436 msgid "guestfs_blockdev_rereadpt"
5440 #: ../src/guestfs-actions.pod:755
5444 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5445 " const char *device);\n"
5450 #: ../src/guestfs-actions.pod:759 ../fish/guestfish-actions.pod:504
5451 msgid "Reread the partition table on C<device>."
5455 #: ../src/guestfs-actions.pod:767
5456 msgid "guestfs_blockdev_setbsz"
5460 #: ../src/guestfs-actions.pod:769
5464 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5465 " const char *device,\n"
5466 " int blocksize);\n"
5471 #: ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:512
5472 msgid "This sets the block size of a device."
5476 #: ../src/guestfs-actions.pod:785
5477 msgid "guestfs_blockdev_setro"
5481 #: ../src/guestfs-actions.pod:787
5485 " guestfs_blockdev_setro (guestfs_h *g,\n"
5486 " const char *device);\n"
5491 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:523
5492 msgid "Sets the block device named C<device> to read-only."
5496 #: ../src/guestfs-actions.pod:799
5497 msgid "guestfs_blockdev_setrw"
5501 #: ../src/guestfs-actions.pod:801
5505 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5506 " const char *device);\n"
5511 #: ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:531
5512 msgid "Sets the block device named C<device> to read-write."
5516 #: ../src/guestfs-actions.pod:813
5517 msgid "guestfs_case_sensitive_path"
5521 #: ../src/guestfs-actions.pod:815
5525 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5526 " const char *path);\n"
5531 #: ../src/guestfs-actions.pod:819 ../fish/guestfish-actions.pod:539
5533 "This can be used to resolve case insensitive paths on a filesystem which is "
5534 "case sensitive. The use case is to resolve paths which you have read from "
5535 "Windows configuration files or the Windows Registry, to the true path."
5539 #: ../src/guestfs-actions.pod:824 ../fish/guestfish-actions.pod:544
5541 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5542 "(and probably others), which is that although the underlying filesystem is "
5543 "case-insensitive, the driver exports the filesystem to Linux as "
5548 #: ../src/guestfs-actions.pod:829 ../fish/guestfish-actions.pod:549
5550 "One consequence of this is that special directories such as C<c:\\windows> "
5551 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5552 "precise details of how they were created. In Windows itself this would not "
5557 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:555
5559 "Bug or feature? You decide: "
5560 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
5564 #: ../src/guestfs-actions.pod:838 ../fish/guestfish-actions.pod:558
5566 "This function resolves the true case of each element in the path and returns "
5567 "the case-sensitive path."
5571 #: ../src/guestfs-actions.pod:841
5573 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
5574 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5575 "how the directories were originally created under Windows)."
5579 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:566
5580 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5584 #: ../src/guestfs-actions.pod:849
5585 msgid "See also C<guestfs_realpath>."
5589 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:6605
5590 msgid "(Added in 1.0.75)"
5594 #: ../src/guestfs-actions.pod:856
5599 #: ../src/guestfs-actions.pod:858
5603 " guestfs_cat (guestfs_h *g,\n"
5604 " const char *path);\n"
5609 #: ../src/guestfs-actions.pod:862 ../src/guestfs-actions.pod:5150 ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3424
5610 msgid "Return the contents of the file named C<path>."
5614 #: ../src/guestfs-actions.pod:864
5616 "Note that this function cannot correctly handle binary files (specifically, "
5617 "files containing C<\\0> character which is treated as end of string). For "
5618 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5619 "functions which have a more complex interface."
5623 #: ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1051 ../src/guestfs-actions.pod:1071 ../src/guestfs-actions.pod:1362 ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1484 ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:1752 ../src/guestfs-actions.pod:2170 ../src/guestfs-actions.pod:2189 ../src/guestfs-actions.pod:2232 ../src/guestfs-actions.pod:2256 ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2302 ../src/guestfs-actions.pod:4932 ../src/guestfs-actions.pod:4958 ../src/guestfs-actions.pod:5089 ../src/guestfs-actions.pod:5115 ../src/guestfs-actions.pod:5139 ../src/guestfs-actions.pod:5990 ../src/guestfs-actions.pod:6045 ../src/guestfs-actions.pod:6191 ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:6877 ../src/guestfs-actions.pod:6903 ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:7033 ../src/guestfs-actions.pod:7052 ../src/guestfs-actions.pod:7098 ../src/guestfs-actions.pod:7117 ../fish/guestfish-actions.pod:582 ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729 ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915 ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992 ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462 ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500 ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525 ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3294 ../fish/guestfish-actions.pod:3309 ../fish/guestfish-actions.pod:3385 ../fish/guestfish-actions.pod:3402 ../fish/guestfish-actions.pod:3417 ../fish/guestfish-actions.pod:4000 ../fish/guestfish-actions.pod:4046 ../fish/guestfish-actions.pod:4131 ../fish/guestfish-actions.pod:4146 ../fish/guestfish-actions.pod:4556 ../fish/guestfish-actions.pod:4574 ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4601 ../fish/guestfish-actions.pod:4649 ../fish/guestfish-actions.pod:4659 ../fish/guestfish-actions.pod:4688 ../fish/guestfish-actions.pod:4698
5625 "Because of the message protocol, there is a transfer limit of somewhere "
5626 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5630 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:3264 ../src/guestfs-actions.pod:3326 ../src/guestfs-actions.pod:3343 ../src/guestfs-actions.pod:3431 ../src/guestfs-actions.pod:3836 ../src/guestfs-actions.pod:3850 ../src/guestfs-actions.pod:5038 ../src/guestfs-actions.pod:5052 ../src/guestfs-actions.pod:6764 ../src/guestfs-actions.pod:6778
5631 msgid "(Added in 0.4)"
5635 #: ../src/guestfs-actions.pod:877
5636 msgid "guestfs_checksum"
5640 #: ../src/guestfs-actions.pod:879
5644 " guestfs_checksum (guestfs_h *g,\n"
5645 " const char *csumtype,\n"
5646 " const char *path);\n"
5651 #: ../src/guestfs-actions.pod:884 ../fish/guestfish-actions.pod:589
5652 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5656 #: ../src/guestfs-actions.pod:887 ../fish/guestfish-actions.pod:592
5658 "The type of checksum to compute is given by the C<csumtype> parameter which "
5659 "must have one of the following values:"
5663 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
5668 #: ../src/guestfs-actions.pod:894 ../fish/guestfish-actions.pod:599
5670 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5675 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
5680 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
5681 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5685 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
5690 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
5691 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5695 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
5700 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
5701 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5705 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
5710 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
5711 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5715 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
5720 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
5721 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5725 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
5730 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:624
5731 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5735 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:628
5736 msgid "The checksum is returned as a printable string."
5740 #: ../src/guestfs-actions.pod:925
5741 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
5745 #: ../src/guestfs-actions.pod:927
5746 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
5750 #: ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:1240 ../src/guestfs-actions.pod:2062 ../src/guestfs-actions.pod:3038 ../src/guestfs-actions.pod:3067 ../src/guestfs-actions.pod:3128 ../src/guestfs-actions.pod:3155 ../src/guestfs-actions.pod:6461
5751 msgid "(Added in 1.0.2)"
5755 #: ../src/guestfs-actions.pod:934
5756 msgid "guestfs_checksum_device"
5760 #: ../src/guestfs-actions.pod:936
5764 " guestfs_checksum_device (guestfs_h *g,\n"
5765 " const char *csumtype,\n"
5766 " const char *device);\n"
5771 #: ../src/guestfs-actions.pod:941
5773 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5774 "device named C<device>. For the types of checksums supported see the "
5775 "C<guestfs_checksum> command."
5779 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:4569 ../src/guestfs-actions.pod:4628 ../src/guestfs-actions.pod:4665 ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:4859 ../src/guestfs-actions.pod:6370 ../src/guestfs-actions.pod:6384 ../src/guestfs-actions.pod:6790
5780 msgid "(Added in 1.3.2)"
5784 #: ../src/guestfs-actions.pod:950
5785 msgid "guestfs_checksums_out"
5789 #: ../src/guestfs-actions.pod:952
5793 " guestfs_checksums_out (guestfs_h *g,\n"
5794 " const char *csumtype,\n"
5795 " const char *directory,\n"
5796 " const char *sumsfile);\n"
5801 #: ../src/guestfs-actions.pod:958 ../fish/guestfish-actions.pod:646
5803 "This command computes the checksums of all regular files in C<directory> and "
5804 "then emits a list of those checksums to the local output file C<sumsfile>."
5808 #: ../src/guestfs-actions.pod:962 ../fish/guestfish-actions.pod:650
5810 "This can be used for verifying the integrity of a virtual machine. However "
5811 "to be properly secure you should pay attention to the output of the checksum "
5812 "command (it uses the ones from GNU coreutils). In particular when the "
5813 "filename is not printable, coreutils uses a special backslash syntax. For "
5814 "more information, see the GNU coreutils info file."
5818 #: ../src/guestfs-actions.pod:972
5819 msgid "(Added in 1.3.7)"
5823 #: ../src/guestfs-actions.pod:974
5824 msgid "guestfs_chmod"
5828 #: ../src/guestfs-actions.pod:976
5832 " guestfs_chmod (guestfs_h *g,\n"
5834 " const char *path);\n"
5839 #: ../src/guestfs-actions.pod:981 ../fish/guestfish-actions.pod:664
5841 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5846 #: ../src/guestfs-actions.pod:984 ../fish/guestfish-actions.pod:667
5848 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5849 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5854 #: ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:4087 ../src/guestfs-actions.pod:4268 ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4306 ../fish/guestfish-actions.pod:671 ../fish/guestfish-actions.pod:2753 ../fish/guestfish-actions.pod:2869 ../fish/guestfish-actions.pod:2879 ../fish/guestfish-actions.pod:2889
5855 msgid "The mode actually set is affected by the umask."
5859 #: ../src/guestfs-actions.pod:994
5860 msgid "guestfs_chown"
5864 #: ../src/guestfs-actions.pod:996
5868 " guestfs_chown (guestfs_h *g,\n"
5871 " const char *path);\n"
5876 #: ../src/guestfs-actions.pod:1002 ../fish/guestfish-actions.pod:677
5877 msgid "Change the file owner to C<owner> and group to C<group>."
5881 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:3225 ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2231
5883 "Only numeric uid and gid are supported. If you want to use names, you will "
5884 "need to locate and parse the password file yourself (Augeas support makes "
5885 "this relatively easy)."
5889 #: ../src/guestfs-actions.pod:1012
5890 msgid "guestfs_command"
5894 #: ../src/guestfs-actions.pod:1014
5898 " guestfs_command (guestfs_h *g,\n"
5899 " char *const *arguments);\n"
5904 #: ../src/guestfs-actions.pod:1018 ../fish/guestfish-actions.pod:687
5906 "This call runs a command from the guest filesystem. The filesystem must be "
5907 "mounted, and must contain a compatible operating system (ie. something "
5908 "Linux, with the same or compatible processor architecture)."
5912 #: ../src/guestfs-actions.pod:1023
5914 "The single parameter is an argv-style list of arguments. The first element "
5915 "is the name of the program to run. Subsequent elements are parameters. The "
5916 "list must be non-empty (ie. must contain a program name). Note that the "
5917 "command runs directly, and is I<not> invoked via the shell (see "
5922 #: ../src/guestfs-actions.pod:1030 ../fish/guestfish-actions.pod:699
5923 msgid "The return value is anything printed to I<stdout> by the command."
5927 #: ../src/guestfs-actions.pod:1033 ../fish/guestfish-actions.pod:702
5929 "If the command returns a non-zero exit status, then this function returns an "
5930 "error message. The error message string is the content of I<stderr> from "
5935 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:706
5937 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5938 "C</bin>. If you require a program from another location, you should provide "
5939 "the full path in the first parameter."
5943 #: ../src/guestfs-actions.pod:1042 ../fish/guestfish-actions.pod:711
5945 "Shared libraries and data files required by the program must be available on "
5946 "filesystems which are mounted in the correct places. It is the caller's "
5947 "responsibility to ensure all filesystems that are needed are mounted at the "
5952 #: ../src/guestfs-actions.pod:1054 ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1537
5953 msgid "(Added in 0.9.1)"
5957 #: ../src/guestfs-actions.pod:1056
5958 msgid "guestfs_command_lines"
5962 #: ../src/guestfs-actions.pod:1058
5966 " guestfs_command_lines (guestfs_h *g,\n"
5967 " char *const *arguments);\n"
5972 #: ../src/guestfs-actions.pod:1062
5974 "This is the same as C<guestfs_command>, but splits the result into a list of "
5979 #: ../src/guestfs-actions.pod:1065
5980 msgid "See also: C<guestfs_sh_lines>"
5984 #: ../src/guestfs-actions.pod:1076
5985 msgid "guestfs_config"
5989 #: ../src/guestfs-actions.pod:1078
5993 " guestfs_config (guestfs_h *g,\n"
5994 " const char *qemuparam,\n"
5995 " const char *qemuvalue);\n"
6000 #: ../src/guestfs-actions.pod:1083 ../fish/guestfish-actions.pod:736
6002 "This can be used to add arbitrary qemu command line parameters of the form "
6003 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6004 "setting some parameters which would interfere with parameters that we use."
6008 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
6009 msgid "The first character of C<param> string must be a C<-> (dash)."
6013 #: ../src/guestfs-actions.pod:1090 ../fish/guestfish-actions.pod:743
6014 msgid "C<value> can be NULL."
6018 #: ../src/guestfs-actions.pod:1096
6019 msgid "guestfs_copy_size"
6023 #: ../src/guestfs-actions.pod:1098
6027 " guestfs_copy_size (guestfs_h *g,\n"
6028 " const char *src,\n"
6029 " const char *dest,\n"
6035 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:749
6037 "This command copies exactly C<size> bytes from one source device or file "
6038 "C<src> to another destination device or file C<dest>."
6042 #: ../src/guestfs-actions.pod:1107 ../fish/guestfish-actions.pod:752
6044 "Note this will fail if the source is too short or if the destination is not "
6049 #: ../src/guestfs-actions.pod:1112 ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1686 ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:6456 ../src/guestfs-actions.pod:6490 ../src/guestfs-actions.pod:6969 ../src/guestfs-actions.pod:6988
6051 "This long-running command can generate progress notification messages so "
6052 "that the caller can display a progress bar or indicator. To receive these "
6053 "messages, the caller must register a progress callback. See "
6054 "L<guestfs(3)/guestfs_set_progress_callback>."
6058 #: ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:5065 ../src/guestfs-actions.pod:6697 ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:6803
6059 msgid "(Added in 1.0.87)"
6063 #: ../src/guestfs-actions.pod:1119
6068 #: ../src/guestfs-actions.pod:1121
6072 " guestfs_cp (guestfs_h *g,\n"
6073 " const char *src,\n"
6074 " const char *dest);\n"
6079 #: ../src/guestfs-actions.pod:1126 ../fish/guestfish-actions.pod:759
6081 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6082 "destination filename or destination directory."
6086 #: ../src/guestfs-actions.pod:1131 ../src/guestfs-actions.pod:1145 ../src/guestfs-actions.pod:1217 ../src/guestfs-actions.pod:1291 ../src/guestfs-actions.pod:1400 ../src/guestfs-actions.pod:4532 ../src/guestfs-actions.pod:4909
6087 msgid "(Added in 1.0.18)"
6091 #: ../src/guestfs-actions.pod:1133
6092 msgid "guestfs_cp_a"
6096 #: ../src/guestfs-actions.pod:1135
6100 " guestfs_cp_a (guestfs_h *g,\n"
6101 " const char *src,\n"
6102 " const char *dest);\n"
6107 #: ../src/guestfs-actions.pod:1140 ../fish/guestfish-actions.pod:766
6109 "This copies a file or directory from C<src> to C<dest> recursively using the "
6114 #: ../src/guestfs-actions.pod:1147
6119 #: ../src/guestfs-actions.pod:1149
6123 " guestfs_dd (guestfs_h *g,\n"
6124 " const char *src,\n"
6125 " const char *dest);\n"
6130 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:773
6132 "This command copies from one source device or file C<src> to another "
6133 "destination device or file C<dest>. Normally you would use this to copy to "
6134 "or from a device or partition, for example to duplicate a filesystem."
6138 #: ../src/guestfs-actions.pod:1159
6140 "If the destination is a device, it must be as large or larger than the "
6141 "source file or device, otherwise the copy will fail. This command cannot do "
6142 "partial copies (see C<guestfs_copy_size>)."
6146 #: ../src/guestfs-actions.pod:1167
6151 #: ../src/guestfs-actions.pod:1169
6155 " guestfs_df (guestfs_h *g);\n"
6160 #: ../src/guestfs-actions.pod:1172 ../fish/guestfish-actions.pod:786
6161 msgid "This command runs the C<df> command to report disk space used."
6165 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1191 ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6167 "This command is mostly useful for interactive sessions. It is I<not> "
6168 "intended that you try to parse the output string. Use C<statvfs> from "
6173 #: ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1198 ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:2235 ../src/guestfs-actions.pod:2259 ../src/guestfs-actions.pod:2327 ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:4432 ../src/guestfs-actions.pod:6194 ../src/guestfs-actions.pod:6218 ../src/guestfs-actions.pod:6836 ../src/guestfs-actions.pod:6849 ../src/guestfs-actions.pod:6862
6174 msgid "(Added in 1.0.54)"
6178 #: ../src/guestfs-actions.pod:1183
6179 msgid "guestfs_df_h"
6183 #: ../src/guestfs-actions.pod:1185
6187 " guestfs_df_h (guestfs_h *g);\n"
6192 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:796
6194 "This command runs the C<df -h> command to report disk space used in "
6195 "human-readable format."
6199 #: ../src/guestfs-actions.pod:1200
6200 msgid "guestfs_dmesg"
6204 #: ../src/guestfs-actions.pod:1202
6208 " guestfs_dmesg (guestfs_h *g);\n"
6213 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:807
6215 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6216 "This is sometimes useful for extended debugging of problems."
6220 #: ../src/guestfs-actions.pod:1209
6222 "Another way to get the same information is to enable verbose messages with "
6223 "C<guestfs_set_verbose> or by setting the environment variable "
6224 "C<LIBGUESTFS_DEBUG=1> before running the program."
6228 #: ../src/guestfs-actions.pod:1219
6229 msgid "guestfs_download"
6233 #: ../src/guestfs-actions.pod:1221
6237 " guestfs_download (guestfs_h *g,\n"
6238 " const char *remotefilename,\n"
6239 " const char *filename);\n"
6244 #: ../src/guestfs-actions.pod:1226 ../src/guestfs-actions.pod:1251 ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6246 "Download file C<remotefilename> and save it as C<filename> on the local "
6251 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:6450 ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4304
6252 msgid "C<filename> can also be a named pipe."
6256 #: ../src/guestfs-actions.pod:1231
6257 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6261 #: ../src/guestfs-actions.pod:1242
6262 msgid "guestfs_download_offset"
6266 #: ../src/guestfs-actions.pod:1244
6270 " guestfs_download_offset (guestfs_h *g,\n"
6271 " const char *remotefilename,\n"
6272 " const char *filename,\n"
6273 " int64_t offset,\n"
6279 #: ../src/guestfs-actions.pod:1254 ../fish/guestfish-actions.pod:836
6281 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6282 "region must be within the file or device)."
6286 #: ../src/guestfs-actions.pod:1257
6288 "Note that there is no limit on the amount of data that can be downloaded "
6289 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6290 "full amount unless an error occurs."
6294 #: ../src/guestfs-actions.pod:1262
6295 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6299 #: ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:6495
6300 msgid "(Added in 1.5.17)"
6304 #: ../src/guestfs-actions.pod:1273
6305 msgid "guestfs_drop_caches"
6309 #: ../src/guestfs-actions.pod:1275
6313 " guestfs_drop_caches (guestfs_h *g,\n"
6314 " int whattodrop);\n"
6319 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:852
6321 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6322 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6323 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6327 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
6328 msgid "Setting C<whattodrop> to 3 should drop everything."
6332 #: ../src/guestfs-actions.pod:1286 ../fish/guestfish-actions.pod:859
6334 "This automatically calls L<sync(2)> before the operation, so that the "
6335 "maximum guest memory is freed."
6339 #: ../src/guestfs-actions.pod:1293
6344 #: ../src/guestfs-actions.pod:1295
6348 " guestfs_du (guestfs_h *g,\n"
6349 " const char *path);\n"
6354 #: ../src/guestfs-actions.pod:1299 ../fish/guestfish-actions.pod:866
6356 "This command runs the C<du -s> command to estimate file space usage for "
6361 #: ../src/guestfs-actions.pod:1302 ../fish/guestfish-actions.pod:869
6363 "C<path> can be a file or a directory. If C<path> is a directory then the "
6364 "estimate includes the contents of the directory and all subdirectories "
6369 #: ../src/guestfs-actions.pod:1306 ../fish/guestfish-actions.pod:873
6370 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6374 #: ../src/guestfs-actions.pod:1313
6375 msgid "guestfs_e2fsck_f"
6379 #: ../src/guestfs-actions.pod:1315
6383 " guestfs_e2fsck_f (guestfs_h *g,\n"
6384 " const char *device);\n"
6389 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:880
6391 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6392 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6397 #: ../src/guestfs-actions.pod:1323
6399 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6400 "Normally you should use C<guestfs_fsck>."
6404 #: ../src/guestfs-actions.pod:1328
6405 msgid "(Added in 1.0.29)"
6409 #: ../src/guestfs-actions.pod:1330
6410 msgid "guestfs_echo_daemon"
6414 #: ../src/guestfs-actions.pod:1332
6418 " guestfs_echo_daemon (guestfs_h *g,\n"
6419 " char *const *words);\n"
6424 #: ../src/guestfs-actions.pod:1336 ../fish/guestfish-actions.pod:891
6426 "This command concatenates the list of C<words> passed with single spaces "
6427 "between them and returns the resulting string."
6431 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:894
6432 msgid "You can use this command to test the connection through to the daemon."
6436 #: ../src/guestfs-actions.pod:1341
6437 msgid "See also C<guestfs_ping_daemon>."
6441 #: ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:5698
6442 msgid "(Added in 1.0.69)"
6446 #: ../src/guestfs-actions.pod:1348
6447 msgid "guestfs_egrep"
6451 #: ../src/guestfs-actions.pod:1350
6455 " guestfs_egrep (guestfs_h *g,\n"
6456 " const char *regex,\n"
6457 " const char *path);\n"
6462 #: ../src/guestfs-actions.pod:1355 ../fish/guestfish-actions.pod:902
6463 msgid "This calls the external C<egrep> program and returns the matching lines."
6467 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1384 ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1487 ../src/guestfs-actions.pod:1506 ../src/guestfs-actions.pod:2173 ../src/guestfs-actions.pod:2192 ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:2376 ../src/guestfs-actions.pod:2422 ../src/guestfs-actions.pod:2444 ../src/guestfs-actions.pod:2457 ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:3370 ../src/guestfs-actions.pod:3383 ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:4367 ../src/guestfs-actions.pod:5243 ../src/guestfs-actions.pod:5292 ../src/guestfs-actions.pod:6062 ../src/guestfs-actions.pod:6074 ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6100 ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6135 ../src/guestfs-actions.pod:6148 ../src/guestfs-actions.pod:6161 ../src/guestfs-actions.pod:6932 ../src/guestfs-actions.pod:6951 ../src/guestfs-actions.pod:7036 ../src/guestfs-actions.pod:7055 ../src/guestfs-actions.pod:7101 ../src/guestfs-actions.pod:7120
6468 msgid "(Added in 1.0.66)"
6472 #: ../src/guestfs-actions.pod:1367
6473 msgid "guestfs_egrepi"
6477 #: ../src/guestfs-actions.pod:1369
6481 " guestfs_egrepi (guestfs_h *g,\n"
6482 " const char *regex,\n"
6483 " const char *path);\n"
6488 #: ../src/guestfs-actions.pod:1374 ../fish/guestfish-actions.pod:912
6489 msgid "This calls the external C<egrep -i> program and returns the matching lines."
6493 #: ../src/guestfs-actions.pod:1386
6494 msgid "guestfs_equal"
6498 #: ../src/guestfs-actions.pod:1388
6502 " guestfs_equal (guestfs_h *g,\n"
6503 " const char *file1,\n"
6504 " const char *file2);\n"
6509 #: ../src/guestfs-actions.pod:1393 ../fish/guestfish-actions.pod:922
6511 "This compares the two files C<file1> and C<file2> and returns true if their "
6512 "content is exactly equal, or false otherwise."
6516 #: ../src/guestfs-actions.pod:1396 ../fish/guestfish-actions.pod:925
6517 msgid "The external L<cmp(1)> program is used for the comparison."
6521 #: ../src/guestfs-actions.pod:1402
6522 msgid "guestfs_exists"
6526 #: ../src/guestfs-actions.pod:1404
6530 " guestfs_exists (guestfs_h *g,\n"
6531 " const char *path);\n"
6536 #: ../src/guestfs-actions.pod:1408 ../fish/guestfish-actions.pod:931
6538 "This returns C<true> if and only if there is a file, directory (or anything) "
6539 "with the given C<path> name."
6543 #: ../src/guestfs-actions.pod:1411
6544 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6548 #: ../src/guestfs-actions.pod:1417
6549 msgid "guestfs_fallocate"
6553 #: ../src/guestfs-actions.pod:1419
6557 " guestfs_fallocate (guestfs_h *g,\n"
6558 " const char *path,\n"
6564 #: ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1450 ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6566 "This command preallocates a file (containing zero bytes) named C<path> of "
6567 "size C<len> bytes. If the file exists already, it is overwritten."
6571 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:944
6573 "Do not confuse this with the guestfish-specific C<alloc> command which "
6574 "allocates a file in the host and attaches it as a device."
6578 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:948
6580 "This function is deprecated. In new code, use the C<fallocate64> call "
6585 #: ../src/guestfs-actions.pod:1443
6586 msgid "guestfs_fallocate64"
6590 #: ../src/guestfs-actions.pod:1445
6594 " guestfs_fallocate64 (guestfs_h *g,\n"
6595 " const char *path,\n"
6601 #: ../src/guestfs-actions.pod:1454
6603 "Note that this call allocates disk blocks for the file. To create a sparse "
6604 "file use C<guestfs_truncate_size> instead."
6608 #: ../src/guestfs-actions.pod:1457
6610 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6611 "oversight it only allowed 30 bit lengths to be specified, effectively "
6612 "limiting the maximum size of files created through that call to 1GB."
6616 #: ../src/guestfs-actions.pod:1462 ../fish/guestfish-actions.pod:971
6618 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6619 "commands which create a file in the host and attach it as a device."
6623 #: ../src/guestfs-actions.pod:1468
6624 msgid "(Added in 1.3.17)"
6628 #: ../src/guestfs-actions.pod:1470
6629 msgid "guestfs_fgrep"
6633 #: ../src/guestfs-actions.pod:1472
6637 " guestfs_fgrep (guestfs_h *g,\n"
6638 " const char *pattern,\n"
6639 " const char *path);\n"
6644 #: ../src/guestfs-actions.pod:1477 ../fish/guestfish-actions.pod:979
6645 msgid "This calls the external C<fgrep> program and returns the matching lines."
6649 #: ../src/guestfs-actions.pod:1489
6650 msgid "guestfs_fgrepi"
6654 #: ../src/guestfs-actions.pod:1491
6658 " guestfs_fgrepi (guestfs_h *g,\n"
6659 " const char *pattern,\n"
6660 " const char *path);\n"
6665 #: ../src/guestfs-actions.pod:1496 ../fish/guestfish-actions.pod:989
6666 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
6670 #: ../src/guestfs-actions.pod:1508
6671 msgid "guestfs_file"
6675 #: ../src/guestfs-actions.pod:1510
6679 " guestfs_file (guestfs_h *g,\n"
6680 " const char *path);\n"
6685 #: ../src/guestfs-actions.pod:1514 ../fish/guestfish-actions.pod:999
6687 "This call uses the standard L<file(1)> command to determine the type or "
6688 "contents of the file."
6692 #: ../src/guestfs-actions.pod:1517 ../fish/guestfish-actions.pod:1002
6694 "This call will also transparently look inside various types of compressed "
6699 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1005
6701 "The exact command which runs is C<file -zb path>. Note in particular that "
6702 "the filename is not prepended to the output (the C<-b> option)."
6706 #: ../src/guestfs-actions.pod:1524
6708 "This command can also be used on C</dev/> devices (and partitions, LV "
6709 "names). You can for example use this to determine if a device contains a "
6710 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
6714 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1014
6716 "If the C<path> does not begin with C</dev/> then this command only works for "
6717 "the content of regular files. For other file types (directory, symbolic "
6718 "link etc) it will just return the string C<directory> etc."
6722 #: ../src/guestfs-actions.pod:1539
6723 msgid "guestfs_file_architecture"
6727 #: ../src/guestfs-actions.pod:1541
6731 " guestfs_file_architecture (guestfs_h *g,\n"
6732 " const char *filename);\n"
6737 #: ../src/guestfs-actions.pod:1545 ../fish/guestfish-actions.pod:1023
6739 "This detects the architecture of the binary C<filename>, and returns it if "
6744 #: ../src/guestfs-actions.pod:1548 ../fish/guestfish-actions.pod:1026
6745 msgid "Currently defined architectures are:"
6749 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
6754 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1032
6756 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6757 "irrespective of the precise processor requirements of the binary."
6761 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
6766 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
6767 msgid "64 bit x86-64."
6771 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
6776 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
6777 msgid "32 bit SPARC."
6781 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
6786 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
6787 msgid "64 bit SPARC V9 and above."
6791 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
6796 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
6797 msgid "Intel Itanium."
6801 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
6806 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
6807 msgid "32 bit Power PC."
6811 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
6816 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1057
6817 msgid "64 bit Power PC."
6821 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
6822 msgid "Libguestfs may return other architecture strings in future."
6826 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1063
6827 msgid "The function works on at least the following types of files:"
6831 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1069
6832 msgid "many types of Un*x and Linux binary"
6836 #: ../src/guestfs-actions.pod:1595 ../fish/guestfish-actions.pod:1073
6837 msgid "many types of Un*x and Linux shared library"
6841 #: ../src/guestfs-actions.pod:1599 ../fish/guestfish-actions.pod:1077
6842 msgid "Windows Win32 and Win64 binaries"
6846 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
6847 msgid "Windows Win32 and Win64 DLLs"
6851 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
6852 msgid "Win32 binaries and DLLs return C<i386>."
6856 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1085
6857 msgid "Win64 binaries and DLLs return C<x86_64>."
6861 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1089
6862 msgid "Linux kernel modules"
6866 #: ../src/guestfs-actions.pod:1615 ../fish/guestfish-actions.pod:1093
6867 msgid "Linux new-style initrd images"
6871 #: ../src/guestfs-actions.pod:1619 ../fish/guestfish-actions.pod:1097
6872 msgid "some non-x86 Linux vmlinuz kernels"
6876 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1101
6877 msgid "What it can't do currently:"
6881 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1107
6882 msgid "static libraries (libfoo.a)"
6886 #: ../src/guestfs-actions.pod:1633 ../fish/guestfish-actions.pod:1111
6887 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6891 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
6892 msgid "x86 Linux vmlinuz kernels"
6896 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1117
6898 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6899 "compressed code, and are horribly hard to unpack. If you want to find the "
6900 "architecture of a kernel, use the architecture of the associated initrd or "
6901 "kernel module(s) instead."
6905 #: ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1812 ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2587 ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2657 ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2774 ../src/guestfs-actions.pod:2836 ../src/guestfs-actions.pod:3009 ../src/guestfs-actions.pod:3141
6906 msgid "(Added in 1.5.3)"
6910 #: ../src/guestfs-actions.pod:1651
6911 msgid "guestfs_filesize"
6915 #: ../src/guestfs-actions.pod:1653
6919 " guestfs_filesize (guestfs_h *g,\n"
6920 " const char *file);\n"
6925 #: ../src/guestfs-actions.pod:1657 ../fish/guestfish-actions.pod:1128
6926 msgid "This command returns the size of C<file> in bytes."
6930 #: ../src/guestfs-actions.pod:1659
6932 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6933 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6934 "devices, use C<guestfs_blockdev_getsize64>."
6938 #: ../src/guestfs-actions.pod:1665
6939 msgid "(Added in 1.0.82)"
6943 #: ../src/guestfs-actions.pod:1667
6944 msgid "guestfs_fill"
6948 #: ../src/guestfs-actions.pod:1669
6952 " guestfs_fill (guestfs_h *g,\n"
6955 " const char *path);\n"
6960 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1138
6962 "This command creates a new file called C<path>. The initial content of the "
6963 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6968 #: ../src/guestfs-actions.pod:1679
6970 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6971 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6972 "bytes use C<guestfs_fill_pattern>."
6976 #: ../src/guestfs-actions.pod:1691
6977 msgid "(Added in 1.0.79)"
6981 #: ../src/guestfs-actions.pod:1693
6982 msgid "guestfs_fill_pattern"
6986 #: ../src/guestfs-actions.pod:1695
6990 " guestfs_fill_pattern (guestfs_h *g,\n"
6991 " const char *pattern,\n"
6993 " const char *path);\n"
6998 #: ../src/guestfs-actions.pod:1701
7000 "This function is like C<guestfs_fill> except that it creates a new file of "
7001 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7002 "pattern is truncated if necessary to ensure the length of the file is "
7003 "exactly C<len> bytes."
7007 #: ../src/guestfs-actions.pod:1713
7008 msgid "(Added in 1.3.12)"
7012 #: ../src/guestfs-actions.pod:1715
7013 msgid "guestfs_find"
7017 #: ../src/guestfs-actions.pod:1717
7021 " guestfs_find (guestfs_h *g,\n"
7022 " const char *directory);\n"
7027 #: ../src/guestfs-actions.pod:1721 ../fish/guestfish-actions.pod:1160
7029 "This command lists out all files and directories, recursively, starting at "
7030 "C<directory>. It is essentially equivalent to running the shell command "
7031 "C<find directory -print> but some post-processing happens on the output, "
7036 #: ../src/guestfs-actions.pod:1726 ../fish/guestfish-actions.pod:1165
7038 "This returns a list of strings I<without any prefix>. Thus if the directory "
7043 #: ../src/guestfs-actions.pod:1729 ../fish/guestfish-actions.pod:1168
7053 #: ../src/guestfs-actions.pod:1733
7054 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7058 #: ../src/guestfs-actions.pod:1736 ../fish/guestfish-actions.pod:1175
7069 #: ../src/guestfs-actions.pod:1741 ../fish/guestfish-actions.pod:1180
7070 msgid "If C<directory> is not a directory, then this command returns an error."
7074 #: ../src/guestfs-actions.pod:1744 ../fish/guestfish-actions.pod:1183
7075 msgid "The returned list is sorted."
7079 #: ../src/guestfs-actions.pod:1746
7080 msgid "See also C<guestfs_find0>."
7084 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:3800 ../src/guestfs-actions.pod:5327
7085 msgid "(Added in 1.0.27)"
7089 #: ../src/guestfs-actions.pod:1757
7090 msgid "guestfs_find0"
7094 #: ../src/guestfs-actions.pod:1759
7098 " guestfs_find0 (guestfs_h *g,\n"
7099 " const char *directory,\n"
7100 " const char *files);\n"
7105 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1194
7107 "This command lists out all files and directories, recursively, starting at "
7108 "C<directory>, placing the resulting list in the external file called "
7113 #: ../src/guestfs-actions.pod:1768
7115 "This command works the same way as C<guestfs_find> with the following "
7120 #: ../src/guestfs-actions.pod:1775 ../fish/guestfish-actions.pod:1205
7121 msgid "The resulting list is written to an external file."
7125 #: ../src/guestfs-actions.pod:1779 ../fish/guestfish-actions.pod:1209
7127 "Items (filenames) in the result are separated by C<\\0> characters. See "
7128 "L<find(1)> option I<-print0>."
7132 #: ../src/guestfs-actions.pod:1784 ../fish/guestfish-actions.pod:1214
7133 msgid "This command is not limited in the number of names that it can return."
7137 #: ../src/guestfs-actions.pod:1789 ../fish/guestfish-actions.pod:1219
7138 msgid "The result list is not sorted."
7142 #: ../src/guestfs-actions.pod:1795
7143 msgid "(Added in 1.0.74)"
7147 #: ../src/guestfs-actions.pod:1797
7148 msgid "guestfs_findfs_label"
7152 #: ../src/guestfs-actions.pod:1799
7156 " guestfs_findfs_label (guestfs_h *g,\n"
7157 " const char *label);\n"
7162 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1229
7164 "This command searches the filesystems and returns the one which has the "
7165 "given label. An error is returned if no such filesystem can be found."
7169 #: ../src/guestfs-actions.pod:1807
7170 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7174 #: ../src/guestfs-actions.pod:1814
7175 msgid "guestfs_findfs_uuid"
7179 #: ../src/guestfs-actions.pod:1816
7183 " guestfs_findfs_uuid (guestfs_h *g,\n"
7184 " const char *uuid);\n"
7189 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1239
7191 "This command searches the filesystems and returns the one which has the "
7192 "given UUID. An error is returned if no such filesystem can be found."
7196 #: ../src/guestfs-actions.pod:1824
7197 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7201 #: ../src/guestfs-actions.pod:1831
7202 msgid "guestfs_fsck"
7206 #: ../src/guestfs-actions.pod:1833
7210 " guestfs_fsck (guestfs_h *g,\n"
7211 " const char *fstype,\n"
7212 " const char *device);\n"
7217 #: ../src/guestfs-actions.pod:1838 ../fish/guestfish-actions.pod:1249
7219 "This runs the filesystem checker (fsck) on C<device> which should have "
7220 "filesystem type C<fstype>."
7224 #: ../src/guestfs-actions.pod:1841 ../fish/guestfish-actions.pod:1252
7226 "The returned integer is the status. See L<fsck(8)> for the list of status "
7227 "codes from C<fsck>."
7231 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:1261
7232 msgid "Multiple status codes can be summed together."
7236 #: ../src/guestfs-actions.pod:1854 ../fish/guestfish-actions.pod:1265
7238 "A non-zero return code can mean \"success\", for example if errors have been "
7239 "corrected on the filesystem."
7243 #: ../src/guestfs-actions.pod:1859 ../fish/guestfish-actions.pod:1270
7244 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7248 #: ../src/guestfs-actions.pod:1864 ../fish/guestfish-actions.pod:1275
7249 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7253 #: ../src/guestfs-actions.pod:1868 ../src/guestfs-actions.pod:6974
7254 msgid "(Added in 1.0.16)"
7258 #: ../src/guestfs-actions.pod:1870
7259 msgid "guestfs_get_append"
7263 #: ../src/guestfs-actions.pod:1872
7267 " guestfs_get_append (guestfs_h *g);\n"
7272 #: ../src/guestfs-actions.pod:1875 ../fish/guestfish-actions.pod:1281
7274 "Return the additional kernel options which are added to the guest kernel "
7279 #: ../src/guestfs-actions.pod:1878 ../fish/guestfish-actions.pod:1284
7280 msgid "If C<NULL> then no options are added."
7284 #: ../src/guestfs-actions.pod:1880
7286 "This function returns a string which may be NULL. There is no way to return "
7287 "an error from this function. The string is owned by the guest handle and "
7288 "must I<not> be freed."
7292 #: ../src/guestfs-actions.pod:1884 ../src/guestfs-actions.pod:5005 ../src/guestfs-actions.pod:5468 ../src/guestfs-actions.pod:5836 ../src/guestfs-actions.pod:5855 ../src/guestfs-actions.pod:5871 ../src/guestfs-actions.pod:5888 ../src/guestfs-actions.pod:6645 ../src/guestfs-actions.pod:6663 ../src/guestfs-actions.pod:7017
7293 msgid "(Added in 1.0.26)"
7297 #: ../src/guestfs-actions.pod:1886
7298 msgid "guestfs_get_autosync"
7302 #: ../src/guestfs-actions.pod:1888
7306 " guestfs_get_autosync (guestfs_h *g);\n"
7311 #: ../src/guestfs-actions.pod:1891 ../fish/guestfish-actions.pod:1290
7312 msgid "Get the autosync flag."
7316 #: ../src/guestfs-actions.pod:1897
7317 msgid "guestfs_get_direct"
7321 #: ../src/guestfs-actions.pod:1899
7325 " guestfs_get_direct (guestfs_h *g);\n"
7330 #: ../src/guestfs-actions.pod:1902 ../fish/guestfish-actions.pod:1296
7331 msgid "Return the direct appliance mode flag."
7335 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:5509
7336 msgid "(Added in 1.0.72)"
7340 #: ../src/guestfs-actions.pod:1908
7341 msgid "guestfs_get_e2label"
7345 #: ../src/guestfs-actions.pod:1910
7349 " guestfs_get_e2label (guestfs_h *g,\n"
7350 " const char *device);\n"
7355 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1302
7356 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7360 #: ../src/guestfs-actions.pod:1920 ../fish/guestfish-actions.pod:1305
7362 "This function is deprecated. In new code, use the C<vfs_label> call "
7367 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:1948 ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5546
7368 msgid "(Added in 1.0.15)"
7372 #: ../src/guestfs-actions.pod:1929
7373 msgid "guestfs_get_e2uuid"
7377 #: ../src/guestfs-actions.pod:1931
7381 " guestfs_get_e2uuid (guestfs_h *g,\n"
7382 " const char *device);\n"
7387 #: ../src/guestfs-actions.pod:1935 ../fish/guestfish-actions.pod:1316
7388 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7392 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1319
7393 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7397 #: ../src/guestfs-actions.pod:1950
7398 msgid "guestfs_get_memsize"
7402 #: ../src/guestfs-actions.pod:1952
7406 " guestfs_get_memsize (guestfs_h *g);\n"
7411 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1330
7412 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
7416 #: ../src/guestfs-actions.pod:1958
7418 "If C<guestfs_set_memsize> was not called on this handle, and if "
7419 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7420 "value for memsize."
7424 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:2043 ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5669 ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388 ../fish/guestfish-actions.pod:3711 ../fish/guestfish-actions.pod:3798
7425 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7429 #: ../src/guestfs-actions.pod:1967 ../src/guestfs-actions.pod:4091 ../src/guestfs-actions.pod:4272 ../src/guestfs-actions.pod:4291 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4322 ../src/guestfs-actions.pod:4339 ../src/guestfs-actions.pod:4352 ../src/guestfs-actions.pod:5230 ../src/guestfs-actions.pod:5567 ../src/guestfs-actions.pod:5810 ../src/guestfs-actions.pod:6411
7430 msgid "(Added in 1.0.55)"
7434 #: ../src/guestfs-actions.pod:1969
7435 msgid "guestfs_get_network"
7439 #: ../src/guestfs-actions.pod:1971
7443 " guestfs_get_network (guestfs_h *g);\n"
7448 #: ../src/guestfs-actions.pod:1974 ../fish/guestfish-actions.pod:1344
7449 msgid "This returns the enable network flag."
7453 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:5586
7454 msgid "(Added in 1.5.4)"
7458 #: ../src/guestfs-actions.pod:1980
7459 msgid "guestfs_get_path"
7463 #: ../src/guestfs-actions.pod:1982
7467 " guestfs_get_path (guestfs_h *g);\n"
7472 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
7473 msgid "Return the current search path."
7477 #: ../src/guestfs-actions.pod:1987 ../fish/guestfish-actions.pod:1352
7479 "This is always non-NULL. If it wasn't set already, then this will return "
7484 #: ../src/guestfs-actions.pod:1990 ../src/guestfs-actions.pod:2019
7486 "This function returns a string, or NULL on error. The string is owned by "
7487 "the guest handle and must I<not> be freed."
7491 #: ../src/guestfs-actions.pod:1995
7492 msgid "guestfs_get_pid"
7496 #: ../src/guestfs-actions.pod:1997
7500 " guestfs_get_pid (guestfs_h *g);\n"
7505 #: ../src/guestfs-actions.pod:2000 ../fish/guestfish-actions.pod:1361
7507 "Return the process ID of the qemu subprocess. If there is no qemu "
7508 "subprocess, then this will return an error."
7512 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1364
7513 msgid "This is an internal call used for debugging and testing."
7517 #: ../src/guestfs-actions.pod:2007
7518 msgid "(Added in 1.0.56)"
7522 #: ../src/guestfs-actions.pod:2009
7523 msgid "guestfs_get_qemu"
7527 #: ../src/guestfs-actions.pod:2011
7531 " guestfs_get_qemu (guestfs_h *g);\n"
7536 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
7537 msgid "Return the current qemu binary."
7541 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
7543 "This is always non-NULL. If it wasn't set already, then this will return "
7544 "the default qemu binary name."
7548 #: ../src/guestfs-actions.pod:2022 ../src/guestfs-actions.pod:5631
7549 msgid "(Added in 1.0.6)"
7553 #: ../src/guestfs-actions.pod:2024
7554 msgid "guestfs_get_recovery_proc"
7558 #: ../src/guestfs-actions.pod:2026
7562 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7567 #: ../src/guestfs-actions.pod:2029 ../fish/guestfish-actions.pod:1379
7568 msgid "Return the recovery process enabled flag."
7572 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:3231 ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3898 ../src/guestfs-actions.pod:3930 ../src/guestfs-actions.pod:4935 ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5655 ../src/guestfs-actions.pod:6314 ../src/guestfs-actions.pod:6334 ../src/guestfs-actions.pod:6526
7573 msgid "(Added in 1.0.77)"
7577 #: ../src/guestfs-actions.pod:2035
7578 msgid "guestfs_get_selinux"
7582 #: ../src/guestfs-actions.pod:2037
7586 " guestfs_get_selinux (guestfs_h *g);\n"
7591 #: ../src/guestfs-actions.pod:2040
7593 "This returns the current setting of the selinux flag which is passed to the "
7594 "appliance at boot time. See C<guestfs_set_selinux>."
7598 #: ../src/guestfs-actions.pod:2048 ../src/guestfs-actions.pod:2111 ../src/guestfs-actions.pod:5674 ../src/guestfs-actions.pod:5728
7599 msgid "(Added in 1.0.67)"
7603 #: ../src/guestfs-actions.pod:2050
7604 msgid "guestfs_get_state"
7608 #: ../src/guestfs-actions.pod:2052
7612 " guestfs_get_state (guestfs_h *g);\n"
7617 #: ../src/guestfs-actions.pod:2055 ../fish/guestfish-actions.pod:1395
7619 "This returns the current state as an opaque integer. This is only useful "
7620 "for printing debug and internal error messages."
7624 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:3034 ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3124 ../src/guestfs-actions.pod:3151 ../fish/guestfish-actions.pod:1398 ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2131 ../fish/guestfish-actions.pod:2169 ../fish/guestfish-actions.pod:2185
7625 msgid "For more information on states, see L<guestfs(3)>."
7629 #: ../src/guestfs-actions.pod:2064
7630 msgid "guestfs_get_trace"
7634 #: ../src/guestfs-actions.pod:2066
7638 " guestfs_get_trace (guestfs_h *g);\n"
7643 #: ../src/guestfs-actions.pod:2069 ../fish/guestfish-actions.pod:1404
7644 msgid "Return the command trace flag."
7648 #: ../src/guestfs-actions.pod:2075
7649 msgid "guestfs_get_umask"
7653 #: ../src/guestfs-actions.pod:2077
7657 " guestfs_get_umask (guestfs_h *g);\n"
7662 #: ../src/guestfs-actions.pod:2080
7664 "Return the current umask. By default the umask is C<022> unless it has been "
7665 "set by calling C<guestfs_umask>."
7669 #: ../src/guestfs-actions.pod:2087
7670 msgid "guestfs_get_verbose"
7674 #: ../src/guestfs-actions.pod:2089
7678 " guestfs_get_verbose (guestfs_h *g);\n"
7683 #: ../src/guestfs-actions.pod:2092 ../fish/guestfish-actions.pod:1417
7684 msgid "This returns the verbose messages flag."
7688 #: ../src/guestfs-actions.pod:2098
7689 msgid "guestfs_getcon"
7693 #: ../src/guestfs-actions.pod:2100
7697 " guestfs_getcon (guestfs_h *g);\n"
7702 #: ../src/guestfs-actions.pod:2103 ../fish/guestfish-actions.pod:1423
7703 msgid "This gets the SELinux security context of the daemon."
7707 #: ../src/guestfs-actions.pod:2105
7708 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
7712 #: ../src/guestfs-actions.pod:2113
7713 msgid "guestfs_getxattrs"
7717 #: ../src/guestfs-actions.pod:2115
7720 " struct guestfs_xattr_list *\n"
7721 " guestfs_getxattrs (guestfs_h *g,\n"
7722 " const char *path);\n"
7727 #: ../src/guestfs-actions.pod:2119 ../fish/guestfish-actions.pod:1432
7728 msgid "This call lists the extended attributes of the file or directory C<path>."
7732 #: ../src/guestfs-actions.pod:2122 ../fish/guestfish-actions.pod:1435
7734 "At the system call level, this is a combination of the L<listxattr(2)> and "
7735 "L<getxattr(2)> calls."
7739 #: ../src/guestfs-actions.pod:2125
7740 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
7744 #: ../src/guestfs-actions.pod:2127 ../src/guestfs-actions.pod:3243 ../src/guestfs-actions.pod:3894
7746 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
7747 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
7751 #: ../src/guestfs-actions.pod:2131 ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3448 ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5747 ../src/guestfs-actions.pod:7082
7752 msgid "(Added in 1.0.59)"
7756 #: ../src/guestfs-actions.pod:2133
7757 msgid "guestfs_glob_expand"
7761 #: ../src/guestfs-actions.pod:2135
7765 " guestfs_glob_expand (guestfs_h *g,\n"
7766 " const char *pattern);\n"
7771 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1444
7773 "This command searches for all the pathnames matching C<pattern> according to "
7774 "the wildcard expansion rules used by the shell."
7778 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1448
7779 msgid "If no paths match, then this returns an empty list (note: not an error)."
7783 #: ../src/guestfs-actions.pod:2146 ../fish/guestfish-actions.pod:1451
7785 "It is just a wrapper around the C L<glob(3)> function with flags "
7786 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
7790 #: ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:5929
7791 msgid "(Added in 1.0.50)"
7795 #: ../src/guestfs-actions.pod:2156
7796 msgid "guestfs_grep"
7800 #: ../src/guestfs-actions.pod:2158
7804 " guestfs_grep (guestfs_h *g,\n"
7805 " const char *regex,\n"
7806 " const char *path);\n"
7811 #: ../src/guestfs-actions.pod:2163 ../fish/guestfish-actions.pod:1459
7812 msgid "This calls the external C<grep> program and returns the matching lines."
7816 #: ../src/guestfs-actions.pod:2175
7817 msgid "guestfs_grepi"
7821 #: ../src/guestfs-actions.pod:2177
7825 " guestfs_grepi (guestfs_h *g,\n"
7826 " const char *regex,\n"
7827 " const char *path);\n"
7832 #: ../src/guestfs-actions.pod:2182 ../fish/guestfish-actions.pod:1469
7833 msgid "This calls the external C<grep -i> program and returns the matching lines."
7837 #: ../src/guestfs-actions.pod:2194
7838 msgid "guestfs_grub_install"
7842 #: ../src/guestfs-actions.pod:2196
7846 " guestfs_grub_install (guestfs_h *g,\n"
7847 " const char *root,\n"
7848 " const char *device);\n"
7853 #: ../src/guestfs-actions.pod:2201 ../fish/guestfish-actions.pod:1479
7855 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7856 "the root directory being C<root>."
7860 #: ../src/guestfs-actions.pod:2204 ../fish/guestfish-actions.pod:1482
7862 "Note: If grub-install reports the error \"No suitable drive was found in the "
7863 "generated device map.\" it may be that you need to create a "
7864 "C</boot/grub/device.map> file first that contains the mapping between grub "
7865 "device names and Linux device names. It is usually sufficient to create a "
7870 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1489
7878 #: ../src/guestfs-actions.pod:2213 ../fish/guestfish-actions.pod:1491
7879 msgid "replacing C</dev/vda> with the name of the installation device."
7883 #: ../src/guestfs-actions.pod:2217
7884 msgid "(Added in 1.0.17)"
7888 #: ../src/guestfs-actions.pod:2219
7889 msgid "guestfs_head"
7893 #: ../src/guestfs-actions.pod:2221
7897 " guestfs_head (guestfs_h *g,\n"
7898 " const char *path);\n"
7903 #: ../src/guestfs-actions.pod:2225 ../fish/guestfish-actions.pod:1497
7905 "This command returns up to the first 10 lines of a file as a list of "
7910 #: ../src/guestfs-actions.pod:2237
7911 msgid "guestfs_head_n"
7915 #: ../src/guestfs-actions.pod:2239
7919 " guestfs_head_n (guestfs_h *g,\n"
7921 " const char *path);\n"
7926 #: ../src/guestfs-actions.pod:2244 ../fish/guestfish-actions.pod:1507
7928 "If the parameter C<nrlines> is a positive number, this returns the first "
7929 "C<nrlines> lines of the file C<path>."
7933 #: ../src/guestfs-actions.pod:2247 ../fish/guestfish-actions.pod:1510
7935 "If the parameter C<nrlines> is a negative number, this returns lines from "
7936 "the file C<path>, excluding the last C<nrlines> lines."
7940 #: ../src/guestfs-actions.pod:2250 ../src/guestfs-actions.pod:6209 ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:4144
7941 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7945 #: ../src/guestfs-actions.pod:2261
7946 msgid "guestfs_hexdump"
7950 #: ../src/guestfs-actions.pod:2263
7954 " guestfs_hexdump (guestfs_h *g,\n"
7955 " const char *path);\n"
7960 #: ../src/guestfs-actions.pod:2267 ../fish/guestfish-actions.pod:1522
7962 "This runs C<hexdump -C> on the given C<path>. The result is the "
7963 "human-readable, canonical hex dump of the file."
7967 #: ../src/guestfs-actions.pod:2276 ../src/guestfs-actions.pod:5993 ../src/guestfs-actions.pod:6048
7968 msgid "(Added in 1.0.22)"
7972 #: ../src/guestfs-actions.pod:2278
7973 msgid "guestfs_initrd_cat"
7977 #: ../src/guestfs-actions.pod:2280
7981 " guestfs_initrd_cat (guestfs_h *g,\n"
7982 " const char *initrdpath,\n"
7983 " const char *filename,\n"
7984 " size_t *size_r);\n"
7989 #: ../src/guestfs-actions.pod:2286 ../fish/guestfish-actions.pod:1532
7991 "This command unpacks the file C<filename> from the initrd file called "
7992 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7997 #: ../src/guestfs-actions.pod:2290 ../fish/guestfish-actions.pod:1536
7999 "For example, in guestfish you could use the following command to examine the "
8000 "boot script (usually called C</init>) contained in a Linux initrd or "
8005 #: ../src/guestfs-actions.pod:2294 ../fish/guestfish-actions.pod:1540
8008 " initrd-cat /boot/initrd-<version>.img init\n"
8013 #: ../src/guestfs-actions.pod:2296
8014 msgid "See also C<guestfs_initrd_list>."
8018 #: ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:4928 ../src/guestfs-actions.pod:4954 ../src/guestfs-actions.pod:5135
8020 "This function returns a buffer, or NULL on error. The size of the returned "
8021 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8026 #: ../src/guestfs-actions.pod:2307
8027 msgid "guestfs_initrd_list"
8031 #: ../src/guestfs-actions.pod:2309
8035 " guestfs_initrd_list (guestfs_h *g,\n"
8036 " const char *path);\n"
8041 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1551
8042 msgid "This command lists out files contained in an initrd."
8046 #: ../src/guestfs-actions.pod:2315 ../fish/guestfish-actions.pod:1553
8048 "The files are listed without any initial C</> character. The files are "
8049 "listed in the order they appear (not necessarily alphabetical). Directory "
8050 "names are listed as separate items."
8054 #: ../src/guestfs-actions.pod:2319 ../fish/guestfish-actions.pod:1557
8056 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8057 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8062 #: ../src/guestfs-actions.pod:2329
8063 msgid "guestfs_inotify_add_watch"
8067 #: ../src/guestfs-actions.pod:2331
8071 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8072 " const char *path,\n"
8078 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1565
8079 msgid "Watch C<path> for the events listed in C<mask>."
8083 #: ../src/guestfs-actions.pod:2338 ../fish/guestfish-actions.pod:1567
8085 "Note that if C<path> is a directory then events within that directory are "
8086 "watched, but this does I<not> happen recursively (in subdirectories)."
8090 #: ../src/guestfs-actions.pod:2342 ../fish/guestfish-actions.pod:1571
8092 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8093 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8097 #: ../src/guestfs-actions.pod:2350
8098 msgid "guestfs_inotify_close"
8102 #: ../src/guestfs-actions.pod:2352
8106 " guestfs_inotify_close (guestfs_h *g);\n"
8111 #: ../src/guestfs-actions.pod:2355 ../fish/guestfish-actions.pod:1579
8113 "This closes the inotify handle which was previously opened by inotify_init. "
8114 "It removes all watches, throws away any pending events, and deallocates all "
8119 #: ../src/guestfs-actions.pod:2363
8120 msgid "guestfs_inotify_files"
8124 #: ../src/guestfs-actions.pod:2365
8128 " guestfs_inotify_files (guestfs_h *g);\n"
8133 #: ../src/guestfs-actions.pod:2368
8135 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8136 "returns a list of pathnames of objects that were touched. The returned "
8137 "pathnames are sorted and deduplicated."
8141 #: ../src/guestfs-actions.pod:2378
8142 msgid "guestfs_inotify_init"
8146 #: ../src/guestfs-actions.pod:2380
8150 " guestfs_inotify_init (guestfs_h *g,\n"
8151 " int maxevents);\n"
8156 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1595
8158 "This command creates a new inotify handle. The inotify subsystem can be "
8159 "used to notify events which happen to objects in the guest filesystem."
8163 #: ../src/guestfs-actions.pod:2388
8165 "C<maxevents> is the maximum number of events which will be queued up between "
8166 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8167 "passed as C<0>, then the kernel (or previously set) default is used. For "
8168 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8169 "throws away events, but records the fact that it threw them away by setting "
8170 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8171 "C<guestfs_inotify_read>)."
8175 #: ../src/guestfs-actions.pod:2398
8177 "Before any events are generated, you have to add some watches to the "
8178 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8179 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8183 #: ../src/guestfs-actions.pod:2404
8185 "Queued up events should be read periodically by calling "
8186 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8187 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8188 "often enough then you risk the internal queue overflowing."
8192 #: ../src/guestfs-actions.pod:2411
8194 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8195 "This also removes any watches automatically."
8199 #: ../src/guestfs-actions.pod:2415 ../fish/guestfish-actions.pod:1626
8201 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8202 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8203 "that there is one global inotify handle per libguestfs instance."
8207 #: ../src/guestfs-actions.pod:2424
8208 msgid "guestfs_inotify_read"
8212 #: ../src/guestfs-actions.pod:2426
8215 " struct guestfs_inotify_event_list *\n"
8216 " guestfs_inotify_read (guestfs_h *g);\n"
8221 #: ../src/guestfs-actions.pod:2429 ../fish/guestfish-actions.pod:1635
8223 "Return the complete queue of events that have happened since the previous "
8228 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1638
8229 msgid "If no events have happened, this returns an empty list."
8233 #: ../src/guestfs-actions.pod:2434 ../fish/guestfish-actions.pod:1640
8235 "I<Note>: In order to make sure that all events have been read, you must call "
8236 "this function repeatedly until it returns an empty list. The reason is that "
8237 "the call will read events up to the maximum appliance-to-host message size "
8238 "and leave remaining events in the queue."
8242 #: ../src/guestfs-actions.pod:2440
8244 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8245 "there was an error. I<The caller must call "
8246 "C<guestfs_free_inotify_event_list> after use>."
8250 #: ../src/guestfs-actions.pod:2446
8251 msgid "guestfs_inotify_rm_watch"
8255 #: ../src/guestfs-actions.pod:2448
8259 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8265 #: ../src/guestfs-actions.pod:2452
8267 "Remove a previously defined inotify watch. See "
8268 "C<guestfs_inotify_add_watch>."
8272 #: ../src/guestfs-actions.pod:2459
8273 msgid "guestfs_inspect_get_arch"
8277 #: ../src/guestfs-actions.pod:2461
8281 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8282 " const char *root);\n"
8287 #: ../src/guestfs-actions.pod:2465 ../src/guestfs-actions.pod:2488 ../src/guestfs-actions.pod:2569 ../src/guestfs-actions.pod:2595 ../src/guestfs-actions.pod:2617 ../src/guestfs-actions.pod:2644 ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:2698 ../src/guestfs-actions.pod:2727 ../src/guestfs-actions.pod:2758 ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2844 ../src/guestfs-actions.pod:2867
8289 "This function should only be called with a root device string as returned by "
8290 "C<guestfs_inspect_os>."
8294 #: ../src/guestfs-actions.pod:2468
8296 "This returns the architecture of the inspected operating system. The "
8297 "possible return values are listed under C<guestfs_file_architecture>."
8301 #: ../src/guestfs-actions.pod:2472 ../fish/guestfish-actions.pod:1664
8303 "If the architecture could not be determined, then the string C<unknown> is "
8308 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2556 ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2745 ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:2854 ../src/guestfs-actions.pod:2960 ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:1667 ../fish/guestfish-actions.pod:1741 ../fish/guestfish-actions.pod:1774 ../fish/guestfish-actions.pod:1795 ../fish/guestfish-actions.pod:1855 ../fish/guestfish-actions.pod:1879 ../fish/guestfish-actions.pod:1896 ../fish/guestfish-actions.pod:1909 ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1960 ../fish/guestfish-actions.pod:2059 ../fish/guestfish-actions.pod:2093
8309 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8313 #: ../src/guestfs-actions.pod:2482
8314 msgid "guestfs_inspect_get_distro"
8318 #: ../src/guestfs-actions.pod:2484
8322 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8323 " const char *root);\n"
8328 #: ../src/guestfs-actions.pod:2491 ../fish/guestfish-actions.pod:1676
8329 msgid "This returns the distro (distribution) of the inspected operating system."
8333 #: ../src/guestfs-actions.pod:2494 ../fish/guestfish-actions.pod:1679
8334 msgid "Currently defined distros are:"
8338 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1683
8339 msgid "\"archlinux\""
8343 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1685
8348 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1687
8353 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1689
8358 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1691
8363 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1693
8368 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1695
8373 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1697
8378 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1699
8379 msgid "\"linuxmint\""
8383 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1701
8388 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1703
8389 msgid "\"mandriva\""
8393 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1705
8398 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1707
8403 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1709
8408 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1711
8413 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1713
8418 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1715
8419 msgid "\"redhat-based\""
8423 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1717
8424 msgid "Some Red Hat-derived distro."
8428 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1719
8433 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1721
8434 msgid "Red Hat Enterprise Linux and some derivatives."
8438 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1723
8443 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1725
8448 #: ../src/guestfs-actions.pod:2542 ../src/guestfs-actions.pod:2822 ../fish/guestfish-actions.pod:1727 ../fish/guestfish-actions.pod:1935
8453 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1729
8454 msgid "The distro could not be determined."
8458 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:2814 ../fish/guestfish-actions.pod:1731 ../fish/guestfish-actions.pod:1927
8463 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1733
8465 "Windows does not have distributions. This string is returned if the OS type "
8470 #: ../src/guestfs-actions.pod:2553 ../src/guestfs-actions.pod:2828 ../fish/guestfish-actions.pod:1738 ../fish/guestfish-actions.pod:1941
8472 "Future versions of libguestfs may return other strings here. The caller "
8473 "should be prepared to handle any string."
8477 #: ../src/guestfs-actions.pod:2563
8478 msgid "guestfs_inspect_get_filesystems"
8482 #: ../src/guestfs-actions.pod:2565
8486 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8487 " const char *root);\n"
8492 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1750
8494 "This returns a list of all the filesystems that we think are associated with "
8495 "this operating system. This includes the root filesystem, other ordinary "
8496 "filesystems, and non-mounted devices like swap partitions."
8500 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:1755
8502 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8503 "to be shared between operating systems."
8507 #: ../src/guestfs-actions.pod:2580
8509 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8510 "C<guestfs_inspect_get_mountpoints>."
8514 #: ../src/guestfs-actions.pod:2589
8515 msgid "guestfs_inspect_get_hostname"
8519 #: ../src/guestfs-actions.pod:2591
8523 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
8524 " const char *root);\n"
8529 #: ../src/guestfs-actions.pod:2598 ../fish/guestfish-actions.pod:1768
8531 "This function returns the hostname of the operating system as found by "
8532 "inspection of the guest's configuration files."
8536 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:1771
8538 "If the hostname could not be determined, then the string C<unknown> is "
8543 #: ../src/guestfs-actions.pod:2609
8544 msgid "(Added in 1.7.9)"
8548 #: ../src/guestfs-actions.pod:2611
8549 msgid "guestfs_inspect_get_major_version"
8553 #: ../src/guestfs-actions.pod:2613
8557 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
8558 " const char *root);\n"
8563 #: ../src/guestfs-actions.pod:2620 ../fish/guestfish-actions.pod:1783
8564 msgid "This returns the major version number of the inspected operating system."
8568 #: ../src/guestfs-actions.pod:2623 ../fish/guestfish-actions.pod:1786
8570 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8571 "popular public names used by the operating system. Notably the operating "
8572 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8573 "1). You can find out the real versions corresponding to releases of Windows "
8574 "by consulting Wikipedia or MSDN."
8578 #: ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:2650 ../fish/guestfish-actions.pod:1793 ../fish/guestfish-actions.pod:1807
8579 msgid "If the version could not be determined, then C<0> is returned."
8583 #: ../src/guestfs-actions.pod:2638
8584 msgid "guestfs_inspect_get_minor_version"
8588 #: ../src/guestfs-actions.pod:2640
8592 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8593 " const char *root);\n"
8598 #: ../src/guestfs-actions.pod:2647 ../fish/guestfish-actions.pod:1804
8599 msgid "This returns the minor version number of the inspected operating system."
8603 #: ../src/guestfs-actions.pod:2652
8605 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8606 "C<guestfs_inspect_get_major_version>."
8610 #: ../src/guestfs-actions.pod:2659
8611 msgid "guestfs_inspect_get_mountpoints"
8615 #: ../src/guestfs-actions.pod:2661
8619 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
8620 " const char *root);\n"
8625 #: ../src/guestfs-actions.pod:2668 ../fish/guestfish-actions.pod:1819
8627 "This returns a hash of where we think the filesystems associated with this "
8628 "operating system should be mounted. Callers should note that this is at "
8629 "best an educated guess made by reading configuration files such as "
8634 #: ../src/guestfs-actions.pod:2673 ../fish/guestfish-actions.pod:1824
8636 "Each element in the returned hashtable has a key which is the path of the "
8637 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8638 "mounted there (eg. C</dev/sda1>)."
8642 #: ../src/guestfs-actions.pod:2678 ../fish/guestfish-actions.pod:1829
8643 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
8647 #: ../src/guestfs-actions.pod:2681
8649 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8650 "C<guestfs_inspect_get_filesystems>."
8654 #: ../src/guestfs-actions.pod:2684 ../src/guestfs-actions.pod:3300 ../src/guestfs-actions.pod:4494 ../src/guestfs-actions.pod:6350
8656 "This function returns a NULL-terminated array of strings, or NULL if there "
8657 "was an error. The array of strings will always have length C<2n+1>, where "
8658 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
8659 "caller must free the strings and the array after use>."
8663 #: ../src/guestfs-actions.pod:2692
8664 msgid "guestfs_inspect_get_package_format"
8668 #: ../src/guestfs-actions.pod:2694
8672 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
8673 " const char *root);\n"
8678 #: ../src/guestfs-actions.pod:2701
8680 "This function and C<guestfs_inspect_get_package_management> return the "
8681 "package format and package management tool used by the inspected operating "
8682 "system. For example for Fedora these functions would return C<rpm> (package "
8683 "format) and C<yum> (package management)."
8687 #: ../src/guestfs-actions.pod:2707 ../fish/guestfish-actions.pod:1848
8689 "This returns the string C<unknown> if we could not determine the package "
8690 "format I<or> if the operating system does not have a real packaging system "
8695 #: ../src/guestfs-actions.pod:2711 ../fish/guestfish-actions.pod:1852
8697 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
8698 "Future versions of libguestfs may return other strings."
8702 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2750
8703 msgid "(Added in 1.7.5)"
8707 #: ../src/guestfs-actions.pod:2721
8708 msgid "guestfs_inspect_get_package_management"
8712 #: ../src/guestfs-actions.pod:2723
8716 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
8717 " const char *root);\n"
8722 #: ../src/guestfs-actions.pod:2730
8724 "C<guestfs_inspect_get_package_format> and this function return the package "
8725 "format and package management tool used by the inspected operating system. "
8726 "For example for Fedora these functions would return C<rpm> (package format) "
8727 "and C<yum> (package management)."
8731 #: ../src/guestfs-actions.pod:2736 ../fish/guestfish-actions.pod:1870
8733 "This returns the string C<unknown> if we could not determine the package "
8734 "management tool I<or> if the operating system does not have a real packaging "
8735 "system (eg. Windows)."
8739 #: ../src/guestfs-actions.pod:2740 ../fish/guestfish-actions.pod:1874
8741 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8742 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8743 "libguestfs may return other strings."
8747 #: ../src/guestfs-actions.pod:2752
8748 msgid "guestfs_inspect_get_product_name"
8752 #: ../src/guestfs-actions.pod:2754
8756 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
8757 " const char *root);\n"
8762 #: ../src/guestfs-actions.pod:2761 ../fish/guestfish-actions.pod:1888
8764 "This returns the product name of the inspected operating system. The "
8765 "product name is generally some freeform string which can be displayed to the "
8766 "user, but should not be parsed by programs."
8770 #: ../src/guestfs-actions.pod:2766 ../fish/guestfish-actions.pod:1893
8772 "If the product name could not be determined, then the string C<unknown> is "
8777 #: ../src/guestfs-actions.pod:2776
8778 msgid "guestfs_inspect_get_roots"
8782 #: ../src/guestfs-actions.pod:2778
8786 " guestfs_inspect_get_roots (guestfs_h *g);\n"
8791 #: ../src/guestfs-actions.pod:2781
8793 "This function is a convenient way to get the list of root devices, as "
8794 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
8795 "the whole inspection process."
8799 #: ../src/guestfs-actions.pod:2785
8801 "This returns an empty list if either no root devices were found or the "
8802 "caller has not called C<guestfs_inspect_os>."
8806 #: ../src/guestfs-actions.pod:2794
8807 msgid "(Added in 1.7.3)"
8811 #: ../src/guestfs-actions.pod:2796
8812 msgid "guestfs_inspect_get_type"
8816 #: ../src/guestfs-actions.pod:2798
8820 " guestfs_inspect_get_type (guestfs_h *g,\n"
8821 " const char *root);\n"
8826 #: ../src/guestfs-actions.pod:2805 ../fish/guestfish-actions.pod:1918
8828 "This returns the type of the inspected operating system. Currently defined "
8833 #: ../src/guestfs-actions.pod:2810 ../fish/guestfish-actions.pod:1923
8838 #: ../src/guestfs-actions.pod:2812 ../fish/guestfish-actions.pod:1925
8839 msgid "Any Linux-based operating system."
8843 #: ../src/guestfs-actions.pod:2816 ../fish/guestfish-actions.pod:1929
8844 msgid "Any Microsoft Windows operating system."
8848 #: ../src/guestfs-actions.pod:2818 ../fish/guestfish-actions.pod:1931
8853 #: ../src/guestfs-actions.pod:2820 ../fish/guestfish-actions.pod:1933
8858 #: ../src/guestfs-actions.pod:2824 ../fish/guestfish-actions.pod:1937
8859 msgid "The operating system type could not be determined."
8863 #: ../src/guestfs-actions.pod:2838
8864 msgid "guestfs_inspect_get_windows_systemroot"
8868 #: ../src/guestfs-actions.pod:2840
8872 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
8873 " const char *root);\n"
8878 #: ../src/guestfs-actions.pod:2847 ../fish/guestfish-actions.pod:1953
8880 "This returns the Windows systemroot of the inspected guest. The systemroot "
8881 "is a directory path such as C</WINDOWS>."
8885 #: ../src/guestfs-actions.pod:2850 ../fish/guestfish-actions.pod:1956
8887 "This call assumes that the guest is Windows and that the systemroot could be "
8888 "determined by inspection. If this is not the case then an error is "
8893 #: ../src/guestfs-actions.pod:2859
8894 msgid "(Added in 1.5.25)"
8898 #: ../src/guestfs-actions.pod:2861
8899 msgid "guestfs_inspect_list_applications"
8903 #: ../src/guestfs-actions.pod:2863
8906 " struct guestfs_application_list *\n"
8907 " guestfs_inspect_list_applications (guestfs_h *g,\n"
8908 " const char *root);\n"
8913 #: ../src/guestfs-actions.pod:2870 ../fish/guestfish-actions.pod:1969
8914 msgid "Return the list of applications installed in the operating system."
8918 #: ../src/guestfs-actions.pod:2872
8920 "I<Note:> This call works differently from other parts of the inspection "
8921 "API. You have to call C<guestfs_inspect_os>, then "
8922 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
8923 "this. Listing applications is a significantly more difficult operation "
8924 "which requires access to the full filesystem. Also note that unlike the "
8925 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
8926 "the libguestfs handle, this call actually reads parts of the mounted "
8927 "filesystems during the call."
8931 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:1981
8933 "This returns an empty list if the inspection code was not able to determine "
8934 "the list of applications."
8938 #: ../src/guestfs-actions.pod:2885 ../fish/guestfish-actions.pod:1984
8939 msgid "The application structure contains the following fields:"
8943 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:1988
8948 #: ../src/guestfs-actions.pod:2891 ../fish/guestfish-actions.pod:1990
8950 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8951 "guests, this is the package name."
8955 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:1993
8956 msgid "C<app_display_name>"
8960 #: ../src/guestfs-actions.pod:2896 ../fish/guestfish-actions.pod:1995
8962 "The display name of the application, sometimes localized to the install "
8963 "language of the guest operating system."
8967 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:1998
8969 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8970 "to display something can use C<app_name> instead."
8974 #: ../src/guestfs-actions.pod:2902 ../fish/guestfish-actions.pod:2001
8975 msgid "C<app_epoch>"
8979 #: ../src/guestfs-actions.pod:2904 ../fish/guestfish-actions.pod:2003
8981 "For package managers which use epochs, this contains the epoch of the "
8982 "package (an integer). If unavailable, this is returned as C<0>."
8986 #: ../src/guestfs-actions.pod:2907 ../fish/guestfish-actions.pod:2006
8987 msgid "C<app_version>"
8991 #: ../src/guestfs-actions.pod:2909 ../fish/guestfish-actions.pod:2008
8993 "The version string of the application or package. If unavailable this is "
8994 "returned as an empty string C<\"\">."
8998 #: ../src/guestfs-actions.pod:2912 ../fish/guestfish-actions.pod:2011
8999 msgid "C<app_release>"
9003 #: ../src/guestfs-actions.pod:2914 ../fish/guestfish-actions.pod:2013
9005 "The release string of the application or package, for package managers that "
9006 "use this. If unavailable this is returned as an empty string C<\"\">."
9010 #: ../src/guestfs-actions.pod:2918 ../fish/guestfish-actions.pod:2017
9011 msgid "C<app_install_path>"
9015 #: ../src/guestfs-actions.pod:2920 ../fish/guestfish-actions.pod:2019
9017 "The installation path of the application (on operating systems such as "
9018 "Windows which use installation paths). This path is in the format used by "
9019 "the guest operating system, it is not a libguestfs path."
9023 #: ../src/guestfs-actions.pod:2925 ../fish/guestfish-actions.pod:2024
9024 msgid "If unavailable this is returned as an empty string C<\"\">."
9028 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2026
9029 msgid "C<app_trans_path>"
9033 #: ../src/guestfs-actions.pod:2929 ../fish/guestfish-actions.pod:2028
9035 "The install path translated into a libguestfs path. If unavailable this is "
9036 "returned as an empty string C<\"\">."
9040 #: ../src/guestfs-actions.pod:2932 ../fish/guestfish-actions.pod:2031
9041 msgid "C<app_publisher>"
9045 #: ../src/guestfs-actions.pod:2934 ../fish/guestfish-actions.pod:2033
9047 "The name of the publisher of the application, for package managers that use "
9048 "this. If unavailable this is returned as an empty string C<\"\">."
9052 #: ../src/guestfs-actions.pod:2938 ../fish/guestfish-actions.pod:2037
9057 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2039
9059 "The URL (eg. upstream URL) of the application. If unavailable this is "
9060 "returned as an empty string C<\"\">."
9064 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2042
9065 msgid "C<app_source_package>"
9069 #: ../src/guestfs-actions.pod:2945 ../fish/guestfish-actions.pod:2044
9071 "For packaging systems which support this, the name of the source package. "
9072 "If unavailable this is returned as an empty string C<\"\">."
9076 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2047
9077 msgid "C<app_summary>"
9081 #: ../src/guestfs-actions.pod:2950 ../fish/guestfish-actions.pod:2049
9083 "A short (usually one line) description of the application or package. If "
9084 "unavailable this is returned as an empty string C<\"\">."
9088 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2052
9089 msgid "C<app_description>"
9093 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2054
9095 "A longer description of the application or package. If unavailable this is "
9096 "returned as an empty string C<\"\">."
9100 #: ../src/guestfs-actions.pod:2962
9102 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9103 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9108 #: ../src/guestfs-actions.pod:2966
9109 msgid "(Added in 1.7.8)"
9113 #: ../src/guestfs-actions.pod:2968
9114 msgid "guestfs_inspect_os"
9118 #: ../src/guestfs-actions.pod:2970
9122 " guestfs_inspect_os (guestfs_h *g);\n"
9127 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2065
9129 "This function uses other libguestfs functions and certain heuristics to "
9130 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9131 "for operating systems."
9135 #: ../src/guestfs-actions.pod:2977 ../fish/guestfish-actions.pod:2069
9136 msgid "The list returned is empty if no operating systems were found."
9140 #: ../src/guestfs-actions.pod:2979 ../fish/guestfish-actions.pod:2071
9142 "If one operating system was found, then this returns a list with a single "
9143 "element, which is the name of the root filesystem of this operating system. "
9144 "It is also possible for this function to return a list containing more than "
9145 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9146 "element being the root filesystem of one of the operating systems."
9150 #: ../src/guestfs-actions.pod:2986
9152 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9153 "functions in order to query further information about each operating system, "
9154 "such as the name and version."
9158 #: ../src/guestfs-actions.pod:2991
9160 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9161 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9162 "the contents. This should be called with no disks currently mounted. The "
9163 "function may also use Augeas, so any existing Augeas handle will be closed."
9167 #: ../src/guestfs-actions.pod:2997 ../fish/guestfish-actions.pod:2089
9169 "This function cannot decrypt encrypted disks. The caller must do that first "
9170 "(supplying the necessary keys) if the disk is encrypted."
9174 #: ../src/guestfs-actions.pod:3003 ../src/guestfs-actions.pod:3258 ../src/guestfs-actions.pod:3320
9175 msgid "See also C<guestfs_list_filesystems>."
9179 #: ../src/guestfs-actions.pod:3011
9180 msgid "guestfs_is_blockdev"
9184 #: ../src/guestfs-actions.pod:3013
9188 " guestfs_is_blockdev (guestfs_h *g,\n"
9189 " const char *path);\n"
9194 #: ../src/guestfs-actions.pod:3017 ../fish/guestfish-actions.pod:2101
9196 "This returns C<true> if and only if there is a block device with the given "
9201 #: ../src/guestfs-actions.pod:3020 ../src/guestfs-actions.pod:3049 ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3094 ../src/guestfs-actions.pod:3110 ../src/guestfs-actions.pod:3166 ../src/guestfs-actions.pod:3181
9202 msgid "See also C<guestfs_stat>."
9206 #: ../src/guestfs-actions.pod:3024 ../src/guestfs-actions.pod:3053 ../src/guestfs-actions.pod:3098 ../src/guestfs-actions.pod:3170 ../src/guestfs-actions.pod:3185
9207 msgid "(Added in 1.5.10)"
9211 #: ../src/guestfs-actions.pod:3026
9212 msgid "guestfs_is_busy"
9216 #: ../src/guestfs-actions.pod:3028
9220 " guestfs_is_busy (guestfs_h *g);\n"
9225 #: ../src/guestfs-actions.pod:3031 ../fish/guestfish-actions.pod:2110
9227 "This returns true iff this handle is busy processing a command (in the "
9232 #: ../src/guestfs-actions.pod:3040
9233 msgid "guestfs_is_chardev"
9237 #: ../src/guestfs-actions.pod:3042
9241 " guestfs_is_chardev (guestfs_h *g,\n"
9242 " const char *path);\n"
9247 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2119
9249 "This returns C<true> if and only if there is a character device with the "
9250 "given C<path> name."
9254 #: ../src/guestfs-actions.pod:3055
9255 msgid "guestfs_is_config"
9259 #: ../src/guestfs-actions.pod:3057
9263 " guestfs_is_config (guestfs_h *g);\n"
9268 #: ../src/guestfs-actions.pod:3060 ../fish/guestfish-actions.pod:2128
9270 "This returns true iff this handle is being configured (in the C<CONFIG> "
9275 #: ../src/guestfs-actions.pod:3069
9276 msgid "guestfs_is_dir"
9280 #: ../src/guestfs-actions.pod:3071
9284 " guestfs_is_dir (guestfs_h *g,\n"
9285 " const char *path);\n"
9290 #: ../src/guestfs-actions.pod:3075 ../fish/guestfish-actions.pod:2137
9292 "This returns C<true> if and only if there is a directory with the given "
9293 "C<path> name. Note that it returns false for other objects like files."
9297 #: ../src/guestfs-actions.pod:3085
9298 msgid "guestfs_is_fifo"
9302 #: ../src/guestfs-actions.pod:3087
9306 " guestfs_is_fifo (guestfs_h *g,\n"
9307 " const char *path);\n"
9312 #: ../src/guestfs-actions.pod:3091 ../fish/guestfish-actions.pod:2147
9314 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9315 "given C<path> name."
9319 #: ../src/guestfs-actions.pod:3100
9320 msgid "guestfs_is_file"
9324 #: ../src/guestfs-actions.pod:3102
9328 " guestfs_is_file (guestfs_h *g,\n"
9329 " const char *path);\n"
9334 #: ../src/guestfs-actions.pod:3106 ../fish/guestfish-actions.pod:2156
9336 "This returns C<true> if and only if there is a regular file with the given "
9337 "C<path> name. Note that it returns false for other objects like "
9342 #: ../src/guestfs-actions.pod:3116
9343 msgid "guestfs_is_launching"
9347 #: ../src/guestfs-actions.pod:3118
9351 " guestfs_is_launching (guestfs_h *g);\n"
9356 #: ../src/guestfs-actions.pod:3121 ../fish/guestfish-actions.pod:2166
9358 "This returns true iff this handle is launching the subprocess (in the "
9359 "C<LAUNCHING> state)."
9363 #: ../src/guestfs-actions.pod:3130
9364 msgid "guestfs_is_lv"
9368 #: ../src/guestfs-actions.pod:3132
9372 " guestfs_is_lv (guestfs_h *g,\n"
9373 " const char *device);\n"
9378 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2175
9380 "This command tests whether C<device> is a logical volume, and returns true "
9381 "iff this is the case."
9385 #: ../src/guestfs-actions.pod:3143
9386 msgid "guestfs_is_ready"
9390 #: ../src/guestfs-actions.pod:3145
9394 " guestfs_is_ready (guestfs_h *g);\n"
9399 #: ../src/guestfs-actions.pod:3148 ../fish/guestfish-actions.pod:2182
9401 "This returns true iff this handle is ready to accept commands (in the "
9406 #: ../src/guestfs-actions.pod:3157
9407 msgid "guestfs_is_socket"
9411 #: ../src/guestfs-actions.pod:3159
9415 " guestfs_is_socket (guestfs_h *g,\n"
9416 " const char *path);\n"
9421 #: ../src/guestfs-actions.pod:3163 ../fish/guestfish-actions.pod:2191
9423 "This returns C<true> if and only if there is a Unix domain socket with the "
9424 "given C<path> name."
9428 #: ../src/guestfs-actions.pod:3172
9429 msgid "guestfs_is_symlink"
9433 #: ../src/guestfs-actions.pod:3174
9437 " guestfs_is_symlink (guestfs_h *g,\n"
9438 " const char *path);\n"
9443 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2200
9445 "This returns C<true> if and only if there is a symbolic link with the given "
9450 #: ../src/guestfs-actions.pod:3187
9451 msgid "guestfs_kill_subprocess"
9455 #: ../src/guestfs-actions.pod:3189
9459 " guestfs_kill_subprocess (guestfs_h *g);\n"
9464 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2209
9465 msgid "This kills the qemu subprocess. You should never need to call this."
9469 #: ../src/guestfs-actions.pod:3198
9470 msgid "guestfs_launch"
9474 #: ../src/guestfs-actions.pod:3200
9478 " guestfs_launch (guestfs_h *g);\n"
9483 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2217
9485 "Internally libguestfs is implemented by running a virtual machine using "
9490 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2220
9492 "You should call this after configuring the handle (eg. adding drives) but "
9493 "before performing any actions."
9497 #: ../src/guestfs-actions.pod:3213
9498 msgid "guestfs_lchown"
9502 #: ../src/guestfs-actions.pod:3215
9506 " guestfs_lchown (guestfs_h *g,\n"
9509 " const char *path);\n"
9514 #: ../src/guestfs-actions.pod:3221
9516 "Change the file owner to C<owner> and group to C<group>. This is like "
9517 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
9518 "changed, not the target."
9522 #: ../src/guestfs-actions.pod:3233
9523 msgid "guestfs_lgetxattrs"
9527 #: ../src/guestfs-actions.pod:3235
9530 " struct guestfs_xattr_list *\n"
9531 " guestfs_lgetxattrs (guestfs_h *g,\n"
9532 " const char *path);\n"
9537 #: ../src/guestfs-actions.pod:3239
9539 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
9540 "then it returns the extended attributes of the link itself."
9544 #: ../src/guestfs-actions.pod:3249
9545 msgid "guestfs_list_devices"
9549 #: ../src/guestfs-actions.pod:3251
9553 " guestfs_list_devices (guestfs_h *g);\n"
9558 #: ../src/guestfs-actions.pod:3254 ../fish/guestfish-actions.pod:2247
9559 msgid "List all the block devices."
9563 #: ../src/guestfs-actions.pod:3256 ../fish/guestfish-actions.pod:2249
9564 msgid "The full block device names are returned, eg. C</dev/sda>."
9568 #: ../src/guestfs-actions.pod:3266
9569 msgid "guestfs_list_filesystems"
9573 #: ../src/guestfs-actions.pod:3268
9577 " guestfs_list_filesystems (guestfs_h *g);\n"
9582 #: ../src/guestfs-actions.pod:3271 ../fish/guestfish-actions.pod:2257
9584 "This inspection command looks for filesystems on partitions, block devices "
9585 "and logical volumes, returning a list of devices containing filesystems and "
9590 #: ../src/guestfs-actions.pod:3275 ../fish/guestfish-actions.pod:2261
9592 "The return value is a hash, where the keys are the devices containing "
9593 "filesystems, and the values are the filesystem types. For example:"
9597 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2265
9600 " \"/dev/sda1\" => \"ntfs\"\n"
9601 " \"/dev/sda2\" => \"ext2\"\n"
9602 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9603 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9608 #: ../src/guestfs-actions.pod:3284 ../fish/guestfish-actions.pod:2270
9610 "The value can have the special value \"unknown\", meaning the content of the "
9611 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9615 #: ../src/guestfs-actions.pod:3288
9617 "This command runs other libguestfs commands, which might include "
9618 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
9619 "soon after launch and only when nothing is mounted."
9623 #: ../src/guestfs-actions.pod:3292
9625 "Not all of the filesystems returned will be mountable. In particular, swap "
9626 "partitions are returned in the list. Also this command does not check that "
9627 "each filesystem found is valid and mountable, and some filesystems might be "
9628 "mountable but require special options. Filesystems may not all belong to a "
9629 "single logical operating system (use C<guestfs_inspect_os> to look for "
9634 #: ../src/guestfs-actions.pod:3306 ../src/guestfs-actions.pod:4895
9635 msgid "(Added in 1.5.15)"
9639 #: ../src/guestfs-actions.pod:3308
9640 msgid "guestfs_list_partitions"
9644 #: ../src/guestfs-actions.pod:3310
9648 " guestfs_list_partitions (guestfs_h *g);\n"
9653 #: ../src/guestfs-actions.pod:3313 ../fish/guestfish-actions.pod:2290
9654 msgid "List all the partitions detected on all block devices."
9658 #: ../src/guestfs-actions.pod:3315 ../fish/guestfish-actions.pod:2292
9659 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9663 #: ../src/guestfs-actions.pod:3317
9665 "This does not return logical volumes. For that you will need to call "
9670 #: ../src/guestfs-actions.pod:3328
9675 #: ../src/guestfs-actions.pod:3330
9679 " guestfs_ll (guestfs_h *g,\n"
9680 " const char *directory);\n"
9685 #: ../src/guestfs-actions.pod:3334 ../fish/guestfish-actions.pod:2303
9687 "List the files in C<directory> (relative to the root directory, there is no "
9688 "cwd) in the format of 'ls -la'."
9692 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2306
9694 "This command is mostly useful for interactive sessions. It is I<not> "
9695 "intended that you try to parse the output string."
9699 #: ../src/guestfs-actions.pod:3345
9704 #: ../src/guestfs-actions.pod:3347
9708 " guestfs_ln (guestfs_h *g,\n"
9709 " const char *target,\n"
9710 " const char *linkname);\n"
9715 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2313
9716 msgid "This command creates a hard link using the C<ln> command."
9720 #: ../src/guestfs-actions.pod:3358
9721 msgid "guestfs_ln_f"
9725 #: ../src/guestfs-actions.pod:3360
9729 " guestfs_ln_f (guestfs_h *g,\n"
9730 " const char *target,\n"
9731 " const char *linkname);\n"
9736 #: ../src/guestfs-actions.pod:3365 ../fish/guestfish-actions.pod:2319
9738 "This command creates a hard link using the C<ln -f> command. The C<-f> "
9739 "option removes the link (C<linkname>) if it exists already."
9743 #: ../src/guestfs-actions.pod:3372
9744 msgid "guestfs_ln_s"
9748 #: ../src/guestfs-actions.pod:3374
9752 " guestfs_ln_s (guestfs_h *g,\n"
9753 " const char *target,\n"
9754 " const char *linkname);\n"
9759 #: ../src/guestfs-actions.pod:3379 ../fish/guestfish-actions.pod:2326
9760 msgid "This command creates a symbolic link using the C<ln -s> command."
9764 #: ../src/guestfs-actions.pod:3385
9765 msgid "guestfs_ln_sf"
9769 #: ../src/guestfs-actions.pod:3387
9773 " guestfs_ln_sf (guestfs_h *g,\n"
9774 " const char *target,\n"
9775 " const char *linkname);\n"
9780 #: ../src/guestfs-actions.pod:3392 ../fish/guestfish-actions.pod:2332
9782 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
9783 "option removes the link (C<linkname>) if it exists already."
9787 #: ../src/guestfs-actions.pod:3399
9788 msgid "guestfs_lremovexattr"
9792 #: ../src/guestfs-actions.pod:3401
9796 " guestfs_lremovexattr (guestfs_h *g,\n"
9797 " const char *xattr,\n"
9798 " const char *path);\n"
9803 #: ../src/guestfs-actions.pod:3406
9805 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
9806 "link, then it removes an extended attribute of the link itself."
9810 #: ../src/guestfs-actions.pod:3414
9815 #: ../src/guestfs-actions.pod:3416
9819 " guestfs_ls (guestfs_h *g,\n"
9820 " const char *directory);\n"
9825 #: ../src/guestfs-actions.pod:3420 ../fish/guestfish-actions.pod:2347
9827 "List the files in C<directory> (relative to the root directory, there is no "
9828 "cwd). The '.' and '..' entries are not returned, but hidden files are "
9833 #: ../src/guestfs-actions.pod:3424
9835 "This command is mostly useful for interactive sessions. Programs should "
9836 "probably use C<guestfs_readdir> instead."
9840 #: ../src/guestfs-actions.pod:3433
9841 msgid "guestfs_lsetxattr"
9845 #: ../src/guestfs-actions.pod:3435
9849 " guestfs_lsetxattr (guestfs_h *g,\n"
9850 " const char *xattr,\n"
9851 " const char *val,\n"
9853 " const char *path);\n"
9858 #: ../src/guestfs-actions.pod:3442
9860 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
9861 "then it sets an extended attribute of the link itself."
9865 #: ../src/guestfs-actions.pod:3450
9866 msgid "guestfs_lstat"
9870 #: ../src/guestfs-actions.pod:3452
9873 " struct guestfs_stat *\n"
9874 " guestfs_lstat (guestfs_h *g,\n"
9875 " const char *path);\n"
9880 #: ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:5949 ../fish/guestfish-actions.pod:2366 ../fish/guestfish-actions.pod:3979
9881 msgid "Returns file information for the given C<path>."
9885 #: ../src/guestfs-actions.pod:3458
9887 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
9888 "link, then the link is stat-ed, not the file it refers to."
9892 #: ../src/guestfs-actions.pod:3462 ../fish/guestfish-actions.pod:2372
9893 msgid "This is the same as the C<lstat(2)> system call."
9897 #: ../src/guestfs-actions.pod:3464 ../src/guestfs-actions.pod:5953
9899 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
9900 "error. I<The caller must call C<guestfs_free_stat> after use>."
9904 #: ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:5957 ../src/guestfs-actions.pod:5975 ../src/guestfs-actions.pod:6356
9905 msgid "(Added in 0.9.2)"
9909 #: ../src/guestfs-actions.pod:3470
9910 msgid "guestfs_lstatlist"
9914 #: ../src/guestfs-actions.pod:3472
9917 " struct guestfs_stat_list *\n"
9918 " guestfs_lstatlist (guestfs_h *g,\n"
9919 " const char *path,\n"
9920 " char *const *names);\n"
9925 #: ../src/guestfs-actions.pod:3477
9927 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
9928 "files, where all files are in the directory C<path>. C<names> is the list "
9929 "of files from this directory."
9933 #: ../src/guestfs-actions.pod:3481 ../fish/guestfish-actions.pod:2382
9935 "On return you get a list of stat structs, with a one-to-one correspondence "
9936 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9937 "then the C<ino> field of that structure is set to C<-1>."
9941 #: ../src/guestfs-actions.pod:3486
9943 "This call is intended for programs that want to efficiently list a directory "
9944 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
9945 "for a similarly efficient call for getting extended attributes. Very long "
9946 "directory listings might cause the protocol message size to be exceeded, "
9947 "causing this call to fail. The caller must split up such requests into "
9948 "smaller groups of names."
9952 #: ../src/guestfs-actions.pod:3494
9954 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
9955 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
9959 #: ../src/guestfs-actions.pod:3500
9960 msgid "guestfs_luks_add_key"
9964 #: ../src/guestfs-actions.pod:3502
9968 " guestfs_luks_add_key (guestfs_h *g,\n"
9969 " const char *device,\n"
9970 " const char *key,\n"
9971 " const char *newkey,\n"
9977 #: ../src/guestfs-actions.pod:3509 ../fish/guestfish-actions.pod:2399
9979 "This command adds a new key on LUKS device C<device>. C<key> is any "
9980 "existing key, and is used to access the device. C<newkey> is the new key to "
9981 "add. C<keyslot> is the key slot that will be replaced."
9985 #: ../src/guestfs-actions.pod:3514
9987 "Note that if C<keyslot> already contains a key, then this command will "
9988 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
9992 #: ../src/guestfs-actions.pod:3520 ../src/guestfs-actions.pod:3560 ../src/guestfs-actions.pod:3583 ../src/guestfs-actions.pod:3603 ../src/guestfs-actions.pod:3635 ../src/guestfs-actions.pod:3654
9994 "This function takes a key or passphrase parameter which could contain "
9995 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10000 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:3564 ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3607
10001 msgid "(Added in 1.5.2)"
10005 #: ../src/guestfs-actions.pod:3526
10006 msgid "guestfs_luks_close"
10010 #: ../src/guestfs-actions.pod:3528
10014 " guestfs_luks_close (guestfs_h *g,\n"
10015 " const char *device);\n"
10020 #: ../src/guestfs-actions.pod:3532
10022 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10023 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10024 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10025 "underlying block device."
10029 #: ../src/guestfs-actions.pod:3540 ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3658 ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:3756
10030 msgid "(Added in 1.5.1)"
10034 #: ../src/guestfs-actions.pod:3542
10035 msgid "guestfs_luks_format"
10039 #: ../src/guestfs-actions.pod:3544
10043 " guestfs_luks_format (guestfs_h *g,\n"
10044 " const char *device,\n"
10045 " const char *key,\n"
10051 #: ../src/guestfs-actions.pod:3550 ../fish/guestfish-actions.pod:2425
10053 "This command erases existing data on C<device> and formats the device as a "
10054 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10055 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10059 #: ../src/guestfs-actions.pod:3557 ../src/guestfs-actions.pod:3580 ../src/guestfs-actions.pod:3720 ../src/guestfs-actions.pod:4646 ../src/guestfs-actions.pod:5409 ../src/guestfs-actions.pod:5784 ../src/guestfs-actions.pod:5807 ../src/guestfs-actions.pod:5833 ../src/guestfs-actions.pod:6993 ../fish/guestfish-actions.pod:2433 ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2530 ../fish/guestfish-actions.pod:3091 ../fish/guestfish-actions.pod:3598 ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3894 ../fish/guestfish-actions.pod:3909 ../fish/guestfish-actions.pod:4624
10061 "B<This command is dangerous. Without careful use you can easily destroy all "
10066 #: ../src/guestfs-actions.pod:3566
10067 msgid "guestfs_luks_format_cipher"
10071 #: ../src/guestfs-actions.pod:3568
10075 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10076 " const char *device,\n"
10077 " const char *key,\n"
10079 " const char *cipher);\n"
10084 #: ../src/guestfs-actions.pod:3575
10086 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10087 "set the C<cipher> used."
10091 #: ../src/guestfs-actions.pod:3589
10092 msgid "guestfs_luks_kill_slot"
10096 #: ../src/guestfs-actions.pod:3591
10100 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10101 " const char *device,\n"
10102 " const char *key,\n"
10108 #: ../src/guestfs-actions.pod:3597 ../fish/guestfish-actions.pod:2453
10110 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10111 "device C<device>. C<key> must be one of the I<other> keys."
10115 #: ../src/guestfs-actions.pod:3609
10116 msgid "guestfs_luks_open"
10120 #: ../src/guestfs-actions.pod:3611
10124 " guestfs_luks_open (guestfs_h *g,\n"
10125 " const char *device,\n"
10126 " const char *key,\n"
10127 " const char *mapname);\n"
10132 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2464
10134 "This command opens a block device which has been encrypted according to the "
10135 "Linux Unified Key Setup (LUKS) standard."
10139 #: ../src/guestfs-actions.pod:3620 ../fish/guestfish-actions.pod:2467
10140 msgid "C<device> is the encrypted block device or partition."
10144 #: ../src/guestfs-actions.pod:3622 ../fish/guestfish-actions.pod:2469
10146 "The caller must supply one of the keys associated with the LUKS block "
10147 "device, in the C<key> parameter."
10151 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2472
10153 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10154 "writes to this block device are decrypted from and encrypted to the "
10155 "underlying C<device> respectively."
10159 #: ../src/guestfs-actions.pod:3629
10161 "If this block device contains LVM volume groups, then calling "
10162 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10167 #: ../src/guestfs-actions.pod:3641
10168 msgid "guestfs_luks_open_ro"
10172 #: ../src/guestfs-actions.pod:3643
10176 " guestfs_luks_open_ro (guestfs_h *g,\n"
10177 " const char *device,\n"
10178 " const char *key,\n"
10179 " const char *mapname);\n"
10184 #: ../src/guestfs-actions.pod:3649
10186 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10191 #: ../src/guestfs-actions.pod:3660
10192 msgid "guestfs_lvcreate"
10196 #: ../src/guestfs-actions.pod:3662
10200 " guestfs_lvcreate (guestfs_h *g,\n"
10201 " const char *logvol,\n"
10202 " const char *volgroup,\n"
10208 #: ../src/guestfs-actions.pod:3668 ../fish/guestfish-actions.pod:2497
10210 "This creates an LVM logical volume called C<logvol> on the volume group "
10211 "C<volgroup>, with C<size> megabytes."
10215 #: ../src/guestfs-actions.pod:3675
10216 msgid "guestfs_lvm_canonical_lv_name"
10220 #: ../src/guestfs-actions.pod:3677
10224 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10225 " const char *lvname);\n"
10230 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2504
10232 "This converts alternative naming schemes for LVs that you might find to the "
10233 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
10238 #: ../src/guestfs-actions.pod:3685 ../fish/guestfish-actions.pod:2508
10240 "This command returns an error if the C<lvname> parameter does not refer to a "
10245 #: ../src/guestfs-actions.pod:3688
10246 msgid "See also C<guestfs_is_lv>."
10250 #: ../src/guestfs-actions.pod:3693
10251 msgid "(Added in 1.5.24)"
10255 #: ../src/guestfs-actions.pod:3695
10256 msgid "guestfs_lvm_clear_filter"
10260 #: ../src/guestfs-actions.pod:3697
10264 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10269 #: ../src/guestfs-actions.pod:3700
10271 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10272 "see every block device."
10276 #: ../src/guestfs-actions.pod:3703 ../src/guestfs-actions.pod:3745 ../fish/guestfish-actions.pod:2520 ../fish/guestfish-actions.pod:2551
10277 msgid "This command also clears the LVM cache and performs a volume group scan."
10281 #: ../src/guestfs-actions.pod:3710
10282 msgid "guestfs_lvm_remove_all"
10286 #: ../src/guestfs-actions.pod:3712
10290 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10295 #: ../src/guestfs-actions.pod:3715 ../fish/guestfish-actions.pod:2527
10297 "This command removes all LVM logical volumes, volume groups and physical "
10302 #: ../src/guestfs-actions.pod:3725
10303 msgid "guestfs_lvm_set_filter"
10307 #: ../src/guestfs-actions.pod:3727
10311 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10312 " char *const *devices);\n"
10317 #: ../src/guestfs-actions.pod:3731 ../fish/guestfish-actions.pod:2537
10319 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10320 "block devices in the list C<devices>, and will ignore all other attached "
10325 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2541
10327 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10328 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10329 "there are two types of duplication possible: either cloned PVs/VGs which "
10330 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10331 "same name. In normal operation you cannot create this situation, but you "
10332 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10333 "inside the LVM metadata."
10337 #: ../src/guestfs-actions.pod:3748 ../fish/guestfish-actions.pod:2554
10338 msgid "You can filter whole block devices or individual partitions."
10342 #: ../src/guestfs-actions.pod:3750 ../fish/guestfish-actions.pod:2556
10344 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10345 "filesystem), even if you are not filtering out that VG."
10349 #: ../src/guestfs-actions.pod:3758
10350 msgid "guestfs_lvremove"
10354 #: ../src/guestfs-actions.pod:3760
10358 " guestfs_lvremove (guestfs_h *g,\n"
10359 " const char *device);\n"
10364 #: ../src/guestfs-actions.pod:3764 ../fish/guestfish-actions.pod:2564
10366 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10367 "LV, such as C</dev/VG/LV>."
10371 #: ../src/guestfs-actions.pod:3767 ../fish/guestfish-actions.pod:2567
10373 "You can also remove all LVs in a volume group by specifying the VG name, "
10378 #: ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:4992 ../src/guestfs-actions.pod:6732
10379 msgid "(Added in 1.0.13)"
10383 #: ../src/guestfs-actions.pod:3774
10384 msgid "guestfs_lvrename"
10388 #: ../src/guestfs-actions.pod:3776
10392 " guestfs_lvrename (guestfs_h *g,\n"
10393 " const char *logvol,\n"
10394 " const char *newlogvol);\n"
10399 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2574
10400 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10404 #: ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:6745
10405 msgid "(Added in 1.0.83)"
10409 #: ../src/guestfs-actions.pod:3787
10410 msgid "guestfs_lvresize"
10414 #: ../src/guestfs-actions.pod:3789
10418 " guestfs_lvresize (guestfs_h *g,\n"
10419 " const char *device,\n"
10425 #: ../src/guestfs-actions.pod:3794 ../fish/guestfish-actions.pod:2580
10427 "This resizes (expands or shrinks) an existing LVM logical volume to "
10428 "C<mbytes>. When reducing, data in the reduced part is lost."
10432 #: ../src/guestfs-actions.pod:3802
10433 msgid "guestfs_lvresize_free"
10437 #: ../src/guestfs-actions.pod:3804
10441 " guestfs_lvresize_free (guestfs_h *g,\n"
10442 " const char *lv,\n"
10448 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2588
10450 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10451 "remaining free space in the volume group. Commonly you would call this with "
10452 "pc = 100 which expands the logical volume as much as possible, using all "
10453 "remaining free space in the volume group."
10457 #: ../src/guestfs-actions.pod:3817
10458 msgid "(Added in 1.3.3)"
10462 #: ../src/guestfs-actions.pod:3819
10463 msgid "guestfs_lvs"
10467 #: ../src/guestfs-actions.pod:3821
10471 " guestfs_lvs (guestfs_h *g);\n"
10476 #: ../src/guestfs-actions.pod:3824 ../fish/guestfish-actions.pod:2598
10478 "List all the logical volumes detected. This is the equivalent of the "
10479 "L<lvs(8)> command."
10483 #: ../src/guestfs-actions.pod:3827 ../fish/guestfish-actions.pod:2601
10485 "This returns a list of the logical volume device names "
10486 "(eg. C</dev/VolGroup00/LogVol00>)."
10490 #: ../src/guestfs-actions.pod:3830
10491 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
10495 #: ../src/guestfs-actions.pod:3838
10496 msgid "guestfs_lvs_full"
10500 #: ../src/guestfs-actions.pod:3840
10503 " struct guestfs_lvm_lv_list *\n"
10504 " guestfs_lvs_full (guestfs_h *g);\n"
10509 #: ../src/guestfs-actions.pod:3843 ../fish/guestfish-actions.pod:2610
10511 "List all the logical volumes detected. This is the equivalent of the "
10512 "L<lvs(8)> command. The \"full\" version includes all fields."
10516 #: ../src/guestfs-actions.pod:3846
10518 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
10519 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
10524 #: ../src/guestfs-actions.pod:3852
10525 msgid "guestfs_lvuuid"
10529 #: ../src/guestfs-actions.pod:3854
10533 " guestfs_lvuuid (guestfs_h *g,\n"
10534 " const char *device);\n"
10539 #: ../src/guestfs-actions.pod:3858 ../fish/guestfish-actions.pod:2617
10540 msgid "This command returns the UUID of the LVM LV C<device>."
10544 #: ../src/guestfs-actions.pod:3865
10545 msgid "guestfs_lxattrlist"
10549 #: ../src/guestfs-actions.pod:3867
10552 " struct guestfs_xattr_list *\n"
10553 " guestfs_lxattrlist (guestfs_h *g,\n"
10554 " const char *path,\n"
10555 " char *const *names);\n"
10560 #: ../src/guestfs-actions.pod:3872 ../fish/guestfish-actions.pod:2623
10562 "This call allows you to get the extended attributes of multiple files, where "
10563 "all files are in the directory C<path>. C<names> is the list of files from "
10568 #: ../src/guestfs-actions.pod:3876 ../fish/guestfish-actions.pod:2627
10570 "On return you get a flat list of xattr structs which must be interpreted "
10571 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10572 "C<attrval> in this struct is zero-length to indicate there was an error "
10573 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10574 "number (the number of following attributes for this file, which could be "
10575 "C<\"0\">). Then after the first xattr struct are the zero or more "
10576 "attributes for the first named file. This repeats for the second and "
10577 "subsequent files."
10581 #: ../src/guestfs-actions.pod:3886
10583 "This call is intended for programs that want to efficiently list a directory "
10584 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
10585 "a similarly efficient call for getting standard stats. Very long directory "
10586 "listings might cause the protocol message size to be exceeded, causing this "
10587 "call to fail. The caller must split up such requests into smaller groups of "
10592 #: ../src/guestfs-actions.pod:3900
10593 msgid "guestfs_mkdir"
10597 #: ../src/guestfs-actions.pod:3902
10601 " guestfs_mkdir (guestfs_h *g,\n"
10602 " const char *path);\n"
10607 #: ../src/guestfs-actions.pod:3906 ../fish/guestfish-actions.pod:2649
10608 msgid "Create a directory named C<path>."
10612 #: ../src/guestfs-actions.pod:3912
10613 msgid "guestfs_mkdir_mode"
10617 #: ../src/guestfs-actions.pod:3914
10621 " guestfs_mkdir_mode (guestfs_h *g,\n"
10622 " const char *path,\n"
10628 #: ../src/guestfs-actions.pod:3919 ../fish/guestfish-actions.pod:2655
10630 "This command creates a directory, setting the initial permissions of the "
10631 "directory to C<mode>."
10635 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:2658
10637 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10638 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10643 #: ../src/guestfs-actions.pod:3926
10644 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
10648 #: ../src/guestfs-actions.pod:3932
10649 msgid "guestfs_mkdir_p"
10653 #: ../src/guestfs-actions.pod:3934
10657 " guestfs_mkdir_p (guestfs_h *g,\n"
10658 " const char *path);\n"
10663 #: ../src/guestfs-actions.pod:3938 ../fish/guestfish-actions.pod:2668
10665 "Create a directory named C<path>, creating any parent directories as "
10666 "necessary. This is like the C<mkdir -p> shell command."
10670 #: ../src/guestfs-actions.pod:3945
10671 msgid "guestfs_mkdtemp"
10675 #: ../src/guestfs-actions.pod:3947
10679 " guestfs_mkdtemp (guestfs_h *g,\n"
10680 " const char *template);\n"
10685 #: ../src/guestfs-actions.pod:3951 ../fish/guestfish-actions.pod:2675
10687 "This command creates a temporary directory. The C<template> parameter "
10688 "should be a full pathname for the temporary directory name with the final "
10689 "six characters being \"XXXXXX\"."
10693 #: ../src/guestfs-actions.pod:3956 ../fish/guestfish-actions.pod:2680
10695 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10696 "being suitable for Windows filesystems."
10700 #: ../src/guestfs-actions.pod:3959 ../fish/guestfish-actions.pod:2683
10701 msgid "The name of the temporary directory that was created is returned."
10705 #: ../src/guestfs-actions.pod:3962 ../fish/guestfish-actions.pod:2686
10706 msgid "The temporary directory is created with mode 0700 and is owned by root."
10710 #: ../src/guestfs-actions.pod:3965 ../fish/guestfish-actions.pod:2689
10712 "The caller is responsible for deleting the temporary directory and its "
10713 "contents after use."
10717 #: ../src/guestfs-actions.pod:3968 ../fish/guestfish-actions.pod:2692
10718 msgid "See also: L<mkdtemp(3)>"
10722 #: ../src/guestfs-actions.pod:3975
10723 msgid "guestfs_mke2fs_J"
10727 #: ../src/guestfs-actions.pod:3977
10731 " guestfs_mke2fs_J (guestfs_h *g,\n"
10732 " const char *fstype,\n"
10733 " int blocksize,\n"
10734 " const char *device,\n"
10735 " const char *journal);\n"
10740 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:2698
10742 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10743 "C<journal>. It is equivalent to the command:"
10747 #: ../src/guestfs-actions.pod:3988 ../fish/guestfish-actions.pod:2702
10750 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10755 #: ../src/guestfs-actions.pod:3990
10756 msgid "See also C<guestfs_mke2journal>."
10760 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4012 ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4046 ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4074 ../src/guestfs-actions.pod:4133 ../src/guestfs-actions.pod:4382
10761 msgid "(Added in 1.0.68)"
10765 #: ../src/guestfs-actions.pod:3996
10766 msgid "guestfs_mke2fs_JL"
10770 #: ../src/guestfs-actions.pod:3998
10774 " guestfs_mke2fs_JL (guestfs_h *g,\n"
10775 " const char *fstype,\n"
10776 " int blocksize,\n"
10777 " const char *device,\n"
10778 " const char *label);\n"
10783 #: ../src/guestfs-actions.pod:4005 ../fish/guestfish-actions.pod:2710
10785 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10786 "the journal labeled C<label>."
10790 #: ../src/guestfs-actions.pod:4008
10791 msgid "See also C<guestfs_mke2journal_L>."
10795 #: ../src/guestfs-actions.pod:4014
10796 msgid "guestfs_mke2fs_JU"
10800 #: ../src/guestfs-actions.pod:4016
10804 " guestfs_mke2fs_JU (guestfs_h *g,\n"
10805 " const char *fstype,\n"
10806 " int blocksize,\n"
10807 " const char *device,\n"
10808 " const char *uuid);\n"
10813 #: ../src/guestfs-actions.pod:4023 ../fish/guestfish-actions.pod:2719
10815 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10816 "the journal with UUID C<uuid>."
10820 #: ../src/guestfs-actions.pod:4026
10821 msgid "See also C<guestfs_mke2journal_U>."
10825 #: ../src/guestfs-actions.pod:4032
10826 msgid "guestfs_mke2journal"
10830 #: ../src/guestfs-actions.pod:4034
10834 " guestfs_mke2journal (guestfs_h *g,\n"
10835 " int blocksize,\n"
10836 " const char *device);\n"
10841 #: ../src/guestfs-actions.pod:4039 ../fish/guestfish-actions.pod:2728
10843 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10848 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:2731
10851 " mke2fs -O journal_dev -b blocksize device\n"
10856 #: ../src/guestfs-actions.pod:4048
10857 msgid "guestfs_mke2journal_L"
10861 #: ../src/guestfs-actions.pod:4050
10865 " guestfs_mke2journal_L (guestfs_h *g,\n"
10866 " int blocksize,\n"
10867 " const char *label,\n"
10868 " const char *device);\n"
10873 #: ../src/guestfs-actions.pod:4056 ../fish/guestfish-actions.pod:2737
10874 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10878 #: ../src/guestfs-actions.pod:4062
10879 msgid "guestfs_mke2journal_U"
10883 #: ../src/guestfs-actions.pod:4064
10887 " guestfs_mke2journal_U (guestfs_h *g,\n"
10888 " int blocksize,\n"
10889 " const char *uuid,\n"
10890 " const char *device);\n"
10895 #: ../src/guestfs-actions.pod:4070 ../fish/guestfish-actions.pod:2743
10896 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10900 #: ../src/guestfs-actions.pod:4076
10901 msgid "guestfs_mkfifo"
10905 #: ../src/guestfs-actions.pod:4078
10909 " guestfs_mkfifo (guestfs_h *g,\n"
10911 " const char *path);\n"
10916 #: ../src/guestfs-actions.pod:4083
10918 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10919 "is just a convenient wrapper around C<guestfs_mknod>."
10923 #: ../src/guestfs-actions.pod:4093
10924 msgid "guestfs_mkfs"
10928 #: ../src/guestfs-actions.pod:4095
10932 " guestfs_mkfs (guestfs_h *g,\n"
10933 " const char *fstype,\n"
10934 " const char *device);\n"
10939 #: ../src/guestfs-actions.pod:4100 ../fish/guestfish-actions.pod:2759
10941 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10942 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10946 #: ../src/guestfs-actions.pod:4108
10947 msgid "guestfs_mkfs_b"
10951 #: ../src/guestfs-actions.pod:4110
10955 " guestfs_mkfs_b (guestfs_h *g,\n"
10956 " const char *fstype,\n"
10957 " int blocksize,\n"
10958 " const char *device);\n"
10963 #: ../src/guestfs-actions.pod:4116
10965 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
10966 "block size of the resulting filesystem. Supported block sizes depend on the "
10967 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10971 #: ../src/guestfs-actions.pod:4121 ../src/guestfs-actions.pod:4163 ../fish/guestfish-actions.pod:2772 ../fish/guestfish-actions.pod:2799
10973 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10978 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2775
10980 "This function is deprecated. In new code, use the C<mkfs_opts> call "
10985 #: ../src/guestfs-actions.pod:4135
10986 msgid "guestfs_mkfs_opts"
10990 #: ../src/guestfs-actions.pod:4137
10994 " guestfs_mkfs_opts (guestfs_h *g,\n"
10995 " const char *fstype,\n"
10996 " const char *device,\n"
11002 #: ../src/guestfs-actions.pod:4148
11005 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
11010 #: ../src/guestfs-actions.pod:4150 ../fish/guestfish-actions.pod:2786
11012 "This function creates a filesystem on C<device>. The filesystem type is "
11013 "C<fstype>, for example C<ext3>."
11017 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:2793
11018 msgid "C<blocksize>"
11022 #: ../src/guestfs-actions.pod:4159 ../fish/guestfish-actions.pod:2795
11024 "The filesystem block size. Supported block sizes depend on the filesystem "
11025 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11030 #: ../src/guestfs-actions.pod:4170
11031 msgid "guestfs_mkfs_opts_va"
11035 #: ../src/guestfs-actions.pod:4172
11039 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
11040 " const char *fstype,\n"
11041 " const char *device,\n"
11042 " va_list args);\n"
11047 #: ../src/guestfs-actions.pod:4178
11048 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
11052 #: ../src/guestfs-actions.pod:4182
11053 msgid "guestfs_mkfs_opts_argv"
11057 #: ../src/guestfs-actions.pod:4184
11061 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
11062 " const char *fstype,\n"
11063 " const char *device,\n"
11064 " const struct guestfs_mkfs_opts_argv *optargs);\n"
11069 #: ../src/guestfs-actions.pod:4190
11070 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
11074 #: ../src/guestfs-actions.pod:4194
11075 msgid "guestfs_mkmountpoint"
11079 #: ../src/guestfs-actions.pod:4196
11083 " guestfs_mkmountpoint (guestfs_h *g,\n"
11084 " const char *exemptpath);\n"
11089 #: ../src/guestfs-actions.pod:4200
11091 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11092 "that can be used to create extra mountpoints before mounting the first "
11097 #: ../src/guestfs-actions.pod:4204 ../fish/guestfish-actions.pod:2814
11099 "These calls are I<only> necessary in some very limited circumstances, mainly "
11100 "the case where you want to mount a mix of unrelated and/or read-only "
11101 "filesystems together."
11105 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:2818
11107 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11108 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11109 "inside that. You can unpack this as follows in guestfish:"
11113 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:2823
11116 " add-ro Fedora-11-i686-Live.iso\n"
11118 " mkmountpoint /cd\n"
11119 " mkmountpoint /sqsh\n"
11120 " mkmountpoint /ext3fs\n"
11121 " mount /dev/sda /cd\n"
11122 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11123 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11128 #: ../src/guestfs-actions.pod:4222 ../fish/guestfish-actions.pod:2832
11129 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11133 #: ../src/guestfs-actions.pod:4224
11135 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11136 "may get unexpected errors if you try to mix these calls. It is safest to "
11137 "manually unmount filesystems and remove mountpoints after use."
11141 #: ../src/guestfs-actions.pod:4228
11143 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11144 "first, so for this to work for manual mountpoints, you must ensure that the "
11145 "innermost mountpoints have the longest pathnames, as in the example code "
11150 #: ../src/guestfs-actions.pod:4233 ../fish/guestfish-actions.pod:2843
11151 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11155 #: ../src/guestfs-actions.pod:4235
11157 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11158 "means that C<guestfs_umount_all> is called when the handle is closed which "
11159 "can also trigger these issues."
11163 #: ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4500 ../src/guestfs-actions.pod:5393
11164 msgid "(Added in 1.0.62)"
11168 #: ../src/guestfs-actions.pod:4243
11169 msgid "guestfs_mknod"
11173 #: ../src/guestfs-actions.pod:4245
11177 " guestfs_mknod (guestfs_h *g,\n"
11181 " const char *path);\n"
11186 #: ../src/guestfs-actions.pod:4252 ../fish/guestfish-actions.pod:2853
11188 "This call creates block or character special devices, or named pipes "
11193 #: ../src/guestfs-actions.pod:4255 ../fish/guestfish-actions.pod:2856
11195 "The C<mode> parameter should be the mode, using the standard constants. "
11196 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11197 "used when creating block and character special devices."
11201 #: ../src/guestfs-actions.pod:4260
11203 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11204 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11205 "regular file). These constants are available in the standard Linux header "
11206 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11207 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11208 "the appropriate constant for you."
11212 #: ../src/guestfs-actions.pod:4274
11213 msgid "guestfs_mknod_b"
11217 #: ../src/guestfs-actions.pod:4276
11221 " guestfs_mknod_b (guestfs_h *g,\n"
11225 " const char *path);\n"
11230 #: ../src/guestfs-actions.pod:4283
11232 "This call creates a block device node called C<path> with mode C<mode> and "
11233 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11234 "wrapper around C<guestfs_mknod>."
11238 #: ../src/guestfs-actions.pod:4293
11239 msgid "guestfs_mknod_c"
11243 #: ../src/guestfs-actions.pod:4295
11247 " guestfs_mknod_c (guestfs_h *g,\n"
11251 " const char *path);\n"
11256 #: ../src/guestfs-actions.pod:4302
11258 "This call creates a char device node called C<path> with mode C<mode> and "
11259 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11260 "wrapper around C<guestfs_mknod>."
11264 #: ../src/guestfs-actions.pod:4312
11265 msgid "guestfs_mkswap"
11269 #: ../src/guestfs-actions.pod:4314
11273 " guestfs_mkswap (guestfs_h *g,\n"
11274 " const char *device);\n"
11279 #: ../src/guestfs-actions.pod:4318 ../fish/guestfish-actions.pod:2895
11280 msgid "Create a swap partition on C<device>."
11284 #: ../src/guestfs-actions.pod:4324
11285 msgid "guestfs_mkswap_L"
11289 #: ../src/guestfs-actions.pod:4326
11293 " guestfs_mkswap_L (guestfs_h *g,\n"
11294 " const char *label,\n"
11295 " const char *device);\n"
11300 #: ../src/guestfs-actions.pod:4331 ../fish/guestfish-actions.pod:2901
11301 msgid "Create a swap partition on C<device> with label C<label>."
11305 #: ../src/guestfs-actions.pod:4333 ../fish/guestfish-actions.pod:2903
11307 "Note that you cannot attach a swap label to a block device "
11308 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
11309 "the kernel or swap tools."
11313 #: ../src/guestfs-actions.pod:4341
11314 msgid "guestfs_mkswap_U"
11318 #: ../src/guestfs-actions.pod:4343
11322 " guestfs_mkswap_U (guestfs_h *g,\n"
11323 " const char *uuid,\n"
11324 " const char *device);\n"
11329 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:2911
11330 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11334 #: ../src/guestfs-actions.pod:4354
11335 msgid "guestfs_mkswap_file"
11339 #: ../src/guestfs-actions.pod:4356
11343 " guestfs_mkswap_file (guestfs_h *g,\n"
11344 " const char *path);\n"
11349 #: ../src/guestfs-actions.pod:4360 ../fish/guestfish-actions.pod:2917
11350 msgid "Create a swap file."
11354 #: ../src/guestfs-actions.pod:4362
11356 "This command just writes a swap file signature to an existing file. To "
11357 "create the file itself, use something like C<guestfs_fallocate>."
11361 #: ../src/guestfs-actions.pod:4369
11362 msgid "guestfs_modprobe"
11366 #: ../src/guestfs-actions.pod:4371
11370 " guestfs_modprobe (guestfs_h *g,\n"
11371 " const char *modulename);\n"
11376 #: ../src/guestfs-actions.pod:4375 ../fish/guestfish-actions.pod:2926
11377 msgid "This loads a kernel module in the appliance."
11381 #: ../src/guestfs-actions.pod:4377 ../fish/guestfish-actions.pod:2928
11383 "The kernel module must have been whitelisted when libguestfs was built (see "
11384 "C<appliance/kmod.whitelist.in> in the source)."
11388 #: ../src/guestfs-actions.pod:4384
11389 msgid "guestfs_mount"
11393 #: ../src/guestfs-actions.pod:4386
11397 " guestfs_mount (guestfs_h *g,\n"
11398 " const char *device,\n"
11399 " const char *mountpoint);\n"
11404 #: ../src/guestfs-actions.pod:4391 ../fish/guestfish-actions.pod:2935
11406 "Mount a guest disk at a position in the filesystem. Block devices are named "
11407 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11408 "those block devices contain partitions, they will have the usual names "
11409 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11413 #: ../src/guestfs-actions.pod:4397 ../fish/guestfish-actions.pod:2941
11415 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11416 "mounted on C</> before others can be mounted. Other filesystems can only be "
11417 "mounted on directories which already exist."
11421 #: ../src/guestfs-actions.pod:4402 ../fish/guestfish-actions.pod:2946
11423 "The mounted filesystem is writable, if we have sufficient permissions on the "
11424 "underlying device."
11428 #: ../src/guestfs-actions.pod:4405
11430 "B<Important note:> When you use this call, the filesystem options C<sync> "
11431 "and C<noatime> are set implicitly. This was originally done because we "
11432 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11433 "very large negative performance impact and negligible effect on "
11434 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
11435 "in any code that needs performance, and instead use C<guestfs_mount_options> "
11436 "(use an empty string for the first parameter if you don't want any options)."
11440 #: ../src/guestfs-actions.pod:4419
11441 msgid "guestfs_mount_loop"
11445 #: ../src/guestfs-actions.pod:4421
11449 " guestfs_mount_loop (guestfs_h *g,\n"
11450 " const char *file,\n"
11451 " const char *mountpoint);\n"
11456 #: ../src/guestfs-actions.pod:4426 ../fish/guestfish-actions.pod:2963
11458 "This command lets you mount C<file> (a filesystem image in a file) on a "
11459 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11464 #: ../src/guestfs-actions.pod:4434
11465 msgid "guestfs_mount_options"
11469 #: ../src/guestfs-actions.pod:4436
11473 " guestfs_mount_options (guestfs_h *g,\n"
11474 " const char *options,\n"
11475 " const char *device,\n"
11476 " const char *mountpoint);\n"
11481 #: ../src/guestfs-actions.pod:4442
11483 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11484 "the mount options as for the L<mount(8)> I<-o> flag."
11488 #: ../src/guestfs-actions.pod:4446 ../fish/guestfish-actions.pod:2975
11490 "If the C<options> parameter is an empty string, then no options are passed "
11491 "(all options default to whatever the filesystem uses)."
11495 #: ../src/guestfs-actions.pod:4452 ../src/guestfs-actions.pod:4466 ../src/guestfs-actions.pod:4483
11496 msgid "(Added in 1.0.10)"
11500 #: ../src/guestfs-actions.pod:4454
11501 msgid "guestfs_mount_ro"
11505 #: ../src/guestfs-actions.pod:4456
11509 " guestfs_mount_ro (guestfs_h *g,\n"
11510 " const char *device,\n"
11511 " const char *mountpoint);\n"
11516 #: ../src/guestfs-actions.pod:4461
11518 "This is the same as the C<guestfs_mount> command, but it mounts the "
11519 "filesystem with the read-only (I<-o ro>) flag."
11523 #: ../src/guestfs-actions.pod:4468
11524 msgid "guestfs_mount_vfs"
11528 #: ../src/guestfs-actions.pod:4470
11532 " guestfs_mount_vfs (guestfs_h *g,\n"
11533 " const char *options,\n"
11534 " const char *vfstype,\n"
11535 " const char *device,\n"
11536 " const char *mountpoint);\n"
11541 #: ../src/guestfs-actions.pod:4477
11543 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11544 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
11549 #: ../src/guestfs-actions.pod:4485
11550 msgid "guestfs_mountpoints"
11554 #: ../src/guestfs-actions.pod:4487
11558 " guestfs_mountpoints (guestfs_h *g);\n"
11563 #: ../src/guestfs-actions.pod:4490
11565 "This call is similar to C<guestfs_mounts>. That call returns a list of "
11566 "devices. This one returns a hash table (map) of device name to directory "
11567 "where the device is mounted."
11571 #: ../src/guestfs-actions.pod:4502
11572 msgid "guestfs_mounts"
11576 #: ../src/guestfs-actions.pod:4504
11580 " guestfs_mounts (guestfs_h *g);\n"
11585 #: ../src/guestfs-actions.pod:4507 ../fish/guestfish-actions.pod:3006
11587 "This returns the list of currently mounted filesystems. It returns the list "
11588 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11592 #: ../src/guestfs-actions.pod:4510 ../fish/guestfish-actions.pod:3009
11593 msgid "Some internal mounts are not shown."
11597 #: ../src/guestfs-actions.pod:4512
11598 msgid "See also: C<guestfs_mountpoints>"
11602 #: ../src/guestfs-actions.pod:4520
11607 #: ../src/guestfs-actions.pod:4522
11611 " guestfs_mv (guestfs_h *g,\n"
11612 " const char *src,\n"
11613 " const char *dest);\n"
11618 #: ../src/guestfs-actions.pod:4527 ../fish/guestfish-actions.pod:3017
11620 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11621 "destination filename or destination directory."
11625 #: ../src/guestfs-actions.pod:4534
11626 msgid "guestfs_ntfs_3g_probe"
11630 #: ../src/guestfs-actions.pod:4536
11634 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
11636 " const char *device);\n"
11641 #: ../src/guestfs-actions.pod:4541 ../fish/guestfish-actions.pod:3024
11643 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11644 "C<device> for mountability. (Not all NTFS volumes can be mounted "
11645 "read-write, and some cannot be mounted at all)."
11649 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3028
11651 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11652 "can be mounted read-write. Set it to false if you want to test if the "
11653 "volume can be mounted read-only."
11657 #: ../src/guestfs-actions.pod:4549 ../fish/guestfish-actions.pod:3032
11659 "The return value is an integer which C<0> if the operation would succeed, or "
11660 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11664 #: ../src/guestfs-actions.pod:4555
11665 msgid "(Added in 1.0.43)"
11669 #: ../src/guestfs-actions.pod:4557
11670 msgid "guestfs_ntfsresize"
11674 #: ../src/guestfs-actions.pod:4559
11678 " guestfs_ntfsresize (guestfs_h *g,\n"
11679 " const char *device);\n"
11684 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3040
11686 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11687 "size of the underlying device. See also L<ntfsresize(8)>."
11691 #: ../src/guestfs-actions.pod:4571
11692 msgid "guestfs_ntfsresize_size"
11696 #: ../src/guestfs-actions.pod:4573
11700 " guestfs_ntfsresize_size (guestfs_h *g,\n"
11701 " const char *device,\n"
11702 " int64_t size);\n"
11707 #: ../src/guestfs-actions.pod:4578
11709 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
11710 "to specify the new size (in bytes) explicitly."
11714 #: ../src/guestfs-actions.pod:4583 ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5341
11715 msgid "(Added in 1.3.14)"
11719 #: ../src/guestfs-actions.pod:4585
11720 msgid "guestfs_part_add"
11724 #: ../src/guestfs-actions.pod:4587
11728 " guestfs_part_add (guestfs_h *g,\n"
11729 " const char *device,\n"
11730 " const char *prlogex,\n"
11731 " int64_t startsect,\n"
11732 " int64_t endsect);\n"
11737 #: ../src/guestfs-actions.pod:4594
11739 "This command adds a partition to C<device>. If there is no partition table "
11740 "on the device, call C<guestfs_part_init> first."
11744 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3058
11746 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11747 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11748 "C<logical>) and C<e> (or C<extended>) partition types."
11752 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3063
11754 "C<startsect> and C<endsect> are the start and end of the partition in "
11755 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11756 "from the end of the disk (C<-1> is the last sector)."
11760 #: ../src/guestfs-actions.pod:4606
11762 "Creating a partition which covers the whole disk is not so easy. Use "
11763 "C<guestfs_part_disk> to do that."
11767 #: ../src/guestfs-actions.pod:4611 ../src/guestfs-actions.pod:4649 ../src/guestfs-actions.pod:4702 ../src/guestfs-actions.pod:4780 ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:4837 ../src/guestfs-actions.pod:4877
11768 msgid "(Added in 1.0.78)"
11772 #: ../src/guestfs-actions.pod:4613
11773 msgid "guestfs_part_del"
11777 #: ../src/guestfs-actions.pod:4615
11781 " guestfs_part_del (guestfs_h *g,\n"
11782 " const char *device,\n"
11788 #: ../src/guestfs-actions.pod:4620 ../fish/guestfish-actions.pod:3074
11789 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11793 #: ../src/guestfs-actions.pod:4622 ../fish/guestfish-actions.pod:3076
11795 "Note that in the case of MBR partitioning, deleting an extended partition "
11796 "also deletes any logical partitions it contains."
11800 #: ../src/guestfs-actions.pod:4630
11801 msgid "guestfs_part_disk"
11805 #: ../src/guestfs-actions.pod:4632
11809 " guestfs_part_disk (guestfs_h *g,\n"
11810 " const char *device,\n"
11811 " const char *parttype);\n"
11816 #: ../src/guestfs-actions.pod:4637
11818 "This command is simply a combination of C<guestfs_part_init> followed by "
11819 "C<guestfs_part_add> to create a single primary partition covering the whole "
11824 #: ../src/guestfs-actions.pod:4641
11826 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11827 "possible values are described in C<guestfs_part_init>."
11831 #: ../src/guestfs-actions.pod:4651
11832 msgid "guestfs_part_get_bootable"
11836 #: ../src/guestfs-actions.pod:4653
11840 " guestfs_part_get_bootable (guestfs_h *g,\n"
11841 " const char *device,\n"
11847 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3098
11849 "This command returns true if the partition C<partnum> on C<device> has the "
11850 "bootable flag set."
11854 #: ../src/guestfs-actions.pod:4661
11855 msgid "See also C<guestfs_part_set_bootable>."
11859 #: ../src/guestfs-actions.pod:4667
11860 msgid "guestfs_part_get_mbr_id"
11864 #: ../src/guestfs-actions.pod:4669
11868 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
11869 " const char *device,\n"
11875 #: ../src/guestfs-actions.pod:4674 ../fish/guestfish-actions.pod:3107
11877 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11878 "partition C<partnum>."
11882 #: ../src/guestfs-actions.pod:4677 ../src/guestfs-actions.pod:4853
11884 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11885 "undefined results for other partition table types (see "
11886 "C<guestfs_part_get_parttype>)."
11890 #: ../src/guestfs-actions.pod:4685
11891 msgid "guestfs_part_get_parttype"
11895 #: ../src/guestfs-actions.pod:4687
11899 " guestfs_part_get_parttype (guestfs_h *g,\n"
11900 " const char *device);\n"
11905 #: ../src/guestfs-actions.pod:4691 ../fish/guestfish-actions.pod:3118
11907 "This command examines the partition table on C<device> and returns the "
11908 "partition table type (format) being used."
11912 #: ../src/guestfs-actions.pod:4694
11914 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11915 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11916 "possible, although unusual. See C<guestfs_part_init> for a full list."
11920 #: ../src/guestfs-actions.pod:4704
11921 msgid "guestfs_part_init"
11925 #: ../src/guestfs-actions.pod:4706
11929 " guestfs_part_init (guestfs_h *g,\n"
11930 " const char *device,\n"
11931 " const char *parttype);\n"
11936 #: ../src/guestfs-actions.pod:4711 ../fish/guestfish-actions.pod:3130
11938 "This creates an empty partition table on C<device> of one of the partition "
11939 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11940 "(for large disks)."
11944 #: ../src/guestfs-actions.pod:4715
11946 "Initially there are no partitions. Following this, you should call "
11947 "C<guestfs_part_add> for each partition required."
11951 #: ../src/guestfs-actions.pod:4718 ../fish/guestfish-actions.pod:3137
11952 msgid "Possible values for C<parttype> are:"
11956 #: ../src/guestfs-actions.pod:4722 ../fish/guestfish-actions.pod:3141
11957 msgid "B<efi> | B<gpt>"
11961 #: ../src/guestfs-actions.pod:4724 ../fish/guestfish-actions.pod:3143
11962 msgid "Intel EFI / GPT partition table."
11966 #: ../src/guestfs-actions.pod:4726 ../fish/guestfish-actions.pod:3145
11968 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11969 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11970 "the C<mbr> format."
11974 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3149
11975 msgid "B<mbr> | B<msdos>"
11979 #: ../src/guestfs-actions.pod:4732 ../fish/guestfish-actions.pod:3151
11981 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11982 "Windows. This partition type will B<only> work for device sizes up to 2 "
11983 "TB. For large disks we recommend using C<gpt>."
11987 #: ../src/guestfs-actions.pod:4739 ../fish/guestfish-actions.pod:3158
11988 msgid "Other partition table types that may work but are not supported include:"
11992 #: ../src/guestfs-actions.pod:4744 ../fish/guestfish-actions.pod:3163
11997 #: ../src/guestfs-actions.pod:4746 ../fish/guestfish-actions.pod:3165
11998 msgid "AIX disk labels."
12002 #: ../src/guestfs-actions.pod:4748 ../fish/guestfish-actions.pod:3167
12003 msgid "B<amiga> | B<rdb>"
12007 #: ../src/guestfs-actions.pod:4750 ../fish/guestfish-actions.pod:3169
12008 msgid "Amiga \"Rigid Disk Block\" format."
12012 #: ../src/guestfs-actions.pod:4752 ../fish/guestfish-actions.pod:3171
12017 #: ../src/guestfs-actions.pod:4754 ../fish/guestfish-actions.pod:3173
12018 msgid "BSD disk labels."
12022 #: ../src/guestfs-actions.pod:4756 ../fish/guestfish-actions.pod:3175
12027 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3177
12028 msgid "DASD, used on IBM mainframes."
12032 #: ../src/guestfs-actions.pod:4760 ../fish/guestfish-actions.pod:3179
12037 #: ../src/guestfs-actions.pod:4762 ../fish/guestfish-actions.pod:3181
12038 msgid "MIPS/SGI volumes."
12042 #: ../src/guestfs-actions.pod:4764 ../fish/guestfish-actions.pod:3183
12047 #: ../src/guestfs-actions.pod:4766 ../fish/guestfish-actions.pod:3185
12048 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12052 #: ../src/guestfs-actions.pod:4768 ../fish/guestfish-actions.pod:3187
12057 #: ../src/guestfs-actions.pod:4770 ../fish/guestfish-actions.pod:3189
12058 msgid "NEC PC-98 format, common in Japan apparently."
12062 #: ../src/guestfs-actions.pod:4772 ../fish/guestfish-actions.pod:3191
12067 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3193
12068 msgid "Sun disk labels."
12072 #: ../src/guestfs-actions.pod:4782
12073 msgid "guestfs_part_list"
12077 #: ../src/guestfs-actions.pod:4784
12080 " struct guestfs_partition_list *\n"
12081 " guestfs_part_list (guestfs_h *g,\n"
12082 " const char *device);\n"
12087 #: ../src/guestfs-actions.pod:4788 ../fish/guestfish-actions.pod:3201
12089 "This command parses the partition table on C<device> and returns the list of "
12090 "partitions found."
12094 #: ../src/guestfs-actions.pod:4791 ../fish/guestfish-actions.pod:3204
12095 msgid "The fields in the returned structure are:"
12099 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3208
12100 msgid "B<part_num>"
12104 #: ../src/guestfs-actions.pod:4797 ../fish/guestfish-actions.pod:3210
12105 msgid "Partition number, counting from 1."
12109 #: ../src/guestfs-actions.pod:4799 ../fish/guestfish-actions.pod:3212
12110 msgid "B<part_start>"
12114 #: ../src/guestfs-actions.pod:4801
12116 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12117 "the device's sector size, see C<guestfs_blockdev_getss>."
12121 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3217
12122 msgid "B<part_end>"
12126 #: ../src/guestfs-actions.pod:4806 ../fish/guestfish-actions.pod:3219
12127 msgid "End of the partition in bytes."
12131 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3221
12132 msgid "B<part_size>"
12136 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3223
12137 msgid "Size of the partition in bytes."
12141 #: ../src/guestfs-actions.pod:4814
12143 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12144 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12149 #: ../src/guestfs-actions.pod:4820
12150 msgid "guestfs_part_set_bootable"
12154 #: ../src/guestfs-actions.pod:4822
12158 " guestfs_part_set_bootable (guestfs_h *g,\n"
12159 " const char *device,\n"
12161 " int bootable);\n"
12166 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3231
12168 "This sets the bootable flag on partition numbered C<partnum> on device "
12169 "C<device>. Note that partitions are numbered from 1."
12173 #: ../src/guestfs-actions.pod:4831 ../fish/guestfish-actions.pod:3234
12175 "The bootable flag is used by some operating systems (notably Windows) to "
12176 "determine which partition to boot from. It is by no means universally "
12181 #: ../src/guestfs-actions.pod:4839
12182 msgid "guestfs_part_set_mbr_id"
12186 #: ../src/guestfs-actions.pod:4841
12190 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12191 " const char *device,\n"
12198 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3242
12200 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12201 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12202 "documentation are in fact hexadecimal numbers, but usually documented "
12203 "without any leading \"0x\" which might be confusing."
12207 #: ../src/guestfs-actions.pod:4861
12208 msgid "guestfs_part_set_name"
12212 #: ../src/guestfs-actions.pod:4863
12216 " guestfs_part_set_name (guestfs_h *g,\n"
12217 " const char *device,\n"
12219 " const char *name);\n"
12224 #: ../src/guestfs-actions.pod:4869 ../fish/guestfish-actions.pod:3256
12226 "This sets the partition name on partition numbered C<partnum> on device "
12227 "C<device>. Note that partitions are numbered from 1."
12231 #: ../src/guestfs-actions.pod:4872 ../fish/guestfish-actions.pod:3259
12233 "The partition name can only be set on certain types of partition table. "
12234 "This works on C<gpt> but not on C<mbr> partitions."
12238 #: ../src/guestfs-actions.pod:4879
12239 msgid "guestfs_part_to_dev"
12243 #: ../src/guestfs-actions.pod:4881
12247 " guestfs_part_to_dev (guestfs_h *g,\n"
12248 " const char *partition);\n"
12253 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3266
12255 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12256 "partition number, returning the device name (eg. \"/dev/sdb\")."
12260 #: ../src/guestfs-actions.pod:4889
12262 "The named partition must exist, for example as a string returned from "
12263 "C<guestfs_list_partitions>."
12267 #: ../src/guestfs-actions.pod:4897
12268 msgid "guestfs_ping_daemon"
12272 #: ../src/guestfs-actions.pod:4899
12276 " guestfs_ping_daemon (guestfs_h *g);\n"
12281 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3277
12283 "This is a test probe into the guestfs daemon running inside the qemu "
12284 "subprocess. Calling this function checks that the daemon responds to the "
12285 "ping message, without affecting the daemon or attached block device(s) in "
12290 #: ../src/guestfs-actions.pod:4911
12291 msgid "guestfs_pread"
12295 #: ../src/guestfs-actions.pod:4913
12299 " guestfs_pread (guestfs_h *g,\n"
12300 " const char *path,\n"
12302 " int64_t offset,\n"
12303 " size_t *size_r);\n"
12308 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3286
12310 "This command lets you read part of a file. It reads C<count> bytes of the "
12311 "file, starting at C<offset>, from file C<path>."
12315 #: ../src/guestfs-actions.pod:4923 ../src/guestfs-actions.pod:4949 ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3304
12317 "This may read fewer bytes than requested. For further details see the "
12318 "L<pread(2)> system call."
12322 #: ../src/guestfs-actions.pod:4926
12323 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12327 #: ../src/guestfs-actions.pod:4937
12328 msgid "guestfs_pread_device"
12332 #: ../src/guestfs-actions.pod:4939
12336 " guestfs_pread_device (guestfs_h *g,\n"
12337 " const char *device,\n"
12339 " int64_t offset,\n"
12340 " size_t *size_r);\n"
12345 #: ../src/guestfs-actions.pod:4946 ../fish/guestfish-actions.pod:3301
12347 "This command lets you read part of a file. It reads C<count> bytes of "
12348 "C<device>, starting at C<offset>."
12352 #: ../src/guestfs-actions.pod:4952
12353 msgid "See also C<guestfs_pread>."
12357 #: ../src/guestfs-actions.pod:4961
12358 msgid "(Added in 1.5.21)"
12362 #: ../src/guestfs-actions.pod:4963
12363 msgid "guestfs_pvcreate"
12367 #: ../src/guestfs-actions.pod:4965
12371 " guestfs_pvcreate (guestfs_h *g,\n"
12372 " const char *device);\n"
12377 #: ../src/guestfs-actions.pod:4969 ../fish/guestfish-actions.pod:3316
12379 "This creates an LVM physical volume on the named C<device>, where C<device> "
12380 "should usually be a partition name such as C</dev/sda1>."
12384 #: ../src/guestfs-actions.pod:4977
12385 msgid "guestfs_pvremove"
12389 #: ../src/guestfs-actions.pod:4979
12393 " guestfs_pvremove (guestfs_h *g,\n"
12394 " const char *device);\n"
12399 #: ../src/guestfs-actions.pod:4983 ../fish/guestfish-actions.pod:3324
12401 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12406 #: ../src/guestfs-actions.pod:4986 ../fish/guestfish-actions.pod:3327
12408 "The implementation uses the C<pvremove> command which refuses to wipe "
12409 "physical volumes that contain any volume groups, so you have to remove those "
12414 #: ../src/guestfs-actions.pod:4994
12415 msgid "guestfs_pvresize"
12419 #: ../src/guestfs-actions.pod:4996
12423 " guestfs_pvresize (guestfs_h *g,\n"
12424 " const char *device);\n"
12429 #: ../src/guestfs-actions.pod:5000 ../fish/guestfish-actions.pod:3335
12431 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12432 "the new size of the underlying device."
12436 #: ../src/guestfs-actions.pod:5007
12437 msgid "guestfs_pvresize_size"
12441 #: ../src/guestfs-actions.pod:5009
12445 " guestfs_pvresize_size (guestfs_h *g,\n"
12446 " const char *device,\n"
12447 " int64_t size);\n"
12452 #: ../src/guestfs-actions.pod:5014
12454 "This command is the same as C<guestfs_pvresize> except that it allows you to "
12455 "specify the new size (in bytes) explicitly."
12459 #: ../src/guestfs-actions.pod:5021
12460 msgid "guestfs_pvs"
12464 #: ../src/guestfs-actions.pod:5023
12468 " guestfs_pvs (guestfs_h *g);\n"
12473 #: ../src/guestfs-actions.pod:5026 ../fish/guestfish-actions.pod:3349
12475 "List all the physical volumes detected. This is the equivalent of the "
12476 "L<pvs(8)> command."
12480 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3352
12482 "This returns a list of just the device names that contain PVs "
12483 "(eg. C</dev/sda2>)."
12487 #: ../src/guestfs-actions.pod:5032
12488 msgid "See also C<guestfs_pvs_full>."
12492 #: ../src/guestfs-actions.pod:5040
12493 msgid "guestfs_pvs_full"
12497 #: ../src/guestfs-actions.pod:5042
12500 " struct guestfs_lvm_pv_list *\n"
12501 " guestfs_pvs_full (guestfs_h *g);\n"
12506 #: ../src/guestfs-actions.pod:5045 ../fish/guestfish-actions.pod:3361
12508 "List all the physical volumes detected. This is the equivalent of the "
12509 "L<pvs(8)> command. The \"full\" version includes all fields."
12513 #: ../src/guestfs-actions.pod:5048
12515 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
12516 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
12521 #: ../src/guestfs-actions.pod:5054
12522 msgid "guestfs_pvuuid"
12526 #: ../src/guestfs-actions.pod:5056
12530 " guestfs_pvuuid (guestfs_h *g,\n"
12531 " const char *device);\n"
12536 #: ../src/guestfs-actions.pod:5060 ../fish/guestfish-actions.pod:3368
12537 msgid "This command returns the UUID of the LVM PV C<device>."
12541 #: ../src/guestfs-actions.pod:5067
12542 msgid "guestfs_pwrite"
12546 #: ../src/guestfs-actions.pod:5069
12550 " guestfs_pwrite (guestfs_h *g,\n"
12551 " const char *path,\n"
12552 " const char *content,\n"
12553 " size_t content_size,\n"
12554 " int64_t offset);\n"
12559 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3374
12561 "This command writes to part of a file. It writes the data buffer C<content> "
12562 "to the file C<path> starting at offset C<offset>."
12566 #: ../src/guestfs-actions.pod:5079 ../fish/guestfish-actions.pod:3377
12568 "This command implements the L<pwrite(2)> system call, and like that system "
12569 "call it may not write the full data requested. The return value is the "
12570 "number of bytes that were actually written to the file. This could even be "
12571 "0, although short writes are unlikely for regular files in ordinary "
12576 #: ../src/guestfs-actions.pod:5085
12577 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
12581 #: ../src/guestfs-actions.pod:5094
12582 msgid "guestfs_pwrite_device"
12586 #: ../src/guestfs-actions.pod:5096
12590 " guestfs_pwrite_device (guestfs_h *g,\n"
12591 " const char *device,\n"
12592 " const char *content,\n"
12593 " size_t content_size,\n"
12594 " int64_t offset);\n"
12599 #: ../src/guestfs-actions.pod:5103 ../fish/guestfish-actions.pod:3392
12601 "This command writes to part of a device. It writes the data buffer "
12602 "C<content> to C<device> starting at offset C<offset>."
12606 #: ../src/guestfs-actions.pod:5106 ../fish/guestfish-actions.pod:3395
12608 "This command implements the L<pwrite(2)> system call, and like that system "
12609 "call it may not write the full data requested (although short writes to disk "
12610 "devices and partitions are probably impossible with standard Linux kernels)."
12614 #: ../src/guestfs-actions.pod:5111
12615 msgid "See also C<guestfs_pwrite>."
12619 #: ../src/guestfs-actions.pod:5118
12620 msgid "(Added in 1.5.20)"
12624 #: ../src/guestfs-actions.pod:5120
12625 msgid "guestfs_read_file"
12629 #: ../src/guestfs-actions.pod:5122
12633 " guestfs_read_file (guestfs_h *g,\n"
12634 " const char *path,\n"
12635 " size_t *size_r);\n"
12640 #: ../src/guestfs-actions.pod:5127 ../fish/guestfish-actions.pod:3409
12641 msgid "This calls returns the contents of the file C<path> as a buffer."
12645 #: ../src/guestfs-actions.pod:5130
12647 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
12648 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
12649 "function is limited in the total size of file that can be handled."
12653 #: ../src/guestfs-actions.pod:5142
12654 msgid "(Added in 1.0.63)"
12658 #: ../src/guestfs-actions.pod:5144
12659 msgid "guestfs_read_lines"
12663 #: ../src/guestfs-actions.pod:5146
12667 " guestfs_read_lines (guestfs_h *g,\n"
12668 " const char *path);\n"
12673 #: ../src/guestfs-actions.pod:5152 ../fish/guestfish-actions.pod:3426
12675 "The file contents are returned as a list of lines. Trailing C<LF> and "
12676 "C<CRLF> character sequences are I<not> returned."
12680 #: ../src/guestfs-actions.pod:5155
12682 "Note that this function cannot correctly handle binary files (specifically, "
12683 "files containing C<\\0> character which is treated as end of line). For "
12684 "those you need to use the C<guestfs_read_file> function which has a more "
12685 "complex interface."
12689 #: ../src/guestfs-actions.pod:5166
12690 msgid "guestfs_readdir"
12694 #: ../src/guestfs-actions.pod:5168
12697 " struct guestfs_dirent_list *\n"
12698 " guestfs_readdir (guestfs_h *g,\n"
12699 " const char *dir);\n"
12704 #: ../src/guestfs-actions.pod:5172 ../fish/guestfish-actions.pod:3438
12705 msgid "This returns the list of directory entries in directory C<dir>."
12709 #: ../src/guestfs-actions.pod:5174 ../fish/guestfish-actions.pod:3440
12711 "All entries in the directory are returned, including C<.> and C<..>. The "
12712 "entries are I<not> sorted, but returned in the same order as the underlying "
12717 #: ../src/guestfs-actions.pod:5178 ../fish/guestfish-actions.pod:3444
12719 "Also this call returns basic file type information about each file. The "
12720 "C<ftyp> field will contain one of the following characters:"
12724 #: ../src/guestfs-actions.pod:5183 ../fish/guestfish-actions.pod:3449
12729 #: ../src/guestfs-actions.pod:5185 ../fish/guestfish-actions.pod:3451
12730 msgid "Block special"
12734 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:3453
12739 #: ../src/guestfs-actions.pod:5189 ../fish/guestfish-actions.pod:3455
12740 msgid "Char special"
12744 #: ../src/guestfs-actions.pod:5191 ../fish/guestfish-actions.pod:3457
12749 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:3459
12754 #: ../src/guestfs-actions.pod:5195 ../fish/guestfish-actions.pod:3461
12759 #: ../src/guestfs-actions.pod:5197 ../fish/guestfish-actions.pod:3463
12760 msgid "FIFO (named pipe)"
12764 #: ../src/guestfs-actions.pod:5199 ../fish/guestfish-actions.pod:3465
12769 #: ../src/guestfs-actions.pod:5201 ../fish/guestfish-actions.pod:3467
12770 msgid "Symbolic link"
12774 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:3469
12779 #: ../src/guestfs-actions.pod:5205 ../fish/guestfish-actions.pod:3471
12780 msgid "Regular file"
12784 #: ../src/guestfs-actions.pod:5207 ../fish/guestfish-actions.pod:3473
12789 #: ../src/guestfs-actions.pod:5209 ../fish/guestfish-actions.pod:3475
12794 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:3477
12799 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:3479
12800 msgid "Unknown file type"
12804 #: ../src/guestfs-actions.pod:5215 ../fish/guestfish-actions.pod:3481
12809 #: ../src/guestfs-actions.pod:5217 ../fish/guestfish-actions.pod:3483
12810 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12814 #: ../src/guestfs-actions.pod:5222
12816 "This function is primarily intended for use by programs. To get a simple "
12817 "list of names, use C<guestfs_ls>. To get a printable directory for human "
12818 "consumption, use C<guestfs_ll>."
12822 #: ../src/guestfs-actions.pod:5226
12824 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
12825 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
12830 #: ../src/guestfs-actions.pod:5232
12831 msgid "guestfs_readlink"
12835 #: ../src/guestfs-actions.pod:5234
12839 " guestfs_readlink (guestfs_h *g,\n"
12840 " const char *path);\n"
12845 #: ../src/guestfs-actions.pod:5238 ../fish/guestfish-actions.pod:3496
12846 msgid "This command reads the target of a symbolic link."
12850 #: ../src/guestfs-actions.pod:5245
12851 msgid "guestfs_readlinklist"
12855 #: ../src/guestfs-actions.pod:5247
12859 " guestfs_readlinklist (guestfs_h *g,\n"
12860 " const char *path,\n"
12861 " char *const *names);\n"
12866 #: ../src/guestfs-actions.pod:5252 ../fish/guestfish-actions.pod:3502
12868 "This call allows you to do a C<readlink> operation on multiple files, where "
12869 "all files are in the directory C<path>. C<names> is the list of files from "
12874 #: ../src/guestfs-actions.pod:5256 ../fish/guestfish-actions.pod:3506
12876 "On return you get a list of strings, with a one-to-one correspondence to the "
12877 "C<names> list. Each string is the value of the symbolic link."
12881 #: ../src/guestfs-actions.pod:5260 ../fish/guestfish-actions.pod:3510
12883 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12884 "result string is the empty string C<\"\">. However the whole operation is "
12885 "completed even if there were C<readlink(2)> errors, and so you can call this "
12886 "function with names where you don't know if they are symbolic links already "
12887 "(albeit slightly less efficient)."
12891 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3517
12893 "This call is intended for programs that want to efficiently list a directory "
12894 "contents without making many round-trips. Very long directory listings "
12895 "might cause the protocol message size to be exceeded, causing this call to "
12896 "fail. The caller must split up such requests into smaller groups of names."
12900 #: ../src/guestfs-actions.pod:5280
12901 msgid "guestfs_realpath"
12905 #: ../src/guestfs-actions.pod:5282
12909 " guestfs_realpath (guestfs_h *g,\n"
12910 " const char *path);\n"
12915 #: ../src/guestfs-actions.pod:5286 ../fish/guestfish-actions.pod:3528
12917 "Return the canonicalized absolute pathname of C<path>. The returned path "
12918 "has no C<.>, C<..> or symbolic link path elements."
12922 #: ../src/guestfs-actions.pod:5294
12923 msgid "guestfs_removexattr"
12927 #: ../src/guestfs-actions.pod:5296
12931 " guestfs_removexattr (guestfs_h *g,\n"
12932 " const char *xattr,\n"
12933 " const char *path);\n"
12938 #: ../src/guestfs-actions.pod:5301 ../fish/guestfish-actions.pod:3535
12939 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
12943 #: ../src/guestfs-actions.pod:5304
12944 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
12948 #: ../src/guestfs-actions.pod:5310
12949 msgid "guestfs_resize2fs"
12953 #: ../src/guestfs-actions.pod:5312
12957 " guestfs_resize2fs (guestfs_h *g,\n"
12958 " const char *device);\n"
12963 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3544
12965 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12966 "underlying device."
12970 #: ../src/guestfs-actions.pod:5319
12972 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
12973 "C<device> before calling this command. For unknown reasons C<resize2fs> "
12974 "sometimes gives an error about this and sometimes not. In any case, it is "
12975 "always safe to call C<guestfs_e2fsck_f> before calling this function."
12979 #: ../src/guestfs-actions.pod:5329
12980 msgid "guestfs_resize2fs_size"
12984 #: ../src/guestfs-actions.pod:5331
12988 " guestfs_resize2fs_size (guestfs_h *g,\n"
12989 " const char *device,\n"
12990 " int64_t size);\n"
12995 #: ../src/guestfs-actions.pod:5336
12997 "This command is the same as C<guestfs_resize2fs> except that it allows you "
12998 "to specify the new size (in bytes) explicitly."
13002 #: ../src/guestfs-actions.pod:5343
13007 #: ../src/guestfs-actions.pod:5345
13011 " guestfs_rm (guestfs_h *g,\n"
13012 " const char *path);\n"
13017 #: ../src/guestfs-actions.pod:5349 ../fish/guestfish-actions.pod:3564
13018 msgid "Remove the single file C<path>."
13022 #: ../src/guestfs-actions.pod:5355
13023 msgid "guestfs_rm_rf"
13027 #: ../src/guestfs-actions.pod:5357
13031 " guestfs_rm_rf (guestfs_h *g,\n"
13032 " const char *path);\n"
13037 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3570
13039 "Remove the file or directory C<path>, recursively removing the contents if "
13040 "its a directory. This is like the C<rm -rf> shell command."
13044 #: ../src/guestfs-actions.pod:5369
13045 msgid "guestfs_rmdir"
13049 #: ../src/guestfs-actions.pod:5371
13053 " guestfs_rmdir (guestfs_h *g,\n"
13054 " const char *path);\n"
13059 #: ../src/guestfs-actions.pod:5375 ../fish/guestfish-actions.pod:3578
13060 msgid "Remove the single directory C<path>."
13064 #: ../src/guestfs-actions.pod:5381
13065 msgid "guestfs_rmmountpoint"
13069 #: ../src/guestfs-actions.pod:5383
13073 " guestfs_rmmountpoint (guestfs_h *g,\n"
13074 " const char *exemptpath);\n"
13079 #: ../src/guestfs-actions.pod:5387
13081 "This calls removes a mountpoint that was previously created with "
13082 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13086 #: ../src/guestfs-actions.pod:5395
13087 msgid "guestfs_scrub_device"
13091 #: ../src/guestfs-actions.pod:5397
13095 " guestfs_scrub_device (guestfs_h *g,\n"
13096 " const char *device);\n"
13101 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3592
13103 "This command writes patterns over C<device> to make data retrieval more "
13108 #: ../src/guestfs-actions.pod:5404 ../src/guestfs-actions.pod:5425 ../src/guestfs-actions.pod:5444 ../fish/guestfish-actions.pod:3595 ../fish/guestfish-actions.pod:3610 ../fish/guestfish-actions.pod:3623
13110 "It is an interface to the L<scrub(1)> program. See that manual page for "
13115 #: ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:5430 ../src/guestfs-actions.pod:5449
13116 msgid "(Added in 1.0.52)"
13120 #: ../src/guestfs-actions.pod:5414
13121 msgid "guestfs_scrub_file"
13125 #: ../src/guestfs-actions.pod:5416
13129 " guestfs_scrub_file (guestfs_h *g,\n"
13130 " const char *file);\n"
13135 #: ../src/guestfs-actions.pod:5420 ../fish/guestfish-actions.pod:3605
13137 "This command writes patterns over a file to make data retrieval more "
13142 #: ../src/guestfs-actions.pod:5423 ../fish/guestfish-actions.pod:3608
13143 msgid "The file is I<removed> after scrubbing."
13147 #: ../src/guestfs-actions.pod:5432
13148 msgid "guestfs_scrub_freespace"
13152 #: ../src/guestfs-actions.pod:5434
13156 " guestfs_scrub_freespace (guestfs_h *g,\n"
13157 " const char *dir);\n"
13162 #: ../src/guestfs-actions.pod:5438
13164 "This command creates the directory C<dir> and then fills it with files until "
13165 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13166 "and deletes them. The intention is to scrub any free space on the partition "
13167 "containing C<dir>."
13171 #: ../src/guestfs-actions.pod:5451
13172 msgid "guestfs_set_append"
13176 #: ../src/guestfs-actions.pod:5453
13180 " guestfs_set_append (guestfs_h *g,\n"
13181 " const char *append);\n"
13186 #: ../src/guestfs-actions.pod:5457 ../fish/guestfish-actions.pod:3632
13188 "This function is used to add additional options to the guest kernel command "
13193 #: ../src/guestfs-actions.pod:5460 ../fish/guestfish-actions.pod:3635
13195 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13196 "environment variable."
13200 #: ../src/guestfs-actions.pod:5463 ../fish/guestfish-actions.pod:3638
13202 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13203 "(libguestfs always adds a few of its own)."
13207 #: ../src/guestfs-actions.pod:5470
13208 msgid "guestfs_set_autosync"
13212 #: ../src/guestfs-actions.pod:5472
13216 " guestfs_set_autosync (guestfs_h *g,\n"
13217 " int autosync);\n"
13222 #: ../src/guestfs-actions.pod:5476
13224 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13225 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13226 "the handle is closed (also if the program exits without closing handles)."
13230 #: ../src/guestfs-actions.pod:5481 ../fish/guestfish-actions.pod:3652
13232 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13233 "disabled by default)."
13237 #: ../src/guestfs-actions.pod:5488
13238 msgid "guestfs_set_direct"
13242 #: ../src/guestfs-actions.pod:5490
13246 " guestfs_set_direct (guestfs_h *g,\n"
13252 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:3661
13254 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13255 "passed directly through to the appliance once it is launched."
13259 #: ../src/guestfs-actions.pod:5498
13261 "One consequence of this is that log messages aren't caught by the library "
13262 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13267 #: ../src/guestfs-actions.pod:5502 ../fish/guestfish-actions.pod:3669
13268 msgid "You probably don't want to use this unless you know what you are doing."
13272 #: ../src/guestfs-actions.pod:5505 ../fish/guestfish-actions.pod:3672
13273 msgid "The default is disabled."
13277 #: ../src/guestfs-actions.pod:5511
13278 msgid "guestfs_set_e2label"
13282 #: ../src/guestfs-actions.pod:5513
13286 " guestfs_set_e2label (guestfs_h *g,\n"
13287 " const char *device,\n"
13288 " const char *label);\n"
13293 #: ../src/guestfs-actions.pod:5518 ../fish/guestfish-actions.pod:3678
13295 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13296 "C<label>. Filesystem labels are limited to 16 characters."
13300 #: ../src/guestfs-actions.pod:5522
13302 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13303 "the existing label on a filesystem."
13307 #: ../src/guestfs-actions.pod:5529
13308 msgid "guestfs_set_e2uuid"
13312 #: ../src/guestfs-actions.pod:5531
13316 " guestfs_set_e2uuid (guestfs_h *g,\n"
13317 " const char *device,\n"
13318 " const char *uuid);\n"
13323 #: ../src/guestfs-actions.pod:5536 ../fish/guestfish-actions.pod:3689
13325 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13326 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13327 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13331 #: ../src/guestfs-actions.pod:5541
13333 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13334 "the existing UUID of a filesystem."
13338 #: ../src/guestfs-actions.pod:5548
13339 msgid "guestfs_set_memsize"
13343 #: ../src/guestfs-actions.pod:5550
13347 " guestfs_set_memsize (guestfs_h *g,\n"
13353 #: ../src/guestfs-actions.pod:5554
13355 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13356 "This only has any effect if called before C<guestfs_launch>."
13360 #: ../src/guestfs-actions.pod:5558 ../fish/guestfish-actions.pod:3707
13362 "You can also change this by setting the environment variable "
13363 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13367 #: ../src/guestfs-actions.pod:5569
13368 msgid "guestfs_set_network"
13372 #: ../src/guestfs-actions.pod:5571
13376 " guestfs_set_network (guestfs_h *g,\n"
13382 #: ../src/guestfs-actions.pod:5575 ../fish/guestfish-actions.pod:3720
13384 "If C<network> is true, then the network is enabled in the libguestfs "
13385 "appliance. The default is false."
13389 #: ../src/guestfs-actions.pod:5578 ../fish/guestfish-actions.pod:3723
13391 "This affects whether commands are able to access the network (see "
13392 "L<guestfs(3)/RUNNING COMMANDS>)."
13396 #: ../src/guestfs-actions.pod:5581
13398 "You must call this before calling C<guestfs_launch>, otherwise it has no "
13403 #: ../src/guestfs-actions.pod:5588
13404 msgid "guestfs_set_path"
13408 #: ../src/guestfs-actions.pod:5590
13412 " guestfs_set_path (guestfs_h *g,\n"
13413 " const char *searchpath);\n"
13418 #: ../src/guestfs-actions.pod:5594 ../fish/guestfish-actions.pod:3735
13419 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13423 #: ../src/guestfs-actions.pod:5596 ../fish/guestfish-actions.pod:3737
13425 "The default is C<$libdir/guestfs> unless overridden by setting "
13426 "C<LIBGUESTFS_PATH> environment variable."
13430 #: ../src/guestfs-actions.pod:5599 ../fish/guestfish-actions.pod:3740
13431 msgid "Setting C<path> to C<NULL> restores the default path."
13435 #: ../src/guestfs-actions.pod:5605
13436 msgid "guestfs_set_qemu"
13440 #: ../src/guestfs-actions.pod:5607
13444 " guestfs_set_qemu (guestfs_h *g,\n"
13445 " const char *qemu);\n"
13450 #: ../src/guestfs-actions.pod:5611 ../fish/guestfish-actions.pod:3748
13451 msgid "Set the qemu binary that we will use."
13455 #: ../src/guestfs-actions.pod:5613 ../fish/guestfish-actions.pod:3750
13456 msgid "The default is chosen when the library was compiled by the configure script."
13460 #: ../src/guestfs-actions.pod:5616 ../fish/guestfish-actions.pod:3753
13462 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13467 #: ../src/guestfs-actions.pod:5619 ../fish/guestfish-actions.pod:3756
13468 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13472 #: ../src/guestfs-actions.pod:5621 ../fish/guestfish-actions.pod:3758
13474 "Note that you should call this function as early as possible after creating "
13475 "the handle. This is because some pre-launch operations depend on testing "
13476 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13477 "don't retest features, and so you might see inconsistent results. Using the "
13478 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13479 "the qemu binary at the same time as the handle is created."
13483 #: ../src/guestfs-actions.pod:5633
13484 msgid "guestfs_set_recovery_proc"
13488 #: ../src/guestfs-actions.pod:5635
13492 " guestfs_set_recovery_proc (guestfs_h *g,\n"
13493 " int recoveryproc);\n"
13498 #: ../src/guestfs-actions.pod:5639
13500 "If this is called with the parameter C<false> then C<guestfs_launch> does "
13501 "not create a recovery process. The purpose of the recovery process is to "
13502 "stop runaway qemu processes in the case where the main program aborts "
13507 #: ../src/guestfs-actions.pod:5644
13509 "This only has any effect if called before C<guestfs_launch>, and the default "
13514 #: ../src/guestfs-actions.pod:5647 ../fish/guestfish-actions.pod:3780
13516 "About the only time when you would want to disable this is if the main "
13517 "process will fork itself into the background (\"daemonize\" itself). In "
13518 "this case the recovery process thinks that the main program has disappeared "
13519 "and so kills qemu, which is not very helpful."
13523 #: ../src/guestfs-actions.pod:5657
13524 msgid "guestfs_set_selinux"
13528 #: ../src/guestfs-actions.pod:5659
13532 " guestfs_set_selinux (guestfs_h *g,\n"
13538 #: ../src/guestfs-actions.pod:5663 ../fish/guestfish-actions.pod:3792
13540 "This sets the selinux flag that is passed to the appliance at boot time. "
13541 "The default is C<selinux=0> (disabled)."
13545 #: ../src/guestfs-actions.pod:5666 ../fish/guestfish-actions.pod:3795
13547 "Note that if SELinux is enabled, it is always in Permissive mode "
13548 "(C<enforcing=0>)."
13552 #: ../src/guestfs-actions.pod:5676
13553 msgid "guestfs_set_trace"
13557 #: ../src/guestfs-actions.pod:5678
13561 " guestfs_set_trace (guestfs_h *g,\n"
13567 #: ../src/guestfs-actions.pod:5682 ../fish/guestfish-actions.pod:3807
13569 "If the command trace flag is set to 1, then commands are printed on stderr "
13570 "before they are executed in a format which is very similar to the one used "
13571 "by guestfish. In other words, you can run a program with this enabled, and "
13572 "you will get out a script which you can feed to guestfish to perform the "
13573 "same set of actions."
13577 #: ../src/guestfs-actions.pod:5689 ../fish/guestfish-actions.pod:3814
13579 "If you want to trace C API calls into libguestfs (and other libraries) then "
13580 "possibly a better way is to use the external ltrace(1) command."
13584 #: ../src/guestfs-actions.pod:5693 ../fish/guestfish-actions.pod:3818
13586 "Command traces are disabled unless the environment variable "
13587 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13591 #: ../src/guestfs-actions.pod:5700
13592 msgid "guestfs_set_verbose"
13596 #: ../src/guestfs-actions.pod:5702
13600 " guestfs_set_verbose (guestfs_h *g,\n"
13606 #: ../src/guestfs-actions.pod:5706 ../fish/guestfish-actions.pod:3827
13607 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
13611 #: ../src/guestfs-actions.pod:5708 ../fish/guestfish-actions.pod:3829
13613 "Verbose messages are disabled unless the environment variable "
13614 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13618 #: ../src/guestfs-actions.pod:5715
13619 msgid "guestfs_setcon"
13623 #: ../src/guestfs-actions.pod:5717
13627 " guestfs_setcon (guestfs_h *g,\n"
13628 " const char *context);\n"
13633 #: ../src/guestfs-actions.pod:5721 ../fish/guestfish-actions.pod:3836
13635 "This sets the SELinux security context of the daemon to the string "
13640 #: ../src/guestfs-actions.pod:5724 ../fish/guestfish-actions.pod:3839
13641 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13645 #: ../src/guestfs-actions.pod:5730
13646 msgid "guestfs_setxattr"
13650 #: ../src/guestfs-actions.pod:5732
13654 " guestfs_setxattr (guestfs_h *g,\n"
13655 " const char *xattr,\n"
13656 " const char *val,\n"
13658 " const char *path);\n"
13663 #: ../src/guestfs-actions.pod:5739 ../fish/guestfish-actions.pod:3845
13665 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13666 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13670 #: ../src/guestfs-actions.pod:5743
13671 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
13675 #: ../src/guestfs-actions.pod:5749
13676 msgid "guestfs_sfdisk"
13680 #: ../src/guestfs-actions.pod:5751
13684 " guestfs_sfdisk (guestfs_h *g,\n"
13685 " const char *device,\n"
13689 " char *const *lines);\n"
13694 #: ../src/guestfs-actions.pod:5759 ../fish/guestfish-actions.pod:3855
13696 "This is a direct interface to the L<sfdisk(8)> program for creating "
13697 "partitions on block devices."
13701 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3858
13702 msgid "C<device> should be a block device, for example C</dev/sda>."
13706 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:3860
13708 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13709 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
13710 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13711 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13712 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13713 "the kernel) cannot work out the right geometry and you will need to tell it."
13717 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:3868
13719 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13720 "refer to the L<sfdisk(8)> manpage."
13724 #: ../src/guestfs-actions.pod:5775 ../fish/guestfish-actions.pod:3871
13726 "To create a single partition occupying the whole disk, you would pass "
13727 "C<lines> as a single element list, when the single element being the string "
13732 #: ../src/guestfs-actions.pod:5779
13733 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
13737 #: ../src/guestfs-actions.pod:5789
13738 msgid "guestfs_sfdiskM"
13742 #: ../src/guestfs-actions.pod:5791
13746 " guestfs_sfdiskM (guestfs_h *g,\n"
13747 " const char *device,\n"
13748 " char *const *lines);\n"
13753 #: ../src/guestfs-actions.pod:5796
13755 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
13756 "partition sizes are specified in megabytes only (rounded to the nearest "
13757 "cylinder) and you don't need to specify the cyls, heads and sectors "
13758 "parameters which were rarely if ever used anyway."
13762 #: ../src/guestfs-actions.pod:5802
13764 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
13765 "C<guestfs_part_disk>"
13769 #: ../src/guestfs-actions.pod:5812
13770 msgid "guestfs_sfdisk_N"
13774 #: ../src/guestfs-actions.pod:5814
13778 " guestfs_sfdisk_N (guestfs_h *g,\n"
13779 " const char *device,\n"
13784 " const char *line);\n"
13789 #: ../src/guestfs-actions.pod:5823 ../fish/guestfish-actions.pod:3901
13791 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13792 "(note: C<n> counts from 1)."
13796 #: ../src/guestfs-actions.pod:5826
13798 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
13799 "for the cyls/heads/sectors parameters."
13803 #: ../src/guestfs-actions.pod:5829
13804 msgid "See also: C<guestfs_part_add>"
13808 #: ../src/guestfs-actions.pod:5838
13809 msgid "guestfs_sfdisk_disk_geometry"
13813 #: ../src/guestfs-actions.pod:5840
13817 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
13818 " const char *device);\n"
13823 #: ../src/guestfs-actions.pod:5844
13825 "This displays the disk geometry of C<device> read from the partition table. "
13826 "Especially in the case where the underlying block device has been resized, "
13827 "this can be different from the kernel's idea of the geometry (see "
13828 "C<guestfs_sfdisk_kernel_geometry>)."
13832 #: ../src/guestfs-actions.pod:5849 ../src/guestfs-actions.pod:5865 ../fish/guestfish-actions.pod:3921 ../fish/guestfish-actions.pod:3930
13833 msgid "The result is in human-readable format, and not designed to be parsed."
13837 #: ../src/guestfs-actions.pod:5857
13838 msgid "guestfs_sfdisk_kernel_geometry"
13842 #: ../src/guestfs-actions.pod:5859
13846 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
13847 " const char *device);\n"
13852 #: ../src/guestfs-actions.pod:5863 ../fish/guestfish-actions.pod:3928
13853 msgid "This displays the kernel's idea of the geometry of C<device>."
13857 #: ../src/guestfs-actions.pod:5873
13858 msgid "guestfs_sfdisk_l"
13862 #: ../src/guestfs-actions.pod:5875
13866 " guestfs_sfdisk_l (guestfs_h *g,\n"
13867 " const char *device);\n"
13872 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3937
13874 "This displays the partition table on C<device>, in the human-readable output "
13875 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13879 #: ../src/guestfs-actions.pod:5883
13880 msgid "See also: C<guestfs_part_list>"
13884 #: ../src/guestfs-actions.pod:5890
13889 #: ../src/guestfs-actions.pod:5892
13893 " guestfs_sh (guestfs_h *g,\n"
13894 " const char *command);\n"
13899 #: ../src/guestfs-actions.pod:5896 ../fish/guestfish-actions.pod:3947
13901 "This call runs a command from the guest filesystem via the guest's "
13906 #: ../src/guestfs-actions.pod:5899
13907 msgid "This is like C<guestfs_command>, but passes the command to:"
13911 #: ../src/guestfs-actions.pod:5901 ../fish/guestfish-actions.pod:3952
13914 " /bin/sh -c \"command\"\n"
13919 #: ../src/guestfs-actions.pod:5903 ../fish/guestfish-actions.pod:3954
13921 "Depending on the guest's shell, this usually results in wildcards being "
13922 "expanded, shell expressions being interpolated and so on."
13926 #: ../src/guestfs-actions.pod:5907
13927 msgid "All the provisos about C<guestfs_command> apply to this call."
13931 #: ../src/guestfs-actions.pod:5914
13932 msgid "guestfs_sh_lines"
13936 #: ../src/guestfs-actions.pod:5916
13940 " guestfs_sh_lines (guestfs_h *g,\n"
13941 " const char *command);\n"
13946 #: ../src/guestfs-actions.pod:5920
13948 "This is the same as C<guestfs_sh>, but splits the result into a list of "
13953 #: ../src/guestfs-actions.pod:5923
13954 msgid "See also: C<guestfs_command_lines>"
13958 #: ../src/guestfs-actions.pod:5931
13959 msgid "guestfs_sleep"
13963 #: ../src/guestfs-actions.pod:5933
13967 " guestfs_sleep (guestfs_h *g,\n"
13973 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:3973
13974 msgid "Sleep for C<secs> seconds."
13978 #: ../src/guestfs-actions.pod:5941
13979 msgid "(Added in 1.0.41)"
13983 #: ../src/guestfs-actions.pod:5943 ../src/guestfs-structs.pod:109
13984 msgid "guestfs_stat"
13988 #: ../src/guestfs-actions.pod:5945
13991 " struct guestfs_stat *\n"
13992 " guestfs_stat (guestfs_h *g,\n"
13993 " const char *path);\n"
13998 #: ../src/guestfs-actions.pod:5951 ../fish/guestfish-actions.pod:3981
13999 msgid "This is the same as the C<stat(2)> system call."
14003 #: ../src/guestfs-actions.pod:5959 ../src/guestfs-structs.pod:135
14004 msgid "guestfs_statvfs"
14008 #: ../src/guestfs-actions.pod:5961
14011 " struct guestfs_statvfs *\n"
14012 " guestfs_statvfs (guestfs_h *g,\n"
14013 " const char *path);\n"
14018 #: ../src/guestfs-actions.pod:5965 ../fish/guestfish-actions.pod:3987
14020 "Returns file system statistics for any mounted file system. C<path> should "
14021 "be a file or directory in the mounted file system (typically it is the mount "
14022 "point itself, but it doesn't need to be)."
14026 #: ../src/guestfs-actions.pod:5969 ../fish/guestfish-actions.pod:3991
14027 msgid "This is the same as the C<statvfs(2)> system call."
14031 #: ../src/guestfs-actions.pod:5971
14033 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14034 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14038 #: ../src/guestfs-actions.pod:5977
14039 msgid "guestfs_strings"
14043 #: ../src/guestfs-actions.pod:5979
14047 " guestfs_strings (guestfs_h *g,\n"
14048 " const char *path);\n"
14053 #: ../src/guestfs-actions.pod:5983 ../fish/guestfish-actions.pod:3997
14055 "This runs the L<strings(1)> command on a file and returns the list of "
14056 "printable strings found."
14060 #: ../src/guestfs-actions.pod:5995
14061 msgid "guestfs_strings_e"
14065 #: ../src/guestfs-actions.pod:5997
14069 " guestfs_strings_e (guestfs_h *g,\n"
14070 " const char *encoding,\n"
14071 " const char *path);\n"
14076 #: ../src/guestfs-actions.pod:6002
14078 "This is like the C<guestfs_strings> command, but allows you to specify the "
14079 "encoding of strings that are looked for in the source file C<path>."
14083 #: ../src/guestfs-actions.pod:6006 ../fish/guestfish-actions.pod:4011
14084 msgid "Allowed encodings are:"
14088 #: ../src/guestfs-actions.pod:6010 ../fish/guestfish-actions.pod:4015
14093 #: ../src/guestfs-actions.pod:6012
14095 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14096 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14100 #: ../src/guestfs-actions.pod:6015 ../fish/guestfish-actions.pod:4020
14105 #: ../src/guestfs-actions.pod:6017 ../fish/guestfish-actions.pod:4022
14106 msgid "Single 8-bit-byte characters."
14110 #: ../src/guestfs-actions.pod:6019 ../fish/guestfish-actions.pod:4024
14115 #: ../src/guestfs-actions.pod:6021 ../fish/guestfish-actions.pod:4026
14116 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14120 #: ../src/guestfs-actions.pod:6024 ../fish/guestfish-actions.pod:4029
14121 msgid "l (lower case letter L)"
14125 #: ../src/guestfs-actions.pod:6026 ../fish/guestfish-actions.pod:4031
14127 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14128 "examining binaries in Windows guests."
14132 #: ../src/guestfs-actions.pod:6029 ../fish/guestfish-actions.pod:4034
14137 #: ../src/guestfs-actions.pod:6031 ../fish/guestfish-actions.pod:4036
14138 msgid "32-bit big endian such as UCS-4BE."
14142 #: ../src/guestfs-actions.pod:6033 ../fish/guestfish-actions.pod:4038
14147 #: ../src/guestfs-actions.pod:6035 ../fish/guestfish-actions.pod:4040
14148 msgid "32-bit little endian such as UCS-4LE."
14152 #: ../src/guestfs-actions.pod:6039 ../fish/guestfish-actions.pod:4044
14153 msgid "The returned strings are transcoded to UTF-8."
14157 #: ../src/guestfs-actions.pod:6050
14158 msgid "guestfs_swapoff_device"
14162 #: ../src/guestfs-actions.pod:6052
14166 " guestfs_swapoff_device (guestfs_h *g,\n"
14167 " const char *device);\n"
14172 #: ../src/guestfs-actions.pod:6056
14174 "This command disables the libguestfs appliance swap device or partition "
14175 "named C<device>. See C<guestfs_swapon_device>."
14179 #: ../src/guestfs-actions.pod:6064
14180 msgid "guestfs_swapoff_file"
14184 #: ../src/guestfs-actions.pod:6066
14188 " guestfs_swapoff_file (guestfs_h *g,\n"
14189 " const char *file);\n"
14194 #: ../src/guestfs-actions.pod:6070 ../fish/guestfish-actions.pod:4061
14195 msgid "This command disables the libguestfs appliance swap on file."
14199 #: ../src/guestfs-actions.pod:6076
14200 msgid "guestfs_swapoff_label"
14204 #: ../src/guestfs-actions.pod:6078
14208 " guestfs_swapoff_label (guestfs_h *g,\n"
14209 " const char *label);\n"
14214 #: ../src/guestfs-actions.pod:6082 ../fish/guestfish-actions.pod:4067
14216 "This command disables the libguestfs appliance swap on labeled swap "
14221 #: ../src/guestfs-actions.pod:6089
14222 msgid "guestfs_swapoff_uuid"
14226 #: ../src/guestfs-actions.pod:6091
14230 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14231 " const char *uuid);\n"
14236 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4074
14238 "This command disables the libguestfs appliance swap partition with the given "
14243 #: ../src/guestfs-actions.pod:6102
14244 msgid "guestfs_swapon_device"
14248 #: ../src/guestfs-actions.pod:6104
14252 " guestfs_swapon_device (guestfs_h *g,\n"
14253 " const char *device);\n"
14258 #: ../src/guestfs-actions.pod:6108
14260 "This command enables the libguestfs appliance to use the swap device or "
14261 "partition named C<device>. The increased memory is made available for all "
14262 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14266 #: ../src/guestfs-actions.pod:6113 ../fish/guestfish-actions.pod:4086
14268 "Note that you should not swap to existing guest swap partitions unless you "
14269 "know what you are doing. They may contain hibernation information, or other "
14270 "information that the guest doesn't want you to trash. You also risk leaking "
14271 "information about the host to the guest this way. Instead, attach a new "
14272 "host device to the guest and swap on that."
14276 #: ../src/guestfs-actions.pod:6124
14277 msgid "guestfs_swapon_file"
14281 #: ../src/guestfs-actions.pod:6126
14285 " guestfs_swapon_file (guestfs_h *g,\n"
14286 " const char *file);\n"
14291 #: ../src/guestfs-actions.pod:6130
14293 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14298 #: ../src/guestfs-actions.pod:6137
14299 msgid "guestfs_swapon_label"
14303 #: ../src/guestfs-actions.pod:6139
14307 " guestfs_swapon_label (guestfs_h *g,\n"
14308 " const char *label);\n"
14313 #: ../src/guestfs-actions.pod:6143
14315 "This command enables swap to a labeled swap partition. See "
14316 "C<guestfs_swapon_device> for other notes."
14320 #: ../src/guestfs-actions.pod:6150
14321 msgid "guestfs_swapon_uuid"
14325 #: ../src/guestfs-actions.pod:6152
14329 " guestfs_swapon_uuid (guestfs_h *g,\n"
14330 " const char *uuid);\n"
14335 #: ../src/guestfs-actions.pod:6156
14337 "This command enables swap to a swap partition with the given UUID. See "
14338 "C<guestfs_swapon_device> for other notes."
14342 #: ../src/guestfs-actions.pod:6163
14343 msgid "guestfs_sync"
14347 #: ../src/guestfs-actions.pod:6165
14351 " guestfs_sync (guestfs_h *g);\n"
14356 #: ../src/guestfs-actions.pod:6168 ../fish/guestfish-actions.pod:4118
14358 "This syncs the disk, so that any writes are flushed through to the "
14359 "underlying disk image."
14363 #: ../src/guestfs-actions.pod:6171 ../fish/guestfish-actions.pod:4121
14365 "You should always call this if you have modified a disk image, before "
14366 "closing the handle."
14370 #: ../src/guestfs-actions.pod:6178
14371 msgid "guestfs_tail"
14375 #: ../src/guestfs-actions.pod:6180
14379 " guestfs_tail (guestfs_h *g,\n"
14380 " const char *path);\n"
14385 #: ../src/guestfs-actions.pod:6184 ../fish/guestfish-actions.pod:4128
14386 msgid "This command returns up to the last 10 lines of a file as a list of strings."
14390 #: ../src/guestfs-actions.pod:6196
14391 msgid "guestfs_tail_n"
14395 #: ../src/guestfs-actions.pod:6198
14399 " guestfs_tail_n (guestfs_h *g,\n"
14401 " const char *path);\n"
14406 #: ../src/guestfs-actions.pod:6203 ../fish/guestfish-actions.pod:4138
14408 "If the parameter C<nrlines> is a positive number, this returns the last "
14409 "C<nrlines> lines of the file C<path>."
14413 #: ../src/guestfs-actions.pod:6206 ../fish/guestfish-actions.pod:4141
14415 "If the parameter C<nrlines> is a negative number, this returns lines from "
14416 "the file C<path>, starting with the C<-nrlines>th line."
14420 #: ../src/guestfs-actions.pod:6220
14421 msgid "guestfs_tar_in"
14425 #: ../src/guestfs-actions.pod:6222
14429 " guestfs_tar_in (guestfs_h *g,\n"
14430 " const char *tarfile,\n"
14431 " const char *directory);\n"
14436 #: ../src/guestfs-actions.pod:6227 ../fish/guestfish-actions.pod:4153
14438 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14439 "tar file) into C<directory>."
14443 #: ../src/guestfs-actions.pod:6230
14444 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
14448 #: ../src/guestfs-actions.pod:6235 ../src/guestfs-actions.pod:6252 ../src/guestfs-actions.pod:6268 ../src/guestfs-actions.pod:6284
14449 msgid "(Added in 1.0.3)"
14453 #: ../src/guestfs-actions.pod:6237
14454 msgid "guestfs_tar_out"
14458 #: ../src/guestfs-actions.pod:6239
14462 " guestfs_tar_out (guestfs_h *g,\n"
14463 " const char *directory,\n"
14464 " const char *tarfile);\n"
14469 #: ../src/guestfs-actions.pod:6244 ../fish/guestfish-actions.pod:4165
14471 "This command packs the contents of C<directory> and downloads it to local "
14476 #: ../src/guestfs-actions.pod:6247
14478 "To download a compressed tarball, use C<guestfs_tgz_out> or "
14479 "C<guestfs_txz_out>."
14483 #: ../src/guestfs-actions.pod:6254
14484 msgid "guestfs_tgz_in"
14488 #: ../src/guestfs-actions.pod:6256
14492 " guestfs_tgz_in (guestfs_h *g,\n"
14493 " const char *tarball,\n"
14494 " const char *directory);\n"
14499 #: ../src/guestfs-actions.pod:6261 ../fish/guestfish-actions.pod:4177
14501 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14502 "tar file) into C<directory>."
14506 #: ../src/guestfs-actions.pod:6264
14507 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
14511 #: ../src/guestfs-actions.pod:6270
14512 msgid "guestfs_tgz_out"
14516 #: ../src/guestfs-actions.pod:6272
14520 " guestfs_tgz_out (guestfs_h *g,\n"
14521 " const char *directory,\n"
14522 " const char *tarball);\n"
14527 #: ../src/guestfs-actions.pod:6277 ../fish/guestfish-actions.pod:4188
14529 "This command packs the contents of C<directory> and downloads it to local "
14534 #: ../src/guestfs-actions.pod:6280
14535 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
14539 #: ../src/guestfs-actions.pod:6286
14540 msgid "guestfs_touch"
14544 #: ../src/guestfs-actions.pod:6288
14548 " guestfs_touch (guestfs_h *g,\n"
14549 " const char *path);\n"
14554 #: ../src/guestfs-actions.pod:6292 ../fish/guestfish-actions.pod:4199
14556 "Touch acts like the L<touch(1)> command. It can be used to update the "
14557 "timestamps on a file, or, if the file does not exist, to create a new "
14558 "zero-length file."
14562 #: ../src/guestfs-actions.pod:6296 ../fish/guestfish-actions.pod:4203
14564 "This command only works on regular files, and will fail on other file types "
14565 "such as directories, symbolic links, block special etc."
14569 #: ../src/guestfs-actions.pod:6303
14570 msgid "guestfs_truncate"
14574 #: ../src/guestfs-actions.pod:6305
14578 " guestfs_truncate (guestfs_h *g,\n"
14579 " const char *path);\n"
14584 #: ../src/guestfs-actions.pod:6309 ../fish/guestfish-actions.pod:4210
14586 "This command truncates C<path> to a zero-length file. The file must exist "
14591 #: ../src/guestfs-actions.pod:6316
14592 msgid "guestfs_truncate_size"
14596 #: ../src/guestfs-actions.pod:6318
14600 " guestfs_truncate_size (guestfs_h *g,\n"
14601 " const char *path,\n"
14602 " int64_t size);\n"
14607 #: ../src/guestfs-actions.pod:6323 ../fish/guestfish-actions.pod:4217
14609 "This command truncates C<path> to size C<size> bytes. The file must exist "
14614 #: ../src/guestfs-actions.pod:6326
14616 "If the current file size is less than C<size> then the file is extended to "
14617 "the required size with zero bytes. This creates a sparse file (ie. disk "
14618 "blocks are not allocated for the file until you write to it). To create a "
14619 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
14623 #: ../src/guestfs-actions.pod:6336
14624 msgid "guestfs_tune2fs_l"
14628 #: ../src/guestfs-actions.pod:6338
14632 " guestfs_tune2fs_l (guestfs_h *g,\n"
14633 " const char *device);\n"
14638 #: ../src/guestfs-actions.pod:6342 ../fish/guestfish-actions.pod:4230
14640 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14645 #: ../src/guestfs-actions.pod:6345 ../fish/guestfish-actions.pod:4233
14647 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14648 "for more details. The list of fields returned isn't clearly defined, and "
14649 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14650 "and the filesystem itself."
14654 #: ../src/guestfs-actions.pod:6358
14655 msgid "guestfs_txz_in"
14659 #: ../src/guestfs-actions.pod:6360
14663 " guestfs_txz_in (guestfs_h *g,\n"
14664 " const char *tarball,\n"
14665 " const char *directory);\n"
14670 #: ../src/guestfs-actions.pod:6365 ../fish/guestfish-actions.pod:4242
14672 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14673 "tar file) into C<directory>."
14677 #: ../src/guestfs-actions.pod:6372
14678 msgid "guestfs_txz_out"
14682 #: ../src/guestfs-actions.pod:6374
14686 " guestfs_txz_out (guestfs_h *g,\n"
14687 " const char *directory,\n"
14688 " const char *tarball);\n"
14693 #: ../src/guestfs-actions.pod:6379 ../fish/guestfish-actions.pod:4251
14695 "This command packs the contents of C<directory> and downloads it to local "
14696 "file C<tarball> (as an xz compressed tar archive)."
14700 #: ../src/guestfs-actions.pod:6386
14701 msgid "guestfs_umask"
14705 #: ../src/guestfs-actions.pod:6388
14709 " guestfs_umask (guestfs_h *g,\n"
14715 #: ../src/guestfs-actions.pod:6392 ../fish/guestfish-actions.pod:4260
14717 "This function sets the mask used for creating new files and device nodes to "
14722 #: ../src/guestfs-actions.pod:6395 ../fish/guestfish-actions.pod:4263
14724 "Typical umask values would be C<022> which creates new files with "
14725 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14726 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14730 #: ../src/guestfs-actions.pod:6400 ../fish/guestfish-actions.pod:4268
14732 "The default umask is C<022>. This is important because it means that "
14733 "directories and device nodes will be created with C<0644> or C<0755> mode "
14734 "even if you specify C<0777>."
14738 #: ../src/guestfs-actions.pod:6404
14740 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
14741 "C<guestfs_mkdir>."
14745 #: ../src/guestfs-actions.pod:6407 ../fish/guestfish-actions.pod:4275
14746 msgid "This call returns the previous umask."
14750 #: ../src/guestfs-actions.pod:6413
14751 msgid "guestfs_umount"
14755 #: ../src/guestfs-actions.pod:6415
14759 " guestfs_umount (guestfs_h *g,\n"
14760 " const char *pathordevice);\n"
14765 #: ../src/guestfs-actions.pod:6419 ../fish/guestfish-actions.pod:4283
14767 "This unmounts the given filesystem. The filesystem may be specified either "
14768 "by its mountpoint (path) or the device which contains the filesystem."
14772 #: ../src/guestfs-actions.pod:6427
14773 msgid "guestfs_umount_all"
14777 #: ../src/guestfs-actions.pod:6429
14781 " guestfs_umount_all (guestfs_h *g);\n"
14786 #: ../src/guestfs-actions.pod:6432 ../fish/guestfish-actions.pod:4293
14787 msgid "This unmounts all mounted filesystems."
14791 #: ../src/guestfs-actions.pod:6434 ../fish/guestfish-actions.pod:4295
14792 msgid "Some internal mounts are not unmounted by this call."
14796 #: ../src/guestfs-actions.pod:6440
14797 msgid "guestfs_upload"
14801 #: ../src/guestfs-actions.pod:6442
14805 " guestfs_upload (guestfs_h *g,\n"
14806 " const char *filename,\n"
14807 " const char *remotefilename);\n"
14812 #: ../src/guestfs-actions.pod:6447 ../src/guestfs-actions.pod:6471 ../fish/guestfish-actions.pod:4301 ../fish/guestfish-actions.pod:4314
14813 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14817 #: ../src/guestfs-actions.pod:6452
14818 msgid "See also C<guestfs_download>."
14822 #: ../src/guestfs-actions.pod:6463
14823 msgid "guestfs_upload_offset"
14827 #: ../src/guestfs-actions.pod:6465
14831 " guestfs_upload_offset (guestfs_h *g,\n"
14832 " const char *filename,\n"
14833 " const char *remotefilename,\n"
14834 " int64_t offset);\n"
14839 #: ../src/guestfs-actions.pod:6474 ../fish/guestfish-actions.pod:4317
14841 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14842 "The intention is to overwrite parts of existing files or devices, although "
14843 "if a non-existant file is specified then it is created with a \"hole\" "
14844 "before C<offset>. The size of the data written is implicit in the size of "
14845 "the source C<filename>."
14849 #: ../src/guestfs-actions.pod:6481
14851 "Note that there is no limit on the amount of data that can be uploaded with "
14852 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
14853 "full amount unless an error occurs."
14857 #: ../src/guestfs-actions.pod:6486
14858 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
14862 #: ../src/guestfs-actions.pod:6497
14863 msgid "guestfs_utimens"
14867 #: ../src/guestfs-actions.pod:6499
14871 " guestfs_utimens (guestfs_h *g,\n"
14872 " const char *path,\n"
14873 " int64_t atsecs,\n"
14874 " int64_t atnsecs,\n"
14875 " int64_t mtsecs,\n"
14876 " int64_t mtnsecs);\n"
14881 #: ../src/guestfs-actions.pod:6507 ../fish/guestfish-actions.pod:4337
14882 msgid "This command sets the timestamps of a file with nanosecond precision."
14886 #: ../src/guestfs-actions.pod:6510 ../fish/guestfish-actions.pod:4340
14888 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14893 #: ../src/guestfs-actions.pod:6513 ../fish/guestfish-actions.pod:4343
14895 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14896 "nanoseconds from the epoch."
14900 #: ../src/guestfs-actions.pod:6516 ../fish/guestfish-actions.pod:4346
14902 "If the C<*nsecs> field contains the special value C<-1> then the "
14903 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14904 "ignored in this case)."
14908 #: ../src/guestfs-actions.pod:6520 ../fish/guestfish-actions.pod:4350
14910 "If the C<*nsecs> field contains the special value C<-2> then the "
14911 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14916 #: ../src/guestfs-actions.pod:6528 ../src/guestfs-structs.pod:175
14917 msgid "guestfs_version"
14921 #: ../src/guestfs-actions.pod:6530
14924 " struct guestfs_version *\n"
14925 " guestfs_version (guestfs_h *g);\n"
14930 #: ../src/guestfs-actions.pod:6533 ../fish/guestfish-actions.pod:4358
14931 msgid "Return the libguestfs version number that the program is linked against."
14935 #: ../src/guestfs-actions.pod:6536 ../fish/guestfish-actions.pod:4361
14937 "Note that because of dynamic linking this is not necessarily the version of "
14938 "libguestfs that you compiled against. You can compile the program, and then "
14939 "at runtime dynamically link against a completely different C<libguestfs.so> "
14944 #: ../src/guestfs-actions.pod:6541 ../fish/guestfish-actions.pod:4366
14946 "This call was added in version C<1.0.58>. In previous versions of "
14947 "libguestfs there was no way to get the version number. From C code you can "
14948 "use dynamic linker functions to find out if this symbol exists (if it "
14949 "doesn't, then it's an earlier version)."
14953 #: ../src/guestfs-actions.pod:6547 ../fish/guestfish-actions.pod:4372
14955 "The call returns a structure with four elements. The first three (C<major>, "
14956 "C<minor> and C<release>) are numbers and correspond to the usual version "
14957 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14958 "but may be used for distro-specific information."
14962 #: ../src/guestfs-actions.pod:6553 ../fish/guestfish-actions.pod:4378
14963 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
14967 #: ../src/guestfs-actions.pod:6556 ../fish/guestfish-actions.pod:4381
14968 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14972 #: ../src/guestfs-actions.pod:6558
14974 "I<Note:> Don't use this call to test for availability of features. In "
14975 "enterprise distributions we backport features from later versions into "
14976 "earlier versions, making this an unreliable way to test for features. Use "
14977 "C<guestfs_available> instead."
14981 #: ../src/guestfs-actions.pod:6564
14983 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
14984 "error. I<The caller must call C<guestfs_free_version> after use>."
14988 #: ../src/guestfs-actions.pod:6568
14989 msgid "(Added in 1.0.58)"
14993 #: ../src/guestfs-actions.pod:6570
14994 msgid "guestfs_vfs_label"
14998 #: ../src/guestfs-actions.pod:6572
15002 " guestfs_vfs_label (guestfs_h *g,\n"
15003 " const char *device);\n"
15008 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4393
15009 msgid "This returns the filesystem label of the filesystem on C<device>."
15013 #: ../src/guestfs-actions.pod:6579 ../fish/guestfish-actions.pod:4396
15014 msgid "If the filesystem is unlabeled, this returns the empty string."
15018 #: ../src/guestfs-actions.pod:6581
15019 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15023 #: ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6623
15024 msgid "(Added in 1.3.18)"
15028 #: ../src/guestfs-actions.pod:6588
15029 msgid "guestfs_vfs_type"
15033 #: ../src/guestfs-actions.pod:6590
15037 " guestfs_vfs_type (guestfs_h *g,\n"
15038 " const char *device);\n"
15043 #: ../src/guestfs-actions.pod:6594 ../fish/guestfish-actions.pod:4404
15045 "This command gets the filesystem type corresponding to the filesystem on "
15050 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4407
15052 "For most filesystems, the result is the name of the Linux VFS module which "
15053 "would be used to mount this filesystem if you mounted it without specifying "
15054 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15058 #: ../src/guestfs-actions.pod:6607
15059 msgid "guestfs_vfs_uuid"
15063 #: ../src/guestfs-actions.pod:6609
15067 " guestfs_vfs_uuid (guestfs_h *g,\n"
15068 " const char *device);\n"
15073 #: ../src/guestfs-actions.pod:6613 ../fish/guestfish-actions.pod:4416
15074 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15078 #: ../src/guestfs-actions.pod:6616 ../fish/guestfish-actions.pod:4419
15079 msgid "If the filesystem does not have a UUID, this returns the empty string."
15083 #: ../src/guestfs-actions.pod:6618
15084 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15088 #: ../src/guestfs-actions.pod:6625
15089 msgid "guestfs_vg_activate"
15093 #: ../src/guestfs-actions.pod:6627
15097 " guestfs_vg_activate (guestfs_h *g,\n"
15099 " char *const *volgroups);\n"
15104 #: ../src/guestfs-actions.pod:6632 ../fish/guestfish-actions.pod:4427
15106 "This command activates or (if C<activate> is false) deactivates all logical "
15107 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15108 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15109 "deactivated, then those devices disappear."
15113 #: ../src/guestfs-actions.pod:6638 ../fish/guestfish-actions.pod:4433
15114 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15118 #: ../src/guestfs-actions.pod:6640 ../fish/guestfish-actions.pod:4435
15120 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15121 "activated or deactivated."
15125 #: ../src/guestfs-actions.pod:6647
15126 msgid "guestfs_vg_activate_all"
15130 #: ../src/guestfs-actions.pod:6649
15134 " guestfs_vg_activate_all (guestfs_h *g,\n"
15135 " int activate);\n"
15140 #: ../src/guestfs-actions.pod:6653 ../fish/guestfish-actions.pod:4442
15142 "This command activates or (if C<activate> is false) deactivates all logical "
15143 "volumes in all volume groups. If activated, then they are made known to the "
15144 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15145 "those devices disappear."
15149 #: ../src/guestfs-actions.pod:6659 ../fish/guestfish-actions.pod:4448
15150 msgid "This command is the same as running C<vgchange -a y|n>"
15154 #: ../src/guestfs-actions.pod:6665
15155 msgid "guestfs_vgcreate"
15159 #: ../src/guestfs-actions.pod:6667
15163 " guestfs_vgcreate (guestfs_h *g,\n"
15164 " const char *volgroup,\n"
15165 " char *const *physvols);\n"
15170 #: ../src/guestfs-actions.pod:6672 ../fish/guestfish-actions.pod:4454
15172 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15173 "of physical volumes C<physvols>."
15177 #: ../src/guestfs-actions.pod:6679
15178 msgid "guestfs_vglvuuids"
15182 #: ../src/guestfs-actions.pod:6681
15186 " guestfs_vglvuuids (guestfs_h *g,\n"
15187 " const char *vgname);\n"
15192 #: ../src/guestfs-actions.pod:6685 ../fish/guestfish-actions.pod:4461
15194 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15195 "volumes created in this volume group."
15199 #: ../src/guestfs-actions.pod:6688
15201 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15202 "associate logical volumes and volume groups."
15206 #: ../src/guestfs-actions.pod:6691
15207 msgid "See also C<guestfs_vgpvuuids>."
15211 #: ../src/guestfs-actions.pod:6699
15212 msgid "guestfs_vgpvuuids"
15216 #: ../src/guestfs-actions.pod:6701
15220 " guestfs_vgpvuuids (guestfs_h *g,\n"
15221 " const char *vgname);\n"
15226 #: ../src/guestfs-actions.pod:6705 ../fish/guestfish-actions.pod:4473
15228 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15229 "volumes that this volume group resides on."
15233 #: ../src/guestfs-actions.pod:6708
15235 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15236 "associate physical volumes and volume groups."
15240 #: ../src/guestfs-actions.pod:6711
15241 msgid "See also C<guestfs_vglvuuids>."
15245 #: ../src/guestfs-actions.pod:6719
15246 msgid "guestfs_vgremove"
15250 #: ../src/guestfs-actions.pod:6721
15254 " guestfs_vgremove (guestfs_h *g,\n"
15255 " const char *vgname);\n"
15260 #: ../src/guestfs-actions.pod:6725 ../fish/guestfish-actions.pod:4485
15261 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15265 #: ../src/guestfs-actions.pod:6727 ../fish/guestfish-actions.pod:4487
15266 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
15270 #: ../src/guestfs-actions.pod:6734
15271 msgid "guestfs_vgrename"
15275 #: ../src/guestfs-actions.pod:6736
15279 " guestfs_vgrename (guestfs_h *g,\n"
15280 " const char *volgroup,\n"
15281 " const char *newvolgroup);\n"
15286 #: ../src/guestfs-actions.pod:6741 ../fish/guestfish-actions.pod:4494
15287 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15291 #: ../src/guestfs-actions.pod:6747
15292 msgid "guestfs_vgs"
15296 #: ../src/guestfs-actions.pod:6749
15300 " guestfs_vgs (guestfs_h *g);\n"
15305 #: ../src/guestfs-actions.pod:6752 ../fish/guestfish-actions.pod:4500
15307 "List all the volumes groups detected. This is the equivalent of the "
15308 "L<vgs(8)> command."
15312 #: ../src/guestfs-actions.pod:6755 ../fish/guestfish-actions.pod:4503
15314 "This returns a list of just the volume group names that were detected "
15315 "(eg. C<VolGroup00>)."
15319 #: ../src/guestfs-actions.pod:6758
15320 msgid "See also C<guestfs_vgs_full>."
15324 #: ../src/guestfs-actions.pod:6766
15325 msgid "guestfs_vgs_full"
15329 #: ../src/guestfs-actions.pod:6768
15332 " struct guestfs_lvm_vg_list *\n"
15333 " guestfs_vgs_full (guestfs_h *g);\n"
15338 #: ../src/guestfs-actions.pod:6771 ../fish/guestfish-actions.pod:4512
15340 "List all the volumes groups detected. This is the equivalent of the "
15341 "L<vgs(8)> command. The \"full\" version includes all fields."
15345 #: ../src/guestfs-actions.pod:6774
15347 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15348 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
15353 #: ../src/guestfs-actions.pod:6780
15354 msgid "guestfs_vgscan"
15358 #: ../src/guestfs-actions.pod:6782
15362 " guestfs_vgscan (guestfs_h *g);\n"
15367 #: ../src/guestfs-actions.pod:6785 ../fish/guestfish-actions.pod:4519
15369 "This rescans all block devices and rebuilds the list of LVM physical "
15370 "volumes, volume groups and logical volumes."
15374 #: ../src/guestfs-actions.pod:6792
15375 msgid "guestfs_vguuid"
15379 #: ../src/guestfs-actions.pod:6794
15383 " guestfs_vguuid (guestfs_h *g,\n"
15384 " const char *vgname);\n"
15389 #: ../src/guestfs-actions.pod:6798 ../fish/guestfish-actions.pod:4526
15390 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15394 #: ../src/guestfs-actions.pod:6805
15395 msgid "guestfs_wait_ready"
15399 #: ../src/guestfs-actions.pod:6807
15403 " guestfs_wait_ready (guestfs_h *g);\n"
15408 #: ../src/guestfs-actions.pod:6810
15409 msgid "This function is a no op."
15413 #: ../src/guestfs-actions.pod:6812
15415 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
15416 "calling C<guestfs_launch> to wait for the launch to complete. However this "
15417 "is no longer necessary because C<guestfs_launch> now does the waiting."
15421 #: ../src/guestfs-actions.pod:6817
15423 "If you see any calls to this function in code then you can just remove them, "
15424 "unless you want to retain compatibility with older versions of the API."
15428 #: ../src/guestfs-actions.pod:6825
15429 msgid "guestfs_wc_c"
15433 #: ../src/guestfs-actions.pod:6827
15437 " guestfs_wc_c (guestfs_h *g,\n"
15438 " const char *path);\n"
15443 #: ../src/guestfs-actions.pod:6831 ../fish/guestfish-actions.pod:4532
15445 "This command counts the characters in a file, using the C<wc -c> external "
15450 #: ../src/guestfs-actions.pod:6838
15451 msgid "guestfs_wc_l"
15455 #: ../src/guestfs-actions.pod:6840
15459 " guestfs_wc_l (guestfs_h *g,\n"
15460 " const char *path);\n"
15465 #: ../src/guestfs-actions.pod:6844 ../fish/guestfish-actions.pod:4539
15467 "This command counts the lines in a file, using the C<wc -l> external "
15472 #: ../src/guestfs-actions.pod:6851
15473 msgid "guestfs_wc_w"
15477 #: ../src/guestfs-actions.pod:6853
15481 " guestfs_wc_w (guestfs_h *g,\n"
15482 " const char *path);\n"
15487 #: ../src/guestfs-actions.pod:6857 ../fish/guestfish-actions.pod:4546
15489 "This command counts the words in a file, using the C<wc -w> external "
15494 #: ../src/guestfs-actions.pod:6864
15495 msgid "guestfs_write"
15499 #: ../src/guestfs-actions.pod:6866
15503 " guestfs_write (guestfs_h *g,\n"
15504 " const char *path,\n"
15505 " const char *content,\n"
15506 " size_t content_size);\n"
15511 #: ../src/guestfs-actions.pod:6872 ../fish/guestfish-actions.pod:4553
15513 "This call creates a file called C<path>. The content of the file is the "
15514 "string C<content> (which can contain any 8 bit data)."
15518 #: ../src/guestfs-actions.pod:6882
15519 msgid "guestfs_write_file"
15523 #: ../src/guestfs-actions.pod:6884
15527 " guestfs_write_file (guestfs_h *g,\n"
15528 " const char *path,\n"
15529 " const char *content,\n"
15535 #: ../src/guestfs-actions.pod:6890 ../fish/guestfish-actions.pod:4563
15537 "This call creates a file called C<path>. The contents of the file is the "
15538 "string C<content> (which can contain any 8 bit data), with length C<size>."
15542 #: ../src/guestfs-actions.pod:6894 ../fish/guestfish-actions.pod:4567
15544 "As a special case, if C<size> is C<0> then the length is calculated using "
15545 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15549 #: ../src/guestfs-actions.pod:6898 ../fish/guestfish-actions.pod:4571
15551 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15552 "I<not> work, even if the length is specified."
15556 #: ../src/guestfs-actions.pod:6906 ../fish/guestfish-actions.pod:4577
15557 msgid "This function is deprecated. In new code, use the C<write> call instead."
15561 #: ../src/guestfs-actions.pod:6915
15562 msgid "guestfs_zegrep"
15566 #: ../src/guestfs-actions.pod:6917
15570 " guestfs_zegrep (guestfs_h *g,\n"
15571 " const char *regex,\n"
15572 " const char *path);\n"
15577 #: ../src/guestfs-actions.pod:6922 ../fish/guestfish-actions.pod:4588
15578 msgid "This calls the external C<zegrep> program and returns the matching lines."
15582 #: ../src/guestfs-actions.pod:6934
15583 msgid "guestfs_zegrepi"
15587 #: ../src/guestfs-actions.pod:6936
15591 " guestfs_zegrepi (guestfs_h *g,\n"
15592 " const char *regex,\n"
15593 " const char *path);\n"
15598 #: ../src/guestfs-actions.pod:6941 ../fish/guestfish-actions.pod:4598
15599 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
15603 #: ../src/guestfs-actions.pod:6953
15604 msgid "guestfs_zero"
15608 #: ../src/guestfs-actions.pod:6955
15612 " guestfs_zero (guestfs_h *g,\n"
15613 " const char *device);\n"
15618 #: ../src/guestfs-actions.pod:6959 ../fish/guestfish-actions.pod:4608
15619 msgid "This command writes zeroes over the first few blocks of C<device>."
15623 #: ../src/guestfs-actions.pod:6961 ../fish/guestfish-actions.pod:4610
15625 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15626 "securely wipe the device). It should be sufficient to remove any partition "
15627 "tables, filesystem superblocks and so on."
15631 #: ../src/guestfs-actions.pod:6965
15632 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
15636 #: ../src/guestfs-actions.pod:6976
15637 msgid "guestfs_zero_device"
15641 #: ../src/guestfs-actions.pod:6978
15645 " guestfs_zero_device (guestfs_h *g,\n"
15646 " const char *device);\n"
15651 #: ../src/guestfs-actions.pod:6982
15653 "This command writes zeroes over the entire C<device>. Compare with "
15654 "C<guestfs_zero> which just zeroes the first few blocks of a device."
15658 #: ../src/guestfs-actions.pod:6996
15659 msgid "(Added in 1.3.1)"
15663 #: ../src/guestfs-actions.pod:6998
15664 msgid "guestfs_zerofree"
15668 #: ../src/guestfs-actions.pod:7000
15672 " guestfs_zerofree (guestfs_h *g,\n"
15673 " const char *device);\n"
15678 #: ../src/guestfs-actions.pod:7004 ../fish/guestfish-actions.pod:4631
15680 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15681 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15682 "possible to compress the filesystem more effectively."
15686 #: ../src/guestfs-actions.pod:7009 ../fish/guestfish-actions.pod:4636
15687 msgid "You should B<not> run this program if the filesystem is mounted."
15691 #: ../src/guestfs-actions.pod:7012 ../fish/guestfish-actions.pod:4639
15693 "It is possible that using this program can damage the filesystem or data on "
15698 #: ../src/guestfs-actions.pod:7019
15699 msgid "guestfs_zfgrep"
15703 #: ../src/guestfs-actions.pod:7021
15707 " guestfs_zfgrep (guestfs_h *g,\n"
15708 " const char *pattern,\n"
15709 " const char *path);\n"
15714 #: ../src/guestfs-actions.pod:7026 ../fish/guestfish-actions.pod:4646
15715 msgid "This calls the external C<zfgrep> program and returns the matching lines."
15719 #: ../src/guestfs-actions.pod:7038
15720 msgid "guestfs_zfgrepi"
15724 #: ../src/guestfs-actions.pod:7040
15728 " guestfs_zfgrepi (guestfs_h *g,\n"
15729 " const char *pattern,\n"
15730 " const char *path);\n"
15735 #: ../src/guestfs-actions.pod:7045 ../fish/guestfish-actions.pod:4656
15736 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
15740 #: ../src/guestfs-actions.pod:7057
15741 msgid "guestfs_zfile"
15745 #: ../src/guestfs-actions.pod:7059
15749 " guestfs_zfile (guestfs_h *g,\n"
15750 " const char *meth,\n"
15751 " const char *path);\n"
15756 #: ../src/guestfs-actions.pod:7064 ../fish/guestfish-actions.pod:4666
15757 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
15761 #: ../src/guestfs-actions.pod:7067 ../fish/guestfish-actions.pod:4669
15762 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15766 #: ../src/guestfs-actions.pod:7069
15768 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
15773 #: ../src/guestfs-actions.pod:7075 ../fish/guestfish-actions.pod:4674
15774 msgid "This function is deprecated. In new code, use the C<file> call instead."
15778 #: ../src/guestfs-actions.pod:7084
15779 msgid "guestfs_zgrep"
15783 #: ../src/guestfs-actions.pod:7086
15787 " guestfs_zgrep (guestfs_h *g,\n"
15788 " const char *regex,\n"
15789 " const char *path);\n"
15794 #: ../src/guestfs-actions.pod:7091 ../fish/guestfish-actions.pod:4685
15795 msgid "This calls the external C<zgrep> program and returns the matching lines."
15799 #: ../src/guestfs-actions.pod:7103
15800 msgid "guestfs_zgrepi"
15804 #: ../src/guestfs-actions.pod:7105
15808 " guestfs_zgrepi (guestfs_h *g,\n"
15809 " const char *regex,\n"
15810 " const char *path);\n"
15815 #: ../src/guestfs-actions.pod:7110 ../fish/guestfish-actions.pod:4695
15816 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
15820 #: ../src/guestfs-availability.pod:3
15825 #: ../src/guestfs-availability.pod:5
15827 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
15828 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
15829 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
15830 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
15831 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
15835 #: ../src/guestfs-availability.pod:21
15840 #: ../src/guestfs-availability.pod:23
15842 "The following functions: L</guestfs_inotify_add_watch> "
15843 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
15844 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
15848 #: ../src/guestfs-availability.pod:31
15849 msgid "B<linuxfsuuid>"
15853 #: ../src/guestfs-availability.pod:33
15855 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
15856 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
15860 #: ../src/guestfs-availability.pod:40
15861 msgid "B<linuxmodules>"
15865 #: ../src/guestfs-availability.pod:42
15866 msgid "The following functions: L</guestfs_modprobe>"
15870 #: ../src/guestfs-availability.pod:45
15871 msgid "B<linuxxattrs>"
15875 #: ../src/guestfs-availability.pod:47
15877 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> "
15878 "L</guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> "
15879 "L</guestfs_removexattr> L</guestfs_setxattr>"
15883 #: ../src/guestfs-availability.pod:56
15888 #: ../src/guestfs-availability.pod:58
15890 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
15891 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
15892 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
15896 #: ../src/guestfs-availability.pod:67
15901 #: ../src/guestfs-availability.pod:69
15903 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
15904 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
15905 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
15906 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
15907 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
15908 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
15909 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
15910 "L</guestfs_vgs_full>"
15914 #: ../src/guestfs-availability.pod:92
15919 #: ../src/guestfs-availability.pod:94
15921 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
15922 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
15926 #: ../src/guestfs-availability.pod:100
15931 #: ../src/guestfs-availability.pod:102
15932 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
15936 #: ../src/guestfs-availability.pod:105
15937 msgid "B<ntfsprogs>"
15941 #: ../src/guestfs-availability.pod:107
15942 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
15946 #: ../src/guestfs-availability.pod:111
15947 msgid "B<realpath>"
15951 #: ../src/guestfs-availability.pod:113
15952 msgid "The following functions: L</guestfs_realpath>"
15956 #: ../src/guestfs-availability.pod:116
15961 #: ../src/guestfs-availability.pod:118
15963 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
15964 "L</guestfs_scrub_freespace>"
15968 #: ../src/guestfs-availability.pod:123
15973 #: ../src/guestfs-availability.pod:125
15974 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
15978 #: ../src/guestfs-availability.pod:129
15983 #: ../src/guestfs-availability.pod:131
15984 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
15988 #: ../src/guestfs-availability.pod:135
15989 msgid "B<zerofree>"
15993 #: ../src/guestfs-availability.pod:137
15994 msgid "The following functions: L</guestfs_zerofree>"
15998 #: ../src/guestfs-structs.pod:1
15999 msgid "guestfs_int_bool"
16003 #: ../src/guestfs-structs.pod:3
16006 " struct guestfs_int_bool {\n"
16014 #: ../src/guestfs-structs.pod:8
16017 " struct guestfs_int_bool_list {\n"
16018 " uint32_t len; /* Number of elements in list. */\n"
16019 " struct guestfs_int_bool *val; /* Elements. */\n"
16025 #: ../src/guestfs-structs.pod:13
16028 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16029 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16034 #: ../src/guestfs-structs.pod:16
16035 msgid "guestfs_lvm_pv"
16039 #: ../src/guestfs-structs.pod:18
16042 " struct guestfs_lvm_pv {\n"
16043 " char *pv_name;\n"
16044 " /* The next field is NOT nul-terminated, be careful when printing it: "
16046 " char pv_uuid[32];\n"
16048 " uint64_t pv_size;\n"
16049 " uint64_t dev_size;\n"
16050 " uint64_t pv_free;\n"
16051 " uint64_t pv_used;\n"
16052 " char *pv_attr;\n"
16053 " int64_t pv_pe_count;\n"
16054 " int64_t pv_pe_alloc_count;\n"
16055 " char *pv_tags;\n"
16056 " uint64_t pe_start;\n"
16057 " int64_t pv_mda_count;\n"
16058 " uint64_t pv_mda_free;\n"
16064 #: ../src/guestfs-structs.pod:36
16067 " struct guestfs_lvm_pv_list {\n"
16068 " uint32_t len; /* Number of elements in list. */\n"
16069 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16075 #: ../src/guestfs-structs.pod:41
16078 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16079 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16084 #: ../src/guestfs-structs.pod:44
16085 msgid "guestfs_lvm_vg"
16089 #: ../src/guestfs-structs.pod:46
16092 " struct guestfs_lvm_vg {\n"
16093 " char *vg_name;\n"
16094 " /* The next field is NOT nul-terminated, be careful when printing it: "
16096 " char vg_uuid[32];\n"
16098 " char *vg_attr;\n"
16099 " uint64_t vg_size;\n"
16100 " uint64_t vg_free;\n"
16101 " char *vg_sysid;\n"
16102 " uint64_t vg_extent_size;\n"
16103 " int64_t vg_extent_count;\n"
16104 " int64_t vg_free_count;\n"
16105 " int64_t max_lv;\n"
16106 " int64_t max_pv;\n"
16107 " int64_t pv_count;\n"
16108 " int64_t lv_count;\n"
16109 " int64_t snap_count;\n"
16110 " int64_t vg_seqno;\n"
16111 " char *vg_tags;\n"
16112 " int64_t vg_mda_count;\n"
16113 " uint64_t vg_mda_free;\n"
16119 #: ../src/guestfs-structs.pod:69
16122 " struct guestfs_lvm_vg_list {\n"
16123 " uint32_t len; /* Number of elements in list. */\n"
16124 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16130 #: ../src/guestfs-structs.pod:74
16133 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16134 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16139 #: ../src/guestfs-structs.pod:77
16140 msgid "guestfs_lvm_lv"
16144 #: ../src/guestfs-structs.pod:79
16147 " struct guestfs_lvm_lv {\n"
16148 " char *lv_name;\n"
16149 " /* The next field is NOT nul-terminated, be careful when printing it: "
16151 " char lv_uuid[32];\n"
16152 " char *lv_attr;\n"
16153 " int64_t lv_major;\n"
16154 " int64_t lv_minor;\n"
16155 " int64_t lv_kernel_major;\n"
16156 " int64_t lv_kernel_minor;\n"
16157 " uint64_t lv_size;\n"
16158 " int64_t seg_count;\n"
16160 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16161 " float snap_percent;\n"
16162 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16163 " float copy_percent;\n"
16164 " char *move_pv;\n"
16165 " char *lv_tags;\n"
16166 " char *mirror_log;\n"
16167 " char *modules;\n"
16173 #: ../src/guestfs-structs.pod:101
16176 " struct guestfs_lvm_lv_list {\n"
16177 " uint32_t len; /* Number of elements in list. */\n"
16178 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16184 #: ../src/guestfs-structs.pod:106
16187 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16188 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16193 #: ../src/guestfs-structs.pod:111
16196 " struct guestfs_stat {\n"
16200 " int64_t nlink;\n"
16205 " int64_t blksize;\n"
16206 " int64_t blocks;\n"
16207 " int64_t atime;\n"
16208 " int64_t mtime;\n"
16209 " int64_t ctime;\n"
16215 #: ../src/guestfs-structs.pod:127
16218 " struct guestfs_stat_list {\n"
16219 " uint32_t len; /* Number of elements in list. */\n"
16220 " struct guestfs_stat *val; /* Elements. */\n"
16226 #: ../src/guestfs-structs.pod:132
16229 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16230 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16235 #: ../src/guestfs-structs.pod:137
16238 " struct guestfs_statvfs {\n"
16239 " int64_t bsize;\n"
16240 " int64_t frsize;\n"
16241 " int64_t blocks;\n"
16242 " int64_t bfree;\n"
16243 " int64_t bavail;\n"
16244 " int64_t files;\n"
16245 " int64_t ffree;\n"
16246 " int64_t favail;\n"
16249 " int64_t namemax;\n"
16255 #: ../src/guestfs-structs.pod:151
16258 " struct guestfs_statvfs_list {\n"
16259 " uint32_t len; /* Number of elements in list. */\n"
16260 " struct guestfs_statvfs *val; /* Elements. */\n"
16266 #: ../src/guestfs-structs.pod:156
16269 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16270 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16275 #: ../src/guestfs-structs.pod:159
16276 msgid "guestfs_dirent"
16280 #: ../src/guestfs-structs.pod:161
16283 " struct guestfs_dirent {\n"
16292 #: ../src/guestfs-structs.pod:167
16295 " struct guestfs_dirent_list {\n"
16296 " uint32_t len; /* Number of elements in list. */\n"
16297 " struct guestfs_dirent *val; /* Elements. */\n"
16303 #: ../src/guestfs-structs.pod:172
16306 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16307 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16312 #: ../src/guestfs-structs.pod:177
16315 " struct guestfs_version {\n"
16316 " int64_t major;\n"
16317 " int64_t minor;\n"
16318 " int64_t release;\n"
16325 #: ../src/guestfs-structs.pod:184
16328 " struct guestfs_version_list {\n"
16329 " uint32_t len; /* Number of elements in list. */\n"
16330 " struct guestfs_version *val; /* Elements. */\n"
16336 #: ../src/guestfs-structs.pod:189
16339 " void guestfs_free_version (struct guestfs_free_version *);\n"
16340 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16345 #: ../src/guestfs-structs.pod:192
16346 msgid "guestfs_xattr"
16350 #: ../src/guestfs-structs.pod:194
16353 " struct guestfs_xattr {\n"
16354 " char *attrname;\n"
16355 " /* The next two fields describe a byte array. */\n"
16356 " uint32_t attrval_len;\n"
16357 " char *attrval;\n"
16363 #: ../src/guestfs-structs.pod:201
16366 " struct guestfs_xattr_list {\n"
16367 " uint32_t len; /* Number of elements in list. */\n"
16368 " struct guestfs_xattr *val; /* Elements. */\n"
16374 #: ../src/guestfs-structs.pod:206
16377 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
16378 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
16383 #: ../src/guestfs-structs.pod:209
16384 msgid "guestfs_inotify_event"
16388 #: ../src/guestfs-structs.pod:211
16391 " struct guestfs_inotify_event {\n"
16392 " int64_t in_wd;\n"
16393 " uint32_t in_mask;\n"
16394 " uint32_t in_cookie;\n"
16395 " char *in_name;\n"
16401 #: ../src/guestfs-structs.pod:218
16404 " struct guestfs_inotify_event_list {\n"
16405 " uint32_t len; /* Number of elements in list. */\n"
16406 " struct guestfs_inotify_event *val; /* Elements. */\n"
16412 #: ../src/guestfs-structs.pod:223
16415 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
16416 " void guestfs_free_inotify_event_list (struct "
16417 "guestfs_free_inotify_event_list *);\n"
16422 #: ../src/guestfs-structs.pod:226
16423 msgid "guestfs_partition"
16427 #: ../src/guestfs-structs.pod:228
16430 " struct guestfs_partition {\n"
16431 " int32_t part_num;\n"
16432 " uint64_t part_start;\n"
16433 " uint64_t part_end;\n"
16434 " uint64_t part_size;\n"
16440 #: ../src/guestfs-structs.pod:235
16443 " struct guestfs_partition_list {\n"
16444 " uint32_t len; /* Number of elements in list. */\n"
16445 " struct guestfs_partition *val; /* Elements. */\n"
16451 #: ../src/guestfs-structs.pod:240
16454 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
16455 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
16460 #: ../src/guestfs-structs.pod:243
16461 msgid "guestfs_application"
16465 #: ../src/guestfs-structs.pod:245
16468 " struct guestfs_application {\n"
16469 " char *app_name;\n"
16470 " char *app_display_name;\n"
16471 " int32_t app_epoch;\n"
16472 " char *app_version;\n"
16473 " char *app_release;\n"
16474 " char *app_install_path;\n"
16475 " char *app_trans_path;\n"
16476 " char *app_publisher;\n"
16477 " char *app_url;\n"
16478 " char *app_source_package;\n"
16479 " char *app_summary;\n"
16480 " char *app_description;\n"
16486 #: ../src/guestfs-structs.pod:260
16489 " struct guestfs_application_list {\n"
16490 " uint32_t len; /* Number of elements in list. */\n"
16491 " struct guestfs_application *val; /* Elements. */\n"
16497 #: ../src/guestfs-structs.pod:265
16500 " void guestfs_free_application (struct guestfs_free_application *);\n"
16501 " void guestfs_free_application_list (struct guestfs_free_application_list "
16507 #: ../fish/guestfish.pod:5
16508 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16512 #: ../fish/guestfish.pod:9
16515 " guestfish [--options] [commands]\n"
16520 #: ../fish/guestfish.pod:11
16528 #: ../fish/guestfish.pod:13
16531 " guestfish [--ro|--rw] -a disk.img\n"
16536 #: ../fish/guestfish.pod:15
16539 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16544 #: ../fish/guestfish.pod:17
16547 " guestfish -d libvirt-domain\n"
16552 #: ../fish/guestfish.pod:19
16555 " guestfish [--ro|--rw] -a disk.img -i\n"
16560 #: ../fish/guestfish.pod:21
16563 " guestfish -d libvirt-domain -i\n"
16568 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44 ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
16573 #: ../fish/guestfish.pod:25
16575 "Using guestfish in read/write mode on live virtual machines can be "
16576 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16577 "option to use guestfish safely if the disk image or virtual machine might be "
16582 #: ../fish/guestfish.pod:32
16584 "Guestfish is a shell and command-line tool for examining and modifying "
16585 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16586 "functionality of the guestfs API, see L<guestfs(3)>."
16590 #: ../fish/guestfish.pod:36
16592 "Guestfish gives you structured access to the libguestfs API, from shell "
16593 "scripts or the command line or interactively. If you want to rescue a "
16594 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16599 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:847 ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58 ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:45
16604 #: ../fish/guestfish.pod:43
16605 msgid "As an interactive shell"
16609 #: ../fish/guestfish.pod:45
16617 #: ../fish/guestfish.pod:47
16620 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16621 " editing virtual machine filesystems.\n"
16626 #: ../fish/guestfish.pod:50
16629 " Type: 'help' for a list of commands\n"
16630 " 'man' to read the manual\n"
16631 " 'quit' to quit the shell\n"
16636 #: ../fish/guestfish.pod:54
16639 " ><fs> add-ro disk.img\n"
16641 " ><fs> list-filesystems\n"
16642 " /dev/sda1: ext4\n"
16643 " /dev/vg_guest/lv_root: ext4\n"
16644 " /dev/vg_guest/lv_swap: swap\n"
16645 " ><fs> mount /dev/vg_guest/lv_root /\n"
16646 " ><fs> cat /etc/fstab\n"
16648 " # Created by anaconda\n"
16655 #: ../fish/guestfish.pod:67
16656 msgid "From shell scripts"
16660 #: ../fish/guestfish.pod:69
16661 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16665 #: ../fish/guestfish.pod:71
16668 " guestfish <<_EOF_\n"
16671 " mount /dev/vg_guest/lv_root /\n"
16672 " write /etc/motd \"Welcome, new users\"\n"
16678 #: ../fish/guestfish.pod:78
16679 msgid "List the LVM logical volumes in a disk image:"
16683 #: ../fish/guestfish.pod:80
16686 " guestfish -a disk.img --ro <<_EOF_\n"
16694 #: ../fish/guestfish.pod:85
16695 msgid "List all the filesystems in a disk image:"
16699 #: ../fish/guestfish.pod:87
16702 " guestfish -a disk.img --ro <<_EOF_\n"
16704 " list-filesystems\n"
16710 #: ../fish/guestfish.pod:92
16711 msgid "On one command line"
16715 #: ../fish/guestfish.pod:94
16716 msgid "Update C</etc/resolv.conf> in a guest:"
16720 #: ../fish/guestfish.pod:96
16724 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16725 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16730 #: ../fish/guestfish.pod:100
16731 msgid "Edit C</boot/grub/grub.conf> interactively:"
16735 #: ../fish/guestfish.pod:102
16738 " guestfish --rw --add disk.img \\\n"
16739 " --mount /dev/vg_guest/lv_root \\\n"
16740 " --mount /dev/sda1:/boot \\\n"
16741 " edit /boot/grub/grub.conf\n"
16746 #: ../fish/guestfish.pod:107
16747 msgid "Mount disks automatically"
16751 #: ../fish/guestfish.pod:109
16753 "Use the I<-i> option to automatically mount the disks from a virtual "
16758 #: ../fish/guestfish.pod:112
16761 " guestfish --ro -a disk.img -i cat /etc/group\n"
16766 #: ../fish/guestfish.pod:114
16769 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16774 #: ../fish/guestfish.pod:116
16775 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16779 #: ../fish/guestfish.pod:118
16782 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16787 #: ../fish/guestfish.pod:120
16788 msgid "As a script interpreter"
16792 #: ../fish/guestfish.pod:122
16793 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16797 #: ../fish/guestfish.pod:124
16800 " #!/usr/bin/guestfish -f\n"
16801 " sparse test1.img 100M\n"
16803 " part-disk /dev/sda mbr\n"
16804 " mkfs ext2 /dev/sda1\n"
16809 #: ../fish/guestfish.pod:130
16810 msgid "Start with a prepared disk"
16814 #: ../fish/guestfish.pod:132
16816 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16817 "single ext2-formatted partition:"
16821 #: ../fish/guestfish.pod:135
16824 " guestfish -N fs\n"
16829 #: ../fish/guestfish.pod:137
16830 msgid "To list what is available do:"
16834 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:838
16837 " guestfish -N help | less\n"
16842 #: ../fish/guestfish.pod:141
16843 msgid "Remote control"
16847 #: ../fish/guestfish.pod:143
16850 " eval \"`guestfish --listen`\"\n"
16851 " guestfish --remote add-ro disk.img\n"
16852 " guestfish --remote run\n"
16853 " guestfish --remote lvs\n"
16858 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171 ../tools/virt-resize.pl:254 ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:98 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
16863 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131 ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:179 ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61 ../tools/virt-tar.pl:106 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:62
16868 #: ../fish/guestfish.pod:154
16869 msgid "Displays general help on options."
16873 #: ../fish/guestfish.pod:156
16874 msgid "B<-h> | B<--cmd-help>"
16878 #: ../fish/guestfish.pod:158
16879 msgid "Lists all available guestfish commands."
16883 #: ../fish/guestfish.pod:160
16884 msgid "B<-h cmd> | B<--cmd-help cmd>"
16888 #: ../fish/guestfish.pod:162
16889 msgid "Displays detailed help on a single command C<cmd>."
16893 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
16894 msgid "B<-a image> | B<--add image>"
16898 #: ../fish/guestfish.pod:166
16899 msgid "Add a block device or virtual machine image to the shell."
16903 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
16905 "The format of the disk image is auto-detected. To override this and force a "
16906 "particular format use the I<--format=..> option."
16910 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
16911 msgid "B<-c URI> | B<--connect URI>"
16915 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
16917 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16918 "URI to use. The default is to use the default libvirt connection."
16922 #: ../fish/guestfish.pod:177
16927 #: ../fish/guestfish.pod:179
16929 "If using the I<--listen> option and a csh-like shell, use this option. See "
16930 "section L</REMOTE CONTROL AND CSH> below."
16934 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
16935 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
16939 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
16941 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16942 "used, then any libvirt domain can be used. However in write mode, only "
16943 "libvirt domains which are shut down can be named here."
16947 #: ../fish/guestfish.pod:188
16948 msgid "B<-D> | B<--no-dest-paths>"
16952 #: ../fish/guestfish.pod:190
16954 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16955 "to hit the tab key to complete paths on the guest filesystem, but this "
16956 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16957 "allow this feature to be disabled."
16961 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
16962 msgid "B<--echo-keys>"
16966 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
16968 "When prompting for keys and passphrases, guestfish normally turns echoing "
16969 "off so you cannot see what you are typing. If you are not worried about "
16970 "Tempest attacks and there is no one else in the room you can specify this "
16971 "flag to see what you are typing."
16975 #: ../fish/guestfish.pod:202
16976 msgid "B<-f file> | B<--file file>"
16980 #: ../fish/guestfish.pod:204
16981 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16985 #: ../fish/guestfish.pod:207
16988 " #!/usr/bin/guestfish -f\n"
16993 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
16994 msgid "B<--format=raw|qcow2|..> | B<--format>"
16998 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
17000 "The default for the I<-a> option is to auto-detect the format of the disk "
17001 "image. Using this forces the disk format for I<-a> options which follow on "
17002 "the command line. Using I<--format> with no argument switches back to "
17003 "auto-detection for subsequent I<-a> options."
17007 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:544
17008 msgid "For example:"
17012 #: ../fish/guestfish.pod:218
17015 " guestfish --format=raw -a disk.img\n"
17020 #: ../fish/guestfish.pod:220
17021 msgid "forces raw format (no auto-detection) for C<disk.img>."
17025 #: ../fish/guestfish.pod:222
17028 " guestfish --format=raw -a disk.img --format -a another.img\n"
17033 #: ../fish/guestfish.pod:224
17035 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
17036 "auto-detection for C<another.img>."
17040 #: ../fish/guestfish.pod:227
17042 "If you have untrusted raw-format guest disk images, you should use this "
17043 "option to specify the disk format. This avoids a possible security problem "
17044 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17048 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
17049 msgid "B<-i> | B<--inspector>"
17053 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
17055 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17056 "system and mount filesystems as they would be mounted on the real virtual "
17061 #: ../fish/guestfish.pod:238
17062 msgid "Typical usage is either:"
17066 #: ../fish/guestfish.pod:240
17069 " guestfish -d myguest -i\n"
17074 #: ../fish/guestfish.pod:242
17075 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17079 #: ../fish/guestfish.pod:244
17082 " guestfish --ro -d myguest -i\n"
17087 #: ../fish/guestfish.pod:246
17088 msgid "(for active domains, readonly), or specify the block device directly:"
17092 #: ../fish/guestfish.pod:248
17095 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17100 #: ../fish/guestfish.pod:250
17102 "Note that the command line syntax changed slightly over older versions of "
17103 "guestfish. You can still use the old syntax:"
17107 #: ../fish/guestfish.pod:253
17110 " guestfish [--ro] -i disk.img\n"
17115 #: ../fish/guestfish.pod:255
17118 " guestfish [--ro] -i libvirt-domain\n"
17123 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
17124 msgid "B<--keys-from-stdin>"
17128 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
17130 "Read key or passphrase parameters from stdin. The default is to try to read "
17131 "passphrases from the user by opening C</dev/tty>."
17135 #: ../fish/guestfish.pod:262
17136 msgid "B<--listen>"
17140 #: ../fish/guestfish.pod:264
17142 "Fork into the background and listen for remote commands. See section "
17143 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17147 #: ../fish/guestfish.pod:267
17148 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
17152 #: ../fish/guestfish.pod:269
17153 msgid "Mount the named partition or logical volume on the given mountpoint."
17157 #: ../fish/guestfish.pod:271
17158 msgid "If the mountpoint is omitted, it defaults to C</>."
17162 #: ../fish/guestfish.pod:273
17163 msgid "You have to mount something on C</> before most commands will work."
17167 #: ../fish/guestfish.pod:275
17169 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17174 #: ../fish/guestfish.pod:278
17176 "If you don't know what filesystems a disk image contains, you can either run "
17177 "guestfish without this option, then list the partitions, filesystems and LVs "
17178 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17179 "commands), or you can use the L<virt-filesystems(1)> program."
17183 #: ../fish/guestfish.pod:284 ../fuse/guestmount.pod:154
17184 msgid "B<-n> | B<--no-sync>"
17188 #: ../fish/guestfish.pod:286
17190 "Disable autosync. This is enabled by default. See the discussion of "
17191 "autosync in the L<guestfs(3)> manpage."
17195 #: ../fish/guestfish.pod:289
17196 msgid "B<-N type> | B<--new type> | B<-N help>"
17200 #: ../fish/guestfish.pod:291
17202 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17203 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17204 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17209 #: ../fish/guestfish.pod:296
17210 msgid "B<--progress-bars>"
17214 #: ../fish/guestfish.pod:298
17215 msgid "Enable progress bars, even when guestfish is used non-interactively."
17219 #: ../fish/guestfish.pod:300
17221 "Progress bars are enabled by default when guestfish is used as an "
17222 "interactive shell."
17226 #: ../fish/guestfish.pod:303
17227 msgid "B<--no-progress-bars>"
17231 #: ../fish/guestfish.pod:305
17232 msgid "Disable progress bars."
17236 #: ../fish/guestfish.pod:307
17237 msgid "B<--remote[=pid]>"
17241 #: ../fish/guestfish.pod:309
17243 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17244 "CONTROL GUESTFISH OVER A SOCKET> below."
17248 #: ../fish/guestfish.pod:312 ../fuse/guestmount.pod:196
17249 msgid "B<-r> | B<--ro>"
17253 #: ../fish/guestfish.pod:314
17255 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
17256 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
17260 #: ../fish/guestfish.pod:317
17262 "The option must always be used if the disk image or virtual machine might be "
17263 "running, and is generally recommended in cases where you don't need write "
17264 "access to the disk."
17268 #: ../fish/guestfish.pod:321
17270 "Note that prepared disk images created with I<-N> are not affected by the "
17275 #: ../fish/guestfish.pod:324
17276 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17280 #: ../fish/guestfish.pod:326 ../fuse/guestmount.pod:208
17281 msgid "B<--selinux>"
17285 #: ../fish/guestfish.pod:328
17286 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17290 #: ../fish/guestfish.pod:330 ../fuse/guestmount.pod:212
17291 msgid "B<-v> | B<--verbose>"
17295 #: ../fish/guestfish.pod:332
17297 "Enable very verbose messages. This is particularly useful if you find a "
17302 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:216
17303 msgid "B<-V> | B<--version>"
17307 #: ../fish/guestfish.pod:337
17308 msgid "Display the guestfish / libguestfs version number and exit."
17312 #: ../fish/guestfish.pod:339 ../fuse/guestmount.pod:220
17313 msgid "B<-w> | B<--rw>"
17317 #: ../fish/guestfish.pod:341
17319 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
17324 #: ../fish/guestfish.pod:344
17329 #: ../fish/guestfish.pod:346
17330 msgid "Echo each command before executing it."
17334 #: ../fish/guestfish.pod:350
17335 msgid "COMMANDS ON COMMAND LINE"
17339 #: ../fish/guestfish.pod:352
17340 msgid "Any additional (non-option) arguments are treated as commands to execute."
17344 #: ../fish/guestfish.pod:355
17346 "Commands to execute should be separated by a colon (C<:>), where the colon "
17347 "is a separate parameter. Thus:"
17351 #: ../fish/guestfish.pod:358
17354 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17359 #: ../fish/guestfish.pod:360
17361 "If there are no additional arguments, then we enter a shell, either an "
17362 "interactive shell with a prompt (if the input is a terminal) or a "
17363 "non-interactive shell."
17367 #: ../fish/guestfish.pod:364
17369 "In either command line mode or non-interactive shell, the first command that "
17370 "gives an error causes the whole shell to exit. In interactive mode (with a "
17371 "prompt) if a command fails, you can continue to enter commands."
17375 #: ../fish/guestfish.pod:369
17376 msgid "USING launch (OR run)"
17380 #: ../fish/guestfish.pod:371
17382 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17383 "then launch it, then mount any disks you need, and finally issue "
17384 "actions/commands. So the general order of the day is:"
17388 #: ../fish/guestfish.pod:379
17389 msgid "add or -a/--add"
17393 #: ../fish/guestfish.pod:383
17394 msgid "launch (aka run)"
17398 #: ../fish/guestfish.pod:387
17399 msgid "mount or -m/--mount"
17403 #: ../fish/guestfish.pod:391
17404 msgid "any other commands"
17408 #: ../fish/guestfish.pod:395
17410 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17411 "guest before mounting or performing any other commands."
17415 #: ../fish/guestfish.pod:398
17417 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17418 "I<--new> options were given then C<run> is done automatically, simply "
17419 "because guestfish can't perform the action you asked for without doing this."
17423 #: ../fish/guestfish.pod:403
17424 msgid "OPENING DISKS FOR READ AND WRITE"
17428 #: ../fish/guestfish.pod:405
17430 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
17431 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
17432 "open disk images read-only or for writing."
17436 #: ../fish/guestfish.pod:409
17438 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
17439 "disk images supplied on the command line for write. To open a disk image "
17440 "read-only you have to do I<-a image --ro>."
17444 #: ../fish/guestfish.pod:413
17446 "This matters: If you accidentally open a live VM disk image writable then "
17447 "you will cause irreversible disk corruption."
17451 #: ../fish/guestfish.pod:416
17453 "By libguestfs 1.8 we intend to change the default the other way. Disk "
17454 "images will be opened read-only. You will have to either specify "
17455 "I<guestfish --rw> or change a configuration file in order to get write "
17456 "access for disk images specified by those other command line options."
17460 #: ../fish/guestfish.pod:421
17462 "This version of guestfish has a I<--rw> option which does nothing (it is "
17463 "already the default). However it is highly recommended that you use this "
17464 "option to indicate that guestfish needs write access, and to prepare your "
17465 "scripts for the day when this option will be required for write access."
17469 #: ../fish/guestfish.pod:427
17471 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17472 "other libguestfs program apart from guestfish and guestmount."
17476 #: ../fish/guestfish.pod:430
17481 #: ../fish/guestfish.pod:432
17483 "You can quote ordinary parameters using either single or double quotes. For "
17488 #: ../fish/guestfish.pod:435
17491 " add \"file with a space.img\"\n"
17496 #: ../fish/guestfish.pod:437
17499 " rm '/file name'\n"
17504 #: ../fish/guestfish.pod:439
17512 #: ../fish/guestfish.pod:441
17514 "A few commands require a list of strings to be passed. For these, use a "
17515 "whitespace-separated list, enclosed in quotes. Strings containing "
17516 "whitespace to be passed through must be enclosed in single quotes. A "
17517 "literal single quote must be escaped with a backslash."
17521 #: ../fish/guestfish.pod:446
17524 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17525 " command \"/bin/echo 'foo bar'\"\n"
17526 " command \"/bin/echo \\'foo\\'\"\n"
17531 #: ../fish/guestfish.pod:450
17532 msgid "OPTIONAL ARGUMENTS"
17536 #: ../fish/guestfish.pod:452
17538 "Some commands take optional arguments. These arguments appear in this "
17539 "documentation as C<[argname:..]>. You can use them as in these examples:"
17543 #: ../fish/guestfish.pod:456
17546 " add-drive-opts filename\n"
17551 #: ../fish/guestfish.pod:458
17554 " add-drive-opts filename readonly:true\n"
17559 #: ../fish/guestfish.pod:460
17562 " add-drive-opts filename format:qcow2 readonly:false\n"
17567 #: ../fish/guestfish.pod:462
17569 "Each optional argument can appear at most once. All optional arguments must "
17570 "appear after the required ones."
17574 #: ../fish/guestfish.pod:465
17579 #: ../fish/guestfish.pod:467
17580 msgid "This section applies to all commands which can take integers as parameters."
17584 #: ../fish/guestfish.pod:470
17585 msgid "SIZE SUFFIX"
17589 #: ../fish/guestfish.pod:472
17591 "When the command takes a parameter measured in bytes, you can use one of the "
17592 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17596 #: ../fish/guestfish.pod:478
17597 msgid "B<k> or B<K> or B<KiB>"
17601 #: ../fish/guestfish.pod:480
17602 msgid "The size in kilobytes (multiplied by 1024)."
17606 #: ../fish/guestfish.pod:482
17611 #: ../fish/guestfish.pod:484
17612 msgid "The size in SI 1000 byte units."
17616 #: ../fish/guestfish.pod:486
17617 msgid "B<M> or B<MiB>"
17621 #: ../fish/guestfish.pod:488
17622 msgid "The size in megabytes (multiplied by 1048576)."
17626 #: ../fish/guestfish.pod:490
17631 #: ../fish/guestfish.pod:492
17632 msgid "The size in SI 1000000 byte units."
17636 #: ../fish/guestfish.pod:494
17637 msgid "B<G> or B<GiB>"
17641 #: ../fish/guestfish.pod:496
17642 msgid "The size in gigabytes (multiplied by 2**30)."
17646 #: ../fish/guestfish.pod:498
17651 #: ../fish/guestfish.pod:500
17652 msgid "The size in SI 10**9 byte units."
17656 #: ../fish/guestfish.pod:502
17657 msgid "B<T> or B<TiB>"
17661 #: ../fish/guestfish.pod:504
17662 msgid "The size in terabytes (multiplied by 2**40)."
17666 #: ../fish/guestfish.pod:506
17671 #: ../fish/guestfish.pod:508
17672 msgid "The size in SI 10**12 byte units."
17676 #: ../fish/guestfish.pod:510
17677 msgid "B<P> or B<PiB>"
17681 #: ../fish/guestfish.pod:512
17682 msgid "The size in petabytes (multiplied by 2**50)."
17686 #: ../fish/guestfish.pod:514
17691 #: ../fish/guestfish.pod:516
17692 msgid "The size in SI 10**15 byte units."
17696 #: ../fish/guestfish.pod:518
17697 msgid "B<E> or B<EiB>"
17701 #: ../fish/guestfish.pod:520
17702 msgid "The size in exabytes (multiplied by 2**60)."
17706 #: ../fish/guestfish.pod:522
17711 #: ../fish/guestfish.pod:524
17712 msgid "The size in SI 10**18 byte units."
17716 #: ../fish/guestfish.pod:526
17717 msgid "B<Z> or B<ZiB>"
17721 #: ../fish/guestfish.pod:528
17722 msgid "The size in zettabytes (multiplied by 2**70)."
17726 #: ../fish/guestfish.pod:530
17731 #: ../fish/guestfish.pod:532
17732 msgid "The size in SI 10**21 byte units."
17736 #: ../fish/guestfish.pod:534
17737 msgid "B<Y> or B<YiB>"
17741 #: ../fish/guestfish.pod:536
17742 msgid "The size in yottabytes (multiplied by 2**80)."
17746 #: ../fish/guestfish.pod:538
17751 #: ../fish/guestfish.pod:540
17752 msgid "The size in SI 10**24 byte units."
17756 #: ../fish/guestfish.pod:546
17759 " truncate-size /file 1G\n"
17764 #: ../fish/guestfish.pod:548
17765 msgid "would truncate the file to 1 gigabyte."
17769 #: ../fish/guestfish.pod:550
17771 "Be careful because a few commands take sizes in kilobytes or megabytes "
17772 "(eg. the parameter to L</memsize> is specified in megabytes already). "
17773 "Adding a suffix will probably not do what you expect."
17777 #: ../fish/guestfish.pod:554
17778 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17782 #: ../fish/guestfish.pod:556
17784 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17785 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17789 #: ../fish/guestfish.pod:559
17792 " 1234 decimal number 1234\n"
17793 " 02322 octal number, equivalent to decimal 1234\n"
17794 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17799 #: ../fish/guestfish.pod:563
17801 "When using the C<chmod> command, you almost always want to specify an octal "
17802 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17803 "L<chmod(1)> program):"
17807 #: ../fish/guestfish.pod:567
17810 " chmod 0777 /public # OK\n"
17811 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17816 #: ../fish/guestfish.pod:570
17818 "Commands that return numbers usually print them in decimal, but some "
17819 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17820 "octal, preceeded by C<0>)."
17824 #: ../fish/guestfish.pod:574
17825 msgid "WILDCARDS AND GLOBBING"
17829 #: ../fish/guestfish.pod:576
17831 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17832 "(globbing) by default. So for example the following will not do what you "
17837 #: ../fish/guestfish.pod:580
17845 #: ../fish/guestfish.pod:582
17847 "Assuming you don't have a directory called literally C</home/*> then the "
17848 "above command will return an error."
17852 #: ../fish/guestfish.pod:585
17853 msgid "To perform wildcard expansion, use the C<glob> command."
17857 #: ../fish/guestfish.pod:587
17860 " glob rm-rf /home/*\n"
17865 #: ../fish/guestfish.pod:589
17867 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17868 "many times), equivalent to:"
17872 #: ../fish/guestfish.pod:592
17875 " rm-rf /home/jim\n"
17876 " rm-rf /home/joe\n"
17877 " rm-rf /home/mary\n"
17882 #: ../fish/guestfish.pod:596
17883 msgid "C<glob> only works on simple guest paths and not on device names."
17887 #: ../fish/guestfish.pod:598
17889 "If you have several parameters, each containing a wildcard, then glob will "
17890 "perform a Cartesian product."
17894 #: ../fish/guestfish.pod:601
17899 #: ../fish/guestfish.pod:603
17901 "Any line which starts with a I<#> character is treated as a comment and "
17902 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17903 "a command. For example:"
17907 #: ../fish/guestfish.pod:607
17910 " # this is a comment\n"
17911 " # this is a comment\n"
17912 " foo # NOT a comment\n"
17917 #: ../fish/guestfish.pod:611
17918 msgid "Blank lines are also ignored."
17922 #: ../fish/guestfish.pod:613
17923 msgid "RUNNING COMMANDS LOCALLY"
17927 #: ../fish/guestfish.pod:615
17929 "Any line which starts with a I<!> character is treated as a command sent to "
17930 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17934 #: ../fish/guestfish.pod:619
17938 " tgz-out /remote local/remote-data.tar.gz\n"
17943 #: ../fish/guestfish.pod:622
17945 "will create a directory C<local> on the host, and then export the contents "
17946 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17947 "(See C<tgz-out>)."
17951 #: ../fish/guestfish.pod:626
17953 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17954 "effect, due to the way that subprocesses work in Unix."
17958 #: ../fish/guestfish.pod:629
17963 #: ../fish/guestfish.pod:631
17965 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17966 "command (a guestfish command) to the second command (any host command). For "
17971 #: ../fish/guestfish.pod:635
17974 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17979 #: ../fish/guestfish.pod:637
17981 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17982 "program). The above command would list all accounts in the guest filesystem "
17983 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17987 #: ../fish/guestfish.pod:642
17990 " hexdump /bin/ls | head\n"
17991 " list-devices | tail -1\n"
17992 " tgz-out / - | tar ztf -\n"
17997 #: ../fish/guestfish.pod:646
17999 "The space before the pipe symbol is required, any space after the pipe "
18000 "symbol is optional. Everything after the pipe symbol is just passed "
18001 "straight to the host shell, so it can contain redirections, globs and "
18002 "anything else that makes sense on the host side."
18006 #: ../fish/guestfish.pod:651
18008 "To use a literal argument which begins with a pipe symbol, you have to quote "
18013 #: ../fish/guestfish.pod:654
18021 #: ../fish/guestfish.pod:656
18022 msgid "HOME DIRECTORIES"
18026 #: ../fish/guestfish.pod:658
18028 "If a parameter starts with the character C<~> then the tilde may be expanded "
18029 "as a home directory path (either C<~> for the current user's home directory, "
18030 "or C<~user> for another user)."
18034 #: ../fish/guestfish.pod:662
18036 "Note that home directory expansion happens for users known I<on the host>, "
18037 "not in the guest filesystem."
18041 #: ../fish/guestfish.pod:665
18043 "To use a literal argument which begins with a tilde, you have to quote it, "
18048 #: ../fish/guestfish.pod:668
18056 #: ../fish/guestfish.pod:672
18058 "Libguestfs has some support for Linux guests encrypted according to the "
18059 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18060 "disk encryption systems used by modern Linux guests. Currently only "
18061 "LVM-on-LUKS is supported."
18065 #: ../fish/guestfish.pod:677
18066 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18070 #: ../fish/guestfish.pod:679
18073 " ><fs> vfs-type /dev/sda2\n"
18079 #: ../fish/guestfish.pod:682
18081 "Then open those devices using L</luks-open>. This creates a device-mapper "
18082 "device called C</dev/mapper/luksdev>."
18086 #: ../fish/guestfish.pod:685
18089 " ><fs> luks-open /dev/sda2 luksdev\n"
18090 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18095 #: ../fish/guestfish.pod:688
18097 "Finally you have to tell LVM to scan for volume groups on the newly created "
18102 #: ../fish/guestfish.pod:691
18106 " vg-activate-all true\n"
18111 #: ../fish/guestfish.pod:694
18112 msgid "The logical volume(s) can now be mounted in the usual way."
18116 #: ../fish/guestfish.pod:696
18118 "Before closing a LUKS device you must unmount any logical volumes on it and "
18119 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18120 "one. Then you can close the mapper device:"
18124 #: ../fish/guestfish.pod:700
18127 " vg-activate false /dev/VG\n"
18128 " luks-close /dev/mapper/luksdev\n"
18133 #: ../fish/guestfish.pod:703
18134 msgid "WINDOWS PATHS"
18138 #: ../fish/guestfish.pod:705
18140 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18141 "(with some limitations). The following commands are equivalent:"
18145 #: ../fish/guestfish.pod:708
18148 " file /WINDOWS/system32/config/system.LOG\n"
18153 #: ../fish/guestfish.pod:710
18156 " file win:/windows/system32/config/system.log\n"
18161 #: ../fish/guestfish.pod:712
18164 " file win:\\windows\\system32\\config\\system.log\n"
18169 #: ../fish/guestfish.pod:714
18172 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18177 #: ../fish/guestfish.pod:716
18179 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18180 "handles case insensitivity like Windows would. This only works in argument "
18181 "positions that expect a path."
18185 #: ../fish/guestfish.pod:720
18186 msgid "UPLOADING AND DOWNLOADING FILES"
18190 #: ../fish/guestfish.pod:722
18192 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18193 "others which upload from or download to a local file, you can use the "
18194 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18198 #: ../fish/guestfish.pod:726
18206 #: ../fish/guestfish.pod:728
18207 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
18211 #: ../fish/guestfish.pod:731
18214 " tar-out /etc - | tar tf -\n"
18219 #: ../fish/guestfish.pod:733
18221 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18222 "command (see L</PIPES>)."
18226 #: ../fish/guestfish.pod:736
18228 "When using C<-> to read from stdin, the input is read up to the end of "
18229 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18230 "some arbitrary end marker:"
18234 #: ../fish/guestfish.pod:740
18237 " upload -<<END /foo\n"
18246 #: ../fish/guestfish.pod:746
18248 "Any string of characters can be used instead of C<END>. The end marker must "
18249 "appear on a line of its own, without any preceeding or following characters "
18250 "(not even spaces)."
18254 #: ../fish/guestfish.pod:750
18256 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18257 "upload local files (so-called \"FileIn\" parameters in the generator)."
18261 #: ../fish/guestfish.pod:753
18262 msgid "EXIT ON ERROR BEHAVIOUR"
18266 #: ../fish/guestfish.pod:755
18268 "By default, guestfish will ignore any errors when in interactive mode "
18269 "(ie. taking commands from a human over a tty), and will exit on the first "
18270 "error in non-interactive mode (scripts, commands given on the command line)."
18274 #: ../fish/guestfish.pod:760
18276 "If you prefix a command with a I<-> character, then that command will not "
18277 "cause guestfish to exit, even if that (one) command returns an error."
18281 #: ../fish/guestfish.pod:764
18282 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18286 #: ../fish/guestfish.pod:766
18288 "Guestfish can be remote-controlled over a socket. This is useful "
18289 "particularly in shell scripts where you want to make several different "
18290 "changes to a filesystem, but you don't want the overhead of starting up a "
18291 "guestfish process each time."
18295 #: ../fish/guestfish.pod:771
18296 msgid "Start a guestfish server process using:"
18300 #: ../fish/guestfish.pod:773
18303 " eval \"`guestfish --listen`\"\n"
18308 #: ../fish/guestfish.pod:775
18309 msgid "and then send it commands by doing:"
18313 #: ../fish/guestfish.pod:777
18316 " guestfish --remote cmd [...]\n"
18321 #: ../fish/guestfish.pod:779
18322 msgid "To cause the server to exit, send it the exit command:"
18326 #: ../fish/guestfish.pod:781
18329 " guestfish --remote exit\n"
18334 #: ../fish/guestfish.pod:783
18336 "Note that the server will normally exit if there is an error in a command. "
18337 "You can change this in the usual way. See section L</EXIT ON ERROR "
18342 #: ../fish/guestfish.pod:787
18343 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18347 #: ../fish/guestfish.pod:789
18349 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18350 "is how the I<--remote> option knows where to send the commands. You can "
18351 "have several guestfish listener processes running using:"
18355 #: ../fish/guestfish.pod:793
18358 " eval \"`guestfish --listen`\"\n"
18359 " pid1=$GUESTFISH_PID\n"
18360 " eval \"`guestfish --listen`\"\n"
18361 " pid2=$GUESTFISH_PID\n"
18363 " guestfish --remote=$pid1 cmd\n"
18364 " guestfish --remote=$pid2 cmd\n"
18369 #: ../fish/guestfish.pod:801
18370 msgid "REMOTE CONTROL AND CSH"
18374 #: ../fish/guestfish.pod:803
18376 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18381 #: ../fish/guestfish.pod:806
18384 " eval \"`guestfish --listen --csh`\"\n"
18389 #: ../fish/guestfish.pod:808
18390 msgid "REMOTE CONTROL DETAILS"
18394 #: ../fish/guestfish.pod:810
18396 "Remote control happens over a Unix domain socket called "
18397 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
18398 "of the process, and C<$PID> is the process ID of the server."
18402 #: ../fish/guestfish.pod:814
18403 msgid "Guestfish client and server versions must match exactly."
18407 #: ../fish/guestfish.pod:816
18408 msgid "PREPARED DISK IMAGES"
18412 #: ../fish/guestfish.pod:818
18414 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18415 "preformatted disk images that guestfish can make for you to save typing. "
18416 "This is particularly useful for testing purposes. This option is used "
18417 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18418 "can be mixed with I<-a>)."
18422 #: ../fish/guestfish.pod:824
18424 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18425 "the second and so on. Existing files in the current directory are "
18430 #: ../fish/guestfish.pod:828
18432 "The type briefly describes how the disk should be sized, partitioned, how "
18433 "filesystem(s) should be created, and how content should be added. "
18434 "Optionally the type can be followed by extra parameters, separated by C<:> "
18435 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
18436 "sparsely-allocated disk, containing a single partition, with the partition "
18437 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
18438 "on a 1GB disk instead."
18442 #: ../fish/guestfish.pod:836
18443 msgid "To list the available types and any extra parameters they take, run:"
18447 #: ../fish/guestfish.pod:840
18449 "Note that the prepared filesystem is not mounted. You would usually have to "
18450 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18454 #: ../fish/guestfish.pod:844
18456 "If any I<-N> or I<--new> options are given, the guest is automatically "
18461 #: ../fish/guestfish.pod:849
18462 msgid "Create a 100MB disk with an ext4-formatted partition:"
18466 #: ../fish/guestfish.pod:851
18469 " guestfish -N fs:ext4\n"
18474 #: ../fish/guestfish.pod:853
18475 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18479 #: ../fish/guestfish.pod:855
18482 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18487 #: ../fish/guestfish.pod:857
18488 msgid "Create a blank 200MB disk:"
18492 #: ../fish/guestfish.pod:859
18495 " guestfish -N disk:200M\n"
18500 #: ../fish/guestfish.pod:861
18501 msgid "PROGRESS BARS"
18505 #: ../fish/guestfish.pod:863
18507 "Some (not all) long-running commands send progress notification messages as "
18508 "they are running. Guestfish turns these messages into progress bars."
18512 #: ../fish/guestfish.pod:867
18514 "When a command that supports progress bars takes longer than two seconds to "
18515 "run, and if progress bars are enabled, then you will see one appearing below "
18520 #: ../fish/guestfish.pod:871
18523 " ><fs> copy-size /large-file /another-file 2048M\n"
18524 " / 10% [#####-----------------------------------------] 00:30\n"
18529 #: ../fish/guestfish.pod:874
18531 "The spinner on the left hand side moves round once for every progress "
18532 "notification received from the backend. This is a (reasonably) golden "
18533 "assurance that the command is \"doing something\" even if the progress bar "
18534 "is not moving, because the command is able to send the progress "
18535 "notifications. When the bar reaches 100% and the command finishes, the "
18536 "spinner disappears."
18540 #: ../fish/guestfish.pod:881
18542 "Progress bars are enabled by default when guestfish is used interactively. "
18543 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18544 "and you can disable them completely using I<--no-progress-bars>."
18548 #: ../fish/guestfish.pod:886
18549 msgid "GUESTFISH COMMANDS"
18553 #: ../fish/guestfish.pod:888
18555 "The commands in this section are guestfish convenience commands, in other "
18556 "words, they are not part of the L<guestfs(3)> API."
18560 #: ../fish/guestfish.pod:891
18565 #: ../fish/guestfish.pod:893
18574 #: ../fish/guestfish.pod:896
18575 msgid "Without any parameter, this provides general help."
18579 #: ../fish/guestfish.pod:898
18580 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18584 #: ../fish/guestfish.pod:900
18585 msgid "quit | exit"
18589 #: ../fish/guestfish.pod:902
18590 msgid "This exits guestfish. You can also use C<^D> key."
18594 #: ../fish/guestfish.pod:904
18595 msgid "@FISH_COMMANDS@"
18599 #: ../fish/guestfish.pod:906
18604 #: ../fish/guestfish.pod:910 ../test-tool/libguestfs-test-tool.pod:83
18609 #: ../fish/guestfish.pod:912
18611 "guestfish returns 0 if the commands completed without error, or 1 if there "
18616 #: ../fish/guestfish.pod:919
18621 #: ../fish/guestfish.pod:921
18623 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18628 #: ../fish/guestfish.pod:924
18629 msgid "GUESTFISH_PID"
18633 #: ../fish/guestfish.pod:926
18635 "Used with the I<--remote> option to specify the remote guestfish process to "
18636 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18640 #: ../fish/guestfish.pod:930
18645 #: ../fish/guestfish.pod:932
18647 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18648 "not specified, the external L<hexedit(1)> program is used."
18652 #: ../fish/guestfish.pod:936
18657 #: ../fish/guestfish.pod:938
18659 "If compiled with GNU readline support, various files in the home directory "
18660 "can be used. See L</FILES>."
18664 #: ../fish/guestfish.pod:947
18666 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18667 "effect as using the B<-v> option."
18671 #: ../fish/guestfish.pod:959
18673 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18674 "the discussion of paths in L<guestfs(3)>."
18678 #: ../fish/guestfish.pod:970
18679 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18683 #: ../fish/guestfish.pod:972
18688 #: ../fish/guestfish.pod:974
18690 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18695 #: ../fish/guestfish.pod:989 ../test-tool/libguestfs-test-tool.pod:88
18700 #: ../fish/guestfish.pod:993
18701 msgid "$HOME/.guestfish"
18705 #: ../fish/guestfish.pod:995
18707 "If compiled with GNU readline support, then the command history is saved in "
18712 #: ../fish/guestfish.pod:998
18713 msgid "$HOME/.inputrc"
18717 #: ../fish/guestfish.pod:1000
18718 msgid "/etc/inputrc"
18722 #: ../fish/guestfish.pod:1002
18724 "If compiled with GNU readline support, then these files can be used to "
18725 "configure readline. For further information, please see "
18726 "L<readline(3)/INITIALIZATION FILE>."
18730 #: ../fish/guestfish.pod:1006
18731 msgid "To write rules which only apply to guestfish, use:"
18735 #: ../fish/guestfish.pod:1008
18745 #: ../fish/guestfish.pod:1012
18747 "Variables that you can set in inputrc that change the behaviour of guestfish "
18748 "in useful ways include:"
18752 #: ../fish/guestfish.pod:1017
18753 msgid "completion-ignore-case (default: on)"
18757 #: ../fish/guestfish.pod:1019
18759 "By default, guestfish will ignore case when tab-completing paths on the "
18764 #: ../fish/guestfish.pod:1022
18767 " set completion-ignore-case off\n"
18772 #: ../fish/guestfish.pod:1024
18773 msgid "to make guestfish case sensitive."
18777 #: ../fish/guestfish.pod:1028
18782 #: ../fish/guestfish.pod:1030
18783 msgid "test2.img (etc)"
18787 #: ../fish/guestfish.pod:1032
18789 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
18790 "will be created in the file C<test1.img> in the current directory. The "
18791 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
18792 "the same name will be overwritten."
18796 #: ../fish/guestfish.pod:1041
18798 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
18799 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
18800 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
18801 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, "
18802 "L<virt-win-reg(1)>, L<hexedit(1)>."
18806 #: ../fish/guestfish.pod:1067 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518 ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:300 ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
18808 "This program is free software; you can redistribute it and/or modify it "
18809 "under the terms of the GNU General Public License as published by the Free "
18810 "Software Foundation; either version 2 of the License, or (at your option) "
18811 "any later version."
18815 #: ../fish/guestfish.pod:1072 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523 ../tools/virt-resize.pl:1517 ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
18817 "This program is distributed in the hope that it will be useful, but WITHOUT "
18818 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
18819 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
18824 #: ../fish/guestfish.pod:1077 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528 ../tools/virt-resize.pl:1522 ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:310 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
18826 "You should have received a copy of the GNU General Public License along with "
18827 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
18828 "Ave, Cambridge, MA 02139, USA."
18832 #: ../fish/guestfish-actions.pod:1
18837 #: ../fish/guestfish-actions.pod:3
18840 " add-cdrom filename\n"
18845 #: ../fish/guestfish-actions.pod:15
18847 "This call checks for the existence of C<filename>. This stops you from "
18848 "specifying other types of drive which are supported by qemu such as C<nbd:> "
18849 "and C<http:> URLs. To specify those, use the general L</config> call "
18854 #: ../fish/guestfish-actions.pod:22
18856 "If you just want to add an ISO file (often you use this as an efficient way "
18857 "to transfer large files into the guest), then you should probably use "
18858 "L</add-drive-ro> instead."
18862 #: ../fish/guestfish-actions.pod:35
18867 #: ../fish/guestfish-actions.pod:37
18872 #: ../fish/guestfish-actions.pod:39
18875 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
18880 #: ../fish/guestfish-actions.pod:41
18882 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
18883 "It works by connecting to libvirt, requesting the domain and domain XML from "
18884 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
18888 #: ../fish/guestfish-actions.pod:58
18890 "The optional C<libvirturi> parameter sets the libvirt URI (see "
18891 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
18892 "default libvirt URI (or one set through an environment variable, see the "
18893 "libvirt documentation for full details). If you are using the C API "
18894 "directly then it is more flexible to create the libvirt connection object "
18895 "yourself, get the domain object, and call L</add-libvirt-dom>."
18899 #: ../fish/guestfish-actions.pod:66
18901 "The other optional parameters are passed directly through to "
18902 "L</add-drive-opts>."
18906 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133 ../fish/guestfish-actions.pod:2804
18908 "This command has one or more optional arguments. See L</OPTIONAL "
18913 #: ../fish/guestfish-actions.pod:71
18918 #: ../fish/guestfish-actions.pod:73
18921 " add-drive filename\n"
18926 #: ../fish/guestfish-actions.pod:75
18928 "This function is the equivalent of calling L</add-drive-opts> with no "
18929 "optional parameters, so the disk is added writable, with the format being "
18930 "detected automatically."
18934 #: ../fish/guestfish-actions.pod:79
18936 "Automatic detection of the format opens you up to a potential security hole "
18937 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
18938 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
18939 "you should think about replacing calls to this function with calls to "
18940 "L</add-drive-opts>, and specifying the format."
18944 #: ../fish/guestfish-actions.pod:86
18945 msgid "add-drive-opts"
18949 #: ../fish/guestfish-actions.pod:88
18954 #: ../fish/guestfish-actions.pod:90
18957 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
18962 #: ../fish/guestfish-actions.pod:117
18964 "This forces the image format. If you omit this (or use L</add-drive> or "
18965 "L</add-drive-ro>) then the format is automatically detected. Possible "
18966 "formats include C<raw> and C<qcow2>."
18970 #: ../fish/guestfish-actions.pod:128
18972 "This rarely-used option lets you emulate the behaviour of the deprecated "
18973 "L</add-drive-with-if> call (q.v.)"
18977 #: ../fish/guestfish-actions.pod:135
18978 msgid "add-drive-ro"
18982 #: ../fish/guestfish-actions.pod:137
18987 #: ../fish/guestfish-actions.pod:139
18990 " add-drive-ro filename\n"
18995 #: ../fish/guestfish-actions.pod:141
18997 "This function is the equivalent of calling L</add-drive-opts> with the "
18998 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
18999 "is added read-only, with the format being detected automatically."
19003 #: ../fish/guestfish-actions.pod:146
19004 msgid "add-drive-ro-with-if"
19008 #: ../fish/guestfish-actions.pod:148
19011 " add-drive-ro-with-if filename iface\n"
19016 #: ../fish/guestfish-actions.pod:150
19018 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19019 "interface emulation to use at run time."
19023 #: ../fish/guestfish-actions.pod:160
19024 msgid "add-drive-with-if"
19028 #: ../fish/guestfish-actions.pod:162
19031 " add-drive-with-if filename iface\n"
19036 #: ../fish/guestfish-actions.pod:164
19038 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19039 "interface emulation to use at run time."
19043 #: ../fish/guestfish-actions.pod:174
19048 #: ../fish/guestfish-actions.pod:176
19051 " aug-clear augpath\n"
19056 #: ../fish/guestfish-actions.pod:181
19061 #: ../fish/guestfish-actions.pod:183
19069 #: ../fish/guestfish-actions.pod:185
19071 "Close the current Augeas handle and free up any resources used by it. After "
19072 "calling this, you have to call L</aug-init> again before you can use any "
19073 "other Augeas functions."
19077 #: ../fish/guestfish-actions.pod:190
19078 msgid "aug-defnode"
19082 #: ../fish/guestfish-actions.pod:192
19085 " aug-defnode name expr val\n"
19090 #: ../fish/guestfish-actions.pod:197
19092 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19093 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19094 "containing that single node."
19098 #: ../fish/guestfish-actions.pod:205
19103 #: ../fish/guestfish-actions.pod:207
19106 " aug-defvar name expr\n"
19111 #: ../fish/guestfish-actions.pod:216
19116 #: ../fish/guestfish-actions.pod:218
19119 " aug-get augpath\n"
19124 #: ../fish/guestfish-actions.pod:223
19129 #: ../fish/guestfish-actions.pod:225
19132 " aug-init root flags\n"
19137 #: ../fish/guestfish-actions.pod:231
19138 msgid "You must call this before using any other L</aug-*> commands."
19142 #: ../fish/guestfish-actions.pod:266
19143 msgid "Do not load the tree in L</aug-init>."
19147 #: ../fish/guestfish-actions.pod:270
19148 msgid "To close the handle, you can call L</aug-close>."
19152 #: ../fish/guestfish-actions.pod:274
19157 #: ../fish/guestfish-actions.pod:276
19160 " aug-insert augpath label true|false\n"
19165 #: ../fish/guestfish-actions.pod:286
19170 #: ../fish/guestfish-actions.pod:288
19178 #: ../fish/guestfish-actions.pod:295
19183 #: ../fish/guestfish-actions.pod:297
19186 " aug-ls augpath\n"
19191 #: ../fish/guestfish-actions.pod:299
19193 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19194 "resulting nodes into alphabetical order."
19198 #: ../fish/guestfish-actions.pod:302
19203 #: ../fish/guestfish-actions.pod:304
19206 " aug-match augpath\n"
19211 #: ../fish/guestfish-actions.pod:310
19216 #: ../fish/guestfish-actions.pod:312
19219 " aug-mv src dest\n"
19224 #: ../fish/guestfish-actions.pod:317
19229 #: ../fish/guestfish-actions.pod:319
19232 " aug-rm augpath\n"
19237 #: ../fish/guestfish-actions.pod:325
19242 #: ../fish/guestfish-actions.pod:327
19250 #: ../fish/guestfish-actions.pod:331
19252 "The flags which were passed to L</aug-init> affect exactly how files are "
19257 #: ../fish/guestfish-actions.pod:334
19262 #: ../fish/guestfish-actions.pod:336
19265 " aug-set augpath val\n"
19270 #: ../fish/guestfish-actions.pod:340
19272 "In the Augeas API, it is possible to clear a node by setting the value to "
19273 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
19274 "this call. Instead you must use the L</aug-clear> call."
19278 #: ../fish/guestfish-actions.pod:345
19283 #: ../fish/guestfish-actions.pod:347
19286 " available 'groups ...'\n"
19291 #: ../fish/guestfish-actions.pod:353
19293 "The libguestfs groups, and the functions that those groups correspond to, "
19294 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
19295 "runtime by calling L</available-all-groups>."
19299 #: ../fish/guestfish-actions.pod:377
19300 msgid "You must call L</launch> before calling this function."
19304 #: ../fish/guestfish-actions.pod:399
19306 "This call was added in version C<1.0.80>. In previous versions of "
19307 "libguestfs all you could do would be to speculatively execute a command to "
19308 "find out if the daemon implemented it. See also L</version>."
19312 #: ../fish/guestfish-actions.pod:406
19313 msgid "available-all-groups"
19317 #: ../fish/guestfish-actions.pod:408
19320 " available-all-groups\n"
19325 #: ../fish/guestfish-actions.pod:410
19327 "This command returns a list of all optional groups that this daemon knows "
19328 "about. Note this returns both supported and unsupported groups. To find "
19329 "out which ones the daemon can actually support you have to call "
19330 "L</available> on each member of the returned list."
19334 #: ../fish/guestfish-actions.pod:416
19335 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
19339 #: ../fish/guestfish-actions.pod:418
19344 #: ../fish/guestfish-actions.pod:420
19347 " base64-in (base64file|-) filename\n"
19352 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434 ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827 ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223 ../fish/guestfish-actions.pod:4159 ../fish/guestfish-actions.pod:4171 ../fish/guestfish-actions.pod:4182 ../fish/guestfish-actions.pod:4193 ../fish/guestfish-actions.pod:4245 ../fish/guestfish-actions.pod:4254 ../fish/guestfish-actions.pod:4308 ../fish/guestfish-actions.pod:4331
19353 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
19357 #: ../fish/guestfish-actions.pod:427
19362 #: ../fish/guestfish-actions.pod:429
19365 " base64-out filename (base64file|-)\n"
19370 #: ../fish/guestfish-actions.pod:436
19371 msgid "blockdev-flushbufs"
19375 #: ../fish/guestfish-actions.pod:438
19378 " blockdev-flushbufs device\n"
19383 #: ../fish/guestfish-actions.pod:445
19384 msgid "blockdev-getbsz"
19388 #: ../fish/guestfish-actions.pod:447
19391 " blockdev-getbsz device\n"
19396 #: ../fish/guestfish-actions.pod:456
19397 msgid "blockdev-getro"
19401 #: ../fish/guestfish-actions.pod:458
19404 " blockdev-getro device\n"
19409 #: ../fish/guestfish-actions.pod:465
19410 msgid "blockdev-getsize64"
19414 #: ../fish/guestfish-actions.pod:467
19417 " blockdev-getsize64 device\n"
19422 #: ../fish/guestfish-actions.pod:471
19423 msgid "See also L</blockdev-getsz>."
19427 #: ../fish/guestfish-actions.pod:475
19428 msgid "blockdev-getss"
19432 #: ../fish/guestfish-actions.pod:477
19435 " blockdev-getss device\n"
19440 #: ../fish/guestfish-actions.pod:482
19441 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
19445 #: ../fish/guestfish-actions.pod:487
19446 msgid "blockdev-getsz"
19450 #: ../fish/guestfish-actions.pod:489
19453 " blockdev-getsz device\n"
19458 #: ../fish/guestfish-actions.pod:494
19460 "See also L</blockdev-getss> for the real sector size of the device, and "
19461 "L</blockdev-getsize64> for the more useful I<size in bytes>."
19465 #: ../fish/guestfish-actions.pod:500
19466 msgid "blockdev-rereadpt"
19470 #: ../fish/guestfish-actions.pod:502
19473 " blockdev-rereadpt device\n"
19478 #: ../fish/guestfish-actions.pod:508
19479 msgid "blockdev-setbsz"
19483 #: ../fish/guestfish-actions.pod:510
19486 " blockdev-setbsz device blocksize\n"
19491 #: ../fish/guestfish-actions.pod:519
19492 msgid "blockdev-setro"
19496 #: ../fish/guestfish-actions.pod:521
19499 " blockdev-setro device\n"
19504 #: ../fish/guestfish-actions.pod:527
19505 msgid "blockdev-setrw"
19509 #: ../fish/guestfish-actions.pod:529
19512 " blockdev-setrw device\n"
19517 #: ../fish/guestfish-actions.pod:535
19518 msgid "case-sensitive-path"
19522 #: ../fish/guestfish-actions.pod:537
19525 " case-sensitive-path path\n"
19530 #: ../fish/guestfish-actions.pod:561
19532 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
19533 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
19534 "how the directories were originally created under Windows)."
19538 #: ../fish/guestfish-actions.pod:569
19539 msgid "See also L</realpath>."
19543 #: ../fish/guestfish-actions.pod:571
19548 #: ../fish/guestfish-actions.pod:573
19556 #: ../fish/guestfish-actions.pod:577
19558 "Note that this function cannot correctly handle binary files (specifically, "
19559 "files containing C<\\0> character which is treated as end of string). For "
19560 "those you need to use the L</read-file> or L</download> functions which have "
19561 "a more complex interface."
19565 #: ../fish/guestfish-actions.pod:585
19570 #: ../fish/guestfish-actions.pod:587
19573 " checksum csumtype path\n"
19578 #: ../fish/guestfish-actions.pod:630
19579 msgid "To get the checksum for a device, use L</checksum-device>."
19583 #: ../fish/guestfish-actions.pod:632
19584 msgid "To get the checksums for many files, use L</checksums-out>."
19588 #: ../fish/guestfish-actions.pod:634
19589 msgid "checksum-device"
19593 #: ../fish/guestfish-actions.pod:636
19596 " checksum-device csumtype device\n"
19601 #: ../fish/guestfish-actions.pod:638
19603 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
19604 "device named C<device>. For the types of checksums supported see the "
19605 "L</checksum> command."
19609 #: ../fish/guestfish-actions.pod:642
19610 msgid "checksums-out"
19614 #: ../fish/guestfish-actions.pod:644
19617 " checksums-out csumtype directory (sumsfile|-)\n"
19622 #: ../fish/guestfish-actions.pod:660
19627 #: ../fish/guestfish-actions.pod:662
19630 " chmod mode path\n"
19635 #: ../fish/guestfish-actions.pod:673
19640 #: ../fish/guestfish-actions.pod:675
19643 " chown owner group path\n"
19648 #: ../fish/guestfish-actions.pod:683
19653 #: ../fish/guestfish-actions.pod:685
19656 " command 'arguments ...'\n"
19661 #: ../fish/guestfish-actions.pod:692
19663 "The single parameter is an argv-style list of arguments. The first element "
19664 "is the name of the program to run. Subsequent elements are parameters. The "
19665 "list must be non-empty (ie. must contain a program name). Note that the "
19666 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
19670 #: ../fish/guestfish-actions.pod:720
19671 msgid "command-lines"
19675 #: ../fish/guestfish-actions.pod:722
19678 " command-lines 'arguments ...'\n"
19683 #: ../fish/guestfish-actions.pod:724
19684 msgid "This is the same as L</command>, but splits the result into a list of lines."
19688 #: ../fish/guestfish-actions.pod:727
19689 msgid "See also: L</sh-lines>"
19693 #: ../fish/guestfish-actions.pod:732
19698 #: ../fish/guestfish-actions.pod:734
19701 " config qemuparam qemuvalue\n"
19706 #: ../fish/guestfish-actions.pod:745
19711 #: ../fish/guestfish-actions.pod:747
19714 " copy-size src dest size\n"
19719 #: ../fish/guestfish-actions.pod:755
19724 #: ../fish/guestfish-actions.pod:757
19732 #: ../fish/guestfish-actions.pod:762
19737 #: ../fish/guestfish-actions.pod:764
19745 #: ../fish/guestfish-actions.pod:769
19750 #: ../fish/guestfish-actions.pod:771
19758 #: ../fish/guestfish-actions.pod:778
19760 "If the destination is a device, it must be as large or larger than the "
19761 "source file or device, otherwise the copy will fail. This command cannot do "
19762 "partial copies (see L</copy-size>)."
19766 #: ../fish/guestfish-actions.pod:782
19771 #: ../fish/guestfish-actions.pod:784
19779 #: ../fish/guestfish-actions.pod:792
19784 #: ../fish/guestfish-actions.pod:794
19792 #: ../fish/guestfish-actions.pod:803
19797 #: ../fish/guestfish-actions.pod:805
19805 #: ../fish/guestfish-actions.pod:811
19807 "Another way to get the same information is to enable verbose messages with "
19808 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
19809 "before running the program."
19813 #: ../fish/guestfish-actions.pod:816
19818 #: ../fish/guestfish-actions.pod:818
19821 " download remotefilename (filename|-)\n"
19826 #: ../fish/guestfish-actions.pod:825
19827 msgid "See also L</upload>, L</cat>."
19831 #: ../fish/guestfish-actions.pod:829
19832 msgid "download-offset"
19836 #: ../fish/guestfish-actions.pod:831
19839 " download-offset remotefilename (filename|-) offset size\n"
19844 #: ../fish/guestfish-actions.pod:839
19846 "Note that there is no limit on the amount of data that can be downloaded "
19847 "with this call, unlike with L</pread>, and this call always reads the full "
19848 "amount unless an error occurs."
19852 #: ../fish/guestfish-actions.pod:844
19853 msgid "See also L</download>, L</pread>."
19857 #: ../fish/guestfish-actions.pod:848
19858 msgid "drop-caches"
19862 #: ../fish/guestfish-actions.pod:850
19865 " drop-caches whattodrop\n"
19870 #: ../fish/guestfish-actions.pod:862
19875 #: ../fish/guestfish-actions.pod:864
19883 #: ../fish/guestfish-actions.pod:876
19888 #: ../fish/guestfish-actions.pod:878
19891 " e2fsck-f device\n"
19896 #: ../fish/guestfish-actions.pod:884
19898 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
19899 "should use L</fsck>."
19903 #: ../fish/guestfish-actions.pod:887
19904 msgid "echo-daemon"
19908 #: ../fish/guestfish-actions.pod:889
19911 " echo-daemon 'words ...'\n"
19916 #: ../fish/guestfish-actions.pod:896
19917 msgid "See also L</ping-daemon>."
19921 #: ../fish/guestfish-actions.pod:898
19926 #: ../fish/guestfish-actions.pod:900
19929 " egrep regex path\n"
19934 #: ../fish/guestfish-actions.pod:908
19939 #: ../fish/guestfish-actions.pod:910
19942 " egrepi regex path\n"
19947 #: ../fish/guestfish-actions.pod:918
19952 #: ../fish/guestfish-actions.pod:920
19955 " equal file1 file2\n"
19960 #: ../fish/guestfish-actions.pod:927
19965 #: ../fish/guestfish-actions.pod:929
19973 #: ../fish/guestfish-actions.pod:934
19974 msgid "See also L</is-file>, L</is-dir>, L</stat>."
19978 #: ../fish/guestfish-actions.pod:936
19983 #: ../fish/guestfish-actions.pod:938
19986 " fallocate path len\n"
19991 #: ../fish/guestfish-actions.pod:955
19992 msgid "fallocate64"
19996 #: ../fish/guestfish-actions.pod:957
19999 " fallocate64 path len\n"
20004 #: ../fish/guestfish-actions.pod:963
20006 "Note that this call allocates disk blocks for the file. To create a sparse "
20007 "file use L</truncate-size> instead."
20011 #: ../fish/guestfish-actions.pod:966
20013 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20014 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20015 "maximum size of files created through that call to 1GB."
20019 #: ../fish/guestfish-actions.pod:975
20024 #: ../fish/guestfish-actions.pod:977
20027 " fgrep pattern path\n"
20032 #: ../fish/guestfish-actions.pod:985
20037 #: ../fish/guestfish-actions.pod:987
20040 " fgrepi pattern path\n"
20045 #: ../fish/guestfish-actions.pod:995
20050 #: ../fish/guestfish-actions.pod:997
20058 #: ../fish/guestfish-actions.pod:1009
20060 "This command can also be used on C</dev/> devices (and partitions, LV "
20061 "names). You can for example use this to determine if a device contains a "
20062 "filesystem, although it's usually better to use L</vfs-type>."
20066 #: ../fish/guestfish-actions.pod:1019
20067 msgid "file-architecture"
20071 #: ../fish/guestfish-actions.pod:1021
20074 " file-architecture filename\n"
20079 #: ../fish/guestfish-actions.pod:1124
20084 #: ../fish/guestfish-actions.pod:1126
20092 #: ../fish/guestfish-actions.pod:1130
20094 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
20095 "L</is-file> etc. To get the size of block devices, use "
20096 "L</blockdev-getsize64>."
20100 #: ../fish/guestfish-actions.pod:1134
20105 #: ../fish/guestfish-actions.pod:1136
20108 " fill c len path\n"
20113 #: ../fish/guestfish-actions.pod:1142
20115 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20116 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20117 "L</fill-pattern>."
20121 #: ../fish/guestfish-actions.pod:1147
20122 msgid "fill-pattern"
20126 #: ../fish/guestfish-actions.pod:1149
20129 " fill-pattern pattern len path\n"
20134 #: ../fish/guestfish-actions.pod:1151
20136 "This function is like L</fill> except that it creates a new file of length "
20137 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20138 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20143 #: ../fish/guestfish-actions.pod:1156
20148 #: ../fish/guestfish-actions.pod:1158
20151 " find directory\n"
20156 #: ../fish/guestfish-actions.pod:1172
20157 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20161 #: ../fish/guestfish-actions.pod:1185
20162 msgid "See also L</find0>."
20166 #: ../fish/guestfish-actions.pod:1190
20171 #: ../fish/guestfish-actions.pod:1192
20174 " find0 directory (files|-)\n"
20179 #: ../fish/guestfish-actions.pod:1198
20180 msgid "This command works the same way as L</find> with the following exceptions:"
20184 #: ../fish/guestfish-actions.pod:1225
20185 msgid "findfs-label"
20189 #: ../fish/guestfish-actions.pod:1227
20192 " findfs-label label\n"
20197 #: ../fish/guestfish-actions.pod:1233
20198 msgid "To find the label of a filesystem, use L</vfs-label>."
20202 #: ../fish/guestfish-actions.pod:1235
20203 msgid "findfs-uuid"
20207 #: ../fish/guestfish-actions.pod:1237
20210 " findfs-uuid uuid\n"
20215 #: ../fish/guestfish-actions.pod:1243
20216 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
20220 #: ../fish/guestfish-actions.pod:1245
20225 #: ../fish/guestfish-actions.pod:1247
20228 " fsck fstype device\n"
20233 #: ../fish/guestfish-actions.pod:1277
20238 #: ../fish/guestfish-actions.pod:1279
20246 #: ../fish/guestfish-actions.pod:1286
20247 msgid "get-autosync"
20251 #: ../fish/guestfish-actions.pod:1288
20259 #: ../fish/guestfish-actions.pod:1292
20264 #: ../fish/guestfish-actions.pod:1294
20272 #: ../fish/guestfish-actions.pod:1298
20273 msgid "get-e2label"
20277 #: ../fish/guestfish-actions.pod:1300
20280 " get-e2label device\n"
20285 #: ../fish/guestfish-actions.pod:1312
20290 #: ../fish/guestfish-actions.pod:1314
20293 " get-e2uuid device\n"
20298 #: ../fish/guestfish-actions.pod:1326
20299 msgid "get-memsize"
20303 #: ../fish/guestfish-actions.pod:1328
20311 #: ../fish/guestfish-actions.pod:1333
20313 "If L</set-memsize> was not called on this handle, and if "
20314 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
20315 "value for memsize."
20319 #: ../fish/guestfish-actions.pod:1340
20320 msgid "get-network"
20324 #: ../fish/guestfish-actions.pod:1342
20332 #: ../fish/guestfish-actions.pod:1346
20337 #: ../fish/guestfish-actions.pod:1348
20345 #: ../fish/guestfish-actions.pod:1355
20350 #: ../fish/guestfish-actions.pod:1357
20355 #: ../fish/guestfish-actions.pod:1359
20363 #: ../fish/guestfish-actions.pod:1366
20368 #: ../fish/guestfish-actions.pod:1368
20376 #: ../fish/guestfish-actions.pod:1375
20377 msgid "get-recovery-proc"
20381 #: ../fish/guestfish-actions.pod:1377
20384 " get-recovery-proc\n"
20389 #: ../fish/guestfish-actions.pod:1381
20390 msgid "get-selinux"
20394 #: ../fish/guestfish-actions.pod:1383
20402 #: ../fish/guestfish-actions.pod:1385
20404 "This returns the current setting of the selinux flag which is passed to the "
20405 "appliance at boot time. See L</set-selinux>."
20409 #: ../fish/guestfish-actions.pod:1391
20414 #: ../fish/guestfish-actions.pod:1393
20422 #: ../fish/guestfish-actions.pod:1400
20427 #: ../fish/guestfish-actions.pod:1402
20435 #: ../fish/guestfish-actions.pod:1406
20440 #: ../fish/guestfish-actions.pod:1408
20448 #: ../fish/guestfish-actions.pod:1410
20450 "Return the current umask. By default the umask is C<022> unless it has been "
20451 "set by calling L</umask>."
20455 #: ../fish/guestfish-actions.pod:1413
20456 msgid "get-verbose"
20460 #: ../fish/guestfish-actions.pod:1415
20468 #: ../fish/guestfish-actions.pod:1419
20473 #: ../fish/guestfish-actions.pod:1421
20481 #: ../fish/guestfish-actions.pod:1425
20482 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
20486 #: ../fish/guestfish-actions.pod:1428
20491 #: ../fish/guestfish-actions.pod:1430
20494 " getxattrs path\n"
20499 #: ../fish/guestfish-actions.pod:1438
20500 msgid "See also: L</lgetxattrs>, L<attr(5)>."
20504 #: ../fish/guestfish-actions.pod:1440
20505 msgid "glob-expand"
20509 #: ../fish/guestfish-actions.pod:1442
20512 " glob-expand pattern\n"
20517 #: ../fish/guestfish-actions.pod:1455
20522 #: ../fish/guestfish-actions.pod:1457
20525 " grep regex path\n"
20530 #: ../fish/guestfish-actions.pod:1465
20535 #: ../fish/guestfish-actions.pod:1467
20538 " grepi regex path\n"
20543 #: ../fish/guestfish-actions.pod:1475
20544 msgid "grub-install"
20548 #: ../fish/guestfish-actions.pod:1477
20551 " grub-install root device\n"
20556 #: ../fish/guestfish-actions.pod:1493
20561 #: ../fish/guestfish-actions.pod:1495
20569 #: ../fish/guestfish-actions.pod:1503
20574 #: ../fish/guestfish-actions.pod:1505
20577 " head-n nrlines path\n"
20582 #: ../fish/guestfish-actions.pod:1518
20587 #: ../fish/guestfish-actions.pod:1520
20595 #: ../fish/guestfish-actions.pod:1528
20600 #: ../fish/guestfish-actions.pod:1530
20603 " initrd-cat initrdpath filename\n"
20608 #: ../fish/guestfish-actions.pod:1542
20609 msgid "See also L</initrd-list>."
20613 #: ../fish/guestfish-actions.pod:1547
20614 msgid "initrd-list"
20618 #: ../fish/guestfish-actions.pod:1549
20621 " initrd-list path\n"
20626 #: ../fish/guestfish-actions.pod:1561
20627 msgid "inotify-add-watch"
20631 #: ../fish/guestfish-actions.pod:1563
20634 " inotify-add-watch path mask\n"
20639 #: ../fish/guestfish-actions.pod:1575
20640 msgid "inotify-close"
20644 #: ../fish/guestfish-actions.pod:1577
20652 #: ../fish/guestfish-actions.pod:1583
20653 msgid "inotify-files"
20657 #: ../fish/guestfish-actions.pod:1585
20665 #: ../fish/guestfish-actions.pod:1587
20667 "This function is a helpful wrapper around L</inotify-read> which just "
20668 "returns a list of pathnames of objects that were touched. The returned "
20669 "pathnames are sorted and deduplicated."
20673 #: ../fish/guestfish-actions.pod:1591
20674 msgid "inotify-init"
20678 #: ../fish/guestfish-actions.pod:1593
20681 " inotify-init maxevents\n"
20686 #: ../fish/guestfish-actions.pod:1599
20688 "C<maxevents> is the maximum number of events which will be queued up between "
20689 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
20690 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
20691 "default was 16384 events. Beyond this limit, the kernel throws away events, "
20692 "but records the fact that it threw them away by setting a flag "
20693 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
20697 #: ../fish/guestfish-actions.pod:1609
20699 "Before any events are generated, you have to add some watches to the "
20700 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
20701 "L</inotify-watch-all>."
20705 #: ../fish/guestfish-actions.pod:1615
20707 "Queued up events should be read periodically by calling L</inotify-read> (or "
20708 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
20709 "If you don't read the events out often enough then you risk the internal "
20710 "queue overflowing."
20714 #: ../fish/guestfish-actions.pod:1622
20716 "The handle should be closed after use by calling L</inotify-close>. This "
20717 "also removes any watches automatically."
20721 #: ../fish/guestfish-actions.pod:1631
20722 msgid "inotify-read"
20726 #: ../fish/guestfish-actions.pod:1633
20734 #: ../fish/guestfish-actions.pod:1646
20735 msgid "inotify-rm-watch"
20739 #: ../fish/guestfish-actions.pod:1648
20742 " inotify-rm-watch wd\n"
20747 #: ../fish/guestfish-actions.pod:1650
20748 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
20752 #: ../fish/guestfish-actions.pod:1653
20753 msgid "inspect-get-arch"
20757 #: ../fish/guestfish-actions.pod:1655
20760 " inspect-get-arch root\n"
20765 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673 ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1765 ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1839 ../fish/guestfish-actions.pod:1861 ../fish/guestfish-actions.pod:1885 ../fish/guestfish-actions.pod:1915 ../fish/guestfish-actions.pod:1950 ../fish/guestfish-actions.pod:1966
20767 "This function should only be called with a root device string as returned by "
20772 #: ../fish/guestfish-actions.pod:1660
20774 "This returns the architecture of the inspected operating system. The "
20775 "possible return values are listed under L</file-architecture>."
20779 #: ../fish/guestfish-actions.pod:1669
20780 msgid "inspect-get-distro"
20784 #: ../fish/guestfish-actions.pod:1671
20787 " inspect-get-distro root\n"
20792 #: ../fish/guestfish-actions.pod:1743
20793 msgid "inspect-get-filesystems"
20797 #: ../fish/guestfish-actions.pod:1745
20800 " inspect-get-filesystems root\n"
20805 #: ../fish/guestfish-actions.pod:1758
20807 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
20808 "L</inspect-get-mountpoints>."
20812 #: ../fish/guestfish-actions.pod:1761
20813 msgid "inspect-get-hostname"
20817 #: ../fish/guestfish-actions.pod:1763
20820 " inspect-get-hostname root\n"
20825 #: ../fish/guestfish-actions.pod:1776
20826 msgid "inspect-get-major-version"
20830 #: ../fish/guestfish-actions.pod:1778
20833 " inspect-get-major-version root\n"
20838 #: ../fish/guestfish-actions.pod:1797
20839 msgid "inspect-get-minor-version"
20843 #: ../fish/guestfish-actions.pod:1799
20846 " inspect-get-minor-version root\n"
20851 #: ../fish/guestfish-actions.pod:1809
20853 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
20854 "L</inspect-get-major-version>."
20858 #: ../fish/guestfish-actions.pod:1812
20859 msgid "inspect-get-mountpoints"
20863 #: ../fish/guestfish-actions.pod:1814
20866 " inspect-get-mountpoints root\n"
20871 #: ../fish/guestfish-actions.pod:1832
20873 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
20874 "L</inspect-get-filesystems>."
20878 #: ../fish/guestfish-actions.pod:1835
20879 msgid "inspect-get-package-format"
20883 #: ../fish/guestfish-actions.pod:1837
20886 " inspect-get-package-format root\n"
20891 #: ../fish/guestfish-actions.pod:1842
20893 "This function and L</inspect-get-package-management> return the package "
20894 "format and package management tool used by the inspected operating system. "
20895 "For example for Fedora these functions would return C<rpm> (package format) "
20896 "and C<yum> (package management)."
20900 #: ../fish/guestfish-actions.pod:1857
20901 msgid "inspect-get-package-management"
20905 #: ../fish/guestfish-actions.pod:1859
20908 " inspect-get-package-management root\n"
20913 #: ../fish/guestfish-actions.pod:1864
20915 "L</inspect-get-package-format> and this function return the package format "
20916 "and package management tool used by the inspected operating system. For "
20917 "example for Fedora these functions would return C<rpm> (package format) and "
20918 "C<yum> (package management)."
20922 #: ../fish/guestfish-actions.pod:1881
20923 msgid "inspect-get-product-name"
20927 #: ../fish/guestfish-actions.pod:1883
20930 " inspect-get-product-name root\n"
20935 #: ../fish/guestfish-actions.pod:1898
20936 msgid "inspect-get-roots"
20940 #: ../fish/guestfish-actions.pod:1900
20943 " inspect-get-roots\n"
20948 #: ../fish/guestfish-actions.pod:1902
20950 "This function is a convenient way to get the list of root devices, as "
20951 "returned from a previous call to L</inspect-os>, but without redoing the "
20952 "whole inspection process."
20956 #: ../fish/guestfish-actions.pod:1906
20958 "This returns an empty list if either no root devices were found or the "
20959 "caller has not called L</inspect-os>."
20963 #: ../fish/guestfish-actions.pod:1911
20964 msgid "inspect-get-type"
20968 #: ../fish/guestfish-actions.pod:1913
20971 " inspect-get-type root\n"
20976 #: ../fish/guestfish-actions.pod:1946
20977 msgid "inspect-get-windows-systemroot"
20981 #: ../fish/guestfish-actions.pod:1948
20984 " inspect-get-windows-systemroot root\n"
20989 #: ../fish/guestfish-actions.pod:1962
20990 msgid "inspect-list-applications"
20994 #: ../fish/guestfish-actions.pod:1964
20997 " inspect-list-applications root\n"
21002 #: ../fish/guestfish-actions.pod:1971
21004 "I<Note:> This call works differently from other parts of the inspection "
21005 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21006 "then mount up the disks, before calling this. Listing applications is a "
21007 "significantly more difficult operation which requires access to the full "
21008 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21009 "are just returning data cached in the libguestfs handle, this call actually "
21010 "reads parts of the mounted filesystems during the call."
21014 #: ../fish/guestfish-actions.pod:2061
21019 #: ../fish/guestfish-actions.pod:2063
21027 #: ../fish/guestfish-actions.pod:2078
21029 "You can pass the root string(s) returned to other L</inspect-get-*> "
21030 "functions in order to query further information about each operating system, "
21031 "such as the name and version."
21035 #: ../fish/guestfish-actions.pod:2083
21037 "This function uses other libguestfs features such as L</mount-ro> and "
21038 "L</umount-all> in order to mount and unmount filesystems and look at the "
21039 "contents. This should be called with no disks currently mounted. The "
21040 "function may also use Augeas, so any existing Augeas handle will be closed."
21044 #: ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2251 ../fish/guestfish-actions.pod:2297
21045 msgid "See also L</list-filesystems>."
21049 #: ../fish/guestfish-actions.pod:2097
21050 msgid "is-blockdev"
21054 #: ../fish/guestfish-actions.pod:2099
21057 " is-blockdev path\n"
21062 #: ../fish/guestfish-actions.pod:2104 ../fish/guestfish-actions.pod:2122 ../fish/guestfish-actions.pod:2141 ../fish/guestfish-actions.pod:2150 ../fish/guestfish-actions.pod:2160 ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2203
21063 msgid "See also L</stat>."
21067 #: ../fish/guestfish-actions.pod:2106
21072 #: ../fish/guestfish-actions.pod:2108
21080 #: ../fish/guestfish-actions.pod:2115
21085 #: ../fish/guestfish-actions.pod:2117
21088 " is-chardev path\n"
21093 #: ../fish/guestfish-actions.pod:2124
21098 #: ../fish/guestfish-actions.pod:2126
21106 #: ../fish/guestfish-actions.pod:2133
21111 #: ../fish/guestfish-actions.pod:2135
21119 #: ../fish/guestfish-actions.pod:2143
21124 #: ../fish/guestfish-actions.pod:2145
21132 #: ../fish/guestfish-actions.pod:2152
21137 #: ../fish/guestfish-actions.pod:2154
21145 #: ../fish/guestfish-actions.pod:2162
21146 msgid "is-launching"
21150 #: ../fish/guestfish-actions.pod:2164
21158 #: ../fish/guestfish-actions.pod:2171
21163 #: ../fish/guestfish-actions.pod:2173
21171 #: ../fish/guestfish-actions.pod:2178
21176 #: ../fish/guestfish-actions.pod:2180
21184 #: ../fish/guestfish-actions.pod:2187
21189 #: ../fish/guestfish-actions.pod:2189
21192 " is-socket path\n"
21197 #: ../fish/guestfish-actions.pod:2196
21202 #: ../fish/guestfish-actions.pod:2198
21205 " is-symlink path\n"
21210 #: ../fish/guestfish-actions.pod:2205
21211 msgid "kill-subprocess"
21215 #: ../fish/guestfish-actions.pod:2207
21218 " kill-subprocess\n"
21223 #: ../fish/guestfish-actions.pod:2211
21228 #: ../fish/guestfish-actions.pod:2213
21233 #: ../fish/guestfish-actions.pod:2215
21241 #: ../fish/guestfish-actions.pod:2223
21246 #: ../fish/guestfish-actions.pod:2225
21249 " lchown owner group path\n"
21254 #: ../fish/guestfish-actions.pod:2227
21256 "Change the file owner to C<owner> and group to C<group>. This is like "
21257 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
21262 #: ../fish/guestfish-actions.pod:2235
21267 #: ../fish/guestfish-actions.pod:2237
21270 " lgetxattrs path\n"
21275 #: ../fish/guestfish-actions.pod:2239
21277 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
21278 "it returns the extended attributes of the link itself."
21282 #: ../fish/guestfish-actions.pod:2243
21283 msgid "list-devices"
21287 #: ../fish/guestfish-actions.pod:2245
21295 #: ../fish/guestfish-actions.pod:2253
21296 msgid "list-filesystems"
21300 #: ../fish/guestfish-actions.pod:2255
21303 " list-filesystems\n"
21308 #: ../fish/guestfish-actions.pod:2274
21310 "This command runs other libguestfs commands, which might include L</mount> "
21311 "and L</umount>, and therefore you should use this soon after launch and only "
21312 "when nothing is mounted."
21316 #: ../fish/guestfish-actions.pod:2278
21318 "Not all of the filesystems returned will be mountable. In particular, swap "
21319 "partitions are returned in the list. Also this command does not check that "
21320 "each filesystem found is valid and mountable, and some filesystems might be "
21321 "mountable but require special options. Filesystems may not all belong to a "
21322 "single logical operating system (use L</inspect-os> to look for OSes)."
21326 #: ../fish/guestfish-actions.pod:2286
21327 msgid "list-partitions"
21331 #: ../fish/guestfish-actions.pod:2288
21334 " list-partitions\n"
21339 #: ../fish/guestfish-actions.pod:2294
21341 "This does not return logical volumes. For that you will need to call "
21346 #: ../fish/guestfish-actions.pod:2299
21351 #: ../fish/guestfish-actions.pod:2301
21359 #: ../fish/guestfish-actions.pod:2309
21364 #: ../fish/guestfish-actions.pod:2311
21367 " ln target linkname\n"
21372 #: ../fish/guestfish-actions.pod:2315
21377 #: ../fish/guestfish-actions.pod:2317
21380 " ln-f target linkname\n"
21385 #: ../fish/guestfish-actions.pod:2322
21390 #: ../fish/guestfish-actions.pod:2324
21393 " ln-s target linkname\n"
21398 #: ../fish/guestfish-actions.pod:2328
21403 #: ../fish/guestfish-actions.pod:2330
21406 " ln-sf target linkname\n"
21411 #: ../fish/guestfish-actions.pod:2335
21412 msgid "lremovexattr"
21416 #: ../fish/guestfish-actions.pod:2337
21419 " lremovexattr xattr path\n"
21424 #: ../fish/guestfish-actions.pod:2339
21426 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
21427 "it removes an extended attribute of the link itself."
21431 #: ../fish/guestfish-actions.pod:2343
21436 #: ../fish/guestfish-actions.pod:2345
21444 #: ../fish/guestfish-actions.pod:2351
21446 "This command is mostly useful for interactive sessions. Programs should "
21447 "probably use L</readdir> instead."
21451 #: ../fish/guestfish-actions.pod:2354
21456 #: ../fish/guestfish-actions.pod:2356
21459 " lsetxattr xattr val vallen path\n"
21464 #: ../fish/guestfish-actions.pod:2358
21466 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
21467 "sets an extended attribute of the link itself."
21471 #: ../fish/guestfish-actions.pod:2362
21476 #: ../fish/guestfish-actions.pod:2364
21484 #: ../fish/guestfish-actions.pod:2368
21486 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
21487 "the link is stat-ed, not the file it refers to."
21491 #: ../fish/guestfish-actions.pod:2374
21496 #: ../fish/guestfish-actions.pod:2376
21499 " lstatlist path 'names ...'\n"
21504 #: ../fish/guestfish-actions.pod:2378
21506 "This call allows you to perform the L</lstat> operation on multiple files, "
21507 "where all files are in the directory C<path>. C<names> is the list of files "
21508 "from this directory."
21512 #: ../fish/guestfish-actions.pod:2387
21514 "This call is intended for programs that want to efficiently list a directory "
21515 "contents without making many round-trips. See also L</lxattrlist> for a "
21516 "similarly efficient call for getting extended attributes. Very long "
21517 "directory listings might cause the protocol message size to be exceeded, "
21518 "causing this call to fail. The caller must split up such requests into "
21519 "smaller groups of names."
21523 #: ../fish/guestfish-actions.pod:2395
21524 msgid "luks-add-key"
21528 #: ../fish/guestfish-actions.pod:2397
21531 " luks-add-key device keyslot\n"
21536 #: ../fish/guestfish-actions.pod:2404
21538 "Note that if C<keyslot> already contains a key, then this command will "
21539 "fail. You have to use L</luks-kill-slot> first to remove that key."
21543 #: ../fish/guestfish-actions.pod:2408 ../fish/guestfish-actions.pod:2430 ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2457 ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2490
21545 "This command has one or more key or passphrase parameters. Guestfish will "
21546 "prompt for these separately."
21550 #: ../fish/guestfish-actions.pod:2411
21555 #: ../fish/guestfish-actions.pod:2413
21558 " luks-close device\n"
21563 #: ../fish/guestfish-actions.pod:2415
21565 "This closes a LUKS device that was created earlier by L</luks-open> or "
21566 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
21567 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
21568 "underlying block device."
21572 #: ../fish/guestfish-actions.pod:2421
21573 msgid "luks-format"
21577 #: ../fish/guestfish-actions.pod:2423
21580 " luks-format device keyslot\n"
21585 #: ../fish/guestfish-actions.pod:2436
21586 msgid "luks-format-cipher"
21590 #: ../fish/guestfish-actions.pod:2438
21593 " luks-format-cipher device keyslot cipher\n"
21598 #: ../fish/guestfish-actions.pod:2440
21600 "This command is the same as L</luks-format> but it also allows you to set "
21601 "the C<cipher> used."
21605 #: ../fish/guestfish-actions.pod:2449
21606 msgid "luks-kill-slot"
21610 #: ../fish/guestfish-actions.pod:2451
21613 " luks-kill-slot device keyslot\n"
21618 #: ../fish/guestfish-actions.pod:2460
21623 #: ../fish/guestfish-actions.pod:2462
21626 " luks-open device mapname\n"
21631 #: ../fish/guestfish-actions.pod:2476
21633 "If this block device contains LVM volume groups, then calling L</vgscan> "
21634 "followed by L</vg-activate-all> will make them visible."
21638 #: ../fish/guestfish-actions.pod:2483
21639 msgid "luks-open-ro"
21643 #: ../fish/guestfish-actions.pod:2485
21646 " luks-open-ro device mapname\n"
21651 #: ../fish/guestfish-actions.pod:2487
21653 "This is the same as L</luks-open> except that a read-only mapping is "
21658 #: ../fish/guestfish-actions.pod:2493
21663 #: ../fish/guestfish-actions.pod:2495
21666 " lvcreate logvol volgroup mbytes\n"
21671 #: ../fish/guestfish-actions.pod:2500
21672 msgid "lvm-canonical-lv-name"
21676 #: ../fish/guestfish-actions.pod:2502
21679 " lvm-canonical-lv-name lvname\n"
21684 #: ../fish/guestfish-actions.pod:2511
21685 msgid "See also L</is-lv>."
21689 #: ../fish/guestfish-actions.pod:2513
21690 msgid "lvm-clear-filter"
21694 #: ../fish/guestfish-actions.pod:2515
21697 " lvm-clear-filter\n"
21702 #: ../fish/guestfish-actions.pod:2517
21704 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
21709 #: ../fish/guestfish-actions.pod:2523
21710 msgid "lvm-remove-all"
21714 #: ../fish/guestfish-actions.pod:2525
21717 " lvm-remove-all\n"
21722 #: ../fish/guestfish-actions.pod:2533
21723 msgid "lvm-set-filter"
21727 #: ../fish/guestfish-actions.pod:2535
21730 " lvm-set-filter 'devices ...'\n"
21735 #: ../fish/guestfish-actions.pod:2560
21740 #: ../fish/guestfish-actions.pod:2562
21743 " lvremove device\n"
21748 #: ../fish/guestfish-actions.pod:2570
21753 #: ../fish/guestfish-actions.pod:2572
21756 " lvrename logvol newlogvol\n"
21761 #: ../fish/guestfish-actions.pod:2576
21766 #: ../fish/guestfish-actions.pod:2578
21769 " lvresize device mbytes\n"
21774 #: ../fish/guestfish-actions.pod:2584
21775 msgid "lvresize-free"
21779 #: ../fish/guestfish-actions.pod:2586
21782 " lvresize-free lv percent\n"
21787 #: ../fish/guestfish-actions.pod:2594
21792 #: ../fish/guestfish-actions.pod:2596
21800 #: ../fish/guestfish-actions.pod:2604
21801 msgid "See also L</lvs-full>, L</list-filesystems>."
21805 #: ../fish/guestfish-actions.pod:2606
21810 #: ../fish/guestfish-actions.pod:2608
21818 #: ../fish/guestfish-actions.pod:2613
21823 #: ../fish/guestfish-actions.pod:2615
21831 #: ../fish/guestfish-actions.pod:2619
21836 #: ../fish/guestfish-actions.pod:2621
21839 " lxattrlist path 'names ...'\n"
21844 #: ../fish/guestfish-actions.pod:2637
21846 "This call is intended for programs that want to efficiently list a directory "
21847 "contents without making many round-trips. See also L</lstatlist> for a "
21848 "similarly efficient call for getting standard stats. Very long directory "
21849 "listings might cause the protocol message size to be exceeded, causing this "
21850 "call to fail. The caller must split up such requests into smaller groups of "
21855 #: ../fish/guestfish-actions.pod:2645
21860 #: ../fish/guestfish-actions.pod:2647
21868 #: ../fish/guestfish-actions.pod:2651
21873 #: ../fish/guestfish-actions.pod:2653
21876 " mkdir-mode path mode\n"
21881 #: ../fish/guestfish-actions.pod:2662
21882 msgid "See also L</mkdir>, L</umask>"
21886 #: ../fish/guestfish-actions.pod:2664
21891 #: ../fish/guestfish-actions.pod:2666
21899 #: ../fish/guestfish-actions.pod:2671
21904 #: ../fish/guestfish-actions.pod:2673
21907 " mkdtemp template\n"
21912 #: ../fish/guestfish-actions.pod:2694
21917 #: ../fish/guestfish-actions.pod:2696
21920 " mke2fs-J fstype blocksize device journal\n"
21925 #: ../fish/guestfish-actions.pod:2704
21926 msgid "See also L</mke2journal>."
21930 #: ../fish/guestfish-actions.pod:2706
21935 #: ../fish/guestfish-actions.pod:2708
21938 " mke2fs-JL fstype blocksize device label\n"
21943 #: ../fish/guestfish-actions.pod:2713
21944 msgid "See also L</mke2journal-L>."
21948 #: ../fish/guestfish-actions.pod:2715
21953 #: ../fish/guestfish-actions.pod:2717
21956 " mke2fs-JU fstype blocksize device uuid\n"
21961 #: ../fish/guestfish-actions.pod:2722
21962 msgid "See also L</mke2journal-U>."
21966 #: ../fish/guestfish-actions.pod:2724
21967 msgid "mke2journal"
21971 #: ../fish/guestfish-actions.pod:2726
21974 " mke2journal blocksize device\n"
21979 #: ../fish/guestfish-actions.pod:2733
21980 msgid "mke2journal-L"
21984 #: ../fish/guestfish-actions.pod:2735
21987 " mke2journal-L blocksize label device\n"
21992 #: ../fish/guestfish-actions.pod:2739
21993 msgid "mke2journal-U"
21997 #: ../fish/guestfish-actions.pod:2741
22000 " mke2journal-U blocksize uuid device\n"
22005 #: ../fish/guestfish-actions.pod:2745
22010 #: ../fish/guestfish-actions.pod:2747
22013 " mkfifo mode path\n"
22018 #: ../fish/guestfish-actions.pod:2749
22020 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22021 "is just a convenient wrapper around L</mknod>."
22025 #: ../fish/guestfish-actions.pod:2755
22030 #: ../fish/guestfish-actions.pod:2757
22033 " mkfs fstype device\n"
22038 #: ../fish/guestfish-actions.pod:2763
22043 #: ../fish/guestfish-actions.pod:2765
22046 " mkfs-b fstype blocksize device\n"
22051 #: ../fish/guestfish-actions.pod:2767
22053 "This call is similar to L</mkfs>, but it allows you to control the block "
22054 "size of the resulting filesystem. Supported block sizes depend on the "
22055 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22059 #: ../fish/guestfish-actions.pod:2782
22064 #: ../fish/guestfish-actions.pod:2784
22067 " mkfs-opts fstype device [blocksize:..]\n"
22072 #: ../fish/guestfish-actions.pod:2806
22073 msgid "mkmountpoint"
22077 #: ../fish/guestfish-actions.pod:2808
22080 " mkmountpoint exemptpath\n"
22085 #: ../fish/guestfish-actions.pod:2810
22087 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22088 "to create extra mountpoints before mounting the first filesystem."
22092 #: ../fish/guestfish-actions.pod:2834
22094 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22095 "unexpected errors if you try to mix these calls. It is safest to manually "
22096 "unmount filesystems and remove mountpoints after use."
22100 #: ../fish/guestfish-actions.pod:2838
22102 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22103 "for this to work for manual mountpoints, you must ensure that the innermost "
22104 "mountpoints have the longest pathnames, as in the example code above."
22108 #: ../fish/guestfish-actions.pod:2845
22110 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22111 "that L</umount-all> is called when the handle is closed which can also "
22112 "trigger these issues."
22116 #: ../fish/guestfish-actions.pod:2849
22121 #: ../fish/guestfish-actions.pod:2851
22124 " mknod mode devmajor devminor path\n"
22129 #: ../fish/guestfish-actions.pod:2861
22131 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22132 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22133 "regular file). These constants are available in the standard Linux header "
22134 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22135 "wrappers around this command which bitwise OR in the appropriate constant "
22140 #: ../fish/guestfish-actions.pod:2871
22145 #: ../fish/guestfish-actions.pod:2873
22148 " mknod-b mode devmajor devminor path\n"
22153 #: ../fish/guestfish-actions.pod:2875
22155 "This call creates a block device node called C<path> with mode C<mode> and "
22156 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22157 "wrapper around L</mknod>."
22161 #: ../fish/guestfish-actions.pod:2881
22166 #: ../fish/guestfish-actions.pod:2883
22169 " mknod-c mode devmajor devminor path\n"
22174 #: ../fish/guestfish-actions.pod:2885
22176 "This call creates a char device node called C<path> with mode C<mode> and "
22177 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22178 "wrapper around L</mknod>."
22182 #: ../fish/guestfish-actions.pod:2891
22187 #: ../fish/guestfish-actions.pod:2893
22195 #: ../fish/guestfish-actions.pod:2897
22200 #: ../fish/guestfish-actions.pod:2899
22203 " mkswap-L label device\n"
22208 #: ../fish/guestfish-actions.pod:2907
22213 #: ../fish/guestfish-actions.pod:2909
22216 " mkswap-U uuid device\n"
22221 #: ../fish/guestfish-actions.pod:2913
22222 msgid "mkswap-file"
22226 #: ../fish/guestfish-actions.pod:2915
22229 " mkswap-file path\n"
22234 #: ../fish/guestfish-actions.pod:2919
22236 "This command just writes a swap file signature to an existing file. To "
22237 "create the file itself, use something like L</fallocate>."
22241 #: ../fish/guestfish-actions.pod:2922
22246 #: ../fish/guestfish-actions.pod:2924
22249 " modprobe modulename\n"
22254 #: ../fish/guestfish-actions.pod:2931
22259 #: ../fish/guestfish-actions.pod:2933
22262 " mount device mountpoint\n"
22267 #: ../fish/guestfish-actions.pod:2949
22269 "B<Important note:> When you use this call, the filesystem options C<sync> "
22270 "and C<noatime> are set implicitly. This was originally done because we "
22271 "thought it would improve reliability, but it turns out that I<-o sync> has a "
22272 "very large negative performance impact and negligible effect on "
22273 "reliability. Therefore we recommend that you avoid using L</mount> in any "
22274 "code that needs performance, and instead use L</mount-options> (use an empty "
22275 "string for the first parameter if you don't want any options)."
22279 #: ../fish/guestfish-actions.pod:2959
22284 #: ../fish/guestfish-actions.pod:2961
22287 " mount-loop file mountpoint\n"
22292 #: ../fish/guestfish-actions.pod:2967
22293 msgid "mount-options"
22297 #: ../fish/guestfish-actions.pod:2969
22300 " mount-options options device mountpoint\n"
22305 #: ../fish/guestfish-actions.pod:2971
22307 "This is the same as the L</mount> command, but it allows you to set the "
22308 "mount options as for the L<mount(8)> I<-o> flag."
22312 #: ../fish/guestfish-actions.pod:2979
22317 #: ../fish/guestfish-actions.pod:2981
22320 " mount-ro device mountpoint\n"
22325 #: ../fish/guestfish-actions.pod:2983
22327 "This is the same as the L</mount> command, but it mounts the filesystem with "
22328 "the read-only (I<-o ro>) flag."
22332 #: ../fish/guestfish-actions.pod:2986
22337 #: ../fish/guestfish-actions.pod:2988
22340 " mount-vfs options vfstype device mountpoint\n"
22345 #: ../fish/guestfish-actions.pod:2990
22347 "This is the same as the L</mount> command, but it allows you to set both the "
22348 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
22352 #: ../fish/guestfish-actions.pod:2994
22353 msgid "mountpoints"
22357 #: ../fish/guestfish-actions.pod:2996
22365 #: ../fish/guestfish-actions.pod:2998
22367 "This call is similar to L</mounts>. That call returns a list of devices. "
22368 "This one returns a hash table (map) of device name to directory where the "
22369 "device is mounted."
22373 #: ../fish/guestfish-actions.pod:3002
22378 #: ../fish/guestfish-actions.pod:3004
22386 #: ../fish/guestfish-actions.pod:3011
22387 msgid "See also: L</mountpoints>"
22391 #: ../fish/guestfish-actions.pod:3013
22396 #: ../fish/guestfish-actions.pod:3015
22404 #: ../fish/guestfish-actions.pod:3020
22405 msgid "ntfs-3g-probe"
22409 #: ../fish/guestfish-actions.pod:3022
22412 " ntfs-3g-probe true|false device\n"
22417 #: ../fish/guestfish-actions.pod:3036
22422 #: ../fish/guestfish-actions.pod:3038
22425 " ntfsresize device\n"
22430 #: ../fish/guestfish-actions.pod:3044
22431 msgid "ntfsresize-size"
22435 #: ../fish/guestfish-actions.pod:3046
22438 " ntfsresize-size device size\n"
22443 #: ../fish/guestfish-actions.pod:3048
22445 "This command is the same as L</ntfsresize> except that it allows you to "
22446 "specify the new size (in bytes) explicitly."
22450 #: ../fish/guestfish-actions.pod:3051
22455 #: ../fish/guestfish-actions.pod:3053
22458 " part-add device prlogex startsect endsect\n"
22463 #: ../fish/guestfish-actions.pod:3055
22465 "This command adds a partition to C<device>. If there is no partition table "
22466 "on the device, call L</part-init> first."
22470 #: ../fish/guestfish-actions.pod:3067
22472 "Creating a partition which covers the whole disk is not so easy. Use "
22473 "L</part-disk> to do that."
22477 #: ../fish/guestfish-actions.pod:3070
22482 #: ../fish/guestfish-actions.pod:3072
22485 " part-del device partnum\n"
22490 #: ../fish/guestfish-actions.pod:3080
22495 #: ../fish/guestfish-actions.pod:3082
22498 " part-disk device parttype\n"
22503 #: ../fish/guestfish-actions.pod:3084
22505 "This command is simply a combination of L</part-init> followed by "
22506 "L</part-add> to create a single primary partition covering the whole disk."
22510 #: ../fish/guestfish-actions.pod:3088
22512 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
22513 "possible values are described in L</part-init>."
22517 #: ../fish/guestfish-actions.pod:3094
22518 msgid "part-get-bootable"
22522 #: ../fish/guestfish-actions.pod:3096
22525 " part-get-bootable device partnum\n"
22530 #: ../fish/guestfish-actions.pod:3101
22531 msgid "See also L</part-set-bootable>."
22535 #: ../fish/guestfish-actions.pod:3103
22536 msgid "part-get-mbr-id"
22540 #: ../fish/guestfish-actions.pod:3105
22543 " part-get-mbr-id device partnum\n"
22548 #: ../fish/guestfish-actions.pod:3110 ../fish/guestfish-actions.pod:3248
22550 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
22551 "undefined results for other partition table types (see "
22552 "L</part-get-parttype>)."
22556 #: ../fish/guestfish-actions.pod:3114
22557 msgid "part-get-parttype"
22561 #: ../fish/guestfish-actions.pod:3116
22564 " part-get-parttype device\n"
22569 #: ../fish/guestfish-actions.pod:3121
22571 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
22572 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
22573 "possible, although unusual. See L</part-init> for a full list."
22577 #: ../fish/guestfish-actions.pod:3126
22582 #: ../fish/guestfish-actions.pod:3128
22585 " part-init device parttype\n"
22590 #: ../fish/guestfish-actions.pod:3134
22592 "Initially there are no partitions. Following this, you should call "
22593 "L</part-add> for each partition required."
22597 #: ../fish/guestfish-actions.pod:3197
22602 #: ../fish/guestfish-actions.pod:3199
22605 " part-list device\n"
22610 #: ../fish/guestfish-actions.pod:3214
22612 "Start of the partition I<in bytes>. To get sectors you have to divide by "
22613 "the device's sector size, see L</blockdev-getss>."
22617 #: ../fish/guestfish-actions.pod:3227
22618 msgid "part-set-bootable"
22622 #: ../fish/guestfish-actions.pod:3229
22625 " part-set-bootable device partnum true|false\n"
22630 #: ../fish/guestfish-actions.pod:3238
22631 msgid "part-set-mbr-id"
22635 #: ../fish/guestfish-actions.pod:3240
22638 " part-set-mbr-id device partnum idbyte\n"
22643 #: ../fish/guestfish-actions.pod:3252
22644 msgid "part-set-name"
22648 #: ../fish/guestfish-actions.pod:3254
22651 " part-set-name device partnum name\n"
22656 #: ../fish/guestfish-actions.pod:3262
22657 msgid "part-to-dev"
22661 #: ../fish/guestfish-actions.pod:3264
22664 " part-to-dev partition\n"
22669 #: ../fish/guestfish-actions.pod:3270
22671 "The named partition must exist, for example as a string returned from "
22672 "L</list-partitions>."
22676 #: ../fish/guestfish-actions.pod:3273
22677 msgid "ping-daemon"
22681 #: ../fish/guestfish-actions.pod:3275
22689 #: ../fish/guestfish-actions.pod:3282
22694 #: ../fish/guestfish-actions.pod:3284
22697 " pread path count offset\n"
22702 #: ../fish/guestfish-actions.pod:3292
22703 msgid "See also L</pwrite>, L</pread-device>."
22707 #: ../fish/guestfish-actions.pod:3297
22708 msgid "pread-device"
22712 #: ../fish/guestfish-actions.pod:3299
22715 " pread-device device count offset\n"
22720 #: ../fish/guestfish-actions.pod:3307
22721 msgid "See also L</pread>."
22725 #: ../fish/guestfish-actions.pod:3312
22730 #: ../fish/guestfish-actions.pod:3314
22733 " pvcreate device\n"
22738 #: ../fish/guestfish-actions.pod:3320
22743 #: ../fish/guestfish-actions.pod:3322
22746 " pvremove device\n"
22751 #: ../fish/guestfish-actions.pod:3331
22756 #: ../fish/guestfish-actions.pod:3333
22759 " pvresize device\n"
22764 #: ../fish/guestfish-actions.pod:3338
22765 msgid "pvresize-size"
22769 #: ../fish/guestfish-actions.pod:3340
22772 " pvresize-size device size\n"
22777 #: ../fish/guestfish-actions.pod:3342
22779 "This command is the same as L</pvresize> except that it allows you to "
22780 "specify the new size (in bytes) explicitly."
22784 #: ../fish/guestfish-actions.pod:3345
22789 #: ../fish/guestfish-actions.pod:3347
22797 #: ../fish/guestfish-actions.pod:3355
22798 msgid "See also L</pvs-full>."
22802 #: ../fish/guestfish-actions.pod:3357
22807 #: ../fish/guestfish-actions.pod:3359
22815 #: ../fish/guestfish-actions.pod:3364
22820 #: ../fish/guestfish-actions.pod:3366
22828 #: ../fish/guestfish-actions.pod:3370
22833 #: ../fish/guestfish-actions.pod:3372
22836 " pwrite path content offset\n"
22841 #: ../fish/guestfish-actions.pod:3383
22842 msgid "See also L</pread>, L</pwrite-device>."
22846 #: ../fish/guestfish-actions.pod:3388
22847 msgid "pwrite-device"
22851 #: ../fish/guestfish-actions.pod:3390
22854 " pwrite-device device content offset\n"
22859 #: ../fish/guestfish-actions.pod:3400
22860 msgid "See also L</pwrite>."
22864 #: ../fish/guestfish-actions.pod:3405
22869 #: ../fish/guestfish-actions.pod:3407
22872 " read-file path\n"
22877 #: ../fish/guestfish-actions.pod:3412
22879 "Unlike L</cat>, this function can correctly handle files that contain "
22880 "embedded ASCII NUL characters. However unlike L</download>, this function "
22881 "is limited in the total size of file that can be handled."
22885 #: ../fish/guestfish-actions.pod:3420
22890 #: ../fish/guestfish-actions.pod:3422
22893 " read-lines path\n"
22898 #: ../fish/guestfish-actions.pod:3429
22900 "Note that this function cannot correctly handle binary files (specifically, "
22901 "files containing C<\\0> character which is treated as end of line). For "
22902 "those you need to use the L</read-file> function which has a more complex "
22907 #: ../fish/guestfish-actions.pod:3434
22912 #: ../fish/guestfish-actions.pod:3436
22920 #: ../fish/guestfish-actions.pod:3488
22922 "This function is primarily intended for use by programs. To get a simple "
22923 "list of names, use L</ls>. To get a printable directory for human "
22924 "consumption, use L</ll>."
22928 #: ../fish/guestfish-actions.pod:3492
22933 #: ../fish/guestfish-actions.pod:3494
22941 #: ../fish/guestfish-actions.pod:3498
22942 msgid "readlinklist"
22946 #: ../fish/guestfish-actions.pod:3500
22949 " readlinklist path 'names ...'\n"
22954 #: ../fish/guestfish-actions.pod:3524
22959 #: ../fish/guestfish-actions.pod:3526
22967 #: ../fish/guestfish-actions.pod:3531
22968 msgid "removexattr"
22972 #: ../fish/guestfish-actions.pod:3533
22975 " removexattr xattr path\n"
22980 #: ../fish/guestfish-actions.pod:3538
22981 msgid "See also: L</lremovexattr>, L<attr(5)>."
22985 #: ../fish/guestfish-actions.pod:3540
22990 #: ../fish/guestfish-actions.pod:3542
22993 " resize2fs device\n"
22998 #: ../fish/guestfish-actions.pod:3547
23000 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23001 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23002 "gives an error about this and sometimes not. In any case, it is always safe "
23003 "to call L</e2fsck-f> before calling this function."
23007 #: ../fish/guestfish-actions.pod:3553
23008 msgid "resize2fs-size"
23012 #: ../fish/guestfish-actions.pod:3555
23015 " resize2fs-size device size\n"
23020 #: ../fish/guestfish-actions.pod:3557
23022 "This command is the same as L</resize2fs> except that it allows you to "
23023 "specify the new size (in bytes) explicitly."
23027 #: ../fish/guestfish-actions.pod:3560
23032 #: ../fish/guestfish-actions.pod:3562
23040 #: ../fish/guestfish-actions.pod:3566
23045 #: ../fish/guestfish-actions.pod:3568
23053 #: ../fish/guestfish-actions.pod:3574
23058 #: ../fish/guestfish-actions.pod:3576
23066 #: ../fish/guestfish-actions.pod:3580
23067 msgid "rmmountpoint"
23071 #: ../fish/guestfish-actions.pod:3582
23074 " rmmountpoint exemptpath\n"
23079 #: ../fish/guestfish-actions.pod:3584
23081 "This calls removes a mountpoint that was previously created with "
23082 "L</mkmountpoint>. See L</mkmountpoint> for full details."
23086 #: ../fish/guestfish-actions.pod:3588
23087 msgid "scrub-device"
23091 #: ../fish/guestfish-actions.pod:3590
23094 " scrub-device device\n"
23099 #: ../fish/guestfish-actions.pod:3601
23104 #: ../fish/guestfish-actions.pod:3603
23107 " scrub-file file\n"
23112 #: ../fish/guestfish-actions.pod:3613
23113 msgid "scrub-freespace"
23117 #: ../fish/guestfish-actions.pod:3615
23120 " scrub-freespace dir\n"
23125 #: ../fish/guestfish-actions.pod:3617
23127 "This command creates the directory C<dir> and then fills it with files until "
23128 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23129 "deletes them. The intention is to scrub any free space on the partition "
23130 "containing C<dir>."
23134 #: ../fish/guestfish-actions.pod:3626
23139 #: ../fish/guestfish-actions.pod:3628
23144 #: ../fish/guestfish-actions.pod:3630
23147 " set-append append\n"
23152 #: ../fish/guestfish-actions.pod:3641
23153 msgid "set-autosync"
23157 #: ../fish/guestfish-actions.pod:3643
23162 #: ../fish/guestfish-actions.pod:3645
23165 " set-autosync true|false\n"
23170 #: ../fish/guestfish-actions.pod:3647
23172 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
23173 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
23174 "closed (also if the program exits without closing handles)."
23178 #: ../fish/guestfish-actions.pod:3655
23183 #: ../fish/guestfish-actions.pod:3657
23188 #: ../fish/guestfish-actions.pod:3659
23191 " set-direct true|false\n"
23196 #: ../fish/guestfish-actions.pod:3665
23198 "One consequence of this is that log messages aren't caught by the library "
23199 "and handled by L</set-log-message-callback>, but go straight to stdout."
23203 #: ../fish/guestfish-actions.pod:3674
23204 msgid "set-e2label"
23208 #: ../fish/guestfish-actions.pod:3676
23211 " set-e2label device label\n"
23216 #: ../fish/guestfish-actions.pod:3682
23218 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
23219 "label on a filesystem."
23223 #: ../fish/guestfish-actions.pod:3685
23228 #: ../fish/guestfish-actions.pod:3687
23231 " set-e2uuid device uuid\n"
23236 #: ../fish/guestfish-actions.pod:3694
23238 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
23239 "UUID of a filesystem."
23243 #: ../fish/guestfish-actions.pod:3697
23244 msgid "set-memsize"
23248 #: ../fish/guestfish-actions.pod:3699
23253 #: ../fish/guestfish-actions.pod:3701
23256 " set-memsize memsize\n"
23261 #: ../fish/guestfish-actions.pod:3703
23263 "This sets the memory size in megabytes allocated to the qemu subprocess. "
23264 "This only has any effect if called before L</launch>."
23268 #: ../fish/guestfish-actions.pod:3714
23269 msgid "set-network"
23273 #: ../fish/guestfish-actions.pod:3716
23278 #: ../fish/guestfish-actions.pod:3718
23281 " set-network true|false\n"
23286 #: ../fish/guestfish-actions.pod:3726
23287 msgid "You must call this before calling L</launch>, otherwise it has no effect."
23291 #: ../fish/guestfish-actions.pod:3729
23296 #: ../fish/guestfish-actions.pod:3731
23301 #: ../fish/guestfish-actions.pod:3733
23304 " set-path searchpath\n"
23309 #: ../fish/guestfish-actions.pod:3742
23314 #: ../fish/guestfish-actions.pod:3744
23319 #: ../fish/guestfish-actions.pod:3746
23327 #: ../fish/guestfish-actions.pod:3766
23328 msgid "set-recovery-proc"
23332 #: ../fish/guestfish-actions.pod:3768
23333 msgid "recovery-proc"
23337 #: ../fish/guestfish-actions.pod:3770
23340 " set-recovery-proc true|false\n"
23345 #: ../fish/guestfish-actions.pod:3772
23347 "If this is called with the parameter C<false> then L</launch> does not "
23348 "create a recovery process. The purpose of the recovery process is to stop "
23349 "runaway qemu processes in the case where the main program aborts abruptly."
23353 #: ../fish/guestfish-actions.pod:3777
23355 "This only has any effect if called before L</launch>, and the default is "
23360 #: ../fish/guestfish-actions.pod:3786
23361 msgid "set-selinux"
23365 #: ../fish/guestfish-actions.pod:3788
23370 #: ../fish/guestfish-actions.pod:3790
23373 " set-selinux true|false\n"
23378 #: ../fish/guestfish-actions.pod:3801
23383 #: ../fish/guestfish-actions.pod:3803
23388 #: ../fish/guestfish-actions.pod:3805
23391 " set-trace true|false\n"
23396 #: ../fish/guestfish-actions.pod:3821
23397 msgid "set-verbose"
23401 #: ../fish/guestfish-actions.pod:3823
23406 #: ../fish/guestfish-actions.pod:3825
23409 " set-verbose true|false\n"
23414 #: ../fish/guestfish-actions.pod:3832
23419 #: ../fish/guestfish-actions.pod:3834
23422 " setcon context\n"
23427 #: ../fish/guestfish-actions.pod:3841
23432 #: ../fish/guestfish-actions.pod:3843
23435 " setxattr xattr val vallen path\n"
23440 #: ../fish/guestfish-actions.pod:3849
23441 msgid "See also: L</lsetxattr>, L<attr(5)>."
23445 #: ../fish/guestfish-actions.pod:3851
23450 #: ../fish/guestfish-actions.pod:3853
23453 " sfdisk device cyls heads sectors 'lines ...'\n"
23458 #: ../fish/guestfish-actions.pod:3875
23459 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
23463 #: ../fish/guestfish-actions.pod:3881
23468 #: ../fish/guestfish-actions.pod:3883
23471 " sfdiskM device 'lines ...'\n"
23476 #: ../fish/guestfish-actions.pod:3885
23478 "This is a simplified interface to the L</sfdisk> command, where partition "
23479 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
23480 "you don't need to specify the cyls, heads and sectors parameters which were "
23481 "rarely if ever used anyway."
23485 #: ../fish/guestfish-actions.pod:3891
23486 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
23490 #: ../fish/guestfish-actions.pod:3897
23495 #: ../fish/guestfish-actions.pod:3899
23498 " sfdisk-N device partnum cyls heads sectors line\n"
23503 #: ../fish/guestfish-actions.pod:3904
23505 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
23506 "cyls/heads/sectors parameters."
23510 #: ../fish/guestfish-actions.pod:3907
23511 msgid "See also: L</part-add>"
23515 #: ../fish/guestfish-actions.pod:3912
23516 msgid "sfdisk-disk-geometry"
23520 #: ../fish/guestfish-actions.pod:3914
23523 " sfdisk-disk-geometry device\n"
23528 #: ../fish/guestfish-actions.pod:3916
23530 "This displays the disk geometry of C<device> read from the partition table. "
23531 "Especially in the case where the underlying block device has been resized, "
23532 "this can be different from the kernel's idea of the geometry (see "
23533 "L</sfdisk-kernel-geometry>)."
23537 #: ../fish/guestfish-actions.pod:3924
23538 msgid "sfdisk-kernel-geometry"
23542 #: ../fish/guestfish-actions.pod:3926
23545 " sfdisk-kernel-geometry device\n"
23550 #: ../fish/guestfish-actions.pod:3933
23555 #: ../fish/guestfish-actions.pod:3935
23558 " sfdisk-l device\n"
23563 #: ../fish/guestfish-actions.pod:3941
23564 msgid "See also: L</part-list>"
23568 #: ../fish/guestfish-actions.pod:3943
23573 #: ../fish/guestfish-actions.pod:3945
23581 #: ../fish/guestfish-actions.pod:3950
23582 msgid "This is like L</command>, but passes the command to:"
23586 #: ../fish/guestfish-actions.pod:3958
23587 msgid "All the provisos about L</command> apply to this call."
23591 #: ../fish/guestfish-actions.pod:3960
23596 #: ../fish/guestfish-actions.pod:3962
23599 " sh-lines command\n"
23604 #: ../fish/guestfish-actions.pod:3964
23605 msgid "This is the same as L</sh>, but splits the result into a list of lines."
23609 #: ../fish/guestfish-actions.pod:3967
23610 msgid "See also: L</command-lines>"
23614 #: ../fish/guestfish-actions.pod:3969
23619 #: ../fish/guestfish-actions.pod:3971
23627 #: ../fish/guestfish-actions.pod:3975
23632 #: ../fish/guestfish-actions.pod:3977
23640 #: ../fish/guestfish-actions.pod:3983
23645 #: ../fish/guestfish-actions.pod:3985
23653 #: ../fish/guestfish-actions.pod:3993
23658 #: ../fish/guestfish-actions.pod:3995
23666 #: ../fish/guestfish-actions.pod:4003
23671 #: ../fish/guestfish-actions.pod:4005
23674 " strings-e encoding path\n"
23679 #: ../fish/guestfish-actions.pod:4007
23681 "This is like the L</strings> command, but allows you to specify the encoding "
23682 "of strings that are looked for in the source file C<path>."
23686 #: ../fish/guestfish-actions.pod:4017
23688 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
23689 "ISO-8859-X (this is what L</strings> uses)."
23693 #: ../fish/guestfish-actions.pod:4049
23694 msgid "swapoff-device"
23698 #: ../fish/guestfish-actions.pod:4051
23701 " swapoff-device device\n"
23706 #: ../fish/guestfish-actions.pod:4053
23708 "This command disables the libguestfs appliance swap device or partition "
23709 "named C<device>. See L</swapon-device>."
23713 #: ../fish/guestfish-actions.pod:4057
23714 msgid "swapoff-file"
23718 #: ../fish/guestfish-actions.pod:4059
23721 " swapoff-file file\n"
23726 #: ../fish/guestfish-actions.pod:4063
23727 msgid "swapoff-label"
23731 #: ../fish/guestfish-actions.pod:4065
23734 " swapoff-label label\n"
23739 #: ../fish/guestfish-actions.pod:4070
23740 msgid "swapoff-uuid"
23744 #: ../fish/guestfish-actions.pod:4072
23747 " swapoff-uuid uuid\n"
23752 #: ../fish/guestfish-actions.pod:4077
23753 msgid "swapon-device"
23757 #: ../fish/guestfish-actions.pod:4079
23760 " swapon-device device\n"
23765 #: ../fish/guestfish-actions.pod:4081
23767 "This command enables the libguestfs appliance to use the swap device or "
23768 "partition named C<device>. The increased memory is made available for all "
23769 "commands, for example those run using L</command> or L</sh>."
23773 #: ../fish/guestfish-actions.pod:4093
23774 msgid "swapon-file"
23778 #: ../fish/guestfish-actions.pod:4095
23781 " swapon-file file\n"
23786 #: ../fish/guestfish-actions.pod:4097
23787 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
23791 #: ../fish/guestfish-actions.pod:4100
23792 msgid "swapon-label"
23796 #: ../fish/guestfish-actions.pod:4102
23799 " swapon-label label\n"
23804 #: ../fish/guestfish-actions.pod:4104
23806 "This command enables swap to a labeled swap partition. See "
23807 "L</swapon-device> for other notes."
23811 #: ../fish/guestfish-actions.pod:4107
23812 msgid "swapon-uuid"
23816 #: ../fish/guestfish-actions.pod:4109
23819 " swapon-uuid uuid\n"
23824 #: ../fish/guestfish-actions.pod:4111
23826 "This command enables swap to a swap partition with the given UUID. See "
23827 "L</swapon-device> for other notes."
23831 #: ../fish/guestfish-actions.pod:4114
23836 #: ../fish/guestfish-actions.pod:4116
23844 #: ../fish/guestfish-actions.pod:4124
23849 #: ../fish/guestfish-actions.pod:4126
23857 #: ../fish/guestfish-actions.pod:4134
23862 #: ../fish/guestfish-actions.pod:4136
23865 " tail-n nrlines path\n"
23870 #: ../fish/guestfish-actions.pod:4149
23875 #: ../fish/guestfish-actions.pod:4151
23878 " tar-in (tarfile|-) directory\n"
23883 #: ../fish/guestfish-actions.pod:4156
23884 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
23888 #: ../fish/guestfish-actions.pod:4161
23893 #: ../fish/guestfish-actions.pod:4163
23896 " tar-out directory (tarfile|-)\n"
23901 #: ../fish/guestfish-actions.pod:4168
23902 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
23906 #: ../fish/guestfish-actions.pod:4173
23911 #: ../fish/guestfish-actions.pod:4175
23914 " tgz-in (tarball|-) directory\n"
23919 #: ../fish/guestfish-actions.pod:4180
23920 msgid "To upload an uncompressed tarball, use L</tar-in>."
23924 #: ../fish/guestfish-actions.pod:4184
23929 #: ../fish/guestfish-actions.pod:4186
23932 " tgz-out directory (tarball|-)\n"
23937 #: ../fish/guestfish-actions.pod:4191
23938 msgid "To download an uncompressed tarball, use L</tar-out>."
23942 #: ../fish/guestfish-actions.pod:4195
23947 #: ../fish/guestfish-actions.pod:4197
23955 #: ../fish/guestfish-actions.pod:4206
23960 #: ../fish/guestfish-actions.pod:4208
23968 #: ../fish/guestfish-actions.pod:4213
23969 msgid "truncate-size"
23973 #: ../fish/guestfish-actions.pod:4215
23976 " truncate-size path size\n"
23981 #: ../fish/guestfish-actions.pod:4220
23983 "If the current file size is less than C<size> then the file is extended to "
23984 "the required size with zero bytes. This creates a sparse file (ie. disk "
23985 "blocks are not allocated for the file until you write to it). To create a "
23986 "non-sparse file of zeroes, use L</fallocate64> instead."
23990 #: ../fish/guestfish-actions.pod:4226
23995 #: ../fish/guestfish-actions.pod:4228
23998 " tune2fs-l device\n"
24003 #: ../fish/guestfish-actions.pod:4238
24008 #: ../fish/guestfish-actions.pod:4240
24011 " txz-in (tarball|-) directory\n"
24016 #: ../fish/guestfish-actions.pod:4247
24021 #: ../fish/guestfish-actions.pod:4249
24024 " txz-out directory (tarball|-)\n"
24029 #: ../fish/guestfish-actions.pod:4256
24034 #: ../fish/guestfish-actions.pod:4258
24042 #: ../fish/guestfish-actions.pod:4272
24043 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24047 #: ../fish/guestfish-actions.pod:4277
24052 #: ../fish/guestfish-actions.pod:4279
24057 #: ../fish/guestfish-actions.pod:4281
24060 " umount pathordevice\n"
24065 #: ../fish/guestfish-actions.pod:4287
24070 #: ../fish/guestfish-actions.pod:4289
24071 msgid "unmount-all"
24075 #: ../fish/guestfish-actions.pod:4291
24083 #: ../fish/guestfish-actions.pod:4297
24088 #: ../fish/guestfish-actions.pod:4299
24091 " upload (filename|-) remotefilename\n"
24096 #: ../fish/guestfish-actions.pod:4306
24097 msgid "See also L</download>."
24101 #: ../fish/guestfish-actions.pod:4310
24102 msgid "upload-offset"
24106 #: ../fish/guestfish-actions.pod:4312
24109 " upload-offset (filename|-) remotefilename offset\n"
24114 #: ../fish/guestfish-actions.pod:4324
24116 "Note that there is no limit on the amount of data that can be uploaded with "
24117 "this call, unlike with L</pwrite>, and this call always writes the full "
24118 "amount unless an error occurs."
24122 #: ../fish/guestfish-actions.pod:4329
24123 msgid "See also L</upload>, L</pwrite>."
24127 #: ../fish/guestfish-actions.pod:4333
24132 #: ../fish/guestfish-actions.pod:4335
24135 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24140 #: ../fish/guestfish-actions.pod:4354
24145 #: ../fish/guestfish-actions.pod:4356
24153 #: ../fish/guestfish-actions.pod:4383
24155 "I<Note:> Don't use this call to test for availability of features. In "
24156 "enterprise distributions we backport features from later versions into "
24157 "earlier versions, making this an unreliable way to test for features. Use "
24158 "L</available> instead."
24162 #: ../fish/guestfish-actions.pod:4389
24167 #: ../fish/guestfish-actions.pod:4391
24170 " vfs-label device\n"
24175 #: ../fish/guestfish-actions.pod:4398
24176 msgid "To find a filesystem from the label, use L</findfs-label>."
24180 #: ../fish/guestfish-actions.pod:4400
24185 #: ../fish/guestfish-actions.pod:4402
24188 " vfs-type device\n"
24193 #: ../fish/guestfish-actions.pod:4412
24198 #: ../fish/guestfish-actions.pod:4414
24201 " vfs-uuid device\n"
24206 #: ../fish/guestfish-actions.pod:4421
24207 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
24211 #: ../fish/guestfish-actions.pod:4423
24212 msgid "vg-activate"
24216 #: ../fish/guestfish-actions.pod:4425
24219 " vg-activate true|false 'volgroups ...'\n"
24224 #: ../fish/guestfish-actions.pod:4438
24225 msgid "vg-activate-all"
24229 #: ../fish/guestfish-actions.pod:4440
24232 " vg-activate-all true|false\n"
24237 #: ../fish/guestfish-actions.pod:4450
24242 #: ../fish/guestfish-actions.pod:4452
24245 " vgcreate volgroup 'physvols ...'\n"
24250 #: ../fish/guestfish-actions.pod:4457
24255 #: ../fish/guestfish-actions.pod:4459
24258 " vglvuuids vgname\n"
24263 #: ../fish/guestfish-actions.pod:4464
24265 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
24266 "logical volumes and volume groups."
24270 #: ../fish/guestfish-actions.pod:4467
24271 msgid "See also L</vgpvuuids>."
24275 #: ../fish/guestfish-actions.pod:4469
24280 #: ../fish/guestfish-actions.pod:4471
24283 " vgpvuuids vgname\n"
24288 #: ../fish/guestfish-actions.pod:4476
24290 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
24291 "physical volumes and volume groups."
24295 #: ../fish/guestfish-actions.pod:4479
24296 msgid "See also L</vglvuuids>."
24300 #: ../fish/guestfish-actions.pod:4481
24305 #: ../fish/guestfish-actions.pod:4483
24308 " vgremove vgname\n"
24313 #: ../fish/guestfish-actions.pod:4490
24318 #: ../fish/guestfish-actions.pod:4492
24321 " vgrename volgroup newvolgroup\n"
24326 #: ../fish/guestfish-actions.pod:4496
24331 #: ../fish/guestfish-actions.pod:4498
24339 #: ../fish/guestfish-actions.pod:4506
24340 msgid "See also L</vgs-full>."
24344 #: ../fish/guestfish-actions.pod:4508
24349 #: ../fish/guestfish-actions.pod:4510
24357 #: ../fish/guestfish-actions.pod:4515
24362 #: ../fish/guestfish-actions.pod:4517
24370 #: ../fish/guestfish-actions.pod:4522
24375 #: ../fish/guestfish-actions.pod:4524
24383 #: ../fish/guestfish-actions.pod:4528
24388 #: ../fish/guestfish-actions.pod:4530
24396 #: ../fish/guestfish-actions.pod:4535
24401 #: ../fish/guestfish-actions.pod:4537
24409 #: ../fish/guestfish-actions.pod:4542
24414 #: ../fish/guestfish-actions.pod:4544
24422 #: ../fish/guestfish-actions.pod:4549
24427 #: ../fish/guestfish-actions.pod:4551
24430 " write path content\n"
24435 #: ../fish/guestfish-actions.pod:4559
24440 #: ../fish/guestfish-actions.pod:4561
24443 " write-file path content size\n"
24448 #: ../fish/guestfish-actions.pod:4584
24453 #: ../fish/guestfish-actions.pod:4586
24456 " zegrep regex path\n"
24461 #: ../fish/guestfish-actions.pod:4594
24466 #: ../fish/guestfish-actions.pod:4596
24469 " zegrepi regex path\n"
24474 #: ../fish/guestfish-actions.pod:4604
24479 #: ../fish/guestfish-actions.pod:4606
24487 #: ../fish/guestfish-actions.pod:4614
24488 msgid "See also: L</zero-device>, L</scrub-device>."
24492 #: ../fish/guestfish-actions.pod:4616
24493 msgid "zero-device"
24497 #: ../fish/guestfish-actions.pod:4618
24500 " zero-device device\n"
24505 #: ../fish/guestfish-actions.pod:4620
24507 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
24508 "which just zeroes the first few blocks of a device."
24512 #: ../fish/guestfish-actions.pod:4627
24517 #: ../fish/guestfish-actions.pod:4629
24520 " zerofree device\n"
24525 #: ../fish/guestfish-actions.pod:4642
24530 #: ../fish/guestfish-actions.pod:4644
24533 " zfgrep pattern path\n"
24538 #: ../fish/guestfish-actions.pod:4652
24543 #: ../fish/guestfish-actions.pod:4654
24546 " zfgrepi pattern path\n"
24551 #: ../fish/guestfish-actions.pod:4662
24556 #: ../fish/guestfish-actions.pod:4664
24559 " zfile meth path\n"
24564 #: ../fish/guestfish-actions.pod:4671
24565 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
24569 #: ../fish/guestfish-actions.pod:4681
24574 #: ../fish/guestfish-actions.pod:4683
24577 " zgrep regex path\n"
24582 #: ../fish/guestfish-actions.pod:4691
24587 #: ../fish/guestfish-actions.pod:4693
24590 " zgrepi regex path\n"
24595 #: ../fish/guestfish-commands.pod:1
24600 #: ../fish/guestfish-commands.pod:3
24605 #: ../fish/guestfish-commands.pod:5
24608 " alloc filename size\n"
24613 #: ../fish/guestfish-commands.pod:7
24615 "This creates an empty (zeroed) file of the given size, and then adds so it "
24616 "can be further examined."
24620 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
24621 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
24625 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
24626 msgid "Size can be specified using standard suffixes, eg. C<1M>."
24630 #: ../fish/guestfish-commands.pod:14
24632 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
24633 "image, see L</PREPARED DISK IMAGES>."
24637 #: ../fish/guestfish-commands.pod:17
24642 #: ../fish/guestfish-commands.pod:19
24645 " copy-in local [local ...] /remotedir\n"
24650 #: ../fish/guestfish-commands.pod:21
24652 "C<copy-in> copies local files or directories recursively into the disk "
24653 "image, placing them in the directory called C</remotedir> (which must "
24654 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
24655 "other commands as necessary."
24659 #: ../fish/guestfish-commands.pod:26
24661 "Multiple local files and directories can be specified, but the last "
24662 "parameter must always be a remote directory. Wildcards cannot be used."
24666 #: ../fish/guestfish-commands.pod:30
24671 #: ../fish/guestfish-commands.pod:32
24674 " copy-out remote [remote ...] localdir\n"
24679 #: ../fish/guestfish-commands.pod:34
24681 "C<copy-out> copies remote files or directories recursively out of the disk "
24682 "image, placing them on the host disk in a local directory called C<localdir> "
24683 "(which must exist). This guestfish meta-command turns into a sequence of "
24684 "L</download>, L</tar-out> and other commands as necessary."
24688 #: ../fish/guestfish-commands.pod:40
24690 "Multiple remote files and directories can be specified, but the last "
24691 "parameter must always be a local directory. To download to the current "
24692 "directory, use C<.> as in:"
24696 #: ../fish/guestfish-commands.pod:44
24699 " copy-out /home .\n"
24704 #: ../fish/guestfish-commands.pod:46
24706 "Wildcards cannot be used in the ordinary command, but you can use them with "
24707 "the help of L</glob> like this:"
24711 #: ../fish/guestfish-commands.pod:49
24714 " glob copy-out /home/* .\n"
24719 #: ../fish/guestfish-commands.pod:51
24724 #: ../fish/guestfish-commands.pod:53
24727 " echo [params ...]\n"
24732 #: ../fish/guestfish-commands.pod:55
24733 msgid "This echos the parameters to the terminal."
24737 #: ../fish/guestfish-commands.pod:57
24742 #: ../fish/guestfish-commands.pod:59
24747 #: ../fish/guestfish-commands.pod:61
24752 #: ../fish/guestfish-commands.pod:63
24760 #: ../fish/guestfish-commands.pod:65
24762 "This is used to edit a file. It downloads the file, edits it locally using "
24763 "your editor, then uploads the result."
24767 #: ../fish/guestfish-commands.pod:68
24769 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
24770 "or C<emacs> you will get those corresponding editors."
24774 #: ../fish/guestfish-commands.pod:72
24779 #: ../fish/guestfish-commands.pod:74
24782 " glob command args...\n"
24787 #: ../fish/guestfish-commands.pod:76
24789 "Expand wildcards in any paths in the args list, and run C<command> "
24790 "repeatedly on each matching path."
24794 #: ../fish/guestfish-commands.pod:79
24795 msgid "See L</WILDCARDS AND GLOBBING>."
24799 #: ../fish/guestfish-commands.pod:81
24804 #: ../fish/guestfish-commands.pod:83
24807 " hexedit <filename|device>\n"
24808 " hexedit <filename|device> <max>\n"
24809 " hexedit <filename|device> <start> <max>\n"
24814 #: ../fish/guestfish-commands.pod:87
24816 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
24821 #: ../fish/guestfish-commands.pod:90
24823 "This command works by downloading potentially the whole file or device, "
24824 "editing it locally, then uploading it. If the file or device is large, you "
24825 "have to specify which part you wish to edit by using C<max> and/or C<start> "
24826 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
24827 "usual modifiers allowed such as C<1M> (1 megabyte)."
24831 #: ../fish/guestfish-commands.pod:97
24832 msgid "For example to edit the first few sectors of a disk you might do:"
24836 #: ../fish/guestfish-commands.pod:100
24839 " hexedit /dev/sda 1M\n"
24844 #: ../fish/guestfish-commands.pod:102
24846 "which would allow you to edit anywhere within the first megabyte of the "
24851 #: ../fish/guestfish-commands.pod:105
24852 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
24856 #: ../fish/guestfish-commands.pod:107
24859 " hexedit /dev/sda1 0x400 0x400\n"
24864 #: ../fish/guestfish-commands.pod:109
24865 msgid "(assuming the superblock is in the standard location)."
24869 #: ../fish/guestfish-commands.pod:111
24871 "This command requires the external L<hexedit(1)> program. You can specify "
24872 "another program to use by setting the C<HEXEDITOR> environment variable."
24876 #: ../fish/guestfish-commands.pod:115
24877 msgid "See also L</hexdump>."
24881 #: ../fish/guestfish-commands.pod:117
24886 #: ../fish/guestfish-commands.pod:119
24894 #: ../fish/guestfish-commands.pod:121
24895 msgid "Change the local directory, ie. the current directory of guestfish itself."
24899 #: ../fish/guestfish-commands.pod:124
24900 msgid "Note that C<!cd> won't do what you might expect."
24904 #: ../fish/guestfish-commands.pod:126
24909 #: ../fish/guestfish-commands.pod:128
24914 #: ../fish/guestfish-commands.pod:130
24922 #: ../fish/guestfish-commands.pod:132
24923 msgid "Opens the manual page for guestfish."
24927 #: ../fish/guestfish-commands.pod:134
24932 #: ../fish/guestfish-commands.pod:136
24937 #: ../fish/guestfish-commands.pod:138
24945 #: ../fish/guestfish-commands.pod:140
24953 #: ../fish/guestfish-commands.pod:142
24954 msgid "This is used to view a file."
24958 #: ../fish/guestfish-commands.pod:144
24960 "The default viewer is C<$PAGER>. However if you use the alternate command "
24961 "C<less> you will get the C<less> command specifically."
24965 #: ../fish/guestfish-commands.pod:147
24970 #: ../fish/guestfish-commands.pod:149
24978 #: ../fish/guestfish-commands.pod:151
24980 "Close and reopen the libguestfs handle. It is not necessary to use this "
24981 "normally, because the handle is closed properly when guestfish exits. "
24982 "However this is occasionally useful for testing."
24986 #: ../fish/guestfish-commands.pod:155
24991 #: ../fish/guestfish-commands.pod:157
24994 " sparse filename size\n"
24999 #: ../fish/guestfish-commands.pod:159
25001 "This creates an empty sparse file of the given size, and then adds so it can "
25002 "be further examined."
25006 #: ../fish/guestfish-commands.pod:162
25008 "In all respects it works the same as the L</alloc> command, except that the "
25009 "image file is allocated sparsely, which means that disk blocks are not "
25010 "assigned to the file until they are needed. Sparse disk files only use "
25011 "space when written to, but they are slower and there is a danger you could "
25012 "run out of real disk space during a write operation."
25016 #: ../fish/guestfish-commands.pod:172
25021 #: ../fish/guestfish-commands.pod:174
25029 #: ../fish/guestfish-commands.pod:176
25031 "This command returns a list of the optional groups known to the daemon, and "
25032 "indicates which ones are supported by this build of the libguestfs "
25037 #: ../fish/guestfish-commands.pod:180
25038 msgid "See also L<guestfs(3)/AVAILABILITY>."
25042 #: ../fish/guestfish-commands.pod:182
25047 #: ../fish/guestfish-commands.pod:184
25050 " time command args...\n"
25055 #: ../fish/guestfish-commands.pod:186
25057 "Run the command as usual, but print the elapsed time afterwards. This can "
25058 "be useful for benchmarking operations."
25062 #: ../test-tool/libguestfs-test-tool.pod:5
25063 msgid "libguestfs-test-tool - End user tests for libguestfs"
25067 #: ../test-tool/libguestfs-test-tool.pod:9
25070 " libguestfs-test-tool [--options]\n"
25075 #: ../test-tool/libguestfs-test-tool.pod:13
25077 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25078 "and developers, to allow them to check basic libguestfs functionality is "
25079 "working. This is needed because libguestfs occasionally breaks for reasons "
25080 "beyond our control: usually because of changes in the underlying qemu or "
25081 "kernel packages, or the host environment."
25085 #: ../test-tool/libguestfs-test-tool.pod:20
25086 msgid "If you suspect a problem in libguestfs, then just run:"
25090 #: ../test-tool/libguestfs-test-tool.pod:22
25093 " libguestfs-test-tool\n"
25098 #: ../test-tool/libguestfs-test-tool.pod:24
25099 msgid "It will print lots of diagnostic messages."
25103 #: ../test-tool/libguestfs-test-tool.pod:26
25104 msgid "If it runs to completion successfully, you will see this near the end:"
25108 #: ../test-tool/libguestfs-test-tool.pod:28
25111 " ===== TEST FINISHED OK =====\n"
25116 #: ../test-tool/libguestfs-test-tool.pod:30
25117 msgid "and the test tool will exit with code 0."
25121 #: ../test-tool/libguestfs-test-tool.pod:32
25123 "If it fails (and/or exits with non-zero error code), please paste the "
25124 "B<complete, unedited> output of the test tool into a bug report. More "
25125 "information about reporting bugs can be found on the "
25126 "L<http://libguestfs.org/> website."
25130 #: ../test-tool/libguestfs-test-tool.pod:41
25135 #: ../test-tool/libguestfs-test-tool.pod:43
25136 msgid "Display short usage information and exit."
25140 #: ../test-tool/libguestfs-test-tool.pod:45
25141 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
25145 #: ../test-tool/libguestfs-test-tool.pod:47
25147 "Pass an alternate name for the helper program. libguestfs-test-tool will "
25148 "normally look in the C<$libexec> directory that was configured when the tool "
25153 #: ../test-tool/libguestfs-test-tool.pod:51
25154 msgid "I<--qemu qemu_binary>"
25158 #: ../test-tool/libguestfs-test-tool.pod:53
25160 "If you have downloaded another qemu binary, point this option at the full "
25161 "path of the binary to try it."
25165 #: ../test-tool/libguestfs-test-tool.pod:56
25166 msgid "I<--qemudir qemu_source_dir>"
25170 #: ../test-tool/libguestfs-test-tool.pod:58
25172 "If you have compiled qemu from source, point this option at the source "
25173 "directory to try it."
25177 #: ../test-tool/libguestfs-test-tool.pod:61
25178 msgid "I<--timeout N>"
25182 #: ../test-tool/libguestfs-test-tool.pod:63
25184 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
25185 "does not usually need to be adjusted unless your machine is very slow."
25189 #: ../test-tool/libguestfs-test-tool.pod:69
25190 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
25194 #: ../test-tool/libguestfs-test-tool.pod:71
25196 "If you have compiled another version of qemu from source and would like to "
25197 "try that, then you can use the I<--qemudir> option to point to the qemu "
25198 "source directory."
25202 #: ../test-tool/libguestfs-test-tool.pod:75
25204 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
25205 "option to point to the binary."
25209 #: ../test-tool/libguestfs-test-tool.pod:78
25211 "When using an alternate qemu with libguestfs, usually you would need to "
25212 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
25213 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
25214 "when you use either of the I<--qemudir> or I<--qemu> options."
25218 #: ../test-tool/libguestfs-test-tool.pod:85
25220 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
25221 "I<1> if there was an error."
25225 #: ../test-tool/libguestfs-test-tool.pod:92
25226 msgid "/usr/libexec/libguestfs-test-tool-helper"
25230 #: ../test-tool/libguestfs-test-tool.pod:94
25232 "This helper program is run inside the appliance and provides additional "
25237 #: ../test-tool/libguestfs-test-tool.pod:97
25238 msgid "/usr/bin/mkisofs"
25242 #: ../test-tool/libguestfs-test-tool.pod:99
25244 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
25245 "which is used as part of the tests."
25249 #: ../test-tool/libguestfs-test-tool.pod:106
25251 "For the full list of environment variables which may affect libguestfs, "
25252 "please see the L<guestfs(3)> manual page."
25256 #: ../test-tool/libguestfs-test-tool.pod:111
25257 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
25261 #: ../test-tool/libguestfs-test-tool.pod:121
25262 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
25266 #: ../fuse/guestmount.pod:5
25267 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
25271 #: ../fuse/guestmount.pod:9
25274 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
25279 #: ../fuse/guestmount.pod:11
25282 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
25287 #: ../fuse/guestmount.pod:13
25290 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
25295 #: ../fuse/guestmount.pod:17
25297 "You must I<not> use C<guestmount> in read-write mode on live virtual "
25298 "machines. If you do this, you risk disk corruption in the VM."
25302 #: ../fuse/guestmount.pod:22
25304 "The guestmount program can be used to mount virtual machine filesystems and "
25305 "other disk images on the host. It uses libguestfs for access to the guest "
25306 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
25307 "a mountable device."
25311 #: ../fuse/guestmount.pod:27
25313 "Along with other options, you have to give at least one device (I<-a> "
25314 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
25315 "option) or use the I<-i> inspection option. How this works is better "
25316 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
25321 #: ../fuse/guestmount.pod:33
25323 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
25324 "by you, and the filesystem will not be visible to any other users unless you "
25325 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
25326 "the filesystem, use the C<fusermount -u> command."
25330 #: ../fuse/guestmount.pod:41
25332 "For a typical Windows guest which has its main filesystem on the first "
25337 #: ../fuse/guestmount.pod:44
25340 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
25345 #: ../fuse/guestmount.pod:46
25347 "For a typical Linux guest which has a /boot filesystem on the first "
25348 "partition, and the root filesystem on a logical volume:"
25352 #: ../fuse/guestmount.pod:49
25355 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
25360 #: ../fuse/guestmount.pod:51
25361 msgid "To get libguestfs to detect guest mountpoints for you:"
25365 #: ../fuse/guestmount.pod:53
25368 " guestmount -a guest.img -i --ro /mnt\n"
25373 #: ../fuse/guestmount.pod:55
25374 msgid "For a libvirt guest called \"Guest\" you could do:"
25378 #: ../fuse/guestmount.pod:57
25381 " guestmount -d Guest -i --ro /mnt\n"
25386 #: ../fuse/guestmount.pod:59
25388 "If you don't know what filesystems are contained in a guest or disk image, "
25389 "use L<virt-filesystems(1)> first:"
25393 #: ../fuse/guestmount.pod:62
25396 " virt-filesystems MyGuest\n"
25401 #: ../fuse/guestmount.pod:64
25403 "If you want to trace the libguestfs calls but without excessive debugging "
25404 "information, we recommend:"
25408 #: ../fuse/guestmount.pod:67
25411 " guestmount [...] --trace /mnt\n"
25416 #: ../fuse/guestmount.pod:69
25417 msgid "If you want to debug the program, we recommend:"
25421 #: ../fuse/guestmount.pod:71
25424 " guestmount [...] --trace --verbose /mnt\n"
25429 #: ../fuse/guestmount.pod:79
25430 msgid "Add a block device or virtual machine image."
25434 #: ../fuse/guestmount.pod:96
25435 msgid "B<--dir-cache-timeout N>"
25439 #: ../fuse/guestmount.pod:98
25441 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
25442 "seconds. The readdir cache [actually, there are several semi-independent "
25443 "caches] is populated after a readdir(2) call with the stat and extended "
25444 "attributes of the files in the directory, in anticipation that they will be "
25445 "requested soon after."
25449 #: ../fuse/guestmount.pod:104
25451 "There is also a different attribute cache implemented by FUSE (see the FUSE "
25452 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
25453 "requests, only cache existing ones."
25457 #: ../fuse/guestmount.pod:122
25459 "If you have untrusted raw-format guest disk images, you should use this "
25460 "option to specify the disk format. This avoids a possible security problem "
25461 "with malicious guests (CVE-2010-3851). See also "
25462 "L<guestfs(3)/guestfs_add_drive_opts>."
25466 #: ../fuse/guestmount.pod:127
25467 msgid "B<--fuse-help>"
25471 #: ../fuse/guestmount.pod:129
25472 msgid "Display help on special FUSE options (see I<-o> below)."
25476 #: ../fuse/guestmount.pod:133
25477 msgid "Display brief help and exit."
25481 #: ../fuse/guestmount.pod:146
25482 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
25486 #: ../fuse/guestmount.pod:148
25488 "Mount the named partition or logical volume on the given mountpoint B<in the "
25489 "guest> (this has nothing to do with mountpoints in the host)."
25493 #: ../fuse/guestmount.pod:151
25495 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
25496 "something on C</>."
25500 #: ../fuse/guestmount.pod:156
25502 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
25503 "unmounted. If you specify this option, then we don't attempt to sync the "
25504 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
25508 #: ../fuse/guestmount.pod:161
25509 msgid "B<-o option> | B<--option option>"
25513 #: ../fuse/guestmount.pod:163
25514 msgid "Pass extra options to FUSE."
25518 #: ../fuse/guestmount.pod:165
25520 "To get a list of all the extra options supported by FUSE, use the command "
25521 "below. Note that only the FUSE I<-o> options can be passed, and only some "
25522 "of them are a good idea."
25526 #: ../fuse/guestmount.pod:169
25529 " guestmount --fuse-help\n"
25534 #: ../fuse/guestmount.pod:171
25535 msgid "Some potentially useful FUSE options:"
25539 #: ../fuse/guestmount.pod:175
25540 msgid "B<-o allow_other>"
25544 #: ../fuse/guestmount.pod:177
25545 msgid "Allow other users to see the filesystem."
25549 #: ../fuse/guestmount.pod:179
25550 msgid "B<-o attr_timeout=N>"
25554 #: ../fuse/guestmount.pod:181
25555 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
25559 #: ../fuse/guestmount.pod:183
25560 msgid "B<-o kernel_cache>"
25564 #: ../fuse/guestmount.pod:185
25566 "Allow the kernel to cache files (reduces the number of reads that have to go "
25567 "through the L<guestfs(3)> API). This is generally a good idea if you can "
25568 "afford the extra memory usage."
25572 #: ../fuse/guestmount.pod:189
25573 msgid "B<-o uid=N> B<-o gid=N>"
25577 #: ../fuse/guestmount.pod:191
25579 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
25580 "the chosen values."
25584 #: ../fuse/guestmount.pod:198
25586 "Add devices and mount everything read-only. Also disallow writes and make "
25587 "the disk appear read-only to FUSE."
25591 #: ../fuse/guestmount.pod:201
25593 "This is highly recommended if you are not going to edit the guest disk. If "
25594 "the guest is running and this option is I<not> supplied, then there is a "
25595 "strong risk of disk corruption in the guest. We try to prevent this from "
25596 "happening, but it is not always possible."
25600 #: ../fuse/guestmount.pod:206
25601 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
25605 #: ../fuse/guestmount.pod:210
25606 msgid "Enable SELinux support for the guest."
25610 #: ../fuse/guestmount.pod:214
25611 msgid "Enable verbose messages from underlying libguestfs."
25615 #: ../fuse/guestmount.pod:218
25616 msgid "Display the program version and exit."
25620 #: ../fuse/guestmount.pod:222
25622 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
25623 "FOR READ AND WRITE>."
25627 #: ../fuse/guestmount.pod:225
25628 msgid "B<-x> | B<--trace>"
25632 #: ../fuse/guestmount.pod:227
25633 msgid "Trace libguestfs calls."
25637 #: ../fuse/guestmount.pod:229
25638 msgid "This also stops the daemon from forking into the background."
25642 #: ../fuse/guestmount.pod:235
25644 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
25645 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
25646 "L<http://fuse.sf.net/>."
25650 #: ../tools/virt-edit.pl:34
25651 msgid "virt-edit - Edit a file in a virtual machine"
25655 #: ../tools/virt-edit.pl:38
25658 " virt-edit [--options] domname file\n"
25663 #: ../tools/virt-edit.pl:40
25666 " virt-edit [--options] disk.img [disk.img ...] file\n"
25671 #: ../tools/virt-edit.pl:42
25674 " virt-edit [domname|disk.img] file -e 'expr'\n"
25679 #: ../tools/virt-edit.pl:46
25681 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
25682 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
25683 "doing this, but doesn't catch all cases."
25687 #: ../tools/virt-edit.pl:52
25689 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
25690 "the named virtual machine (or disk image)."
25694 #: ../tools/virt-edit.pl:55
25696 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
25697 "you should look at the L<guestfish(1)> tool."
25701 #: ../tools/virt-edit.pl:60
25702 msgid "Edit the named files interactively:"
25706 #: ../tools/virt-edit.pl:62
25709 " virt-edit mydomain /boot/grub/grub.conf\n"
25714 #: ../tools/virt-edit.pl:64
25717 " virt-edit mydomain /etc/passwd\n"
25722 #: ../tools/virt-edit.pl:66
25724 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
25725 "below). To change the init default level to 5:"
25729 #: ../tools/virt-edit.pl:70
25732 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
25737 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:181 ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:108 ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
25738 msgid "Display brief help."
25742 #: ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:187 ../tools/virt-resize.pl:270 ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:114 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
25743 msgid "B<--version>"
25747 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:189 ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71 ../tools/virt-tar.pl:116 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:72
25748 msgid "Display version number and exit."
25752 #: ../tools/virt-edit.pl:96
25753 msgid "B<--backup extension> | B<-b extension>"
25757 #: ../tools/virt-edit.pl:98
25759 "Create a backup of the original file I<in the guest disk image>. The backup "
25760 "has the original filename with C<extension> added."
25764 #: ../tools/virt-edit.pl:101
25766 "Usually the first character of C<extension> would be a dot C<.> so you would "
25771 #: ../tools/virt-edit.pl:104
25774 " virt-edit -b .orig [etc]\n"
25779 #: ../tools/virt-edit.pl:106
25780 msgid "By default, no backup file is made."
25784 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:203 ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:122 ../tools/virt-list-partitions.pl:78
25785 msgid "B<--connect URI> | B<-c URI>"
25789 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:205 ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:124 ../tools/virt-list-partitions.pl:80
25791 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
25792 "to the default libvirt hypervisor."
25796 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208 ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:127 ../tools/virt-list-partitions.pl:83
25798 "If you specify guest block devices directly, then libvirt is not used at "
25803 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:215 ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89 ../tools/virt-tar.pl:134 ../tools/virt-list-partitions.pl:90
25804 msgid "B<--format> raw"
25808 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:217 ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:136 ../tools/virt-list-partitions.pl:92
25810 "Specify the format of disk images given on the command line. If this is "
25811 "omitted then the format is autodetected from the content of the disk image."
25815 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:221 ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:140 ../tools/virt-list-partitions.pl:96
25817 "If disk images are requested from libvirt, then this program asks libvirt "
25818 "for this information. In this case, the value of the format parameter is "
25823 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:225 ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540 ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:144 ../tools/virt-list-partitions.pl:100
25825 "If working with untrusted raw-format guest disk images, you should ensure "
25826 "the format is always specified."
25830 #: ../tools/virt-edit.pl:141
25831 msgid "B<--expr EXPR> | B<-e EXPR>"
25835 #: ../tools/virt-edit.pl:143
25837 "Instead of launching the external editor, non-interactively apply the Perl "
25838 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
25843 #: ../tools/virt-edit.pl:147
25845 "Be careful to properly quote the expression to prevent it from being altered "
25850 #: ../tools/virt-edit.pl:268
25851 msgid "NON-INTERACTIVE EDITING"
25855 #: ../tools/virt-edit.pl:270
25857 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
25858 "administrator can interactively edit the file."
25862 #: ../tools/virt-edit.pl:273
25864 "There are two ways also to use C<virt-edit> from scripts in order to make "
25865 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
25866 "like this, it's less error-prone to write scripts directly using the "
25867 "libguestfs API and Augeas for configuration file editing.)"
25871 #: ../tools/virt-edit.pl:279
25873 "The first method is to temporarily set C<$EDITOR> to any script or program "
25874 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
25875 "update C<tmpfile> in place however it likes."
25879 #: ../tools/virt-edit.pl:283
25881 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
25882 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
25883 "instances of C<foo> with C<bar> in a file:"
25887 #: ../tools/virt-edit.pl:287
25890 " virt-edit domname filename -e 's/foo/bar/'\n"
25895 #: ../tools/virt-edit.pl:289
25897 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
25898 "For example to delete root's password you could do:"
25902 #: ../tools/virt-edit.pl:292
25905 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
25910 #: ../tools/virt-edit.pl:294
25912 "What really happens is that the snippet is evaluated as a Perl expression "
25913 "for each line of the file. The line, including the final C<\\n>, is passed "
25914 "in C<$_> and the expression should update C<$_> or leave it unchanged."
25918 #: ../tools/virt-edit.pl:299
25920 "To delete a line, set C<$_> to the empty string. For example, to delete the "
25921 "C<apache> user account from the password file you can do:"
25925 #: ../tools/virt-edit.pl:302
25928 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
25933 #: ../tools/virt-edit.pl:304
25935 "To insert a line, prepend or append it to C<$_>. However appending lines to "
25936 "the end of the file is rather difficult this way since there is no concept "
25937 "of \"last line of the file\" - your expression just doesn't get called "
25938 "again. You might want to use the first method (setting C<$EDITOR>) if you "
25943 #: ../tools/virt-edit.pl:310
25945 "The variable C<$lineno> contains the current line number. As is "
25946 "traditional, the first line in the file is number C<1>."
25950 #: ../tools/virt-edit.pl:313
25952 "The return value from the expression is ignored, but the expression may call "
25953 "C<die> in order to abort the whole program, leaving the original file "
25958 #: ../tools/virt-edit.pl:317
25960 "Remember when matching the end of a line that C<$_> may contain the final "
25961 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
25962 "newline then neither of these. Thus to match or substitute some text at the "
25963 "end of a line, use this regular expression:"
25967 #: ../tools/virt-edit.pl:322
25970 " /some text(\\r?\\n)?$/\n"
25975 #: ../tools/virt-edit.pl:324
25977 "Alternately, use the perl C<chomp> function, being careful not to chomp "
25978 "C<$_> itself (since that would remove all newlines from the file):"
25982 #: ../tools/virt-edit.pl:328
25985 " my $m = $_; chomp $m; $m =~ /some text$/\n"
25990 #: ../tools/virt-edit.pl:334
25995 #: ../tools/virt-edit.pl:336
25997 "If set, this string is used as the editor. It may contain arguments, "
25998 "eg. C<\"emacs -nw\">"
26002 #: ../tools/virt-edit.pl:339
26003 msgid "If not set, C<vi> is used."
26007 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477 ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:274 ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:250
26008 msgid "SHELL QUOTING"
26012 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:479 ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184 ../tools/virt-tar.pl:276 ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:252
26014 "Libvirt guest names can contain arbitrary characters, some of which have "
26015 "meaning to the shell such as C<#> and space. You may need to quote or "
26016 "escape these characters on the command line. See the shell manual page "
26017 "L<sh(1)> for details."
26021 #: ../tools/virt-edit.pl:352
26023 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
26024 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, "
26025 "L<perl(1)>, L<perlre(1)>."
26029 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510 ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:292 ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:269
26034 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:512 ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204 ../tools/virt-tar.pl:294 ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:271
26035 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26039 #: ../tools/virt-edit.pl:368 ../tools/virt-list-partitions.pl:275
26040 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26044 #: ../tools/virt-win-reg.pl:37
26046 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
26051 #: ../tools/virt-win-reg.pl:41
26054 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26059 #: ../tools/virt-win-reg.pl:43
26062 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26067 #: ../tools/virt-win-reg.pl:45
26070 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26075 #: ../tools/virt-win-reg.pl:47
26078 " virt-win-reg --merge domname [input.reg ...]\n"
26083 #: ../tools/virt-win-reg.pl:49
26086 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26091 #: ../tools/virt-win-reg.pl:53
26093 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26094 "virtual machines. If you do this, you I<will> get irreversible disk "
26095 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26096 "but doesn't catch all cases."
26100 #: ../tools/virt-win-reg.pl:58
26102 "Modifying the Windows Registry is an inherently risky operation. The format "
26103 "is deliberately obscure and undocumented, and Registry changes can leave the "
26104 "system unbootable. Therefore when using the C<--merge> option, make sure "
26105 "you have a reliable backup first."
26109 #: ../tools/virt-win-reg.pl:65
26111 "This program can export and merge Windows Registry entries from a Windows "
26116 #: ../tools/virt-win-reg.pl:68
26118 "The first parameter is the libvirt guest name or the raw disk image of a "
26123 #: ../tools/virt-win-reg.pl:71
26125 "If C<--merge> is I<not> specified, then the chosen registry key is "
26126 "displayed/exported (recursively). For example:"
26130 #: ../tools/virt-win-reg.pl:74
26133 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26138 #: ../tools/virt-win-reg.pl:76
26139 msgid "You can also display single values from within registry keys, for example:"
26143 #: ../tools/virt-win-reg.pl:79
26146 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26147 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26148 " Windows 7 Enterprise\n"
26153 #: ../tools/virt-win-reg.pl:83
26155 "With C<--merge>, you can merge a textual regedit file into the Windows "
26160 #: ../tools/virt-win-reg.pl:86
26163 " $ virt-win-reg --merge Windows7 changes.reg\n"
26168 #: ../tools/virt-win-reg.pl:88
26169 msgid "SUPPORTED SYSTEMS"
26173 #: ../tools/virt-win-reg.pl:90
26175 "The program currently supports Windows NT-derived guests starting with "
26176 "Windows XP through to at least Windows 7."
26180 #: ../tools/virt-win-reg.pl:93
26182 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
26183 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
26184 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
26188 #: ../tools/virt-win-reg.pl:97
26190 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26195 #: ../tools/virt-win-reg.pl:100
26197 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26202 #: ../tools/virt-win-reg.pl:103
26207 #: ../tools/virt-win-reg.pl:105
26209 "This program is only meant for simple access to the registry. If you want "
26210 "to do complicated things with the registry, we suggest you download the "
26211 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26212 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26213 "L<hivexregedit(1)>."
26217 #: ../tools/virt-win-reg.pl:111
26222 #: ../tools/virt-win-reg.pl:113
26224 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26225 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
26226 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
26227 "with Windows-style line endings, you may need to reencode the whole file "
26228 "before or after processing."
26232 #: ../tools/virt-win-reg.pl:119
26234 "To reencode a file from Windows format to Linux (before processing it with "
26235 "the C<--merge> option), you would do something like this:"
26239 #: ../tools/virt-win-reg.pl:122
26242 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26247 #: ../tools/virt-win-reg.pl:124
26249 "To go in the opposite direction, after exporting and before sending the file "
26250 "to a Windows user, do something like this:"
26254 #: ../tools/virt-win-reg.pl:127
26257 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26262 #: ../tools/virt-win-reg.pl:129
26263 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26267 #: ../tools/virt-win-reg.pl:131
26269 "If you are unsure about the current encoding, use the L<file(1)> command. "
26270 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
26271 "Windows-style (CRLF) line endings, like this:"
26275 #: ../tools/virt-win-reg.pl:135
26278 " $ file software.reg\n"
26279 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26280 " with CRLF line terminators\n"
26285 #: ../tools/virt-win-reg.pl:139
26286 msgid "This file would need conversion before you could C<--merge> it."
26290 #: ../tools/virt-win-reg.pl:143
26292 "Be careful when passing parameters containing C<\\> (backslash) in the "
26293 "shell. Usually you will have to use 'single quotes' or double backslashes "
26294 "(but not both) to protect them from the shell."
26298 #: ../tools/virt-win-reg.pl:147
26299 msgid "Paths and value names are case-insensitive."
26303 #: ../tools/virt-win-reg.pl:149
26304 msgid "CurrentControlSet etc."
26308 #: ../tools/virt-win-reg.pl:151
26310 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26311 "Registry at the level of the hive file, and therefore you cannot modify "
26316 #: ../tools/virt-win-reg.pl:155
26318 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26319 "circumstances it might refer to another control set. The way to find out is "
26320 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26324 #: ../tools/virt-win-reg.pl:159
26327 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26328 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26329 " \"Current\"=dword:00000001\n"
26330 " \"Default\"=dword:00000001\n"
26331 " \"Failed\"=dword:00000000\n"
26332 " \"LastKnownGood\"=dword:00000002\n"
26337 #: ../tools/virt-win-reg.pl:166
26338 msgid "\"Current\" is the one which Windows will choose when it boots."
26342 #: ../tools/virt-win-reg.pl:168
26343 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
26347 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
26352 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:498
26353 msgid "Enable debugging messages."
26357 #: ../tools/virt-win-reg.pl:232
26362 #: ../tools/virt-win-reg.pl:234
26364 "In merge mode, this merges a textual regedit file into the Windows Registry "
26365 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26366 "displays or exports Registry entries instead."
26370 #: ../tools/virt-win-reg.pl:238
26372 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26373 "result in disk corruption. However exporting (without this flag) is always "
26378 #: ../tools/virt-win-reg.pl:246
26379 msgid "B<--encoding> UTF-16LE|ASCII"
26383 #: ../tools/virt-win-reg.pl:248
26385 "When merging (only), you may need to specify the encoding for strings to be "
26386 "used in the hive file. This is explained in detail in "
26387 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
26391 #: ../tools/virt-win-reg.pl:252
26393 "The default is to use UTF-16LE, which should work with recent versions of "
26398 #: ../tools/virt-win-reg.pl:486
26400 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
26401 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
26402 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
26403 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26407 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
26409 "When reporting bugs, please enable debugging and capture the I<complete> "
26414 #: ../tools/virt-win-reg.pl:504
26417 " export LIBGUESTFS_DEBUG=1\n"
26418 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26423 #: ../tools/virt-win-reg.pl:507
26425 "Attach /tmp/virt-win-reg.log to a new bug report at "
26426 "L<https://bugzilla.redhat.com/>"
26430 #: ../tools/virt-win-reg.pl:516 ../tools/virt-resize.pl:1510 ../tools/virt-make-fs.pl:565
26431 msgid "Copyright (C) 2010 Red Hat Inc."
26435 #: ../tools/virt-resize.pl:42
26436 msgid "virt-resize - Resize a virtual machine disk"
26440 #: ../tools/virt-resize.pl:46
26443 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
26444 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
26445 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
26450 #: ../tools/virt-resize.pl:52
26452 "Virt-resize is a tool which can resize a virtual machine disk, making it "
26453 "larger or smaller overall, and resizing or deleting any partitions contained "
26458 #: ../tools/virt-resize.pl:56
26460 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
26461 "not> be used on live virtual machines - for consistent results, shut the "
26462 "virtual machine down before resizing it."
26466 #: ../tools/virt-resize.pl:60
26468 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
26469 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
26473 #: ../tools/virt-resize.pl:66
26475 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
26476 "fill the extra 5GB of space."
26480 #: ../tools/virt-resize.pl:69
26483 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
26484 " virt-filesystems --long --h --all -a olddisk\n"
26485 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
26486 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
26491 #: ../tools/virt-resize.pl:74
26493 "As above, but make the /boot partition 200MB bigger, while giving the "
26494 "remaining space to /dev/sda2:"
26498 #: ../tools/virt-resize.pl:77
26501 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
26506 #: ../tools/virt-resize.pl:79
26507 msgid "As above, but the output format will be uncompressed qcow2:"
26511 #: ../tools/virt-resize.pl:81
26514 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
26515 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
26520 #: ../tools/virt-resize.pl:84
26521 msgid "DETAILED USAGE"
26525 #: ../tools/virt-resize.pl:86
26526 msgid "EXPANDING A VIRTUAL MACHINE DISK"
26530 #: ../tools/virt-resize.pl:90
26531 msgid "1. Shut down the virtual machine"
26535 #: ../tools/virt-resize.pl:92
26536 msgid "2. Locate input disk image"
26540 #: ../tools/virt-resize.pl:94
26542 "Locate the input disk image (ie. the file or device on the host containing "
26543 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
26544 "dumpxml> like this to find the disk image name:"
26548 #: ../tools/virt-resize.pl:98
26551 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
26552 " Found 1 nodes:\n"
26554 " <source dev=\"/dev/vg/lv_guest\" />\n"
26559 #: ../tools/virt-resize.pl:103
26560 msgid "3. Look at current sizing"
26564 #: ../tools/virt-resize.pl:105
26565 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
26569 #: ../tools/virt-resize.pl:108
26572 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
26573 " Name Type Size Parent\n"
26574 " /dev/sda1 partition 101M /dev/sda\n"
26575 " /dev/sda2 partition 7.9G /dev/sda\n"
26576 " /dev/sda device 8.0G -\n"
26581 #: ../tools/virt-resize.pl:114
26583 "(This example is a virtual machine with an 8 GB disk which we would like to "
26584 "expand up to 10 GB)."
26588 #: ../tools/virt-resize.pl:117
26589 msgid "4. Create output disk"
26593 #: ../tools/virt-resize.pl:119
26595 "Virt-resize cannot do in-place disk modifications. You have to have space "
26596 "to store the resized output disk."
26600 #: ../tools/virt-resize.pl:122
26601 msgid "To store the resized disk image in a file, create a file of a suitable size:"
26605 #: ../tools/virt-resize.pl:125
26608 " # rm -f outdisk\n"
26609 " # truncate -s 10G outdisk\n"
26614 #: ../tools/virt-resize.pl:128
26615 msgid "Or use L<lvcreate(1)> to create a logical volume:"
26619 #: ../tools/virt-resize.pl:130
26622 " # lvcreate -L 10G -n lv_name vg_name\n"
26627 #: ../tools/virt-resize.pl:132
26628 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
26632 #: ../tools/virt-resize.pl:134
26635 " # virsh pool-list\n"
26636 " # virsh vol-create-as poolname newvol 10G\n"
26641 #: ../tools/virt-resize.pl:137
26646 #: ../tools/virt-resize.pl:139
26648 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
26649 "file) and the output disk. The output disk is the one created in the "
26654 #: ../tools/virt-resize.pl:143
26657 " # virt-resize indisk outdisk\n"
26662 #: ../tools/virt-resize.pl:145
26664 "This command just copies disk image C<indisk> to disk image C<outdisk> "
26665 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
26666 "larger, then an extra, empty partition is created at the end of the disk "
26667 "covering the extra space. If C<outdisk> is smaller, then it will give an "
26672 #: ../tools/virt-resize.pl:151
26674 "More realistically you'd want to expand existing partitions in the disk "
26675 "image by passing extra options (for the full list see the L</OPTIONS> "
26680 #: ../tools/virt-resize.pl:155
26682 "L</--expand> is the most useful option. It expands the named partition "
26683 "within the disk to fill any extra space:"
26687 #: ../tools/virt-resize.pl:158
26690 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
26695 #: ../tools/virt-resize.pl:160
26697 "(In this case, an extra partition is I<not> created at the end of the disk, "
26698 "because there will be no unused space)."
26702 #: ../tools/virt-resize.pl:163
26704 "L</--resize> is the other commonly used option. The following would "
26705 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
26706 "rest of the available space:"
26710 #: ../tools/virt-resize.pl:167
26713 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
26714 " indisk outdisk\n"
26719 #: ../tools/virt-resize.pl:170
26721 "If the expanded partition in the image contains a filesystem or LVM PV, then "
26722 "if virt-resize knows how, it will resize the contents, the equivalent of "
26723 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
26724 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
26725 "filesystems, so you would have to online resize them after booting the "
26730 #: ../tools/virt-resize.pl:177
26731 msgid "Other options are covered below."
26735 #: ../tools/virt-resize.pl:179
26740 #: ../tools/virt-resize.pl:181
26741 msgid "Thoroughly test the new disk image I<before> discarding the old one."
26745 #: ../tools/virt-resize.pl:183
26746 msgid "If you are using libvirt, edit the XML to point at the new disk:"
26750 #: ../tools/virt-resize.pl:185
26753 " # virsh edit guestname\n"
26758 #: ../tools/virt-resize.pl:187
26760 "Change E<lt>source ...E<gt>, see "
26761 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
26765 #: ../tools/virt-resize.pl:190
26766 msgid "Then start up the domain with the new, resized disk:"
26770 #: ../tools/virt-resize.pl:192
26773 " # virsh start guestname\n"
26778 #: ../tools/virt-resize.pl:194
26780 "and check that it still works. See also the L</NOTES> section below for "
26781 "additional information."
26785 #: ../tools/virt-resize.pl:197
26786 msgid "7. Resize LVs etc inside the guest"
26790 #: ../tools/virt-resize.pl:199
26791 msgid "(This can also be done offline using L<guestfish(1)>)"
26795 #: ../tools/virt-resize.pl:201
26797 "Once the guest has booted you should see the new space available, at least "
26798 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
26799 "may need to resize LVs inside PVs, and also resize filesystem types that "
26800 "virt-resize does not know how to expand."
26804 #: ../tools/virt-resize.pl:208
26805 msgid "SHRINKING A VIRTUAL MACHINE DISK"
26809 #: ../tools/virt-resize.pl:210
26811 "Shrinking is somewhat more complex than expanding, and only an overview is "
26816 #: ../tools/virt-resize.pl:213
26818 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
26819 "filesystems). The user has to shrink content before passing the disk image "
26820 "to virt-resize, and virt-resize will check that the content has been shrunk "
26825 #: ../tools/virt-resize.pl:218
26826 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
26830 #: ../tools/virt-resize.pl:220
26832 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
26833 "steps 3 and 4 above to allocate a new disk image."
26837 #: ../tools/virt-resize.pl:223
26838 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
26842 #: ../tools/virt-resize.pl:226
26843 msgid "IGNORING OR DELETING PARTITIONS"
26847 #: ../tools/virt-resize.pl:228
26849 "virt-resize also gives a convenient way to ignore or delete partitions when "
26850 "copying from the input disk to the output disk. Ignoring a partition speeds "
26851 "up the copy where you don't care about the existing contents of a "
26852 "partition. Deleting a partition removes it completely, but note that it "
26853 "also renumbers any partitions after the one which is deleted, which can "
26854 "leave some guests unbootable."
26858 #: ../tools/virt-resize.pl:235
26859 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
26863 #: ../tools/virt-resize.pl:237
26865 "If the input disk is in qcow2 format, then you may prefer that the output is "
26866 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
26867 "the fly. The output format is simply determined by the format of the empty "
26868 "output container that you provide. Thus to create qcow2 output, use:"
26872 #: ../tools/virt-resize.pl:243
26875 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
26880 #: ../tools/virt-resize.pl:245
26881 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
26885 #: ../tools/virt-resize.pl:247
26886 msgid "Similarly, to get non-sparse raw output use:"
26890 #: ../tools/virt-resize.pl:249
26893 " fallocate -l size outdisk\n"
26898 #: ../tools/virt-resize.pl:251
26900 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
26901 "if=/dev/zero of=outdisk bs=1M count=..>)"
26905 #: ../tools/virt-resize.pl:264
26906 msgid "Display help."
26910 #: ../tools/virt-resize.pl:278
26911 msgid "B<--resize part=size>"
26915 #: ../tools/virt-resize.pl:280
26917 "Resize the named partition (expanding or shrinking it) so that it has the "
26922 #: ../tools/virt-resize.pl:283
26924 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
26925 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
26926 "Exabytes; or as a percentage of the current size; or as a relative number or "
26927 "percentage. For example:"
26931 #: ../tools/virt-resize.pl:288
26934 " --resize /dev/sda2=10G\n"
26939 #: ../tools/virt-resize.pl:290
26942 " --resize /dev/sda4=90%\n"
26947 #: ../tools/virt-resize.pl:292
26950 " --resize /dev/sda2=+1G\n"
26955 #: ../tools/virt-resize.pl:294
26958 " --resize /dev/sda2=-200M\n"
26963 #: ../tools/virt-resize.pl:296
26966 " --resize /dev/sda1=+128K\n"
26971 #: ../tools/virt-resize.pl:298
26974 " --resize /dev/sda1=+10%\n"
26979 #: ../tools/virt-resize.pl:300
26982 " --resize /dev/sda1=-10%\n"
26987 #: ../tools/virt-resize.pl:302
26989 "You can increase the size of any partition. Virt-resize will expand the "
26990 "direct content of the partition if it knows how (see C<--expand> below)."
26994 #: ../tools/virt-resize.pl:306
26996 "You can only I<decrease> the size of partitions that contain filesystems or "
26997 "PVs which have already been shrunk. Virt-resize will check this has been "
26998 "done before proceeding, or else will print an error (see also "
26999 "C<--resize-force>)."
27003 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403 ../tools/virt-resize.pl:420
27004 msgid "You can give this option multiple times."
27008 #: ../tools/virt-resize.pl:317
27009 msgid "B<--resize-force part=size>"
27013 #: ../tools/virt-resize.pl:319
27015 "This is the same as C<--resize> except that it will let you decrease the "
27016 "size of any partition. Generally this means you will lose any data which "
27017 "was at the end of the partition you shrink, but you may not care about that "
27018 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
27019 "as a swap partition)."
27023 #: ../tools/virt-resize.pl:325
27024 msgid "See also the C<--ignore> option."
27028 #: ../tools/virt-resize.pl:331
27029 msgid "B<--expand part>"
27033 #: ../tools/virt-resize.pl:333
27035 "Expand the named partition so it uses up all extra space (space left over "
27036 "after any other resize changes that you request have been done)."
27040 #: ../tools/virt-resize.pl:336
27042 "If virt-resize knows how, it will expand the direct content of the "
27043 "partition. For example, if the partition is an LVM PV, it will expand the "
27044 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
27045 "content it doesn't know about alone."
27049 #: ../tools/virt-resize.pl:341
27050 msgid "Currently virt-resize can resize:"
27054 #: ../tools/virt-resize.pl:347
27056 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
27061 #: ../tools/virt-resize.pl:352
27063 "NTFS filesystems contained directly in a partition, if libguestfs was "
27064 "compiled with support for NTFS."
27068 #: ../tools/virt-resize.pl:355
27070 "The filesystem must have been shut down consistently last time it was used. "
27071 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
27072 "consistency check, so at the first boot after resizing Windows will check "
27077 #: ../tools/virt-resize.pl:362
27079 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
27080 "inside the PV, but see the C<--LV-expand> option. The user could also "
27081 "resize LVs as desired after boot."
27085 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
27086 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
27090 #: ../tools/virt-resize.pl:374
27091 msgid "B<--shrink part>"
27095 #: ../tools/virt-resize.pl:376
27097 "Shrink the named partition until the overall disk image fits in the "
27098 "destination. The named partition B<must> contain a filesystem or PV which "
27099 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
27100 "online tools). Virt-resize will check this and give an error if it has not "
27105 #: ../tools/virt-resize.pl:382
27107 "The amount by which the overall disk must be shrunk (after carrying out all "
27108 "other operations requested by the user) is called the \"deficit\". For "
27109 "example, a straight copy (assume no other operations) from a 5GB disk image "
27110 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
27111 "would give an error unless the user specified a partition to shrink and that "
27112 "partition had more than a gigabyte of free space."
27116 #: ../tools/virt-resize.pl:396
27117 msgid "B<--ignore part>"
27121 #: ../tools/virt-resize.pl:398
27123 "Ignore the named partition. Effectively this means the partition is "
27124 "allocated on the destination disk, but the content is not copied across from "
27125 "the source disk. The content of the partition will be blank (all zero "
27130 #: ../tools/virt-resize.pl:409
27131 msgid "B<--delete part>"
27135 #: ../tools/virt-resize.pl:411
27137 "Delete the named partition. It would be more accurate to describe this as "
27138 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
27139 "the original disk image is left intact."
27143 #: ../tools/virt-resize.pl:415
27145 "Note that when you delete a partition, then anything contained in the "
27146 "partition is also deleted. Furthermore, this causes any partitions that "
27147 "come after to be I<renumbered>, which can easily make your guest unbootable."
27151 #: ../tools/virt-resize.pl:426
27152 msgid "B<--LV-expand logvol>"
27156 #: ../tools/virt-resize.pl:428
27158 "This takes the logical volume and, as a final step, expands it to fill all "
27159 "the space available in its volume group. A typical usage, assuming a Linux "
27160 "guest with a single PV C</dev/sda2> and a root device called "
27161 "C</dev/vg_guest/lv_root> would be:"
27165 #: ../tools/virt-resize.pl:433
27168 " virt-resize indisk outdisk \\\n"
27169 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
27174 #: ../tools/virt-resize.pl:436
27176 "This would first expand the partition (and PV), and then expand the root "
27177 "device to fill the extra space in the PV."
27181 #: ../tools/virt-resize.pl:439
27183 "The contents of the LV are also resized if virt-resize knows how to do "
27184 "that. You can stop virt-resize from trying to expand the content by using "
27185 "the option C<--no-expand-content>."
27189 #: ../tools/virt-resize.pl:443
27190 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
27194 #: ../tools/virt-resize.pl:446
27196 "You can give this option multiple times, I<but> it doesn't make sense to do "
27197 "this unless the logical volumes you specify are all in different volume "
27202 #: ../tools/virt-resize.pl:454
27203 msgid "B<--no-copy-boot-loader>"
27207 #: ../tools/virt-resize.pl:456
27209 "By default, virt-resize copies over some sectors at the start of the disk "
27210 "(up to the beginning of the first partition). Commonly these sectors "
27211 "contain the Master Boot Record (MBR) and the boot loader, and are required "
27212 "in order for the guest to boot correctly."
27216 #: ../tools/virt-resize.pl:461
27218 "If you specify this flag, then this initial copy is not done. You may need "
27219 "to reinstall the boot loader in this case."
27223 #: ../tools/virt-resize.pl:469
27224 msgid "B<--no-extra-partition>"
27228 #: ../tools/virt-resize.pl:471
27230 "By default, virt-resize creates an extra partition if there is any extra, "
27231 "unused space after all resizing has happened. Use this option to prevent "
27232 "the extra partition from being created. If you do this then the extra space "
27233 "will be inaccessible until you run fdisk, parted, or some other partitioning "
27234 "tool in the guest."
27238 #: ../tools/virt-resize.pl:477
27240 "Note that if the surplus space is smaller than 10 MB, no extra partition "
27245 #: ../tools/virt-resize.pl:484
27246 msgid "B<--no-expand-content>"
27250 #: ../tools/virt-resize.pl:486
27252 "By default, virt-resize will try to expand the direct contents of "
27253 "partitions, if it knows how (see C<--expand> option above)."
27257 #: ../tools/virt-resize.pl:489
27259 "If you give the C<--no-expand-content> option then virt-resize will not "
27264 #: ../tools/virt-resize.pl:496
27265 msgid "B<-d> | B<--debug>"
27269 #: ../tools/virt-resize.pl:504
27270 msgid "B<-n> | B<--dryrun>"
27274 #: ../tools/virt-resize.pl:506
27275 msgid "Print a summary of what would be done, but don't do anything."
27279 #: ../tools/virt-resize.pl:512
27280 msgid "B<-q> | B<--quiet>"
27284 #: ../tools/virt-resize.pl:514
27285 msgid "Don't print the summary."
27289 #: ../tools/virt-resize.pl:522
27291 "Specify the format of the input disk image. If this flag is not given then "
27292 "it is auto-detected from the image itself."
27296 #: ../tools/virt-resize.pl:528
27298 "Note that this option I<does not> affect the output format. See L</QCOW2 "
27299 "AND NON-SPARSE RAW FORMATS>."
27303 #: ../tools/virt-resize.pl:535
27304 msgid "B<--output-format> raw"
27308 #: ../tools/virt-resize.pl:537
27310 "Specify the format of the output disk image. If this flag is not given then "
27311 "it is auto-detected from the image itself."
27315 #: ../tools/virt-resize.pl:543
27317 "Note that you still need to create the output disk with the right format. "
27318 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
27322 #: ../tools/virt-resize.pl:1419
27327 #: ../tools/virt-resize.pl:1421
27328 msgid "\"Partition 1 does not end on cylinder boundary.\""
27332 #: ../tools/virt-resize.pl:1423
27334 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
27335 "means the partitions will not be aligned to the ancient CHS geometry. "
27336 "However CHS geometry is meaningless for disks manufactured since the early "
27337 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
27338 "cylinders is not required by any modern operating system."
27342 #: ../tools/virt-resize.pl:1430
27343 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
27347 #: ../tools/virt-resize.pl:1432
27349 "In Windows Vista and later versions, Microsoft switched to using a separate "
27350 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
27351 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
27352 "the boot partition. Doing so seems to break the guest completely. However "
27353 "expanding the second partition (ie. C: drive) should work."
27357 #: ../tools/virt-resize.pl:1439
27359 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
27360 "NTFS partitions have been expanded. This is just a safety check and (unless "
27361 "it find errors) is nothing to worry about."
27365 #: ../tools/virt-resize.pl:1443
27366 msgid "GUEST BOOT STUCK AT \"GRUB\""
27370 #: ../tools/virt-resize.pl:1445
27372 "If a Linux guest does not boot after resizing, and the boot is stuck after "
27373 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
27374 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
27375 "although we think is to do with partition alignment."
27379 #: ../tools/virt-resize.pl:1450
27382 " guestfish -i -a newdisk\n"
27383 " ><fs> cat /boot/grub/device.map\n"
27384 " # check the contents of this file are sensible or\n"
27385 " # edit the file if necessary\n"
27386 " ><fs> grub-install / /dev/vda\n"
27392 #: ../tools/virt-resize.pl:1457
27394 "For more flexible guest reconfiguration, including if you need to specify "
27395 "other parameters to grub-install, use L<virt-rescue(1)>."
27399 #: ../tools/virt-resize.pl:1460
27400 msgid "ALTERNATIVE TOOLS"
27404 #: ../tools/virt-resize.pl:1462
27406 "There are several proprietary tools for resizing partitions. We won't "
27407 "mention any here."
27411 #: ../tools/virt-resize.pl:1465
27413 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
27414 "operations on disk images. They can resize and move partitions, but I don't "
27415 "think they can do anything with the contents, and they certainly don't "
27420 #: ../tools/virt-resize.pl:1470
27422 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
27423 "but at a much lower level. You will probably end up hand-calculating sector "
27424 "offsets, which is something that virt-resize was designed to avoid. If you "
27425 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
27430 #: ../tools/virt-resize.pl:1485
27432 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
27433 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
27434 "L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
27435 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
27436 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
27440 #: ../tools/virt-list-filesystems.pl:32
27441 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
27445 #: ../tools/virt-list-filesystems.pl:36
27448 " virt-list-filesystems [--options] domname\n"
27453 #: ../tools/virt-list-filesystems.pl:38
27456 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
27461 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
27463 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
27468 #: ../tools/virt-list-filesystems.pl:45
27470 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
27471 "are contained in a virtual machine or disk image."
27475 #: ../tools/virt-list-filesystems.pl:49
27477 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
27478 "functionality. For more complex cases you should look at the "
27479 "L<guestfish(1)> tool."
27483 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
27484 msgid "B<-l> | B<--long>"
27488 #: ../tools/virt-list-filesystems.pl:108
27490 "With this option, C<virt-list-filesystems> displays the type of each "
27491 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
27495 #: ../tools/virt-list-filesystems.pl:115
27496 msgid "B<-a> | B<--all>"
27500 #: ../tools/virt-list-filesystems.pl:117
27502 "Normally we only show mountable filesystems. If this option is given then "
27503 "swap devices are shown too."
27507 #: ../tools/virt-list-filesystems.pl:191
27509 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
27510 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
27511 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27515 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:298
27516 msgid "Copyright (C) 2009 Red Hat Inc."
27520 #: ../tools/virt-tar.pl:33
27521 msgid "virt-tar - Extract or upload files to a virtual machine"
27525 #: ../tools/virt-tar.pl:37
27528 " virt-tar [--options] -x domname directory tarball\n"
27533 #: ../tools/virt-tar.pl:39
27536 " virt-tar [--options] -u domname tarball directory\n"
27541 #: ../tools/virt-tar.pl:41
27544 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
27549 #: ../tools/virt-tar.pl:43
27552 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
27557 #: ../tools/virt-tar.pl:47
27558 msgid "Download C</home> from the VM into a local tarball:"
27562 #: ../tools/virt-tar.pl:49
27565 " virt-tar -x domname /home home.tar\n"
27570 #: ../tools/virt-tar.pl:51
27573 " virt-tar -zx domname /home home.tar.gz\n"
27578 #: ../tools/virt-tar.pl:53
27579 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
27583 #: ../tools/virt-tar.pl:55
27586 " virt-tar -u domname uploadstuff.tar /tmp\n"
27591 #: ../tools/virt-tar.pl:57
27594 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
27599 #: ../tools/virt-tar.pl:61
27601 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
27602 "virtual machines. If you do this, you risk disk corruption in the VM. "
27603 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
27607 #: ../tools/virt-tar.pl:66
27609 "You can use C<-x> (extract) on live virtual machines, but you might get "
27610 "inconsistent results or errors if there is filesystem activity inside the "
27611 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
27612 "work, but the only way to guarantee consistent results is if the virtual "
27613 "machine is shut down."
27617 #: ../tools/virt-tar.pl:74
27619 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
27620 "parts of a guest filesystem. There are many possibilities: making backups, "
27621 "uploading data files, snooping on guest activity, fixing or customizing "
27626 #: ../tools/virt-tar.pl:79
27628 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
27629 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
27630 "should look at the L<guestfish(1)> tool."
27634 #: ../tools/virt-tar.pl:83
27636 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
27637 "its contents (recursively) from the virtual machine into a local tarball. "
27638 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
27639 "virtual machine. You cannot use these two options together."
27643 #: ../tools/virt-tar.pl:89
27645 "In addition, you may need to use the C<-z> (gZip) option to enable "
27646 "compression. When uploading, you have to specify C<-z> if the upload file "
27647 "is compressed because virt-tar won't detect this on its own."
27651 #: ../tools/virt-tar.pl:93
27653 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
27654 "example it cannot do PKZip files or bzip2 compression. If you want that "
27655 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
27656 "the L<libguestfs(3)> API)."
27660 #: ../tools/virt-tar.pl:151
27661 msgid "B<-x> | B<--extract> | B<--download>"
27665 #: ../tools/virt-tar.pl:153
27666 msgid "B<-u> | B<--upload>"
27670 #: ../tools/virt-tar.pl:155
27672 "Use C<-x> to extract (download) a directory from a virtual machine to a "
27677 #: ../tools/virt-tar.pl:158
27679 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
27680 "Please read the L</WARNING> section above before using this option."
27684 #: ../tools/virt-tar.pl:162
27685 msgid "You must specify exactly one of these options."
27689 #: ../tools/virt-tar.pl:168
27690 msgid "B<-z> | B<--gzip>"
27694 #: ../tools/virt-tar.pl:170
27695 msgid "Specify that the input or output tarball is gzip-compressed."
27699 #: ../tools/virt-tar.pl:283
27701 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
27702 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
27703 "L<http://libguestfs.org/>."
27707 #: ../tools/virt-make-fs.pl:37
27708 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
27712 #: ../tools/virt-make-fs.pl:41
27715 " virt-make-fs [--options] input.tar output.img\n"
27720 #: ../tools/virt-make-fs.pl:43
27723 " virt-make-fs [--options] input.tar.gz output.img\n"
27728 #: ../tools/virt-make-fs.pl:45
27731 " virt-make-fs [--options] directory output.img\n"
27736 #: ../tools/virt-make-fs.pl:49
27738 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
27739 "archive or some files in a directory. It is similar to tools like "
27740 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
27741 "it can create common filesystem types like ext2/3 or NTFS, which can be "
27742 "useful if you want to attach these filesystems to existing virtual machines "
27743 "(eg. to import large amounts of read-only data to a VM)."
27747 #: ../tools/virt-make-fs.pl:57
27748 msgid "Basic usage is:"
27752 #: ../tools/virt-make-fs.pl:59
27755 " virt-make-fs input output\n"
27760 #: ../tools/virt-make-fs.pl:61
27762 "where C<input> is either a directory containing files that you want to add, "
27763 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
27764 "C<output> is a disk image. The input type is detected automatically. The "
27765 "output disk image defaults to a raw ext2 image unless you specify extra "
27766 "flags (see L</OPTIONS> below)."
27770 #: ../tools/virt-make-fs.pl:67
27771 msgid "EXTRA SPACE"
27775 #: ../tools/virt-make-fs.pl:69
27777 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
27778 "the files that it contains, but might have extra space. Depending on how "
27779 "you are going to use the output, you might think this extra space is wasted "
27780 "and want to minimize it, or you might want to leave space so that more files "
27781 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
27782 "but you can use the C<--size> flag to leave space in the filesystem if you "
27787 #: ../tools/virt-make-fs.pl:77
27789 "An alternative way to leave extra space but not make the output image any "
27790 "bigger is to use an alternative disk image format (instead of the default "
27791 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
27792 "image format (check your hypervisor supports this before using it). This "
27793 "allows you to choose a large C<--size> but the extra space won't actually be "
27794 "allocated in the image until you try to store something in it."
27798 #: ../tools/virt-make-fs.pl:85
27800 "Don't forget that you can also use local commands including L<resize2fs(8)> "
27801 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
27802 "virt-make-resize to build another image from scratch."
27806 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
27811 #: ../tools/virt-make-fs.pl:91
27814 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
27819 #: ../tools/virt-make-fs.pl:93
27820 msgid "FILESYSTEM TYPE"
27824 #: ../tools/virt-make-fs.pl:95
27826 "The default filesystem type is C<ext2>. Just about any filesystem type that "
27827 "libguestfs supports can be used (but I<not> read-only formats like "
27828 "ISO9660). Here are some of the more common choices:"
27832 #: ../tools/virt-make-fs.pl:101
27837 #: ../tools/virt-make-fs.pl:103
27839 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
27840 "you are not going to use the filesystem in a way that requires the journal, "
27841 "then this is just wasted overhead."
27845 #: ../tools/virt-make-fs.pl:107
27846 msgid "I<ntfs> or I<vfat>"
27850 #: ../tools/virt-make-fs.pl:109
27851 msgid "Useful if exporting data to a Windows guest."
27855 #: ../tools/virt-make-fs.pl:111
27857 "I<Note for vfat>: The tar archive or local directory must only contain files "
27858 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
27859 "program running within libguestfs is unable to change the ownership of "
27860 "non-root files, since vfat itself does not support this."
27864 #: ../tools/virt-make-fs.pl:116
27869 #: ../tools/virt-make-fs.pl:118
27871 "Lower overhead than C<ext2>, but certain limitations on filename length and "
27872 "total filesystem size."
27876 #: ../tools/virt-make-fs.pl:125
27879 " virt-make-fs --type=minix input minixfs.img\n"
27884 #: ../tools/virt-make-fs.pl:127
27885 msgid "TO PARTITION OR NOT TO PARTITION"
27889 #: ../tools/virt-make-fs.pl:129
27890 msgid "Optionally virt-make-fs can add a partition table to the output disk."
27894 #: ../tools/virt-make-fs.pl:131
27896 "Adding a partition can make the disk image more compatible with certain "
27897 "virtualized operating systems which don't expect to see a filesystem "
27898 "directly located on a block device (Linux doesn't care and will happily "
27899 "handle both types)."
27903 #: ../tools/virt-make-fs.pl:136
27905 "On the other hand, if you have a partition table then the output image is no "
27906 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
27907 "directly on a partitioned disk image. (However libguestfs tools such as "
27908 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
27912 #: ../tools/virt-make-fs.pl:144
27913 msgid "Add an MBR partition:"
27917 #: ../tools/virt-make-fs.pl:146
27920 " virt-make-fs --partition -- input disk.img\n"
27925 #: ../tools/virt-make-fs.pl:148
27927 "If the output disk image could be terabyte-sized or larger, it's better to "
27928 "use an EFI/GPT-compatible partition table:"
27932 #: ../tools/virt-make-fs.pl:151
27935 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
27940 #: ../tools/virt-make-fs.pl:179
27941 msgid "Enable debugging information."
27945 #: ../tools/virt-make-fs.pl:185
27946 msgid "B<--size=E<lt>NE<gt>>"
27950 #: ../tools/virt-make-fs.pl:187
27951 msgid "B<--size=+E<lt>NE<gt>>"
27955 #: ../tools/virt-make-fs.pl:189
27956 msgid "B<-s E<lt>NE<gt>>"
27960 #: ../tools/virt-make-fs.pl:191
27961 msgid "B<-s +E<lt>NE<gt>>"
27965 #: ../tools/virt-make-fs.pl:193
27966 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
27970 #: ../tools/virt-make-fs.pl:196
27972 "If this option is I<not> given, then the output image will be just large "
27973 "enough to contain all the files, with not much wasted space."
27977 #: ../tools/virt-make-fs.pl:199
27979 "To choose a fixed size output disk, specify an absolute number followed by "
27980 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27981 "Petabytes or Exabytes. This must be large enough to contain all the input "
27982 "files, else you will get an error."
27986 #: ../tools/virt-make-fs.pl:204
27988 "To leave extra space, specify C<+> (plus sign) and a number followed by "
27989 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27990 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
27991 "the input files, and (approximately) an extra 200 MB free space."
27995 #: ../tools/virt-make-fs.pl:210
27997 "Note that virt-make-fs estimates free space, and therefore will not produce "
27998 "filesystems containing precisely the free space requested. (It is much more "
27999 "expensive and time-consuming to produce a filesystem which has precisely the "
28000 "desired free space)."
28004 #: ../tools/virt-make-fs.pl:219
28005 msgid "B<--format=E<lt>fmtE<gt>>"
28009 #: ../tools/virt-make-fs.pl:221
28010 msgid "B<-F E<lt>fmtE<gt>>"
28014 #: ../tools/virt-make-fs.pl:223
28015 msgid "Choose the output disk image format."
28019 #: ../tools/virt-make-fs.pl:225
28020 msgid "The default is C<raw> (raw disk image)."
28024 #: ../tools/virt-make-fs.pl:227
28026 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
28027 "that would really make sense here is C<qcow2>."
28031 #: ../tools/virt-make-fs.pl:234
28032 msgid "B<--type=E<lt>fsE<gt>>"
28036 #: ../tools/virt-make-fs.pl:236
28037 msgid "B<-t E<lt>fsE<gt>>"
28041 #: ../tools/virt-make-fs.pl:238
28042 msgid "Choose the output filesystem type."
28046 #: ../tools/virt-make-fs.pl:240
28047 msgid "The default is C<ext2>."
28051 #: ../tools/virt-make-fs.pl:242
28052 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
28056 #: ../tools/virt-make-fs.pl:249
28057 msgid "B<--partition>"
28061 #: ../tools/virt-make-fs.pl:251
28062 msgid "B<--partition=E<lt>parttypeE<gt>>"
28066 #: ../tools/virt-make-fs.pl:253
28068 "If specified, this flag adds an MBR partition table to the output disk "
28073 #: ../tools/virt-make-fs.pl:256
28075 "You can change the partition table type, eg. C<--partition=gpt> for large "
28080 #: ../tools/virt-make-fs.pl:259
28082 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
28083 "might consider the next parameter to be the partition type. For example:"
28087 #: ../tools/virt-make-fs.pl:263
28090 " virt-make-fs --partition input.tar ...\n"
28095 #: ../tools/virt-make-fs.pl:265
28097 "would cause virt-make-fs to think you wanted to use a partition type of "
28098 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
28099 "dash) between options and the input file argument:"
28103 #: ../tools/virt-make-fs.pl:269
28106 " virt-make-fs --partition -- input.tar ...\n"
28111 #: ../tools/virt-make-fs.pl:536
28113 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
28114 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
28115 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28119 #: ../tools/virt-make-fs.pl:553
28122 " export LIBGUESTFS_DEBUG=1\n"
28123 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
28128 #: ../tools/virt-make-fs.pl:556
28130 "Attach /tmp/virt-make-fs.log to a new bug report at "
28131 "L<https://bugzilla.redhat.com/>"
28135 #: ../tools/virt-list-partitions.pl:32
28136 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
28140 #: ../tools/virt-list-partitions.pl:36
28143 " virt-list-partitions [--options] domname\n"
28148 #: ../tools/virt-list-partitions.pl:38
28151 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
28156 #: ../tools/virt-list-partitions.pl:45
28158 "C<virt-list-partitions> is a command line tool to list the partitions that "
28159 "are contained in a virtual machine or disk image. It is mainly useful as a "
28160 "first step to using L<virt-resize(1)>."
28164 #: ../tools/virt-list-partitions.pl:50
28166 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
28167 "functionality. For more complex cases you should look at the "
28168 "L<guestfish(1)> tool."
28172 #: ../tools/virt-list-partitions.pl:107
28173 msgid "B<-h> | B<--human-readable>"
28177 #: ../tools/virt-list-partitions.pl:109
28178 msgid "Show sizes in human-readable form (eg. \"1G\")."
28182 #: ../tools/virt-list-partitions.pl:117
28184 "With this option, C<virt-list-partitions> displays the type and size of each "
28185 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
28189 #: ../tools/virt-list-partitions.pl:124
28190 msgid "B<-t> | B<--total>"
28194 #: ../tools/virt-list-partitions.pl:126
28195 msgid "Display the total size of each block device (as a separate row or rows)."
28199 #: ../tools/virt-list-partitions.pl:259
28201 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
28202 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
28203 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."