1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2010-09-18 09:23+0200\n"
11 "PO-Revision-Date: 2010-09-02 14:46+0100\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1
21 #: ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1
22 #: ../inspector/virt-inspector.pl:36 ../tools/virt-cat.pl:30
23 #: ../tools/virt-df.pl:32 ../tools/virt-edit.pl:31
24 #: ../tools/virt-list-filesystems.pl:28 ../tools/virt-list-partitions.pl:28
25 #: ../tools/virt-ls.pl:31 ../tools/virt-make-fs.pl:33
26 #: ../tools/virt-rescue.pl:29 ../tools/virt-resize.pl:38
27 #: ../tools/virt-tar.pl:30 ../tools/virt-win-reg.pl:34
32 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
33 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
34 #: ../inspector/virt-inspector.pl:38 ../tools/virt-cat.pl:32
35 #: ../tools/virt-df.pl:34 ../tools/virt-edit.pl:33
36 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
37 #: ../tools/virt-ls.pl:33 ../tools/virt-make-fs.pl:35
38 #: ../tools/virt-rescue.pl:31 ../tools/virt-resize.pl:40
39 #: ../tools/virt-tar.pl:32 ../tools/virt-win-reg.pl:36
44 #: ../src/guestfs.pod:5
45 msgid "guestfs - Library for accessing and modifying virtual machine images"
49 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
50 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
51 #: ../inspector/virt-inspector.pl:42 ../tools/virt-cat.pl:36
52 #: ../tools/virt-df.pl:38 ../tools/virt-edit.pl:37
53 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
54 #: ../tools/virt-ls.pl:37 ../tools/virt-make-fs.pl:39
55 #: ../tools/virt-rescue.pl:35 ../tools/virt-resize.pl:44
56 #: ../tools/virt-tar.pl:36 ../tools/virt-win-reg.pl:40
61 #: ../src/guestfs.pod:9
64 " #include <guestfs.h>\n"
69 #: ../src/guestfs.pod:11
72 " guestfs_h *g = guestfs_create ();\n"
73 " guestfs_add_drive (g, \"guest.img\");\n"
74 " guestfs_launch (g);\n"
75 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
76 " guestfs_touch (g, \"/hello\");\n"
77 " guestfs_umount (g, \"/\");\n"
78 " guestfs_sync (g);\n"
79 " guestfs_close (g);\n"
84 #: ../src/guestfs.pod:20
87 " cc prog.c -o prog -lguestfs\n"
89 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
94 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:115
95 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:16
96 #: ../inspector/virt-inspector.pl:48 ../tools/virt-cat.pl:42
97 #: ../tools/virt-df.pl:46 ../tools/virt-edit.pl:51
98 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
99 #: ../tools/virt-ls.pl:43 ../tools/virt-make-fs.pl:47
100 #: ../tools/virt-rescue.pl:51 ../tools/virt-resize.pl:50
101 #: ../tools/virt-tar.pl:73 ../tools/virt-win-reg.pl:64
106 #: ../src/guestfs.pod:26
108 "Libguestfs is a library for accessing and modifying guest disk images. "
109 "Amongst the things this is good for: making batch configuration changes to "
110 "guests, getting disk used/free statistics (see also: virt-df), migrating "
111 "between virtualization systems (see also: virt-p2v), performing partial "
112 "backups, performing partial guest clones, cloning guests and changing "
113 "registry/UUID/hostname info, and much else besides."
117 #: ../src/guestfs.pod:34
119 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
120 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
121 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
126 #: ../src/guestfs.pod:39
128 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
129 "what filesystem is in each LV, etc.). It can also run commands in the "
130 "context of the guest. Also you can access filesystems over FUSE."
134 #: ../src/guestfs.pod:44
136 "Libguestfs is a library that can be linked with C and C++ management "
137 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
138 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
143 #: ../src/guestfs.pod:49
145 "You don't need to be root to use libguestfs, although obviously you do need "
146 "enough permissions to access the disk images."
150 #: ../src/guestfs.pod:52
152 "Libguestfs is a large API because it can do many things. For a gentle "
153 "introduction, please read the L</API OVERVIEW> section next."
157 #: ../src/guestfs.pod:55
162 #: ../src/guestfs.pod:57
164 "This section provides a gentler overview of the libguestfs API. We also try "
165 "to group API calls together, where that may not be obvious from reading "
166 "about the individual calls in the main section of this manual."
170 #: ../src/guestfs.pod:62
175 #: ../src/guestfs.pod:64
177 "Before you can use libguestfs calls, you have to create a handle. Then you "
178 "must add at least one disk image to the handle, followed by launching the "
179 "handle, then performing whatever operations you want, and finally closing "
180 "the handle. By convention we use the single letter C<g> for the name of the "
181 "handle variable, although of course you can use any name you want."
185 #: ../src/guestfs.pod:71
186 msgid "The general structure of all libguestfs-using programs looks like this:"
190 #: ../src/guestfs.pod:74
193 " guestfs_h *g = guestfs_create ();\n"
198 #: ../src/guestfs.pod:76
201 " /* Call guestfs_add_drive additional times if there are\n"
202 " * multiple disk images.\n"
204 " guestfs_add_drive (g, \"guest.img\");\n"
209 #: ../src/guestfs.pod:81
212 " /* Most manipulation calls won't work until you've launched\n"
213 " * the handle 'g'. You have to do this _after_ adding drives\n"
214 " * and _before_ other commands.\n"
216 " guestfs_launch (g);\n"
221 #: ../src/guestfs.pod:87
224 " /* Now you can examine what partitions, LVs etc are available.\n"
226 " char **partitions = guestfs_list_partitions (g);\n"
227 " char **logvols = guestfs_lvs (g);\n"
232 #: ../src/guestfs.pod:92
235 " /* To access a filesystem in the image, you must mount it.\n"
237 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
242 #: ../src/guestfs.pod:96
245 " /* Now you can perform filesystem actions on the guest\n"
248 " guestfs_touch (g, \"/hello\");\n"
253 #: ../src/guestfs.pod:101
256 " /* You only need to call guestfs_sync if you have made\n"
257 " * changes to the guest image. (But if you've made changes\n"
258 " * then you *must* sync). See also: guestfs_umount and\n"
259 " * guestfs_umount_all calls.\n"
261 " guestfs_sync (g);\n"
266 #: ../src/guestfs.pod:108
269 " /* Close the handle 'g'. */\n"
270 " guestfs_close (g);\n"
275 #: ../src/guestfs.pod:111
277 "The code above doesn't include any error checking. In real code you should "
278 "check return values carefully for errors. In general all functions that "
279 "return integers return C<-1> on error, and all functions that return "
280 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
281 "how to handle errors, and consult the documentation for each function call "
282 "below to see precisely how they return error indications."
286 #: ../src/guestfs.pod:119
291 #: ../src/guestfs.pod:121
293 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
294 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
295 "actual block device, or simply an empty file of zeroes that you have created "
296 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
301 #: ../src/guestfs.pod:127
303 "You can add a disk read-only using L</guestfs_add_drive_ro>, in which case "
304 "libguestfs won't modify the file."
308 #: ../src/guestfs.pod:130
310 "Be extremely cautious if the disk image is in use, eg. if it is being used "
311 "by a virtual machine. Adding it read-write will almost certainly cause disk "
312 "corruption, but adding it read-only is safe."
316 #: ../src/guestfs.pod:134
318 "You must add at least one disk image, and you may add multiple disk images. "
319 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
320 "first one you added), C</dev/sdb> (for the second one you added), etc."
324 #: ../src/guestfs.pod:139
326 "Once L</guestfs_launch> has been called you cannot add any more images. You "
327 "can call L</guestfs_list_devices> to get a list of the device names, in the "
328 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
332 #: ../src/guestfs.pod:144
337 #: ../src/guestfs.pod:146
339 "Before you can read or write files, create directories and so on in a disk "
340 "image that contains filesystems, you have to mount those filesystems using "
341 "L</guestfs_mount>. If you already know that a disk image contains (for "
342 "example) one partition with a filesystem on that partition, then you can "
347 #: ../src/guestfs.pod:152
350 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
355 #: ../src/guestfs.pod:154
357 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
358 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
359 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
363 #: ../src/guestfs.pod:158
365 "If you are given a disk image and you don't know what it contains then you "
366 "have to find out. Libguestfs can do that too: use L</"
367 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
368 "LVs, and either try mounting each to see what is mountable, or else examine "
369 "them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also has a "
370 "set of APIs for inspection of disk images (see L</INSPECTION> below). But "
371 "you might find it easier to look at higher level programs built on top of "
372 "libguestfs, in particular L<virt-inspector(1)>."
376 #: ../src/guestfs.pod:168
378 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
379 "several other variations of the C<guestfs_mount_*> call."
383 #: ../src/guestfs.pod:171
384 msgid "FILESYSTEM ACCESS AND MODIFICATION"
388 #: ../src/guestfs.pod:173
390 "The majority of the libguestfs API consists of fairly low-level calls for "
391 "accessing and modifying the files, directories, symlinks etc on mounted "
392 "filesystems. There are over a hundred such calls which you can find listed "
393 "in detail below in this man page, and we don't even pretend to cover them "
394 "all in this overview."
398 #: ../src/guestfs.pod:179
400 "Specify filenames as full paths, starting with C<\"/\"> and including the "
405 #: ../src/guestfs.pod:182
407 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
408 "the file called C<\"etc/passwd\"> then you could do:"
412 #: ../src/guestfs.pod:185
415 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
420 #: ../src/guestfs.pod:187
422 "This would return C<data> as a newly allocated buffer containing the full "
423 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
424 "or C<NULL> if there was an error."
428 #: ../src/guestfs.pod:191
430 "As another example, to create a top-level directory on that filesystem "
431 "called C<\"var\"> you would do:"
435 #: ../src/guestfs.pod:194
438 " guestfs_mkdir (g, \"/var\");\n"
443 #: ../src/guestfs.pod:196
444 msgid "To create a symlink you could do:"
448 #: ../src/guestfs.pod:198
451 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
452 " \"/etc/rc3.d/S30portmap\");\n"
457 #: ../src/guestfs.pod:201
459 "Libguestfs will reject attempts to use relative paths and there is no "
460 "concept of a current working directory."
464 #: ../src/guestfs.pod:204
466 "Libguestfs can return errors in many situations: for example if the "
467 "filesystem isn't writable, or if a file or directory that you requested "
468 "doesn't exist. If you are using the C API (documented here) you have to "
469 "check for those error conditions after each call. (Other language bindings "
470 "turn these errors into exceptions)."
474 #: ../src/guestfs.pod:210
476 "File writes are affected by the per-handle umask, set by calling L</"
477 "guestfs_umask> and defaulting to 022. See L</UMASK>."
481 #: ../src/guestfs.pod:213
486 #: ../src/guestfs.pod:215
488 "Libguestfs contains API calls to read, create and modify partition tables on "
493 #: ../src/guestfs.pod:218
495 "In the common case where you want to create a single partition covering the "
496 "whole disk, you should use the L</guestfs_part_disk> call:"
500 #: ../src/guestfs.pod:222
503 " const char *parttype = \"mbr\";\n"
504 " if (disk_is_larger_than_2TB)\n"
505 " parttype = \"gpt\";\n"
506 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
511 #: ../src/guestfs.pod:227
513 "Obviously this effectively wipes anything that was on that disk image before."
517 #: ../src/guestfs.pod:230
522 #: ../src/guestfs.pod:232
524 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
525 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
526 "you familiarize yourself with the concepts of physical volumes, volume "
527 "groups and logical volumes."
531 #: ../src/guestfs.pod:237
533 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
534 "tldp.org/HOWTO/LVM-HOWTO/>."
538 #: ../src/guestfs.pod:240
543 #: ../src/guestfs.pod:242
545 "Use L</guestfs_cat> to download small, text only files. This call is "
546 "limited to files which are less than 2 MB and which cannot contain any ASCII "
547 "NUL (C<\\0>) characters. However it has a very simple to use API."
551 #: ../src/guestfs.pod:247
553 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
554 "bit data, since it returns a (pointer, size) pair. However it is still "
555 "limited to \"small\" files, less than 2 MB."
559 #: ../src/guestfs.pod:251
561 "L</guestfs_download> can be used to download any file, with no limits on "
562 "content or size (even files larger than 4 GB)."
566 #: ../src/guestfs.pod:254
568 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
572 #: ../src/guestfs.pod:257
577 #: ../src/guestfs.pod:259
579 "It's often the case that you want to write a file or files to the disk image."
583 #: ../src/guestfs.pod:262
585 "To write a small file with fixed content, use L</guestfs_write>. To create "
586 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
587 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
588 "of other functions for creating test files, for example L</guestfs_fill> and "
589 "L</guestfs_fill_pattern>."
593 #: ../src/guestfs.pod:268
595 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
596 "file content or size (even files larger than 4 GB)."
600 #: ../src/guestfs.pod:271
602 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
606 #: ../src/guestfs.pod:273
608 "However the fastest way to upload I<large numbers of arbitrary files> is to "
609 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
610 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
611 "in a predictable way (eg. adding it last after all other drives) then you "
612 "can get the device name from L</guestfs_list_devices> and mount it directly "
613 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
614 "portable between kernel versions, and they don't support labels or UUIDs. "
615 "If you want to pre-build an image or you need to mount it using a label or "
616 "UUID, use an ISO image instead."
620 #: ../src/guestfs.pod:284
625 #: ../src/guestfs.pod:286
627 "There are various different commands for copying between files and devices "
628 "and in and out of the guest filesystem. These are summarised in the table "
633 #: ../src/guestfs.pod:292
634 msgid "B<file> to B<file>"
638 #: ../src/guestfs.pod:294
640 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
641 "directories recursively."
645 #: ../src/guestfs.pod:297
646 msgid "B<file or device> to B<file or device>"
650 #: ../src/guestfs.pod:299
652 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
653 "devices in the guest."
657 #: ../src/guestfs.pod:302
658 msgid "Example: duplicate the contents of an LV:"
662 #: ../src/guestfs.pod:304
665 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
670 #: ../src/guestfs.pod:306
672 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
673 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
674 "guestfs_copy_size>."
678 #: ../src/guestfs.pod:310
679 msgid "B<file on the host> to B<file or device>"
683 #: ../src/guestfs.pod:312
684 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
688 #: ../src/guestfs.pod:314
689 msgid "B<file or device> to B<file on the host>"
693 #: ../src/guestfs.pod:316
694 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
698 #: ../src/guestfs.pod:320
699 msgid "LISTING FILES"
703 #: ../src/guestfs.pod:322
705 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
706 "L<guestfish(1)>-equivalent command C<ll>)."
710 #: ../src/guestfs.pod:325
712 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
713 "programs, as a flat list of strings."
717 #: ../src/guestfs.pod:328
719 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
720 "directory, plus additional information about each one. It is more "
721 "equivalent to using the L<readdir(3)> call on a local filesystem."
725 #: ../src/guestfs.pod:332
727 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
731 #: ../src/guestfs.pod:335
732 msgid "RUNNING COMMANDS"
736 #: ../src/guestfs.pod:337
738 "Although libguestfs is primarily an API for manipulating files inside guest "
739 "images, we also provide some limited facilities for running commands inside "
744 #: ../src/guestfs.pod:341
745 msgid "There are many limitations to this:"
749 #: ../src/guestfs.pod:345 ../src/guestfs.pod:350 ../src/guestfs.pod:355
750 #: ../src/guestfs.pod:359 ../src/guestfs.pod:364 ../src/guestfs.pod:368
751 #: ../src/guestfs.pod:373 ../src/guestfs.pod:1223 ../src/guestfs.pod:1228
752 #: ../src/guestfs.pod:1232 ../src/guestfs.pod:1334 ../src/guestfs.pod:1338
753 #: ../src/guestfs.pod:1342 ../src/guestfs.pod:1347 ../src/guestfs.pod:1355
754 #: ../src/guestfs.pod:1374 ../src/guestfs.pod:1382 ../src/guestfs.pod:1612
755 #: ../src/guestfs.pod:1618 ../src/guestfs.pod:1623 ../src/guestfs.pod:1629
756 #: ../src/guestfs.pod:1736 ../src/guestfs.pod:1740 ../src/guestfs.pod:1744
757 #: ../src/guestfs.pod:1748 ../src/guestfs-actions.pod:14
758 #: ../src/guestfs-actions.pod:21 ../src/guestfs-actions.pod:372
759 #: ../src/guestfs-actions.pod:380 ../src/guestfs-actions.pod:387
760 #: ../src/guestfs-actions.pod:394 ../src/guestfs-actions.pod:1257
761 #: ../src/guestfs-actions.pod:1261 ../src/guestfs-actions.pod:1265
762 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:1277
763 #: ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:1285
764 #: ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1299
765 #: ../src/guestfs-actions.pod:1303 ../src/guestfs-actions.pod:1426
766 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1435
767 #: ../src/guestfs-actions.pod:1440 ../src/guestfs-actions.pod:1492
768 #: ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:1501
769 #: ../fish/guestfish.pod:309 ../fish/guestfish.pod:313
770 #: ../fish/guestfish.pod:317 ../fish/guestfish.pod:321
771 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
772 #: ../fish/guestfish-actions.pod:300 ../fish/guestfish-actions.pod:308
773 #: ../fish/guestfish-actions.pod:315 ../fish/guestfish-actions.pod:322
774 #: ../fish/guestfish-actions.pod:998 ../fish/guestfish-actions.pod:1002
775 #: ../fish/guestfish-actions.pod:1006 ../fish/guestfish-actions.pod:1010
776 #: ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1022
777 #: ../fish/guestfish-actions.pod:1026 ../fish/guestfish-actions.pod:1036
778 #: ../fish/guestfish-actions.pod:1040 ../fish/guestfish-actions.pod:1044
779 #: ../fish/guestfish-actions.pod:1134 ../fish/guestfish-actions.pod:1138
780 #: ../fish/guestfish-actions.pod:1143 ../fish/guestfish-actions.pod:1148
781 #: ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1194
782 #: ../fish/guestfish-actions.pod:1199 ../tools/virt-resize.pl:324
783 #: ../tools/virt-resize.pl:329 ../tools/virt-resize.pl:339
788 #: ../src/guestfs.pod:347
790 "The kernel version that the command runs under will be different from what "
795 #: ../src/guestfs.pod:352
797 "If the command needs to communicate with daemons, then most likely they "
802 #: ../src/guestfs.pod:357
803 msgid "The command will be running in limited memory."
807 #: ../src/guestfs.pod:361
809 "The network may not be available unless you enable it (see L</"
810 "guestfs_set_network>)."
814 #: ../src/guestfs.pod:366
815 msgid "Only supports Linux guests (not Windows, BSD, etc)."
819 #: ../src/guestfs.pod:370
821 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
825 #: ../src/guestfs.pod:375
827 "For SELinux guests, you may need to enable SELinux and load policy first. "
828 "See L</SELINUX> in this manpage."
832 #: ../src/guestfs.pod:380
834 "The two main API calls to run commands are L</guestfs_command> and L</"
835 "guestfs_sh> (there are also variations)."
839 #: ../src/guestfs.pod:383
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:386
847 msgid "CONFIGURATION FILES"
851 #: ../src/guestfs.pod:388
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:393
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:397
870 "If you don't want to use Augeas (you fool!) then try calling L</"
871 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
876 #: ../src/guestfs.pod:401
881 #: ../src/guestfs.pod:403
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:409
893 #: ../src/guestfs.pod:411
894 msgid "Before launching, do:"
898 #: ../src/guestfs.pod:413
901 " guestfs_set_selinux (g, 1);\n"
906 #: ../src/guestfs.pod:415
911 #: ../src/guestfs.pod:417
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:421
921 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
926 #: ../src/guestfs.pod:423
928 "(Older versions of C<load_policy> require you to specify the name of the "
933 #: ../src/guestfs.pod:426
938 #: ../src/guestfs.pod:428
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:432
948 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
953 #: ../src/guestfs.pod:436
954 msgid "This will work for running commands and editing existing files."
958 #: ../src/guestfs.pod:438
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:442
970 #: ../src/guestfs.pod:444
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:450
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:453
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 L</"
991 "guestfs_chmod> after creating each file or directory."
995 #: ../src/guestfs.pod:457
996 msgid "For more information about umask, see L<umask(2)>."
1000 #: ../src/guestfs.pod:459 ../fish/guestfish.pod:559
1001 msgid "ENCRYPTED DISKS"
1005 #: ../src/guestfs.pod:461
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:467
1016 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1017 "returns the string C<crypto_LUKS>)."
1021 #: ../src/guestfs.pod:470
1023 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1024 "will require the passphrase!"
1028 #: ../src/guestfs.pod:473
1030 "Opening a LUKS device creates a new device mapper device called C</dev/"
1031 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1032 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1033 "from and encrypted to the underlying block device respectively."
1037 #: ../src/guestfs.pod:479
1039 "LVM volume groups on the device can be made visible by calling L</"
1040 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1041 "(s) can now be mounted in the usual way."
1045 #: ../src/guestfs.pod:483
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 L</"
1050 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1051 "underlying encrypted block device)."
1055 #: ../src/guestfs.pod:490
1060 #: ../src/guestfs.pod:492
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:498
1072 "Add all disks belonging to the unknown virtual machine and call L</"
1073 "guestfs_launch> in the usual way."
1077 #: ../src/guestfs.pod:501
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:510
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 L</"
1094 "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:516
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:523
1113 " /boot => /dev/sda1\n"
1114 " / => /dev/vg_guest/lv_root\n"
1115 " /usr => /dev/vg_guest/lv_usr\n"
1120 #: ../src/guestfs.pod:527
1122 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1123 "filesystems as suggested."
1127 #: ../src/guestfs.pod:530
1129 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1130 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1134 #: ../src/guestfs.pod:534
1136 "Inspection currently only works for some common operating systems. "
1137 "Contributors are welcome to send patches for other operating systems that we "
1138 "currently cannot detect."
1142 #: ../src/guestfs.pod:538
1144 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1145 "for more details. The L</guestfs_inspect_os> function just ignores any "
1146 "encrypted devices."
1150 #: ../src/guestfs.pod:542
1152 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1153 "inspection and caches the results in the guest handle. Subsequent calls to "
1154 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1155 "read the disks. If you change the content of the guest disks, you can redo "
1156 "inspection by calling L</guestfs_inspect_os> again."
1160 #: ../src/guestfs.pod:549
1161 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1165 #: ../src/guestfs.pod:551
1167 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1168 "ntfs-3g.org/> driver."
1172 #: ../src/guestfs.pod:554
1174 "DOS and Windows still use drive letters, and the filesystems are always "
1175 "treated as case insensitive by Windows itself, and therefore you might find "
1176 "a Windows configuration file referring to a path like C<c:\\windows"
1177 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1178 "might be referred to as C</WINDOWS/System32>."
1182 #: ../src/guestfs.pod:560
1184 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1185 "libguestfs to read the appropriate Windows Registry and configuration files, "
1186 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1191 #: ../src/guestfs.pod:565
1193 "Replacing backslash characters with forward slash characters is also outside "
1194 "the scope of libguestfs, but something that you can easily do."
1198 #: ../src/guestfs.pod:568
1200 "Where we can help is in resolving the case insensitivity of paths. For "
1201 "this, call L</guestfs_case_sensitive_path>."
1205 #: ../src/guestfs.pod:571
1207 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1208 "files, through the library C<hivex> which is part of the libguestfs project "
1209 "although ships as a separate tarball. You have to locate and download the "
1210 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1211 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1212 "reg(1)> for more help on this issue."
1216 #: ../src/guestfs.pod:579
1217 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1221 #: ../src/guestfs.pod:581
1223 "Although we don't want to discourage you from using the C API, we will "
1224 "mention here that the same API is also available in other languages."
1228 #: ../src/guestfs.pod:584
1230 "The API is broadly identical in all supported languages. This means that "
1231 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1232 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1233 "words, a straightforward, predictable isomorphism between each language."
1237 #: ../src/guestfs.pod:590
1239 "Error messages are automatically transformed into exceptions if the language "
1244 #: ../src/guestfs.pod:593
1246 "We don't try to \"object orientify\" parts of the API in OO languages, "
1247 "although contributors are welcome to write higher level APIs above what we "
1248 "provide in their favourite languages if they wish."
1252 #: ../src/guestfs.pod:599
1257 #: ../src/guestfs.pod:601
1259 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1260 "identical to the C API. C++ classes and exceptions are not used."
1264 #: ../src/guestfs.pod:605
1269 #: ../src/guestfs.pod:607
1271 "The C# bindings are highly experimental. Please read the warnings at the "
1272 "top of C<csharp/Libguestfs.cs>."
1276 #: ../src/guestfs.pod:610
1281 #: ../src/guestfs.pod:612
1283 "This is the only language binding that is working but incomplete. Only "
1284 "calls which return simple integers have been bound in Haskell, and we are "
1285 "looking for help to complete this binding."
1289 #: ../src/guestfs.pod:616
1294 #: ../src/guestfs.pod:618
1296 "Full documentation is contained in the Javadoc which is distributed with "
1301 #: ../src/guestfs.pod:621
1306 #: ../src/guestfs.pod:623
1307 msgid "For documentation see the file C<guestfs.mli>."
1311 #: ../src/guestfs.pod:625
1316 #: ../src/guestfs.pod:627
1317 msgid "For documentation see L<Sys::Guestfs(3)>."
1321 #: ../src/guestfs.pod:629
1326 #: ../src/guestfs.pod:631
1328 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1329 "the php-libguestfs package for your distribution."
1333 #: ../src/guestfs.pod:634
1334 msgid "The PHP binding only works correctly on 64 bit machines."
1338 #: ../src/guestfs.pod:636
1343 #: ../src/guestfs.pod:638
1344 msgid "For documentation do:"
1348 #: ../src/guestfs.pod:640
1352 " >>> import guestfs\n"
1353 " >>> help (guestfs)\n"
1358 #: ../src/guestfs.pod:644
1363 #: ../src/guestfs.pod:646
1365 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1366 "can find examples written in Ruby in the libguestfs source."
1370 #: ../src/guestfs.pod:649
1371 msgid "B<shell scripts>"
1375 #: ../src/guestfs.pod:651
1376 msgid "For documentation see L<guestfish(1)>."
1380 #: ../src/guestfs.pod:655
1381 msgid "LIBGUESTFS GOTCHAS"
1385 #: ../src/guestfs.pod:657
1387 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1388 "system [...] that works in the way it is documented but is counterintuitive "
1389 "and almost invites mistakes.\""
1393 #: ../src/guestfs.pod:661
1395 "Since we developed libguestfs and the associated tools, there are several "
1396 "things we would have designed differently, but are now stuck with for "
1397 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1398 "release, you can expect these to change. Beware of them."
1402 #: ../src/guestfs.pod:669
1403 msgid "Autosync / forgetting to sync."
1407 #: ../src/guestfs.pod:671
1409 "When modifying a filesystem from C or another language, you B<must> unmount "
1410 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1411 "libguestfs handle. You can also call:"
1415 #: ../src/guestfs.pod:675
1418 " guestfs_set_autosync (g, 1);\n"
1423 #: ../src/guestfs.pod:677
1425 "to have the unmount/sync done automatically for you when the handle 'g' is "
1426 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1430 #: ../src/guestfs.pod:681
1432 "If you forget to do this, then it is entirely possible that your changes "
1433 "won't be written out, or will be partially written, or (very rarely) that "
1434 "you'll get disk corruption."
1438 #: ../src/guestfs.pod:685
1440 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1441 "guestfish scripts that forget to sync will work just fine, which can make "
1442 "this very puzzling if you are trying to debug a problem."
1446 #: ../src/guestfs.pod:689
1447 msgid "Mount option C<-o sync> should not be the default."
1451 #: ../src/guestfs.pod:691
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:695
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:698
1467 msgid "Read-only should be the default."
1471 #: ../src/guestfs.pod:700
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:703
1479 msgid "This would reduce the potential to corrupt live VM images."
1483 #: ../src/guestfs.pod:705
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 L</"
1487 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1491 #: ../src/guestfs.pod:709
1492 msgid "guestfish command line is hard to use."
1496 #: ../src/guestfs.pod:711
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:718
1507 msgid "guestfish megabyte modifiers don't work right on all commands"
1511 #: ../src/guestfs.pod:720
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:727
1522 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1526 #: ../src/guestfs.pod:729
1529 " lvcreate LV VG 100M\n"
1534 #: ../src/guestfs.pod:731
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:736
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:739
1551 msgid "Library should return errno with error messages."
1555 #: ../src/guestfs.pod:741
1557 "It would be a nice-to-have to be able to get the original value of 'errno' "
1558 "from inside the appliance along error paths (where set). Currently "
1559 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1560 "string into an errno, see the function error() in fuse/guestmount.c."
1564 #: ../src/guestfs.pod:747
1566 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1567 "sent back from the daemon."
1571 #: ../src/guestfs.pod:752
1572 msgid "PROTOCOL LIMITS"
1576 #: ../src/guestfs.pod:754
1578 "Internally libguestfs uses a message-based protocol to pass API calls and "
1579 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1580 "plenty more detail about this). The maximum message size used by the "
1581 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1582 "aware of this limit. The API calls which may be affected are individually "
1583 "documented, with a link back to this section of the documentation."
1587 #: ../src/guestfs.pod:762
1589 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1590 "a simple string. Because this string is at some point internally encoded as "
1591 "a message, the maximum size that it can return is slightly under 4 MB. If "
1592 "the requested file is larger than this then you will get an error."
1596 #: ../src/guestfs.pod:768
1598 "In order to transfer large files into and out of the guest filesystem, you "
1599 "need to use particular calls that support this. The sections L</UPLOADING> "
1600 "and L</DOWNLOADING> document how to do this."
1604 #: ../src/guestfs.pod:772
1606 "You might also consider mounting the disk image using our FUSE filesystem "
1607 "support (L<guestmount(1)>)."
1611 #: ../src/guestfs.pod:775
1612 msgid "KEYS AND PASSPHRASES"
1616 #: ../src/guestfs.pod:777
1618 "Certain libguestfs calls take a parameter that contains sensitive key "
1619 "material, passed in as a C string."
1623 #: ../src/guestfs.pod:780
1625 "In the future we would hope to change the libguestfs implementation so that "
1626 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1627 "swap. However this is I<not> done at the moment, because of the complexity "
1628 "of such an implementation."
1632 #: ../src/guestfs.pod:785
1634 "Therefore you should be aware that any key parameter you pass to libguestfs "
1635 "might end up being written out to the swap partition. If this is a concern, "
1636 "scrub the swap partition or don't use libguestfs on encrypted devices."
1640 #: ../src/guestfs.pod:790
1641 msgid "CONNECTION MANAGEMENT"
1645 #: ../src/guestfs.pod:792
1650 #: ../src/guestfs.pod:794
1652 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1653 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1654 "handle and release all resources used."
1658 #: ../src/guestfs.pod:798
1660 "For information on using multiple handles and threads, see the section L</"
1661 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1665 #: ../src/guestfs.pod:801
1666 msgid "guestfs_create"
1670 #: ../src/guestfs.pod:803
1673 " guestfs_h *guestfs_create (void);\n"
1678 #: ../src/guestfs.pod:805
1679 msgid "Create a connection handle."
1683 #: ../src/guestfs.pod:807
1684 msgid "You have to call L</guestfs_add_drive> on the handle at least once."
1688 #: ../src/guestfs.pod:809
1690 "This function returns a non-NULL pointer to a handle on success or NULL on "
1695 #: ../src/guestfs.pod:812
1696 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1700 #: ../src/guestfs.pod:814
1702 "You may also want to configure error handling for the handle. See L</ERROR "
1703 "HANDLING> section below."
1707 #: ../src/guestfs.pod:817
1708 msgid "guestfs_close"
1712 #: ../src/guestfs.pod:819
1715 " void guestfs_close (guestfs_h *g);\n"
1720 #: ../src/guestfs.pod:821
1721 msgid "This closes the connection handle and frees up all resources used."
1725 #: ../src/guestfs.pod:823
1726 msgid "ERROR HANDLING"
1730 #: ../src/guestfs.pod:825
1732 "The convention in all functions that return C<int> is that they return C<-1> "
1733 "to indicate an error. You can get additional information on errors by "
1734 "calling L</guestfs_last_error> and/or by setting up an error handler with L</"
1735 "guestfs_set_error_handler>."
1739 #: ../src/guestfs.pod:830
1740 msgid "The default error handler prints the information string to C<stderr>."
1744 #: ../src/guestfs.pod:832
1746 "Out of memory errors are handled differently. The default action is to call "
1747 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
1748 "guestfs_set_out_of_memory_handler>."
1752 #: ../src/guestfs.pod:836
1753 msgid "guestfs_last_error"
1757 #: ../src/guestfs.pod:838
1760 " const char *guestfs_last_error (guestfs_h *g);\n"
1765 #: ../src/guestfs.pod:840
1767 "This returns the last error message that happened on C<g>. If there has not "
1768 "been an error since the handle was created, then this returns C<NULL>."
1772 #: ../src/guestfs.pod:844
1774 "The lifetime of the returned string is until the next error occurs, or L</"
1775 "guestfs_close> is called."
1779 #: ../src/guestfs.pod:847
1781 "The error string is not localized (ie. is always in English), because this "
1782 "makes searching for error messages in search engines give the largest number "
1787 #: ../src/guestfs.pod:851
1788 msgid "guestfs_set_error_handler"
1792 #: ../src/guestfs.pod:853
1795 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1797 " const char *msg);\n"
1798 " void guestfs_set_error_handler (guestfs_h *g,\n"
1799 " guestfs_error_handler_cb cb,\n"
1805 #: ../src/guestfs.pod:860
1807 "The callback C<cb> will be called if there is an error. The parameters "
1808 "passed to the callback are an opaque data pointer and the error message "
1813 #: ../src/guestfs.pod:864
1815 "Note that the message string C<msg> is freed as soon as the callback "
1816 "function returns, so if you want to stash it somewhere you must make your "
1821 #: ../src/guestfs.pod:868
1822 msgid "The default handler prints messages on C<stderr>."
1826 #: ../src/guestfs.pod:870
1827 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1831 #: ../src/guestfs.pod:872
1832 msgid "guestfs_get_error_handler"
1836 #: ../src/guestfs.pod:874
1839 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1840 " void **opaque_rtn);\n"
1845 #: ../src/guestfs.pod:877
1846 msgid "Returns the current error handler callback."
1850 #: ../src/guestfs.pod:879
1851 msgid "guestfs_set_out_of_memory_handler"
1855 #: ../src/guestfs.pod:881
1858 " typedef void (*guestfs_abort_cb) (void);\n"
1859 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1860 " guestfs_abort_cb);\n"
1865 #: ../src/guestfs.pod:885
1867 "The callback C<cb> will be called if there is an out of memory situation. "
1868 "I<Note this callback must not return>."
1872 #: ../src/guestfs.pod:888
1873 msgid "The default is to call L<abort(3)>."
1877 #: ../src/guestfs.pod:890
1879 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
1883 #: ../src/guestfs.pod:893
1884 msgid "guestfs_get_out_of_memory_handler"
1888 #: ../src/guestfs.pod:895
1891 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
1896 #: ../src/guestfs.pod:897
1897 msgid "This returns the current out of memory handler."
1901 #: ../src/guestfs.pod:899
1906 #: ../src/guestfs.pod:901
1908 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1913 #: ../src/guestfs.pod:904
1915 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1916 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1920 #: ../src/guestfs.pod:907
1922 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1923 "to change the directories that libguestfs will search in. The value is a "
1924 "colon-separated list of paths. The current directory is I<not> searched "
1925 "unless the path contains an empty element or C<.>. For example "
1926 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1927 "then C</usr/lib/guestfs>."
1931 #: ../src/guestfs.pod:914
1932 msgid "HIGH-LEVEL API ACTIONS"
1936 #: ../src/guestfs.pod:916
1937 msgid "ABI GUARANTEE"
1941 #: ../src/guestfs.pod:918
1943 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1944 "actions as outlined in this section. Although we will deprecate some "
1945 "actions, for example if they get replaced by newer calls, we will keep the "
1946 "old actions forever. This allows you the developer to program in confidence "
1947 "against the libguestfs API."
1951 #: ../src/guestfs.pod:924 ../fish/guestfish.pod:789
1956 #: ../src/guestfs.pod:926
1961 #: ../src/guestfs.pod:928
1966 #: ../src/guestfs.pod:930
1967 msgid "AVAILABILITY"
1971 #: ../src/guestfs.pod:932
1972 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
1976 #: ../src/guestfs.pod:934
1978 "Using L</guestfs_available> you can test availability of the following "
1979 "groups of functions. This test queries the appliance to see if the "
1980 "appliance you are currently using supports the functionality."
1984 #: ../src/guestfs.pod:939
1985 msgid "@AVAILABILITY@"
1989 #: ../src/guestfs.pod:941
1990 msgid "GUESTFISH supported COMMAND"
1994 #: ../src/guestfs.pod:943
1996 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
1997 "prints out the available groups and whether they are supported by this build "
1998 "of libguestfs. Note however that you have to do C<run> first."
2002 #: ../src/guestfs.pod:948
2003 msgid "SINGLE CALLS AT COMPILE TIME"
2007 #: ../src/guestfs.pod:950
2009 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2010 "function, such as:"
2014 #: ../src/guestfs.pod:953
2017 " #define LIBGUESTFS_HAVE_DD 1\n"
2022 #: ../src/guestfs.pod:955
2023 msgid "if L</guestfs_dd> is available."
2027 #: ../src/guestfs.pod:957
2029 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2030 "function is available at compile time, we recommended using build tools such "
2031 "as autoconf or cmake. For example in autotools you could use:"
2035 #: ../src/guestfs.pod:962
2038 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2039 " AC_CHECK_FUNCS([guestfs_dd])\n"
2044 #: ../src/guestfs.pod:965
2046 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2051 #: ../src/guestfs.pod:968
2052 msgid "SINGLE CALLS AT RUN TIME"
2056 #: ../src/guestfs.pod:970
2058 "Testing at compile time doesn't guarantee that a function really exists in "
2059 "the library. The reason is that you might be dynamically linked against a "
2060 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2061 "This situation unfortunately results in a segmentation fault, which is a "
2062 "shortcoming of the C dynamic linking system itself."
2066 #: ../src/guestfs.pod:977
2068 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2069 "in this example program (note that you still need the compile time check as "
2074 #: ../src/guestfs.pod:981
2077 " #include <stdio.h>\n"
2078 " #include <stdlib.h>\n"
2079 " #include <unistd.h>\n"
2080 " #include <dlfcn.h>\n"
2081 " #include <guestfs.h>\n"
2086 #: ../src/guestfs.pod:987
2091 " #ifdef LIBGUESTFS_HAVE_DD\n"
2093 " int has_function;\n"
2098 #: ../src/guestfs.pod:993
2101 " /* Test if the function guestfs_dd is really available. */\n"
2102 " dl = dlopen (NULL, RTLD_LAZY);\n"
2104 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2105 " exit (EXIT_FAILURE);\n"
2107 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2113 #: ../src/guestfs.pod:1002
2116 " if (!has_function)\n"
2117 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2119 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2120 " /* Now it's safe to call\n"
2121 " guestfs_dd (g, \"foo\", \"bar\");\n"
2125 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2132 #: ../src/guestfs.pod:1015
2134 "You may think the above is an awful lot of hassle, and it is. There are "
2135 "other ways outside of the C linking system to ensure that this kind of "
2136 "incompatibility never arises, such as using package versioning:"
2140 #: ../src/guestfs.pod:1020
2143 " Requires: libguestfs >= 1.0.80\n"
2148 #: ../src/guestfs.pod:1022 ../src/guestfs.pod:1027
2153 #: ../src/guestfs.pod:1024
2155 "<!-- old anchor for the next section --> <a name="
2156 "\"state_machine_and_low_level_event_api\"/>"
2160 #: ../src/guestfs.pod:1029
2161 msgid "ARCHITECTURE"
2165 #: ../src/guestfs.pod:1031
2167 "Internally, libguestfs is implemented by running an appliance (a special "
2168 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2169 "process of the main program."
2173 #: ../src/guestfs.pod:1035
2176 " ___________________\n"
2178 " | main program |\n"
2180 " | | child process / appliance\n"
2181 " | | __________________________\n"
2183 " +-------------------+ RPC | +-----------------+ |\n"
2184 " | libguestfs <--------------------> guestfsd | |\n"
2185 " | | | +-----------------+ |\n"
2186 " \\___________________/ | | Linux kernel | |\n"
2187 " | +--^--------------+ |\n"
2188 " \\_________|________________/\n"
2194 " \\______________/\n"
2199 #: ../src/guestfs.pod:1055
2201 "The library, linked to the main program, creates the child process and hence "
2202 "the appliance in the L</guestfs_launch> function."
2206 #: ../src/guestfs.pod:1058
2208 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2209 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2210 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2211 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2212 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2213 "attached to the qemu process which translates device access by the "
2214 "appliance's Linux kernel into accesses to the image."
2218 #: ../src/guestfs.pod:1067
2220 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2221 "Although the disk image you are attached to might also be used by some "
2222 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2223 "care if both libguestfs's qemu process and your virtual machine are trying "
2224 "to update the disk image at the same time, since these usually results in "
2225 "massive disk corruption)."
2229 #: ../src/guestfs.pod:1074
2230 msgid "STATE MACHINE"
2234 #: ../src/guestfs.pod:1076
2235 msgid "libguestfs uses a state machine to model the child process:"
2239 #: ../src/guestfs.pod:1078
2251 " / | \\ \\ guestfs_launch\n"
2252 " / | _\\__V______\n"
2254 " / | | LAUNCHING |\n"
2255 " / | \\___________/\n"
2257 " / | guestfs_launch\n"
2259 " ______ / __|____V\n"
2260 " / \\ ------> / \\\n"
2261 " | BUSY | | READY |\n"
2262 " \\______/ <------ \\________/\n"
2267 #: ../src/guestfs.pod:1100
2269 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2270 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2271 "(3) alternating between READY and BUSY as commands are issued to, and "
2272 "carried out by, the child process."
2276 #: ../src/guestfs.pod:1105
2278 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2279 "asynchronously at any time (eg. due to some internal error), and that causes "
2280 "the state to transition back to CONFIG."
2284 #: ../src/guestfs.pod:1109
2286 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2287 "issued when in the CONFIG state."
2291 #: ../src/guestfs.pod:1112
2293 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2294 "L</guestfs_launch> blocks until the child process is READY to accept "
2295 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2296 "moves the state from CONFIG to LAUNCHING while it is running."
2300 #: ../src/guestfs.pod:1118
2302 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2303 "state. These API calls block waiting for the command to be carried out (ie. "
2304 "the state to transition to BUSY and then back to READY). There are no non-"
2305 "blocking versions, and no way to issue more than one command per handle at "
2310 #: ../src/guestfs.pod:1124
2312 "Finally, the child process sends asynchronous messages back to the main "
2313 "program, such as kernel log messages. You can register a callback to "
2314 "receive these messages."
2318 #: ../src/guestfs.pod:1128
2319 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2323 #: ../src/guestfs.pod:1130
2325 "The child process generates events in some situations. Current events "
2326 "include: receiving a log message, the child process exits."
2330 #: ../src/guestfs.pod:1133
2332 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2337 #: ../src/guestfs.pod:1136
2339 "Only I<one callback of each type> can be registered for each handle. "
2340 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2341 "that type. Cancel all callbacks of this type by calling this function with "
2342 "C<cb> set to C<NULL>."
2346 #: ../src/guestfs.pod:1141
2347 msgid "guestfs_set_log_message_callback"
2351 #: ../src/guestfs.pod:1143
2354 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2355 " char *buf, int len);\n"
2356 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2357 " guestfs_log_message_cb cb,\n"
2363 #: ../src/guestfs.pod:1149
2365 "The callback function C<cb> will be called whenever qemu or the guest writes "
2366 "anything to the console."
2370 #: ../src/guestfs.pod:1152
2371 msgid "Use this function to capture kernel messages and similar."
2375 #: ../src/guestfs.pod:1154
2377 "Normally there is no log message handler, and log messages are just "
2382 #: ../src/guestfs.pod:1157
2383 msgid "guestfs_set_subprocess_quit_callback"
2387 #: ../src/guestfs.pod:1159
2390 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2391 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2392 " guestfs_subprocess_quit_cb cb,\n"
2398 #: ../src/guestfs.pod:1164
2400 "The callback function C<cb> will be called when the child process quits, "
2401 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2402 "corresponds to a transition from any state to the CONFIG state)."
2406 #: ../src/guestfs.pod:1169
2407 msgid "guestfs_set_launch_done_callback"
2411 #: ../src/guestfs.pod:1171
2414 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2415 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2416 " guestfs_launch_done_cb cb,\n"
2422 #: ../src/guestfs.pod:1176
2424 "The callback function C<cb> will be called when the child process becomes "
2425 "ready first time after it has been launched. (This corresponds to a "
2426 "transition from LAUNCHING to the READY state)."
2430 #: ../src/guestfs.pod:1180
2431 msgid "guestfs_set_close_callback"
2435 #: ../src/guestfs.pod:1182
2438 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2439 " void guestfs_set_close_callback (guestfs_h *g,\n"
2440 " guestfs_close_cb cb,\n"
2446 #: ../src/guestfs.pod:1187
2448 "The callback function C<cb> will be called while the handle is being closed "
2449 "(synchronously from L</guestfs_close>)."
2453 #: ../src/guestfs.pod:1190
2455 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2456 "handles that are open when the program exits. This means that this callback "
2457 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2458 "problems in higher-level languages (eg. if your HLL interpreter has already "
2459 "been cleaned up by the time this is called, and if your callback then jumps "
2460 "into some HLL function)."
2464 #: ../src/guestfs.pod:1198
2465 msgid "guestfs_set_progress_callback"
2469 #: ../src/guestfs.pod:1200
2472 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2473 " int proc_nr, int serial,\n"
2474 " uint64_t position, uint64_t total);\n"
2475 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2476 " guestfs_progress_cb cb,\n"
2482 #: ../src/guestfs.pod:1207
2484 "Some long-running operations can generate progress messages. If this "
2485 "callback is registered, then it will be called each time a progress message "
2486 "is generated (usually two seconds after the operation started, and three "
2487 "times per second thereafter until it completes, although the frequency may "
2488 "change in future versions)."
2492 #: ../src/guestfs.pod:1213
2494 "The callback receives two numbers: C<position> and C<total>. The units of "
2495 "C<total> are not defined, although for some operations C<total> may relate "
2496 "in some way to the amount of data to be transferred (eg. in bytes or "
2497 "megabytes), and C<position> may be the portion which has been transferred."
2501 #: ../src/guestfs.pod:1219
2502 msgid "The only defined and stable parts of the API are:"
2506 #: ../src/guestfs.pod:1225
2508 "The callback can display to the user some type of progress bar or indicator "
2509 "which shows the ratio of C<position>:C<total>."
2513 #: ../src/guestfs.pod:1230
2514 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2518 #: ../src/guestfs.pod:1234
2520 "If any progress notification is sent during a call, then a final progress "
2521 "notification is always sent when C<position> = C<total>."
2525 #: ../src/guestfs.pod:1237
2527 "This is to simplify caller code, so callers can easily set the progress "
2528 "indicator to \"100%\" at the end of the operation, without requiring special "
2529 "code to detect this case."
2533 #: ../src/guestfs.pod:1243
2535 "The callback also receives the procedure number and serial number of the "
2536 "call. These are only useful for debugging protocol issues, and the callback "
2537 "can normally ignore them. The callback may want to print these numbers in "
2538 "error messages or debugging messages."
2542 #: ../src/guestfs.pod:1248
2543 msgid "PRIVATE DATA AREA"
2547 #: ../src/guestfs.pod:1250
2549 "You can attach named pieces of private data to the libguestfs handle, and "
2550 "fetch them by name for the lifetime of the handle. This is called the "
2551 "private data area and is only available from the C API."
2555 #: ../src/guestfs.pod:1254
2556 msgid "To attach a named piece of data, use the following call:"
2560 #: ../src/guestfs.pod:1256
2563 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2568 #: ../src/guestfs.pod:1258
2570 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2571 "pointer (which can be C<NULL>). Any previous item with the same name is "
2576 #: ../src/guestfs.pod:1262
2578 "You can use any C<key> you want, but names beginning with an underscore "
2579 "character are reserved for internal libguestfs purposes (for implementing "
2580 "language bindings). It is recommended to prefix the name with some unique "
2581 "string to avoid collisions with other users."
2585 #: ../src/guestfs.pod:1267
2586 msgid "To retrieve the pointer, use:"
2590 #: ../src/guestfs.pod:1269
2593 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2598 #: ../src/guestfs.pod:1271
2600 "This function returns C<NULL> if either no data is found associated with "
2601 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2606 #: ../src/guestfs.pod:1275
2608 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2609 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2610 "all. In particular, libguestfs does I<not> try to free the data when the "
2611 "handle is closed. If the data must be freed, then the caller must either "
2612 "free it before calling L</guestfs_close> or must set up a close callback to "
2613 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2614 "can be registered for a handle)."
2618 #: ../src/guestfs.pod:1283
2620 "The private data area is implemented using a hash table, and should be "
2621 "reasonably efficient for moderate numbers of keys."
2625 #: ../src/guestfs.pod:1286
2626 msgid "BLOCK DEVICE NAMING"
2630 #: ../src/guestfs.pod:1288
2632 "In the kernel there is now quite a profusion of schemata for naming block "
2633 "devices (in this context, by I<block device> I mean a physical or virtual "
2634 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2635 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2636 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2637 "for the old IDE driver (particularly for SATA devices) those devices also "
2638 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2639 "paravirtualized drivers. This has created several different naming systems, "
2640 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2644 #: ../src/guestfs.pod:1300
2646 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2647 "Linux kernel to access block devices. We can run a variety of appliances "
2648 "based on a variety of Linux kernels."
2652 #: ../src/guestfs.pod:1304
2654 "This causes a problem for libguestfs because many API calls use device or "
2655 "partition names. Working scripts and the recipe (example) scripts that we "
2656 "make available over the internet could fail if the naming scheme changes."
2660 #: ../src/guestfs.pod:1309
2662 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2663 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2664 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2665 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2669 #: ../src/guestfs.pod:1315
2671 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2672 "L</guestfs_list_partitions> and similar calls return the true names of the "
2673 "devices and partitions as known to the appliance."
2677 #: ../src/guestfs.pod:1320
2678 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2682 #: ../src/guestfs.pod:1322
2684 "Usually this translation is transparent. However in some (very rare) cases "
2685 "you may need to know the exact algorithm. Such cases include where you use "
2686 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2687 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2691 #: ../src/guestfs.pod:1328
2693 "The algorithm is applied only to I<parameters> which are known to be either "
2694 "device or partition names. Return values from functions such as L</"
2695 "guestfs_list_devices> are never changed."
2699 #: ../src/guestfs.pod:1336
2700 msgid "Is the string a parameter which is a device or partition name?"
2704 #: ../src/guestfs.pod:1340
2705 msgid "Does the string begin with C</dev/sd>?"
2709 #: ../src/guestfs.pod:1344
2711 "Does the named device exist? If so, we use that device. However if I<not> "
2712 "then we continue with this algorithm."
2716 #: ../src/guestfs.pod:1349
2717 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2721 #: ../src/guestfs.pod:1351
2722 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2726 #: ../src/guestfs.pod:1353
2727 msgid "If that named device exists, use it. If not, continue."
2731 #: ../src/guestfs.pod:1357
2732 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2736 #: ../src/guestfs.pod:1359
2737 msgid "If that named device exists, use it. If not, return an error."
2741 #: ../src/guestfs.pod:1363
2742 msgid "PORTABILITY CONCERNS"
2746 #: ../src/guestfs.pod:1365
2748 "Although the standard naming scheme and automatic translation is useful for "
2749 "simple programs and guestfish scripts, for larger programs it is best not to "
2750 "rely on this mechanism."
2754 #: ../src/guestfs.pod:1369
2756 "Where possible for maximum future portability programs using libguestfs "
2757 "should use these future-proof techniques:"
2761 #: ../src/guestfs.pod:1376
2763 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2764 "device names, and then use those names directly."
2768 #: ../src/guestfs.pod:1379
2770 "Since those device names exist by definition, they will never be translated."
2774 #: ../src/guestfs.pod:1384
2776 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2777 "filesystem labels."
2781 #: ../src/guestfs.pod:1389
2786 #: ../src/guestfs.pod:1391
2787 msgid "COMMUNICATION PROTOCOL"
2791 #: ../src/guestfs.pod:1393
2793 "Don't rely on using this protocol directly. This section documents how it "
2794 "currently works, but it may change at any time."
2798 #: ../src/guestfs.pod:1396
2800 "The protocol used to talk between the library and the daemon running inside "
2801 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
2802 "1014, RFC 1832, RFC 4506)."
2806 #: ../src/guestfs.pod:1400
2808 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
2809 "this file is automatically generated)."
2813 #: ../src/guestfs.pod:1403
2815 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
2816 "and C<FileOut> parameters, which are handled with very simple request/reply "
2817 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
2818 "parameters, which use the same request and reply messages, but they may also "
2819 "be followed by files sent using a chunked encoding."
2823 #: ../src/guestfs.pod:1410
2824 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
2828 #: ../src/guestfs.pod:1412
2829 msgid "For ordinary functions, the request message is:"
2833 #: ../src/guestfs.pod:1414
2836 " total length (header + arguments,\n"
2837 " but not including the length word itself)\n"
2838 " struct guestfs_message_header (encoded as XDR)\n"
2839 " struct guestfs_<foo>_args (encoded as XDR)\n"
2844 #: ../src/guestfs.pod:1419
2846 "The total length field allows the daemon to allocate a fixed size buffer "
2847 "into which it slurps the rest of the message. As a result, the total length "
2848 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
2849 "effective size of any request is limited to somewhere under this size."
2853 #: ../src/guestfs.pod:1425
2855 "Note also that many functions don't take any arguments, in which case the "
2856 "C<guestfs_I<foo>_args> is completely omitted."
2860 #: ../src/guestfs.pod:1428
2862 "The header contains the procedure number (C<guestfs_proc>) which is how the "
2863 "receiver knows what type of args structure to expect, or none at all."
2867 #: ../src/guestfs.pod:1432
2868 msgid "The reply message for ordinary functions is:"
2872 #: ../src/guestfs.pod:1434
2875 " total length (header + ret,\n"
2876 " but not including the length word itself)\n"
2877 " struct guestfs_message_header (encoded as XDR)\n"
2878 " struct guestfs_<foo>_ret (encoded as XDR)\n"
2883 #: ../src/guestfs.pod:1439
2885 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
2886 "functions that return no formal return values."
2890 #: ../src/guestfs.pod:1442
2892 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
2896 #: ../src/guestfs.pod:1445
2898 "In the case of an error, a flag is set in the header, and the reply message "
2899 "is slightly changed:"
2903 #: ../src/guestfs.pod:1448
2906 " total length (header + error,\n"
2907 " but not including the length word itself)\n"
2908 " struct guestfs_message_header (encoded as XDR)\n"
2909 " struct guestfs_message_error (encoded as XDR)\n"
2914 #: ../src/guestfs.pod:1453
2916 "The C<guestfs_message_error> structure contains the error message as a "
2921 #: ../src/guestfs.pod:1456
2922 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
2926 #: ../src/guestfs.pod:1458
2928 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
2929 "The normal request message is sent (see above). However this is followed by "
2930 "a sequence of file chunks."
2934 #: ../src/guestfs.pod:1462
2937 " total length (header + arguments,\n"
2938 " but not including the length word itself,\n"
2939 " and not including the chunks)\n"
2940 " struct guestfs_message_header (encoded as XDR)\n"
2941 " struct guestfs_<foo>_args (encoded as XDR)\n"
2942 " sequence of chunks for FileIn param #0\n"
2943 " sequence of chunks for FileIn param #1 etc.\n"
2948 #: ../src/guestfs.pod:1470
2949 msgid "The \"sequence of chunks\" is:"
2953 #: ../src/guestfs.pod:1472
2956 " length of chunk (not including length word itself)\n"
2957 " struct guestfs_chunk (encoded as XDR)\n"
2958 " length of chunk\n"
2959 " struct guestfs_chunk (encoded as XDR)\n"
2961 " length of chunk\n"
2962 " struct guestfs_chunk (with data.data_len == 0)\n"
2967 #: ../src/guestfs.pod:1480
2969 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
2970 "is set in the final chunk to indicate either successful completion or early "
2975 #: ../src/guestfs.pod:1484
2977 "At time of writing there are no functions that have more than one FileIn "
2978 "parameter. However this is (theoretically) supported, by sending the "
2979 "sequence of chunks for each FileIn parameter one after another (from left to "
2984 #: ../src/guestfs.pod:1489
2986 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
2987 "transfer. The library does this by sending a chunk with a special flag set "
2988 "to indicate cancellation. When the daemon sees this, it cancels the whole "
2989 "RPC, does I<not> send any reply, and goes back to reading the next request."
2993 #: ../src/guestfs.pod:1495
2995 "The daemon may also cancel. It does this by writing a special word "
2996 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
2997 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
2998 "cancel chunk). The special word is chosen so that even if cancellation "
2999 "happens right at the end of the transfer (after the library has finished "
3000 "writing and has started listening for the reply), the \"spurious\" cancel "
3001 "flag will not be confused with the reply message."
3005 #: ../src/guestfs.pod:1504
3007 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3008 "limit), and also files where the size is not known in advance (eg. from "
3009 "pipes or sockets). However the chunks are rather small "
3010 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3011 "to keep much in memory."
3015 #: ../src/guestfs.pod:1510
3016 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3020 #: ../src/guestfs.pod:1512
3022 "The protocol for FileOut parameters is exactly the same as for FileIn "
3023 "parameters, but with the roles of daemon and library reversed."
3027 #: ../src/guestfs.pod:1515
3030 " total length (header + ret,\n"
3031 " but not including the length word itself,\n"
3032 " and not including the chunks)\n"
3033 " struct guestfs_message_header (encoded as XDR)\n"
3034 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3035 " sequence of chunks for FileOut param #0\n"
3036 " sequence of chunks for FileOut param #1 etc.\n"
3041 #: ../src/guestfs.pod:1523
3042 msgid "INITIAL MESSAGE"
3046 #: ../src/guestfs.pod:1525
3048 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3049 "which indicates that the guest and daemon is alive. This is what L</"
3050 "guestfs_launch> waits for."
3054 #: ../src/guestfs.pod:1529
3055 msgid "PROGRESS NOTIFICATION MESSAGES"
3059 #: ../src/guestfs.pod:1531
3061 "The daemon may send progress notification messages at any time. These are "
3062 "distinguished by the normal length word being replaced by "
3063 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3067 #: ../src/guestfs.pod:1535
3069 "The library turns them into progress callbacks (see "
3070 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3071 "discards them if not."
3075 #: ../src/guestfs.pod:1539
3077 "The daemon self-limits the frequency of progress messages it sends (see "
3078 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3083 #: ../src/guestfs.pod:1543
3084 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3088 #: ../src/guestfs.pod:1545
3090 "All high-level libguestfs actions are synchronous. If you want to use "
3091 "libguestfs asynchronously then you must create a thread."
3095 #: ../src/guestfs.pod:1548
3097 "Only use the handle from a single thread. Either use the handle exclusively "
3098 "from one thread, or provide your own mutex so that two threads cannot issue "
3099 "calls on the same handle at the same time."
3103 #: ../src/guestfs.pod:1552
3105 "See the graphical program guestfs-browser for one possible architecture for "
3106 "multithreaded programs using libvirt and libguestfs."
3110 #: ../src/guestfs.pod:1555
3111 msgid "QEMU WRAPPERS"
3115 #: ../src/guestfs.pod:1557
3117 "If you want to compile your own qemu, run qemu from a non-standard location, "
3118 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3123 #: ../src/guestfs.pod:1561
3125 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3126 "last command in the shell script (so that qemu replaces the shell and "
3127 "becomes the direct child of the libguestfs-using program). If you don't do "
3128 "this, then the qemu process won't be cleaned up correctly."
3132 #: ../src/guestfs.pod:1566
3134 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3139 #: ../src/guestfs.pod:1569
3143 " qemudir=/home/rjones/d/qemu\n"
3144 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
3149 #: ../src/guestfs.pod:1573
3151 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3152 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3157 #: ../src/guestfs.pod:1577
3160 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3165 #: ../src/guestfs.pod:1579
3167 "Note that libguestfs also calls qemu with the -help and -version options in "
3168 "order to determine features."
3172 #: ../src/guestfs.pod:1582
3173 msgid "LIBGUESTFS VERSION NUMBERS"
3177 #: ../src/guestfs.pod:1584
3179 "Since April 2010, libguestfs has started to make separate development and "
3180 "stable releases, along with corresponding branches in our git repository. "
3181 "These separate releases can be identified by version number:"
3185 #: ../src/guestfs.pod:1589
3188 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3189 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3195 " | `-------- sub-version\n"
3197 " `------ always '1' because we don't change the ABI\n"
3202 #: ../src/guestfs.pod:1600
3203 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3207 #: ../src/guestfs.pod:1602
3209 "As time passes we cherry pick fixes from the development branch and backport "
3210 "those into the stable branch, the effect being that the stable branch should "
3211 "get more stable and less buggy over time. So the stable releases are ideal "
3212 "for people who don't need new features but would just like the software to "
3217 #: ../src/guestfs.pod:1608
3218 msgid "Our criteria for backporting changes are:"
3222 #: ../src/guestfs.pod:1614
3224 "Documentation changes which don't affect any code are backported unless the "
3225 "documentation refers to a future feature which is not in stable."
3229 #: ../src/guestfs.pod:1620
3231 "Bug fixes which are not controversial, fix obvious problems, and have been "
3232 "well tested are backported."
3236 #: ../src/guestfs.pod:1625
3238 "Simple rearrangements of code which shouldn't affect how it works get "
3239 "backported. This is so that the code in the two branches doesn't get too "
3240 "far out of step, allowing us to backport future fixes more easily."
3244 #: ../src/guestfs.pod:1631
3246 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3247 "exceptional case: the new feature is required in order to implement an "
3248 "important bug fix."
3252 #: ../src/guestfs.pod:1637
3254 "A new stable branch starts when we think the new features in development are "
3255 "substantial and compelling enough over the current stable branch to warrant "
3256 "it. When that happens we create new stable and development versions 1.N.0 "
3257 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3258 "stable at this point, but by backporting fixes from development, that branch "
3259 "will stabilize over time."
3263 #: ../src/guestfs.pod:1645 ../fish/guestfish.pod:796
3264 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:312
3265 #: ../tools/virt-rescue.pl:226
3266 msgid "ENVIRONMENT VARIABLES"
3270 #: ../src/guestfs.pod:1649 ../fish/guestfish.pod:816
3271 msgid "LIBGUESTFS_APPEND"
3275 #: ../src/guestfs.pod:1651 ../fish/guestfish.pod:818
3276 msgid "Pass additional options to the guest kernel."
3280 #: ../src/guestfs.pod:1653 ../fish/guestfish.pod:820
3281 msgid "LIBGUESTFS_DEBUG"
3285 #: ../src/guestfs.pod:1655
3287 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3288 "effect as calling C<guestfs_set_verbose (g, 1)>."
3292 #: ../src/guestfs.pod:1658 ../fish/guestfish.pod:825
3293 msgid "LIBGUESTFS_MEMSIZE"
3297 #: ../src/guestfs.pod:1660 ../fish/guestfish.pod:827
3299 "Set the memory allocated to the qemu process, in megabytes. For example:"
3303 #: ../src/guestfs.pod:1663 ../fish/guestfish.pod:830
3306 " LIBGUESTFS_MEMSIZE=700\n"
3311 #: ../src/guestfs.pod:1665 ../fish/guestfish.pod:832
3312 msgid "LIBGUESTFS_PATH"
3316 #: ../src/guestfs.pod:1667
3318 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3319 "the discussion of paths in section PATH above."
3323 #: ../src/guestfs.pod:1670 ../fish/guestfish.pod:837
3324 msgid "LIBGUESTFS_QEMU"
3328 #: ../src/guestfs.pod:1672 ../fish/guestfish.pod:839
3330 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3331 "which was found at compile time by the configure script is used."
3335 #: ../src/guestfs.pod:1676
3336 msgid "See also L</QEMU WRAPPERS> above."
3340 #: ../src/guestfs.pod:1678 ../fish/guestfish.pod:843
3341 msgid "LIBGUESTFS_TRACE"
3345 #: ../src/guestfs.pod:1680
3347 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3348 "effect as calling C<guestfs_set_trace (g, 1)>."
3352 #: ../src/guestfs.pod:1683 ../fish/guestfish.pod:852
3357 #: ../src/guestfs.pod:1685 ../fish/guestfish.pod:854
3358 msgid "Location of temporary directory, defaults to C</tmp>."
3362 #: ../src/guestfs.pod:1687 ../fish/guestfish.pod:856
3364 "If libguestfs was compiled to use the supermin appliance then each handle "
3365 "will require rather a large amount of space in this directory for short "
3366 "periods of time (~ 80 MB). You can use C<$TMPDIR> to configure another "
3367 "directory to use in case C</tmp> is not large enough."
3371 #: ../src/guestfs.pod:1695 ../fish/guestfish.pod:914
3372 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:178
3373 #: ../inspector/virt-inspector.pl:846 ../tools/virt-cat.pl:163
3374 #: ../tools/virt-df.pl:482 ../tools/virt-edit.pl:325
3375 #: ../tools/virt-list-filesystems.pl:191 ../tools/virt-list-partitions.pl:229
3376 #: ../tools/virt-ls.pl:210 ../tools/virt-make-fs.pl:527
3377 #: ../tools/virt-rescue.pl:231 ../tools/virt-resize.pl:1390
3378 #: ../tools/virt-tar.pl:257 ../tools/virt-win-reg.pl:461
3383 #: ../src/guestfs.pod:1697
3385 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-edit"
3386 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
3387 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
3388 "tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
3389 "L<http://libguestfs.org/>."
3393 #: ../src/guestfs.pod:1715
3395 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
3396 "(8)>, L<disktype(1)>."
3400 #: ../src/guestfs.pod:1722 ../tools/virt-make-fs.pl:541
3401 #: ../tools/virt-win-reg.pl:476
3406 #: ../src/guestfs.pod:1724
3407 msgid "To get a list of bugs against libguestfs use this link:"
3411 #: ../src/guestfs.pod:1726
3413 "L<https://bugzilla.redhat.com/buglist.cgi?"
3414 "component=libguestfs&product=Virtualization+Tools>"
3418 #: ../src/guestfs.pod:1728
3419 msgid "To report a new bug against libguestfs use this link:"
3423 #: ../src/guestfs.pod:1730
3425 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
3426 "component=libguestfs&product=Virtualization+Tools>"
3430 #: ../src/guestfs.pod:1732
3431 msgid "When reporting a bug, please check:"
3435 #: ../src/guestfs.pod:1738
3436 msgid "That the bug hasn't been reported already."
3440 #: ../src/guestfs.pod:1742
3441 msgid "That you are testing a recent version."
3445 #: ../src/guestfs.pod:1746
3446 msgid "Describe the bug accurately, and give a way to reproduce it."
3450 #: ../src/guestfs.pod:1750
3452 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3457 #: ../src/guestfs.pod:1755 ../fish/guestfish.pod:930
3458 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:189
3459 #: ../inspector/virt-inspector.pl:855
3464 #: ../src/guestfs.pod:1757 ../fish/guestfish.pod:932
3465 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:191
3466 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3470 #: ../src/guestfs.pod:1759 ../fish/guestfish.pod:934
3471 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:193
3472 #: ../inspector/virt-inspector.pl:861 ../tools/virt-cat.pl:177
3473 #: ../tools/virt-df.pl:495 ../tools/virt-edit.pl:341
3474 #: ../tools/virt-list-filesystems.pl:207 ../tools/virt-list-partitions.pl:244
3475 #: ../tools/virt-ls.pl:225 ../tools/virt-make-fs.pl:556
3476 #: ../tools/virt-rescue.pl:245 ../tools/virt-resize.pl:1411
3477 #: ../tools/virt-tar.pl:272 ../tools/virt-win-reg.pl:491
3482 #: ../src/guestfs.pod:1761 ../fish/guestfish.pod:936
3483 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3487 #: ../src/guestfs.pod:1764
3489 "This library is free software; you can redistribute it and/or modify it "
3490 "under the terms of the GNU Lesser General Public License as published by the "
3491 "Free Software Foundation; either version 2 of the License, or (at your "
3492 "option) any later version."
3496 #: ../src/guestfs.pod:1769
3498 "This library is distributed in the hope that it will be useful, but WITHOUT "
3499 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3500 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3505 #: ../src/guestfs.pod:1774
3507 "You should have received a copy of the GNU Lesser General Public License "
3508 "along with this library; if not, write to the Free Software Foundation, "
3509 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3513 #: ../src/guestfs-actions.pod:1
3514 msgid "guestfs_add_cdrom"
3518 #: ../src/guestfs-actions.pod:3
3521 " int guestfs_add_cdrom (guestfs_h *g,\n"
3522 "\t\tconst char *filename);\n"
3527 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:5
3528 msgid "This function adds a virtual CD-ROM disk image to the guest."
3532 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:7
3533 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3537 #: ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:1488
3538 #: ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1186
3543 #: ../src/guestfs-actions.pod:16
3545 "This call checks for the existence of C<filename>. This stops you from "
3546 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3547 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3552 #: ../src/guestfs-actions.pod:23
3554 "If you just want to add an ISO file (often you use this as an efficient way "
3555 "to transfer large files into the guest), then you should probably use "
3556 "C<guestfs_add_drive_ro> instead."
3560 #: ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:63
3561 #: ../src/guestfs-actions.pod:92 ../src/guestfs-actions.pod:103
3562 #: ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:124
3563 #: ../src/guestfs-actions.pod:135 ../src/guestfs-actions.pod:238
3564 #: ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:266
3565 #: ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:324
3566 #: ../src/guestfs-actions.pod:339 ../src/guestfs-actions.pod:403
3567 #: ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:441
3568 #: ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:534
3569 #: ../src/guestfs-actions.pod:549 ../src/guestfs-actions.pod:560
3570 #: ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:717
3571 #: ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:749
3572 #: ../src/guestfs-actions.pod:824 ../src/guestfs-actions.pod:839
3573 #: ../src/guestfs-actions.pod:855 ../src/guestfs-actions.pod:866
3574 #: ../src/guestfs-actions.pod:883 ../src/guestfs-actions.pod:916
3575 #: ../src/guestfs-actions.pod:974 ../src/guestfs-actions.pod:996
3576 #: ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1115
3577 #: ../src/guestfs-actions.pod:1146 ../src/guestfs-actions.pod:1346
3578 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1446
3579 #: ../src/guestfs-actions.pod:1794 ../src/guestfs-actions.pod:1917
3580 #: ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:2002
3581 #: ../src/guestfs-actions.pod:2411 ../src/guestfs-actions.pod:2423
3582 #: ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:2548
3583 #: ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2569
3584 #: ../src/guestfs-actions.pod:2580 ../src/guestfs-actions.pod:2592
3585 #: ../src/guestfs-actions.pod:2622 ../src/guestfs-actions.pod:2686
3586 #: ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2717
3587 #: ../src/guestfs-actions.pod:2737 ../src/guestfs-actions.pod:2757
3588 #: ../src/guestfs-actions.pod:2786 ../src/guestfs-actions.pod:2802
3589 #: ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:2830
3590 #: ../src/guestfs-actions.pod:2839 ../src/guestfs-actions.pod:2872
3591 #: ../src/guestfs-actions.pod:2885 ../src/guestfs-actions.pod:2895
3592 #: ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2921
3593 #: ../src/guestfs-actions.pod:3001 ../src/guestfs-actions.pod:3018
3594 #: ../src/guestfs-actions.pod:3028 ../src/guestfs-actions.pod:3073
3595 #: ../src/guestfs-actions.pod:3088 ../src/guestfs-actions.pod:3103
3596 #: ../src/guestfs-actions.pod:3116 ../src/guestfs-actions.pod:3127
3597 #: ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3152
3598 #: ../src/guestfs-actions.pod:3164 ../src/guestfs-actions.pod:3181
3599 #: ../src/guestfs-actions.pod:3212 ../src/guestfs-actions.pod:3240
3600 #: ../src/guestfs-actions.pod:3256 ../src/guestfs-actions.pod:3272
3601 #: ../src/guestfs-actions.pod:3281 ../src/guestfs-actions.pod:3295
3602 #: ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:3317
3603 #: ../src/guestfs-actions.pod:3329 ../src/guestfs-actions.pod:3361
3604 #: ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3390
3605 #: ../src/guestfs-actions.pod:3401 ../src/guestfs-actions.pod:3415
3606 #: ../src/guestfs-actions.pod:3455 ../src/guestfs-actions.pod:3486
3607 #: ../src/guestfs-actions.pod:3497 ../src/guestfs-actions.pod:3522
3608 #: ../src/guestfs-actions.pod:3536 ../src/guestfs-actions.pod:3551
3609 #: ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3725
3610 #: ../src/guestfs-actions.pod:3744 ../src/guestfs-actions.pod:3759
3611 #: ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:3819
3612 #: ../src/guestfs-actions.pod:3833 ../src/guestfs-actions.pod:3843
3613 #: ../src/guestfs-actions.pod:3854 ../src/guestfs-actions.pod:4086
3614 #: ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:4113
3615 #: ../src/guestfs-actions.pod:4122 ../src/guestfs-actions.pod:4133
3616 #: ../src/guestfs-actions.pod:4142 ../src/guestfs-actions.pod:4153
3617 #: ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4184
3618 #: ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4216
3619 #: ../src/guestfs-actions.pod:4231 ../src/guestfs-actions.pod:4251
3620 #: ../src/guestfs-actions.pod:4266 ../src/guestfs-actions.pod:4282
3621 #: ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4316
3622 #: ../src/guestfs-actions.pod:4330 ../src/guestfs-actions.pod:4355
3623 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4392
3624 #: ../src/guestfs-actions.pod:4413 ../src/guestfs-actions.pod:4425
3625 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:4453
3626 #: ../src/guestfs-actions.pod:4487 ../src/guestfs-actions.pod:4507
3627 #: ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4620
3628 #: ../src/guestfs-actions.pod:4726 ../src/guestfs-actions.pod:4735
3629 #: ../src/guestfs-actions.pod:4745 ../src/guestfs-actions.pod:4755
3630 #: ../src/guestfs-actions.pod:4774 ../src/guestfs-actions.pod:4784
3631 #: ../src/guestfs-actions.pod:4794 ../src/guestfs-actions.pod:4804
3632 #: ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:4866
3633 #: ../src/guestfs-actions.pod:4880 ../src/guestfs-actions.pod:4893
3634 #: ../src/guestfs-actions.pod:4906 ../src/guestfs-actions.pod:4920
3635 #: ../src/guestfs-actions.pod:4930 ../src/guestfs-actions.pod:4947
3636 #: ../src/guestfs-actions.pod:4977 ../src/guestfs-actions.pod:4988
3637 #: ../src/guestfs-actions.pod:5023 ../src/guestfs-actions.pod:5033
3638 #: ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5076
3639 #: ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5195
3640 #: ../src/guestfs-actions.pod:5206 ../src/guestfs-actions.pod:5252
3641 #: ../src/guestfs-actions.pod:5262 ../src/guestfs-actions.pod:5299
3642 #: ../src/guestfs-actions.pod:5326 ../src/guestfs-actions.pod:5368
3643 #: ../src/guestfs-actions.pod:5391 ../src/guestfs-actions.pod:5448
3644 #: ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5490
3645 msgid "This function returns 0 on success or -1 on error."
3649 #: ../src/guestfs-actions.pod:31
3650 msgid "guestfs_add_drive"
3654 #: ../src/guestfs-actions.pod:33
3657 " int guestfs_add_drive (guestfs_h *g,\n"
3658 "\t\tconst char *filename);\n"
3663 #: ../src/guestfs-actions.pod:36 ../fish/guestfish-actions.pod:32
3665 "This function adds a virtual machine disk image C<filename> to the guest. "
3666 "The first time you call this function, the disk appears as IDE disk 0 (C</"
3667 "dev/sda>) in the guest, the second time as C</dev/sdb>, and so on."
3671 #: ../src/guestfs-actions.pod:41 ../fish/guestfish-actions.pod:37
3673 "You don't necessarily need to be root when using libguestfs. However you "
3674 "obviously do need sufficient permissions to access the filename for whatever "
3675 "operations you want to perform (ie. read access if you just want to read the "
3676 "image or write access if you want to modify the image)."
3680 #: ../src/guestfs-actions.pod:47 ../fish/guestfish-actions.pod:43
3682 "This is equivalent to the qemu parameter C<-drive file=filename,cache=off,"
3687 #: ../src/guestfs-actions.pod:50 ../fish/guestfish-actions.pod:46
3689 "C<cache=off> is omitted in cases where it is not supported by the underlying "
3694 #: ../src/guestfs-actions.pod:53 ../src/guestfs-actions.pod:82
3696 "C<if=...> is set at compile time by the configuration option C<./configure --"
3697 "with-drive-if=...>. In the rare case where you might need to change this at "
3698 "run time, use C<guestfs_add_drive_with_if> or "
3699 "C<guestfs_add_drive_ro_with_if>."
3703 #: ../src/guestfs-actions.pod:58 ../src/guestfs-actions.pod:87
3705 "Note that this call checks for the existence of C<filename>. This stops you "
3706 "from specifying other types of drive which are supported by qemu such as "
3707 "C<nbd:> and C<http:> URLs. To specify those, use the general "
3708 "C<guestfs_config> call instead."
3712 #: ../src/guestfs-actions.pod:65
3713 msgid "guestfs_add_drive_ro"
3717 #: ../src/guestfs-actions.pod:67
3720 " int guestfs_add_drive_ro (guestfs_h *g,\n"
3721 "\t\tconst char *filename);\n"
3726 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:63
3727 msgid "This adds a drive in snapshot mode, making it effectively read-only."
3731 #: ../src/guestfs-actions.pod:73 ../fish/guestfish-actions.pod:66
3733 "Note that writes to the device are allowed, and will be seen for the "
3734 "duration of the guestfs handle, but they are written to a temporary file "
3735 "which is discarded as soon as the guestfs handle is closed. We don't "
3736 "currently have any method to enable changes to be committed, although qemu "
3741 #: ../src/guestfs-actions.pod:79 ../fish/guestfish-actions.pod:72
3743 "This is equivalent to the qemu parameter C<-drive file=filename,snapshot=on,"
3748 #: ../src/guestfs-actions.pod:94
3749 msgid "guestfs_add_drive_ro_with_if"
3753 #: ../src/guestfs-actions.pod:96
3756 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
3757 "\t\tconst char *filename,\n"
3758 "\t\tconst char *iface);\n"
3763 #: ../src/guestfs-actions.pod:100
3765 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
3766 "QEMU interface emulation to use at run time."
3770 #: ../src/guestfs-actions.pod:105
3771 msgid "guestfs_add_drive_with_if"
3775 #: ../src/guestfs-actions.pod:107
3778 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
3779 "\t\tconst char *filename,\n"
3780 "\t\tconst char *iface);\n"
3785 #: ../src/guestfs-actions.pod:111
3787 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
3788 "QEMU interface emulation to use at run time."
3792 #: ../src/guestfs-actions.pod:116
3793 msgid "guestfs_aug_clear"
3797 #: ../src/guestfs-actions.pod:118
3800 " int guestfs_aug_clear (guestfs_h *g,\n"
3801 "\t\tconst char *augpath);\n"
3806 #: ../src/guestfs-actions.pod:121 ../fish/guestfish-actions.pod:103
3808 "Set the value associated with C<path> to C<NULL>. This is the same as the "
3809 "L<augtool(1)> C<clear> command."
3813 #: ../src/guestfs-actions.pod:126
3814 msgid "guestfs_aug_close"
3818 #: ../src/guestfs-actions.pod:128
3821 " int guestfs_aug_close (guestfs_h *g);\n"
3826 #: ../src/guestfs-actions.pod:130
3828 "Close the current Augeas handle and free up any resources used by it. After "
3829 "calling this, you have to call C<guestfs_aug_init> again before you can use "
3830 "any other Augeas functions."
3834 #: ../src/guestfs-actions.pod:137
3835 msgid "guestfs_aug_defnode"
3839 #: ../src/guestfs-actions.pod:139
3842 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
3843 "\t\tconst char *name,\n"
3844 "\t\tconst char *expr,\n"
3845 "\t\tconst char *val);\n"
3850 #: ../src/guestfs-actions.pod:144 ../fish/guestfish-actions.pod:119
3852 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
3856 #: ../src/guestfs-actions.pod:147
3858 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
3859 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
3860 "containing that single node."
3864 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:126
3866 "On success this returns a pair containing the number of nodes in the "
3867 "nodeset, and a boolean flag if a node was created."
3871 #: ../src/guestfs-actions.pod:155
3873 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
3874 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
3878 #: ../src/guestfs-actions.pod:159
3879 msgid "guestfs_aug_defvar"
3883 #: ../src/guestfs-actions.pod:161
3886 " int guestfs_aug_defvar (guestfs_h *g,\n"
3887 "\t\tconst char *name,\n"
3888 "\t\tconst char *expr);\n"
3893 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:134
3895 "Defines an Augeas variable C<name> whose value is the result of evaluating "
3896 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
3900 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:138
3902 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
3903 "evaluates to something which is not a nodeset."
3907 #: ../src/guestfs-actions.pod:172 ../src/guestfs-actions.pod:313
3908 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:492
3909 #: ../src/guestfs-actions.pod:507 ../src/guestfs-actions.pod:523
3910 #: ../src/guestfs-actions.pod:1013 ../src/guestfs-actions.pod:1328
3911 #: ../src/guestfs-actions.pod:1510 ../src/guestfs-actions.pod:1591
3912 #: ../src/guestfs-actions.pod:1622 ../src/guestfs-actions.pod:1665
3913 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1907
3914 #: ../src/guestfs-actions.pod:2119 ../src/guestfs-actions.pod:2137
3915 #: ../src/guestfs-actions.pod:3475 ../src/guestfs-actions.pod:3582
3916 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5012
3917 #: ../src/guestfs-actions.pod:5336 ../src/guestfs-actions.pod:5346
3918 #: ../src/guestfs-actions.pod:5356
3919 msgid "On error this function returns -1."
3923 #: ../src/guestfs-actions.pod:174
3924 msgid "guestfs_aug_get"
3928 #: ../src/guestfs-actions.pod:176
3931 " char *guestfs_aug_get (guestfs_h *g,\n"
3932 "\t\tconst char *augpath);\n"
3937 #: ../src/guestfs-actions.pod:179 ../fish/guestfish-actions.pod:145
3939 "Look up the value associated with C<path>. If C<path> matches exactly one "
3940 "node, the C<value> is returned."
3944 #: ../src/guestfs-actions.pod:182 ../src/guestfs-actions.pod:610
3945 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:682
3946 #: ../src/guestfs-actions.pod:695 ../src/guestfs-actions.pod:786
3947 #: ../src/guestfs-actions.pod:899 ../src/guestfs-actions.pod:928
3948 #: ../src/guestfs-actions.pod:942 ../src/guestfs-actions.pod:958
3949 #: ../src/guestfs-actions.pod:1041 ../src/guestfs-actions.pod:1205
3950 #: ../src/guestfs-actions.pod:1314 ../src/guestfs-actions.pod:1459
3951 #: ../src/guestfs-actions.pod:1473 ../src/guestfs-actions.pod:1549
3952 #: ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:1701
3953 #: ../src/guestfs-actions.pod:1840 ../src/guestfs-actions.pod:2021
3954 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2187
3955 #: ../src/guestfs-actions.pod:2222 ../src/guestfs-actions.pod:2537
3956 #: ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:3054
3957 #: ../src/guestfs-actions.pod:3597 ../src/guestfs-actions.pod:3773
3958 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:4029
3959 #: ../src/guestfs-actions.pod:4072 ../src/guestfs-actions.pod:4548
3960 #: ../src/guestfs-actions.pod:4561 ../src/guestfs-actions.pod:4575
3961 #: ../src/guestfs-actions.pod:4596 ../src/guestfs-actions.pod:5129
3962 #: ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5160
3963 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5538
3965 "This function returns a string, or NULL on error. I<The caller must free "
3966 "the returned string after use>."
3970 #: ../src/guestfs-actions.pod:185
3971 msgid "guestfs_aug_init"
3975 #: ../src/guestfs-actions.pod:187
3978 " int guestfs_aug_init (guestfs_h *g,\n"
3979 "\t\tconst char *root,\n"
3985 #: ../src/guestfs-actions.pod:191 ../fish/guestfish-actions.pod:152
3987 "Create a new Augeas handle for editing configuration files. If there was "
3988 "any previous Augeas handle associated with this guestfs session, then it is "
3993 #: ../src/guestfs-actions.pod:195
3994 msgid "You must call this before using any other C<guestfs_aug_*> commands."
3998 #: ../src/guestfs-actions.pod:198 ../fish/guestfish-actions.pod:159
4000 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4004 #: ../src/guestfs-actions.pod:201 ../fish/guestfish-actions.pod:162
4006 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4007 "logical I<or> of the following integers:"
4011 #: ../src/guestfs-actions.pod:207 ../fish/guestfish-actions.pod:168
4012 msgid "C<AUG_SAVE_BACKUP> = 1"
4016 #: ../src/guestfs-actions.pod:209 ../fish/guestfish-actions.pod:170
4017 msgid "Keep the original file with a C<.augsave> extension."
4021 #: ../src/guestfs-actions.pod:211 ../fish/guestfish-actions.pod:172
4022 msgid "C<AUG_SAVE_NEWFILE> = 2"
4026 #: ../src/guestfs-actions.pod:213 ../fish/guestfish-actions.pod:174
4028 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4029 "original. Overrides C<AUG_SAVE_BACKUP>."
4033 #: ../src/guestfs-actions.pod:216 ../fish/guestfish-actions.pod:177
4034 msgid "C<AUG_TYPE_CHECK> = 4"
4038 #: ../src/guestfs-actions.pod:218 ../fish/guestfish-actions.pod:179
4039 msgid "Typecheck lenses (can be expensive)."
4043 #: ../src/guestfs-actions.pod:220 ../fish/guestfish-actions.pod:181
4044 msgid "C<AUG_NO_STDINC> = 8"
4048 #: ../src/guestfs-actions.pod:222 ../fish/guestfish-actions.pod:183
4049 msgid "Do not use standard load path for modules."
4053 #: ../src/guestfs-actions.pod:224 ../fish/guestfish-actions.pod:185
4054 msgid "C<AUG_SAVE_NOOP> = 16"
4058 #: ../src/guestfs-actions.pod:226 ../fish/guestfish-actions.pod:187
4059 msgid "Make save a no-op, just record what would have been changed."
4063 #: ../src/guestfs-actions.pod:228 ../fish/guestfish-actions.pod:189
4064 msgid "C<AUG_NO_LOAD> = 32"
4068 #: ../src/guestfs-actions.pod:230
4069 msgid "Do not load the tree in C<guestfs_aug_init>."
4073 #: ../src/guestfs-actions.pod:234
4074 msgid "To close the handle, you can call C<guestfs_aug_close>."
4078 #: ../src/guestfs-actions.pod:236 ../fish/guestfish-actions.pod:197
4079 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4083 #: ../src/guestfs-actions.pod:240
4084 msgid "guestfs_aug_insert"
4088 #: ../src/guestfs-actions.pod:242
4091 " int guestfs_aug_insert (guestfs_h *g,\n"
4092 "\t\tconst char *augpath,\n"
4093 "\t\tconst char *label,\n"
4094 "\t\tint before);\n"
4099 #: ../src/guestfs-actions.pod:247 ../fish/guestfish-actions.pod:203
4101 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4102 "or after C<path> (depending on the boolean flag C<before>)."
4106 #: ../src/guestfs-actions.pod:251 ../fish/guestfish-actions.pod:207
4108 "C<path> must match exactly one existing node in the tree, and C<label> must "
4109 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4113 #: ../src/guestfs-actions.pod:257
4114 msgid "guestfs_aug_load"
4118 #: ../src/guestfs-actions.pod:259
4121 " int guestfs_aug_load (guestfs_h *g);\n"
4126 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:215
4127 msgid "Load files into the tree."
4131 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:217
4132 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4136 #: ../src/guestfs-actions.pod:268
4137 msgid "guestfs_aug_ls"
4141 #: ../src/guestfs-actions.pod:270
4144 " char **guestfs_aug_ls (guestfs_h *g,\n"
4145 "\t\tconst char *augpath);\n"
4150 #: ../src/guestfs-actions.pod:273
4152 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4153 "sorting the resulting nodes into alphabetical order."
4157 #: ../src/guestfs-actions.pod:276 ../src/guestfs-actions.pod:289
4158 #: ../src/guestfs-actions.pod:417 ../src/guestfs-actions.pod:802
4159 #: ../src/guestfs-actions.pod:1053 ../src/guestfs-actions.pod:1069
4160 #: ../src/guestfs-actions.pod:1157 ../src/guestfs-actions.pod:1173
4161 #: ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1738
4162 #: ../src/guestfs-actions.pod:1751 ../src/guestfs-actions.pod:1767
4163 #: ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1825
4164 #: ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1927
4165 #: ../src/guestfs-actions.pod:2093 ../src/guestfs-actions.pod:2261
4166 #: ../src/guestfs-actions.pod:2466 ../src/guestfs-actions.pod:2522
4167 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2935
4168 #: ../src/guestfs-actions.pod:3442 ../src/guestfs-actions.pod:3868
4169 #: ../src/guestfs-actions.pod:3954 ../src/guestfs-actions.pod:4060
4170 #: ../src/guestfs-actions.pod:4609 ../src/guestfs-actions.pod:4658
4171 #: ../src/guestfs-actions.pod:4710 ../src/guestfs-actions.pod:4826
4172 #: ../src/guestfs-actions.pod:4847 ../src/guestfs-actions.pod:5221
4173 #: ../src/guestfs-actions.pod:5238 ../src/guestfs-actions.pod:5276
4174 #: ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:5428
4175 #: ../src/guestfs-actions.pod:5501 ../src/guestfs-actions.pod:5517
4176 #: ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:5573
4178 "This function returns a NULL-terminated array of strings (like L<environ(3)"
4179 ">), or NULL if there was an error. I<The caller must free the strings and "
4180 "the array after use>."
4184 #: ../src/guestfs-actions.pod:280
4185 msgid "guestfs_aug_match"
4189 #: ../src/guestfs-actions.pod:282
4192 " char **guestfs_aug_match (guestfs_h *g,\n"
4193 "\t\tconst char *augpath);\n"
4198 #: ../src/guestfs-actions.pod:285 ../fish/guestfish-actions.pod:231
4200 "Returns a list of paths which match the path expression C<path>. The "
4201 "returned paths are sufficiently qualified so that they match exactly one "
4202 "node in the current tree."
4206 #: ../src/guestfs-actions.pod:293
4207 msgid "guestfs_aug_mv"
4211 #: ../src/guestfs-actions.pod:295
4214 " int guestfs_aug_mv (guestfs_h *g,\n"
4215 "\t\tconst char *src,\n"
4216 "\t\tconst char *dest);\n"
4221 #: ../src/guestfs-actions.pod:299 ../fish/guestfish-actions.pod:239
4223 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4224 "C<dest> is overwritten if it exists."
4228 #: ../src/guestfs-actions.pod:304
4229 msgid "guestfs_aug_rm"
4233 #: ../src/guestfs-actions.pod:306
4236 " int guestfs_aug_rm (guestfs_h *g,\n"
4237 "\t\tconst char *augpath);\n"
4242 #: ../src/guestfs-actions.pod:309 ../fish/guestfish-actions.pod:246
4243 msgid "Remove C<path> and all of its children."
4247 #: ../src/guestfs-actions.pod:311 ../fish/guestfish-actions.pod:248
4248 msgid "On success this returns the number of entries which were removed."
4252 #: ../src/guestfs-actions.pod:315
4253 msgid "guestfs_aug_save"
4257 #: ../src/guestfs-actions.pod:317
4260 " int guestfs_aug_save (guestfs_h *g);\n"
4265 #: ../src/guestfs-actions.pod:319 ../fish/guestfish-actions.pod:254
4266 msgid "This writes all pending changes to disk."
4270 #: ../src/guestfs-actions.pod:321
4272 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4277 #: ../src/guestfs-actions.pod:326
4278 msgid "guestfs_aug_set"
4282 #: ../src/guestfs-actions.pod:328
4285 " int guestfs_aug_set (guestfs_h *g,\n"
4286 "\t\tconst char *augpath,\n"
4287 "\t\tconst char *val);\n"
4292 #: ../src/guestfs-actions.pod:332 ../fish/guestfish-actions.pod:263
4293 msgid "Set the value associated with C<path> to C<val>."
4297 #: ../src/guestfs-actions.pod:334
4299 "In the Augeas API, it is possible to clear a node by setting the value to "
4300 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4301 "this call. Instead you must use the C<guestfs_aug_clear> call."
4305 #: ../src/guestfs-actions.pod:341
4306 msgid "guestfs_available"
4310 #: ../src/guestfs-actions.pod:343
4313 " int guestfs_available (guestfs_h *g,\n"
4314 "\t\tchar *const *groups);\n"
4319 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:274
4321 "This command is used to check the availability of some groups of "
4322 "functionality in the appliance, which not all builds of the libguestfs "
4323 "appliance will be able to provide."
4327 #: ../src/guestfs-actions.pod:350
4329 "The libguestfs groups, and the functions that those groups correspond to, "
4330 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4331 "runtime by calling C<guestfs_available_all_groups>."
4335 #: ../src/guestfs-actions.pod:355 ../fish/guestfish-actions.pod:283
4337 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
4338 "\"]> would check for the availability of the Linux inotify functions and "
4339 "Augeas (configuration file editing) functions."
4343 #: ../src/guestfs-actions.pod:360 ../fish/guestfish-actions.pod:288
4344 msgid "The command returns no error if I<all> requested groups are available."
4348 #: ../src/guestfs-actions.pod:362 ../fish/guestfish-actions.pod:290
4350 "It fails with an error if one or more of the requested groups is unavailable "
4355 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:293
4357 "If an unknown group name is included in the list of groups then an error is "
4362 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:296
4367 #: ../src/guestfs-actions.pod:374
4368 msgid "You must call C<guestfs_launch> before calling this function."
4372 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:304
4374 "The reason is because we don't know what groups are supported by the "
4375 "appliance/daemon until it is running and can be queried."
4379 #: ../src/guestfs-actions.pod:382 ../fish/guestfish-actions.pod:310
4381 "If a group of functions is available, this does not necessarily mean that "
4382 "they will work. You still have to check for errors when calling individual "
4383 "API functions even if they are available."
4387 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:317
4389 "It is usually the job of distro packagers to build complete functionality "
4390 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4391 "with all requirements satisfied, will support everything."
4395 #: ../src/guestfs-actions.pod:396
4397 "This call was added in version C<1.0.80>. In previous versions of "
4398 "libguestfs all you could do would be to speculatively execute a command to "
4399 "find out if the daemon implemented it. See also C<guestfs_version>."
4403 #: ../src/guestfs-actions.pod:405
4404 msgid "guestfs_available_all_groups"
4408 #: ../src/guestfs-actions.pod:407
4411 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4416 #: ../src/guestfs-actions.pod:409
4418 "This command returns a list of all optional groups that this daemon knows "
4419 "about. Note this returns both supported and unsupported groups. To find "
4420 "out which ones the daemon can actually support you have to call "
4421 "C<guestfs_available> on each member of the returned list."
4425 #: ../src/guestfs-actions.pod:415
4426 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4430 #: ../src/guestfs-actions.pod:421
4431 msgid "guestfs_base64_in"
4435 #: ../src/guestfs-actions.pod:423
4438 " int guestfs_base64_in (guestfs_h *g,\n"
4439 "\t\tconst char *base64file,\n"
4440 "\t\tconst char *filename);\n"
4445 #: ../src/guestfs-actions.pod:427 ../fish/guestfish-actions.pod:347
4447 "This command uploads base64-encoded data from C<base64file> to C<filename>."
4451 #: ../src/guestfs-actions.pod:432
4452 msgid "guestfs_base64_out"
4456 #: ../src/guestfs-actions.pod:434
4459 " int guestfs_base64_out (guestfs_h *g,\n"
4460 "\t\tconst char *filename,\n"
4461 "\t\tconst char *base64file);\n"
4466 #: ../src/guestfs-actions.pod:438 ../fish/guestfish-actions.pod:356
4468 "This command downloads the contents of C<filename>, writing it out to local "
4469 "file C<base64file> encoded as base64."
4473 #: ../src/guestfs-actions.pod:443
4474 msgid "guestfs_blockdev_flushbufs"
4478 #: ../src/guestfs-actions.pod:445
4481 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4482 "\t\tconst char *device);\n"
4487 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:365
4489 "This tells the kernel to flush internal buffers associated with C<device>."
4493 #: ../src/guestfs-actions.pod:451 ../src/guestfs-actions.pod:465
4494 #: ../src/guestfs-actions.pod:477 ../src/guestfs-actions.pod:490
4495 #: ../src/guestfs-actions.pod:505 ../src/guestfs-actions.pod:521
4496 #: ../src/guestfs-actions.pod:532 ../src/guestfs-actions.pod:547
4497 #: ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:569
4498 #: ../fish/guestfish-actions.pod:368 ../fish/guestfish-actions.pod:379
4499 #: ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:398
4500 #: ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:423
4501 #: ../fish/guestfish-actions.pod:431 ../fish/guestfish-actions.pod:442
4502 #: ../fish/guestfish-actions.pod:450 ../fish/guestfish-actions.pod:458
4503 msgid "This uses the L<blockdev(8)> command."
4507 #: ../src/guestfs-actions.pod:455
4508 msgid "guestfs_blockdev_getbsz"
4512 #: ../src/guestfs-actions.pod:457
4515 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4516 "\t\tconst char *device);\n"
4521 #: ../src/guestfs-actions.pod:460 ../fish/guestfish-actions.pod:374
4522 msgid "This returns the block size of a device."
4526 #: ../src/guestfs-actions.pod:462 ../src/guestfs-actions.pod:544
4527 #: ../fish/guestfish-actions.pod:376 ../fish/guestfish-actions.pod:439
4529 "(Note this is different from both I<size in blocks> and I<filesystem block "
4534 #: ../src/guestfs-actions.pod:469
4535 msgid "guestfs_blockdev_getro"
4539 #: ../src/guestfs-actions.pod:471
4542 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4543 "\t\tconst char *device);\n"
4548 #: ../src/guestfs-actions.pod:474 ../fish/guestfish-actions.pod:385
4550 "Returns a boolean indicating if the block device is read-only (true if read-"
4551 "only, false if not)."
4555 #: ../src/guestfs-actions.pod:479 ../src/guestfs-actions.pod:1087
4556 #: ../src/guestfs-actions.pod:1099 ../src/guestfs-actions.pod:1531
4557 #: ../src/guestfs-actions.pod:1539 ../src/guestfs-actions.pod:1599
4558 #: ../src/guestfs-actions.pod:1642 ../src/guestfs-actions.pod:1654
4559 #: ../src/guestfs-actions.pod:1673 ../src/guestfs-actions.pod:1690
4560 #: ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2286
4561 #: ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:2309
4562 #: ../src/guestfs-actions.pod:2322 ../src/guestfs-actions.pod:2334
4563 #: ../src/guestfs-actions.pod:2347 ../src/guestfs-actions.pod:2358
4564 #: ../src/guestfs-actions.pod:2368 ../src/guestfs-actions.pod:2379
4565 #: ../src/guestfs-actions.pod:2391 ../src/guestfs-actions.pod:2403
4566 #: ../src/guestfs-actions.pod:3567
4567 msgid "This function returns a C truth value on success or -1 on error."
4571 #: ../src/guestfs-actions.pod:481
4572 msgid "guestfs_blockdev_getsize64"
4576 #: ../src/guestfs-actions.pod:483
4579 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
4580 "\t\tconst char *device);\n"
4585 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:394
4586 msgid "This returns the size of the device in bytes."
4590 #: ../src/guestfs-actions.pod:488
4591 msgid "See also C<guestfs_blockdev_getsz>."
4595 #: ../src/guestfs-actions.pod:494
4596 msgid "guestfs_blockdev_getss"
4600 #: ../src/guestfs-actions.pod:496
4603 " int guestfs_blockdev_getss (guestfs_h *g,\n"
4604 "\t\tconst char *device);\n"
4609 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:404
4611 "This returns the size of sectors on a block device. Usually 512, but can be "
4612 "larger for modern devices."
4616 #: ../src/guestfs-actions.pod:502
4618 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
4623 #: ../src/guestfs-actions.pod:509
4624 msgid "guestfs_blockdev_getsz"
4628 #: ../src/guestfs-actions.pod:511
4631 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
4632 "\t\tconst char *device);\n"
4637 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:416
4639 "This returns the size of the device in units of 512-byte sectors (even if "
4640 "the sectorsize isn't 512 bytes ... weird)."
4644 #: ../src/guestfs-actions.pod:517
4646 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
4647 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
4651 #: ../src/guestfs-actions.pod:525
4652 msgid "guestfs_blockdev_rereadpt"
4656 #: ../src/guestfs-actions.pod:527
4659 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
4660 "\t\tconst char *device);\n"
4665 #: ../src/guestfs-actions.pod:530 ../fish/guestfish-actions.pod:429
4666 msgid "Reread the partition table on C<device>."
4670 #: ../src/guestfs-actions.pod:536
4671 msgid "guestfs_blockdev_setbsz"
4675 #: ../src/guestfs-actions.pod:538
4678 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
4679 "\t\tconst char *device,\n"
4680 "\t\tint blocksize);\n"
4685 #: ../src/guestfs-actions.pod:542 ../fish/guestfish-actions.pod:437
4686 msgid "This sets the block size of a device."
4690 #: ../src/guestfs-actions.pod:551
4691 msgid "guestfs_blockdev_setro"
4695 #: ../src/guestfs-actions.pod:553
4698 " int guestfs_blockdev_setro (guestfs_h *g,\n"
4699 "\t\tconst char *device);\n"
4704 #: ../src/guestfs-actions.pod:556 ../fish/guestfish-actions.pod:448
4705 msgid "Sets the block device named C<device> to read-only."
4709 #: ../src/guestfs-actions.pod:562
4710 msgid "guestfs_blockdev_setrw"
4714 #: ../src/guestfs-actions.pod:564
4717 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
4718 "\t\tconst char *device);\n"
4723 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:456
4724 msgid "Sets the block device named C<device> to read-write."
4728 #: ../src/guestfs-actions.pod:573
4729 msgid "guestfs_case_sensitive_path"
4733 #: ../src/guestfs-actions.pod:575
4736 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
4737 "\t\tconst char *path);\n"
4742 #: ../src/guestfs-actions.pod:578 ../fish/guestfish-actions.pod:464
4744 "This can be used to resolve case insensitive paths on a filesystem which is "
4745 "case sensitive. The use case is to resolve paths which you have read from "
4746 "Windows configuration files or the Windows Registry, to the true path."
4750 #: ../src/guestfs-actions.pod:583 ../fish/guestfish-actions.pod:469
4752 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4753 "(and probably others), which is that although the underlying filesystem is "
4754 "case-insensitive, the driver exports the filesystem to Linux as case-"
4759 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:474
4761 "One consequence of this is that special directories such as C<c:\\windows> "
4762 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4763 "precise details of how they were created. In Windows itself this would not "
4768 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:480
4770 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
4775 #: ../src/guestfs-actions.pod:597 ../fish/guestfish-actions.pod:483
4777 "This function resolves the true case of each element in the path and returns "
4778 "the case-sensitive path."
4782 #: ../src/guestfs-actions.pod:600
4784 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
4785 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4786 "how the directories were originally created under Windows)."
4790 #: ../src/guestfs-actions.pod:605 ../fish/guestfish-actions.pod:491
4791 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4795 #: ../src/guestfs-actions.pod:608
4796 msgid "See also C<guestfs_realpath>."
4800 #: ../src/guestfs-actions.pod:613
4805 #: ../src/guestfs-actions.pod:615
4808 " char *guestfs_cat (guestfs_h *g,\n"
4809 "\t\tconst char *path);\n"
4814 #: ../src/guestfs-actions.pod:618 ../src/guestfs-actions.pod:3944
4815 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:3039
4816 msgid "Return the contents of the file named C<path>."
4820 #: ../src/guestfs-actions.pod:620
4822 "Note that this function cannot correctly handle binary files (specifically, "
4823 "files containing C<\\0> character which is treated as end of string). For "
4824 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
4825 "functions which have a more complex interface."
4829 #: ../src/guestfs-actions.pod:628 ../src/guestfs-actions.pod:789
4830 #: ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:1057
4831 #: ../src/guestfs-actions.pod:1073 ../src/guestfs-actions.pod:1161
4832 #: ../src/guestfs-actions.pod:1177 ../src/guestfs-actions.pod:1408
4833 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:1771
4834 #: ../src/guestfs-actions.pod:1808 ../src/guestfs-actions.pod:1829
4835 #: ../src/guestfs-actions.pod:1843 ../src/guestfs-actions.pod:1869
4836 #: ../src/guestfs-actions.pod:3807 ../src/guestfs-actions.pod:3915
4837 #: ../src/guestfs-actions.pod:3936 ../src/guestfs-actions.pod:4662
4838 #: ../src/guestfs-actions.pod:4714 ../src/guestfs-actions.pod:4830
4839 #: ../src/guestfs-actions.pod:4851 ../src/guestfs-actions.pod:5370
4840 #: ../src/guestfs-actions.pod:5393 ../src/guestfs-actions.pod:5416
4841 #: ../src/guestfs-actions.pod:5432 ../src/guestfs-actions.pod:5505
4842 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5561
4843 #: ../src/guestfs-actions.pod:5577 ../fish/guestfish-actions.pod:507
4844 #: ../fish/guestfish-actions.pod:642 ../fish/guestfish-actions.pod:654
4845 #: ../fish/guestfish-actions.pod:836 ../fish/guestfish-actions.pod:846
4846 #: ../fish/guestfish-actions.pod:913 ../fish/guestfish-actions.pod:923
4847 #: ../fish/guestfish-actions.pod:1118 ../fish/guestfish-actions.pod:1391
4848 #: ../fish/guestfish-actions.pod:1401 ../fish/guestfish-actions.pod:1429
4849 #: ../fish/guestfish-actions.pod:1444 ../fish/guestfish-actions.pod:1454
4850 #: ../fish/guestfish-actions.pod:1473 ../fish/guestfish-actions.pod:2941
4851 #: ../fish/guestfish-actions.pod:3017 ../fish/guestfish-actions.pod:3032
4852 #: ../fish/guestfish-actions.pod:3593 ../fish/guestfish-actions.pod:3639
4853 #: ../fish/guestfish-actions.pod:3724 ../fish/guestfish-actions.pod:3739
4854 #: ../fish/guestfish-actions.pod:4122 ../fish/guestfish-actions.pod:4140
4855 #: ../fish/guestfish-actions.pod:4157 ../fish/guestfish-actions.pod:4167
4856 #: ../fish/guestfish-actions.pod:4215 ../fish/guestfish-actions.pod:4225
4857 #: ../fish/guestfish-actions.pod:4254 ../fish/guestfish-actions.pod:4264
4859 "Because of the message protocol, there is a transfer limit of somewhere "
4860 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4864 #: ../src/guestfs-actions.pod:631
4865 msgid "guestfs_checksum"
4869 #: ../src/guestfs-actions.pod:633
4872 " char *guestfs_checksum (guestfs_h *g,\n"
4873 "\t\tconst char *csumtype,\n"
4874 "\t\tconst char *path);\n"
4879 #: ../src/guestfs-actions.pod:637 ../fish/guestfish-actions.pod:514
4881 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4885 #: ../src/guestfs-actions.pod:640 ../fish/guestfish-actions.pod:517
4887 "The type of checksum to compute is given by the C<csumtype> parameter which "
4888 "must have one of the following values:"
4892 #: ../src/guestfs-actions.pod:645 ../fish/guestfish-actions.pod:522
4897 #: ../src/guestfs-actions.pod:647 ../fish/guestfish-actions.pod:524
4899 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
4904 #: ../src/guestfs-actions.pod:650 ../fish/guestfish-actions.pod:527
4909 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:529
4910 msgid "Compute the MD5 hash (using the C<md5sum> program)."
4914 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:531
4919 #: ../src/guestfs-actions.pod:656 ../fish/guestfish-actions.pod:533
4920 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
4924 #: ../src/guestfs-actions.pod:658 ../fish/guestfish-actions.pod:535
4929 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:537
4930 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
4934 #: ../src/guestfs-actions.pod:662 ../fish/guestfish-actions.pod:539
4939 #: ../src/guestfs-actions.pod:664 ../fish/guestfish-actions.pod:541
4940 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
4944 #: ../src/guestfs-actions.pod:666 ../fish/guestfish-actions.pod:543
4949 #: ../src/guestfs-actions.pod:668 ../fish/guestfish-actions.pod:545
4950 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
4954 #: ../src/guestfs-actions.pod:670 ../fish/guestfish-actions.pod:547
4959 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:549
4960 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
4964 #: ../src/guestfs-actions.pod:676 ../fish/guestfish-actions.pod:553
4965 msgid "The checksum is returned as a printable string."
4969 #: ../src/guestfs-actions.pod:678
4970 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
4974 #: ../src/guestfs-actions.pod:680
4975 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
4979 #: ../src/guestfs-actions.pod:685
4980 msgid "guestfs_checksum_device"
4984 #: ../src/guestfs-actions.pod:687
4987 " char *guestfs_checksum_device (guestfs_h *g,\n"
4988 "\t\tconst char *csumtype,\n"
4989 "\t\tconst char *device);\n"
4994 #: ../src/guestfs-actions.pod:691
4996 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
4997 "device named C<device>. For the types of checksums supported see the "
4998 "C<guestfs_checksum> command."
5002 #: ../src/guestfs-actions.pod:698
5003 msgid "guestfs_checksums_out"
5007 #: ../src/guestfs-actions.pod:700
5010 " int guestfs_checksums_out (guestfs_h *g,\n"
5011 "\t\tconst char *csumtype,\n"
5012 "\t\tconst char *directory,\n"
5013 "\t\tconst char *sumsfile);\n"
5018 #: ../src/guestfs-actions.pod:705 ../fish/guestfish-actions.pod:571
5020 "This command computes the checksums of all regular files in C<directory> and "
5021 "then emits a list of those checksums to the local output file C<sumsfile>."
5025 #: ../src/guestfs-actions.pod:709 ../fish/guestfish-actions.pod:575
5027 "This can be used for verifying the integrity of a virtual machine. However "
5028 "to be properly secure you should pay attention to the output of the checksum "
5029 "command (it uses the ones from GNU coreutils). In particular when the "
5030 "filename is not printable, coreutils uses a special backslash syntax. For "
5031 "more information, see the GNU coreutils info file."
5035 #: ../src/guestfs-actions.pod:719
5036 msgid "guestfs_chmod"
5040 #: ../src/guestfs-actions.pod:721
5043 " int guestfs_chmod (guestfs_h *g,\n"
5045 "\t\tconst char *path);\n"
5050 #: ../src/guestfs-actions.pod:725 ../fish/guestfish-actions.pod:589
5052 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5057 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:592
5059 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5060 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5065 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:3150
5066 #: ../src/guestfs-actions.pod:3238 ../src/guestfs-actions.pod:3254
5067 #: ../src/guestfs-actions.pod:3270 ../fish/guestfish-actions.pod:596
5068 #: ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2516
5069 #: ../fish/guestfish-actions.pod:2526 ../fish/guestfish-actions.pod:2536
5070 msgid "The mode actually set is affected by the umask."
5074 #: ../src/guestfs-actions.pod:736
5075 msgid "guestfs_chown"
5079 #: ../src/guestfs-actions.pod:738
5082 " int guestfs_chown (guestfs_h *g,\n"
5085 "\t\tconst char *path);\n"
5090 #: ../src/guestfs-actions.pod:743 ../fish/guestfish-actions.pod:602
5091 msgid "Change the file owner to C<owner> and group to C<group>."
5095 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:2436
5096 #: ../fish/guestfish-actions.pod:604 ../fish/guestfish-actions.pod:1937
5098 "Only numeric uid and gid are supported. If you want to use names, you will "
5099 "need to locate and parse the password file yourself (Augeas support makes "
5100 "this relatively easy)."
5104 #: ../src/guestfs-actions.pod:751
5105 msgid "guestfs_command"
5109 #: ../src/guestfs-actions.pod:753
5112 " char *guestfs_command (guestfs_h *g,\n"
5113 "\t\tchar *const *arguments);\n"
5118 #: ../src/guestfs-actions.pod:756 ../fish/guestfish-actions.pod:612
5120 "This call runs a command from the guest filesystem. The filesystem must be "
5121 "mounted, and must contain a compatible operating system (ie. something "
5122 "Linux, with the same or compatible processor architecture)."
5126 #: ../src/guestfs-actions.pod:761
5128 "The single parameter is an argv-style list of arguments. The first element "
5129 "is the name of the program to run. Subsequent elements are parameters. The "
5130 "list must be non-empty (ie. must contain a program name). Note that the "
5131 "command runs directly, and is I<not> invoked via the shell (see "
5136 #: ../src/guestfs-actions.pod:768 ../fish/guestfish-actions.pod:624
5137 msgid "The return value is anything printed to I<stdout> by the command."
5141 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:627
5143 "If the command returns a non-zero exit status, then this function returns an "
5144 "error message. The error message string is the content of I<stderr> from "
5149 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:631
5151 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5152 "bin>. If you require a program from another location, you should provide "
5153 "the full path in the first parameter."
5157 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:636
5159 "Shared libraries and data files required by the program must be available on "
5160 "filesystems which are mounted in the correct places. It is the caller's "
5161 "responsibility to ensure all filesystems that are needed are mounted at the "
5166 #: ../src/guestfs-actions.pod:792
5167 msgid "guestfs_command_lines"
5171 #: ../src/guestfs-actions.pod:794
5174 " char **guestfs_command_lines (guestfs_h *g,\n"
5175 "\t\tchar *const *arguments);\n"
5180 #: ../src/guestfs-actions.pod:797
5182 "This is the same as C<guestfs_command>, but splits the result into a list of "
5187 #: ../src/guestfs-actions.pod:800
5188 msgid "See also: C<guestfs_sh_lines>"
5192 #: ../src/guestfs-actions.pod:809
5193 msgid "guestfs_config"
5197 #: ../src/guestfs-actions.pod:811
5200 " int guestfs_config (guestfs_h *g,\n"
5201 "\t\tconst char *qemuparam,\n"
5202 "\t\tconst char *qemuvalue);\n"
5207 #: ../src/guestfs-actions.pod:815 ../fish/guestfish-actions.pod:661
5209 "This can be used to add arbitrary qemu command line parameters of the form "
5210 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
5211 "setting some parameters which would interfere with parameters that we use."
5215 #: ../src/guestfs-actions.pod:820 ../fish/guestfish-actions.pod:666
5216 msgid "The first character of C<param> string must be a C<-> (dash)."
5220 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:668
5221 msgid "C<value> can be NULL."
5225 #: ../src/guestfs-actions.pod:826
5226 msgid "guestfs_copy_size"
5230 #: ../src/guestfs-actions.pod:828
5233 " int guestfs_copy_size (guestfs_h *g,\n"
5234 "\t\tconst char *src,\n"
5235 "\t\tconst char *dest,\n"
5236 "\t\tint64_t size);\n"
5241 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:674
5243 "This command copies exactly C<size> bytes from one source device or file "
5244 "C<src> to another destination device or file C<dest>."
5248 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:677
5250 "Note this will fail if the source is too short or if the destination is not "
5255 #: ../src/guestfs-actions.pod:841 ../src/guestfs-actions.pod:976
5256 #: ../src/guestfs-actions.pod:1348 ../src/guestfs-actions.pod:1367
5257 #: ../src/guestfs-actions.pod:5450 ../src/guestfs-actions.pod:5466
5259 "This long-running command can generate progress notification messages so "
5260 "that the caller can display a progress bar or indicator. To receive these "
5261 "messages, the caller must register a progress callback. See L<guestfs(3)/"
5262 "guestfs_set_progress_callback>."
5266 #: ../src/guestfs-actions.pod:846
5271 #: ../src/guestfs-actions.pod:848
5274 " int guestfs_cp (guestfs_h *g,\n"
5275 "\t\tconst char *src,\n"
5276 "\t\tconst char *dest);\n"
5281 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:684
5283 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5284 "destination filename or destination directory."
5288 #: ../src/guestfs-actions.pod:857
5289 msgid "guestfs_cp_a"
5293 #: ../src/guestfs-actions.pod:859
5296 " int guestfs_cp_a (guestfs_h *g,\n"
5297 "\t\tconst char *src,\n"
5298 "\t\tconst char *dest);\n"
5303 #: ../src/guestfs-actions.pod:863 ../fish/guestfish-actions.pod:691
5305 "This copies a file or directory from C<src> to C<dest> recursively using the "
5310 #: ../src/guestfs-actions.pod:868
5315 #: ../src/guestfs-actions.pod:870
5318 " int guestfs_dd (guestfs_h *g,\n"
5319 "\t\tconst char *src,\n"
5320 "\t\tconst char *dest);\n"
5325 #: ../src/guestfs-actions.pod:874 ../fish/guestfish-actions.pod:698
5327 "This command copies from one source device or file C<src> to another "
5328 "destination device or file C<dest>. Normally you would use this to copy to "
5329 "or from a device or partition, for example to duplicate a filesystem."
5333 #: ../src/guestfs-actions.pod:879
5335 "If the destination is a device, it must be as large or larger than the "
5336 "source file or device, otherwise the copy will fail. This command cannot do "
5337 "partial copies (see C<guestfs_copy_size>)."
5341 #: ../src/guestfs-actions.pod:885
5342 msgid "guestfs_debug"
5346 #: ../src/guestfs-actions.pod:887
5349 " char *guestfs_debug (guestfs_h *g,\n"
5350 "\t\tconst char *subcmd,\n"
5351 "\t\tchar *const *extraargs);\n"
5356 #: ../src/guestfs-actions.pod:891
5358 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5359 "guestfs daemon) that runs inside the qemu subprocess."
5363 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:715
5365 "There is no comprehensive help for this command. You have to look at the "
5366 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5370 #: ../src/guestfs-actions.pod:902
5371 msgid "guestfs_debug_upload"
5375 #: ../src/guestfs-actions.pod:904
5378 " int guestfs_debug_upload (guestfs_h *g,\n"
5379 "\t\tconst char *filename,\n"
5380 "\t\tconst char *tmpname,\n"
5386 #: ../src/guestfs-actions.pod:909
5388 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5393 #: ../src/guestfs-actions.pod:912 ../fish/guestfish-actions.pod:726
5395 "There is no comprehensive help for this command. You have to look at the "
5396 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5400 #: ../src/guestfs-actions.pod:918
5405 #: ../src/guestfs-actions.pod:920
5408 " char *guestfs_df (guestfs_h *g);\n"
5413 #: ../src/guestfs-actions.pod:922 ../fish/guestfish-actions.pod:736
5414 msgid "This command runs the C<df> command to report disk space used."
5418 #: ../src/guestfs-actions.pod:924 ../src/guestfs-actions.pod:938
5419 #: ../fish/guestfish-actions.pod:738 ../fish/guestfish-actions.pod:749
5421 "This command is mostly useful for interactive sessions. It is I<not> "
5422 "intended that you try to parse the output string. Use C<statvfs> from "
5427 #: ../src/guestfs-actions.pod:931
5428 msgid "guestfs_df_h"
5432 #: ../src/guestfs-actions.pod:933
5435 " char *guestfs_df_h (guestfs_h *g);\n"
5440 #: ../src/guestfs-actions.pod:935 ../fish/guestfish-actions.pod:746
5442 "This command runs the C<df -h> command to report disk space used in human-"
5447 #: ../src/guestfs-actions.pod:945
5448 msgid "guestfs_dmesg"
5452 #: ../src/guestfs-actions.pod:947
5455 " char *guestfs_dmesg (guestfs_h *g);\n"
5460 #: ../src/guestfs-actions.pod:949 ../fish/guestfish-actions.pod:757
5462 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5463 "This is sometimes useful for extended debugging of problems."
5467 #: ../src/guestfs-actions.pod:953
5469 "Another way to get the same information is to enable verbose messages with "
5470 "C<guestfs_set_verbose> or by setting the environment variable "
5471 "C<LIBGUESTFS_DEBUG=1> before running the program."
5475 #: ../src/guestfs-actions.pod:961
5476 msgid "guestfs_download"
5480 #: ../src/guestfs-actions.pod:963
5483 " int guestfs_download (guestfs_h *g,\n"
5484 "\t\tconst char *remotefilename,\n"
5485 "\t\tconst char *filename);\n"
5490 #: ../src/guestfs-actions.pod:967 ../fish/guestfish-actions.pod:770
5492 "Download file C<remotefilename> and save it as C<filename> on the local "
5497 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:5044
5498 #: ../fish/guestfish-actions.pod:773 ../fish/guestfish-actions.pod:3893
5499 msgid "C<filename> can also be a named pipe."
5503 #: ../src/guestfs-actions.pod:972
5504 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5508 #: ../src/guestfs-actions.pod:981
5509 msgid "guestfs_drop_caches"
5513 #: ../src/guestfs-actions.pod:983
5516 " int guestfs_drop_caches (guestfs_h *g,\n"
5517 "\t\tint whattodrop);\n"
5522 #: ../src/guestfs-actions.pod:986 ../fish/guestfish-actions.pod:783
5524 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5525 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5526 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5530 #: ../src/guestfs-actions.pod:991 ../fish/guestfish-actions.pod:788
5531 msgid "Setting C<whattodrop> to 3 should drop everything."
5535 #: ../src/guestfs-actions.pod:993 ../fish/guestfish-actions.pod:790
5537 "This automatically calls L<sync(2)> before the operation, so that the "
5538 "maximum guest memory is freed."
5542 #: ../src/guestfs-actions.pod:998
5547 #: ../src/guestfs-actions.pod:1000
5550 " int64_t guestfs_du (guestfs_h *g,\n"
5551 "\t\tconst char *path);\n"
5556 #: ../src/guestfs-actions.pod:1003 ../fish/guestfish-actions.pod:797
5558 "This command runs the C<du -s> command to estimate file space usage for "
5563 #: ../src/guestfs-actions.pod:1006 ../fish/guestfish-actions.pod:800
5565 "C<path> can be a file or a directory. If C<path> is a directory then the "
5566 "estimate includes the contents of the directory and all subdirectories "
5571 #: ../src/guestfs-actions.pod:1010 ../fish/guestfish-actions.pod:804
5573 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5577 #: ../src/guestfs-actions.pod:1015
5578 msgid "guestfs_e2fsck_f"
5582 #: ../src/guestfs-actions.pod:1017
5585 " int guestfs_e2fsck_f (guestfs_h *g,\n"
5586 "\t\tconst char *device);\n"
5591 #: ../src/guestfs-actions.pod:1020 ../fish/guestfish-actions.pod:811
5593 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5594 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
5599 #: ../src/guestfs-actions.pod:1024
5601 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
5602 "Normally you should use C<guestfs_fsck>."
5606 #: ../src/guestfs-actions.pod:1029
5607 msgid "guestfs_echo_daemon"
5611 #: ../src/guestfs-actions.pod:1031
5614 " char *guestfs_echo_daemon (guestfs_h *g,\n"
5615 "\t\tchar *const *words);\n"
5620 #: ../src/guestfs-actions.pod:1034 ../fish/guestfish-actions.pod:822
5622 "This command concatenates the list of C<words> passed with single spaces "
5623 "between them and returns the resulting string."
5627 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:825
5628 msgid "You can use this command to test the connection through to the daemon."
5632 #: ../src/guestfs-actions.pod:1039
5633 msgid "See also C<guestfs_ping_daemon>."
5637 #: ../src/guestfs-actions.pod:1044
5638 msgid "guestfs_egrep"
5642 #: ../src/guestfs-actions.pod:1046
5645 " char **guestfs_egrep (guestfs_h *g,\n"
5646 "\t\tconst char *regex,\n"
5647 "\t\tconst char *path);\n"
5652 #: ../src/guestfs-actions.pod:1050 ../fish/guestfish-actions.pod:833
5654 "This calls the external C<egrep> program and returns the matching lines."
5658 #: ../src/guestfs-actions.pod:1060
5659 msgid "guestfs_egrepi"
5663 #: ../src/guestfs-actions.pod:1062
5666 " char **guestfs_egrepi (guestfs_h *g,\n"
5667 "\t\tconst char *regex,\n"
5668 "\t\tconst char *path);\n"
5673 #: ../src/guestfs-actions.pod:1066 ../fish/guestfish-actions.pod:843
5675 "This calls the external C<egrep -i> program and returns the matching lines."
5679 #: ../src/guestfs-actions.pod:1076
5680 msgid "guestfs_equal"
5684 #: ../src/guestfs-actions.pod:1078
5687 " int guestfs_equal (guestfs_h *g,\n"
5688 "\t\tconst char *file1,\n"
5689 "\t\tconst char *file2);\n"
5694 #: ../src/guestfs-actions.pod:1082 ../fish/guestfish-actions.pod:853
5696 "This compares the two files C<file1> and C<file2> and returns true if their "
5697 "content is exactly equal, or false otherwise."
5701 #: ../src/guestfs-actions.pod:1085 ../fish/guestfish-actions.pod:856
5702 msgid "The external L<cmp(1)> program is used for the comparison."
5706 #: ../src/guestfs-actions.pod:1089
5707 msgid "guestfs_exists"
5711 #: ../src/guestfs-actions.pod:1091
5714 " int guestfs_exists (guestfs_h *g,\n"
5715 "\t\tconst char *path);\n"
5720 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:862
5722 "This returns C<true> if and only if there is a file, directory (or anything) "
5723 "with the given C<path> name."
5727 #: ../src/guestfs-actions.pod:1097
5728 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
5732 #: ../src/guestfs-actions.pod:1101
5733 msgid "guestfs_fallocate"
5737 #: ../src/guestfs-actions.pod:1103
5740 " int guestfs_fallocate (guestfs_h *g,\n"
5741 "\t\tconst char *path,\n"
5747 #: ../src/guestfs-actions.pod:1107 ../src/guestfs-actions.pod:1130
5748 #: ../fish/guestfish-actions.pod:871 ../fish/guestfish-actions.pod:890
5750 "This command preallocates a file (containing zero bytes) named C<path> of "
5751 "size C<len> bytes. If the file exists already, it is overwritten."
5755 #: ../src/guestfs-actions.pod:1111 ../fish/guestfish-actions.pod:875
5757 "Do not confuse this with the guestfish-specific C<alloc> command which "
5758 "allocates a file in the host and attaches it as a device."
5762 #: ../src/guestfs-actions.pod:1117 ../fish/guestfish-actions.pod:879
5764 "This function is deprecated. In new code, use the C<fallocate64> call "
5769 #: ../src/guestfs-actions.pod:1120 ../src/guestfs-actions.pod:1555
5770 #: ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:5399
5771 #: ../src/guestfs-actions.pod:5544 ../fish/guestfish-actions.pod:882
5772 #: ../fish/guestfish-actions.pod:1239 ../fish/guestfish-actions.pod:1253
5773 #: ../fish/guestfish-actions.pod:4146 ../fish/guestfish-actions.pod:4243
5775 "Deprecated functions will not be removed from the API, but the fact that "
5776 "they are deprecated indicates that there are problems with correct use of "
5781 #: ../src/guestfs-actions.pod:1124
5782 msgid "guestfs_fallocate64"
5786 #: ../src/guestfs-actions.pod:1126
5789 " int guestfs_fallocate64 (guestfs_h *g,\n"
5790 "\t\tconst char *path,\n"
5791 "\t\tint64_t len);\n"
5796 #: ../src/guestfs-actions.pod:1134
5798 "Note that this call allocates disk blocks for the file. To create a sparse "
5799 "file use C<guestfs_truncate_size> instead."
5803 #: ../src/guestfs-actions.pod:1137
5805 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
5806 "oversight it only allowed 30 bit lengths to be specified, effectively "
5807 "limiting the maximum size of files created through that call to 1GB."
5811 #: ../src/guestfs-actions.pod:1142 ../fish/guestfish-actions.pod:902
5813 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5814 "commands which create a file in the host and attach it as a device."
5818 #: ../src/guestfs-actions.pod:1148
5819 msgid "guestfs_fgrep"
5823 #: ../src/guestfs-actions.pod:1150
5826 " char **guestfs_fgrep (guestfs_h *g,\n"
5827 "\t\tconst char *pattern,\n"
5828 "\t\tconst char *path);\n"
5833 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:910
5835 "This calls the external C<fgrep> program and returns the matching lines."
5839 #: ../src/guestfs-actions.pod:1164
5840 msgid "guestfs_fgrepi"
5844 #: ../src/guestfs-actions.pod:1166
5847 " char **guestfs_fgrepi (guestfs_h *g,\n"
5848 "\t\tconst char *pattern,\n"
5849 "\t\tconst char *path);\n"
5854 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:920
5856 "This calls the external C<fgrep -i> program and returns the matching lines."
5860 #: ../src/guestfs-actions.pod:1180
5861 msgid "guestfs_file"
5865 #: ../src/guestfs-actions.pod:1182
5868 " char *guestfs_file (guestfs_h *g,\n"
5869 "\t\tconst char *path);\n"
5874 #: ../src/guestfs-actions.pod:1185 ../fish/guestfish-actions.pod:930
5876 "This call uses the standard L<file(1)> command to determine the type or "
5877 "contents of the file."
5881 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:933
5883 "This call will also transparently look inside various types of compressed "
5888 #: ../src/guestfs-actions.pod:1191 ../fish/guestfish-actions.pod:936
5890 "The exact command which runs is C<file -zb path>. Note in particular that "
5891 "the filename is not prepended to the output (the C<-b> option)."
5895 #: ../src/guestfs-actions.pod:1195
5897 "This command can also be used on C</dev/> devices (and partitions, LV "
5898 "names). You can for example use this to determine if a device contains a "
5899 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
5903 #: ../src/guestfs-actions.pod:1200 ../fish/guestfish-actions.pod:945
5905 "If the C<path> does not begin with C</dev/> then this command only works for "
5906 "the content of regular files. For other file types (directory, symbolic "
5907 "link etc) it will just return the string C<directory> etc."
5911 #: ../src/guestfs-actions.pod:1208
5912 msgid "guestfs_file_architecture"
5916 #: ../src/guestfs-actions.pod:1210
5919 " char *guestfs_file_architecture (guestfs_h *g,\n"
5920 "\t\tconst char *filename);\n"
5925 #: ../src/guestfs-actions.pod:1213 ../fish/guestfish-actions.pod:954
5927 "This detects the architecture of the binary C<filename>, and returns it if "
5932 #: ../src/guestfs-actions.pod:1216 ../fish/guestfish-actions.pod:957
5933 msgid "Currently defined architectures are:"
5937 #: ../src/guestfs-actions.pod:1220 ../fish/guestfish-actions.pod:961
5942 #: ../src/guestfs-actions.pod:1222 ../fish/guestfish-actions.pod:963
5944 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5945 "irrespective of the precise processor requirements of the binary."
5949 #: ../src/guestfs-actions.pod:1225 ../fish/guestfish-actions.pod:966
5954 #: ../src/guestfs-actions.pod:1227 ../fish/guestfish-actions.pod:968
5955 msgid "64 bit x86-64."
5959 #: ../src/guestfs-actions.pod:1229 ../fish/guestfish-actions.pod:970
5964 #: ../src/guestfs-actions.pod:1231 ../fish/guestfish-actions.pod:972
5965 msgid "32 bit SPARC."
5969 #: ../src/guestfs-actions.pod:1233 ../fish/guestfish-actions.pod:974
5974 #: ../src/guestfs-actions.pod:1235 ../fish/guestfish-actions.pod:976
5975 msgid "64 bit SPARC V9 and above."
5979 #: ../src/guestfs-actions.pod:1237 ../fish/guestfish-actions.pod:978
5984 #: ../src/guestfs-actions.pod:1239 ../fish/guestfish-actions.pod:980
5985 msgid "Intel Itanium."
5989 #: ../src/guestfs-actions.pod:1241 ../fish/guestfish-actions.pod:982
5994 #: ../src/guestfs-actions.pod:1243 ../fish/guestfish-actions.pod:984
5995 msgid "32 bit Power PC."
5999 #: ../src/guestfs-actions.pod:1245 ../fish/guestfish-actions.pod:986
6004 #: ../src/guestfs-actions.pod:1247 ../fish/guestfish-actions.pod:988
6005 msgid "64 bit Power PC."
6009 #: ../src/guestfs-actions.pod:1251 ../fish/guestfish-actions.pod:992
6010 msgid "Libguestfs may return other architecture strings in future."
6014 #: ../src/guestfs-actions.pod:1253 ../fish/guestfish-actions.pod:994
6015 msgid "The function works on at least the following types of files:"
6019 #: ../src/guestfs-actions.pod:1259 ../fish/guestfish-actions.pod:1000
6020 msgid "many types of Un*x and Linux binary"
6024 #: ../src/guestfs-actions.pod:1263 ../fish/guestfish-actions.pod:1004
6025 msgid "many types of Un*x and Linux shared library"
6029 #: ../src/guestfs-actions.pod:1267 ../fish/guestfish-actions.pod:1008
6030 msgid "Windows Win32 and Win64 binaries"
6034 #: ../src/guestfs-actions.pod:1271 ../fish/guestfish-actions.pod:1012
6035 msgid "Windows Win32 and Win64 DLLs"
6039 #: ../src/guestfs-actions.pod:1273 ../fish/guestfish-actions.pod:1014
6040 msgid "Win32 binaries and DLLs return C<i386>."
6044 #: ../src/guestfs-actions.pod:1275 ../fish/guestfish-actions.pod:1016
6045 msgid "Win64 binaries and DLLs return C<x86_64>."
6049 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:1020
6050 msgid "Linux kernel modules"
6054 #: ../src/guestfs-actions.pod:1283 ../fish/guestfish-actions.pod:1024
6055 msgid "Linux new-style initrd images"
6059 #: ../src/guestfs-actions.pod:1287 ../fish/guestfish-actions.pod:1028
6060 msgid "some non-x86 Linux vmlinuz kernels"
6064 #: ../src/guestfs-actions.pod:1291 ../fish/guestfish-actions.pod:1032
6065 msgid "What it can't do currently:"
6069 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:1038
6070 msgid "static libraries (libfoo.a)"
6074 #: ../src/guestfs-actions.pod:1301 ../fish/guestfish-actions.pod:1042
6075 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6079 #: ../src/guestfs-actions.pod:1305 ../fish/guestfish-actions.pod:1046
6080 msgid "x86 Linux vmlinuz kernels"
6084 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1048
6086 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6087 "compressed code, and are horribly hard to unpack. If you want to find the "
6088 "architecture of a kernel, use the architecture of the associated initrd or "
6089 "kernel module(s) instead."
6093 #: ../src/guestfs-actions.pod:1317
6094 msgid "guestfs_filesize"
6098 #: ../src/guestfs-actions.pod:1319
6101 " int64_t guestfs_filesize (guestfs_h *g,\n"
6102 "\t\tconst char *file);\n"
6107 #: ../src/guestfs-actions.pod:1322 ../fish/guestfish-actions.pod:1059
6108 msgid "This command returns the size of C<file> in bytes."
6112 #: ../src/guestfs-actions.pod:1324
6114 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6115 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6116 "devices, use C<guestfs_blockdev_getsize64>."
6120 #: ../src/guestfs-actions.pod:1330
6121 msgid "guestfs_fill"
6125 #: ../src/guestfs-actions.pod:1332
6128 " int guestfs_fill (guestfs_h *g,\n"
6131 "\t\tconst char *path);\n"
6136 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:1069
6138 "This command creates a new file called C<path>. The initial content of the "
6139 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6144 #: ../src/guestfs-actions.pod:1341
6146 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6147 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6148 "bytes use C<guestfs_fill_pattern>."
6152 #: ../src/guestfs-actions.pod:1353
6153 msgid "guestfs_fill_pattern"
6157 #: ../src/guestfs-actions.pod:1355
6160 " int guestfs_fill_pattern (guestfs_h *g,\n"
6161 "\t\tconst char *pattern,\n"
6163 "\t\tconst char *path);\n"
6168 #: ../src/guestfs-actions.pod:1360
6170 "This function is like C<guestfs_fill> except that it creates a new file of "
6171 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
6172 "pattern is truncated if necessary to ensure the length of the file is "
6173 "exactly C<len> bytes."
6177 #: ../src/guestfs-actions.pod:1372
6178 msgid "guestfs_find"
6182 #: ../src/guestfs-actions.pod:1374
6185 " char **guestfs_find (guestfs_h *g,\n"
6186 "\t\tconst char *directory);\n"
6191 #: ../src/guestfs-actions.pod:1377 ../fish/guestfish-actions.pod:1091
6193 "This command lists out all files and directories, recursively, starting at "
6194 "C<directory>. It is essentially equivalent to running the shell command "
6195 "C<find directory -print> but some post-processing happens on the output, "
6200 #: ../src/guestfs-actions.pod:1382 ../fish/guestfish-actions.pod:1096
6202 "This returns a list of strings I<without any prefix>. Thus if the directory "
6207 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:1099
6217 #: ../src/guestfs-actions.pod:1389
6219 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
6223 #: ../src/guestfs-actions.pod:1392 ../fish/guestfish-actions.pod:1106
6234 #: ../src/guestfs-actions.pod:1397 ../fish/guestfish-actions.pod:1111
6235 msgid "If C<directory> is not a directory, then this command returns an error."
6239 #: ../src/guestfs-actions.pod:1400 ../fish/guestfish-actions.pod:1114
6240 msgid "The returned list is sorted."
6244 #: ../src/guestfs-actions.pod:1402
6245 msgid "See also C<guestfs_find0>."
6249 #: ../src/guestfs-actions.pod:1411
6250 msgid "guestfs_find0"
6254 #: ../src/guestfs-actions.pod:1413
6257 " int guestfs_find0 (guestfs_h *g,\n"
6258 "\t\tconst char *directory,\n"
6259 "\t\tconst char *files);\n"
6264 #: ../src/guestfs-actions.pod:1417 ../fish/guestfish-actions.pod:1125
6266 "This command lists out all files and directories, recursively, starting at "
6267 "C<directory>, placing the resulting list in the external file called "
6272 #: ../src/guestfs-actions.pod:1421
6274 "This command works the same way as C<guestfs_find> with the following "
6279 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:1136
6280 msgid "The resulting list is written to an external file."
6284 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:1140
6286 "Items (filenames) in the result are separated by C<\\0> characters. See "
6287 "L<find(1)> option I<-print0>."
6291 #: ../src/guestfs-actions.pod:1437 ../fish/guestfish-actions.pod:1145
6292 msgid "This command is not limited in the number of names that it can return."
6296 #: ../src/guestfs-actions.pod:1442 ../fish/guestfish-actions.pod:1150
6297 msgid "The result list is not sorted."
6301 #: ../src/guestfs-actions.pod:1448
6302 msgid "guestfs_findfs_label"
6306 #: ../src/guestfs-actions.pod:1450
6309 " char *guestfs_findfs_label (guestfs_h *g,\n"
6310 "\t\tconst char *label);\n"
6315 #: ../src/guestfs-actions.pod:1453 ../fish/guestfish-actions.pod:1160
6317 "This command searches the filesystems and returns the one which has the "
6318 "given label. An error is returned if no such filesystem can be found."
6322 #: ../src/guestfs-actions.pod:1457
6323 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6327 #: ../src/guestfs-actions.pod:1462
6328 msgid "guestfs_findfs_uuid"
6332 #: ../src/guestfs-actions.pod:1464
6335 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6336 "\t\tconst char *uuid);\n"
6341 #: ../src/guestfs-actions.pod:1467 ../fish/guestfish-actions.pod:1170
6343 "This command searches the filesystems and returns the one which has the "
6344 "given UUID. An error is returned if no such filesystem can be found."
6348 #: ../src/guestfs-actions.pod:1471
6349 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6353 #: ../src/guestfs-actions.pod:1476
6354 msgid "guestfs_fsck"
6358 #: ../src/guestfs-actions.pod:1478
6361 " int guestfs_fsck (guestfs_h *g,\n"
6362 "\t\tconst char *fstype,\n"
6363 "\t\tconst char *device);\n"
6368 #: ../src/guestfs-actions.pod:1482 ../fish/guestfish-actions.pod:1180
6370 "This runs the filesystem checker (fsck) on C<device> which should have "
6371 "filesystem type C<fstype>."
6375 #: ../src/guestfs-actions.pod:1485 ../fish/guestfish-actions.pod:1183
6377 "The returned integer is the status. See L<fsck(8)> for the list of status "
6378 "codes from C<fsck>."
6382 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:1192
6383 msgid "Multiple status codes can be summed together."
6387 #: ../src/guestfs-actions.pod:1498 ../fish/guestfish-actions.pod:1196
6389 "A non-zero return code can mean \"success\", for example if errors have been "
6390 "corrected on the filesystem."
6394 #: ../src/guestfs-actions.pod:1503 ../fish/guestfish-actions.pod:1201
6395 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6399 #: ../src/guestfs-actions.pod:1508 ../fish/guestfish-actions.pod:1206
6401 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6405 #: ../src/guestfs-actions.pod:1512
6406 msgid "guestfs_get_append"
6410 #: ../src/guestfs-actions.pod:1514
6413 " const char *guestfs_get_append (guestfs_h *g);\n"
6418 #: ../src/guestfs-actions.pod:1516 ../fish/guestfish-actions.pod:1212
6420 "Return the additional kernel options which are added to the guest kernel "
6425 #: ../src/guestfs-actions.pod:1519 ../fish/guestfish-actions.pod:1215
6426 msgid "If C<NULL> then no options are added."
6430 #: ../src/guestfs-actions.pod:1521
6432 "This function returns a string which may be NULL. There is no way to return "
6433 "an error from this function. The string is owned by the guest handle and "
6434 "must I<not> be freed."
6438 #: ../src/guestfs-actions.pod:1525
6439 msgid "guestfs_get_autosync"
6443 #: ../src/guestfs-actions.pod:1527
6446 " int guestfs_get_autosync (guestfs_h *g);\n"
6451 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1221
6452 msgid "Get the autosync flag."
6456 #: ../src/guestfs-actions.pod:1533
6457 msgid "guestfs_get_direct"
6461 #: ../src/guestfs-actions.pod:1535
6464 " int guestfs_get_direct (guestfs_h *g);\n"
6469 #: ../src/guestfs-actions.pod:1537 ../fish/guestfish-actions.pod:1227
6470 msgid "Return the direct appliance mode flag."
6474 #: ../src/guestfs-actions.pod:1541
6475 msgid "guestfs_get_e2label"
6479 #: ../src/guestfs-actions.pod:1543
6482 " char *guestfs_get_e2label (guestfs_h *g,\n"
6483 "\t\tconst char *device);\n"
6488 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1233
6490 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6494 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1236
6496 "This function is deprecated. In new code, use the C<vfs_label> call instead."
6500 #: ../src/guestfs-actions.pod:1559
6501 msgid "guestfs_get_e2uuid"
6505 #: ../src/guestfs-actions.pod:1561
6508 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6509 "\t\tconst char *device);\n"
6514 #: ../src/guestfs-actions.pod:1564 ../fish/guestfish-actions.pod:1247
6516 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6520 #: ../src/guestfs-actions.pod:1570 ../fish/guestfish-actions.pod:1250
6522 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6526 #: ../src/guestfs-actions.pod:1577
6527 msgid "guestfs_get_memsize"
6531 #: ../src/guestfs-actions.pod:1579
6534 " int guestfs_get_memsize (guestfs_h *g);\n"
6539 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1261
6541 "This gets the memory size in megabytes allocated to the qemu subprocess."
6545 #: ../src/guestfs-actions.pod:1584
6547 "If C<guestfs_set_memsize> was not called on this handle, and if "
6548 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6549 "value for memsize."
6553 #: ../src/guestfs-actions.pod:1588 ../src/guestfs-actions.pod:1651
6554 #: ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4389
6555 #: ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1317
6556 #: ../fish/guestfish-actions.pod:3318 ../fish/guestfish-actions.pod:3395
6558 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6562 #: ../src/guestfs-actions.pod:1593
6563 msgid "guestfs_get_network"
6567 #: ../src/guestfs-actions.pod:1595
6570 " int guestfs_get_network (guestfs_h *g);\n"
6575 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1275
6576 msgid "This returns the enable network flag."
6580 #: ../src/guestfs-actions.pod:1601
6581 msgid "guestfs_get_path"
6585 #: ../src/guestfs-actions.pod:1603
6588 " const char *guestfs_get_path (guestfs_h *g);\n"
6593 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1281
6594 msgid "Return the current search path."
6598 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1283
6600 "This is always non-NULL. If it wasn't set already, then this will return "
6605 #: ../src/guestfs-actions.pod:1610 ../src/guestfs-actions.pod:1633
6607 "This function returns a string, or NULL on error. The string is owned by "
6608 "the guest handle and must I<not> be freed."
6612 #: ../src/guestfs-actions.pod:1613
6613 msgid "guestfs_get_pid"
6617 #: ../src/guestfs-actions.pod:1615
6620 " int guestfs_get_pid (guestfs_h *g);\n"
6625 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1290
6627 "Return the process ID of the qemu subprocess. If there is no qemu "
6628 "subprocess, then this will return an error."
6632 #: ../src/guestfs-actions.pod:1620 ../fish/guestfish-actions.pod:1293
6633 msgid "This is an internal call used for debugging and testing."
6637 #: ../src/guestfs-actions.pod:1624
6638 msgid "guestfs_get_qemu"
6642 #: ../src/guestfs-actions.pod:1626
6645 " const char *guestfs_get_qemu (guestfs_h *g);\n"
6650 #: ../src/guestfs-actions.pod:1628 ../fish/guestfish-actions.pod:1299
6651 msgid "Return the current qemu binary."
6655 #: ../src/guestfs-actions.pod:1630 ../fish/guestfish-actions.pod:1301
6657 "This is always non-NULL. If it wasn't set already, then this will return "
6658 "the default qemu binary name."
6662 #: ../src/guestfs-actions.pod:1636
6663 msgid "guestfs_get_recovery_proc"
6667 #: ../src/guestfs-actions.pod:1638
6670 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
6675 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1308
6676 msgid "Return the recovery process enabled flag."
6680 #: ../src/guestfs-actions.pod:1644
6681 msgid "guestfs_get_selinux"
6685 #: ../src/guestfs-actions.pod:1646
6688 " int guestfs_get_selinux (guestfs_h *g);\n"
6693 #: ../src/guestfs-actions.pod:1648
6695 "This returns the current setting of the selinux flag which is passed to the "
6696 "appliance at boot time. See C<guestfs_set_selinux>."
6700 #: ../src/guestfs-actions.pod:1656
6701 msgid "guestfs_get_state"
6705 #: ../src/guestfs-actions.pod:1658
6708 " int guestfs_get_state (guestfs_h *g);\n"
6713 #: ../src/guestfs-actions.pod:1660 ../fish/guestfish-actions.pod:1324
6715 "This returns the current state as an opaque integer. This is only useful "
6716 "for printing debug and internal error messages."
6720 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:2284
6721 #: ../src/guestfs-actions.pod:2307 ../src/guestfs-actions.pod:2356
6722 #: ../src/guestfs-actions.pod:2377 ../fish/guestfish-actions.pod:1327
6723 #: ../fish/guestfish-actions.pod:1821 ../fish/guestfish-actions.pod:1839
6724 #: ../fish/guestfish-actions.pod:1877 ../fish/guestfish-actions.pod:1893
6725 msgid "For more information on states, see L<guestfs(3)>."
6729 #: ../src/guestfs-actions.pod:1667
6730 msgid "guestfs_get_trace"
6734 #: ../src/guestfs-actions.pod:1669
6737 " int guestfs_get_trace (guestfs_h *g);\n"
6742 #: ../src/guestfs-actions.pod:1671 ../fish/guestfish-actions.pod:1333
6743 msgid "Return the command trace flag."
6747 #: ../src/guestfs-actions.pod:1675
6748 msgid "guestfs_get_umask"
6752 #: ../src/guestfs-actions.pod:1677
6755 " int guestfs_get_umask (guestfs_h *g);\n"
6760 #: ../src/guestfs-actions.pod:1679
6762 "Return the current umask. By default the umask is C<022> unless it has been "
6763 "set by calling C<guestfs_umask>."
6767 #: ../src/guestfs-actions.pod:1684
6768 msgid "guestfs_get_verbose"
6772 #: ../src/guestfs-actions.pod:1686
6775 " int guestfs_get_verbose (guestfs_h *g);\n"
6780 #: ../src/guestfs-actions.pod:1688 ../fish/guestfish-actions.pod:1346
6781 msgid "This returns the verbose messages flag."
6785 #: ../src/guestfs-actions.pod:1692
6786 msgid "guestfs_getcon"
6790 #: ../src/guestfs-actions.pod:1694
6793 " char *guestfs_getcon (guestfs_h *g);\n"
6798 #: ../src/guestfs-actions.pod:1696 ../fish/guestfish-actions.pod:1352
6799 msgid "This gets the SELinux security context of the daemon."
6803 #: ../src/guestfs-actions.pod:1698
6805 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
6809 #: ../src/guestfs-actions.pod:1704
6810 msgid "guestfs_getxattrs"
6814 #: ../src/guestfs-actions.pod:1706
6817 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
6818 "\t\tconst char *path);\n"
6823 #: ../src/guestfs-actions.pod:1709 ../fish/guestfish-actions.pod:1361
6825 "This call lists the extended attributes of the file or directory C<path>."
6829 #: ../src/guestfs-actions.pod:1712 ../fish/guestfish-actions.pod:1364
6831 "At the system call level, this is a combination of the L<listxattr(2)> and "
6832 "L<getxattr(2)> calls."
6836 #: ../src/guestfs-actions.pod:1715
6837 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
6841 #: ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:2451
6842 #: ../src/guestfs-actions.pod:2989
6844 "This function returns a C<struct guestfs_xattr_list *> (see E<lt>guestfs-"
6845 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
6846 "C<guestfs_free_xattr_list> after use>."
6850 #: ../src/guestfs-actions.pod:1722
6851 msgid "guestfs_glob_expand"
6855 #: ../src/guestfs-actions.pod:1724
6858 " char **guestfs_glob_expand (guestfs_h *g,\n"
6859 "\t\tconst char *pattern);\n"
6864 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1373
6866 "This command searches for all the pathnames matching C<pattern> according to "
6867 "the wildcard expansion rules used by the shell."
6871 #: ../src/guestfs-actions.pod:1731 ../fish/guestfish-actions.pod:1377
6873 "If no paths match, then this returns an empty list (note: not an error)."
6877 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1380
6879 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
6880 "GLOB_BRACE>. See that manual page for more details."
6884 #: ../src/guestfs-actions.pod:1742
6885 msgid "guestfs_grep"
6889 #: ../src/guestfs-actions.pod:1744
6892 " char **guestfs_grep (guestfs_h *g,\n"
6893 "\t\tconst char *regex,\n"
6894 "\t\tconst char *path);\n"
6899 #: ../src/guestfs-actions.pod:1748 ../fish/guestfish-actions.pod:1388
6900 msgid "This calls the external C<grep> program and returns the matching lines."
6904 #: ../src/guestfs-actions.pod:1758
6905 msgid "guestfs_grepi"
6909 #: ../src/guestfs-actions.pod:1760
6912 " char **guestfs_grepi (guestfs_h *g,\n"
6913 "\t\tconst char *regex,\n"
6914 "\t\tconst char *path);\n"
6919 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1398
6921 "This calls the external C<grep -i> program and returns the matching lines."
6925 #: ../src/guestfs-actions.pod:1774
6926 msgid "guestfs_grub_install"
6930 #: ../src/guestfs-actions.pod:1776
6933 " int guestfs_grub_install (guestfs_h *g,\n"
6934 "\t\tconst char *root,\n"
6935 "\t\tconst char *device);\n"
6940 #: ../src/guestfs-actions.pod:1780 ../fish/guestfish-actions.pod:1408
6942 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
6943 "the root directory being C<root>."
6947 #: ../src/guestfs-actions.pod:1783 ../fish/guestfish-actions.pod:1411
6949 "Note: If grub-install reports the error \"No suitable drive was found in the "
6950 "generated device map.\" it may be that you need to create a C</boot/grub/"
6951 "device.map> file first that contains the mapping between grub device names "
6952 "and Linux device names. It is usually sufficient to create a file "
6957 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1418
6965 #: ../src/guestfs-actions.pod:1792 ../fish/guestfish-actions.pod:1420
6966 msgid "replacing C</dev/vda> with the name of the installation device."
6970 #: ../src/guestfs-actions.pod:1796
6971 msgid "guestfs_head"
6975 #: ../src/guestfs-actions.pod:1798
6978 " char **guestfs_head (guestfs_h *g,\n"
6979 "\t\tconst char *path);\n"
6984 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1426
6986 "This command returns up to the first 10 lines of a file as a list of strings."
6990 #: ../src/guestfs-actions.pod:1811
6991 msgid "guestfs_head_n"
6995 #: ../src/guestfs-actions.pod:1813
6998 " char **guestfs_head_n (guestfs_h *g,\n"
6999 "\t\tint nrlines,\n"
7000 "\t\tconst char *path);\n"
7005 #: ../src/guestfs-actions.pod:1817 ../fish/guestfish-actions.pod:1436
7007 "If the parameter C<nrlines> is a positive number, this returns the first "
7008 "C<nrlines> lines of the file C<path>."
7012 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1439
7014 "If the parameter C<nrlines> is a negative number, this returns lines from "
7015 "the file C<path>, excluding the last C<nrlines> lines."
7019 #: ../src/guestfs-actions.pod:1823 ../src/guestfs-actions.pod:4845
7020 #: ../fish/guestfish-actions.pod:1442 ../fish/guestfish-actions.pod:3737
7021 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7025 #: ../src/guestfs-actions.pod:1832
7026 msgid "guestfs_hexdump"
7030 #: ../src/guestfs-actions.pod:1834
7033 " char *guestfs_hexdump (guestfs_h *g,\n"
7034 "\t\tconst char *path);\n"
7039 #: ../src/guestfs-actions.pod:1837 ../fish/guestfish-actions.pod:1451
7041 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7042 "readable, canonical hex dump of the file."
7046 #: ../src/guestfs-actions.pod:1846
7047 msgid "guestfs_initrd_cat"
7051 #: ../src/guestfs-actions.pod:1848
7054 " char *guestfs_initrd_cat (guestfs_h *g,\n"
7055 "\t\tconst char *initrdpath,\n"
7056 "\t\tconst char *filename,\n"
7057 "\t\tsize_t *size_r);\n"
7062 #: ../src/guestfs-actions.pod:1853 ../fish/guestfish-actions.pod:1461
7064 "This command unpacks the file C<filename> from the initrd file called "
7065 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7070 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1465
7072 "For example, in guestfish you could use the following command to examine the "
7073 "boot script (usually called C</init>) contained in a Linux initrd or "
7078 #: ../src/guestfs-actions.pod:1861 ../fish/guestfish-actions.pod:1469
7081 " initrd-cat /boot/initrd-<version>.img init\n"
7086 #: ../src/guestfs-actions.pod:1863
7087 msgid "See also C<guestfs_initrd_list>."
7091 #: ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:3803
7092 #: ../src/guestfs-actions.pod:3932
7094 "This function returns a buffer, or NULL on error. The size of the returned "
7095 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
7100 #: ../src/guestfs-actions.pod:1872
7101 msgid "guestfs_initrd_list"
7105 #: ../src/guestfs-actions.pod:1874
7108 " char **guestfs_initrd_list (guestfs_h *g,\n"
7109 "\t\tconst char *path);\n"
7114 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1480
7115 msgid "This command lists out files contained in an initrd."
7119 #: ../src/guestfs-actions.pod:1879 ../fish/guestfish-actions.pod:1482
7121 "The files are listed without any initial C</> character. The files are "
7122 "listed in the order they appear (not necessarily alphabetical). Directory "
7123 "names are listed as separate items."
7127 #: ../src/guestfs-actions.pod:1883 ../fish/guestfish-actions.pod:1486
7129 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7130 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7135 #: ../src/guestfs-actions.pod:1891
7136 msgid "guestfs_inotify_add_watch"
7140 #: ../src/guestfs-actions.pod:1893
7143 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
7144 "\t\tconst char *path,\n"
7150 #: ../src/guestfs-actions.pod:1897 ../fish/guestfish-actions.pod:1494
7151 msgid "Watch C<path> for the events listed in C<mask>."
7155 #: ../src/guestfs-actions.pod:1899 ../fish/guestfish-actions.pod:1496
7157 "Note that if C<path> is a directory then events within that directory are "
7158 "watched, but this does I<not> happen recursively (in subdirectories)."
7162 #: ../src/guestfs-actions.pod:1903 ../fish/guestfish-actions.pod:1500
7164 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7165 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7169 #: ../src/guestfs-actions.pod:1909
7170 msgid "guestfs_inotify_close"
7174 #: ../src/guestfs-actions.pod:1911
7177 " int guestfs_inotify_close (guestfs_h *g);\n"
7182 #: ../src/guestfs-actions.pod:1913 ../fish/guestfish-actions.pod:1508
7184 "This closes the inotify handle which was previously opened by inotify_init. "
7185 "It removes all watches, throws away any pending events, and deallocates all "
7190 #: ../src/guestfs-actions.pod:1919
7191 msgid "guestfs_inotify_files"
7195 #: ../src/guestfs-actions.pod:1921
7198 " char **guestfs_inotify_files (guestfs_h *g);\n"
7203 #: ../src/guestfs-actions.pod:1923
7205 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
7206 "returns a list of pathnames of objects that were touched. The returned "
7207 "pathnames are sorted and deduplicated."
7211 #: ../src/guestfs-actions.pod:1931
7212 msgid "guestfs_inotify_init"
7216 #: ../src/guestfs-actions.pod:1933
7219 " int guestfs_inotify_init (guestfs_h *g,\n"
7220 "\t\tint maxevents);\n"
7225 #: ../src/guestfs-actions.pod:1936 ../fish/guestfish-actions.pod:1524
7227 "This command creates a new inotify handle. The inotify subsystem can be "
7228 "used to notify events which happen to objects in the guest filesystem."
7232 #: ../src/guestfs-actions.pod:1940
7234 "C<maxevents> is the maximum number of events which will be queued up between "
7235 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
7236 "passed as C<0>, then the kernel (or previously set) default is used. For "
7237 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
7238 "throws away events, but records the fact that it threw them away by setting "
7239 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
7240 "C<guestfs_inotify_read>)."
7244 #: ../src/guestfs-actions.pod:1950
7246 "Before any events are generated, you have to add some watches to the "
7247 "internal watch list. See: C<guestfs_inotify_add_watch>, "
7248 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
7252 #: ../src/guestfs-actions.pod:1956
7254 "Queued up events should be read periodically by calling "
7255 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
7256 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
7257 "often enough then you risk the internal queue overflowing."
7261 #: ../src/guestfs-actions.pod:1963
7263 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
7264 "This also removes any watches automatically."
7268 #: ../src/guestfs-actions.pod:1967 ../fish/guestfish-actions.pod:1555
7270 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7271 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7272 "that there is one global inotify handle per libguestfs instance."
7276 #: ../src/guestfs-actions.pod:1974
7277 msgid "guestfs_inotify_read"
7281 #: ../src/guestfs-actions.pod:1976
7284 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
7289 #: ../src/guestfs-actions.pod:1978 ../fish/guestfish-actions.pod:1564
7291 "Return the complete queue of events that have happened since the previous "
7296 #: ../src/guestfs-actions.pod:1981 ../fish/guestfish-actions.pod:1567
7297 msgid "If no events have happened, this returns an empty list."
7301 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1569
7303 "I<Note>: In order to make sure that all events have been read, you must call "
7304 "this function repeatedly until it returns an empty list. The reason is that "
7305 "the call will read events up to the maximum appliance-to-host message size "
7306 "and leave remaining events in the queue."
7310 #: ../src/guestfs-actions.pod:1989
7312 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7313 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7314 "must call C<guestfs_free_inotify_event_list> after use>."
7318 #: ../src/guestfs-actions.pod:1994
7319 msgid "guestfs_inotify_rm_watch"
7323 #: ../src/guestfs-actions.pod:1996
7326 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7332 #: ../src/guestfs-actions.pod:1999
7334 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
7338 #: ../src/guestfs-actions.pod:2004
7339 msgid "guestfs_inspect_get_arch"
7343 #: ../src/guestfs-actions.pod:2006
7346 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7347 "\t\tconst char *root);\n"
7352 #: ../src/guestfs-actions.pod:2009 ../src/guestfs-actions.pod:2029
7353 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:2102
7354 #: ../src/guestfs-actions.pod:2126 ../src/guestfs-actions.pod:2144
7355 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:2195
7357 "This function should only be called with a root device string as returned by "
7358 "C<guestfs_inspect_os>."
7362 #: ../src/guestfs-actions.pod:2012
7364 "This returns the architecture of the inspected operating system. The "
7365 "possible return values are listed under C<guestfs_file_architecture>."
7369 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1593
7371 "If the architecture could not be determined, then the string C<unknown> is "
7376 #: ../src/guestfs-actions.pod:2019 ../src/guestfs-actions.pod:2069
7377 #: ../src/guestfs-actions.pod:2117 ../src/guestfs-actions.pod:2185
7378 #: ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2257
7379 #: ../fish/guestfish-actions.pod:1596 ../fish/guestfish-actions.pod:1642
7380 #: ../fish/guestfish-actions.pod:1681 ../fish/guestfish-actions.pod:1736
7381 #: ../fish/guestfish-actions.pod:1767 ../fish/guestfish-actions.pod:1801
7382 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7386 #: ../src/guestfs-actions.pod:2024
7387 msgid "guestfs_inspect_get_distro"
7391 #: ../src/guestfs-actions.pod:2026
7394 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7395 "\t\tconst char *root);\n"
7400 #: ../src/guestfs-actions.pod:2032 ../fish/guestfish-actions.pod:1605
7402 "This returns the distro (distribution) of the inspected operating system."
7406 #: ../src/guestfs-actions.pod:2035 ../fish/guestfish-actions.pod:1608
7407 msgid "Currently defined distros are:"
7411 #: ../src/guestfs-actions.pod:2039 ../fish/guestfish-actions.pod:1612
7416 #: ../src/guestfs-actions.pod:2041 ../fish/guestfish-actions.pod:1614
7417 msgid "Debian or a Debian-derived distro such as Ubuntu."
7421 #: ../src/guestfs-actions.pod:2043 ../fish/guestfish-actions.pod:1616
7426 #: ../src/guestfs-actions.pod:2045 ../fish/guestfish-actions.pod:1618
7431 #: ../src/guestfs-actions.pod:2047 ../fish/guestfish-actions.pod:1620
7432 msgid "\"redhat-based\""
7436 #: ../src/guestfs-actions.pod:2049 ../fish/guestfish-actions.pod:1622
7437 msgid "Some Red Hat-derived distro."
7441 #: ../src/guestfs-actions.pod:2051 ../fish/guestfish-actions.pod:1624
7446 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1626
7447 msgid "Red Hat Enterprise Linux and some derivatives."
7451 #: ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2207
7452 #: ../fish/guestfish-actions.pod:1628 ../fish/guestfish-actions.pod:1754
7457 #: ../src/guestfs-actions.pod:2057 ../fish/guestfish-actions.pod:1630
7459 "Windows does not have distributions. This string is returned if the OS type "
7464 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2211
7465 #: ../fish/guestfish-actions.pod:1633 ../fish/guestfish-actions.pod:1758
7470 #: ../src/guestfs-actions.pod:2062 ../fish/guestfish-actions.pod:1635
7471 msgid "The distro could not be determined."
7475 #: ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2217
7476 #: ../fish/guestfish-actions.pod:1639 ../fish/guestfish-actions.pod:1764
7478 "Future versions of libguestfs may return other strings here. The caller "
7479 "should be prepared to handle any string."
7483 #: ../src/guestfs-actions.pod:2074
7484 msgid "guestfs_inspect_get_filesystems"
7488 #: ../src/guestfs-actions.pod:2076
7491 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7492 "\t\tconst char *root);\n"
7497 #: ../src/guestfs-actions.pod:2082 ../fish/guestfish-actions.pod:1651
7499 "This returns a list of all the filesystems that we think are associated with "
7500 "this operating system. This includes the root filesystem, other ordinary "
7501 "filesystems, and non-mounted devices like swap partitions."
7505 #: ../src/guestfs-actions.pod:2087 ../fish/guestfish-actions.pod:1656
7507 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7508 "to be shared between operating systems."
7512 #: ../src/guestfs-actions.pod:2090
7514 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7515 "C<guestfs_inspect_get_mountpoints>."
7519 #: ../src/guestfs-actions.pod:2097
7520 msgid "guestfs_inspect_get_major_version"
7524 #: ../src/guestfs-actions.pod:2099
7527 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
7528 "\t\tconst char *root);\n"
7533 #: ../src/guestfs-actions.pod:2105 ../fish/guestfish-actions.pod:1669
7535 "This returns the major version number of the inspected operating system."
7539 #: ../src/guestfs-actions.pod:2108 ../fish/guestfish-actions.pod:1672
7541 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7542 "popular public names used by the operating system. Notably the operating "
7543 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7544 "1). You can find out the real versions corresponding to releases of Windows "
7545 "by consulting Wikipedia or MSDN."
7549 #: ../src/guestfs-actions.pod:2115 ../src/guestfs-actions.pod:2132
7550 #: ../fish/guestfish-actions.pod:1679 ../fish/guestfish-actions.pod:1693
7551 msgid "If the version could not be determined, then C<0> is returned."
7555 #: ../src/guestfs-actions.pod:2121
7556 msgid "guestfs_inspect_get_minor_version"
7560 #: ../src/guestfs-actions.pod:2123
7563 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
7564 "\t\tconst char *root);\n"
7569 #: ../src/guestfs-actions.pod:2129 ../fish/guestfish-actions.pod:1690
7571 "This returns the minor version number of the inspected operating system."
7575 #: ../src/guestfs-actions.pod:2134
7577 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7578 "C<guestfs_inspect_get_major_version>."
7582 #: ../src/guestfs-actions.pod:2139
7583 msgid "guestfs_inspect_get_mountpoints"
7587 #: ../src/guestfs-actions.pod:2141
7590 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
7591 "\t\tconst char *root);\n"
7596 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1705
7598 "This returns a hash of where we think the filesystems associated with this "
7599 "operating system should be mounted. Callers should note that this is at "
7600 "best an educated guess made by reading configuration files such as C</etc/"
7605 #: ../src/guestfs-actions.pod:2152 ../fish/guestfish-actions.pod:1710
7607 "Each element in the returned hashtable has a key which is the path of the "
7608 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7609 "mounted there (eg. C</dev/sda1>)."
7613 #: ../src/guestfs-actions.pod:2157 ../fish/guestfish-actions.pod:1715
7615 "Non-mounted devices such as swap devices are I<not> returned in this list."
7619 #: ../src/guestfs-actions.pod:2160
7621 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7622 "C<guestfs_inspect_get_filesystems>."
7626 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2503
7627 #: ../src/guestfs-actions.pod:3425 ../src/guestfs-actions.pod:4962
7629 "This function returns a NULL-terminated array of strings, or NULL if there "
7630 "was an error. The array of strings will always have length C<2n+1>, where "
7631 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
7632 "caller must free the strings and the array after use>."
7636 #: ../src/guestfs-actions.pod:2169
7637 msgid "guestfs_inspect_get_product_name"
7641 #: ../src/guestfs-actions.pod:2171
7644 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
7645 "\t\tconst char *root);\n"
7650 #: ../src/guestfs-actions.pod:2177 ../fish/guestfish-actions.pod:1728
7652 "This returns the product name of the inspected operating system. The "
7653 "product name is generally some freeform string which can be displayed to the "
7654 "user, but should not be parsed by programs."
7658 #: ../src/guestfs-actions.pod:2182 ../fish/guestfish-actions.pod:1733
7660 "If the product name could not be determined, then the string C<unknown> is "
7665 #: ../src/guestfs-actions.pod:2190
7666 msgid "guestfs_inspect_get_type"
7670 #: ../src/guestfs-actions.pod:2192
7673 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
7674 "\t\tconst char *root);\n"
7679 #: ../src/guestfs-actions.pod:2198 ../fish/guestfish-actions.pod:1745
7681 "This returns the type of the inspected operating system. Currently defined "
7686 #: ../src/guestfs-actions.pod:2203 ../fish/guestfish-actions.pod:1750
7691 #: ../src/guestfs-actions.pod:2205 ../fish/guestfish-actions.pod:1752
7692 msgid "Any Linux-based operating system."
7696 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1756
7697 msgid "Any Microsoft Windows operating system."
7701 #: ../src/guestfs-actions.pod:2213 ../fish/guestfish-actions.pod:1760
7702 msgid "The operating system type could not be determined."
7706 #: ../src/guestfs-actions.pod:2225
7707 msgid "guestfs_inspect_os"
7711 #: ../src/guestfs-actions.pod:2227
7714 " char **guestfs_inspect_os (guestfs_h *g);\n"
7719 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1773
7721 "This function uses other libguestfs functions and certain heuristics to "
7722 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
7723 "for operating systems."
7727 #: ../src/guestfs-actions.pod:2233 ../fish/guestfish-actions.pod:1777
7728 msgid "The list returned is empty if no operating systems were found."
7732 #: ../src/guestfs-actions.pod:2235 ../fish/guestfish-actions.pod:1779
7734 "If one operating system was found, then this returns a list with a single "
7735 "element, which is the name of the root filesystem of this operating system. "
7736 "It is also possible for this function to return a list containing more than "
7737 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
7738 "element being the root filesystem of one of the operating systems."
7742 #: ../src/guestfs-actions.pod:2242
7744 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
7745 "functions in order to query further information about each operating system, "
7746 "such as the name and version."
7750 #: ../src/guestfs-actions.pod:2247
7752 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
7753 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
7754 "the contents. This should be called with no disks currently mounted. The "
7755 "function may also use Augeas, so any existing Augeas handle will be closed."
7759 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1797
7761 "This function cannot decrypt encrypted disks. The caller must do that first "
7762 "(supplying the necessary keys) if the disk is encrypted."
7766 #: ../src/guestfs-actions.pod:2259 ../src/guestfs-actions.pod:2464
7767 #: ../src/guestfs-actions.pod:2520
7768 msgid "See also C<guestfs_list_filesystems>."
7772 #: ../src/guestfs-actions.pod:2265
7773 msgid "guestfs_is_blockdev"
7777 #: ../src/guestfs-actions.pod:2267
7780 " int guestfs_is_blockdev (guestfs_h *g,\n"
7781 "\t\tconst char *path);\n"
7786 #: ../src/guestfs-actions.pod:2270 ../fish/guestfish-actions.pod:1809
7788 "This returns C<true> if and only if there is a block device with the given "
7793 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2296
7794 #: ../src/guestfs-actions.pod:2320 ../src/guestfs-actions.pod:2332
7795 #: ../src/guestfs-actions.pod:2345 ../src/guestfs-actions.pod:2389
7796 #: ../src/guestfs-actions.pod:2401
7797 msgid "See also C<guestfs_stat>."
7801 #: ../src/guestfs-actions.pod:2277
7802 msgid "guestfs_is_busy"
7806 #: ../src/guestfs-actions.pod:2279
7809 " int guestfs_is_busy (guestfs_h *g);\n"
7814 #: ../src/guestfs-actions.pod:2281 ../fish/guestfish-actions.pod:1818
7816 "This returns true iff this handle is busy processing a command (in the "
7821 #: ../src/guestfs-actions.pod:2288
7822 msgid "guestfs_is_chardev"
7826 #: ../src/guestfs-actions.pod:2290
7829 " int guestfs_is_chardev (guestfs_h *g,\n"
7830 "\t\tconst char *path);\n"
7835 #: ../src/guestfs-actions.pod:2293 ../fish/guestfish-actions.pod:1827
7837 "This returns C<true> if and only if there is a character device with the "
7838 "given C<path> name."
7842 #: ../src/guestfs-actions.pod:2300
7843 msgid "guestfs_is_config"
7847 #: ../src/guestfs-actions.pod:2302
7850 " int guestfs_is_config (guestfs_h *g);\n"
7855 #: ../src/guestfs-actions.pod:2304 ../fish/guestfish-actions.pod:1836
7857 "This returns true iff this handle is being configured (in the C<CONFIG> "
7862 #: ../src/guestfs-actions.pod:2311
7863 msgid "guestfs_is_dir"
7867 #: ../src/guestfs-actions.pod:2313
7870 " int guestfs_is_dir (guestfs_h *g,\n"
7871 "\t\tconst char *path);\n"
7876 #: ../src/guestfs-actions.pod:2316 ../fish/guestfish-actions.pod:1845
7878 "This returns C<true> if and only if there is a directory with the given "
7879 "C<path> name. Note that it returns false for other objects like files."
7883 #: ../src/guestfs-actions.pod:2324
7884 msgid "guestfs_is_fifo"
7888 #: ../src/guestfs-actions.pod:2326
7891 " int guestfs_is_fifo (guestfs_h *g,\n"
7892 "\t\tconst char *path);\n"
7897 #: ../src/guestfs-actions.pod:2329 ../fish/guestfish-actions.pod:1855
7899 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
7900 "given C<path> name."
7904 #: ../src/guestfs-actions.pod:2336
7905 msgid "guestfs_is_file"
7909 #: ../src/guestfs-actions.pod:2338
7912 " int guestfs_is_file (guestfs_h *g,\n"
7913 "\t\tconst char *path);\n"
7918 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1864
7920 "This returns C<true> if and only if there is a regular file with the given "
7921 "C<path> name. Note that it returns false for other objects like directories."
7925 #: ../src/guestfs-actions.pod:2349
7926 msgid "guestfs_is_launching"
7930 #: ../src/guestfs-actions.pod:2351
7933 " int guestfs_is_launching (guestfs_h *g);\n"
7938 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1874
7940 "This returns true iff this handle is launching the subprocess (in the "
7941 "C<LAUNCHING> state)."
7945 #: ../src/guestfs-actions.pod:2360
7946 msgid "guestfs_is_lv"
7950 #: ../src/guestfs-actions.pod:2362
7953 " int guestfs_is_lv (guestfs_h *g,\n"
7954 "\t\tconst char *device);\n"
7959 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1883
7961 "This command tests whether C<device> is a logical volume, and returns true "
7962 "iff this is the case."
7966 #: ../src/guestfs-actions.pod:2370
7967 msgid "guestfs_is_ready"
7971 #: ../src/guestfs-actions.pod:2372
7974 " int guestfs_is_ready (guestfs_h *g);\n"
7979 #: ../src/guestfs-actions.pod:2374 ../fish/guestfish-actions.pod:1890
7981 "This returns true iff this handle is ready to accept commands (in the "
7986 #: ../src/guestfs-actions.pod:2381
7987 msgid "guestfs_is_socket"
7991 #: ../src/guestfs-actions.pod:2383
7994 " int guestfs_is_socket (guestfs_h *g,\n"
7995 "\t\tconst char *path);\n"
8000 #: ../src/guestfs-actions.pod:2386 ../fish/guestfish-actions.pod:1899
8002 "This returns C<true> if and only if there is a Unix domain socket with the "
8003 "given C<path> name."
8007 #: ../src/guestfs-actions.pod:2393
8008 msgid "guestfs_is_symlink"
8012 #: ../src/guestfs-actions.pod:2395
8015 " int guestfs_is_symlink (guestfs_h *g,\n"
8016 "\t\tconst char *path);\n"
8021 #: ../src/guestfs-actions.pod:2398 ../fish/guestfish-actions.pod:1908
8023 "This returns C<true> if and only if there is a symbolic link with the given "
8028 #: ../src/guestfs-actions.pod:2405
8029 msgid "guestfs_kill_subprocess"
8033 #: ../src/guestfs-actions.pod:2407
8036 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8041 #: ../src/guestfs-actions.pod:2409 ../fish/guestfish-actions.pod:1917
8042 msgid "This kills the qemu subprocess. You should never need to call this."
8046 #: ../src/guestfs-actions.pod:2413
8047 msgid "guestfs_launch"
8051 #: ../src/guestfs-actions.pod:2415
8054 " int guestfs_launch (guestfs_h *g);\n"
8059 #: ../src/guestfs-actions.pod:2417 ../fish/guestfish-actions.pod:1923
8061 "Internally libguestfs is implemented by running a virtual machine using "
8066 #: ../src/guestfs-actions.pod:2420 ../fish/guestfish-actions.pod:1926
8068 "You should call this after configuring the handle (eg. adding drives) but "
8069 "before performing any actions."
8073 #: ../src/guestfs-actions.pod:2425
8074 msgid "guestfs_lchown"
8078 #: ../src/guestfs-actions.pod:2427
8081 " int guestfs_lchown (guestfs_h *g,\n"
8084 "\t\tconst char *path);\n"
8089 #: ../src/guestfs-actions.pod:2432
8091 "Change the file owner to C<owner> and group to C<group>. This is like "
8092 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8093 "changed, not the target."
8097 #: ../src/guestfs-actions.pod:2442
8098 msgid "guestfs_lgetxattrs"
8102 #: ../src/guestfs-actions.pod:2444
8105 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8106 "\t\tconst char *path);\n"
8111 #: ../src/guestfs-actions.pod:2447
8113 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8114 "then it returns the extended attributes of the link itself."
8118 #: ../src/guestfs-actions.pod:2456
8119 msgid "guestfs_list_devices"
8123 #: ../src/guestfs-actions.pod:2458
8126 " char **guestfs_list_devices (guestfs_h *g);\n"
8131 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1953
8132 msgid "List all the block devices."
8136 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1955
8137 msgid "The full block device names are returned, eg. C</dev/sda>."
8141 #: ../src/guestfs-actions.pod:2470
8142 msgid "guestfs_list_filesystems"
8146 #: ../src/guestfs-actions.pod:2472
8149 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8154 #: ../src/guestfs-actions.pod:2474 ../fish/guestfish-actions.pod:1963
8156 "This inspection command looks for filesystems on partitions, block devices "
8157 "and logical volumes, returning a list of devices containing filesystems and "
8162 #: ../src/guestfs-actions.pod:2478 ../fish/guestfish-actions.pod:1967
8164 "The return value is a hash, where the keys are the devices containing "
8165 "filesystems, and the values are the filesystem types. For example:"
8169 #: ../src/guestfs-actions.pod:2482 ../fish/guestfish-actions.pod:1971
8172 " \"/dev/sda1\" => \"ntfs\"\n"
8173 " \"/dev/sda2\" => \"ext2\"\n"
8174 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8175 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8180 #: ../src/guestfs-actions.pod:2487 ../fish/guestfish-actions.pod:1976
8182 "The value can have the special value \"unknown\", meaning the content of the "
8183 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8187 #: ../src/guestfs-actions.pod:2491
8189 "This command runs other libguestfs commands, which might include "
8190 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8191 "soon after launch and only when nothing is mounted."
8195 #: ../src/guestfs-actions.pod:2495
8197 "Not all of the filesystems returned will be mountable. In particular, swap "
8198 "partitions are returned in the list. Also this command does not check that "
8199 "each filesystem found is valid and mountable, and some filesystems might be "
8200 "mountable but require special options. Filesystems may not all belong to a "
8201 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
8205 #: ../src/guestfs-actions.pod:2509
8206 msgid "guestfs_list_partitions"
8210 #: ../src/guestfs-actions.pod:2511
8213 " char **guestfs_list_partitions (guestfs_h *g);\n"
8218 #: ../src/guestfs-actions.pod:2513 ../fish/guestfish-actions.pod:1996
8219 msgid "List all the partitions detected on all block devices."
8223 #: ../src/guestfs-actions.pod:2515 ../fish/guestfish-actions.pod:1998
8224 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8228 #: ../src/guestfs-actions.pod:2517
8230 "This does not return logical volumes. For that you will need to call "
8235 #: ../src/guestfs-actions.pod:2526
8240 #: ../src/guestfs-actions.pod:2528
8243 " char *guestfs_ll (guestfs_h *g,\n"
8244 "\t\tconst char *directory);\n"
8249 #: ../src/guestfs-actions.pod:2531 ../fish/guestfish-actions.pod:2009
8251 "List the files in C<directory> (relative to the root directory, there is no "
8252 "cwd) in the format of 'ls -la'."
8256 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:2012
8258 "This command is mostly useful for interactive sessions. It is I<not> "
8259 "intended that you try to parse the output string."
8263 #: ../src/guestfs-actions.pod:2540
8268 #: ../src/guestfs-actions.pod:2542
8271 " int guestfs_ln (guestfs_h *g,\n"
8272 "\t\tconst char *target,\n"
8273 "\t\tconst char *linkname);\n"
8278 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:2019
8279 msgid "This command creates a hard link using the C<ln> command."
8283 #: ../src/guestfs-actions.pod:2550
8284 msgid "guestfs_ln_f"
8288 #: ../src/guestfs-actions.pod:2552
8291 " int guestfs_ln_f (guestfs_h *g,\n"
8292 "\t\tconst char *target,\n"
8293 "\t\tconst char *linkname);\n"
8298 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:2025
8300 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8301 "option removes the link (C<linkname>) if it exists already."
8305 #: ../src/guestfs-actions.pod:2561
8306 msgid "guestfs_ln_s"
8310 #: ../src/guestfs-actions.pod:2563
8313 " int guestfs_ln_s (guestfs_h *g,\n"
8314 "\t\tconst char *target,\n"
8315 "\t\tconst char *linkname);\n"
8320 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:2032
8321 msgid "This command creates a symbolic link using the C<ln -s> command."
8325 #: ../src/guestfs-actions.pod:2571
8326 msgid "guestfs_ln_sf"
8330 #: ../src/guestfs-actions.pod:2573
8333 " int guestfs_ln_sf (guestfs_h *g,\n"
8334 "\t\tconst char *target,\n"
8335 "\t\tconst char *linkname);\n"
8340 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:2038
8342 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8343 "option removes the link (C<linkname>) if it exists already."
8347 #: ../src/guestfs-actions.pod:2582
8348 msgid "guestfs_lremovexattr"
8352 #: ../src/guestfs-actions.pod:2584
8355 " int guestfs_lremovexattr (guestfs_h *g,\n"
8356 "\t\tconst char *xattr,\n"
8357 "\t\tconst char *path);\n"
8362 #: ../src/guestfs-actions.pod:2588
8364 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8365 "link, then it removes an extended attribute of the link itself."
8369 #: ../src/guestfs-actions.pod:2594
8374 #: ../src/guestfs-actions.pod:2596
8377 " char **guestfs_ls (guestfs_h *g,\n"
8378 "\t\tconst char *directory);\n"
8383 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:2053
8385 "List the files in C<directory> (relative to the root directory, there is no "
8386 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
8390 #: ../src/guestfs-actions.pod:2603
8392 "This command is mostly useful for interactive sessions. Programs should "
8393 "probably use C<guestfs_readdir> instead."
8397 #: ../src/guestfs-actions.pod:2610
8398 msgid "guestfs_lsetxattr"
8402 #: ../src/guestfs-actions.pod:2612
8405 " int guestfs_lsetxattr (guestfs_h *g,\n"
8406 "\t\tconst char *xattr,\n"
8407 "\t\tconst char *val,\n"
8409 "\t\tconst char *path);\n"
8414 #: ../src/guestfs-actions.pod:2618
8416 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8417 "then it sets an extended attribute of the link itself."
8421 #: ../src/guestfs-actions.pod:2624
8422 msgid "guestfs_lstat"
8426 #: ../src/guestfs-actions.pod:2626
8429 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8430 "\t\tconst char *path);\n"
8435 #: ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:4627
8436 #: ../fish/guestfish-actions.pod:2072 ../fish/guestfish-actions.pod:3572
8437 msgid "Returns file information for the given C<path>."
8441 #: ../src/guestfs-actions.pod:2631
8443 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8444 "link, then the link is stat-ed, not the file it refers to."
8448 #: ../src/guestfs-actions.pod:2635 ../fish/guestfish-actions.pod:2078
8449 msgid "This is the same as the C<lstat(2)> system call."
8453 #: ../src/guestfs-actions.pod:2637 ../src/guestfs-actions.pod:4631
8455 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8456 "error. I<The caller must call C<guestfs_free_stat> after use>."
8460 #: ../src/guestfs-actions.pod:2641
8461 msgid "guestfs_lstatlist"
8465 #: ../src/guestfs-actions.pod:2643
8468 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8469 "\t\tconst char *path,\n"
8470 "\t\tchar *const *names);\n"
8475 #: ../src/guestfs-actions.pod:2647
8477 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8478 "files, where all files are in the directory C<path>. C<names> is the list "
8479 "of files from this directory."
8483 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:2088
8485 "On return you get a list of stat structs, with a one-to-one correspondence "
8486 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8487 "then the C<ino> field of that structure is set to C<-1>."
8491 #: ../src/guestfs-actions.pod:2656
8493 "This call is intended for programs that want to efficiently list a directory "
8494 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8495 "for a similarly efficient call for getting extended attributes. Very long "
8496 "directory listings might cause the protocol message size to be exceeded, "
8497 "causing this call to fail. The caller must split up such requests into "
8498 "smaller groups of names."
8502 #: ../src/guestfs-actions.pod:2664
8504 "This function returns a C<struct guestfs_stat_list *> (see E<lt>guestfs-"
8505 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
8506 "C<guestfs_free_stat_list> after use>."
8510 #: ../src/guestfs-actions.pod:2669
8511 msgid "guestfs_luks_add_key"
8515 #: ../src/guestfs-actions.pod:2671
8518 " int guestfs_luks_add_key (guestfs_h *g,\n"
8519 "\t\tconst char *device,\n"
8520 "\t\tconst char *key,\n"
8521 "\t\tconst char *newkey,\n"
8522 "\t\tint keyslot);\n"
8527 #: ../src/guestfs-actions.pod:2677 ../fish/guestfish-actions.pod:2105
8529 "This command adds a new key on LUKS device C<device>. C<key> is any "
8530 "existing key, and is used to access the device. C<newkey> is the new key to "
8531 "add. C<keyslot> is the key slot that will be replaced."
8535 #: ../src/guestfs-actions.pod:2682
8537 "Note that if C<keyslot> already contains a key, then this command will "
8538 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8542 #: ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2722
8543 #: ../src/guestfs-actions.pod:2742 ../src/guestfs-actions.pod:2759
8544 #: ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:2804
8546 "This function takes a key or passphrase parameter which could contain "
8547 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8552 #: ../src/guestfs-actions.pod:2692
8553 msgid "guestfs_luks_close"
8557 #: ../src/guestfs-actions.pod:2694
8560 " int guestfs_luks_close (guestfs_h *g,\n"
8561 "\t\tconst char *device);\n"
8566 #: ../src/guestfs-actions.pod:2697
8568 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8569 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8570 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8571 "underlying block device."
8575 #: ../src/guestfs-actions.pod:2705
8576 msgid "guestfs_luks_format"
8580 #: ../src/guestfs-actions.pod:2707
8583 " int guestfs_luks_format (guestfs_h *g,\n"
8584 "\t\tconst char *device,\n"
8585 "\t\tconst char *key,\n"
8586 "\t\tint keyslot);\n"
8591 #: ../src/guestfs-actions.pod:2712 ../fish/guestfish-actions.pod:2131
8593 "This command erases existing data on C<device> and formats the device as a "
8594 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8595 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8599 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2739
8600 #: ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:3553
8601 #: ../src/guestfs-actions.pod:4168 ../src/guestfs-actions.pod:4489
8602 #: ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4532
8603 #: ../src/guestfs-actions.pod:5471 ../fish/guestfish-actions.pod:2139
8604 #: ../fish/guestfish-actions.pod:2152 ../fish/guestfish-actions.pod:2223
8605 #: ../fish/guestfish-actions.pod:2738 ../fish/guestfish-actions.pod:3213
8606 #: ../fish/guestfish-actions.pod:3471 ../fish/guestfish-actions.pod:3487
8607 #: ../fish/guestfish-actions.pod:3502 ../fish/guestfish-actions.pod:4190
8609 "B<This command is dangerous. Without careful use you can easily destroy all "
8614 #: ../src/guestfs-actions.pod:2726
8615 msgid "guestfs_luks_format_cipher"
8619 #: ../src/guestfs-actions.pod:2728
8622 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8623 "\t\tconst char *device,\n"
8624 "\t\tconst char *key,\n"
8625 "\t\tint keyslot,\n"
8626 "\t\tconst char *cipher);\n"
8631 #: ../src/guestfs-actions.pod:2734
8633 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8634 "set the C<cipher> used."
8638 #: ../src/guestfs-actions.pod:2746
8639 msgid "guestfs_luks_kill_slot"
8643 #: ../src/guestfs-actions.pod:2748
8646 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8647 "\t\tconst char *device,\n"
8648 "\t\tconst char *key,\n"
8649 "\t\tint keyslot);\n"
8654 #: ../src/guestfs-actions.pod:2753 ../fish/guestfish-actions.pod:2159
8656 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8657 "device C<device>. C<key> must be one of the I<other> keys."
8661 #: ../src/guestfs-actions.pod:2763
8662 msgid "guestfs_luks_open"
8666 #: ../src/guestfs-actions.pod:2765
8669 " int guestfs_luks_open (guestfs_h *g,\n"
8670 "\t\tconst char *device,\n"
8671 "\t\tconst char *key,\n"
8672 "\t\tconst char *mapname);\n"
8677 #: ../src/guestfs-actions.pod:2770 ../fish/guestfish-actions.pod:2170
8679 "This command opens a block device which has been encrypted according to the "
8680 "Linux Unified Key Setup (LUKS) standard."
8684 #: ../src/guestfs-actions.pod:2773 ../fish/guestfish-actions.pod:2173
8685 msgid "C<device> is the encrypted block device or partition."
8689 #: ../src/guestfs-actions.pod:2775 ../fish/guestfish-actions.pod:2175
8691 "The caller must supply one of the keys associated with the LUKS block "
8692 "device, in the C<key> parameter."
8696 #: ../src/guestfs-actions.pod:2778 ../fish/guestfish-actions.pod:2178
8698 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8699 "writes to this block device are decrypted from and encrypted to the "
8700 "underlying C<device> respectively."
8704 #: ../src/guestfs-actions.pod:2782
8706 "If this block device contains LVM volume groups, then calling "
8707 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8712 #: ../src/guestfs-actions.pod:2792
8713 msgid "guestfs_luks_open_ro"
8717 #: ../src/guestfs-actions.pod:2794
8720 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8721 "\t\tconst char *device,\n"
8722 "\t\tconst char *key,\n"
8723 "\t\tconst char *mapname);\n"
8728 #: ../src/guestfs-actions.pod:2799
8730 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8735 #: ../src/guestfs-actions.pod:2808
8736 msgid "guestfs_lvcreate"
8740 #: ../src/guestfs-actions.pod:2810
8743 " int guestfs_lvcreate (guestfs_h *g,\n"
8744 "\t\tconst char *logvol,\n"
8745 "\t\tconst char *volgroup,\n"
8746 "\t\tint mbytes);\n"
8751 #: ../src/guestfs-actions.pod:2815 ../fish/guestfish-actions.pod:2203
8753 "This creates an LVM logical volume called C<logvol> on the volume group "
8754 "C<volgroup>, with C<size> megabytes."
8758 #: ../src/guestfs-actions.pod:2820
8759 msgid "guestfs_lvm_clear_filter"
8763 #: ../src/guestfs-actions.pod:2822
8766 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8771 #: ../src/guestfs-actions.pod:2824
8773 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8774 "see every block device."
8778 #: ../src/guestfs-actions.pod:2827 ../src/guestfs-actions.pod:2863
8779 #: ../fish/guestfish-actions.pod:2213 ../fish/guestfish-actions.pod:2244
8781 "This command also clears the LVM cache and performs a volume group scan."
8785 #: ../src/guestfs-actions.pod:2832
8786 msgid "guestfs_lvm_remove_all"
8790 #: ../src/guestfs-actions.pod:2834
8793 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8798 #: ../src/guestfs-actions.pod:2836 ../fish/guestfish-actions.pod:2220
8800 "This command removes all LVM logical volumes, volume groups and physical "
8805 #: ../src/guestfs-actions.pod:2844
8806 msgid "guestfs_lvm_set_filter"
8810 #: ../src/guestfs-actions.pod:2846
8813 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8814 "\t\tchar *const *devices);\n"
8819 #: ../src/guestfs-actions.pod:2849 ../fish/guestfish-actions.pod:2230
8821 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
8822 "block devices in the list C<devices>, and will ignore all other attached "
8827 #: ../src/guestfs-actions.pod:2853 ../fish/guestfish-actions.pod:2234
8829 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
8830 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
8831 "there are two types of duplication possible: either cloned PVs/VGs which "
8832 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
8833 "same name. In normal operation you cannot create this situation, but you "
8834 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
8835 "inside the LVM metadata."
8839 #: ../src/guestfs-actions.pod:2866 ../fish/guestfish-actions.pod:2247
8840 msgid "You can filter whole block devices or individual partitions."
8844 #: ../src/guestfs-actions.pod:2868 ../fish/guestfish-actions.pod:2249
8846 "You cannot use this if any VG is currently in use (eg. contains a mounted "
8847 "filesystem), even if you are not filtering out that VG."
8851 #: ../src/guestfs-actions.pod:2874
8852 msgid "guestfs_lvremove"
8856 #: ../src/guestfs-actions.pod:2876
8859 " int guestfs_lvremove (guestfs_h *g,\n"
8860 "\t\tconst char *device);\n"
8865 #: ../src/guestfs-actions.pod:2879 ../fish/guestfish-actions.pod:2257
8867 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
8868 "LV, such as C</dev/VG/LV>."
8872 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:2260
8874 "You can also remove all LVs in a volume group by specifying the VG name, C</"
8879 #: ../src/guestfs-actions.pod:2887
8880 msgid "guestfs_lvrename"
8884 #: ../src/guestfs-actions.pod:2889
8887 " int guestfs_lvrename (guestfs_h *g,\n"
8888 "\t\tconst char *logvol,\n"
8889 "\t\tconst char *newlogvol);\n"
8894 #: ../src/guestfs-actions.pod:2893 ../fish/guestfish-actions.pod:2267
8895 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
8899 #: ../src/guestfs-actions.pod:2897
8900 msgid "guestfs_lvresize"
8904 #: ../src/guestfs-actions.pod:2899
8907 " int guestfs_lvresize (guestfs_h *g,\n"
8908 "\t\tconst char *device,\n"
8909 "\t\tint mbytes);\n"
8914 #: ../src/guestfs-actions.pod:2903 ../fish/guestfish-actions.pod:2273
8916 "This resizes (expands or shrinks) an existing LVM logical volume to "
8917 "C<mbytes>. When reducing, data in the reduced part is lost."
8921 #: ../src/guestfs-actions.pod:2909
8922 msgid "guestfs_lvresize_free"
8926 #: ../src/guestfs-actions.pod:2911
8929 " int guestfs_lvresize_free (guestfs_h *g,\n"
8930 "\t\tconst char *lv,\n"
8931 "\t\tint percent);\n"
8936 #: ../src/guestfs-actions.pod:2915 ../fish/guestfish-actions.pod:2281
8938 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
8939 "remaining free space in the volume group. Commonly you would call this with "
8940 "pc = 100 which expands the logical volume as much as possible, using all "
8941 "remaining free space in the volume group."
8945 #: ../src/guestfs-actions.pod:2923
8950 #: ../src/guestfs-actions.pod:2925
8953 " char **guestfs_lvs (guestfs_h *g);\n"
8958 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2291
8960 "List all the logical volumes detected. This is the equivalent of the L<lvs"
8965 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2294
8967 "This returns a list of the logical volume device names (eg. C</dev/"
8968 "VolGroup00/LogVol00>)."
8972 #: ../src/guestfs-actions.pod:2933
8973 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
8977 #: ../src/guestfs-actions.pod:2939
8978 msgid "guestfs_lvs_full"
8982 #: ../src/guestfs-actions.pod:2941
8985 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
8990 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2303
8992 "List all the logical volumes detected. This is the equivalent of the L<lvs"
8993 "(8)> command. The \"full\" version includes all fields."
8997 #: ../src/guestfs-actions.pod:2946
8999 "This function returns a C<struct guestfs_lvm_lv_list *> (see E<lt>guestfs-"
9000 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9001 "C<guestfs_free_lvm_lv_list> after use>."
9005 #: ../src/guestfs-actions.pod:2951
9006 msgid "guestfs_lvuuid"
9010 #: ../src/guestfs-actions.pod:2953
9013 " char *guestfs_lvuuid (guestfs_h *g,\n"
9014 "\t\tconst char *device);\n"
9019 #: ../src/guestfs-actions.pod:2956 ../fish/guestfish-actions.pod:2310
9020 msgid "This command returns the UUID of the LVM LV C<device>."
9024 #: ../src/guestfs-actions.pod:2961
9025 msgid "guestfs_lxattrlist"
9029 #: ../src/guestfs-actions.pod:2963
9032 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9033 "\t\tconst char *path,\n"
9034 "\t\tchar *const *names);\n"
9039 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2316
9041 "This call allows you to get the extended attributes of multiple files, where "
9042 "all files are in the directory C<path>. C<names> is the list of files from "
9047 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2320
9049 "On return you get a flat list of xattr structs which must be interpreted "
9050 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9051 "C<attrval> in this struct is zero-length to indicate there was an error "
9052 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9053 "number (the number of following attributes for this file, which could be C<"
9054 "\"0\">). Then after the first xattr struct are the zero or more attributes "
9055 "for the first named file. This repeats for the second and subsequent files."
9059 #: ../src/guestfs-actions.pod:2981
9061 "This call is intended for programs that want to efficiently list a directory "
9062 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9063 "a similarly efficient call for getting standard stats. Very long directory "
9064 "listings might cause the protocol message size to be exceeded, causing this "
9065 "call to fail. The caller must split up such requests into smaller groups of "
9070 #: ../src/guestfs-actions.pod:2994
9071 msgid "guestfs_mkdir"
9075 #: ../src/guestfs-actions.pod:2996
9078 " int guestfs_mkdir (guestfs_h *g,\n"
9079 "\t\tconst char *path);\n"
9084 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2342
9085 msgid "Create a directory named C<path>."
9089 #: ../src/guestfs-actions.pod:3003
9090 msgid "guestfs_mkdir_mode"
9094 #: ../src/guestfs-actions.pod:3005
9097 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9098 "\t\tconst char *path,\n"
9104 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2348
9106 "This command creates a directory, setting the initial permissions of the "
9107 "directory to C<mode>."
9111 #: ../src/guestfs-actions.pod:3012 ../fish/guestfish-actions.pod:2351
9113 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9114 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9119 #: ../src/guestfs-actions.pod:3016
9120 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9124 #: ../src/guestfs-actions.pod:3020
9125 msgid "guestfs_mkdir_p"
9129 #: ../src/guestfs-actions.pod:3022
9132 " int guestfs_mkdir_p (guestfs_h *g,\n"
9133 "\t\tconst char *path);\n"
9138 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2361
9140 "Create a directory named C<path>, creating any parent directories as "
9141 "necessary. This is like the C<mkdir -p> shell command."
9145 #: ../src/guestfs-actions.pod:3030
9146 msgid "guestfs_mkdtemp"
9150 #: ../src/guestfs-actions.pod:3032
9153 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9154 "\t\tconst char *template);\n"
9159 #: ../src/guestfs-actions.pod:3035 ../fish/guestfish-actions.pod:2368
9161 "This command creates a temporary directory. The C<template> parameter "
9162 "should be a full pathname for the temporary directory name with the final "
9163 "six characters being \"XXXXXX\"."
9167 #: ../src/guestfs-actions.pod:3040 ../fish/guestfish-actions.pod:2373
9169 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9170 "being suitable for Windows filesystems."
9174 #: ../src/guestfs-actions.pod:3043 ../fish/guestfish-actions.pod:2376
9175 msgid "The name of the temporary directory that was created is returned."
9179 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2379
9180 msgid "The temporary directory is created with mode 0700 and is owned by root."
9184 #: ../src/guestfs-actions.pod:3049 ../fish/guestfish-actions.pod:2382
9186 "The caller is responsible for deleting the temporary directory and its "
9187 "contents after use."
9191 #: ../src/guestfs-actions.pod:3052 ../fish/guestfish-actions.pod:2385
9192 msgid "See also: L<mkdtemp(3)>"
9196 #: ../src/guestfs-actions.pod:3057
9197 msgid "guestfs_mke2fs_J"
9201 #: ../src/guestfs-actions.pod:3059
9204 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9205 "\t\tconst char *fstype,\n"
9206 "\t\tint blocksize,\n"
9207 "\t\tconst char *device,\n"
9208 "\t\tconst char *journal);\n"
9213 #: ../src/guestfs-actions.pod:3065 ../fish/guestfish-actions.pod:2391
9215 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9216 "C<journal>. It is equivalent to the command:"
9220 #: ../src/guestfs-actions.pod:3069 ../fish/guestfish-actions.pod:2395
9223 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9228 #: ../src/guestfs-actions.pod:3071
9229 msgid "See also C<guestfs_mke2journal>."
9233 #: ../src/guestfs-actions.pod:3075
9234 msgid "guestfs_mke2fs_JL"
9238 #: ../src/guestfs-actions.pod:3077
9241 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9242 "\t\tconst char *fstype,\n"
9243 "\t\tint blocksize,\n"
9244 "\t\tconst char *device,\n"
9245 "\t\tconst char *label);\n"
9250 #: ../src/guestfs-actions.pod:3083 ../fish/guestfish-actions.pod:2403
9252 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9253 "the journal labeled C<label>."
9257 #: ../src/guestfs-actions.pod:3086
9258 msgid "See also C<guestfs_mke2journal_L>."
9262 #: ../src/guestfs-actions.pod:3090
9263 msgid "guestfs_mke2fs_JU"
9267 #: ../src/guestfs-actions.pod:3092
9270 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9271 "\t\tconst char *fstype,\n"
9272 "\t\tint blocksize,\n"
9273 "\t\tconst char *device,\n"
9274 "\t\tconst char *uuid);\n"
9279 #: ../src/guestfs-actions.pod:3098 ../fish/guestfish-actions.pod:2412
9281 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9282 "the journal with UUID C<uuid>."
9286 #: ../src/guestfs-actions.pod:3101
9287 msgid "See also C<guestfs_mke2journal_U>."
9291 #: ../src/guestfs-actions.pod:3105
9292 msgid "guestfs_mke2journal"
9296 #: ../src/guestfs-actions.pod:3107
9299 " int guestfs_mke2journal (guestfs_h *g,\n"
9300 "\t\tint blocksize,\n"
9301 "\t\tconst char *device);\n"
9306 #: ../src/guestfs-actions.pod:3111 ../fish/guestfish-actions.pod:2421
9308 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9313 #: ../src/guestfs-actions.pod:3114 ../fish/guestfish-actions.pod:2424
9316 " mke2fs -O journal_dev -b blocksize device\n"
9321 #: ../src/guestfs-actions.pod:3118
9322 msgid "guestfs_mke2journal_L"
9326 #: ../src/guestfs-actions.pod:3120
9329 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9330 "\t\tint blocksize,\n"
9331 "\t\tconst char *label,\n"
9332 "\t\tconst char *device);\n"
9337 #: ../src/guestfs-actions.pod:3125 ../fish/guestfish-actions.pod:2430
9338 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9342 #: ../src/guestfs-actions.pod:3129
9343 msgid "guestfs_mke2journal_U"
9347 #: ../src/guestfs-actions.pod:3131
9350 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9351 "\t\tint blocksize,\n"
9352 "\t\tconst char *uuid,\n"
9353 "\t\tconst char *device);\n"
9358 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2436
9359 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9363 #: ../src/guestfs-actions.pod:3140
9364 msgid "guestfs_mkfifo"
9368 #: ../src/guestfs-actions.pod:3142
9371 " int guestfs_mkfifo (guestfs_h *g,\n"
9373 "\t\tconst char *path);\n"
9378 #: ../src/guestfs-actions.pod:3146
9380 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9381 "is just a convenient wrapper around C<guestfs_mknod>."
9385 #: ../src/guestfs-actions.pod:3154
9386 msgid "guestfs_mkfs"
9390 #: ../src/guestfs-actions.pod:3156
9393 " int guestfs_mkfs (guestfs_h *g,\n"
9394 "\t\tconst char *fstype,\n"
9395 "\t\tconst char *device);\n"
9400 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2452
9402 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9403 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9407 #: ../src/guestfs-actions.pod:3166
9408 msgid "guestfs_mkfs_b"
9412 #: ../src/guestfs-actions.pod:3168
9415 " int guestfs_mkfs_b (guestfs_h *g,\n"
9416 "\t\tconst char *fstype,\n"
9417 "\t\tint blocksize,\n"
9418 "\t\tconst char *device);\n"
9423 #: ../src/guestfs-actions.pod:3173
9425 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9426 "block size of the resulting filesystem. Supported block sizes depend on the "
9427 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9431 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2465
9433 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9438 #: ../src/guestfs-actions.pod:3183
9439 msgid "guestfs_mkmountpoint"
9443 #: ../src/guestfs-actions.pod:3185
9446 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9447 "\t\tconst char *exemptpath);\n"
9452 #: ../src/guestfs-actions.pod:3188
9454 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9455 "that can be used to create extra mountpoints before mounting the first "
9460 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2476
9462 "These calls are I<only> necessary in some very limited circumstances, mainly "
9463 "the case where you want to mount a mix of unrelated and/or read-only "
9464 "filesystems together."
9468 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2480
9470 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9471 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9472 "inside that. You can unpack this as follows in guestfish:"
9476 #: ../src/guestfs-actions.pod:3201 ../fish/guestfish-actions.pod:2485
9479 " add-ro Fedora-11-i686-Live.iso\n"
9481 " mkmountpoint /cd\n"
9482 " mkmountpoint /squash\n"
9483 " mkmountpoint /ext3\n"
9484 " mount /dev/sda /cd\n"
9485 " mount-loop /cd/LiveOS/squashfs.img /squash\n"
9486 " mount-loop /squash/LiveOS/ext3fs.img /ext3\n"
9491 #: ../src/guestfs-actions.pod:3210 ../fish/guestfish-actions.pod:2494
9492 msgid "The inner filesystem is now unpacked under the /ext3 mountpoint."
9496 #: ../src/guestfs-actions.pod:3214
9497 msgid "guestfs_mknod"
9501 #: ../src/guestfs-actions.pod:3216
9504 " int guestfs_mknod (guestfs_h *g,\n"
9506 "\t\tint devmajor,\n"
9507 "\t\tint devminor,\n"
9508 "\t\tconst char *path);\n"
9513 #: ../src/guestfs-actions.pod:3222 ../fish/guestfish-actions.pod:2500
9515 "This call creates block or character special devices, or named pipes (FIFOs)."
9519 #: ../src/guestfs-actions.pod:3225 ../fish/guestfish-actions.pod:2503
9521 "The C<mode> parameter should be the mode, using the standard constants. "
9522 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9523 "used when creating block and character special devices."
9527 #: ../src/guestfs-actions.pod:3230
9529 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9530 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9531 "regular file). These constants are available in the standard Linux header "
9532 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9533 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9534 "the appropriate constant for you."
9538 #: ../src/guestfs-actions.pod:3242
9539 msgid "guestfs_mknod_b"
9543 #: ../src/guestfs-actions.pod:3244
9546 " int guestfs_mknod_b (guestfs_h *g,\n"
9548 "\t\tint devmajor,\n"
9549 "\t\tint devminor,\n"
9550 "\t\tconst char *path);\n"
9555 #: ../src/guestfs-actions.pod:3250
9557 "This call creates a block device node called C<path> with mode C<mode> and "
9558 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9559 "wrapper around C<guestfs_mknod>."
9563 #: ../src/guestfs-actions.pod:3258
9564 msgid "guestfs_mknod_c"
9568 #: ../src/guestfs-actions.pod:3260
9571 " int guestfs_mknod_c (guestfs_h *g,\n"
9573 "\t\tint devmajor,\n"
9574 "\t\tint devminor,\n"
9575 "\t\tconst char *path);\n"
9580 #: ../src/guestfs-actions.pod:3266
9582 "This call creates a char device node called C<path> with mode C<mode> and "
9583 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9584 "wrapper around C<guestfs_mknod>."
9588 #: ../src/guestfs-actions.pod:3274
9589 msgid "guestfs_mkswap"
9593 #: ../src/guestfs-actions.pod:3276
9596 " int guestfs_mkswap (guestfs_h *g,\n"
9597 "\t\tconst char *device);\n"
9602 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2542
9603 msgid "Create a swap partition on C<device>."
9607 #: ../src/guestfs-actions.pod:3283
9608 msgid "guestfs_mkswap_L"
9612 #: ../src/guestfs-actions.pod:3285
9615 " int guestfs_mkswap_L (guestfs_h *g,\n"
9616 "\t\tconst char *label,\n"
9617 "\t\tconst char *device);\n"
9622 #: ../src/guestfs-actions.pod:3289 ../fish/guestfish-actions.pod:2548
9623 msgid "Create a swap partition on C<device> with label C<label>."
9627 #: ../src/guestfs-actions.pod:3291 ../fish/guestfish-actions.pod:2550
9629 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
9630 "sda>), just to a partition. This appears to be a limitation of the kernel "
9635 #: ../src/guestfs-actions.pod:3297
9636 msgid "guestfs_mkswap_U"
9640 #: ../src/guestfs-actions.pod:3299
9643 " int guestfs_mkswap_U (guestfs_h *g,\n"
9644 "\t\tconst char *uuid,\n"
9645 "\t\tconst char *device);\n"
9650 #: ../src/guestfs-actions.pod:3303 ../fish/guestfish-actions.pod:2558
9651 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9655 #: ../src/guestfs-actions.pod:3307
9656 msgid "guestfs_mkswap_file"
9660 #: ../src/guestfs-actions.pod:3309
9663 " int guestfs_mkswap_file (guestfs_h *g,\n"
9664 "\t\tconst char *path);\n"
9669 #: ../src/guestfs-actions.pod:3312 ../fish/guestfish-actions.pod:2564
9670 msgid "Create a swap file."
9674 #: ../src/guestfs-actions.pod:3314
9676 "This command just writes a swap file signature to an existing file. To "
9677 "create the file itself, use something like C<guestfs_fallocate>."
9681 #: ../src/guestfs-actions.pod:3319
9682 msgid "guestfs_modprobe"
9686 #: ../src/guestfs-actions.pod:3321
9689 " int guestfs_modprobe (guestfs_h *g,\n"
9690 "\t\tconst char *modulename);\n"
9695 #: ../src/guestfs-actions.pod:3324 ../fish/guestfish-actions.pod:2573
9696 msgid "This loads a kernel module in the appliance."
9700 #: ../src/guestfs-actions.pod:3326 ../fish/guestfish-actions.pod:2575
9702 "The kernel module must have been whitelisted when libguestfs was built (see "
9703 "C<appliance/kmod.whitelist.in> in the source)."
9707 #: ../src/guestfs-actions.pod:3331
9708 msgid "guestfs_mount"
9712 #: ../src/guestfs-actions.pod:3333
9715 " int guestfs_mount (guestfs_h *g,\n"
9716 "\t\tconst char *device,\n"
9717 "\t\tconst char *mountpoint);\n"
9722 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2582
9724 "Mount a guest disk at a position in the filesystem. Block devices are named "
9725 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9726 "those block devices contain partitions, they will have the usual names (eg. "
9727 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9731 #: ../src/guestfs-actions.pod:3343 ../fish/guestfish-actions.pod:2588
9733 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9734 "mounted on C</> before others can be mounted. Other filesystems can only be "
9735 "mounted on directories which already exist."
9739 #: ../src/guestfs-actions.pod:3348 ../fish/guestfish-actions.pod:2593
9741 "The mounted filesystem is writable, if we have sufficient permissions on the "
9742 "underlying device."
9746 #: ../src/guestfs-actions.pod:3351
9748 "B<Important note:> When you use this call, the filesystem options C<sync> "
9749 "and C<noatime> are set implicitly. This was originally done because we "
9750 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9751 "very large negative performance impact and negligible effect on "
9752 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9753 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9754 "(use an empty string for the first parameter if you don't want any options)."
9758 #: ../src/guestfs-actions.pod:3363
9759 msgid "guestfs_mount_loop"
9763 #: ../src/guestfs-actions.pod:3365
9766 " int guestfs_mount_loop (guestfs_h *g,\n"
9767 "\t\tconst char *file,\n"
9768 "\t\tconst char *mountpoint);\n"
9773 #: ../src/guestfs-actions.pod:3369 ../fish/guestfish-actions.pod:2610
9775 "This command lets you mount C<file> (a filesystem image in a file) on a "
9776 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9781 #: ../src/guestfs-actions.pod:3375
9782 msgid "guestfs_mount_options"
9786 #: ../src/guestfs-actions.pod:3377
9789 " int guestfs_mount_options (guestfs_h *g,\n"
9790 "\t\tconst char *options,\n"
9791 "\t\tconst char *device,\n"
9792 "\t\tconst char *mountpoint);\n"
9797 #: ../src/guestfs-actions.pod:3382
9799 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9800 "the mount options as for the L<mount(8)> I<-o> flag."
9804 #: ../src/guestfs-actions.pod:3386 ../fish/guestfish-actions.pod:2622
9806 "If the C<options> parameter is an empty string, then no options are passed "
9807 "(all options default to whatever the filesystem uses)."
9811 #: ../src/guestfs-actions.pod:3392
9812 msgid "guestfs_mount_ro"
9816 #: ../src/guestfs-actions.pod:3394
9819 " int guestfs_mount_ro (guestfs_h *g,\n"
9820 "\t\tconst char *device,\n"
9821 "\t\tconst char *mountpoint);\n"
9826 #: ../src/guestfs-actions.pod:3398
9828 "This is the same as the C<guestfs_mount> command, but it mounts the "
9829 "filesystem with the read-only (I<-o ro>) flag."
9833 #: ../src/guestfs-actions.pod:3403
9834 msgid "guestfs_mount_vfs"
9838 #: ../src/guestfs-actions.pod:3405
9841 " int guestfs_mount_vfs (guestfs_h *g,\n"
9842 "\t\tconst char *options,\n"
9843 "\t\tconst char *vfstype,\n"
9844 "\t\tconst char *device,\n"
9845 "\t\tconst char *mountpoint);\n"
9850 #: ../src/guestfs-actions.pod:3411
9852 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9853 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
9858 #: ../src/guestfs-actions.pod:3417
9859 msgid "guestfs_mountpoints"
9863 #: ../src/guestfs-actions.pod:3419
9866 " char **guestfs_mountpoints (guestfs_h *g);\n"
9871 #: ../src/guestfs-actions.pod:3421
9873 "This call is similar to C<guestfs_mounts>. That call returns a list of "
9874 "devices. This one returns a hash table (map) of device name to directory "
9875 "where the device is mounted."
9879 #: ../src/guestfs-actions.pod:3431
9880 msgid "guestfs_mounts"
9884 #: ../src/guestfs-actions.pod:3433
9887 " char **guestfs_mounts (guestfs_h *g);\n"
9892 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2653
9894 "This returns the list of currently mounted filesystems. It returns the list "
9895 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
9899 #: ../src/guestfs-actions.pod:3438 ../fish/guestfish-actions.pod:2656
9900 msgid "Some internal mounts are not shown."
9904 #: ../src/guestfs-actions.pod:3440
9905 msgid "See also: C<guestfs_mountpoints>"
9909 #: ../src/guestfs-actions.pod:3446
9914 #: ../src/guestfs-actions.pod:3448
9917 " int guestfs_mv (guestfs_h *g,\n"
9918 "\t\tconst char *src,\n"
9919 "\t\tconst char *dest);\n"
9924 #: ../src/guestfs-actions.pod:3452 ../fish/guestfish-actions.pod:2664
9926 "This moves a file from C<src> to C<dest> where C<dest> is either a "
9927 "destination filename or destination directory."
9931 #: ../src/guestfs-actions.pod:3457
9932 msgid "guestfs_ntfs_3g_probe"
9936 #: ../src/guestfs-actions.pod:3459
9939 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
9941 "\t\tconst char *device);\n"
9946 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2671
9948 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
9949 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
9950 "write, and some cannot be mounted at all)."
9954 #: ../src/guestfs-actions.pod:3467 ../fish/guestfish-actions.pod:2675
9956 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
9957 "can be mounted read-write. Set it to false if you want to test if the "
9958 "volume can be mounted read-only."
9962 #: ../src/guestfs-actions.pod:3471 ../fish/guestfish-actions.pod:2679
9964 "The return value is an integer which C<0> if the operation would succeed, or "
9965 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
9969 #: ../src/guestfs-actions.pod:3477
9970 msgid "guestfs_ntfsresize"
9974 #: ../src/guestfs-actions.pod:3479
9977 " int guestfs_ntfsresize (guestfs_h *g,\n"
9978 "\t\tconst char *device);\n"
9983 #: ../src/guestfs-actions.pod:3482 ../fish/guestfish-actions.pod:2687
9985 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
9986 "size of the underlying device. See also L<ntfsresize(8)>."
9990 #: ../src/guestfs-actions.pod:3488
9991 msgid "guestfs_ntfsresize_size"
9995 #: ../src/guestfs-actions.pod:3490
9998 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
9999 "\t\tconst char *device,\n"
10000 "\t\tint64_t size);\n"
10005 #: ../src/guestfs-actions.pod:3494
10007 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10008 "to specify the new size (in bytes) explicitly."
10012 #: ../src/guestfs-actions.pod:3499
10013 msgid "guestfs_part_add"
10017 #: ../src/guestfs-actions.pod:3501
10020 " int guestfs_part_add (guestfs_h *g,\n"
10021 "\t\tconst char *device,\n"
10022 "\t\tconst char *prlogex,\n"
10023 "\t\tint64_t startsect,\n"
10024 "\t\tint64_t endsect);\n"
10029 #: ../src/guestfs-actions.pod:3507
10031 "This command adds a partition to C<device>. If there is no partition table "
10032 "on the device, call C<guestfs_part_init> first."
10036 #: ../src/guestfs-actions.pod:3510 ../fish/guestfish-actions.pod:2705
10038 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10039 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10040 "C<logical>) and C<e> (or C<extended>) partition types."
10044 #: ../src/guestfs-actions.pod:3515 ../fish/guestfish-actions.pod:2710
10046 "C<startsect> and C<endsect> are the start and end of the partition in "
10047 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10048 "from the end of the disk (C<-1> is the last sector)."
10052 #: ../src/guestfs-actions.pod:3519
10054 "Creating a partition which covers the whole disk is not so easy. Use "
10055 "C<guestfs_part_disk> to do that."
10059 #: ../src/guestfs-actions.pod:3524
10060 msgid "guestfs_part_del"
10064 #: ../src/guestfs-actions.pod:3526
10067 " int guestfs_part_del (guestfs_h *g,\n"
10068 "\t\tconst char *device,\n"
10069 "\t\tint partnum);\n"
10074 #: ../src/guestfs-actions.pod:3530 ../fish/guestfish-actions.pod:2721
10075 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10079 #: ../src/guestfs-actions.pod:3532 ../fish/guestfish-actions.pod:2723
10081 "Note that in the case of MBR partitioning, deleting an extended partition "
10082 "also deletes any logical partitions it contains."
10086 #: ../src/guestfs-actions.pod:3538
10087 msgid "guestfs_part_disk"
10091 #: ../src/guestfs-actions.pod:3540
10094 " int guestfs_part_disk (guestfs_h *g,\n"
10095 "\t\tconst char *device,\n"
10096 "\t\tconst char *parttype);\n"
10101 #: ../src/guestfs-actions.pod:3544
10103 "This command is simply a combination of C<guestfs_part_init> followed by "
10104 "C<guestfs_part_add> to create a single primary partition covering the whole "
10109 #: ../src/guestfs-actions.pod:3548
10111 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10112 "possible values are described in C<guestfs_part_init>."
10116 #: ../src/guestfs-actions.pod:3556
10117 msgid "guestfs_part_get_bootable"
10121 #: ../src/guestfs-actions.pod:3558
10124 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10125 "\t\tconst char *device,\n"
10126 "\t\tint partnum);\n"
10131 #: ../src/guestfs-actions.pod:3562 ../fish/guestfish-actions.pod:2745
10133 "This command returns true if the partition C<partnum> on C<device> has the "
10134 "bootable flag set."
10138 #: ../src/guestfs-actions.pod:3565
10139 msgid "See also C<guestfs_part_set_bootable>."
10143 #: ../src/guestfs-actions.pod:3569
10144 msgid "guestfs_part_get_mbr_id"
10148 #: ../src/guestfs-actions.pod:3571
10151 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10152 "\t\tconst char *device,\n"
10153 "\t\tint partnum);\n"
10158 #: ../src/guestfs-actions.pod:3575 ../fish/guestfish-actions.pod:2754
10160 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10161 "partition C<partnum>."
10165 #: ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3740
10167 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10168 "undefined results for other partition table types (see "
10169 "C<guestfs_part_get_parttype>)."
10173 #: ../src/guestfs-actions.pod:3584
10174 msgid "guestfs_part_get_parttype"
10178 #: ../src/guestfs-actions.pod:3586
10181 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10182 "\t\tconst char *device);\n"
10187 #: ../src/guestfs-actions.pod:3589 ../fish/guestfish-actions.pod:2765
10189 "This command examines the partition table on C<device> and returns the "
10190 "partition table type (format) being used."
10194 #: ../src/guestfs-actions.pod:3592
10196 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10197 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10198 "possible, although unusual. See C<guestfs_part_init> for a full list."
10202 #: ../src/guestfs-actions.pod:3600
10203 msgid "guestfs_part_init"
10207 #: ../src/guestfs-actions.pod:3602
10210 " int guestfs_part_init (guestfs_h *g,\n"
10211 "\t\tconst char *device,\n"
10212 "\t\tconst char *parttype);\n"
10217 #: ../src/guestfs-actions.pod:3606 ../fish/guestfish-actions.pod:2777
10219 "This creates an empty partition table on C<device> of one of the partition "
10220 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10221 "(for large disks)."
10225 #: ../src/guestfs-actions.pod:3610
10227 "Initially there are no partitions. Following this, you should call "
10228 "C<guestfs_part_add> for each partition required."
10232 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2784
10233 msgid "Possible values for C<parttype> are:"
10237 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2788
10238 msgid "B<efi> | B<gpt>"
10242 #: ../src/guestfs-actions.pod:3619 ../fish/guestfish-actions.pod:2790
10243 msgid "Intel EFI / GPT partition table."
10247 #: ../src/guestfs-actions.pod:3621 ../fish/guestfish-actions.pod:2792
10249 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10250 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10251 "the C<mbr> format."
10255 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2796
10256 msgid "B<mbr> | B<msdos>"
10260 #: ../src/guestfs-actions.pod:3627 ../fish/guestfish-actions.pod:2798
10262 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10263 "Windows. This partition type will B<only> work for device sizes up to 2 "
10264 "TB. For large disks we recommend using C<gpt>."
10268 #: ../src/guestfs-actions.pod:3634 ../fish/guestfish-actions.pod:2805
10270 "Other partition table types that may work but are not supported include:"
10274 #: ../src/guestfs-actions.pod:3639 ../fish/guestfish-actions.pod:2810
10279 #: ../src/guestfs-actions.pod:3641 ../fish/guestfish-actions.pod:2812
10280 msgid "AIX disk labels."
10284 #: ../src/guestfs-actions.pod:3643 ../fish/guestfish-actions.pod:2814
10285 msgid "B<amiga> | B<rdb>"
10289 #: ../src/guestfs-actions.pod:3645 ../fish/guestfish-actions.pod:2816
10290 msgid "Amiga \"Rigid Disk Block\" format."
10294 #: ../src/guestfs-actions.pod:3647 ../fish/guestfish-actions.pod:2818
10299 #: ../src/guestfs-actions.pod:3649 ../fish/guestfish-actions.pod:2820
10300 msgid "BSD disk labels."
10304 #: ../src/guestfs-actions.pod:3651 ../fish/guestfish-actions.pod:2822
10309 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2824
10310 msgid "DASD, used on IBM mainframes."
10314 #: ../src/guestfs-actions.pod:3655 ../fish/guestfish-actions.pod:2826
10319 #: ../src/guestfs-actions.pod:3657 ../fish/guestfish-actions.pod:2828
10320 msgid "MIPS/SGI volumes."
10324 #: ../src/guestfs-actions.pod:3659 ../fish/guestfish-actions.pod:2830
10329 #: ../src/guestfs-actions.pod:3661 ../fish/guestfish-actions.pod:2832
10330 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10334 #: ../src/guestfs-actions.pod:3663 ../fish/guestfish-actions.pod:2834
10339 #: ../src/guestfs-actions.pod:3665 ../fish/guestfish-actions.pod:2836
10340 msgid "NEC PC-98 format, common in Japan apparently."
10344 #: ../src/guestfs-actions.pod:3667 ../fish/guestfish-actions.pod:2838
10349 #: ../src/guestfs-actions.pod:3669 ../fish/guestfish-actions.pod:2840
10350 msgid "Sun disk labels."
10354 #: ../src/guestfs-actions.pod:3675
10355 msgid "guestfs_part_list"
10359 #: ../src/guestfs-actions.pod:3677
10362 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10363 "\t\tconst char *device);\n"
10368 #: ../src/guestfs-actions.pod:3680 ../fish/guestfish-actions.pod:2848
10370 "This command parses the partition table on C<device> and returns the list of "
10371 "partitions found."
10375 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2851
10376 msgid "The fields in the returned structure are:"
10380 #: ../src/guestfs-actions.pod:3687 ../fish/guestfish-actions.pod:2855
10381 msgid "B<part_num>"
10385 #: ../src/guestfs-actions.pod:3689 ../fish/guestfish-actions.pod:2857
10386 msgid "Partition number, counting from 1."
10390 #: ../src/guestfs-actions.pod:3691 ../fish/guestfish-actions.pod:2859
10391 msgid "B<part_start>"
10395 #: ../src/guestfs-actions.pod:3693
10397 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10398 "the device's sector size, see C<guestfs_blockdev_getss>."
10402 #: ../src/guestfs-actions.pod:3696 ../fish/guestfish-actions.pod:2864
10403 msgid "B<part_end>"
10407 #: ../src/guestfs-actions.pod:3698 ../fish/guestfish-actions.pod:2866
10408 msgid "End of the partition in bytes."
10412 #: ../src/guestfs-actions.pod:3700 ../fish/guestfish-actions.pod:2868
10413 msgid "B<part_size>"
10417 #: ../src/guestfs-actions.pod:3702 ../fish/guestfish-actions.pod:2870
10418 msgid "Size of the partition in bytes."
10422 #: ../src/guestfs-actions.pod:3706
10424 "This function returns a C<struct guestfs_partition_list *> (see E<lt>guestfs-"
10425 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10426 "C<guestfs_free_partition_list> after use>."
10430 #: ../src/guestfs-actions.pod:3711
10431 msgid "guestfs_part_set_bootable"
10435 #: ../src/guestfs-actions.pod:3713
10438 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10439 "\t\tconst char *device,\n"
10440 "\t\tint partnum,\n"
10441 "\t\tint bootable);\n"
10446 #: ../src/guestfs-actions.pod:3718 ../fish/guestfish-actions.pod:2878
10448 "This sets the bootable flag on partition numbered C<partnum> on device "
10449 "C<device>. Note that partitions are numbered from 1."
10453 #: ../src/guestfs-actions.pod:3721 ../fish/guestfish-actions.pod:2881
10455 "The bootable flag is used by some operating systems (notably Windows) to "
10456 "determine which partition to boot from. It is by no means universally "
10461 #: ../src/guestfs-actions.pod:3727
10462 msgid "guestfs_part_set_mbr_id"
10466 #: ../src/guestfs-actions.pod:3729
10469 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10470 "\t\tconst char *device,\n"
10471 "\t\tint partnum,\n"
10472 "\t\tint idbyte);\n"
10477 #: ../src/guestfs-actions.pod:3734 ../fish/guestfish-actions.pod:2889
10479 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10480 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10481 "documentation are in fact hexadecimal numbers, but usually documented "
10482 "without any leading \"0x\" which might be confusing."
10486 #: ../src/guestfs-actions.pod:3746
10487 msgid "guestfs_part_set_name"
10491 #: ../src/guestfs-actions.pod:3748
10494 " int guestfs_part_set_name (guestfs_h *g,\n"
10495 "\t\tconst char *device,\n"
10496 "\t\tint partnum,\n"
10497 "\t\tconst char *name);\n"
10502 #: ../src/guestfs-actions.pod:3753 ../fish/guestfish-actions.pod:2903
10504 "This sets the partition name on partition numbered C<partnum> on device "
10505 "C<device>. Note that partitions are numbered from 1."
10509 #: ../src/guestfs-actions.pod:3756 ../fish/guestfish-actions.pod:2906
10511 "The partition name can only be set on certain types of partition table. "
10512 "This works on C<gpt> but not on C<mbr> partitions."
10516 #: ../src/guestfs-actions.pod:3761
10517 msgid "guestfs_part_to_dev"
10521 #: ../src/guestfs-actions.pod:3763
10524 " char *guestfs_part_to_dev (guestfs_h *g,\n"
10525 "\t\tconst char *partition);\n"
10530 #: ../src/guestfs-actions.pod:3766 ../fish/guestfish-actions.pod:2913
10532 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
10533 "partition number, returning the device name (eg. \"/dev/sdb\")."
10537 #: ../src/guestfs-actions.pod:3770
10539 "The named partition must exist, for example as a string returned from "
10540 "C<guestfs_list_partitions>."
10544 #: ../src/guestfs-actions.pod:3776
10545 msgid "guestfs_ping_daemon"
10549 #: ../src/guestfs-actions.pod:3778
10552 " int guestfs_ping_daemon (guestfs_h *g);\n"
10557 #: ../src/guestfs-actions.pod:3780 ../fish/guestfish-actions.pod:2924
10559 "This is a test probe into the guestfs daemon running inside the qemu "
10560 "subprocess. Calling this function checks that the daemon responds to the "
10561 "ping message, without affecting the daemon or attached block device(s) in "
10566 #: ../src/guestfs-actions.pod:3787
10567 msgid "guestfs_pread"
10571 #: ../src/guestfs-actions.pod:3789
10574 " char *guestfs_pread (guestfs_h *g,\n"
10575 "\t\tconst char *path,\n"
10577 "\t\tint64_t offset,\n"
10578 "\t\tsize_t *size_r);\n"
10583 #: ../src/guestfs-actions.pod:3795 ../fish/guestfish-actions.pod:2933
10585 "This command lets you read part of a file. It reads C<count> bytes of the "
10586 "file, starting at C<offset>, from file C<path>."
10590 #: ../src/guestfs-actions.pod:3798 ../fish/guestfish-actions.pod:2936
10592 "This may read fewer bytes than requested. For further details see the "
10593 "L<pread(2)> system call."
10597 #: ../src/guestfs-actions.pod:3801
10598 msgid "See also C<guestfs_pwrite>."
10602 #: ../src/guestfs-actions.pod:3810
10603 msgid "guestfs_pvcreate"
10607 #: ../src/guestfs-actions.pod:3812
10610 " int guestfs_pvcreate (guestfs_h *g,\n"
10611 "\t\tconst char *device);\n"
10616 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2948
10618 "This creates an LVM physical volume on the named C<device>, where C<device> "
10619 "should usually be a partition name such as C</dev/sda1>."
10623 #: ../src/guestfs-actions.pod:3821
10624 msgid "guestfs_pvremove"
10628 #: ../src/guestfs-actions.pod:3823
10631 " int guestfs_pvremove (guestfs_h *g,\n"
10632 "\t\tconst char *device);\n"
10637 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2956
10639 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10644 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2959
10646 "The implementation uses the C<pvremove> command which refuses to wipe "
10647 "physical volumes that contain any volume groups, so you have to remove those "
10652 #: ../src/guestfs-actions.pod:3835
10653 msgid "guestfs_pvresize"
10657 #: ../src/guestfs-actions.pod:3837
10660 " int guestfs_pvresize (guestfs_h *g,\n"
10661 "\t\tconst char *device);\n"
10666 #: ../src/guestfs-actions.pod:3840 ../fish/guestfish-actions.pod:2967
10668 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10669 "the new size of the underlying device."
10673 #: ../src/guestfs-actions.pod:3845
10674 msgid "guestfs_pvresize_size"
10678 #: ../src/guestfs-actions.pod:3847
10681 " int guestfs_pvresize_size (guestfs_h *g,\n"
10682 "\t\tconst char *device,\n"
10683 "\t\tint64_t size);\n"
10688 #: ../src/guestfs-actions.pod:3851
10690 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10691 "specify the new size (in bytes) explicitly."
10695 #: ../src/guestfs-actions.pod:3856
10696 msgid "guestfs_pvs"
10700 #: ../src/guestfs-actions.pod:3858
10703 " char **guestfs_pvs (guestfs_h *g);\n"
10708 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2981
10710 "List all the physical volumes detected. This is the equivalent of the L<pvs"
10715 #: ../src/guestfs-actions.pod:3863 ../fish/guestfish-actions.pod:2984
10717 "This returns a list of just the device names that contain PVs (eg. C</dev/"
10722 #: ../src/guestfs-actions.pod:3866
10723 msgid "See also C<guestfs_pvs_full>."
10727 #: ../src/guestfs-actions.pod:3872
10728 msgid "guestfs_pvs_full"
10732 #: ../src/guestfs-actions.pod:3874
10735 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10740 #: ../src/guestfs-actions.pod:3876 ../fish/guestfish-actions.pod:2993
10742 "List all the physical volumes detected. This is the equivalent of the L<pvs"
10743 "(8)> command. The \"full\" version includes all fields."
10747 #: ../src/guestfs-actions.pod:3879
10749 "This function returns a C<struct guestfs_lvm_pv_list *> (see E<lt>guestfs-"
10750 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10751 "C<guestfs_free_lvm_pv_list> after use>."
10755 #: ../src/guestfs-actions.pod:3884
10756 msgid "guestfs_pvuuid"
10760 #: ../src/guestfs-actions.pod:3886
10763 " char *guestfs_pvuuid (guestfs_h *g,\n"
10764 "\t\tconst char *device);\n"
10769 #: ../src/guestfs-actions.pod:3889 ../fish/guestfish-actions.pod:3000
10770 msgid "This command returns the UUID of the LVM PV C<device>."
10774 #: ../src/guestfs-actions.pod:3894
10775 msgid "guestfs_pwrite"
10779 #: ../src/guestfs-actions.pod:3896
10782 " int guestfs_pwrite (guestfs_h *g,\n"
10783 "\t\tconst char *path,\n"
10784 "\t\tconst char *content,\n"
10785 "\t\tsize_t content_size,\n"
10786 "\t\tint64_t offset);\n"
10791 #: ../src/guestfs-actions.pod:3902 ../fish/guestfish-actions.pod:3006
10793 "This command writes to part of a file. It writes the data buffer C<content> "
10794 "to the file C<path> starting at offset C<offset>."
10798 #: ../src/guestfs-actions.pod:3905 ../fish/guestfish-actions.pod:3009
10800 "This command implements the L<pwrite(2)> system call, and like that system "
10801 "call it may not write the full data requested. The return value is the "
10802 "number of bytes that were actually written to the file. This could even be "
10803 "0, although short writes are unlikely for regular files in ordinary "
10808 #: ../src/guestfs-actions.pod:3911
10809 msgid "See also C<guestfs_pread>."
10813 #: ../src/guestfs-actions.pod:3918
10814 msgid "guestfs_read_file"
10818 #: ../src/guestfs-actions.pod:3920
10821 " char *guestfs_read_file (guestfs_h *g,\n"
10822 "\t\tconst char *path,\n"
10823 "\t\tsize_t *size_r);\n"
10828 #: ../src/guestfs-actions.pod:3924 ../fish/guestfish-actions.pod:3024
10829 msgid "This calls returns the contents of the file C<path> as a buffer."
10833 #: ../src/guestfs-actions.pod:3927
10835 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
10836 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
10837 "function is limited in the total size of file that can be handled."
10841 #: ../src/guestfs-actions.pod:3939
10842 msgid "guestfs_read_lines"
10846 #: ../src/guestfs-actions.pod:3941
10849 " char **guestfs_read_lines (guestfs_h *g,\n"
10850 "\t\tconst char *path);\n"
10855 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:3041
10857 "The file contents are returned as a list of lines. Trailing C<LF> and "
10858 "C<CRLF> character sequences are I<not> returned."
10862 #: ../src/guestfs-actions.pod:3949
10864 "Note that this function cannot correctly handle binary files (specifically, "
10865 "files containing C<\\0> character which is treated as end of line). For "
10866 "those you need to use the C<guestfs_read_file> function which has a more "
10867 "complex interface."
10871 #: ../src/guestfs-actions.pod:3958
10872 msgid "guestfs_readdir"
10876 #: ../src/guestfs-actions.pod:3960
10879 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
10880 "\t\tconst char *dir);\n"
10885 #: ../src/guestfs-actions.pod:3963 ../fish/guestfish-actions.pod:3053
10886 msgid "This returns the list of directory entries in directory C<dir>."
10890 #: ../src/guestfs-actions.pod:3965 ../fish/guestfish-actions.pod:3055
10892 "All entries in the directory are returned, including C<.> and C<..>. The "
10893 "entries are I<not> sorted, but returned in the same order as the underlying "
10898 #: ../src/guestfs-actions.pod:3969 ../fish/guestfish-actions.pod:3059
10900 "Also this call returns basic file type information about each file. The "
10901 "C<ftyp> field will contain one of the following characters:"
10905 #: ../src/guestfs-actions.pod:3974 ../fish/guestfish-actions.pod:3064
10910 #: ../src/guestfs-actions.pod:3976 ../fish/guestfish-actions.pod:3066
10911 msgid "Block special"
10915 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:3068
10920 #: ../src/guestfs-actions.pod:3980 ../fish/guestfish-actions.pod:3070
10921 msgid "Char special"
10925 #: ../src/guestfs-actions.pod:3982 ../fish/guestfish-actions.pod:3072
10930 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:3074
10935 #: ../src/guestfs-actions.pod:3986 ../fish/guestfish-actions.pod:3076
10940 #: ../src/guestfs-actions.pod:3988 ../fish/guestfish-actions.pod:3078
10941 msgid "FIFO (named pipe)"
10945 #: ../src/guestfs-actions.pod:3990 ../fish/guestfish-actions.pod:3080
10950 #: ../src/guestfs-actions.pod:3992 ../fish/guestfish-actions.pod:3082
10951 msgid "Symbolic link"
10955 #: ../src/guestfs-actions.pod:3994 ../fish/guestfish-actions.pod:3084
10960 #: ../src/guestfs-actions.pod:3996 ../fish/guestfish-actions.pod:3086
10961 msgid "Regular file"
10965 #: ../src/guestfs-actions.pod:3998 ../fish/guestfish-actions.pod:3088
10970 #: ../src/guestfs-actions.pod:4000 ../fish/guestfish-actions.pod:3090
10975 #: ../src/guestfs-actions.pod:4002 ../fish/guestfish-actions.pod:3092
10980 #: ../src/guestfs-actions.pod:4004 ../fish/guestfish-actions.pod:3094
10981 msgid "Unknown file type"
10985 #: ../src/guestfs-actions.pod:4006 ../fish/guestfish-actions.pod:3096
10990 #: ../src/guestfs-actions.pod:4008 ../fish/guestfish-actions.pod:3098
10992 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
10996 #: ../src/guestfs-actions.pod:4013
10998 "This function is primarily intended for use by programs. To get a simple "
10999 "list of names, use C<guestfs_ls>. To get a printable directory for human "
11000 "consumption, use C<guestfs_ll>."
11004 #: ../src/guestfs-actions.pod:4017
11006 "This function returns a C<struct guestfs_dirent_list *> (see E<lt>guestfs-"
11007 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11008 "C<guestfs_free_dirent_list> after use>."
11012 #: ../src/guestfs-actions.pod:4022
11013 msgid "guestfs_readlink"
11017 #: ../src/guestfs-actions.pod:4024
11020 " char *guestfs_readlink (guestfs_h *g,\n"
11021 "\t\tconst char *path);\n"
11026 #: ../src/guestfs-actions.pod:4027 ../fish/guestfish-actions.pod:3111
11027 msgid "This command reads the target of a symbolic link."
11031 #: ../src/guestfs-actions.pod:4032
11032 msgid "guestfs_readlinklist"
11036 #: ../src/guestfs-actions.pod:4034
11039 " char **guestfs_readlinklist (guestfs_h *g,\n"
11040 "\t\tconst char *path,\n"
11041 "\t\tchar *const *names);\n"
11046 #: ../src/guestfs-actions.pod:4038 ../fish/guestfish-actions.pod:3117
11048 "This call allows you to do a C<readlink> operation on multiple files, where "
11049 "all files are in the directory C<path>. C<names> is the list of files from "
11054 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:3121
11056 "On return you get a list of strings, with a one-to-one correspondence to the "
11057 "C<names> list. Each string is the value of the symbolic link."
11061 #: ../src/guestfs-actions.pod:4046 ../fish/guestfish-actions.pod:3125
11063 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11064 "result string is the empty string C<\"\">. However the whole operation is "
11065 "completed even if there were C<readlink(2)> errors, and so you can call this "
11066 "function with names where you don't know if they are symbolic links already "
11067 "(albeit slightly less efficient)."
11071 #: ../src/guestfs-actions.pod:4053 ../fish/guestfish-actions.pod:3132
11073 "This call is intended for programs that want to efficiently list a directory "
11074 "contents without making many round-trips. Very long directory listings "
11075 "might cause the protocol message size to be exceeded, causing this call to "
11076 "fail. The caller must split up such requests into smaller groups of names."
11080 #: ../src/guestfs-actions.pod:4064
11081 msgid "guestfs_realpath"
11085 #: ../src/guestfs-actions.pod:4066
11088 " char *guestfs_realpath (guestfs_h *g,\n"
11089 "\t\tconst char *path);\n"
11094 #: ../src/guestfs-actions.pod:4069 ../fish/guestfish-actions.pod:3143
11096 "Return the canonicalized absolute pathname of C<path>. The returned path "
11097 "has no C<.>, C<..> or symbolic link path elements."
11101 #: ../src/guestfs-actions.pod:4075
11102 msgid "guestfs_removexattr"
11106 #: ../src/guestfs-actions.pod:4077
11109 " int guestfs_removexattr (guestfs_h *g,\n"
11110 "\t\tconst char *xattr,\n"
11111 "\t\tconst char *path);\n"
11116 #: ../src/guestfs-actions.pod:4081 ../fish/guestfish-actions.pod:3150
11118 "This call removes the extended attribute named C<xattr> of the file C<path>."
11122 #: ../src/guestfs-actions.pod:4084
11123 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11127 #: ../src/guestfs-actions.pod:4088
11128 msgid "guestfs_resize2fs"
11132 #: ../src/guestfs-actions.pod:4090
11135 " int guestfs_resize2fs (guestfs_h *g,\n"
11136 "\t\tconst char *device);\n"
11141 #: ../src/guestfs-actions.pod:4093 ../fish/guestfish-actions.pod:3159
11143 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11144 "underlying device."
11148 #: ../src/guestfs-actions.pod:4096
11150 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11151 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11152 "sometimes gives an error about this and sometimes not. In any case, it is "
11153 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11157 #: ../src/guestfs-actions.pod:4104
11158 msgid "guestfs_resize2fs_size"
11162 #: ../src/guestfs-actions.pod:4106
11165 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11166 "\t\tconst char *device,\n"
11167 "\t\tint64_t size);\n"
11172 #: ../src/guestfs-actions.pod:4110
11174 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11175 "to specify the new size (in bytes) explicitly."
11179 #: ../src/guestfs-actions.pod:4115
11184 #: ../src/guestfs-actions.pod:4117
11187 " int guestfs_rm (guestfs_h *g,\n"
11188 "\t\tconst char *path);\n"
11193 #: ../src/guestfs-actions.pod:4120 ../fish/guestfish-actions.pod:3179
11194 msgid "Remove the single file C<path>."
11198 #: ../src/guestfs-actions.pod:4124
11199 msgid "guestfs_rm_rf"
11203 #: ../src/guestfs-actions.pod:4126
11206 " int guestfs_rm_rf (guestfs_h *g,\n"
11207 "\t\tconst char *path);\n"
11212 #: ../src/guestfs-actions.pod:4129 ../fish/guestfish-actions.pod:3185
11214 "Remove the file or directory C<path>, recursively removing the contents if "
11215 "its a directory. This is like the C<rm -rf> shell command."
11219 #: ../src/guestfs-actions.pod:4135
11220 msgid "guestfs_rmdir"
11224 #: ../src/guestfs-actions.pod:4137
11227 " int guestfs_rmdir (guestfs_h *g,\n"
11228 "\t\tconst char *path);\n"
11233 #: ../src/guestfs-actions.pod:4140 ../fish/guestfish-actions.pod:3193
11234 msgid "Remove the single directory C<path>."
11238 #: ../src/guestfs-actions.pod:4144
11239 msgid "guestfs_rmmountpoint"
11243 #: ../src/guestfs-actions.pod:4146
11246 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11247 "\t\tconst char *exemptpath);\n"
11252 #: ../src/guestfs-actions.pod:4149
11254 "This calls removes a mountpoint that was previously created with "
11255 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11259 #: ../src/guestfs-actions.pod:4155
11260 msgid "guestfs_scrub_device"
11264 #: ../src/guestfs-actions.pod:4157
11267 " int guestfs_scrub_device (guestfs_h *g,\n"
11268 "\t\tconst char *device);\n"
11273 #: ../src/guestfs-actions.pod:4160 ../fish/guestfish-actions.pod:3207
11275 "This command writes patterns over C<device> to make data retrieval more "
11280 #: ../src/guestfs-actions.pod:4163 ../src/guestfs-actions.pod:4181
11281 #: ../src/guestfs-actions.pod:4197 ../fish/guestfish-actions.pod:3210
11282 #: ../fish/guestfish-actions.pod:3225 ../fish/guestfish-actions.pod:3238
11284 "It is an interface to the L<scrub(1)> program. See that manual page for "
11289 #: ../src/guestfs-actions.pod:4171
11290 msgid "guestfs_scrub_file"
11294 #: ../src/guestfs-actions.pod:4173
11297 " int guestfs_scrub_file (guestfs_h *g,\n"
11298 "\t\tconst char *file);\n"
11303 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:3220
11305 "This command writes patterns over a file to make data retrieval more "
11310 #: ../src/guestfs-actions.pod:4179 ../fish/guestfish-actions.pod:3223
11311 msgid "The file is I<removed> after scrubbing."
11315 #: ../src/guestfs-actions.pod:4186
11316 msgid "guestfs_scrub_freespace"
11320 #: ../src/guestfs-actions.pod:4188
11323 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11324 "\t\tconst char *dir);\n"
11329 #: ../src/guestfs-actions.pod:4191
11331 "This command creates the directory C<dir> and then fills it with files until "
11332 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11333 "and deletes them. The intention is to scrub any free space on the partition "
11334 "containing C<dir>."
11338 #: ../src/guestfs-actions.pod:4202
11339 msgid "guestfs_set_append"
11343 #: ../src/guestfs-actions.pod:4204
11346 " int guestfs_set_append (guestfs_h *g,\n"
11347 "\t\tconst char *append);\n"
11352 #: ../src/guestfs-actions.pod:4207 ../fish/guestfish-actions.pod:3245
11354 "This function is used to add additional options to the guest kernel command "
11359 #: ../src/guestfs-actions.pod:4210 ../fish/guestfish-actions.pod:3248
11361 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11362 "environment variable."
11366 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:3251
11368 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11369 "(libguestfs always adds a few of its own)."
11373 #: ../src/guestfs-actions.pod:4218
11374 msgid "guestfs_set_autosync"
11378 #: ../src/guestfs-actions.pod:4220
11381 " int guestfs_set_autosync (guestfs_h *g,\n"
11382 "\t\tint autosync);\n"
11387 #: ../src/guestfs-actions.pod:4223
11389 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11390 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11391 "the handle is closed (also if the program exits without closing handles)."
11395 #: ../src/guestfs-actions.pod:4228 ../fish/guestfish-actions.pod:3263
11397 "This is disabled by default (except in guestfish where it is enabled by "
11402 #: ../src/guestfs-actions.pod:4233
11403 msgid "guestfs_set_direct"
11407 #: ../src/guestfs-actions.pod:4235
11410 " int guestfs_set_direct (guestfs_h *g,\n"
11411 "\t\tint direct);\n"
11416 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:3270
11418 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11419 "passed directly through to the appliance once it is launched."
11423 #: ../src/guestfs-actions.pod:4242
11425 "One consequence of this is that log messages aren't caught by the library "
11426 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11431 #: ../src/guestfs-actions.pod:4246 ../fish/guestfish-actions.pod:3278
11432 msgid "You probably don't want to use this unless you know what you are doing."
11436 #: ../src/guestfs-actions.pod:4249 ../fish/guestfish-actions.pod:3281
11437 msgid "The default is disabled."
11441 #: ../src/guestfs-actions.pod:4253
11442 msgid "guestfs_set_e2label"
11446 #: ../src/guestfs-actions.pod:4255
11449 " int guestfs_set_e2label (guestfs_h *g,\n"
11450 "\t\tconst char *device,\n"
11451 "\t\tconst char *label);\n"
11456 #: ../src/guestfs-actions.pod:4259 ../fish/guestfish-actions.pod:3287
11458 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11459 "C<label>. Filesystem labels are limited to 16 characters."
11463 #: ../src/guestfs-actions.pod:4263
11465 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11466 "the existing label on a filesystem."
11470 #: ../src/guestfs-actions.pod:4268
11471 msgid "guestfs_set_e2uuid"
11475 #: ../src/guestfs-actions.pod:4270
11478 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11479 "\t\tconst char *device,\n"
11480 "\t\tconst char *uuid);\n"
11485 #: ../src/guestfs-actions.pod:4274 ../fish/guestfish-actions.pod:3298
11487 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11488 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11489 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11493 #: ../src/guestfs-actions.pod:4279
11495 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11496 "the existing UUID of a filesystem."
11500 #: ../src/guestfs-actions.pod:4284
11501 msgid "guestfs_set_memsize"
11505 #: ../src/guestfs-actions.pod:4286
11508 " int guestfs_set_memsize (guestfs_h *g,\n"
11509 "\t\tint memsize);\n"
11514 #: ../src/guestfs-actions.pod:4289
11516 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11517 "This only has any effect if called before C<guestfs_launch>."
11521 #: ../src/guestfs-actions.pod:4293 ../fish/guestfish-actions.pod:3314
11523 "You can also change this by setting the environment variable "
11524 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11528 #: ../src/guestfs-actions.pod:4302
11529 msgid "guestfs_set_network"
11533 #: ../src/guestfs-actions.pod:4304
11536 " int guestfs_set_network (guestfs_h *g,\n"
11537 "\t\tint network);\n"
11542 #: ../src/guestfs-actions.pod:4307 ../fish/guestfish-actions.pod:3325
11544 "If C<network> is true, then the network is enabled in the libguestfs "
11545 "appliance. The default is false."
11549 #: ../src/guestfs-actions.pod:4310 ../fish/guestfish-actions.pod:3328
11551 "This affects whether commands are able to access the network (see L<guestfs"
11552 "(3)/RUNNING COMMANDS>)."
11556 #: ../src/guestfs-actions.pod:4313
11558 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11563 #: ../src/guestfs-actions.pod:4318
11564 msgid "guestfs_set_path"
11568 #: ../src/guestfs-actions.pod:4320
11571 " int guestfs_set_path (guestfs_h *g,\n"
11572 "\t\tconst char *searchpath);\n"
11577 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:3338
11578 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11582 #: ../src/guestfs-actions.pod:4325 ../fish/guestfish-actions.pod:3340
11584 "The default is C<$libdir/guestfs> unless overridden by setting "
11585 "C<LIBGUESTFS_PATH> environment variable."
11589 #: ../src/guestfs-actions.pod:4328 ../fish/guestfish-actions.pod:3343
11590 msgid "Setting C<path> to C<NULL> restores the default path."
11594 #: ../src/guestfs-actions.pod:4332
11595 msgid "guestfs_set_qemu"
11599 #: ../src/guestfs-actions.pod:4334
11602 " int guestfs_set_qemu (guestfs_h *g,\n"
11603 "\t\tconst char *qemu);\n"
11608 #: ../src/guestfs-actions.pod:4337 ../fish/guestfish-actions.pod:3349
11609 msgid "Set the qemu binary that we will use."
11613 #: ../src/guestfs-actions.pod:4339 ../fish/guestfish-actions.pod:3351
11615 "The default is chosen when the library was compiled by the configure script."
11619 #: ../src/guestfs-actions.pod:4342 ../fish/guestfish-actions.pod:3354
11621 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11626 #: ../src/guestfs-actions.pod:4345 ../fish/guestfish-actions.pod:3357
11627 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11631 #: ../src/guestfs-actions.pod:4347 ../fish/guestfish-actions.pod:3359
11633 "Note that you should call this function as early as possible after creating "
11634 "the handle. This is because some pre-launch operations depend on testing "
11635 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11636 "don't retest features, and so you might see inconsistent results. Using the "
11637 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11638 "the qemu binary at the same time as the handle is created."
11642 #: ../src/guestfs-actions.pod:4357
11643 msgid "guestfs_set_recovery_proc"
11647 #: ../src/guestfs-actions.pod:4359
11650 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11651 "\t\tint recoveryproc);\n"
11656 #: ../src/guestfs-actions.pod:4362
11658 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11659 "not create a recovery process. The purpose of the recovery process is to "
11660 "stop runaway qemu processes in the case where the main program aborts "
11665 #: ../src/guestfs-actions.pod:4367
11667 "This only has any effect if called before C<guestfs_launch>, and the default "
11672 #: ../src/guestfs-actions.pod:4370 ../fish/guestfish-actions.pod:3379
11674 "About the only time when you would want to disable this is if the main "
11675 "process will fork itself into the background (\"daemonize\" itself). In "
11676 "this case the recovery process thinks that the main program has disappeared "
11677 "and so kills qemu, which is not very helpful."
11681 #: ../src/guestfs-actions.pod:4378
11682 msgid "guestfs_set_selinux"
11686 #: ../src/guestfs-actions.pod:4380
11689 " int guestfs_set_selinux (guestfs_h *g,\n"
11690 "\t\tint selinux);\n"
11695 #: ../src/guestfs-actions.pod:4383 ../fish/guestfish-actions.pod:3389
11697 "This sets the selinux flag that is passed to the appliance at boot time. "
11698 "The default is C<selinux=0> (disabled)."
11702 #: ../src/guestfs-actions.pod:4386 ../fish/guestfish-actions.pod:3392
11704 "Note that if SELinux is enabled, it is always in Permissive mode "
11705 "(C<enforcing=0>)."
11709 #: ../src/guestfs-actions.pod:4394
11710 msgid "guestfs_set_trace"
11714 #: ../src/guestfs-actions.pod:4396
11717 " int guestfs_set_trace (guestfs_h *g,\n"
11718 "\t\tint trace);\n"
11723 #: ../src/guestfs-actions.pod:4399 ../fish/guestfish-actions.pod:3402
11725 "If the command trace flag is set to 1, then commands are printed on stderr "
11726 "before they are executed in a format which is very similar to the one used "
11727 "by guestfish. In other words, you can run a program with this enabled, and "
11728 "you will get out a script which you can feed to guestfish to perform the "
11729 "same set of actions."
11733 #: ../src/guestfs-actions.pod:4406 ../fish/guestfish-actions.pod:3409
11735 "If you want to trace C API calls into libguestfs (and other libraries) then "
11736 "possibly a better way is to use the external ltrace(1) command."
11740 #: ../src/guestfs-actions.pod:4410 ../fish/guestfish-actions.pod:3413
11742 "Command traces are disabled unless the environment variable "
11743 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
11747 #: ../src/guestfs-actions.pod:4415
11748 msgid "guestfs_set_verbose"
11752 #: ../src/guestfs-actions.pod:4417
11755 " int guestfs_set_verbose (guestfs_h *g,\n"
11756 "\t\tint verbose);\n"
11761 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:3420
11762 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
11766 #: ../src/guestfs-actions.pod:4422 ../fish/guestfish-actions.pod:3422
11768 "Verbose messages are disabled unless the environment variable "
11769 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
11773 #: ../src/guestfs-actions.pod:4427
11774 msgid "guestfs_setcon"
11778 #: ../src/guestfs-actions.pod:4429
11781 " int guestfs_setcon (guestfs_h *g,\n"
11782 "\t\tconst char *context);\n"
11787 #: ../src/guestfs-actions.pod:4432 ../fish/guestfish-actions.pod:3429
11789 "This sets the SELinux security context of the daemon to the string "
11794 #: ../src/guestfs-actions.pod:4435 ../fish/guestfish-actions.pod:3432
11795 msgid "See the documentation about SELINUX in L<guestfs(3)>."
11799 #: ../src/guestfs-actions.pod:4439
11800 msgid "guestfs_setxattr"
11804 #: ../src/guestfs-actions.pod:4441
11807 " int guestfs_setxattr (guestfs_h *g,\n"
11808 "\t\tconst char *xattr,\n"
11809 "\t\tconst char *val,\n"
11810 "\t\tint vallen,\n"
11811 "\t\tconst char *path);\n"
11816 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:3438
11818 "This call sets the extended attribute named C<xattr> of the file C<path> to "
11819 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
11823 #: ../src/guestfs-actions.pod:4451
11824 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
11828 #: ../src/guestfs-actions.pod:4455
11829 msgid "guestfs_sfdisk"
11833 #: ../src/guestfs-actions.pod:4457
11836 " int guestfs_sfdisk (guestfs_h *g,\n"
11837 "\t\tconst char *device,\n"
11840 "\t\tint sectors,\n"
11841 "\t\tchar *const *lines);\n"
11846 #: ../src/guestfs-actions.pod:4464 ../fish/guestfish-actions.pod:3448
11848 "This is a direct interface to the L<sfdisk(8)> program for creating "
11849 "partitions on block devices."
11853 #: ../src/guestfs-actions.pod:4467 ../fish/guestfish-actions.pod:3451
11854 msgid "C<device> should be a block device, for example C</dev/sda>."
11858 #: ../src/guestfs-actions.pod:4469 ../fish/guestfish-actions.pod:3453
11860 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
11861 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
11862 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
11863 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
11864 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
11865 "the kernel) cannot work out the right geometry and you will need to tell it."
11869 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:3461
11871 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
11872 "refer to the L<sfdisk(8)> manpage."
11876 #: ../src/guestfs-actions.pod:4480 ../fish/guestfish-actions.pod:3464
11878 "To create a single partition occupying the whole disk, you would pass "
11879 "C<lines> as a single element list, when the single element being the string "
11884 #: ../src/guestfs-actions.pod:4484
11886 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
11890 #: ../src/guestfs-actions.pod:4492
11891 msgid "guestfs_sfdiskM"
11895 #: ../src/guestfs-actions.pod:4494
11898 " int guestfs_sfdiskM (guestfs_h *g,\n"
11899 "\t\tconst char *device,\n"
11900 "\t\tchar *const *lines);\n"
11905 #: ../src/guestfs-actions.pod:4498
11907 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
11908 "partition sizes are specified in megabytes only (rounded to the nearest "
11909 "cylinder) and you don't need to specify the cyls, heads and sectors "
11910 "parameters which were rarely if ever used anyway."
11914 #: ../src/guestfs-actions.pod:4504
11916 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
11917 "C<guestfs_part_disk>"
11921 #: ../src/guestfs-actions.pod:4512
11922 msgid "guestfs_sfdisk_N"
11926 #: ../src/guestfs-actions.pod:4514
11929 " int guestfs_sfdisk_N (guestfs_h *g,\n"
11930 "\t\tconst char *device,\n"
11931 "\t\tint partnum,\n"
11934 "\t\tint sectors,\n"
11935 "\t\tconst char *line);\n"
11940 #: ../src/guestfs-actions.pod:4522 ../fish/guestfish-actions.pod:3494
11942 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
11943 "(note: C<n> counts from 1)."
11947 #: ../src/guestfs-actions.pod:4525
11949 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
11950 "for the cyls/heads/sectors parameters."
11954 #: ../src/guestfs-actions.pod:4528
11955 msgid "See also: C<guestfs_part_add>"
11959 #: ../src/guestfs-actions.pod:4535
11960 msgid "guestfs_sfdisk_disk_geometry"
11964 #: ../src/guestfs-actions.pod:4537
11967 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
11968 "\t\tconst char *device);\n"
11973 #: ../src/guestfs-actions.pod:4540
11975 "This displays the disk geometry of C<device> read from the partition table. "
11976 "Especially in the case where the underlying block device has been resized, "
11977 "this can be different from the kernel's idea of the geometry (see "
11978 "C<guestfs_sfdisk_kernel_geometry>)."
11982 #: ../src/guestfs-actions.pod:4545 ../src/guestfs-actions.pod:4558
11983 #: ../fish/guestfish-actions.pod:3514 ../fish/guestfish-actions.pod:3523
11984 msgid "The result is in human-readable format, and not designed to be parsed."
11988 #: ../src/guestfs-actions.pod:4551
11989 msgid "guestfs_sfdisk_kernel_geometry"
11993 #: ../src/guestfs-actions.pod:4553
11996 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
11997 "\t\tconst char *device);\n"
12002 #: ../src/guestfs-actions.pod:4556 ../fish/guestfish-actions.pod:3521
12003 msgid "This displays the kernel's idea of the geometry of C<device>."
12007 #: ../src/guestfs-actions.pod:4564
12008 msgid "guestfs_sfdisk_l"
12012 #: ../src/guestfs-actions.pod:4566
12015 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12016 "\t\tconst char *device);\n"
12021 #: ../src/guestfs-actions.pod:4569 ../fish/guestfish-actions.pod:3530
12023 "This displays the partition table on C<device>, in the human-readable output "
12024 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12028 #: ../src/guestfs-actions.pod:4573
12029 msgid "See also: C<guestfs_part_list>"
12033 #: ../src/guestfs-actions.pod:4578
12038 #: ../src/guestfs-actions.pod:4580
12041 " char *guestfs_sh (guestfs_h *g,\n"
12042 "\t\tconst char *command);\n"
12047 #: ../src/guestfs-actions.pod:4583 ../fish/guestfish-actions.pod:3540
12049 "This call runs a command from the guest filesystem via the guest's C</bin/"
12054 #: ../src/guestfs-actions.pod:4586
12055 msgid "This is like C<guestfs_command>, but passes the command to:"
12059 #: ../src/guestfs-actions.pod:4588 ../fish/guestfish-actions.pod:3545
12062 " /bin/sh -c \"command\"\n"
12067 #: ../src/guestfs-actions.pod:4590 ../fish/guestfish-actions.pod:3547
12069 "Depending on the guest's shell, this usually results in wildcards being "
12070 "expanded, shell expressions being interpolated and so on."
12074 #: ../src/guestfs-actions.pod:4594
12075 msgid "All the provisos about C<guestfs_command> apply to this call."
12079 #: ../src/guestfs-actions.pod:4599
12080 msgid "guestfs_sh_lines"
12084 #: ../src/guestfs-actions.pod:4601
12087 " char **guestfs_sh_lines (guestfs_h *g,\n"
12088 "\t\tconst char *command);\n"
12093 #: ../src/guestfs-actions.pod:4604
12095 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12100 #: ../src/guestfs-actions.pod:4607
12101 msgid "See also: C<guestfs_command_lines>"
12105 #: ../src/guestfs-actions.pod:4613
12106 msgid "guestfs_sleep"
12110 #: ../src/guestfs-actions.pod:4615
12113 " int guestfs_sleep (guestfs_h *g,\n"
12119 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3566
12120 msgid "Sleep for C<secs> seconds."
12124 #: ../src/guestfs-actions.pod:4622 ../src/guestfs-structs.pod:109
12125 msgid "guestfs_stat"
12129 #: ../src/guestfs-actions.pod:4624
12132 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12133 "\t\tconst char *path);\n"
12138 #: ../src/guestfs-actions.pod:4629 ../fish/guestfish-actions.pod:3574
12139 msgid "This is the same as the C<stat(2)> system call."
12143 #: ../src/guestfs-actions.pod:4635 ../src/guestfs-structs.pod:135
12144 msgid "guestfs_statvfs"
12148 #: ../src/guestfs-actions.pod:4637
12151 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12152 "\t\tconst char *path);\n"
12157 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3580
12159 "Returns file system statistics for any mounted file system. C<path> should "
12160 "be a file or directory in the mounted file system (typically it is the mount "
12161 "point itself, but it doesn't need to be)."
12165 #: ../src/guestfs-actions.pod:4644 ../fish/guestfish-actions.pod:3584
12166 msgid "This is the same as the C<statvfs(2)> system call."
12170 #: ../src/guestfs-actions.pod:4646
12172 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12173 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12177 #: ../src/guestfs-actions.pod:4650
12178 msgid "guestfs_strings"
12182 #: ../src/guestfs-actions.pod:4652
12185 " char **guestfs_strings (guestfs_h *g,\n"
12186 "\t\tconst char *path);\n"
12191 #: ../src/guestfs-actions.pod:4655 ../fish/guestfish-actions.pod:3590
12193 "This runs the L<strings(1)> command on a file and returns the list of "
12194 "printable strings found."
12198 #: ../src/guestfs-actions.pod:4665
12199 msgid "guestfs_strings_e"
12203 #: ../src/guestfs-actions.pod:4667
12206 " char **guestfs_strings_e (guestfs_h *g,\n"
12207 "\t\tconst char *encoding,\n"
12208 "\t\tconst char *path);\n"
12213 #: ../src/guestfs-actions.pod:4671
12215 "This is like the C<guestfs_strings> command, but allows you to specify the "
12216 "encoding of strings that are looked for in the source file C<path>."
12220 #: ../src/guestfs-actions.pod:4675 ../fish/guestfish-actions.pod:3604
12221 msgid "Allowed encodings are:"
12225 #: ../src/guestfs-actions.pod:4679 ../fish/guestfish-actions.pod:3608
12230 #: ../src/guestfs-actions.pod:4681
12232 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12233 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12237 #: ../src/guestfs-actions.pod:4684 ../fish/guestfish-actions.pod:3613
12242 #: ../src/guestfs-actions.pod:4686 ../fish/guestfish-actions.pod:3615
12243 msgid "Single 8-bit-byte characters."
12247 #: ../src/guestfs-actions.pod:4688 ../fish/guestfish-actions.pod:3617
12252 #: ../src/guestfs-actions.pod:4690 ../fish/guestfish-actions.pod:3619
12253 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12257 #: ../src/guestfs-actions.pod:4693 ../fish/guestfish-actions.pod:3622
12258 msgid "l (lower case letter L)"
12262 #: ../src/guestfs-actions.pod:4695 ../fish/guestfish-actions.pod:3624
12264 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12265 "examining binaries in Windows guests."
12269 #: ../src/guestfs-actions.pod:4698 ../fish/guestfish-actions.pod:3627
12274 #: ../src/guestfs-actions.pod:4700 ../fish/guestfish-actions.pod:3629
12275 msgid "32-bit big endian such as UCS-4BE."
12279 #: ../src/guestfs-actions.pod:4702 ../fish/guestfish-actions.pod:3631
12284 #: ../src/guestfs-actions.pod:4704 ../fish/guestfish-actions.pod:3633
12285 msgid "32-bit little endian such as UCS-4LE."
12289 #: ../src/guestfs-actions.pod:4708 ../fish/guestfish-actions.pod:3637
12290 msgid "The returned strings are transcoded to UTF-8."
12294 #: ../src/guestfs-actions.pod:4717
12295 msgid "guestfs_swapoff_device"
12299 #: ../src/guestfs-actions.pod:4719
12302 " int guestfs_swapoff_device (guestfs_h *g,\n"
12303 "\t\tconst char *device);\n"
12308 #: ../src/guestfs-actions.pod:4722
12310 "This command disables the libguestfs appliance swap device or partition "
12311 "named C<device>. See C<guestfs_swapon_device>."
12315 #: ../src/guestfs-actions.pod:4728
12316 msgid "guestfs_swapoff_file"
12320 #: ../src/guestfs-actions.pod:4730
12323 " int guestfs_swapoff_file (guestfs_h *g,\n"
12324 "\t\tconst char *file);\n"
12329 #: ../src/guestfs-actions.pod:4733 ../fish/guestfish-actions.pod:3654
12330 msgid "This command disables the libguestfs appliance swap on file."
12334 #: ../src/guestfs-actions.pod:4737
12335 msgid "guestfs_swapoff_label"
12339 #: ../src/guestfs-actions.pod:4739
12342 " int guestfs_swapoff_label (guestfs_h *g,\n"
12343 "\t\tconst char *label);\n"
12348 #: ../src/guestfs-actions.pod:4742 ../fish/guestfish-actions.pod:3660
12350 "This command disables the libguestfs appliance swap on labeled swap "
12355 #: ../src/guestfs-actions.pod:4747
12356 msgid "guestfs_swapoff_uuid"
12360 #: ../src/guestfs-actions.pod:4749
12363 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12364 "\t\tconst char *uuid);\n"
12369 #: ../src/guestfs-actions.pod:4752 ../fish/guestfish-actions.pod:3667
12371 "This command disables the libguestfs appliance swap partition with the given "
12376 #: ../src/guestfs-actions.pod:4757
12377 msgid "guestfs_swapon_device"
12381 #: ../src/guestfs-actions.pod:4759
12384 " int guestfs_swapon_device (guestfs_h *g,\n"
12385 "\t\tconst char *device);\n"
12390 #: ../src/guestfs-actions.pod:4762
12392 "This command enables the libguestfs appliance to use the swap device or "
12393 "partition named C<device>. The increased memory is made available for all "
12394 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12398 #: ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:3679
12400 "Note that you should not swap to existing guest swap partitions unless you "
12401 "know what you are doing. They may contain hibernation information, or other "
12402 "information that the guest doesn't want you to trash. You also risk leaking "
12403 "information about the host to the guest this way. Instead, attach a new "
12404 "host device to the guest and swap on that."
12408 #: ../src/guestfs-actions.pod:4776
12409 msgid "guestfs_swapon_file"
12413 #: ../src/guestfs-actions.pod:4778
12416 " int guestfs_swapon_file (guestfs_h *g,\n"
12417 "\t\tconst char *file);\n"
12422 #: ../src/guestfs-actions.pod:4781
12424 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12429 #: ../src/guestfs-actions.pod:4786
12430 msgid "guestfs_swapon_label"
12434 #: ../src/guestfs-actions.pod:4788
12437 " int guestfs_swapon_label (guestfs_h *g,\n"
12438 "\t\tconst char *label);\n"
12443 #: ../src/guestfs-actions.pod:4791
12445 "This command enables swap to a labeled swap partition. See "
12446 "C<guestfs_swapon_device> for other notes."
12450 #: ../src/guestfs-actions.pod:4796
12451 msgid "guestfs_swapon_uuid"
12455 #: ../src/guestfs-actions.pod:4798
12458 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12459 "\t\tconst char *uuid);\n"
12464 #: ../src/guestfs-actions.pod:4801
12466 "This command enables swap to a swap partition with the given UUID. See "
12467 "C<guestfs_swapon_device> for other notes."
12471 #: ../src/guestfs-actions.pod:4806
12472 msgid "guestfs_sync"
12476 #: ../src/guestfs-actions.pod:4808
12479 " int guestfs_sync (guestfs_h *g);\n"
12484 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3711
12486 "This syncs the disk, so that any writes are flushed through to the "
12487 "underlying disk image."
12491 #: ../src/guestfs-actions.pod:4813 ../fish/guestfish-actions.pod:3714
12493 "You should always call this if you have modified a disk image, before "
12494 "closing the handle."
12498 #: ../src/guestfs-actions.pod:4818
12499 msgid "guestfs_tail"
12503 #: ../src/guestfs-actions.pod:4820
12506 " char **guestfs_tail (guestfs_h *g,\n"
12507 "\t\tconst char *path);\n"
12512 #: ../src/guestfs-actions.pod:4823 ../fish/guestfish-actions.pod:3721
12514 "This command returns up to the last 10 lines of a file as a list of strings."
12518 #: ../src/guestfs-actions.pod:4833
12519 msgid "guestfs_tail_n"
12523 #: ../src/guestfs-actions.pod:4835
12526 " char **guestfs_tail_n (guestfs_h *g,\n"
12527 "\t\tint nrlines,\n"
12528 "\t\tconst char *path);\n"
12533 #: ../src/guestfs-actions.pod:4839 ../fish/guestfish-actions.pod:3731
12535 "If the parameter C<nrlines> is a positive number, this returns the last "
12536 "C<nrlines> lines of the file C<path>."
12540 #: ../src/guestfs-actions.pod:4842 ../fish/guestfish-actions.pod:3734
12542 "If the parameter C<nrlines> is a negative number, this returns lines from "
12543 "the file C<path>, starting with the C<-nrlines>th line."
12547 #: ../src/guestfs-actions.pod:4854
12548 msgid "guestfs_tar_in"
12552 #: ../src/guestfs-actions.pod:4856
12555 " int guestfs_tar_in (guestfs_h *g,\n"
12556 "\t\tconst char *tarfile,\n"
12557 "\t\tconst char *directory);\n"
12562 #: ../src/guestfs-actions.pod:4860 ../fish/guestfish-actions.pod:3746
12564 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12565 "tar file) into C<directory>."
12569 #: ../src/guestfs-actions.pod:4863
12571 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12575 #: ../src/guestfs-actions.pod:4868
12576 msgid "guestfs_tar_out"
12580 #: ../src/guestfs-actions.pod:4870
12583 " int guestfs_tar_out (guestfs_h *g,\n"
12584 "\t\tconst char *directory,\n"
12585 "\t\tconst char *tarfile);\n"
12590 #: ../src/guestfs-actions.pod:4874 ../fish/guestfish-actions.pod:3758
12592 "This command packs the contents of C<directory> and downloads it to local "
12597 #: ../src/guestfs-actions.pod:4877
12599 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12600 "C<guestfs_txz_out>."
12604 #: ../src/guestfs-actions.pod:4882
12605 msgid "guestfs_tgz_in"
12609 #: ../src/guestfs-actions.pod:4884
12612 " int guestfs_tgz_in (guestfs_h *g,\n"
12613 "\t\tconst char *tarball,\n"
12614 "\t\tconst char *directory);\n"
12619 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3770
12621 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12622 "tar file) into C<directory>."
12626 #: ../src/guestfs-actions.pod:4891
12627 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12631 #: ../src/guestfs-actions.pod:4895
12632 msgid "guestfs_tgz_out"
12636 #: ../src/guestfs-actions.pod:4897
12639 " int guestfs_tgz_out (guestfs_h *g,\n"
12640 "\t\tconst char *directory,\n"
12641 "\t\tconst char *tarball);\n"
12646 #: ../src/guestfs-actions.pod:4901 ../fish/guestfish-actions.pod:3781
12648 "This command packs the contents of C<directory> and downloads it to local "
12653 #: ../src/guestfs-actions.pod:4904
12654 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12658 #: ../src/guestfs-actions.pod:4908
12659 msgid "guestfs_touch"
12663 #: ../src/guestfs-actions.pod:4910
12666 " int guestfs_touch (guestfs_h *g,\n"
12667 "\t\tconst char *path);\n"
12672 #: ../src/guestfs-actions.pod:4913 ../fish/guestfish-actions.pod:3792
12674 "Touch acts like the L<touch(1)> command. It can be used to update the "
12675 "timestamps on a file, or, if the file does not exist, to create a new zero-"
12680 #: ../src/guestfs-actions.pod:4917 ../fish/guestfish-actions.pod:3796
12682 "This command only works on regular files, and will fail on other file types "
12683 "such as directories, symbolic links, block special etc."
12687 #: ../src/guestfs-actions.pod:4922
12688 msgid "guestfs_truncate"
12692 #: ../src/guestfs-actions.pod:4924
12695 " int guestfs_truncate (guestfs_h *g,\n"
12696 "\t\tconst char *path);\n"
12701 #: ../src/guestfs-actions.pod:4927 ../fish/guestfish-actions.pod:3803
12703 "This command truncates C<path> to a zero-length file. The file must exist "
12708 #: ../src/guestfs-actions.pod:4932
12709 msgid "guestfs_truncate_size"
12713 #: ../src/guestfs-actions.pod:4934
12716 " int guestfs_truncate_size (guestfs_h *g,\n"
12717 "\t\tconst char *path,\n"
12718 "\t\tint64_t size);\n"
12723 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3810
12725 "This command truncates C<path> to size C<size> bytes. The file must exist "
12730 #: ../src/guestfs-actions.pod:4941
12732 "If the current file size is less than C<size> then the file is extended to "
12733 "the required size with zero bytes. This creates a sparse file (ie. disk "
12734 "blocks are not allocated for the file until you write to it). To create a "
12735 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
12739 #: ../src/guestfs-actions.pod:4949
12740 msgid "guestfs_tune2fs_l"
12744 #: ../src/guestfs-actions.pod:4951
12747 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
12748 "\t\tconst char *device);\n"
12753 #: ../src/guestfs-actions.pod:4954 ../fish/guestfish-actions.pod:3823
12755 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
12760 #: ../src/guestfs-actions.pod:4957 ../fish/guestfish-actions.pod:3826
12762 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
12763 "for more details. The list of fields returned isn't clearly defined, and "
12764 "depends on both the version of C<tune2fs> that libguestfs was built against, "
12765 "and the filesystem itself."
12769 #: ../src/guestfs-actions.pod:4968
12770 msgid "guestfs_txz_in"
12774 #: ../src/guestfs-actions.pod:4970
12777 " int guestfs_txz_in (guestfs_h *g,\n"
12778 "\t\tconst char *tarball,\n"
12779 "\t\tconst char *directory);\n"
12784 #: ../src/guestfs-actions.pod:4974 ../fish/guestfish-actions.pod:3835
12786 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
12787 "tar file) into C<directory>."
12791 #: ../src/guestfs-actions.pod:4979
12792 msgid "guestfs_txz_out"
12796 #: ../src/guestfs-actions.pod:4981
12799 " int guestfs_txz_out (guestfs_h *g,\n"
12800 "\t\tconst char *directory,\n"
12801 "\t\tconst char *tarball);\n"
12806 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3844
12808 "This command packs the contents of C<directory> and downloads it to local "
12809 "file C<tarball> (as an xz compressed tar archive)."
12813 #: ../src/guestfs-actions.pod:4990
12814 msgid "guestfs_umask"
12818 #: ../src/guestfs-actions.pod:4992
12821 " int guestfs_umask (guestfs_h *g,\n"
12827 #: ../src/guestfs-actions.pod:4995 ../fish/guestfish-actions.pod:3853
12829 "This function sets the mask used for creating new files and device nodes to "
12834 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3856
12836 "Typical umask values would be C<022> which creates new files with "
12837 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
12838 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
12842 #: ../src/guestfs-actions.pod:5003 ../fish/guestfish-actions.pod:3861
12844 "The default umask is C<022>. This is important because it means that "
12845 "directories and device nodes will be created with C<0644> or C<0755> mode "
12846 "even if you specify C<0777>."
12850 #: ../src/guestfs-actions.pod:5007
12852 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
12853 "C<guestfs_mkdir>."
12857 #: ../src/guestfs-actions.pod:5010 ../fish/guestfish-actions.pod:3868
12858 msgid "This call returns the previous umask."
12862 #: ../src/guestfs-actions.pod:5014
12863 msgid "guestfs_umount"
12867 #: ../src/guestfs-actions.pod:5016
12870 " int guestfs_umount (guestfs_h *g,\n"
12871 "\t\tconst char *pathordevice);\n"
12876 #: ../src/guestfs-actions.pod:5019 ../fish/guestfish-actions.pod:3874
12878 "This unmounts the given filesystem. The filesystem may be specified either "
12879 "by its mountpoint (path) or the device which contains the filesystem."
12883 #: ../src/guestfs-actions.pod:5025
12884 msgid "guestfs_umount_all"
12888 #: ../src/guestfs-actions.pod:5027
12891 " int guestfs_umount_all (guestfs_h *g);\n"
12896 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3882
12897 msgid "This unmounts all mounted filesystems."
12901 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3884
12902 msgid "Some internal mounts are not unmounted by this call."
12906 #: ../src/guestfs-actions.pod:5035
12907 msgid "guestfs_upload"
12911 #: ../src/guestfs-actions.pod:5037
12914 " int guestfs_upload (guestfs_h *g,\n"
12915 "\t\tconst char *filename,\n"
12916 "\t\tconst char *remotefilename);\n"
12921 #: ../src/guestfs-actions.pod:5041 ../fish/guestfish-actions.pod:3890
12922 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
12926 #: ../src/guestfs-actions.pod:5046
12927 msgid "See also C<guestfs_download>."
12931 #: ../src/guestfs-actions.pod:5050
12932 msgid "guestfs_utimens"
12936 #: ../src/guestfs-actions.pod:5052
12939 " int guestfs_utimens (guestfs_h *g,\n"
12940 "\t\tconst char *path,\n"
12941 "\t\tint64_t atsecs,\n"
12942 "\t\tint64_t atnsecs,\n"
12943 "\t\tint64_t mtsecs,\n"
12944 "\t\tint64_t mtnsecs);\n"
12949 #: ../src/guestfs-actions.pod:5059 ../fish/guestfish-actions.pod:3903
12950 msgid "This command sets the timestamps of a file with nanosecond precision."
12954 #: ../src/guestfs-actions.pod:5062 ../fish/guestfish-actions.pod:3906
12956 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
12961 #: ../src/guestfs-actions.pod:5065 ../fish/guestfish-actions.pod:3909
12963 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
12964 "nanoseconds from the epoch."
12968 #: ../src/guestfs-actions.pod:5068 ../fish/guestfish-actions.pod:3912
12970 "If the C<*nsecs> field contains the special value C<-1> then the "
12971 "corresponding timestamp is set to the current time. (The C<*secs> field is "
12972 "ignored in this case)."
12976 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3916
12978 "If the C<*nsecs> field contains the special value C<-2> then the "
12979 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
12984 #: ../src/guestfs-actions.pod:5078 ../src/guestfs-structs.pod:175
12985 msgid "guestfs_version"
12989 #: ../src/guestfs-actions.pod:5080
12992 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
12997 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3924
12999 "Return the libguestfs version number that the program is linked against."
13003 #: ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3927
13005 "Note that because of dynamic linking this is not necessarily the version of "
13006 "libguestfs that you compiled against. You can compile the program, and then "
13007 "at runtime dynamically link against a completely different C<libguestfs.so> "
13012 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3932
13014 "This call was added in version C<1.0.58>. In previous versions of "
13015 "libguestfs there was no way to get the version number. From C code you can "
13016 "use dynamic linker functions to find out if this symbol exists (if it "
13017 "doesn't, then it's an earlier version)."
13021 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3938
13023 "The call returns a structure with four elements. The first three (C<major>, "
13024 "C<minor> and C<release>) are numbers and correspond to the usual version "
13025 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13026 "but may be used for distro-specific information."
13030 #: ../src/guestfs-actions.pod:5102 ../fish/guestfish-actions.pod:3944
13032 "To construct the original version string: C<$major.$minor.$release$extra>"
13036 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3947
13037 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13041 #: ../src/guestfs-actions.pod:5107
13043 "I<Note:> Don't use this call to test for availability of features. In "
13044 "enterprise distributions we backport features from later versions into "
13045 "earlier versions, making this an unreliable way to test for features. Use "
13046 "C<guestfs_available> instead."
13050 #: ../src/guestfs-actions.pod:5113
13052 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13053 "error. I<The caller must call C<guestfs_free_version> after use>."
13057 #: ../src/guestfs-actions.pod:5117
13058 msgid "guestfs_vfs_label"
13062 #: ../src/guestfs-actions.pod:5119
13065 " char *guestfs_vfs_label (guestfs_h *g,\n"
13066 "\t\tconst char *device);\n"
13071 #: ../src/guestfs-actions.pod:5122 ../fish/guestfish-actions.pod:3959
13072 msgid "This returns the filesystem label of the filesystem on C<device>."
13076 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3962
13077 msgid "If the filesystem is unlabeled, this returns the empty string."
13081 #: ../src/guestfs-actions.pod:5127
13082 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13086 #: ../src/guestfs-actions.pod:5132
13087 msgid "guestfs_vfs_type"
13091 #: ../src/guestfs-actions.pod:5134
13094 " char *guestfs_vfs_type (guestfs_h *g,\n"
13095 "\t\tconst char *device);\n"
13100 #: ../src/guestfs-actions.pod:5137 ../fish/guestfish-actions.pod:3970
13102 "This command gets the filesystem type corresponding to the filesystem on "
13107 #: ../src/guestfs-actions.pod:5140 ../fish/guestfish-actions.pod:3973
13109 "For most filesystems, the result is the name of the Linux VFS module which "
13110 "would be used to mount this filesystem if you mounted it without specifying "
13111 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13115 #: ../src/guestfs-actions.pod:5148
13116 msgid "guestfs_vfs_uuid"
13120 #: ../src/guestfs-actions.pod:5150
13123 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13124 "\t\tconst char *device);\n"
13129 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3982
13130 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13134 #: ../src/guestfs-actions.pod:5156 ../fish/guestfish-actions.pod:3985
13135 msgid "If the filesystem does not have a UUID, this returns the empty string."
13139 #: ../src/guestfs-actions.pod:5158
13140 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13144 #: ../src/guestfs-actions.pod:5163
13145 msgid "guestfs_vg_activate"
13149 #: ../src/guestfs-actions.pod:5165
13152 " int guestfs_vg_activate (guestfs_h *g,\n"
13153 "\t\tint activate,\n"
13154 "\t\tchar *const *volgroups);\n"
13159 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:3993
13161 "This command activates or (if C<activate> is false) deactivates all logical "
13162 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13163 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13164 "deactivated, then those devices disappear."
13168 #: ../src/guestfs-actions.pod:5175 ../fish/guestfish-actions.pod:3999
13169 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13173 #: ../src/guestfs-actions.pod:5177 ../fish/guestfish-actions.pod:4001
13175 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13176 "activated or deactivated."
13180 #: ../src/guestfs-actions.pod:5182
13181 msgid "guestfs_vg_activate_all"
13185 #: ../src/guestfs-actions.pod:5184
13188 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13189 "\t\tint activate);\n"
13194 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:4008
13196 "This command activates or (if C<activate> is false) deactivates all logical "
13197 "volumes in all volume groups. If activated, then they are made known to the "
13198 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13199 "those devices disappear."
13203 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:4014
13204 msgid "This command is the same as running C<vgchange -a y|n>"
13208 #: ../src/guestfs-actions.pod:5197
13209 msgid "guestfs_vgcreate"
13213 #: ../src/guestfs-actions.pod:5199
13216 " int guestfs_vgcreate (guestfs_h *g,\n"
13217 "\t\tconst char *volgroup,\n"
13218 "\t\tchar *const *physvols);\n"
13223 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:4020
13225 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13226 "of physical volumes C<physvols>."
13230 #: ../src/guestfs-actions.pod:5208
13231 msgid "guestfs_vglvuuids"
13235 #: ../src/guestfs-actions.pod:5210
13238 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13239 "\t\tconst char *vgname);\n"
13244 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:4027
13246 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13247 "volumes created in this volume group."
13251 #: ../src/guestfs-actions.pod:5216
13253 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13254 "associate logical volumes and volume groups."
13258 #: ../src/guestfs-actions.pod:5219
13259 msgid "See also C<guestfs_vgpvuuids>."
13263 #: ../src/guestfs-actions.pod:5225
13264 msgid "guestfs_vgpvuuids"
13268 #: ../src/guestfs-actions.pod:5227
13271 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13272 "\t\tconst char *vgname);\n"
13277 #: ../src/guestfs-actions.pod:5230 ../fish/guestfish-actions.pod:4039
13279 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13280 "volumes that this volume group resides on."
13284 #: ../src/guestfs-actions.pod:5233
13286 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13287 "associate physical volumes and volume groups."
13291 #: ../src/guestfs-actions.pod:5236
13292 msgid "See also C<guestfs_vglvuuids>."
13296 #: ../src/guestfs-actions.pod:5242
13297 msgid "guestfs_vgremove"
13301 #: ../src/guestfs-actions.pod:5244
13304 " int guestfs_vgremove (guestfs_h *g,\n"
13305 "\t\tconst char *vgname);\n"
13310 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:4051
13311 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13315 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:4053
13317 "This also forcibly removes all logical volumes in the volume group (if any)."
13321 #: ../src/guestfs-actions.pod:5254
13322 msgid "guestfs_vgrename"
13326 #: ../src/guestfs-actions.pod:5256
13329 " int guestfs_vgrename (guestfs_h *g,\n"
13330 "\t\tconst char *volgroup,\n"
13331 "\t\tconst char *newvolgroup);\n"
13336 #: ../src/guestfs-actions.pod:5260 ../fish/guestfish-actions.pod:4060
13337 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
13341 #: ../src/guestfs-actions.pod:5264
13342 msgid "guestfs_vgs"
13346 #: ../src/guestfs-actions.pod:5266
13349 " char **guestfs_vgs (guestfs_h *g);\n"
13354 #: ../src/guestfs-actions.pod:5268 ../fish/guestfish-actions.pod:4066
13356 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
13361 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:4069
13363 "This returns a list of just the volume group names that were detected (eg. "
13368 #: ../src/guestfs-actions.pod:5274
13369 msgid "See also C<guestfs_vgs_full>."
13373 #: ../src/guestfs-actions.pod:5280
13374 msgid "guestfs_vgs_full"
13378 #: ../src/guestfs-actions.pod:5282
13381 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13386 #: ../src/guestfs-actions.pod:5284 ../fish/guestfish-actions.pod:4078
13388 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
13389 "> command. The \"full\" version includes all fields."
13393 #: ../src/guestfs-actions.pod:5287
13395 "This function returns a C<struct guestfs_lvm_vg_list *> (see E<lt>guestfs-"
13396 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
13397 "C<guestfs_free_lvm_vg_list> after use>."
13401 #: ../src/guestfs-actions.pod:5292
13402 msgid "guestfs_vgscan"
13406 #: ../src/guestfs-actions.pod:5294
13409 " int guestfs_vgscan (guestfs_h *g);\n"
13414 #: ../src/guestfs-actions.pod:5296 ../fish/guestfish-actions.pod:4085
13416 "This rescans all block devices and rebuilds the list of LVM physical "
13417 "volumes, volume groups and logical volumes."
13421 #: ../src/guestfs-actions.pod:5301
13422 msgid "guestfs_vguuid"
13426 #: ../src/guestfs-actions.pod:5303
13429 " char *guestfs_vguuid (guestfs_h *g,\n"
13430 "\t\tconst char *vgname);\n"
13435 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:4092
13436 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13440 #: ../src/guestfs-actions.pod:5311
13441 msgid "guestfs_wait_ready"
13445 #: ../src/guestfs-actions.pod:5313
13448 " int guestfs_wait_ready (guestfs_h *g);\n"
13453 #: ../src/guestfs-actions.pod:5315
13454 msgid "This function is a no op."
13458 #: ../src/guestfs-actions.pod:5317
13460 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13461 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13462 "is no longer necessary because C<guestfs_launch> now does the waiting."
13466 #: ../src/guestfs-actions.pod:5322
13468 "If you see any calls to this function in code then you can just remove them, "
13469 "unless you want to retain compatibility with older versions of the API."
13473 #: ../src/guestfs-actions.pod:5328
13474 msgid "guestfs_wc_c"
13478 #: ../src/guestfs-actions.pod:5330
13481 " int guestfs_wc_c (guestfs_h *g,\n"
13482 "\t\tconst char *path);\n"
13487 #: ../src/guestfs-actions.pod:5333 ../fish/guestfish-actions.pod:4098
13489 "This command counts the characters in a file, using the C<wc -c> external "
13494 #: ../src/guestfs-actions.pod:5338
13495 msgid "guestfs_wc_l"
13499 #: ../src/guestfs-actions.pod:5340
13502 " int guestfs_wc_l (guestfs_h *g,\n"
13503 "\t\tconst char *path);\n"
13508 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4105
13510 "This command counts the lines in a file, using the C<wc -l> external command."
13514 #: ../src/guestfs-actions.pod:5348
13515 msgid "guestfs_wc_w"
13519 #: ../src/guestfs-actions.pod:5350
13522 " int guestfs_wc_w (guestfs_h *g,\n"
13523 "\t\tconst char *path);\n"
13528 #: ../src/guestfs-actions.pod:5353 ../fish/guestfish-actions.pod:4112
13530 "This command counts the words in a file, using the C<wc -w> external command."
13534 #: ../src/guestfs-actions.pod:5358
13535 msgid "guestfs_write"
13539 #: ../src/guestfs-actions.pod:5360
13542 " int guestfs_write (guestfs_h *g,\n"
13543 "\t\tconst char *path,\n"
13544 "\t\tconst char *content,\n"
13545 "\t\tsize_t content_size);\n"
13550 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:4119
13552 "This call creates a file called C<path>. The content of the file is the "
13553 "string C<content> (which can contain any 8 bit data)."
13557 #: ../src/guestfs-actions.pod:5373
13558 msgid "guestfs_write_file"
13562 #: ../src/guestfs-actions.pod:5375
13565 " int guestfs_write_file (guestfs_h *g,\n"
13566 "\t\tconst char *path,\n"
13567 "\t\tconst char *content,\n"
13573 #: ../src/guestfs-actions.pod:5380 ../fish/guestfish-actions.pod:4129
13575 "This call creates a file called C<path>. The contents of the file is the "
13576 "string C<content> (which can contain any 8 bit data), with length C<size>."
13580 #: ../src/guestfs-actions.pod:5384 ../fish/guestfish-actions.pod:4133
13582 "As a special case, if C<size> is C<0> then the length is calculated using "
13583 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13587 #: ../src/guestfs-actions.pod:5388 ../fish/guestfish-actions.pod:4137
13589 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13590 "I<not> work, even if the length is specified."
13594 #: ../src/guestfs-actions.pod:5396 ../fish/guestfish-actions.pod:4143
13596 "This function is deprecated. In new code, use the C<write> call instead."
13600 #: ../src/guestfs-actions.pod:5403
13601 msgid "guestfs_zegrep"
13605 #: ../src/guestfs-actions.pod:5405
13608 " char **guestfs_zegrep (guestfs_h *g,\n"
13609 "\t\tconst char *regex,\n"
13610 "\t\tconst char *path);\n"
13615 #: ../src/guestfs-actions.pod:5409 ../fish/guestfish-actions.pod:4154
13617 "This calls the external C<zegrep> program and returns the matching lines."
13621 #: ../src/guestfs-actions.pod:5419
13622 msgid "guestfs_zegrepi"
13626 #: ../src/guestfs-actions.pod:5421
13629 " char **guestfs_zegrepi (guestfs_h *g,\n"
13630 "\t\tconst char *regex,\n"
13631 "\t\tconst char *path);\n"
13636 #: ../src/guestfs-actions.pod:5425 ../fish/guestfish-actions.pod:4164
13638 "This calls the external C<zegrep -i> program and returns the matching lines."
13642 #: ../src/guestfs-actions.pod:5435
13643 msgid "guestfs_zero"
13647 #: ../src/guestfs-actions.pod:5437
13650 " int guestfs_zero (guestfs_h *g,\n"
13651 "\t\tconst char *device);\n"
13656 #: ../src/guestfs-actions.pod:5440 ../fish/guestfish-actions.pod:4174
13657 msgid "This command writes zeroes over the first few blocks of C<device>."
13661 #: ../src/guestfs-actions.pod:5442 ../fish/guestfish-actions.pod:4176
13663 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13664 "securely wipe the device). It should be sufficient to remove any partition "
13665 "tables, filesystem superblocks and so on."
13669 #: ../src/guestfs-actions.pod:5446
13670 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13674 #: ../src/guestfs-actions.pod:5455
13675 msgid "guestfs_zero_device"
13679 #: ../src/guestfs-actions.pod:5457
13682 " int guestfs_zero_device (guestfs_h *g,\n"
13683 "\t\tconst char *device);\n"
13688 #: ../src/guestfs-actions.pod:5460
13690 "This command writes zeroes over the entire C<device>. Compare with "
13691 "C<guestfs_zero> which just zeroes the first few blocks of a device."
13695 #: ../src/guestfs-actions.pod:5474
13696 msgid "guestfs_zerofree"
13700 #: ../src/guestfs-actions.pod:5476
13703 " int guestfs_zerofree (guestfs_h *g,\n"
13704 "\t\tconst char *device);\n"
13709 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:4197
13711 "This runs the I<zerofree> program on C<device>. This program claims to zero "
13712 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
13713 "possible to compress the filesystem more effectively."
13717 #: ../src/guestfs-actions.pod:5484 ../fish/guestfish-actions.pod:4202
13718 msgid "You should B<not> run this program if the filesystem is mounted."
13722 #: ../src/guestfs-actions.pod:5487 ../fish/guestfish-actions.pod:4205
13724 "It is possible that using this program can damage the filesystem or data on "
13729 #: ../src/guestfs-actions.pod:5492
13730 msgid "guestfs_zfgrep"
13734 #: ../src/guestfs-actions.pod:5494
13737 " char **guestfs_zfgrep (guestfs_h *g,\n"
13738 "\t\tconst char *pattern,\n"
13739 "\t\tconst char *path);\n"
13744 #: ../src/guestfs-actions.pod:5498 ../fish/guestfish-actions.pod:4212
13746 "This calls the external C<zfgrep> program and returns the matching lines."
13750 #: ../src/guestfs-actions.pod:5508
13751 msgid "guestfs_zfgrepi"
13755 #: ../src/guestfs-actions.pod:5510
13758 " char **guestfs_zfgrepi (guestfs_h *g,\n"
13759 "\t\tconst char *pattern,\n"
13760 "\t\tconst char *path);\n"
13765 #: ../src/guestfs-actions.pod:5514 ../fish/guestfish-actions.pod:4222
13767 "This calls the external C<zfgrep -i> program and returns the matching lines."
13771 #: ../src/guestfs-actions.pod:5524
13772 msgid "guestfs_zfile"
13776 #: ../src/guestfs-actions.pod:5526
13779 " char *guestfs_zfile (guestfs_h *g,\n"
13780 "\t\tconst char *meth,\n"
13781 "\t\tconst char *path);\n"
13786 #: ../src/guestfs-actions.pod:5530 ../fish/guestfish-actions.pod:4232
13788 "This command runs C<file> after first decompressing C<path> using C<method>."
13792 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:4235
13793 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
13797 #: ../src/guestfs-actions.pod:5535
13799 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
13804 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:4240
13806 "This function is deprecated. In new code, use the C<file> call instead."
13810 #: ../src/guestfs-actions.pod:5548
13811 msgid "guestfs_zgrep"
13815 #: ../src/guestfs-actions.pod:5550
13818 " char **guestfs_zgrep (guestfs_h *g,\n"
13819 "\t\tconst char *regex,\n"
13820 "\t\tconst char *path);\n"
13825 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:4251
13827 "This calls the external C<zgrep> program and returns the matching lines."
13831 #: ../src/guestfs-actions.pod:5564
13832 msgid "guestfs_zgrepi"
13836 #: ../src/guestfs-actions.pod:5566
13839 " char **guestfs_zgrepi (guestfs_h *g,\n"
13840 "\t\tconst char *regex,\n"
13841 "\t\tconst char *path);\n"
13846 #: ../src/guestfs-actions.pod:5570 ../fish/guestfish-actions.pod:4261
13848 "This calls the external C<zgrep -i> program and returns the matching lines."
13852 #: ../src/guestfs-availability.pod:3
13857 #: ../src/guestfs-availability.pod:5
13859 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
13860 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
13861 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
13862 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
13863 "L</guestfs_aug_save> L</guestfs_aug_set>"
13867 #: ../src/guestfs-availability.pod:21
13872 #: ../src/guestfs-availability.pod:23
13874 "The following functions: L</guestfs_inotify_add_watch> L</"
13875 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
13876 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
13880 #: ../src/guestfs-availability.pod:31
13881 msgid "B<linuxfsuuid>"
13885 #: ../src/guestfs-availability.pod:33
13887 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
13888 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
13892 #: ../src/guestfs-availability.pod:40
13893 msgid "B<linuxmodules>"
13897 #: ../src/guestfs-availability.pod:42
13898 msgid "The following functions: L</guestfs_modprobe>"
13902 #: ../src/guestfs-availability.pod:45
13903 msgid "B<linuxxattrs>"
13907 #: ../src/guestfs-availability.pod:47
13909 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
13910 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
13911 "guestfs_removexattr> L</guestfs_setxattr>"
13915 #: ../src/guestfs-availability.pod:56
13920 #: ../src/guestfs-availability.pod:58
13922 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
13923 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
13924 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
13928 #: ../src/guestfs-availability.pod:67
13933 #: ../src/guestfs-availability.pod:69
13935 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
13936 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
13937 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
13938 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
13939 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
13940 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
13941 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
13945 #: ../src/guestfs-availability.pod:92
13950 #: ../src/guestfs-availability.pod:94
13952 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
13953 "guestfs_mknod_b> L</guestfs_mknod_c>"
13957 #: ../src/guestfs-availability.pod:100
13962 #: ../src/guestfs-availability.pod:102
13963 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
13967 #: ../src/guestfs-availability.pod:105
13968 msgid "B<ntfsprogs>"
13972 #: ../src/guestfs-availability.pod:107
13974 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
13978 #: ../src/guestfs-availability.pod:111
13979 msgid "B<realpath>"
13983 #: ../src/guestfs-availability.pod:113
13984 msgid "The following functions: L</guestfs_realpath>"
13988 #: ../src/guestfs-availability.pod:116
13993 #: ../src/guestfs-availability.pod:118
13995 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
13996 "guestfs_scrub_freespace>"
14000 #: ../src/guestfs-availability.pod:123
14005 #: ../src/guestfs-availability.pod:125
14006 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14010 #: ../src/guestfs-availability.pod:129
14015 #: ../src/guestfs-availability.pod:131
14016 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14020 #: ../src/guestfs-availability.pod:135
14021 msgid "B<zerofree>"
14025 #: ../src/guestfs-availability.pod:137
14026 msgid "The following functions: L</guestfs_zerofree>"
14030 #: ../src/guestfs-structs.pod:1
14031 msgid "guestfs_int_bool"
14035 #: ../src/guestfs-structs.pod:3
14038 " struct guestfs_int_bool {\n"
14046 #: ../src/guestfs-structs.pod:8
14049 " struct guestfs_int_bool_list {\n"
14050 " uint32_t len; /* Number of elements in list. */\n"
14051 " struct guestfs_int_bool *val; /* Elements. */\n"
14057 #: ../src/guestfs-structs.pod:13
14060 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14061 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14066 #: ../src/guestfs-structs.pod:16
14067 msgid "guestfs_lvm_pv"
14071 #: ../src/guestfs-structs.pod:18
14074 " struct guestfs_lvm_pv {\n"
14075 " char *pv_name;\n"
14076 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14077 " char pv_uuid[32];\n"
14079 " uint64_t pv_size;\n"
14080 " uint64_t dev_size;\n"
14081 " uint64_t pv_free;\n"
14082 " uint64_t pv_used;\n"
14083 " char *pv_attr;\n"
14084 " int64_t pv_pe_count;\n"
14085 " int64_t pv_pe_alloc_count;\n"
14086 " char *pv_tags;\n"
14087 " uint64_t pe_start;\n"
14088 " int64_t pv_mda_count;\n"
14089 " uint64_t pv_mda_free;\n"
14095 #: ../src/guestfs-structs.pod:36
14098 " struct guestfs_lvm_pv_list {\n"
14099 " uint32_t len; /* Number of elements in list. */\n"
14100 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14106 #: ../src/guestfs-structs.pod:41
14109 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14110 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14115 #: ../src/guestfs-structs.pod:44
14116 msgid "guestfs_lvm_vg"
14120 #: ../src/guestfs-structs.pod:46
14123 " struct guestfs_lvm_vg {\n"
14124 " char *vg_name;\n"
14125 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14126 " char vg_uuid[32];\n"
14128 " char *vg_attr;\n"
14129 " uint64_t vg_size;\n"
14130 " uint64_t vg_free;\n"
14131 " char *vg_sysid;\n"
14132 " uint64_t vg_extent_size;\n"
14133 " int64_t vg_extent_count;\n"
14134 " int64_t vg_free_count;\n"
14135 " int64_t max_lv;\n"
14136 " int64_t max_pv;\n"
14137 " int64_t pv_count;\n"
14138 " int64_t lv_count;\n"
14139 " int64_t snap_count;\n"
14140 " int64_t vg_seqno;\n"
14141 " char *vg_tags;\n"
14142 " int64_t vg_mda_count;\n"
14143 " uint64_t vg_mda_free;\n"
14149 #: ../src/guestfs-structs.pod:69
14152 " struct guestfs_lvm_vg_list {\n"
14153 " uint32_t len; /* Number of elements in list. */\n"
14154 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14160 #: ../src/guestfs-structs.pod:74
14163 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14164 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14169 #: ../src/guestfs-structs.pod:77
14170 msgid "guestfs_lvm_lv"
14174 #: ../src/guestfs-structs.pod:79
14177 " struct guestfs_lvm_lv {\n"
14178 " char *lv_name;\n"
14179 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14180 " char lv_uuid[32];\n"
14181 " char *lv_attr;\n"
14182 " int64_t lv_major;\n"
14183 " int64_t lv_minor;\n"
14184 " int64_t lv_kernel_major;\n"
14185 " int64_t lv_kernel_minor;\n"
14186 " uint64_t lv_size;\n"
14187 " int64_t seg_count;\n"
14189 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14190 " float snap_percent;\n"
14191 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14192 " float copy_percent;\n"
14193 " char *move_pv;\n"
14194 " char *lv_tags;\n"
14195 " char *mirror_log;\n"
14196 " char *modules;\n"
14202 #: ../src/guestfs-structs.pod:101
14205 " struct guestfs_lvm_lv_list {\n"
14206 " uint32_t len; /* Number of elements in list. */\n"
14207 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14213 #: ../src/guestfs-structs.pod:106
14216 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14217 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14222 #: ../src/guestfs-structs.pod:111
14225 " struct guestfs_stat {\n"
14229 " int64_t nlink;\n"
14234 " int64_t blksize;\n"
14235 " int64_t blocks;\n"
14236 " int64_t atime;\n"
14237 " int64_t mtime;\n"
14238 " int64_t ctime;\n"
14244 #: ../src/guestfs-structs.pod:127
14247 " struct guestfs_stat_list {\n"
14248 " uint32_t len; /* Number of elements in list. */\n"
14249 " struct guestfs_stat *val; /* Elements. */\n"
14255 #: ../src/guestfs-structs.pod:132
14258 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14259 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14264 #: ../src/guestfs-structs.pod:137
14267 " struct guestfs_statvfs {\n"
14268 " int64_t bsize;\n"
14269 " int64_t frsize;\n"
14270 " int64_t blocks;\n"
14271 " int64_t bfree;\n"
14272 " int64_t bavail;\n"
14273 " int64_t files;\n"
14274 " int64_t ffree;\n"
14275 " int64_t favail;\n"
14278 " int64_t namemax;\n"
14284 #: ../src/guestfs-structs.pod:151
14287 " struct guestfs_statvfs_list {\n"
14288 " uint32_t len; /* Number of elements in list. */\n"
14289 " struct guestfs_statvfs *val; /* Elements. */\n"
14295 #: ../src/guestfs-structs.pod:156
14298 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14299 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14304 #: ../src/guestfs-structs.pod:159
14305 msgid "guestfs_dirent"
14309 #: ../src/guestfs-structs.pod:161
14312 " struct guestfs_dirent {\n"
14321 #: ../src/guestfs-structs.pod:167
14324 " struct guestfs_dirent_list {\n"
14325 " uint32_t len; /* Number of elements in list. */\n"
14326 " struct guestfs_dirent *val; /* Elements. */\n"
14332 #: ../src/guestfs-structs.pod:172
14335 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
14336 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
14341 #: ../src/guestfs-structs.pod:177
14344 " struct guestfs_version {\n"
14345 " int64_t major;\n"
14346 " int64_t minor;\n"
14347 " int64_t release;\n"
14354 #: ../src/guestfs-structs.pod:184
14357 " struct guestfs_version_list {\n"
14358 " uint32_t len; /* Number of elements in list. */\n"
14359 " struct guestfs_version *val; /* Elements. */\n"
14365 #: ../src/guestfs-structs.pod:189
14368 " void guestfs_free_version (struct guestfs_free_version *);\n"
14369 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14374 #: ../src/guestfs-structs.pod:192
14375 msgid "guestfs_xattr"
14379 #: ../src/guestfs-structs.pod:194
14382 " struct guestfs_xattr {\n"
14383 " char *attrname;\n"
14384 " /* The next two fields describe a byte array. */\n"
14385 " uint32_t attrval_len;\n"
14386 " char *attrval;\n"
14392 #: ../src/guestfs-structs.pod:201
14395 " struct guestfs_xattr_list {\n"
14396 " uint32_t len; /* Number of elements in list. */\n"
14397 " struct guestfs_xattr *val; /* Elements. */\n"
14403 #: ../src/guestfs-structs.pod:206
14406 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14407 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14412 #: ../src/guestfs-structs.pod:209
14413 msgid "guestfs_inotify_event"
14417 #: ../src/guestfs-structs.pod:211
14420 " struct guestfs_inotify_event {\n"
14421 " int64_t in_wd;\n"
14422 " uint32_t in_mask;\n"
14423 " uint32_t in_cookie;\n"
14424 " char *in_name;\n"
14430 #: ../src/guestfs-structs.pod:218
14433 " struct guestfs_inotify_event_list {\n"
14434 " uint32_t len; /* Number of elements in list. */\n"
14435 " struct guestfs_inotify_event *val; /* Elements. */\n"
14441 #: ../src/guestfs-structs.pod:223
14444 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14445 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
14450 #: ../src/guestfs-structs.pod:226
14451 msgid "guestfs_partition"
14455 #: ../src/guestfs-structs.pod:228
14458 " struct guestfs_partition {\n"
14459 " int32_t part_num;\n"
14460 " uint64_t part_start;\n"
14461 " uint64_t part_end;\n"
14462 " uint64_t part_size;\n"
14468 #: ../src/guestfs-structs.pod:235
14471 " struct guestfs_partition_list {\n"
14472 " uint32_t len; /* Number of elements in list. */\n"
14473 " struct guestfs_partition *val; /* Elements. */\n"
14479 #: ../src/guestfs-structs.pod:240
14482 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14483 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14488 #: ../fish/guestfish.pod:5
14489 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14493 #: ../fish/guestfish.pod:9
14496 " guestfish [--options] [commands]\n"
14501 #: ../fish/guestfish.pod:11
14509 #: ../fish/guestfish.pod:13
14512 " guestfish -a disk.img\n"
14517 #: ../fish/guestfish.pod:15
14520 " guestfish -a disk.img -m dev[:mountpoint]\n"
14525 #: ../fish/guestfish.pod:17
14528 " guestfish -d libvirt-domain\n"
14533 #: ../fish/guestfish.pod:19
14536 " guestfish -a disk.img -i\n"
14541 #: ../fish/guestfish.pod:21
14544 " guestfish -d libvirt-domain -i\n"
14549 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:11 ../tools/virt-edit.pl:45
14550 #: ../tools/virt-rescue.pl:41 ../tools/virt-tar.pl:60
14551 #: ../tools/virt-win-reg.pl:52
14556 #: ../fish/guestfish.pod:25
14558 "Using guestfish in read/write mode on live virtual machines can be "
14559 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14560 "option to use guestfish safely if the disk image or virtual machine might be "
14565 #: ../fish/guestfish.pod:30 ../fish/guestfish.pod:729
14566 #: ../fuse/guestmount.pod:35 ../tools/virt-cat.pl:51 ../tools/virt-edit.pl:59
14567 #: ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:46
14572 #: ../fish/guestfish.pod:32
14573 msgid "As an interactive shell"
14577 #: ../fish/guestfish.pod:34
14585 #: ../fish/guestfish.pod:36
14588 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14589 " editing virtual machine filesystems.\n"
14594 #: ../fish/guestfish.pod:39
14597 " Type: 'help' for a list of commands\n"
14598 " 'man' to read the manual\n"
14599 " 'quit' to quit the shell\n"
14604 #: ../fish/guestfish.pod:43
14612 #: ../fish/guestfish.pod:45
14613 msgid "From shell scripts"
14617 #: ../fish/guestfish.pod:47
14618 msgid "Create a new C</etc/motd> file in a guest:"
14622 #: ../fish/guestfish.pod:49
14625 " guestfish <<_EOF_\n"
14628 " mount /dev/vg_guest/lv_root /\n"
14629 " write /etc/motd \"Welcome, new users\"\n"
14635 #: ../fish/guestfish.pod:56
14636 msgid "List the LVM logical volumes in a guest:"
14640 #: ../fish/guestfish.pod:58
14643 " guestfish -a disk.img --ro <<_EOF_\n"
14651 #: ../fish/guestfish.pod:63
14652 msgid "On one command line"
14656 #: ../fish/guestfish.pod:65
14657 msgid "Update C</etc/resolv.conf> in a guest:"
14661 #: ../fish/guestfish.pod:67
14665 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
14666 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
14671 #: ../fish/guestfish.pod:71
14672 msgid "Edit C</boot/grub/grub.conf> interactively:"
14676 #: ../fish/guestfish.pod:73
14679 " guestfish --add disk.img \\\n"
14680 " --mount /dev/vg_guest/lv_root \\\n"
14681 " --mount /dev/sda1:/boot \\\n"
14682 " edit /boot/grub/grub.conf\n"
14687 #: ../fish/guestfish.pod:78
14688 msgid "Mount disks automatically"
14692 #: ../fish/guestfish.pod:80
14694 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
14698 #: ../fish/guestfish.pod:83
14701 " guestfish --ro -a disk.img -i cat /etc/group\n"
14706 #: ../fish/guestfish.pod:85
14709 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
14714 #: ../fish/guestfish.pod:87
14715 msgid "As a script interpreter"
14719 #: ../fish/guestfish.pod:89
14720 msgid "Create a 100MB disk containing an ext2-formatted partition:"
14724 #: ../fish/guestfish.pod:91
14727 " #!/usr/bin/guestfish -f\n"
14728 " sparse test1.img 100M\n"
14730 " part-disk /dev/sda mbr\n"
14731 " mkfs ext2 /dev/sda1\n"
14736 #: ../fish/guestfish.pod:97
14737 msgid "Start with a prepared disk"
14741 #: ../fish/guestfish.pod:99
14743 "An alternate way to create a 100MB disk called C<test1.img> containing a "
14744 "single ext2-formatted partition:"
14748 #: ../fish/guestfish.pod:102
14751 " guestfish -N fs\n"
14756 #: ../fish/guestfish.pod:104
14757 msgid "To list what is available do:"
14761 #: ../fish/guestfish.pod:106 ../fish/guestfish.pod:720
14764 " guestfish -N help | less\n"
14769 #: ../fish/guestfish.pod:108
14770 msgid "Remote control"
14774 #: ../fish/guestfish.pod:110
14777 " eval `guestfish --listen --ro`\n"
14778 " guestfish --remote add disk.img\n"
14779 " guestfish --remote run\n"
14780 " guestfish --remote lvs\n"
14785 #: ../fish/guestfish.pod:117
14787 "Guestfish is a shell and command-line tool for examining and modifying "
14788 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14789 "functionality of the guestfs API, see L<guestfs(3)>."
14793 #: ../fish/guestfish.pod:121
14795 "Guestfish gives you structured access to the libguestfs API, from shell "
14796 "scripts or the command line or interactively. If you want to rescue a "
14797 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14802 #: ../fish/guestfish.pod:126 ../test-tool/libguestfs-test-tool.pod:37
14803 #: ../fuse/guestmount.pod:70 ../inspector/virt-inspector.pl:75
14804 #: ../tools/virt-cat.pl:80 ../tools/virt-df.pl:71 ../tools/virt-edit.pl:73
14805 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-list-partitions.pl:51
14806 #: ../tools/virt-ls.pl:79 ../tools/virt-make-fs.pl:153
14807 #: ../tools/virt-rescue.pl:103 ../tools/virt-resize.pl:233
14808 #: ../tools/virt-tar.pl:99 ../tools/virt-win-reg.pl:172
14813 #: ../fish/guestfish.pod:130 ../fuse/guestmount.pod:94
14814 #: ../inspector/virt-inspector.pl:83 ../tools/virt-cat.pl:88
14815 #: ../tools/virt-df.pl:79 ../tools/virt-edit.pl:81
14816 #: ../tools/virt-list-filesystems.pl:58 ../tools/virt-list-partitions.pl:59
14817 #: ../tools/virt-ls.pl:87 ../tools/virt-make-fs.pl:161
14818 #: ../tools/virt-rescue.pl:111 ../tools/virt-resize.pl:241
14819 #: ../tools/virt-tar.pl:107 ../tools/virt-win-reg.pl:180
14824 #: ../fish/guestfish.pod:132
14825 msgid "Displays general help on options."
14829 #: ../fish/guestfish.pod:134
14830 msgid "B<-h> | B<--cmd-help>"
14834 #: ../fish/guestfish.pod:136
14835 msgid "Lists all available guestfish commands."
14839 #: ../fish/guestfish.pod:138
14840 msgid "B<-h cmd> | B<--cmd-help cmd>"
14844 #: ../fish/guestfish.pod:140
14845 msgid "Displays detailed help on a single command C<cmd>."
14849 #: ../fish/guestfish.pod:142 ../fuse/guestmount.pod:74
14850 msgid "B<-a image> | B<--add image>"
14854 #: ../fish/guestfish.pod:144
14855 msgid "Add a block device or virtual machine image to the shell."
14859 #: ../fish/guestfish.pod:146
14860 msgid "B<-c URI> | B<--connect URI>"
14864 #: ../fish/guestfish.pod:148
14866 "When used in conjunction with the I<-d> option, this specifies the libvirt "
14867 "URI to use. The default is to use the default libvirt connection."
14871 #: ../fish/guestfish.pod:152
14872 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
14876 #: ../fish/guestfish.pod:154
14878 "Add disks from the named libvirt domain. If the I<--ro> option is also "
14879 "used, then any libvirt domain can be used. However in write mode, only "
14880 "libvirt domains which are shut down can be named here."
14884 #: ../fish/guestfish.pod:158
14885 msgid "B<-D> | B<--no-dest-paths>"
14889 #: ../fish/guestfish.pod:160
14891 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
14892 "to hit the tab key to complete paths on the guest filesystem, but this "
14893 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
14894 "allow this feature to be disabled."
14898 #: ../fish/guestfish.pod:165
14899 msgid "B<-f file> | B<--file file>"
14903 #: ../fish/guestfish.pod:167
14904 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
14908 #: ../fish/guestfish.pod:170
14911 " #!/usr/bin/guestfish -f\n"
14916 #: ../fish/guestfish.pod:172
14917 msgid "B<-i> | B<--inspector>"
14921 #: ../fish/guestfish.pod:174
14923 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
14924 "system and mount filesystems as they would be mounted on the real virtual "
14929 #: ../fish/guestfish.pod:178
14930 msgid "Typical usage is either:"
14934 #: ../fish/guestfish.pod:180
14937 " guestfish -d myguest -i\n"
14942 #: ../fish/guestfish.pod:182
14943 msgid "(for an inactive libvirt domain called I<myguest>), or:"
14947 #: ../fish/guestfish.pod:184
14950 " guestfish --ro -d myguest -i\n"
14955 #: ../fish/guestfish.pod:186
14956 msgid "(for active domains, readonly), or specify the block device directly:"
14960 #: ../fish/guestfish.pod:188
14963 " guestfish -a /dev/Guests/MyGuest -i\n"
14968 #: ../fish/guestfish.pod:190
14970 "Note that the command line syntax changed slightly over older versions of "
14971 "guestfish. You can still use the old syntax:"
14975 #: ../fish/guestfish.pod:193
14978 " guestfish [--ro] -i disk.img\n"
14983 #: ../fish/guestfish.pod:195
14986 " guestfish [--ro] -i libvirt-domain\n"
14991 #: ../fish/guestfish.pod:197
14992 msgid "B<--keys-from-stdin>"
14996 #: ../fish/guestfish.pod:199
14998 "Read key or passphrase parameters from stdin. The default is to try to read "
14999 "passphrases from the user by opening C</dev/tty>."
15003 #: ../fish/guestfish.pod:202
15004 msgid "B<--listen>"
15008 #: ../fish/guestfish.pod:204
15010 "Fork into the background and listen for remote commands. See section L</"
15011 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15015 #: ../fish/guestfish.pod:207
15016 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15020 #: ../fish/guestfish.pod:209
15021 msgid "Mount the named partition or logical volume on the given mountpoint."
15025 #: ../fish/guestfish.pod:211
15026 msgid "If the mountpoint is omitted, it defaults to C</>."
15030 #: ../fish/guestfish.pod:213
15031 msgid "You have to mount something on C</> before most commands will work."
15035 #: ../fish/guestfish.pod:215
15037 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15042 #: ../fish/guestfish.pod:218
15044 "If you don't know what filesystems a disk image contains, you can either run "
15045 "guestfish without this option, then list the partitions and LVs available "
15046 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
15047 "list-filesystems(1)> program."
15051 #: ../fish/guestfish.pod:223 ../fuse/guestmount.pod:106
15052 msgid "B<-n> | B<--no-sync>"
15056 #: ../fish/guestfish.pod:225
15058 "Disable autosync. This is enabled by default. See the discussion of "
15059 "autosync in the L<guestfs(3)> manpage."
15063 #: ../fish/guestfish.pod:228
15064 msgid "B<-N type> | B<--new type> | B<-N help>"
15068 #: ../fish/guestfish.pod:230
15070 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15071 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15072 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15077 #: ../fish/guestfish.pod:235
15078 msgid "B<--progress-bars>"
15082 #: ../fish/guestfish.pod:237
15083 msgid "Enable progress bars, even when guestfish is used non-interactively."
15087 #: ../fish/guestfish.pod:239
15089 "Progress bars are enabled by default when guestfish is used as an "
15090 "interactive shell."
15094 #: ../fish/guestfish.pod:242
15095 msgid "B<--no-progress-bars>"
15099 #: ../fish/guestfish.pod:244
15100 msgid "Disable progress bars."
15104 #: ../fish/guestfish.pod:246
15105 msgid "B<--remote[=pid]>"
15109 #: ../fish/guestfish.pod:248
15111 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15112 "CONTROL GUESTFISH OVER A SOCKET> below."
15116 #: ../fish/guestfish.pod:251 ../fuse/guestmount.pod:148
15117 msgid "B<-r> | B<--ro>"
15121 #: ../fish/guestfish.pod:253
15123 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15124 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15128 #: ../fish/guestfish.pod:256 ../tools/virt-rescue.pl:162
15130 "The option must always be used if the disk image or virtual machine might be "
15131 "running, and is generally recommended in cases where you don't need write "
15132 "access to the disk."
15136 #: ../fish/guestfish.pod:260
15138 "Note that prepared disk images created with I<-N> are not affected by the "
15143 #: ../fish/guestfish.pod:263 ../fuse/guestmount.pod:158
15144 #: ../tools/virt-rescue.pl:170
15145 msgid "B<--selinux>"
15149 #: ../fish/guestfish.pod:265
15150 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15154 #: ../fish/guestfish.pod:267 ../fuse/guestmount.pod:168
15155 msgid "B<-v> | B<--verbose>"
15159 #: ../fish/guestfish.pod:269
15161 "Enable very verbose messages. This is particularly useful if you find a bug."
15165 #: ../fish/guestfish.pod:272 ../fuse/guestmount.pod:172
15166 msgid "B<-V> | B<--version>"
15170 #: ../fish/guestfish.pod:274
15171 msgid "Display the guestfish / libguestfs version number and exit."
15175 #: ../fish/guestfish.pod:276
15180 #: ../fish/guestfish.pod:278
15181 msgid "Echo each command before executing it."
15185 #: ../fish/guestfish.pod:282
15186 msgid "COMMANDS ON COMMAND LINE"
15190 #: ../fish/guestfish.pod:284
15192 "Any additional (non-option) arguments are treated as commands to execute."
15196 #: ../fish/guestfish.pod:287
15198 "Commands to execute should be separated by a colon (C<:>), where the colon "
15199 "is a separate parameter. Thus:"
15203 #: ../fish/guestfish.pod:290
15206 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
15211 #: ../fish/guestfish.pod:292
15213 "If there are no additional arguments, then we enter a shell, either an "
15214 "interactive shell with a prompt (if the input is a terminal) or a non-"
15215 "interactive shell."
15219 #: ../fish/guestfish.pod:296
15221 "In either command line mode or non-interactive shell, the first command that "
15222 "gives an error causes the whole shell to exit. In interactive mode (with a "
15223 "prompt) if a command fails, you can continue to enter commands."
15227 #: ../fish/guestfish.pod:301
15228 msgid "USING launch (OR run)"
15232 #: ../fish/guestfish.pod:303
15234 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
15235 "then launch it, then mount any disks you need, and finally issue actions/"
15236 "commands. So the general order of the day is:"
15240 #: ../fish/guestfish.pod:311
15241 msgid "add or -a/--add"
15245 #: ../fish/guestfish.pod:315
15246 msgid "launch (aka run)"
15250 #: ../fish/guestfish.pod:319
15251 msgid "mount or -m/--mount"
15255 #: ../fish/guestfish.pod:323
15256 msgid "any other commands"
15260 #: ../fish/guestfish.pod:327
15262 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
15263 "guest before mounting or performing any other commands."
15267 #: ../fish/guestfish.pod:330
15269 "The only exception is that if the I<-m> or I<--mount> option was given, the "
15270 "guest is automatically run for you (simply because guestfish can't mount the "
15271 "disks you asked for without doing this)."
15275 #: ../fish/guestfish.pod:334
15280 #: ../fish/guestfish.pod:336
15282 "You can quote ordinary parameters using either single or double quotes. For "
15287 #: ../fish/guestfish.pod:339
15290 " add \"file with a space.img\"\n"
15295 #: ../fish/guestfish.pod:341
15298 " rm '/file name'\n"
15303 #: ../fish/guestfish.pod:343
15311 #: ../fish/guestfish.pod:345
15313 "A few commands require a list of strings to be passed. For these, use a "
15314 "whitespace-separated list, enclosed in quotes. Strings containing "
15315 "whitespace to be passed through must be enclosed in single quotes. A "
15316 "literal single quote must be escaped with a backslash."
15320 #: ../fish/guestfish.pod:350
15323 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
15324 " command \"/bin/echo 'foo bar'\"\n"
15325 " command \"/bin/echo \\'foo\\'\"\n"
15330 #: ../fish/guestfish.pod:354
15335 #: ../fish/guestfish.pod:356
15337 "This section applies to all commands which can take integers as parameters."
15341 #: ../fish/guestfish.pod:359
15342 msgid "SIZE SUFFIX"
15346 #: ../fish/guestfish.pod:361
15348 "When the command takes a parameter measured in bytes, you can use one of the "
15349 "following suffixes to specify kilobytes, megabytes and larger sizes:"
15353 #: ../fish/guestfish.pod:367
15354 msgid "B<k> or B<K> or B<KiB>"
15358 #: ../fish/guestfish.pod:369
15359 msgid "The size in kilobytes (multiplied by 1024)."
15363 #: ../fish/guestfish.pod:371
15368 #: ../fish/guestfish.pod:373
15369 msgid "The size in SI 1000 byte units."
15373 #: ../fish/guestfish.pod:375
15374 msgid "B<M> or B<MiB>"
15378 #: ../fish/guestfish.pod:377
15379 msgid "The size in megabytes (multiplied by 1048576)."
15383 #: ../fish/guestfish.pod:379
15388 #: ../fish/guestfish.pod:381
15389 msgid "The size in SI 1000000 byte units."
15393 #: ../fish/guestfish.pod:383
15394 msgid "B<G> or B<GiB>"
15398 #: ../fish/guestfish.pod:385
15399 msgid "The size in gigabytes (multiplied by 2**30)."
15403 #: ../fish/guestfish.pod:387
15408 #: ../fish/guestfish.pod:389
15409 msgid "The size in SI 10**9 byte units."
15413 #: ../fish/guestfish.pod:391
15414 msgid "B<T> or B<TiB>"
15418 #: ../fish/guestfish.pod:393
15419 msgid "The size in terabytes (multiplied by 2**40)."
15423 #: ../fish/guestfish.pod:395
15428 #: ../fish/guestfish.pod:397
15429 msgid "The size in SI 10**12 byte units."
15433 #: ../fish/guestfish.pod:399
15434 msgid "B<P> or B<PiB>"
15438 #: ../fish/guestfish.pod:401
15439 msgid "The size in petabytes (multiplied by 2**50)."
15443 #: ../fish/guestfish.pod:403
15448 #: ../fish/guestfish.pod:405
15449 msgid "The size in SI 10**15 byte units."
15453 #: ../fish/guestfish.pod:407
15454 msgid "B<E> or B<EiB>"
15458 #: ../fish/guestfish.pod:409
15459 msgid "The size in exabytes (multiplied by 2**60)."
15463 #: ../fish/guestfish.pod:411
15468 #: ../fish/guestfish.pod:413
15469 msgid "The size in SI 10**18 byte units."
15473 #: ../fish/guestfish.pod:415
15474 msgid "B<Z> or B<ZiB>"
15478 #: ../fish/guestfish.pod:417
15479 msgid "The size in zettabytes (multiplied by 2**70)."
15483 #: ../fish/guestfish.pod:419
15488 #: ../fish/guestfish.pod:421
15489 msgid "The size in SI 10**21 byte units."
15493 #: ../fish/guestfish.pod:423
15494 msgid "B<Y> or B<YiB>"
15498 #: ../fish/guestfish.pod:425
15499 msgid "The size in yottabytes (multiplied by 2**80)."
15503 #: ../fish/guestfish.pod:427
15508 #: ../fish/guestfish.pod:429
15509 msgid "The size in SI 10**24 byte units."
15513 #: ../fish/guestfish.pod:433
15514 msgid "For example:"
15518 #: ../fish/guestfish.pod:435
15521 " truncate-size /file 1G\n"
15526 #: ../fish/guestfish.pod:437
15527 msgid "would truncate the file to 1 gigabyte."
15531 #: ../fish/guestfish.pod:439
15533 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
15534 "the parameter to L</memsize> is specified in megabytes already). Adding a "
15535 "suffix will probably not do what you expect."
15539 #: ../fish/guestfish.pod:443
15540 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15544 #: ../fish/guestfish.pod:445
15546 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15547 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15551 #: ../fish/guestfish.pod:448
15554 " 1234 decimal number 1234\n"
15555 " 02322 octal number, equivalent to decimal 1234\n"
15556 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
15561 #: ../fish/guestfish.pod:452
15563 "When using the C<chmod> command, you almost always want to specify an octal "
15564 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
15565 "L<chmod(1)> program):"
15569 #: ../fish/guestfish.pod:456
15572 " chmod 0777 /public # OK\n"
15573 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
15578 #: ../fish/guestfish.pod:459
15580 "Commands that return numbers usually print them in decimal, but some "
15581 "commands print numbers in other radices (eg. C<umask> prints the mode in "
15582 "octal, preceeded by C<0>)."
15586 #: ../fish/guestfish.pod:463
15587 msgid "WILDCARDS AND GLOBBING"
15591 #: ../fish/guestfish.pod:465
15593 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
15594 "(globbing) by default. So for example the following will not do what you "
15599 #: ../fish/guestfish.pod:469
15607 #: ../fish/guestfish.pod:471
15609 "Assuming you don't have a directory literally called C</home/*> then the "
15610 "above command will return an error."
15614 #: ../fish/guestfish.pod:474
15615 msgid "To perform wildcard expansion, use the C<glob> command."
15619 #: ../fish/guestfish.pod:476
15622 " glob rm-rf /home/*\n"
15627 #: ../fish/guestfish.pod:478
15629 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
15630 "many times), equivalent to:"
15634 #: ../fish/guestfish.pod:481
15637 " rm-rf /home/jim\n"
15638 " rm-rf /home/joe\n"
15639 " rm-rf /home/mary\n"
15644 #: ../fish/guestfish.pod:485
15645 msgid "C<glob> only works on simple guest paths and not on device names."
15649 #: ../fish/guestfish.pod:487
15651 "If you have several parameters, each containing a wildcard, then glob will "
15652 "perform a cartesian product."
15656 #: ../fish/guestfish.pod:490
15661 #: ../fish/guestfish.pod:492
15663 "Any line which starts with a I<#> character is treated as a comment and "
15664 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
15665 "a command. For example:"
15669 #: ../fish/guestfish.pod:496
15672 " # this is a comment\n"
15673 " # this is a comment\n"
15674 " foo # NOT a comment\n"
15679 #: ../fish/guestfish.pod:500
15680 msgid "Blank lines are also ignored."
15684 #: ../fish/guestfish.pod:502
15685 msgid "RUNNING COMMANDS LOCALLY"
15689 #: ../fish/guestfish.pod:504
15691 "Any line which starts with a I<!> character is treated as a command sent to "
15692 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
15696 #: ../fish/guestfish.pod:508
15700 " tgz-out /remote local/remote-data.tar.gz\n"
15705 #: ../fish/guestfish.pod:511
15707 "will create a directory C<local> on the host, and then export the contents "
15708 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
15709 "(See C<tgz-out>)."
15713 #: ../fish/guestfish.pod:515
15715 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
15716 "effect, due to the way that subprocesses work in Unix."
15720 #: ../fish/guestfish.pod:518
15725 #: ../fish/guestfish.pod:520
15727 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
15728 "command (a guestfish command) to the second command (any host command). For "
15733 #: ../fish/guestfish.pod:524
15736 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
15741 #: ../fish/guestfish.pod:526
15743 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
15744 "program). The above command would list all accounts in the guest filesystem "
15745 "which have UID 0, ie. root accounts including backdoors. Other examples:"
15749 #: ../fish/guestfish.pod:531
15752 " hexdump /bin/ls | head\n"
15753 " list-devices | tail -1\n"
15754 " tgz-out / - | tar ztf -\n"
15759 #: ../fish/guestfish.pod:535
15761 "The space before the pipe symbol is required, any space after the pipe "
15762 "symbol is optional. Everything after the pipe symbol is just passed "
15763 "straight to the host shell, so it can contain redirections, globs and "
15764 "anything else that makes sense on the host side."
15768 #: ../fish/guestfish.pod:540
15770 "To use a literal argument which begins with a pipe symbol, you have to quote "
15775 #: ../fish/guestfish.pod:543
15783 #: ../fish/guestfish.pod:545
15784 msgid "HOME DIRECTORIES"
15788 #: ../fish/guestfish.pod:547
15790 "If a parameter starts with the character C<~> then the tilde may be expanded "
15791 "as a home directory path (either C<~> for the current user's home directory, "
15792 "or C<~user> for another user)."
15796 #: ../fish/guestfish.pod:551
15798 "Note that home directory expansion happens for users known I<on the host>, "
15799 "not in the guest filesystem."
15803 #: ../fish/guestfish.pod:554
15805 "To use a literal argument which begins with a tilde, you have to quote it, "
15810 #: ../fish/guestfish.pod:557
15818 #: ../fish/guestfish.pod:561
15820 "Libguestfs has some support for Linux guests encrypted according to the "
15821 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
15822 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
15823 "LUKS is supported."
15827 #: ../fish/guestfish.pod:566
15828 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
15832 #: ../fish/guestfish.pod:568
15835 " ><fs> vfs-type /dev/sda2\n"
15841 #: ../fish/guestfish.pod:571
15843 "Then open those devices using L</luks-open>. This creates a device-mapper "
15844 "device called C</dev/mapper/luksdev>."
15848 #: ../fish/guestfish.pod:574
15851 " ><fs> luks-open /dev/sda2 luksdev\n"
15852 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
15857 #: ../fish/guestfish.pod:577
15859 "Finally you have to tell LVM to scan for volume groups on the newly created "
15864 #: ../fish/guestfish.pod:580
15868 " ><fs> vg-activate-all true\n"
15873 #: ../fish/guestfish.pod:583
15874 msgid "The logical volume(s) can now be mounted in the usual way."
15878 #: ../fish/guestfish.pod:585
15880 "Before closing a LUKS device you must unmount any logical volumes on it and "
15881 "deactivate the volume groups by calling C<vg-activate false VG> on each "
15882 "one. Then you can close the mapper device:"
15886 #: ../fish/guestfish.pod:589
15889 " ><fs> vg-activate false /dev/VG\n"
15890 " ><fs> luks-close /dev/mapper/luksdev\n"
15895 #: ../fish/guestfish.pod:592
15896 msgid "WINDOWS PATHS"
15900 #: ../fish/guestfish.pod:594
15902 "If a path is prefixed with C<win:> then you can use Windows-style paths "
15903 "(with some limitations). The following commands are equivalent:"
15907 #: ../fish/guestfish.pod:597
15910 " file /WINDOWS/system32/config/system.LOG\n"
15915 #: ../fish/guestfish.pod:599
15918 " file win:/windows/system32/config/system.log\n"
15923 #: ../fish/guestfish.pod:601
15926 " file win:\\windows\\system32\\config\\system.log\n"
15931 #: ../fish/guestfish.pod:603
15934 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
15939 #: ../fish/guestfish.pod:605
15941 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
15942 "handles case insensitivity like Windows would. This only works in argument "
15943 "positions that expect a path."
15947 #: ../fish/guestfish.pod:609
15948 msgid "UPLOADING AND DOWNLOADING FILES"
15952 #: ../fish/guestfish.pod:611
15954 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
15955 "others which upload from or download to a local file, you can use the "
15956 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
15960 #: ../fish/guestfish.pod:615
15968 #: ../fish/guestfish.pod:617
15970 "reads stdin and creates from that a file C</foo> in the disk image, and:"
15974 #: ../fish/guestfish.pod:620
15977 " tar-out /etc - | tar tf -\n"
15982 #: ../fish/guestfish.pod:622
15984 "writes the tarball to stdout and then pipes that into the external \"tar\" "
15985 "command (see L</PIPES>)."
15989 #: ../fish/guestfish.pod:625
15991 "When using C<-> to read from stdin, the input is read up to the end of "
15992 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
15993 "some arbitrary end marker:"
15997 #: ../fish/guestfish.pod:629
16000 " upload -<<END /foo\n"
16009 #: ../fish/guestfish.pod:635
16011 "Any string of characters can be used instead of C<END>. The end marker must "
16012 "appear on a line of its own, without any preceeding or following characters "
16013 "(not even spaces)."
16017 #: ../fish/guestfish.pod:639
16019 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16020 "upload local files (so-called \"FileIn\" parameters in the generator)."
16024 #: ../fish/guestfish.pod:642
16025 msgid "EXIT ON ERROR BEHAVIOUR"
16029 #: ../fish/guestfish.pod:644
16031 "By default, guestfish will ignore any errors when in interactive mode (ie. "
16032 "taking commands from a human over a tty), and will exit on the first error "
16033 "in non-interactive mode (scripts, commands given on the command line)."
16037 #: ../fish/guestfish.pod:649
16039 "If you prefix a command with a I<-> character, then that command will not "
16040 "cause guestfish to exit, even if that (one) command returns an error."
16044 #: ../fish/guestfish.pod:653
16045 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16049 #: ../fish/guestfish.pod:655
16051 "Guestfish can be remote-controlled over a socket. This is useful "
16052 "particularly in shell scripts where you want to make several different "
16053 "changes to a filesystem, but you don't want the overhead of starting up a "
16054 "guestfish process each time."
16058 #: ../fish/guestfish.pod:660
16059 msgid "Start a guestfish server process using:"
16063 #: ../fish/guestfish.pod:662
16066 " eval `guestfish --listen`\n"
16071 #: ../fish/guestfish.pod:664
16072 msgid "and then send it commands by doing:"
16076 #: ../fish/guestfish.pod:666
16079 " guestfish --remote cmd [...]\n"
16084 #: ../fish/guestfish.pod:668
16085 msgid "To cause the server to exit, send it the exit command:"
16089 #: ../fish/guestfish.pod:670
16092 " guestfish --remote exit\n"
16097 #: ../fish/guestfish.pod:672
16099 "Note that the server will normally exit if there is an error in a command. "
16100 "You can change this in the usual way. See section L</EXIT ON ERROR "
16105 #: ../fish/guestfish.pod:676
16106 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16110 #: ../fish/guestfish.pod:678
16112 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16113 "is how the I<--remote> option knows where to send the commands. You can "
16114 "have several guestfish listener processes running using:"
16118 #: ../fish/guestfish.pod:682
16121 " eval `guestfish --listen`\n"
16122 " pid1=$GUESTFISH_PID\n"
16123 " eval `guestfish --listen`\n"
16124 " pid2=$GUESTFISH_PID\n"
16126 " guestfish --remote=$pid1 cmd\n"
16127 " guestfish --remote=$pid2 cmd\n"
16132 #: ../fish/guestfish.pod:690
16133 msgid "REMOTE CONTROL DETAILS"
16137 #: ../fish/guestfish.pod:692
16139 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
16140 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
16141 "and C<$PID> is the process ID of the server."
16145 #: ../fish/guestfish.pod:696
16146 msgid "Guestfish client and server versions must match exactly."
16150 #: ../fish/guestfish.pod:698
16151 msgid "PREPARED DISK IMAGES"
16155 #: ../fish/guestfish.pod:700
16157 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
16158 "preformatted disk images that guestfish can make for you to save typing. "
16159 "This is particularly useful for testing purposes. This option is used "
16160 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
16161 "can be mixed with I<-a>)."
16165 #: ../fish/guestfish.pod:706
16167 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
16168 "the second and so on. Existing files in the current directory are "
16173 #: ../fish/guestfish.pod:710
16175 "The type briefly describes how the disk should be sized, partitioned, how "
16176 "filesystem(s) should be created, and how content should be added. "
16177 "Optionally the type can be followed by extra parameters, separated by C<:> "
16178 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
16179 "allocated disk, containing a single partition, with the partition formatted "
16180 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
16185 #: ../fish/guestfish.pod:718
16186 msgid "To list the available types and any extra parameters they take, run:"
16190 #: ../fish/guestfish.pod:722
16192 "Note that the prepared filesystem is not mounted. You would usually have to "
16193 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
16197 #: ../fish/guestfish.pod:726
16199 "If any I<-N> or I<--new> options are given, the guest is automatically "
16204 #: ../fish/guestfish.pod:731
16205 msgid "Create a 100MB disk with an ext4-formatted partition:"
16209 #: ../fish/guestfish.pod:733
16212 " guestfish -N fs:ext4\n"
16217 #: ../fish/guestfish.pod:735
16218 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
16222 #: ../fish/guestfish.pod:737
16225 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
16230 #: ../fish/guestfish.pod:739
16231 msgid "Create a blank 200MB disk:"
16235 #: ../fish/guestfish.pod:741
16238 " guestfish -N disk:200M\n"
16243 #: ../fish/guestfish.pod:743
16244 msgid "PROGRESS BARS"
16248 #: ../fish/guestfish.pod:745
16250 "Some (not all) long-running commands send progress notification messages as "
16251 "they are running. Guestfish turns these messages into progress bars."
16255 #: ../fish/guestfish.pod:749
16257 "When a command that supports progress bars takes longer than two seconds to "
16258 "run, and if progress bars are enabled, then you will see one appearing below "
16263 #: ../fish/guestfish.pod:753
16266 " ><fs> copy-size /large-file /another-file 2048M\n"
16267 " / 10% [#####-----------------------------------------] 00:30\n"
16272 #: ../fish/guestfish.pod:756
16274 "The spinner on the left hand side moves round once for every progress "
16275 "notification received from the backend. This is a (reasonably) golden "
16276 "assurance that the command is \"doing something\" even if the progress bar "
16277 "is not moving, because the command is able to send the progress "
16278 "notifications. When the bar reaches 100% and the command finishes, the "
16279 "spinner disappears."
16283 #: ../fish/guestfish.pod:763
16285 "Progress bars are enabled by default when guestfish is used interactively. "
16286 "You can enable them even for non-interactive modes using I<--progress-bars>, "
16287 "and you can disable them completely using I<--no-progress-bars>."
16291 #: ../fish/guestfish.pod:768
16292 msgid "GUESTFISH COMMANDS"
16296 #: ../fish/guestfish.pod:770
16298 "The commands in this section are guestfish convenience commands, in other "
16299 "words, they are not part of the L<guestfs(3)> API."
16303 #: ../fish/guestfish.pod:773
16308 #: ../fish/guestfish.pod:775
16317 #: ../fish/guestfish.pod:778
16319 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
16320 "this displays detailed help for a command."
16324 #: ../fish/guestfish.pod:781
16325 msgid "quit | exit"
16329 #: ../fish/guestfish.pod:783
16330 msgid "This exits guestfish. You can also use C<^D> key."
16334 #: ../fish/guestfish.pod:785
16335 msgid "@FISH_COMMANDS@"
16339 #: ../fish/guestfish.pod:787
16344 #: ../fish/guestfish.pod:791 ../test-tool/libguestfs-test-tool.pod:83
16349 #: ../fish/guestfish.pod:793
16351 "guestfish returns 0 if the commands completed without error, or 1 if there "
16356 #: ../fish/guestfish.pod:800
16361 #: ../fish/guestfish.pod:802
16363 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
16368 #: ../fish/guestfish.pod:805
16369 msgid "GUESTFISH_PID"
16373 #: ../fish/guestfish.pod:807
16375 "Used with the I<--remote> option to specify the remote guestfish process to "
16376 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16380 #: ../fish/guestfish.pod:811
16385 #: ../fish/guestfish.pod:813
16387 "If compiled with GNU readline support, various files in the home directory "
16388 "can be used. See L</FILES>."
16392 #: ../fish/guestfish.pod:822
16394 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16395 "effect as using the B<-v> option."
16399 #: ../fish/guestfish.pod:834
16401 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16402 "the discussion of paths in L<guestfs(3)>."
16406 #: ../fish/guestfish.pod:845
16407 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16411 #: ../fish/guestfish.pod:847
16416 #: ../fish/guestfish.pod:849
16418 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16423 #: ../fish/guestfish.pod:864 ../test-tool/libguestfs-test-tool.pod:88
16428 #: ../fish/guestfish.pod:868
16429 msgid "$HOME/.guestfish"
16433 #: ../fish/guestfish.pod:870
16435 "If compiled with GNU readline support, then the command history is saved in "
16440 #: ../fish/guestfish.pod:873
16441 msgid "$HOME/.inputrc"
16445 #: ../fish/guestfish.pod:875
16446 msgid "/etc/inputrc"
16450 #: ../fish/guestfish.pod:877
16452 "If compiled with GNU readline support, then these files can be used to "
16453 "configure readline. For further information, please see L<readline(3)/"
16454 "INITIALIZATION FILE>."
16458 #: ../fish/guestfish.pod:881
16459 msgid "To write rules which only apply to guestfish, use:"
16463 #: ../fish/guestfish.pod:883
16473 #: ../fish/guestfish.pod:887
16475 "Variables that you can set in inputrc that change the behaviour of guestfish "
16476 "in useful ways include:"
16480 #: ../fish/guestfish.pod:892
16481 msgid "completion-ignore-case (default: on)"
16485 #: ../fish/guestfish.pod:894
16487 "By default, guestfish will ignore case when tab-completing paths on the "
16492 #: ../fish/guestfish.pod:897
16495 " set completion-ignore-case off\n"
16500 #: ../fish/guestfish.pod:899
16501 msgid "to make guestfish case sensitive."
16505 #: ../fish/guestfish.pod:903
16510 #: ../fish/guestfish.pod:905
16511 msgid "test2.img (etc)"
16515 #: ../fish/guestfish.pod:907
16517 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16518 "will be created in the file C<test1.img> in the current directory. The "
16519 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16520 "the same name will be overwritten."
16524 #: ../fish/guestfish.pod:916
16526 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16527 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16528 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16529 "L<virt-tar(1)>, L<virt-win-reg(1)>."
16533 #: ../fish/guestfish.pod:939 ../test-tool/libguestfs-test-tool.pod:124
16534 #: ../fuse/guestmount.pod:198 ../inspector/virt-inspector.pl:865
16535 #: ../tools/virt-cat.pl:181 ../tools/virt-df.pl:499 ../tools/virt-edit.pl:345
16536 #: ../tools/virt-list-filesystems.pl:211 ../tools/virt-list-partitions.pl:248
16537 #: ../tools/virt-ls.pl:229 ../tools/virt-make-fs.pl:560
16538 #: ../tools/virt-rescue.pl:249 ../tools/virt-resize.pl:1415
16539 #: ../tools/virt-tar.pl:276 ../tools/virt-win-reg.pl:495
16541 "This program is free software; you can redistribute it and/or modify it "
16542 "under the terms of the GNU General Public License as published by the Free "
16543 "Software Foundation; either version 2 of the License, or (at your option) "
16544 "any later version."
16548 #: ../fish/guestfish.pod:944 ../test-tool/libguestfs-test-tool.pod:129
16549 #: ../fuse/guestmount.pod:203 ../inspector/virt-inspector.pl:870
16550 #: ../tools/virt-cat.pl:186 ../tools/virt-df.pl:504 ../tools/virt-edit.pl:350
16551 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:253
16552 #: ../tools/virt-ls.pl:234 ../tools/virt-make-fs.pl:565
16553 #: ../tools/virt-rescue.pl:254 ../tools/virt-resize.pl:1420
16554 #: ../tools/virt-tar.pl:281 ../tools/virt-win-reg.pl:500
16556 "This program is distributed in the hope that it will be useful, but WITHOUT "
16557 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
16558 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
16563 #: ../fish/guestfish.pod:949 ../test-tool/libguestfs-test-tool.pod:134
16564 #: ../fuse/guestmount.pod:208 ../inspector/virt-inspector.pl:875
16565 #: ../tools/virt-cat.pl:191 ../tools/virt-df.pl:509 ../tools/virt-edit.pl:355
16566 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:258
16567 #: ../tools/virt-ls.pl:239 ../tools/virt-make-fs.pl:570
16568 #: ../tools/virt-rescue.pl:259 ../tools/virt-resize.pl:1425
16569 #: ../tools/virt-tar.pl:286 ../tools/virt-win-reg.pl:505
16571 "You should have received a copy of the GNU General Public License along with "
16572 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
16573 "Ave, Cambridge, MA 02139, USA."
16577 #: ../fish/guestfish-actions.pod:1
16578 msgid "add-cdrom | cdrom"
16582 #: ../fish/guestfish-actions.pod:3
16585 " add-cdrom filename\n"
16590 #: ../fish/guestfish-actions.pod:15
16592 "This call checks for the existence of C<filename>. This stops you from "
16593 "specifying other types of drive which are supported by qemu such as C<nbd:> "
16594 "and C<http:> URLs. To specify those, use the general L</config> call "
16599 #: ../fish/guestfish-actions.pod:22
16601 "If you just want to add an ISO file (often you use this as an efficient way "
16602 "to transfer large files into the guest), then you should probably use L</add-"
16603 "drive-ro> instead."
16607 #: ../fish/guestfish-actions.pod:28
16608 msgid "add-drive | add"
16612 #: ../fish/guestfish-actions.pod:30
16615 " add-drive filename\n"
16620 #: ../fish/guestfish-actions.pod:49 ../fish/guestfish-actions.pod:75
16622 "C<if=...> is set at compile time by the configuration option C<./configure --"
16623 "with-drive-if=...>. In the rare case where you might need to change this at "
16624 "run time, use L</add-drive-with-if> or L</add-drive-ro-with-if>."
16628 #: ../fish/guestfish-actions.pod:54 ../fish/guestfish-actions.pod:80
16630 "Note that this call checks for the existence of C<filename>. This stops you "
16631 "from specifying other types of drive which are supported by qemu such as "
16632 "C<nbd:> and C<http:> URLs. To specify those, use the general L</config> "
16637 #: ../fish/guestfish-actions.pod:59
16638 msgid "add-drive-ro | add-ro"
16642 #: ../fish/guestfish-actions.pod:61
16645 " add-drive-ro filename\n"
16650 #: ../fish/guestfish-actions.pod:85
16651 msgid "add-drive-ro-with-if"
16655 #: ../fish/guestfish-actions.pod:87
16658 " add-drive-ro-with-if filename iface\n"
16663 #: ../fish/guestfish-actions.pod:89
16665 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
16666 "interface emulation to use at run time."
16670 #: ../fish/guestfish-actions.pod:92
16671 msgid "add-drive-with-if"
16675 #: ../fish/guestfish-actions.pod:94
16678 " add-drive-with-if filename iface\n"
16683 #: ../fish/guestfish-actions.pod:96
16685 "This is the same as L</add-drive> but it allows you to specify the QEMU "
16686 "interface emulation to use at run time."
16690 #: ../fish/guestfish-actions.pod:99
16695 #: ../fish/guestfish-actions.pod:101
16698 " aug-clear augpath\n"
16703 #: ../fish/guestfish-actions.pod:106
16708 #: ../fish/guestfish-actions.pod:108
16716 #: ../fish/guestfish-actions.pod:110
16718 "Close the current Augeas handle and free up any resources used by it. After "
16719 "calling this, you have to call L</aug-init> again before you can use any "
16720 "other Augeas functions."
16724 #: ../fish/guestfish-actions.pod:115
16725 msgid "aug-defnode"
16729 #: ../fish/guestfish-actions.pod:117
16732 " aug-defnode name expr val\n"
16737 #: ../fish/guestfish-actions.pod:122
16739 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
16740 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
16741 "containing that single node."
16745 #: ../fish/guestfish-actions.pod:130
16750 #: ../fish/guestfish-actions.pod:132
16753 " aug-defvar name expr\n"
16758 #: ../fish/guestfish-actions.pod:141
16763 #: ../fish/guestfish-actions.pod:143
16766 " aug-get augpath\n"
16771 #: ../fish/guestfish-actions.pod:148
16776 #: ../fish/guestfish-actions.pod:150
16779 " aug-init root flags\n"
16784 #: ../fish/guestfish-actions.pod:156
16785 msgid "You must call this before using any other L</aug-*> commands."
16789 #: ../fish/guestfish-actions.pod:191
16790 msgid "Do not load the tree in L</aug-init>."
16794 #: ../fish/guestfish-actions.pod:195
16795 msgid "To close the handle, you can call L</aug-close>."
16799 #: ../fish/guestfish-actions.pod:199
16804 #: ../fish/guestfish-actions.pod:201
16807 " aug-insert augpath label true|false\n"
16812 #: ../fish/guestfish-actions.pod:211
16817 #: ../fish/guestfish-actions.pod:213
16825 #: ../fish/guestfish-actions.pod:220
16830 #: ../fish/guestfish-actions.pod:222
16833 " aug-ls augpath\n"
16838 #: ../fish/guestfish-actions.pod:224
16840 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
16841 "resulting nodes into alphabetical order."
16845 #: ../fish/guestfish-actions.pod:227
16850 #: ../fish/guestfish-actions.pod:229
16853 " aug-match augpath\n"
16858 #: ../fish/guestfish-actions.pod:235
16863 #: ../fish/guestfish-actions.pod:237
16866 " aug-mv src dest\n"
16871 #: ../fish/guestfish-actions.pod:242
16876 #: ../fish/guestfish-actions.pod:244
16879 " aug-rm augpath\n"
16884 #: ../fish/guestfish-actions.pod:250
16889 #: ../fish/guestfish-actions.pod:252
16897 #: ../fish/guestfish-actions.pod:256
16899 "The flags which were passed to L</aug-init> affect exactly how files are "
16904 #: ../fish/guestfish-actions.pod:259
16909 #: ../fish/guestfish-actions.pod:261
16912 " aug-set augpath val\n"
16917 #: ../fish/guestfish-actions.pod:265
16919 "In the Augeas API, it is possible to clear a node by setting the value to "
16920 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
16921 "this call. Instead you must use the L</aug-clear> call."
16925 #: ../fish/guestfish-actions.pod:270
16930 #: ../fish/guestfish-actions.pod:272
16933 " available 'groups ...'\n"
16938 #: ../fish/guestfish-actions.pod:278
16940 "The libguestfs groups, and the functions that those groups correspond to, "
16941 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
16942 "runtime by calling L</available-all-groups>."
16946 #: ../fish/guestfish-actions.pod:302
16947 msgid "You must call L</launch> before calling this function."
16951 #: ../fish/guestfish-actions.pod:324
16953 "This call was added in version C<1.0.80>. In previous versions of "
16954 "libguestfs all you could do would be to speculatively execute a command to "
16955 "find out if the daemon implemented it. See also L</version>."
16959 #: ../fish/guestfish-actions.pod:331
16960 msgid "available-all-groups"
16964 #: ../fish/guestfish-actions.pod:333
16967 " available-all-groups\n"
16972 #: ../fish/guestfish-actions.pod:335
16974 "This command returns a list of all optional groups that this daemon knows "
16975 "about. Note this returns both supported and unsupported groups. To find "
16976 "out which ones the daemon can actually support you have to call L</"
16977 "available> on each member of the returned list."
16981 #: ../fish/guestfish-actions.pod:341
16982 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
16986 #: ../fish/guestfish-actions.pod:343
16991 #: ../fish/guestfish-actions.pod:345
16994 " base64-in (base64file|-) filename\n"
16999 #: ../fish/guestfish-actions.pod:350 ../fish/guestfish-actions.pod:359
17000 #: ../fish/guestfish-actions.pod:583 ../fish/guestfish-actions.pod:730
17001 #: ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:1154
17002 #: ../fish/guestfish-actions.pod:3752 ../fish/guestfish-actions.pod:3764
17003 #: ../fish/guestfish-actions.pod:3775 ../fish/guestfish-actions.pod:3786
17004 #: ../fish/guestfish-actions.pod:3838 ../fish/guestfish-actions.pod:3847
17005 #: ../fish/guestfish-actions.pod:3897
17006 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17010 #: ../fish/guestfish-actions.pod:352
17015 #: ../fish/guestfish-actions.pod:354
17018 " base64-out filename (base64file|-)\n"
17023 #: ../fish/guestfish-actions.pod:361
17024 msgid "blockdev-flushbufs"
17028 #: ../fish/guestfish-actions.pod:363
17031 " blockdev-flushbufs device\n"
17036 #: ../fish/guestfish-actions.pod:370
17037 msgid "blockdev-getbsz"
17041 #: ../fish/guestfish-actions.pod:372
17044 " blockdev-getbsz device\n"
17049 #: ../fish/guestfish-actions.pod:381
17050 msgid "blockdev-getro"
17054 #: ../fish/guestfish-actions.pod:383
17057 " blockdev-getro device\n"
17062 #: ../fish/guestfish-actions.pod:390
17063 msgid "blockdev-getsize64"
17067 #: ../fish/guestfish-actions.pod:392
17070 " blockdev-getsize64 device\n"
17075 #: ../fish/guestfish-actions.pod:396
17076 msgid "See also L</blockdev-getsz>."
17080 #: ../fish/guestfish-actions.pod:400
17081 msgid "blockdev-getss"
17085 #: ../fish/guestfish-actions.pod:402
17088 " blockdev-getss device\n"
17093 #: ../fish/guestfish-actions.pod:407
17095 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
17099 #: ../fish/guestfish-actions.pod:412
17100 msgid "blockdev-getsz"
17104 #: ../fish/guestfish-actions.pod:414
17107 " blockdev-getsz device\n"
17112 #: ../fish/guestfish-actions.pod:419
17114 "See also L</blockdev-getss> for the real sector size of the device, and L</"
17115 "blockdev-getsize64> for the more useful I<size in bytes>."
17119 #: ../fish/guestfish-actions.pod:425
17120 msgid "blockdev-rereadpt"
17124 #: ../fish/guestfish-actions.pod:427
17127 " blockdev-rereadpt device\n"
17132 #: ../fish/guestfish-actions.pod:433
17133 msgid "blockdev-setbsz"
17137 #: ../fish/guestfish-actions.pod:435
17140 " blockdev-setbsz device blocksize\n"
17145 #: ../fish/guestfish-actions.pod:444
17146 msgid "blockdev-setro"
17150 #: ../fish/guestfish-actions.pod:446
17153 " blockdev-setro device\n"
17158 #: ../fish/guestfish-actions.pod:452
17159 msgid "blockdev-setrw"
17163 #: ../fish/guestfish-actions.pod:454
17166 " blockdev-setrw device\n"
17171 #: ../fish/guestfish-actions.pod:460
17172 msgid "case-sensitive-path"
17176 #: ../fish/guestfish-actions.pod:462
17179 " case-sensitive-path path\n"
17184 #: ../fish/guestfish-actions.pod:486
17186 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
17187 "WINDOWS/system32\"> (the exact return value would depend on details of how "
17188 "the directories were originally created under Windows)."
17192 #: ../fish/guestfish-actions.pod:494
17193 msgid "See also L</realpath>."
17197 #: ../fish/guestfish-actions.pod:496
17202 #: ../fish/guestfish-actions.pod:498
17210 #: ../fish/guestfish-actions.pod:502
17212 "Note that this function cannot correctly handle binary files (specifically, "
17213 "files containing C<\\0> character which is treated as end of string). For "
17214 "those you need to use the L</read-file> or L</download> functions which have "
17215 "a more complex interface."
17219 #: ../fish/guestfish-actions.pod:510
17224 #: ../fish/guestfish-actions.pod:512
17227 " checksum csumtype path\n"
17232 #: ../fish/guestfish-actions.pod:555
17233 msgid "To get the checksum for a device, use L</checksum-device>."
17237 #: ../fish/guestfish-actions.pod:557
17238 msgid "To get the checksums for many files, use L</checksums-out>."
17242 #: ../fish/guestfish-actions.pod:559
17243 msgid "checksum-device"
17247 #: ../fish/guestfish-actions.pod:561
17250 " checksum-device csumtype device\n"
17255 #: ../fish/guestfish-actions.pod:563
17257 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
17258 "device named C<device>. For the types of checksums supported see the L</"
17259 "checksum> command."
17263 #: ../fish/guestfish-actions.pod:567
17264 msgid "checksums-out"
17268 #: ../fish/guestfish-actions.pod:569
17271 " checksums-out csumtype directory (sumsfile|-)\n"
17276 #: ../fish/guestfish-actions.pod:585
17281 #: ../fish/guestfish-actions.pod:587
17284 " chmod mode path\n"
17289 #: ../fish/guestfish-actions.pod:598
17294 #: ../fish/guestfish-actions.pod:600
17297 " chown owner group path\n"
17302 #: ../fish/guestfish-actions.pod:608
17307 #: ../fish/guestfish-actions.pod:610
17310 " command 'arguments ...'\n"
17315 #: ../fish/guestfish-actions.pod:617
17317 "The single parameter is an argv-style list of arguments. The first element "
17318 "is the name of the program to run. Subsequent elements are parameters. The "
17319 "list must be non-empty (ie. must contain a program name). Note that the "
17320 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
17324 #: ../fish/guestfish-actions.pod:645
17325 msgid "command-lines"
17329 #: ../fish/guestfish-actions.pod:647
17332 " command-lines 'arguments ...'\n"
17337 #: ../fish/guestfish-actions.pod:649
17339 "This is the same as L</command>, but splits the result into a list of lines."
17343 #: ../fish/guestfish-actions.pod:652
17344 msgid "See also: L</sh-lines>"
17348 #: ../fish/guestfish-actions.pod:657
17353 #: ../fish/guestfish-actions.pod:659
17356 " config qemuparam qemuvalue\n"
17361 #: ../fish/guestfish-actions.pod:670
17366 #: ../fish/guestfish-actions.pod:672
17369 " copy-size src dest size\n"
17374 #: ../fish/guestfish-actions.pod:680
17379 #: ../fish/guestfish-actions.pod:682
17387 #: ../fish/guestfish-actions.pod:687
17392 #: ../fish/guestfish-actions.pod:689
17400 #: ../fish/guestfish-actions.pod:694
17405 #: ../fish/guestfish-actions.pod:696
17413 #: ../fish/guestfish-actions.pod:703
17415 "If the destination is a device, it must be as large or larger than the "
17416 "source file or device, otherwise the copy will fail. This command cannot do "
17417 "partial copies (see L</copy-size>)."
17421 #: ../fish/guestfish-actions.pod:707
17426 #: ../fish/guestfish-actions.pod:709
17429 " debug subcmd 'extraargs ...'\n"
17434 #: ../fish/guestfish-actions.pod:711
17436 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
17437 "daemon) that runs inside the qemu subprocess."
17441 #: ../fish/guestfish-actions.pod:719
17442 msgid "debug-upload"
17446 #: ../fish/guestfish-actions.pod:721
17449 " debug-upload (filename|-) tmpname mode\n"
17454 #: ../fish/guestfish-actions.pod:723
17456 "The L</debug-upload> command uploads a file to the libguestfs appliance."
17460 #: ../fish/guestfish-actions.pod:732
17465 #: ../fish/guestfish-actions.pod:734
17473 #: ../fish/guestfish-actions.pod:742
17478 #: ../fish/guestfish-actions.pod:744
17486 #: ../fish/guestfish-actions.pod:753
17491 #: ../fish/guestfish-actions.pod:755
17499 #: ../fish/guestfish-actions.pod:761
17501 "Another way to get the same information is to enable verbose messages with "
17502 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17503 "before running the program."
17507 #: ../fish/guestfish-actions.pod:766
17512 #: ../fish/guestfish-actions.pod:768
17515 " download remotefilename (filename|-)\n"
17520 #: ../fish/guestfish-actions.pod:775
17521 msgid "See also L</upload>, L</cat>."
17525 #: ../fish/guestfish-actions.pod:779
17526 msgid "drop-caches"
17530 #: ../fish/guestfish-actions.pod:781
17533 " drop-caches whattodrop\n"
17538 #: ../fish/guestfish-actions.pod:793
17543 #: ../fish/guestfish-actions.pod:795
17551 #: ../fish/guestfish-actions.pod:807
17556 #: ../fish/guestfish-actions.pod:809
17559 " e2fsck-f device\n"
17564 #: ../fish/guestfish-actions.pod:815
17566 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
17567 "should use L</fsck>."
17571 #: ../fish/guestfish-actions.pod:818
17572 msgid "echo-daemon"
17576 #: ../fish/guestfish-actions.pod:820
17579 " echo-daemon 'words ...'\n"
17584 #: ../fish/guestfish-actions.pod:827
17585 msgid "See also L</ping-daemon>."
17589 #: ../fish/guestfish-actions.pod:829
17594 #: ../fish/guestfish-actions.pod:831
17597 " egrep regex path\n"
17602 #: ../fish/guestfish-actions.pod:839
17607 #: ../fish/guestfish-actions.pod:841
17610 " egrepi regex path\n"
17615 #: ../fish/guestfish-actions.pod:849
17620 #: ../fish/guestfish-actions.pod:851
17623 " equal file1 file2\n"
17628 #: ../fish/guestfish-actions.pod:858
17633 #: ../fish/guestfish-actions.pod:860
17641 #: ../fish/guestfish-actions.pod:865
17642 msgid "See also L</is-file>, L</is-dir>, L</stat>."
17646 #: ../fish/guestfish-actions.pod:867
17651 #: ../fish/guestfish-actions.pod:869
17654 " fallocate path len\n"
17659 #: ../fish/guestfish-actions.pod:886
17660 msgid "fallocate64"
17664 #: ../fish/guestfish-actions.pod:888
17667 " fallocate64 path len\n"
17672 #: ../fish/guestfish-actions.pod:894
17674 "Note that this call allocates disk blocks for the file. To create a sparse "
17675 "file use L</truncate-size> instead."
17679 #: ../fish/guestfish-actions.pod:897
17681 "The deprecated call L</fallocate> does the same, but owing to an oversight "
17682 "it only allowed 30 bit lengths to be specified, effectively limiting the "
17683 "maximum size of files created through that call to 1GB."
17687 #: ../fish/guestfish-actions.pod:906
17692 #: ../fish/guestfish-actions.pod:908
17695 " fgrep pattern path\n"
17700 #: ../fish/guestfish-actions.pod:916
17705 #: ../fish/guestfish-actions.pod:918
17708 " fgrepi pattern path\n"
17713 #: ../fish/guestfish-actions.pod:926
17718 #: ../fish/guestfish-actions.pod:928
17726 #: ../fish/guestfish-actions.pod:940
17728 "This command can also be used on C</dev/> devices (and partitions, LV "
17729 "names). You can for example use this to determine if a device contains a "
17730 "filesystem, although it's usually better to use L</vfs-type>."
17734 #: ../fish/guestfish-actions.pod:950
17735 msgid "file-architecture"
17739 #: ../fish/guestfish-actions.pod:952
17742 " file-architecture filename\n"
17747 #: ../fish/guestfish-actions.pod:1055
17752 #: ../fish/guestfish-actions.pod:1057
17760 #: ../fish/guestfish-actions.pod:1061
17762 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
17763 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
17767 #: ../fish/guestfish-actions.pod:1065
17772 #: ../fish/guestfish-actions.pod:1067
17775 " fill c len path\n"
17780 #: ../fish/guestfish-actions.pod:1073
17782 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
17783 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
17784 "L</fill-pattern>."
17788 #: ../fish/guestfish-actions.pod:1078
17789 msgid "fill-pattern"
17793 #: ../fish/guestfish-actions.pod:1080
17796 " fill-pattern pattern len path\n"
17801 #: ../fish/guestfish-actions.pod:1082
17803 "This function is like L</fill> except that it creates a new file of length "
17804 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
17805 "is truncated if necessary to ensure the length of the file is exactly C<len> "
17810 #: ../fish/guestfish-actions.pod:1087
17815 #: ../fish/guestfish-actions.pod:1089
17818 " find directory\n"
17823 #: ../fish/guestfish-actions.pod:1103
17824 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
17828 #: ../fish/guestfish-actions.pod:1116
17829 msgid "See also L</find0>."
17833 #: ../fish/guestfish-actions.pod:1121
17838 #: ../fish/guestfish-actions.pod:1123
17841 " find0 directory (files|-)\n"
17846 #: ../fish/guestfish-actions.pod:1129
17848 "This command works the same way as L</find> with the following exceptions:"
17852 #: ../fish/guestfish-actions.pod:1156
17853 msgid "findfs-label"
17857 #: ../fish/guestfish-actions.pod:1158
17860 " findfs-label label\n"
17865 #: ../fish/guestfish-actions.pod:1164
17866 msgid "To find the label of a filesystem, use L</vfs-label>."
17870 #: ../fish/guestfish-actions.pod:1166
17871 msgid "findfs-uuid"
17875 #: ../fish/guestfish-actions.pod:1168
17878 " findfs-uuid uuid\n"
17883 #: ../fish/guestfish-actions.pod:1174
17884 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
17888 #: ../fish/guestfish-actions.pod:1176
17893 #: ../fish/guestfish-actions.pod:1178
17896 " fsck fstype device\n"
17901 #: ../fish/guestfish-actions.pod:1208
17906 #: ../fish/guestfish-actions.pod:1210
17914 #: ../fish/guestfish-actions.pod:1217
17915 msgid "get-autosync"
17919 #: ../fish/guestfish-actions.pod:1219
17927 #: ../fish/guestfish-actions.pod:1223
17932 #: ../fish/guestfish-actions.pod:1225
17940 #: ../fish/guestfish-actions.pod:1229
17941 msgid "get-e2label"
17945 #: ../fish/guestfish-actions.pod:1231
17948 " get-e2label device\n"
17953 #: ../fish/guestfish-actions.pod:1243
17958 #: ../fish/guestfish-actions.pod:1245
17961 " get-e2uuid device\n"
17966 #: ../fish/guestfish-actions.pod:1257
17967 msgid "get-memsize"
17971 #: ../fish/guestfish-actions.pod:1259
17979 #: ../fish/guestfish-actions.pod:1264
17981 "If L</set-memsize> was not called on this handle, and if "
17982 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
17983 "value for memsize."
17987 #: ../fish/guestfish-actions.pod:1271
17988 msgid "get-network"
17992 #: ../fish/guestfish-actions.pod:1273
18000 #: ../fish/guestfish-actions.pod:1277
18005 #: ../fish/guestfish-actions.pod:1279
18013 #: ../fish/guestfish-actions.pod:1286
18014 msgid "get-pid | pid"
18018 #: ../fish/guestfish-actions.pod:1288
18026 #: ../fish/guestfish-actions.pod:1295
18031 #: ../fish/guestfish-actions.pod:1297
18039 #: ../fish/guestfish-actions.pod:1304
18040 msgid "get-recovery-proc"
18044 #: ../fish/guestfish-actions.pod:1306
18047 " get-recovery-proc\n"
18052 #: ../fish/guestfish-actions.pod:1310
18053 msgid "get-selinux"
18057 #: ../fish/guestfish-actions.pod:1312
18065 #: ../fish/guestfish-actions.pod:1314
18067 "This returns the current setting of the selinux flag which is passed to the "
18068 "appliance at boot time. See L</set-selinux>."
18072 #: ../fish/guestfish-actions.pod:1320
18077 #: ../fish/guestfish-actions.pod:1322
18085 #: ../fish/guestfish-actions.pod:1329
18090 #: ../fish/guestfish-actions.pod:1331
18098 #: ../fish/guestfish-actions.pod:1335
18103 #: ../fish/guestfish-actions.pod:1337
18111 #: ../fish/guestfish-actions.pod:1339
18113 "Return the current umask. By default the umask is C<022> unless it has been "
18114 "set by calling L</umask>."
18118 #: ../fish/guestfish-actions.pod:1342
18119 msgid "get-verbose"
18123 #: ../fish/guestfish-actions.pod:1344
18131 #: ../fish/guestfish-actions.pod:1348
18136 #: ../fish/guestfish-actions.pod:1350
18144 #: ../fish/guestfish-actions.pod:1354
18145 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
18149 #: ../fish/guestfish-actions.pod:1357
18154 #: ../fish/guestfish-actions.pod:1359
18157 " getxattrs path\n"
18162 #: ../fish/guestfish-actions.pod:1367
18163 msgid "See also: L</lgetxattrs>, L<attr(5)>."
18167 #: ../fish/guestfish-actions.pod:1369
18168 msgid "glob-expand"
18172 #: ../fish/guestfish-actions.pod:1371
18175 " glob-expand pattern\n"
18180 #: ../fish/guestfish-actions.pod:1384
18185 #: ../fish/guestfish-actions.pod:1386
18188 " grep regex path\n"
18193 #: ../fish/guestfish-actions.pod:1394
18198 #: ../fish/guestfish-actions.pod:1396
18201 " grepi regex path\n"
18206 #: ../fish/guestfish-actions.pod:1404
18207 msgid "grub-install"
18211 #: ../fish/guestfish-actions.pod:1406
18214 " grub-install root device\n"
18219 #: ../fish/guestfish-actions.pod:1422
18224 #: ../fish/guestfish-actions.pod:1424
18232 #: ../fish/guestfish-actions.pod:1432
18237 #: ../fish/guestfish-actions.pod:1434
18240 " head-n nrlines path\n"
18245 #: ../fish/guestfish-actions.pod:1447
18250 #: ../fish/guestfish-actions.pod:1449
18258 #: ../fish/guestfish-actions.pod:1457
18263 #: ../fish/guestfish-actions.pod:1459
18266 " initrd-cat initrdpath filename\n"
18271 #: ../fish/guestfish-actions.pod:1471
18272 msgid "See also L</initrd-list>."
18276 #: ../fish/guestfish-actions.pod:1476
18277 msgid "initrd-list"
18281 #: ../fish/guestfish-actions.pod:1478
18284 " initrd-list path\n"
18289 #: ../fish/guestfish-actions.pod:1490
18290 msgid "inotify-add-watch"
18294 #: ../fish/guestfish-actions.pod:1492
18297 " inotify-add-watch path mask\n"
18302 #: ../fish/guestfish-actions.pod:1504
18303 msgid "inotify-close"
18307 #: ../fish/guestfish-actions.pod:1506
18315 #: ../fish/guestfish-actions.pod:1512
18316 msgid "inotify-files"
18320 #: ../fish/guestfish-actions.pod:1514
18328 #: ../fish/guestfish-actions.pod:1516
18330 "This function is a helpful wrapper around L</inotify-read> which just "
18331 "returns a list of pathnames of objects that were touched. The returned "
18332 "pathnames are sorted and deduplicated."
18336 #: ../fish/guestfish-actions.pod:1520
18337 msgid "inotify-init"
18341 #: ../fish/guestfish-actions.pod:1522
18344 " inotify-init maxevents\n"
18349 #: ../fish/guestfish-actions.pod:1528
18351 "C<maxevents> is the maximum number of events which will be queued up between "
18352 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
18353 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
18354 "default was 16384 events. Beyond this limit, the kernel throws away events, "
18355 "but records the fact that it threw them away by setting a flag "
18356 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
18360 #: ../fish/guestfish-actions.pod:1538
18362 "Before any events are generated, you have to add some watches to the "
18363 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
18364 "L</inotify-watch-all>."
18368 #: ../fish/guestfish-actions.pod:1544
18370 "Queued up events should be read periodically by calling L</inotify-read> (or "
18371 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
18372 "If you don't read the events out often enough then you risk the internal "
18373 "queue overflowing."
18377 #: ../fish/guestfish-actions.pod:1551
18379 "The handle should be closed after use by calling L</inotify-close>. This "
18380 "also removes any watches automatically."
18384 #: ../fish/guestfish-actions.pod:1560
18385 msgid "inotify-read"
18389 #: ../fish/guestfish-actions.pod:1562
18397 #: ../fish/guestfish-actions.pod:1575
18398 msgid "inotify-rm-watch"
18402 #: ../fish/guestfish-actions.pod:1577
18405 " inotify-rm-watch wd\n"
18410 #: ../fish/guestfish-actions.pod:1579
18411 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
18415 #: ../fish/guestfish-actions.pod:1582
18416 msgid "inspect-get-arch"
18420 #: ../fish/guestfish-actions.pod:1584
18423 " inspect-get-arch root\n"
18428 #: ../fish/guestfish-actions.pod:1586 ../fish/guestfish-actions.pod:1602
18429 #: ../fish/guestfish-actions.pod:1648 ../fish/guestfish-actions.pod:1666
18430 #: ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:1702
18431 #: ../fish/guestfish-actions.pod:1725 ../fish/guestfish-actions.pod:1742
18433 "This function should only be called with a root device string as returned by "
18438 #: ../fish/guestfish-actions.pod:1589
18440 "This returns the architecture of the inspected operating system. The "
18441 "possible return values are listed under L</file-architecture>."
18445 #: ../fish/guestfish-actions.pod:1598
18446 msgid "inspect-get-distro"
18450 #: ../fish/guestfish-actions.pod:1600
18453 " inspect-get-distro root\n"
18458 #: ../fish/guestfish-actions.pod:1644
18459 msgid "inspect-get-filesystems"
18463 #: ../fish/guestfish-actions.pod:1646
18466 " inspect-get-filesystems root\n"
18471 #: ../fish/guestfish-actions.pod:1659
18473 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
18474 "get-mountpoints>."
18478 #: ../fish/guestfish-actions.pod:1662
18479 msgid "inspect-get-major-version"
18483 #: ../fish/guestfish-actions.pod:1664
18486 " inspect-get-major-version root\n"
18491 #: ../fish/guestfish-actions.pod:1683
18492 msgid "inspect-get-minor-version"
18496 #: ../fish/guestfish-actions.pod:1685
18499 " inspect-get-minor-version root\n"
18504 #: ../fish/guestfish-actions.pod:1695
18506 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
18507 "get-major-version>."
18511 #: ../fish/guestfish-actions.pod:1698
18512 msgid "inspect-get-mountpoints"
18516 #: ../fish/guestfish-actions.pod:1700
18519 " inspect-get-mountpoints root\n"
18524 #: ../fish/guestfish-actions.pod:1718
18526 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
18527 "get-filesystems>."
18531 #: ../fish/guestfish-actions.pod:1721
18532 msgid "inspect-get-product-name"
18536 #: ../fish/guestfish-actions.pod:1723
18539 " inspect-get-product-name root\n"
18544 #: ../fish/guestfish-actions.pod:1738
18545 msgid "inspect-get-type"
18549 #: ../fish/guestfish-actions.pod:1740
18552 " inspect-get-type root\n"
18557 #: ../fish/guestfish-actions.pod:1769
18562 #: ../fish/guestfish-actions.pod:1771
18570 #: ../fish/guestfish-actions.pod:1786
18572 "You can pass the root string(s) returned to other L</inspect-get-*> "
18573 "functions in order to query further information about each operating system, "
18574 "such as the name and version."
18578 #: ../fish/guestfish-actions.pod:1791
18580 "This function uses other libguestfs features such as L</mount-ro> and L</"
18581 "umount-all> in order to mount and unmount filesystems and look at the "
18582 "contents. This should be called with no disks currently mounted. The "
18583 "function may also use Augeas, so any existing Augeas handle will be closed."
18587 #: ../fish/guestfish-actions.pod:1803 ../fish/guestfish-actions.pod:1957
18588 #: ../fish/guestfish-actions.pod:2003
18589 msgid "See also L</list-filesystems>."
18593 #: ../fish/guestfish-actions.pod:1805
18594 msgid "is-blockdev"
18598 #: ../fish/guestfish-actions.pod:1807
18601 " is-blockdev path\n"
18606 #: ../fish/guestfish-actions.pod:1812 ../fish/guestfish-actions.pod:1830
18607 #: ../fish/guestfish-actions.pod:1849 ../fish/guestfish-actions.pod:1858
18608 #: ../fish/guestfish-actions.pod:1868 ../fish/guestfish-actions.pod:1902
18609 #: ../fish/guestfish-actions.pod:1911
18610 msgid "See also L</stat>."
18614 #: ../fish/guestfish-actions.pod:1814
18619 #: ../fish/guestfish-actions.pod:1816
18627 #: ../fish/guestfish-actions.pod:1823
18632 #: ../fish/guestfish-actions.pod:1825
18635 " is-chardev path\n"
18640 #: ../fish/guestfish-actions.pod:1832
18645 #: ../fish/guestfish-actions.pod:1834
18653 #: ../fish/guestfish-actions.pod:1841
18658 #: ../fish/guestfish-actions.pod:1843
18666 #: ../fish/guestfish-actions.pod:1851
18671 #: ../fish/guestfish-actions.pod:1853
18679 #: ../fish/guestfish-actions.pod:1860
18684 #: ../fish/guestfish-actions.pod:1862
18692 #: ../fish/guestfish-actions.pod:1870
18693 msgid "is-launching"
18697 #: ../fish/guestfish-actions.pod:1872
18705 #: ../fish/guestfish-actions.pod:1879
18710 #: ../fish/guestfish-actions.pod:1881
18718 #: ../fish/guestfish-actions.pod:1886
18723 #: ../fish/guestfish-actions.pod:1888
18731 #: ../fish/guestfish-actions.pod:1895
18736 #: ../fish/guestfish-actions.pod:1897
18739 " is-socket path\n"
18744 #: ../fish/guestfish-actions.pod:1904
18749 #: ../fish/guestfish-actions.pod:1906
18752 " is-symlink path\n"
18757 #: ../fish/guestfish-actions.pod:1913
18758 msgid "kill-subprocess"
18762 #: ../fish/guestfish-actions.pod:1915
18765 " kill-subprocess\n"
18770 #: ../fish/guestfish-actions.pod:1919
18771 msgid "launch | run"
18775 #: ../fish/guestfish-actions.pod:1921
18783 #: ../fish/guestfish-actions.pod:1929
18788 #: ../fish/guestfish-actions.pod:1931
18791 " lchown owner group path\n"
18796 #: ../fish/guestfish-actions.pod:1933
18798 "Change the file owner to C<owner> and group to C<group>. This is like L</"
18799 "chown> but if C<path> is a symlink then the link itself is changed, not the "
18804 #: ../fish/guestfish-actions.pod:1941
18809 #: ../fish/guestfish-actions.pod:1943
18812 " lgetxattrs path\n"
18817 #: ../fish/guestfish-actions.pod:1945
18819 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
18820 "it returns the extended attributes of the link itself."
18824 #: ../fish/guestfish-actions.pod:1949
18825 msgid "list-devices"
18829 #: ../fish/guestfish-actions.pod:1951
18837 #: ../fish/guestfish-actions.pod:1959
18838 msgid "list-filesystems"
18842 #: ../fish/guestfish-actions.pod:1961
18845 " list-filesystems\n"
18850 #: ../fish/guestfish-actions.pod:1980
18852 "This command runs other libguestfs commands, which might include L</mount> "
18853 "and L</umount>, and therefore you should use this soon after launch and only "
18854 "when nothing is mounted."
18858 #: ../fish/guestfish-actions.pod:1984
18860 "Not all of the filesystems returned will be mountable. In particular, swap "
18861 "partitions are returned in the list. Also this command does not check that "
18862 "each filesystem found is valid and mountable, and some filesystems might be "
18863 "mountable but require special options. Filesystems may not all belong to a "
18864 "single logical operating system (use L</inspect-os> to look for OSes)."
18868 #: ../fish/guestfish-actions.pod:1992
18869 msgid "list-partitions"
18873 #: ../fish/guestfish-actions.pod:1994
18876 " list-partitions\n"
18881 #: ../fish/guestfish-actions.pod:2000
18883 "This does not return logical volumes. For that you will need to call L</"
18888 #: ../fish/guestfish-actions.pod:2005
18893 #: ../fish/guestfish-actions.pod:2007
18901 #: ../fish/guestfish-actions.pod:2015
18906 #: ../fish/guestfish-actions.pod:2017
18909 " ln target linkname\n"
18914 #: ../fish/guestfish-actions.pod:2021
18919 #: ../fish/guestfish-actions.pod:2023
18922 " ln-f target linkname\n"
18927 #: ../fish/guestfish-actions.pod:2028
18932 #: ../fish/guestfish-actions.pod:2030
18935 " ln-s target linkname\n"
18940 #: ../fish/guestfish-actions.pod:2034
18945 #: ../fish/guestfish-actions.pod:2036
18948 " ln-sf target linkname\n"
18953 #: ../fish/guestfish-actions.pod:2041
18954 msgid "lremovexattr"
18958 #: ../fish/guestfish-actions.pod:2043
18961 " lremovexattr xattr path\n"
18966 #: ../fish/guestfish-actions.pod:2045
18968 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
18969 "it removes an extended attribute of the link itself."
18973 #: ../fish/guestfish-actions.pod:2049
18978 #: ../fish/guestfish-actions.pod:2051
18986 #: ../fish/guestfish-actions.pod:2057
18988 "This command is mostly useful for interactive sessions. Programs should "
18989 "probably use L</readdir> instead."
18993 #: ../fish/guestfish-actions.pod:2060
18998 #: ../fish/guestfish-actions.pod:2062
19001 " lsetxattr xattr val vallen path\n"
19006 #: ../fish/guestfish-actions.pod:2064
19008 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
19009 "sets an extended attribute of the link itself."
19013 #: ../fish/guestfish-actions.pod:2068
19018 #: ../fish/guestfish-actions.pod:2070
19026 #: ../fish/guestfish-actions.pod:2074
19028 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
19029 "the link is stat-ed, not the file it refers to."
19033 #: ../fish/guestfish-actions.pod:2080
19038 #: ../fish/guestfish-actions.pod:2082
19041 " lstatlist path 'names ...'\n"
19046 #: ../fish/guestfish-actions.pod:2084
19048 "This call allows you to perform the L</lstat> operation on multiple files, "
19049 "where all files are in the directory C<path>. C<names> is the list of files "
19050 "from this directory."
19054 #: ../fish/guestfish-actions.pod:2093
19056 "This call is intended for programs that want to efficiently list a directory "
19057 "contents without making many round-trips. See also L</lxattrlist> for a "
19058 "similarly efficient call for getting extended attributes. Very long "
19059 "directory listings might cause the protocol message size to be exceeded, "
19060 "causing this call to fail. The caller must split up such requests into "
19061 "smaller groups of names."
19065 #: ../fish/guestfish-actions.pod:2101
19066 msgid "luks-add-key"
19070 #: ../fish/guestfish-actions.pod:2103
19073 " luks-add-key device keyslot\n"
19078 #: ../fish/guestfish-actions.pod:2110
19080 "Note that if C<keyslot> already contains a key, then this command will "
19081 "fail. You have to use L</luks-kill-slot> first to remove that key."
19085 #: ../fish/guestfish-actions.pod:2114 ../fish/guestfish-actions.pod:2136
19086 #: ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2163
19087 #: ../fish/guestfish-actions.pod:2186 ../fish/guestfish-actions.pod:2196
19089 "This command has one or more key or passphrase parameters. Guestfish will "
19090 "prompt for these separately."
19094 #: ../fish/guestfish-actions.pod:2117
19099 #: ../fish/guestfish-actions.pod:2119
19102 " luks-close device\n"
19107 #: ../fish/guestfish-actions.pod:2121
19109 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
19110 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
19111 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
19116 #: ../fish/guestfish-actions.pod:2127
19117 msgid "luks-format"
19121 #: ../fish/guestfish-actions.pod:2129
19124 " luks-format device keyslot\n"
19129 #: ../fish/guestfish-actions.pod:2142
19130 msgid "luks-format-cipher"
19134 #: ../fish/guestfish-actions.pod:2144
19137 " luks-format-cipher device keyslot cipher\n"
19142 #: ../fish/guestfish-actions.pod:2146
19144 "This command is the same as L</luks-format> but it also allows you to set "
19145 "the C<cipher> used."
19149 #: ../fish/guestfish-actions.pod:2155
19150 msgid "luks-kill-slot"
19154 #: ../fish/guestfish-actions.pod:2157
19157 " luks-kill-slot device keyslot\n"
19162 #: ../fish/guestfish-actions.pod:2166
19167 #: ../fish/guestfish-actions.pod:2168
19170 " luks-open device mapname\n"
19175 #: ../fish/guestfish-actions.pod:2182
19177 "If this block device contains LVM volume groups, then calling L</vgscan> "
19178 "followed by L</vg-activate-all> will make them visible."
19182 #: ../fish/guestfish-actions.pod:2189
19183 msgid "luks-open-ro"
19187 #: ../fish/guestfish-actions.pod:2191
19190 " luks-open-ro device mapname\n"
19195 #: ../fish/guestfish-actions.pod:2193
19197 "This is the same as L</luks-open> except that a read-only mapping is created."
19201 #: ../fish/guestfish-actions.pod:2199
19206 #: ../fish/guestfish-actions.pod:2201
19209 " lvcreate logvol volgroup mbytes\n"
19214 #: ../fish/guestfish-actions.pod:2206
19215 msgid "lvm-clear-filter"
19219 #: ../fish/guestfish-actions.pod:2208
19222 " lvm-clear-filter\n"
19227 #: ../fish/guestfish-actions.pod:2210
19229 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
19234 #: ../fish/guestfish-actions.pod:2216
19235 msgid "lvm-remove-all"
19239 #: ../fish/guestfish-actions.pod:2218
19242 " lvm-remove-all\n"
19247 #: ../fish/guestfish-actions.pod:2226
19248 msgid "lvm-set-filter"
19252 #: ../fish/guestfish-actions.pod:2228
19255 " lvm-set-filter 'devices ...'\n"
19260 #: ../fish/guestfish-actions.pod:2253
19265 #: ../fish/guestfish-actions.pod:2255
19268 " lvremove device\n"
19273 #: ../fish/guestfish-actions.pod:2263
19278 #: ../fish/guestfish-actions.pod:2265
19281 " lvrename logvol newlogvol\n"
19286 #: ../fish/guestfish-actions.pod:2269
19291 #: ../fish/guestfish-actions.pod:2271
19294 " lvresize device mbytes\n"
19299 #: ../fish/guestfish-actions.pod:2277
19300 msgid "lvresize-free"
19304 #: ../fish/guestfish-actions.pod:2279
19307 " lvresize-free lv percent\n"
19312 #: ../fish/guestfish-actions.pod:2287
19317 #: ../fish/guestfish-actions.pod:2289
19325 #: ../fish/guestfish-actions.pod:2297
19326 msgid "See also L</lvs-full>, L</list-filesystems>."
19330 #: ../fish/guestfish-actions.pod:2299
19335 #: ../fish/guestfish-actions.pod:2301
19343 #: ../fish/guestfish-actions.pod:2306
19348 #: ../fish/guestfish-actions.pod:2308
19356 #: ../fish/guestfish-actions.pod:2312
19361 #: ../fish/guestfish-actions.pod:2314
19364 " lxattrlist path 'names ...'\n"
19369 #: ../fish/guestfish-actions.pod:2330
19371 "This call is intended for programs that want to efficiently list a directory "
19372 "contents without making many round-trips. See also L</lstatlist> for a "
19373 "similarly efficient call for getting standard stats. Very long directory "
19374 "listings might cause the protocol message size to be exceeded, causing this "
19375 "call to fail. The caller must split up such requests into smaller groups of "
19380 #: ../fish/guestfish-actions.pod:2338
19385 #: ../fish/guestfish-actions.pod:2340
19393 #: ../fish/guestfish-actions.pod:2344
19398 #: ../fish/guestfish-actions.pod:2346
19401 " mkdir-mode path mode\n"
19406 #: ../fish/guestfish-actions.pod:2355
19407 msgid "See also L</mkdir>, L</umask>"
19411 #: ../fish/guestfish-actions.pod:2357
19416 #: ../fish/guestfish-actions.pod:2359
19424 #: ../fish/guestfish-actions.pod:2364
19429 #: ../fish/guestfish-actions.pod:2366
19432 " mkdtemp template\n"
19437 #: ../fish/guestfish-actions.pod:2387
19442 #: ../fish/guestfish-actions.pod:2389
19445 " mke2fs-J fstype blocksize device journal\n"
19450 #: ../fish/guestfish-actions.pod:2397
19451 msgid "See also L</mke2journal>."
19455 #: ../fish/guestfish-actions.pod:2399
19460 #: ../fish/guestfish-actions.pod:2401
19463 " mke2fs-JL fstype blocksize device label\n"
19468 #: ../fish/guestfish-actions.pod:2406
19469 msgid "See also L</mke2journal-L>."
19473 #: ../fish/guestfish-actions.pod:2408
19478 #: ../fish/guestfish-actions.pod:2410
19481 " mke2fs-JU fstype blocksize device uuid\n"
19486 #: ../fish/guestfish-actions.pod:2415
19487 msgid "See also L</mke2journal-U>."
19491 #: ../fish/guestfish-actions.pod:2417
19492 msgid "mke2journal"
19496 #: ../fish/guestfish-actions.pod:2419
19499 " mke2journal blocksize device\n"
19504 #: ../fish/guestfish-actions.pod:2426
19505 msgid "mke2journal-L"
19509 #: ../fish/guestfish-actions.pod:2428
19512 " mke2journal-L blocksize label device\n"
19517 #: ../fish/guestfish-actions.pod:2432
19518 msgid "mke2journal-U"
19522 #: ../fish/guestfish-actions.pod:2434
19525 " mke2journal-U blocksize uuid device\n"
19530 #: ../fish/guestfish-actions.pod:2438
19535 #: ../fish/guestfish-actions.pod:2440
19538 " mkfifo mode path\n"
19543 #: ../fish/guestfish-actions.pod:2442
19545 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
19546 "is just a convenient wrapper around L</mknod>."
19550 #: ../fish/guestfish-actions.pod:2448
19555 #: ../fish/guestfish-actions.pod:2450
19558 " mkfs fstype device\n"
19563 #: ../fish/guestfish-actions.pod:2456
19568 #: ../fish/guestfish-actions.pod:2458
19571 " mkfs-b fstype blocksize device\n"
19576 #: ../fish/guestfish-actions.pod:2460
19578 "This call is similar to L</mkfs>, but it allows you to control the block "
19579 "size of the resulting filesystem. Supported block sizes depend on the "
19580 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
19584 #: ../fish/guestfish-actions.pod:2468
19585 msgid "mkmountpoint"
19589 #: ../fish/guestfish-actions.pod:2470
19592 " mkmountpoint exemptpath\n"
19597 #: ../fish/guestfish-actions.pod:2472
19599 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
19600 "to create extra mountpoints before mounting the first filesystem."
19604 #: ../fish/guestfish-actions.pod:2496
19609 #: ../fish/guestfish-actions.pod:2498
19612 " mknod mode devmajor devminor path\n"
19617 #: ../fish/guestfish-actions.pod:2508
19619 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
19620 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
19621 "regular file). These constants are available in the standard Linux header "
19622 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
19623 "wrappers around this command which bitwise OR in the appropriate constant "
19628 #: ../fish/guestfish-actions.pod:2518
19633 #: ../fish/guestfish-actions.pod:2520
19636 " mknod-b mode devmajor devminor path\n"
19641 #: ../fish/guestfish-actions.pod:2522
19643 "This call creates a block device node called C<path> with mode C<mode> and "
19644 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19645 "wrapper around L</mknod>."
19649 #: ../fish/guestfish-actions.pod:2528
19654 #: ../fish/guestfish-actions.pod:2530
19657 " mknod-c mode devmajor devminor path\n"
19662 #: ../fish/guestfish-actions.pod:2532
19664 "This call creates a char device node called C<path> with mode C<mode> and "
19665 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19666 "wrapper around L</mknod>."
19670 #: ../fish/guestfish-actions.pod:2538
19675 #: ../fish/guestfish-actions.pod:2540
19683 #: ../fish/guestfish-actions.pod:2544
19688 #: ../fish/guestfish-actions.pod:2546
19691 " mkswap-L label device\n"
19696 #: ../fish/guestfish-actions.pod:2554
19701 #: ../fish/guestfish-actions.pod:2556
19704 " mkswap-U uuid device\n"
19709 #: ../fish/guestfish-actions.pod:2560
19710 msgid "mkswap-file"
19714 #: ../fish/guestfish-actions.pod:2562
19717 " mkswap-file path\n"
19722 #: ../fish/guestfish-actions.pod:2566
19724 "This command just writes a swap file signature to an existing file. To "
19725 "create the file itself, use something like L</fallocate>."
19729 #: ../fish/guestfish-actions.pod:2569
19734 #: ../fish/guestfish-actions.pod:2571
19737 " modprobe modulename\n"
19742 #: ../fish/guestfish-actions.pod:2578
19747 #: ../fish/guestfish-actions.pod:2580
19750 " mount device mountpoint\n"
19755 #: ../fish/guestfish-actions.pod:2596
19757 "B<Important note:> When you use this call, the filesystem options C<sync> "
19758 "and C<noatime> are set implicitly. This was originally done because we "
19759 "thought it would improve reliability, but it turns out that I<-o sync> has a "
19760 "very large negative performance impact and negligible effect on "
19761 "reliability. Therefore we recommend that you avoid using L</mount> in any "
19762 "code that needs performance, and instead use L</mount-options> (use an empty "
19763 "string for the first parameter if you don't want any options)."
19767 #: ../fish/guestfish-actions.pod:2606
19772 #: ../fish/guestfish-actions.pod:2608
19775 " mount-loop file mountpoint\n"
19780 #: ../fish/guestfish-actions.pod:2614
19781 msgid "mount-options"
19785 #: ../fish/guestfish-actions.pod:2616
19788 " mount-options options device mountpoint\n"
19793 #: ../fish/guestfish-actions.pod:2618
19795 "This is the same as the L</mount> command, but it allows you to set the "
19796 "mount options as for the L<mount(8)> I<-o> flag."
19800 #: ../fish/guestfish-actions.pod:2626
19805 #: ../fish/guestfish-actions.pod:2628
19808 " mount-ro device mountpoint\n"
19813 #: ../fish/guestfish-actions.pod:2630
19815 "This is the same as the L</mount> command, but it mounts the filesystem with "
19816 "the read-only (I<-o ro>) flag."
19820 #: ../fish/guestfish-actions.pod:2633
19825 #: ../fish/guestfish-actions.pod:2635
19828 " mount-vfs options vfstype device mountpoint\n"
19833 #: ../fish/guestfish-actions.pod:2637
19835 "This is the same as the L</mount> command, but it allows you to set both the "
19836 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
19840 #: ../fish/guestfish-actions.pod:2641
19841 msgid "mountpoints"
19845 #: ../fish/guestfish-actions.pod:2643
19853 #: ../fish/guestfish-actions.pod:2645
19855 "This call is similar to L</mounts>. That call returns a list of devices. "
19856 "This one returns a hash table (map) of device name to directory where the "
19857 "device is mounted."
19861 #: ../fish/guestfish-actions.pod:2649
19866 #: ../fish/guestfish-actions.pod:2651
19874 #: ../fish/guestfish-actions.pod:2658
19875 msgid "See also: L</mountpoints>"
19879 #: ../fish/guestfish-actions.pod:2660
19884 #: ../fish/guestfish-actions.pod:2662
19892 #: ../fish/guestfish-actions.pod:2667
19893 msgid "ntfs-3g-probe"
19897 #: ../fish/guestfish-actions.pod:2669
19900 " ntfs-3g-probe true|false device\n"
19905 #: ../fish/guestfish-actions.pod:2683
19910 #: ../fish/guestfish-actions.pod:2685
19913 " ntfsresize device\n"
19918 #: ../fish/guestfish-actions.pod:2691
19919 msgid "ntfsresize-size"
19923 #: ../fish/guestfish-actions.pod:2693
19926 " ntfsresize-size device size\n"
19931 #: ../fish/guestfish-actions.pod:2695
19933 "This command is the same as L</ntfsresize> except that it allows you to "
19934 "specify the new size (in bytes) explicitly."
19938 #: ../fish/guestfish-actions.pod:2698
19943 #: ../fish/guestfish-actions.pod:2700
19946 " part-add device prlogex startsect endsect\n"
19951 #: ../fish/guestfish-actions.pod:2702
19953 "This command adds a partition to C<device>. If there is no partition table "
19954 "on the device, call L</part-init> first."
19958 #: ../fish/guestfish-actions.pod:2714
19960 "Creating a partition which covers the whole disk is not so easy. Use L</"
19961 "part-disk> to do that."
19965 #: ../fish/guestfish-actions.pod:2717
19970 #: ../fish/guestfish-actions.pod:2719
19973 " part-del device partnum\n"
19978 #: ../fish/guestfish-actions.pod:2727
19983 #: ../fish/guestfish-actions.pod:2729
19986 " part-disk device parttype\n"
19991 #: ../fish/guestfish-actions.pod:2731
19993 "This command is simply a combination of L</part-init> followed by L</part-"
19994 "add> to create a single primary partition covering the whole disk."
19998 #: ../fish/guestfish-actions.pod:2735
20000 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
20001 "possible values are described in L</part-init>."
20005 #: ../fish/guestfish-actions.pod:2741
20006 msgid "part-get-bootable"
20010 #: ../fish/guestfish-actions.pod:2743
20013 " part-get-bootable device partnum\n"
20018 #: ../fish/guestfish-actions.pod:2748
20019 msgid "See also L</part-set-bootable>."
20023 #: ../fish/guestfish-actions.pod:2750
20024 msgid "part-get-mbr-id"
20028 #: ../fish/guestfish-actions.pod:2752
20031 " part-get-mbr-id device partnum\n"
20036 #: ../fish/guestfish-actions.pod:2757 ../fish/guestfish-actions.pod:2895
20038 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
20039 "undefined results for other partition table types (see L</part-get-"
20044 #: ../fish/guestfish-actions.pod:2761
20045 msgid "part-get-parttype"
20049 #: ../fish/guestfish-actions.pod:2763
20052 " part-get-parttype device\n"
20057 #: ../fish/guestfish-actions.pod:2768
20059 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
20060 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
20061 "possible, although unusual. See L</part-init> for a full list."
20065 #: ../fish/guestfish-actions.pod:2773
20070 #: ../fish/guestfish-actions.pod:2775
20073 " part-init device parttype\n"
20078 #: ../fish/guestfish-actions.pod:2781
20080 "Initially there are no partitions. Following this, you should call L</part-"
20081 "add> for each partition required."
20085 #: ../fish/guestfish-actions.pod:2844
20090 #: ../fish/guestfish-actions.pod:2846
20093 " part-list device\n"
20098 #: ../fish/guestfish-actions.pod:2861
20100 "Start of the partition I<in bytes>. To get sectors you have to divide by "
20101 "the device's sector size, see L</blockdev-getss>."
20105 #: ../fish/guestfish-actions.pod:2874
20106 msgid "part-set-bootable"
20110 #: ../fish/guestfish-actions.pod:2876
20113 " part-set-bootable device partnum true|false\n"
20118 #: ../fish/guestfish-actions.pod:2885
20119 msgid "part-set-mbr-id"
20123 #: ../fish/guestfish-actions.pod:2887
20126 " part-set-mbr-id device partnum idbyte\n"
20131 #: ../fish/guestfish-actions.pod:2899
20132 msgid "part-set-name"
20136 #: ../fish/guestfish-actions.pod:2901
20139 " part-set-name device partnum name\n"
20144 #: ../fish/guestfish-actions.pod:2909
20145 msgid "part-to-dev"
20149 #: ../fish/guestfish-actions.pod:2911
20152 " part-to-dev partition\n"
20157 #: ../fish/guestfish-actions.pod:2917
20159 "The named partition must exist, for example as a string returned from L</"
20160 "list-partitions>."
20164 #: ../fish/guestfish-actions.pod:2920
20165 msgid "ping-daemon"
20169 #: ../fish/guestfish-actions.pod:2922
20177 #: ../fish/guestfish-actions.pod:2929
20182 #: ../fish/guestfish-actions.pod:2931
20185 " pread path count offset\n"
20190 #: ../fish/guestfish-actions.pod:2939
20191 msgid "See also L</pwrite>."
20195 #: ../fish/guestfish-actions.pod:2944
20200 #: ../fish/guestfish-actions.pod:2946
20203 " pvcreate device\n"
20208 #: ../fish/guestfish-actions.pod:2952
20213 #: ../fish/guestfish-actions.pod:2954
20216 " pvremove device\n"
20221 #: ../fish/guestfish-actions.pod:2963
20226 #: ../fish/guestfish-actions.pod:2965
20229 " pvresize device\n"
20234 #: ../fish/guestfish-actions.pod:2970
20235 msgid "pvresize-size"
20239 #: ../fish/guestfish-actions.pod:2972
20242 " pvresize-size device size\n"
20247 #: ../fish/guestfish-actions.pod:2974
20249 "This command is the same as L</pvresize> except that it allows you to "
20250 "specify the new size (in bytes) explicitly."
20254 #: ../fish/guestfish-actions.pod:2977
20259 #: ../fish/guestfish-actions.pod:2979
20267 #: ../fish/guestfish-actions.pod:2987
20268 msgid "See also L</pvs-full>."
20272 #: ../fish/guestfish-actions.pod:2989
20277 #: ../fish/guestfish-actions.pod:2991
20285 #: ../fish/guestfish-actions.pod:2996
20290 #: ../fish/guestfish-actions.pod:2998
20298 #: ../fish/guestfish-actions.pod:3002
20303 #: ../fish/guestfish-actions.pod:3004
20306 " pwrite path content offset\n"
20311 #: ../fish/guestfish-actions.pod:3015
20312 msgid "See also L</pread>."
20316 #: ../fish/guestfish-actions.pod:3020
20321 #: ../fish/guestfish-actions.pod:3022
20324 " read-file path\n"
20329 #: ../fish/guestfish-actions.pod:3027
20331 "Unlike L</cat>, this function can correctly handle files that contain "
20332 "embedded ASCII NUL characters. However unlike L</download>, this function "
20333 "is limited in the total size of file that can be handled."
20337 #: ../fish/guestfish-actions.pod:3035
20342 #: ../fish/guestfish-actions.pod:3037
20345 " read-lines path\n"
20350 #: ../fish/guestfish-actions.pod:3044
20352 "Note that this function cannot correctly handle binary files (specifically, "
20353 "files containing C<\\0> character which is treated as end of line). For "
20354 "those you need to use the L</read-file> function which has a more complex "
20359 #: ../fish/guestfish-actions.pod:3049
20364 #: ../fish/guestfish-actions.pod:3051
20372 #: ../fish/guestfish-actions.pod:3103
20374 "This function is primarily intended for use by programs. To get a simple "
20375 "list of names, use L</ls>. To get a printable directory for human "
20376 "consumption, use L</ll>."
20380 #: ../fish/guestfish-actions.pod:3107
20385 #: ../fish/guestfish-actions.pod:3109
20393 #: ../fish/guestfish-actions.pod:3113
20394 msgid "readlinklist"
20398 #: ../fish/guestfish-actions.pod:3115
20401 " readlinklist path 'names ...'\n"
20406 #: ../fish/guestfish-actions.pod:3139
20411 #: ../fish/guestfish-actions.pod:3141
20419 #: ../fish/guestfish-actions.pod:3146
20420 msgid "removexattr"
20424 #: ../fish/guestfish-actions.pod:3148
20427 " removexattr xattr path\n"
20432 #: ../fish/guestfish-actions.pod:3153
20433 msgid "See also: L</lremovexattr>, L<attr(5)>."
20437 #: ../fish/guestfish-actions.pod:3155
20442 #: ../fish/guestfish-actions.pod:3157
20445 " resize2fs device\n"
20450 #: ../fish/guestfish-actions.pod:3162
20452 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
20453 "before calling this command. For unknown reasons C<resize2fs> sometimes "
20454 "gives an error about this and sometimes not. In any case, it is always safe "
20455 "to call L</e2fsck-f> before calling this function."
20459 #: ../fish/guestfish-actions.pod:3168
20460 msgid "resize2fs-size"
20464 #: ../fish/guestfish-actions.pod:3170
20467 " resize2fs-size device size\n"
20472 #: ../fish/guestfish-actions.pod:3172
20474 "This command is the same as L</resize2fs> except that it allows you to "
20475 "specify the new size (in bytes) explicitly."
20479 #: ../fish/guestfish-actions.pod:3175
20484 #: ../fish/guestfish-actions.pod:3177
20492 #: ../fish/guestfish-actions.pod:3181
20497 #: ../fish/guestfish-actions.pod:3183
20505 #: ../fish/guestfish-actions.pod:3189
20510 #: ../fish/guestfish-actions.pod:3191
20518 #: ../fish/guestfish-actions.pod:3195
20519 msgid "rmmountpoint"
20523 #: ../fish/guestfish-actions.pod:3197
20526 " rmmountpoint exemptpath\n"
20531 #: ../fish/guestfish-actions.pod:3199
20533 "This calls removes a mountpoint that was previously created with L</"
20534 "mkmountpoint>. See L</mkmountpoint> for full details."
20538 #: ../fish/guestfish-actions.pod:3203
20539 msgid "scrub-device"
20543 #: ../fish/guestfish-actions.pod:3205
20546 " scrub-device device\n"
20551 #: ../fish/guestfish-actions.pod:3216
20556 #: ../fish/guestfish-actions.pod:3218
20559 " scrub-file file\n"
20564 #: ../fish/guestfish-actions.pod:3228
20565 msgid "scrub-freespace"
20569 #: ../fish/guestfish-actions.pod:3230
20572 " scrub-freespace dir\n"
20577 #: ../fish/guestfish-actions.pod:3232
20579 "This command creates the directory C<dir> and then fills it with files until "
20580 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
20581 "deletes them. The intention is to scrub any free space on the partition "
20582 "containing C<dir>."
20586 #: ../fish/guestfish-actions.pod:3241
20587 msgid "set-append | append"
20591 #: ../fish/guestfish-actions.pod:3243
20594 " set-append append\n"
20599 #: ../fish/guestfish-actions.pod:3254
20600 msgid "set-autosync | autosync"
20604 #: ../fish/guestfish-actions.pod:3256
20607 " set-autosync true|false\n"
20612 #: ../fish/guestfish-actions.pod:3258
20614 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
20615 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
20616 "closed (also if the program exits without closing handles)."
20620 #: ../fish/guestfish-actions.pod:3266
20621 msgid "set-direct | direct"
20625 #: ../fish/guestfish-actions.pod:3268
20628 " set-direct true|false\n"
20633 #: ../fish/guestfish-actions.pod:3274
20635 "One consequence of this is that log messages aren't caught by the library "
20636 "and handled by L</set-log-message-callback>, but go straight to stdout."
20640 #: ../fish/guestfish-actions.pod:3283
20641 msgid "set-e2label"
20645 #: ../fish/guestfish-actions.pod:3285
20648 " set-e2label device label\n"
20653 #: ../fish/guestfish-actions.pod:3291
20655 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
20656 "label on a filesystem."
20660 #: ../fish/guestfish-actions.pod:3294
20665 #: ../fish/guestfish-actions.pod:3296
20668 " set-e2uuid device uuid\n"
20673 #: ../fish/guestfish-actions.pod:3303
20675 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
20676 "UUID of a filesystem."
20680 #: ../fish/guestfish-actions.pod:3306
20681 msgid "set-memsize | memsize"
20685 #: ../fish/guestfish-actions.pod:3308
20688 " set-memsize memsize\n"
20693 #: ../fish/guestfish-actions.pod:3310
20695 "This sets the memory size in megabytes allocated to the qemu subprocess. "
20696 "This only has any effect if called before L</launch>."
20700 #: ../fish/guestfish-actions.pod:3321
20701 msgid "set-network | network"
20705 #: ../fish/guestfish-actions.pod:3323
20708 " set-network true|false\n"
20713 #: ../fish/guestfish-actions.pod:3331
20715 "You must call this before calling L</launch>, otherwise it has no effect."
20719 #: ../fish/guestfish-actions.pod:3334
20720 msgid "set-path | path"
20724 #: ../fish/guestfish-actions.pod:3336
20727 " set-path searchpath\n"
20732 #: ../fish/guestfish-actions.pod:3345
20733 msgid "set-qemu | qemu"
20737 #: ../fish/guestfish-actions.pod:3347
20745 #: ../fish/guestfish-actions.pod:3367
20746 msgid "set-recovery-proc | recovery-proc"
20750 #: ../fish/guestfish-actions.pod:3369
20753 " set-recovery-proc true|false\n"
20758 #: ../fish/guestfish-actions.pod:3371
20760 "If this is called with the parameter C<false> then L</launch> does not "
20761 "create a recovery process. The purpose of the recovery process is to stop "
20762 "runaway qemu processes in the case where the main program aborts abruptly."
20766 #: ../fish/guestfish-actions.pod:3376
20768 "This only has any effect if called before L</launch>, and the default is "
20773 #: ../fish/guestfish-actions.pod:3385
20774 msgid "set-selinux | selinux"
20778 #: ../fish/guestfish-actions.pod:3387
20781 " set-selinux true|false\n"
20786 #: ../fish/guestfish-actions.pod:3398
20787 msgid "set-trace | trace"
20791 #: ../fish/guestfish-actions.pod:3400
20794 " set-trace true|false\n"
20799 #: ../fish/guestfish-actions.pod:3416
20800 msgid "set-verbose | verbose"
20804 #: ../fish/guestfish-actions.pod:3418
20807 " set-verbose true|false\n"
20812 #: ../fish/guestfish-actions.pod:3425
20817 #: ../fish/guestfish-actions.pod:3427
20820 " setcon context\n"
20825 #: ../fish/guestfish-actions.pod:3434
20830 #: ../fish/guestfish-actions.pod:3436
20833 " setxattr xattr val vallen path\n"
20838 #: ../fish/guestfish-actions.pod:3442
20839 msgid "See also: L</lsetxattr>, L<attr(5)>."
20843 #: ../fish/guestfish-actions.pod:3444
20848 #: ../fish/guestfish-actions.pod:3446
20851 " sfdisk device cyls heads sectors 'lines ...'\n"
20856 #: ../fish/guestfish-actions.pod:3468
20857 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
20861 #: ../fish/guestfish-actions.pod:3474
20866 #: ../fish/guestfish-actions.pod:3476
20869 " sfdiskM device 'lines ...'\n"
20874 #: ../fish/guestfish-actions.pod:3478
20876 "This is a simplified interface to the L</sfdisk> command, where partition "
20877 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
20878 "you don't need to specify the cyls, heads and sectors parameters which were "
20879 "rarely if ever used anyway."
20883 #: ../fish/guestfish-actions.pod:3484
20884 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
20888 #: ../fish/guestfish-actions.pod:3490
20893 #: ../fish/guestfish-actions.pod:3492
20896 " sfdisk-N device partnum cyls heads sectors line\n"
20901 #: ../fish/guestfish-actions.pod:3497
20903 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
20904 "cyls/heads/sectors parameters."
20908 #: ../fish/guestfish-actions.pod:3500
20909 msgid "See also: L</part-add>"
20913 #: ../fish/guestfish-actions.pod:3505
20914 msgid "sfdisk-disk-geometry"
20918 #: ../fish/guestfish-actions.pod:3507
20921 " sfdisk-disk-geometry device\n"
20926 #: ../fish/guestfish-actions.pod:3509
20928 "This displays the disk geometry of C<device> read from the partition table. "
20929 "Especially in the case where the underlying block device has been resized, "
20930 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
20931 "kernel-geometry>)."
20935 #: ../fish/guestfish-actions.pod:3517
20936 msgid "sfdisk-kernel-geometry"
20940 #: ../fish/guestfish-actions.pod:3519
20943 " sfdisk-kernel-geometry device\n"
20948 #: ../fish/guestfish-actions.pod:3526
20953 #: ../fish/guestfish-actions.pod:3528
20956 " sfdisk-l device\n"
20961 #: ../fish/guestfish-actions.pod:3534
20962 msgid "See also: L</part-list>"
20966 #: ../fish/guestfish-actions.pod:3536
20971 #: ../fish/guestfish-actions.pod:3538
20979 #: ../fish/guestfish-actions.pod:3543
20980 msgid "This is like L</command>, but passes the command to:"
20984 #: ../fish/guestfish-actions.pod:3551
20985 msgid "All the provisos about L</command> apply to this call."
20989 #: ../fish/guestfish-actions.pod:3553
20994 #: ../fish/guestfish-actions.pod:3555
20997 " sh-lines command\n"
21002 #: ../fish/guestfish-actions.pod:3557
21003 msgid "This is the same as L</sh>, but splits the result into a list of lines."
21007 #: ../fish/guestfish-actions.pod:3560
21008 msgid "See also: L</command-lines>"
21012 #: ../fish/guestfish-actions.pod:3562
21017 #: ../fish/guestfish-actions.pod:3564
21025 #: ../fish/guestfish-actions.pod:3568
21030 #: ../fish/guestfish-actions.pod:3570
21038 #: ../fish/guestfish-actions.pod:3576
21043 #: ../fish/guestfish-actions.pod:3578
21051 #: ../fish/guestfish-actions.pod:3586
21056 #: ../fish/guestfish-actions.pod:3588
21064 #: ../fish/guestfish-actions.pod:3596
21069 #: ../fish/guestfish-actions.pod:3598
21072 " strings-e encoding path\n"
21077 #: ../fish/guestfish-actions.pod:3600
21079 "This is like the L</strings> command, but allows you to specify the encoding "
21080 "of strings that are looked for in the source file C<path>."
21084 #: ../fish/guestfish-actions.pod:3610
21086 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
21087 "ISO-8859-X (this is what L</strings> uses)."
21091 #: ../fish/guestfish-actions.pod:3642
21092 msgid "swapoff-device"
21096 #: ../fish/guestfish-actions.pod:3644
21099 " swapoff-device device\n"
21104 #: ../fish/guestfish-actions.pod:3646
21106 "This command disables the libguestfs appliance swap device or partition "
21107 "named C<device>. See L</swapon-device>."
21111 #: ../fish/guestfish-actions.pod:3650
21112 msgid "swapoff-file"
21116 #: ../fish/guestfish-actions.pod:3652
21119 " swapoff-file file\n"
21124 #: ../fish/guestfish-actions.pod:3656
21125 msgid "swapoff-label"
21129 #: ../fish/guestfish-actions.pod:3658
21132 " swapoff-label label\n"
21137 #: ../fish/guestfish-actions.pod:3663
21138 msgid "swapoff-uuid"
21142 #: ../fish/guestfish-actions.pod:3665
21145 " swapoff-uuid uuid\n"
21150 #: ../fish/guestfish-actions.pod:3670
21151 msgid "swapon-device"
21155 #: ../fish/guestfish-actions.pod:3672
21158 " swapon-device device\n"
21163 #: ../fish/guestfish-actions.pod:3674
21165 "This command enables the libguestfs appliance to use the swap device or "
21166 "partition named C<device>. The increased memory is made available for all "
21167 "commands, for example those run using L</command> or L</sh>."
21171 #: ../fish/guestfish-actions.pod:3686
21172 msgid "swapon-file"
21176 #: ../fish/guestfish-actions.pod:3688
21179 " swapon-file file\n"
21184 #: ../fish/guestfish-actions.pod:3690
21186 "This command enables swap to a file. See L</swapon-device> for other notes."
21190 #: ../fish/guestfish-actions.pod:3693
21191 msgid "swapon-label"
21195 #: ../fish/guestfish-actions.pod:3695
21198 " swapon-label label\n"
21203 #: ../fish/guestfish-actions.pod:3697
21205 "This command enables swap to a labeled swap partition. See L</swapon-"
21206 "device> for other notes."
21210 #: ../fish/guestfish-actions.pod:3700
21211 msgid "swapon-uuid"
21215 #: ../fish/guestfish-actions.pod:3702
21218 " swapon-uuid uuid\n"
21223 #: ../fish/guestfish-actions.pod:3704
21225 "This command enables swap to a swap partition with the given UUID. See L</"
21226 "swapon-device> for other notes."
21230 #: ../fish/guestfish-actions.pod:3707
21235 #: ../fish/guestfish-actions.pod:3709
21243 #: ../fish/guestfish-actions.pod:3717
21248 #: ../fish/guestfish-actions.pod:3719
21256 #: ../fish/guestfish-actions.pod:3727
21261 #: ../fish/guestfish-actions.pod:3729
21264 " tail-n nrlines path\n"
21269 #: ../fish/guestfish-actions.pod:3742
21274 #: ../fish/guestfish-actions.pod:3744
21277 " tar-in (tarfile|-) directory\n"
21282 #: ../fish/guestfish-actions.pod:3749
21283 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
21287 #: ../fish/guestfish-actions.pod:3754
21292 #: ../fish/guestfish-actions.pod:3756
21295 " tar-out directory (tarfile|-)\n"
21300 #: ../fish/guestfish-actions.pod:3761
21301 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
21305 #: ../fish/guestfish-actions.pod:3766
21310 #: ../fish/guestfish-actions.pod:3768
21313 " tgz-in (tarball|-) directory\n"
21318 #: ../fish/guestfish-actions.pod:3773
21319 msgid "To upload an uncompressed tarball, use L</tar-in>."
21323 #: ../fish/guestfish-actions.pod:3777
21328 #: ../fish/guestfish-actions.pod:3779
21331 " tgz-out directory (tarball|-)\n"
21336 #: ../fish/guestfish-actions.pod:3784
21337 msgid "To download an uncompressed tarball, use L</tar-out>."
21341 #: ../fish/guestfish-actions.pod:3788
21346 #: ../fish/guestfish-actions.pod:3790
21354 #: ../fish/guestfish-actions.pod:3799
21359 #: ../fish/guestfish-actions.pod:3801
21367 #: ../fish/guestfish-actions.pod:3806
21368 msgid "truncate-size"
21372 #: ../fish/guestfish-actions.pod:3808
21375 " truncate-size path size\n"
21380 #: ../fish/guestfish-actions.pod:3813
21382 "If the current file size is less than C<size> then the file is extended to "
21383 "the required size with zero bytes. This creates a sparse file (ie. disk "
21384 "blocks are not allocated for the file until you write to it). To create a "
21385 "non-sparse file of zeroes, use L</fallocate64> instead."
21389 #: ../fish/guestfish-actions.pod:3819
21394 #: ../fish/guestfish-actions.pod:3821
21397 " tune2fs-l device\n"
21402 #: ../fish/guestfish-actions.pod:3831
21407 #: ../fish/guestfish-actions.pod:3833
21410 " txz-in (tarball|-) directory\n"
21415 #: ../fish/guestfish-actions.pod:3840
21420 #: ../fish/guestfish-actions.pod:3842
21423 " txz-out directory (tarball|-)\n"
21428 #: ../fish/guestfish-actions.pod:3849
21433 #: ../fish/guestfish-actions.pod:3851
21441 #: ../fish/guestfish-actions.pod:3865
21442 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
21446 #: ../fish/guestfish-actions.pod:3870
21447 msgid "umount | unmount"
21451 #: ../fish/guestfish-actions.pod:3872
21454 " umount pathordevice\n"
21459 #: ../fish/guestfish-actions.pod:3878
21460 msgid "umount-all | unmount-all"
21464 #: ../fish/guestfish-actions.pod:3880
21472 #: ../fish/guestfish-actions.pod:3886
21477 #: ../fish/guestfish-actions.pod:3888
21480 " upload (filename|-) remotefilename\n"
21485 #: ../fish/guestfish-actions.pod:3895
21486 msgid "See also L</download>."
21490 #: ../fish/guestfish-actions.pod:3899
21495 #: ../fish/guestfish-actions.pod:3901
21498 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
21503 #: ../fish/guestfish-actions.pod:3920
21508 #: ../fish/guestfish-actions.pod:3922
21516 #: ../fish/guestfish-actions.pod:3949
21518 "I<Note:> Don't use this call to test for availability of features. In "
21519 "enterprise distributions we backport features from later versions into "
21520 "earlier versions, making this an unreliable way to test for features. Use "
21521 "L</available> instead."
21525 #: ../fish/guestfish-actions.pod:3955
21530 #: ../fish/guestfish-actions.pod:3957
21533 " vfs-label device\n"
21538 #: ../fish/guestfish-actions.pod:3964
21539 msgid "To find a filesystem from the label, use L</findfs-label>."
21543 #: ../fish/guestfish-actions.pod:3966
21548 #: ../fish/guestfish-actions.pod:3968
21551 " vfs-type device\n"
21556 #: ../fish/guestfish-actions.pod:3978
21561 #: ../fish/guestfish-actions.pod:3980
21564 " vfs-uuid device\n"
21569 #: ../fish/guestfish-actions.pod:3987
21570 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
21574 #: ../fish/guestfish-actions.pod:3989
21575 msgid "vg-activate"
21579 #: ../fish/guestfish-actions.pod:3991
21582 " vg-activate true|false 'volgroups ...'\n"
21587 #: ../fish/guestfish-actions.pod:4004
21588 msgid "vg-activate-all"
21592 #: ../fish/guestfish-actions.pod:4006
21595 " vg-activate-all true|false\n"
21600 #: ../fish/guestfish-actions.pod:4016
21605 #: ../fish/guestfish-actions.pod:4018
21608 " vgcreate volgroup 'physvols ...'\n"
21613 #: ../fish/guestfish-actions.pod:4023
21618 #: ../fish/guestfish-actions.pod:4025
21621 " vglvuuids vgname\n"
21626 #: ../fish/guestfish-actions.pod:4030
21628 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
21629 "logical volumes and volume groups."
21633 #: ../fish/guestfish-actions.pod:4033
21634 msgid "See also L</vgpvuuids>."
21638 #: ../fish/guestfish-actions.pod:4035
21643 #: ../fish/guestfish-actions.pod:4037
21646 " vgpvuuids vgname\n"
21651 #: ../fish/guestfish-actions.pod:4042
21653 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
21654 "physical volumes and volume groups."
21658 #: ../fish/guestfish-actions.pod:4045
21659 msgid "See also L</vglvuuids>."
21663 #: ../fish/guestfish-actions.pod:4047
21668 #: ../fish/guestfish-actions.pod:4049
21671 " vgremove vgname\n"
21676 #: ../fish/guestfish-actions.pod:4056
21681 #: ../fish/guestfish-actions.pod:4058
21684 " vgrename volgroup newvolgroup\n"
21689 #: ../fish/guestfish-actions.pod:4062
21694 #: ../fish/guestfish-actions.pod:4064
21702 #: ../fish/guestfish-actions.pod:4072
21703 msgid "See also L</vgs-full>."
21707 #: ../fish/guestfish-actions.pod:4074
21712 #: ../fish/guestfish-actions.pod:4076
21720 #: ../fish/guestfish-actions.pod:4081
21725 #: ../fish/guestfish-actions.pod:4083
21733 #: ../fish/guestfish-actions.pod:4088
21738 #: ../fish/guestfish-actions.pod:4090
21746 #: ../fish/guestfish-actions.pod:4094
21751 #: ../fish/guestfish-actions.pod:4096
21759 #: ../fish/guestfish-actions.pod:4101
21764 #: ../fish/guestfish-actions.pod:4103
21772 #: ../fish/guestfish-actions.pod:4108
21777 #: ../fish/guestfish-actions.pod:4110
21785 #: ../fish/guestfish-actions.pod:4115
21790 #: ../fish/guestfish-actions.pod:4117
21793 " write path content\n"
21798 #: ../fish/guestfish-actions.pod:4125
21803 #: ../fish/guestfish-actions.pod:4127
21806 " write-file path content size\n"
21811 #: ../fish/guestfish-actions.pod:4150
21816 #: ../fish/guestfish-actions.pod:4152
21819 " zegrep regex path\n"
21824 #: ../fish/guestfish-actions.pod:4160
21829 #: ../fish/guestfish-actions.pod:4162
21832 " zegrepi regex path\n"
21837 #: ../fish/guestfish-actions.pod:4170
21842 #: ../fish/guestfish-actions.pod:4172
21850 #: ../fish/guestfish-actions.pod:4180
21851 msgid "See also: L</zero-device>, L</scrub-device>."
21855 #: ../fish/guestfish-actions.pod:4182
21856 msgid "zero-device"
21860 #: ../fish/guestfish-actions.pod:4184
21863 " zero-device device\n"
21868 #: ../fish/guestfish-actions.pod:4186
21870 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
21871 "which just zeroes the first few blocks of a device."
21875 #: ../fish/guestfish-actions.pod:4193
21880 #: ../fish/guestfish-actions.pod:4195
21883 " zerofree device\n"
21888 #: ../fish/guestfish-actions.pod:4208
21893 #: ../fish/guestfish-actions.pod:4210
21896 " zfgrep pattern path\n"
21901 #: ../fish/guestfish-actions.pod:4218
21906 #: ../fish/guestfish-actions.pod:4220
21909 " zfgrepi pattern path\n"
21914 #: ../fish/guestfish-actions.pod:4228
21919 #: ../fish/guestfish-actions.pod:4230
21922 " zfile meth path\n"
21927 #: ../fish/guestfish-actions.pod:4237
21929 "Since 1.0.63, use L</file> instead which can now process compressed files."
21933 #: ../fish/guestfish-actions.pod:4247
21938 #: ../fish/guestfish-actions.pod:4249
21941 " zgrep regex path\n"
21946 #: ../fish/guestfish-actions.pod:4257
21951 #: ../fish/guestfish-actions.pod:4259
21954 " zgrepi regex path\n"
21959 #: ../fish/guestfish-commands.pod:1
21964 #: ../fish/guestfish-commands.pod:3
21969 #: ../fish/guestfish-commands.pod:5
21972 " alloc filename size\n"
21977 #: ../fish/guestfish-commands.pod:7
21979 "This creates an empty (zeroed) file of the given size, and then adds so it "
21980 "can be further examined."
21984 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:132
21985 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
21989 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:134
21990 msgid "Size can be specified using standard suffixes, eg. C<1M>."
21994 #: ../fish/guestfish-commands.pod:14
21996 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
21997 "image, see L</PREPARED DISK IMAGES>."
22001 #: ../fish/guestfish-commands.pod:17
22006 #: ../fish/guestfish-commands.pod:19
22009 " copy-in local [local ...] /remotedir\n"
22014 #: ../fish/guestfish-commands.pod:21
22016 "C<copy-in> copies local files or directories recursively into the disk "
22017 "image, placing them in the directory called C</remotedir> (which must "
22018 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
22019 "other commands as necessary."
22023 #: ../fish/guestfish-commands.pod:26
22025 "Multiple local files and directories can be specified, but the last "
22026 "parameter must always be a remote directory. Wildcards cannot be used."
22030 #: ../fish/guestfish-commands.pod:30
22035 #: ../fish/guestfish-commands.pod:32
22038 " copy-out remote [remote ...] localdir\n"
22043 #: ../fish/guestfish-commands.pod:34
22045 "C<copy-out> copies remote files or directories recursively out of the disk "
22046 "image, placing them on the host disk in a local directory called C<localdir> "
22047 "(which must exist). This guestfish meta-command turns into a sequence of L</"
22048 "download>, L</tar-out> and other commands as necessary."
22052 #: ../fish/guestfish-commands.pod:40
22054 "Multiple remote files and directories can be specified, but the last "
22055 "parameter must always be a local directory. To download to the current "
22056 "directory, use C<.> as in:"
22060 #: ../fish/guestfish-commands.pod:44
22063 " copy-out /home .\n"
22068 #: ../fish/guestfish-commands.pod:46
22070 "Wildcards cannot be used in the ordinary command, but you can use them with "
22071 "the help of L</glob> like this:"
22075 #: ../fish/guestfish-commands.pod:49
22078 " glob copy-out /home/* .\n"
22083 #: ../fish/guestfish-commands.pod:51
22088 #: ../fish/guestfish-commands.pod:53
22091 " echo [params ...]\n"
22096 #: ../fish/guestfish-commands.pod:55
22097 msgid "This echos the parameters to the terminal."
22101 #: ../fish/guestfish-commands.pod:57
22106 #: ../fish/guestfish-commands.pod:59
22111 #: ../fish/guestfish-commands.pod:61
22116 #: ../fish/guestfish-commands.pod:63
22124 #: ../fish/guestfish-commands.pod:65
22126 "This is used to edit a file. It downloads the file, edits it locally using "
22127 "your editor, then uploads the result."
22131 #: ../fish/guestfish-commands.pod:68
22133 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
22134 "or C<emacs> you will get those corresponding editors."
22138 #: ../fish/guestfish-commands.pod:72
22143 #: ../fish/guestfish-commands.pod:74
22146 " glob command args...\n"
22151 #: ../fish/guestfish-commands.pod:76
22153 "Expand wildcards in any paths in the args list, and run C<command> "
22154 "repeatedly on each matching path."
22158 #: ../fish/guestfish-commands.pod:79
22159 msgid "See L</WILDCARDS AND GLOBBING>."
22163 #: ../fish/guestfish-commands.pod:81
22168 #: ../fish/guestfish-commands.pod:83
22176 #: ../fish/guestfish-commands.pod:85
22178 "Change the local directory, ie. the current directory of guestfish itself."
22182 #: ../fish/guestfish-commands.pod:88
22183 msgid "Note that C<!cd> won't do what you might expect."
22187 #: ../fish/guestfish-commands.pod:90
22192 #: ../fish/guestfish-commands.pod:92
22197 #: ../fish/guestfish-commands.pod:94
22205 #: ../fish/guestfish-commands.pod:96
22206 msgid "Opens the manual page for guestfish."
22210 #: ../fish/guestfish-commands.pod:98
22215 #: ../fish/guestfish-commands.pod:100
22220 #: ../fish/guestfish-commands.pod:102
22228 #: ../fish/guestfish-commands.pod:104
22236 #: ../fish/guestfish-commands.pod:106
22237 msgid "This is used to view a file."
22241 #: ../fish/guestfish-commands.pod:108
22243 "The default viewer is C<$PAGER>. However if you use the alternate command "
22244 "C<less> you will get the C<less> command specifically."
22248 #: ../fish/guestfish-commands.pod:111
22253 #: ../fish/guestfish-commands.pod:113
22261 #: ../fish/guestfish-commands.pod:115
22263 "Close and reopen the libguestfs handle. It is not necessary to use this "
22264 "normally, because the handle is closed properly when guestfish exits. "
22265 "However this is occasionally useful for testing."
22269 #: ../fish/guestfish-commands.pod:119
22274 #: ../fish/guestfish-commands.pod:121
22277 " sparse filename size\n"
22282 #: ../fish/guestfish-commands.pod:123
22284 "This creates an empty sparse file of the given size, and then adds so it can "
22285 "be further examined."
22289 #: ../fish/guestfish-commands.pod:126
22291 "In all respects it works the same as the L</alloc> command, except that the "
22292 "image file is allocated sparsely, which means that disk blocks are not "
22293 "assigned to the file until they are needed. Sparse disk files only use "
22294 "space when written to, but they are slower and there is a danger you could "
22295 "run out of real disk space during a write operation."
22299 #: ../fish/guestfish-commands.pod:136
22304 #: ../fish/guestfish-commands.pod:138
22312 #: ../fish/guestfish-commands.pod:140
22314 "This command returns a list of the optional groups known to the daemon, and "
22315 "indicates which ones are supported by this build of the libguestfs appliance."
22319 #: ../fish/guestfish-commands.pod:144
22320 msgid "See also L<guestfs(3)/AVAILABILITY>."
22324 #: ../fish/guestfish-commands.pod:146
22329 #: ../fish/guestfish-commands.pod:148
22332 " time command args...\n"
22337 #: ../fish/guestfish-commands.pod:150
22339 "Run the command as usual, but print the elapsed time afterwards. This can "
22340 "be useful for benchmarking operations."
22344 #: ../test-tool/libguestfs-test-tool.pod:5
22345 msgid "libguestfs-test-tool - End user tests for libguestfs"
22349 #: ../test-tool/libguestfs-test-tool.pod:9
22352 " libguestfs-test-tool [--options]\n"
22357 #: ../test-tool/libguestfs-test-tool.pod:13
22359 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
22360 "and developers, to allow them to check basic libguestfs functionality is "
22361 "working. This is needed because libguestfs occasionally breaks for reasons "
22362 "beyond our control: usually because of changes in the underlying qemu or "
22363 "kernel packages, or the host environment."
22367 #: ../test-tool/libguestfs-test-tool.pod:20
22368 msgid "If you suspect a problem in libguestfs, then just run:"
22372 #: ../test-tool/libguestfs-test-tool.pod:22
22375 " libguestfs-test-tool\n"
22380 #: ../test-tool/libguestfs-test-tool.pod:24
22381 msgid "It will print lots of diagnostic messages."
22385 #: ../test-tool/libguestfs-test-tool.pod:26
22386 msgid "If it runs to completion successfully, you will see this near the end:"
22390 #: ../test-tool/libguestfs-test-tool.pod:28
22393 " ===== TEST FINISHED OK =====\n"
22398 #: ../test-tool/libguestfs-test-tool.pod:30
22399 msgid "and the test tool will exit with code 0."
22403 #: ../test-tool/libguestfs-test-tool.pod:32
22405 "If it fails (and/or exits with non-zero error code), please paste the "
22406 "B<complete, unedited> output of the test tool into a bug report. More "
22407 "information about reporting bugs can be found on the L<http://libguestfs.org/"
22412 #: ../test-tool/libguestfs-test-tool.pod:41
22417 #: ../test-tool/libguestfs-test-tool.pod:43
22418 msgid "Display short usage information and exit."
22422 #: ../test-tool/libguestfs-test-tool.pod:45
22423 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
22427 #: ../test-tool/libguestfs-test-tool.pod:47
22429 "Pass an alternate name for the helper program. libguestfs-test-tool will "
22430 "normally look in the C<$libexec> directory that was configured when the tool "
22435 #: ../test-tool/libguestfs-test-tool.pod:51
22436 msgid "I<--qemu qemu_binary>"
22440 #: ../test-tool/libguestfs-test-tool.pod:53
22442 "If you have downloaded another qemu binary, point this option at the full "
22443 "path of the binary to try it."
22447 #: ../test-tool/libguestfs-test-tool.pod:56
22448 msgid "I<--qemudir qemu_source_dir>"
22452 #: ../test-tool/libguestfs-test-tool.pod:58
22454 "If you have compiled qemu from source, point this option at the source "
22455 "directory to try it."
22459 #: ../test-tool/libguestfs-test-tool.pod:61
22460 msgid "I<--timeout N>"
22464 #: ../test-tool/libguestfs-test-tool.pod:63
22466 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
22467 "does not usually need to be adjusted unless your machine is very slow."
22471 #: ../test-tool/libguestfs-test-tool.pod:69
22472 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
22476 #: ../test-tool/libguestfs-test-tool.pod:71
22478 "If you have compiled another version of qemu from source and would like to "
22479 "try that, then you can use the I<--qemudir> option to point to the qemu "
22480 "source directory."
22484 #: ../test-tool/libguestfs-test-tool.pod:75
22486 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
22487 "option to point to the binary."
22491 #: ../test-tool/libguestfs-test-tool.pod:78
22493 "When using an alternate qemu with libguestfs, usually you would need to "
22494 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
22495 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
22496 "use either of the I<--qemudir> or I<--qemu> options."
22500 #: ../test-tool/libguestfs-test-tool.pod:85
22502 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
22503 "I<1> if there was an error."
22507 #: ../test-tool/libguestfs-test-tool.pod:92
22508 msgid "/usr/libexec/libguestfs-test-tool-helper"
22512 #: ../test-tool/libguestfs-test-tool.pod:94
22514 "This helper program is run inside the appliance and provides additional "
22519 #: ../test-tool/libguestfs-test-tool.pod:97
22520 msgid "/usr/bin/mkisofs"
22524 #: ../test-tool/libguestfs-test-tool.pod:99
22526 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
22527 "which is used as part of the tests."
22531 #: ../test-tool/libguestfs-test-tool.pod:106
22533 "For the full list of environment variables which may affect libguestfs, "
22534 "please see the L<guestfs(3)> manual page."
22538 #: ../test-tool/libguestfs-test-tool.pod:111
22539 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
22543 #: ../test-tool/libguestfs-test-tool.pod:121 ../fuse/guestmount.pod:195
22544 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
22548 #: ../fuse/guestmount.pod:5
22550 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
22554 #: ../fuse/guestmount.pod:9
22557 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
22562 #: ../fuse/guestmount.pod:13
22564 "You must I<not> use C<guestmount> in read-write mode on live virtual "
22565 "machines. If you do this, you risk disk corruption in the VM."
22569 #: ../fuse/guestmount.pod:18
22571 "The guestmount program can be used to mount virtual machine filesystems and "
22572 "other disk images on the host. It uses libguestfs for access to the guest "
22573 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
22574 "a mountable device."
22578 #: ../fuse/guestmount.pod:23
22580 "Along with other options, you have to give at least one device (I<-a> "
22581 "option) and at least one mountpoint (I<-m> option). How this works is "
22582 "better explained in the L<guestfish(1)> manual page, or you can use L<virt-"
22583 "inspector(1)> and/or the wrapper script C<guestmount-wrapper> to help you."
22587 #: ../fuse/guestmount.pod:29
22589 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
22590 "by you, and the filesystem will not be visible to any other users unless you "
22591 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
22592 "the filesystem, use the C<fusermount -u> command."
22596 #: ../fuse/guestmount.pod:37
22598 "For a typical Windows guest which has its main filesystem on the first "
22603 #: ../fuse/guestmount.pod:40
22606 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
22611 #: ../fuse/guestmount.pod:42
22613 "For a typical Linux guest which has a /boot filesystem on the first "
22614 "partition, and the root filesystem on a logical volume:"
22618 #: ../fuse/guestmount.pod:45
22621 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
22626 #: ../fuse/guestmount.pod:47
22628 "To get L<virt-inspector(1)> to do the hard work of detecting guest "
22629 "mountpoints for you:"
22633 #: ../fuse/guestmount.pod:50
22636 " guestmount $(virt-inspector --ro-fish MyGuest) /mnt\n"
22641 #: ../fuse/guestmount.pod:52
22643 "(or use --fish if you don't want it to be a read only mount). The option is "
22644 "called I<--ro-fish> or I<--fish> because these parameters are compatible "
22645 "with L<guestfish(1)>."
22649 #: ../fuse/guestmount.pod:56
22651 "If you don't know what filesystems are contained in a guest or disk image, "
22652 "use L<virt-list-filesystems(1)> first:"
22656 #: ../fuse/guestmount.pod:59
22659 " virt-list-filesystems MyGuest\n"
22664 #: ../fuse/guestmount.pod:61
22666 "If you want to trace the libguestfs calls but without excessive debugging, "
22671 #: ../fuse/guestmount.pod:64
22674 " guestmount [-a ... -m ...] --trace /mnt\n"
22679 #: ../fuse/guestmount.pod:66
22680 msgid "If you want to debug the program, we recommend:"
22684 #: ../fuse/guestmount.pod:68
22687 " guestmount [-a ... -m ...] --trace --verbose /mnt\n"
22692 #: ../fuse/guestmount.pod:76
22693 msgid "Add a block device or virtual machine image."
22697 #: ../fuse/guestmount.pod:78
22698 msgid "B<--dir-cache-timeout N>"
22702 #: ../fuse/guestmount.pod:80
22704 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22705 "seconds. The readdir cache [actually, there are several semi-independent "
22706 "caches] is populated after a readdir(2) call with the stat and extended "
22707 "attributes of the files in the directory, in anticipation that they will be "
22708 "requested soon after."
22712 #: ../fuse/guestmount.pod:86
22714 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22715 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22716 "requests, only cache existing ones."
22720 #: ../fuse/guestmount.pod:90
22721 msgid "B<--fuse-help>"
22725 #: ../fuse/guestmount.pod:92
22726 msgid "Display help on special FUSE options (see I<-o> below)."
22730 #: ../fuse/guestmount.pod:96
22731 msgid "Display brief help and exit."
22735 #: ../fuse/guestmount.pod:98
22736 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
22740 #: ../fuse/guestmount.pod:100
22742 "Mount the named partition or logical volume on the given mountpoint B<in the "
22743 "guest> (this has nothing to do with mountpoints in the host)."
22747 #: ../fuse/guestmount.pod:103
22749 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22750 "something on C</>."
22754 #: ../fuse/guestmount.pod:108
22756 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22757 "unmounted. If you specify this option, then we don't attempt to sync the "
22758 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22762 #: ../fuse/guestmount.pod:113
22763 msgid "B<-o option> | B<--option option>"
22767 #: ../fuse/guestmount.pod:115
22768 msgid "Pass extra options to FUSE."
22772 #: ../fuse/guestmount.pod:117
22774 "To get a list of all the extra options supported by FUSE, use the command "
22775 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22776 "of them are a good idea."
22780 #: ../fuse/guestmount.pod:121
22783 " guestmount --fuse-help\n"
22788 #: ../fuse/guestmount.pod:123
22789 msgid "Some potentially useful FUSE options:"
22793 #: ../fuse/guestmount.pod:127
22794 msgid "B<-o allow_other>"
22798 #: ../fuse/guestmount.pod:129
22799 msgid "Allow other users to see the filesystem."
22803 #: ../fuse/guestmount.pod:131
22804 msgid "B<-o attr_timeout=N>"
22808 #: ../fuse/guestmount.pod:133
22809 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22813 #: ../fuse/guestmount.pod:135
22814 msgid "B<-o kernel_cache>"
22818 #: ../fuse/guestmount.pod:137
22820 "Allow the kernel to cache files (reduces the number of reads that have to go "
22821 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22822 "afford the extra memory usage."
22826 #: ../fuse/guestmount.pod:141
22827 msgid "B<-o uid=N> B<-o gid=N>"
22831 #: ../fuse/guestmount.pod:143
22833 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22834 "the chosen values."
22838 #: ../fuse/guestmount.pod:150
22840 "Add devices and mount everything read-only. Also disallow writes and make "
22841 "the disk appear read-only to FUSE."
22845 #: ../fuse/guestmount.pod:153
22847 "This is highly recommended if you are not going to edit the guest disk. If "
22848 "the guest is running and this option is I<not> supplied, then there is a "
22849 "strong risk of disk corruption in the guest. We try to prevent this from "
22850 "happening, but it is not always possible."
22854 #: ../fuse/guestmount.pod:160
22855 msgid "Enable SELinux support for the guest."
22859 #: ../fuse/guestmount.pod:162
22864 #: ../fuse/guestmount.pod:164
22865 msgid "Trace libguestfs calls (to stderr)."
22869 #: ../fuse/guestmount.pod:166
22870 msgid "This also stops the daemon from forking into the background."
22874 #: ../fuse/guestmount.pod:170
22875 msgid "Enable verbose messages from underlying libguestfs."
22879 #: ../fuse/guestmount.pod:174
22880 msgid "Display the program version and exit."
22884 #: ../fuse/guestmount.pod:180
22886 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22887 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
22892 #: ../inspector/virt-inspector.pl:40
22894 "virt-inspector - Display OS version, kernel, drivers, mount points, "
22895 "applications, etc. in a virtual machine"
22899 #: ../inspector/virt-inspector.pl:44
22902 " virt-inspector [--connect URI] domname\n"
22907 #: ../inspector/virt-inspector.pl:46
22910 " virt-inspector guest.img [guest.img ...]\n"
22915 #: ../inspector/virt-inspector.pl:50
22917 "B<virt-inspector> examines a virtual machine and tries to determine the "
22918 "version of the OS, the kernel version, what drivers are installed, whether "
22919 "the virtual machine is fully virtualized (FV) or para-virtualized (PV), what "
22920 "applications are installed and more."
22924 #: ../inspector/virt-inspector.pl:55
22926 "Virt-inspector can produce output in several formats, including a readable "
22927 "text report, and XML for feeding into other programs."
22931 #: ../inspector/virt-inspector.pl:58
22933 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
22934 "libvirt domain (see: C<virsh list --all>)."
22938 #: ../inspector/virt-inspector.pl:61
22940 "You can also run virt-inspector directly on disk images from a single "
22941 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
22942 "has several block devices, in which case you should list them one after "
22943 "another, with the first corresponding to the guest's C</dev/sda>, the second "
22944 "to the guest's C</dev/sdb> and so on."
22948 #: ../inspector/virt-inspector.pl:67
22950 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22951 "inspect several virtual machines, you have to run virt-inspector several "
22952 "times (for example, from a shell script for-loop)."
22956 #: ../inspector/virt-inspector.pl:72
22958 "Because virt-inspector needs direct access to guest images, it won't "
22959 "normally work over remote libvirt connections."
22963 #: ../inspector/virt-inspector.pl:85 ../tools/virt-cat.pl:90
22964 #: ../tools/virt-df.pl:81 ../tools/virt-edit.pl:83
22965 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-list-partitions.pl:61
22966 #: ../tools/virt-ls.pl:89 ../tools/virt-make-fs.pl:163
22967 #: ../tools/virt-rescue.pl:113 ../tools/virt-tar.pl:109
22968 #: ../tools/virt-win-reg.pl:182
22969 msgid "Display brief help."
22973 #: ../inspector/virt-inspector.pl:91 ../tools/virt-cat.pl:96
22974 #: ../tools/virt-df.pl:87 ../tools/virt-edit.pl:89
22975 #: ../tools/virt-list-filesystems.pl:66 ../tools/virt-list-partitions.pl:67
22976 #: ../tools/virt-ls.pl:95 ../tools/virt-make-fs.pl:169
22977 #: ../tools/virt-rescue.pl:119 ../tools/virt-resize.pl:249
22978 #: ../tools/virt-tar.pl:115 ../tools/virt-win-reg.pl:188
22979 msgid "B<--version>"
22983 #: ../inspector/virt-inspector.pl:93 ../tools/virt-cat.pl:98
22984 #: ../tools/virt-df.pl:89 ../tools/virt-edit.pl:91
22985 #: ../tools/virt-list-filesystems.pl:68 ../tools/virt-list-partitions.pl:69
22986 #: ../tools/virt-ls.pl:97 ../tools/virt-make-fs.pl:171
22987 #: ../tools/virt-rescue.pl:121 ../tools/virt-resize.pl:251
22988 #: ../tools/virt-tar.pl:117 ../tools/virt-win-reg.pl:190
22989 msgid "Display version number and exit."
22993 #: ../inspector/virt-inspector.pl:99 ../tools/virt-cat.pl:104
22994 #: ../tools/virt-df.pl:95 ../tools/virt-edit.pl:113
22995 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-list-partitions.pl:75
22996 #: ../tools/virt-ls.pl:103 ../tools/virt-rescue.pl:135
22997 #: ../tools/virt-tar.pl:123 ../tools/virt-win-reg.pl:204
22998 msgid "B<--connect URI> | B<-c URI>"
23002 #: ../inspector/virt-inspector.pl:101 ../tools/virt-cat.pl:106
23003 #: ../tools/virt-df.pl:97 ../tools/virt-edit.pl:115
23004 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-list-partitions.pl:77
23005 #: ../tools/virt-ls.pl:105 ../tools/virt-rescue.pl:137
23006 #: ../tools/virt-tar.pl:125 ../tools/virt-win-reg.pl:206
23008 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
23009 "to the default libvirt hypervisor."
23013 #: ../inspector/virt-inspector.pl:104
23015 "Libvirt is only used if you specify a C<domname> on the command line. If "
23016 "you specify guest block devices directly, then libvirt is not used at all."
23020 #: ../inspector/virt-inspector.pl:114
23022 "The following options select the output format. Use only one of them. The "
23023 "default is a readable text report."
23027 #: ../inspector/virt-inspector.pl:119
23028 msgid "B<--text> (default)"
23032 #: ../inspector/virt-inspector.pl:121
23033 msgid "Plain text report."
23037 #: ../inspector/virt-inspector.pl:123
23042 #: ../inspector/virt-inspector.pl:125
23043 msgid "Produce no output at all."
23047 #: ../inspector/virt-inspector.pl:127
23052 #: ../inspector/virt-inspector.pl:129
23054 "If you select I<--xml> then you get XML output which can be fed to other "
23059 #: ../inspector/virt-inspector.pl:132
23064 #: ../inspector/virt-inspector.pl:134
23066 "If you select I<--yaml> then you get YAML output which can be fed to other "
23071 #: ../inspector/virt-inspector.pl:137
23076 #: ../inspector/virt-inspector.pl:139
23078 "If you select I<--perl> then you get Perl structures output which can be "
23079 "used directly in another Perl program."
23083 #: ../inspector/virt-inspector.pl:142
23088 #: ../inspector/virt-inspector.pl:144
23089 msgid "B<--ro-fish>"
23093 #: ../inspector/virt-inspector.pl:146
23095 "If you select I<--fish> then we print a L<guestfish(1)> command line which "
23096 "will automatically mount up the filesystems on the correct mount points. "
23097 "Try this for example:"
23101 #: ../inspector/virt-inspector.pl:150
23104 " guestfish $(virt-inspector --fish guest.img)\n"
23109 #: ../inspector/virt-inspector.pl:152
23111 "I<--ro-fish> is the same, but the I<--ro> option is passed to guestfish so "
23112 "that the filesystems are mounted read-only."
23116 #: ../inspector/virt-inspector.pl:155
23121 #: ../inspector/virt-inspector.pl:157
23123 "In \"query mode\" we answer common questions about the guest, such as "
23124 "whether it is fullvirt or needs a Xen hypervisor to run."
23128 #: ../inspector/virt-inspector.pl:160
23129 msgid "See section I<QUERY MODE> below."
23133 #: ../inspector/virt-inspector.pl:166
23134 msgid "B<--windows-registry>"
23138 #: ../inspector/virt-inspector.pl:168
23140 "This flag is ignored for compatibility with earlier releases of the software."
23144 #: ../inspector/virt-inspector.pl:171
23146 "In this version, if L<Win::Hivex(3)> is available, then we attempt to parse "
23147 "information out of the Registry for any Windows guest."
23151 #: ../inspector/virt-inspector.pl:218
23152 msgid "OUTPUT FORMAT"
23156 #: ../inspector/virt-inspector.pl:220
23159 " Operating system(s)\n"
23160 " -------------------\n"
23161 " Linux (distro + version)\n"
23162 " Windows (version)\n"
23165 " +--- Filesystems ---------- Installed apps --- Kernel & drivers\n"
23166 " ----------- -------------- ----------------\n"
23167 " mount point => device List of apps Extra information\n"
23168 " mount point => device and versions about kernel(s)\n"
23169 " ... and drivers\n"
23170 " swap => swap device\n"
23171 " (plus lots of extra information\n"
23172 " about each filesystem)\n"
23177 #: ../inspector/virt-inspector.pl:235
23178 msgid "The output of virt-inspector is a complex two-level data structure."
23182 #: ../inspector/virt-inspector.pl:237
23184 "At the top level is a list of the operating systems installed on the guest. "
23185 "(For the vast majority of guests, only a single OS is installed.) The data "
23186 "returned for the OS includes the name (Linux, Windows), the distribution and "
23191 #: ../inspector/virt-inspector.pl:242
23192 msgid "The diagram above shows what we return for each OS."
23196 #: ../inspector/virt-inspector.pl:244
23198 "With the I<--xml> option the output is mapped into an XML document. There "
23199 "is a RELAX-NG schema for this XML in the file I<virt-inspector.rng> which "
23200 "normally ships with virt-inspector, or can be found in the source."
23204 #: ../inspector/virt-inspector.pl:249
23206 "With the I<--fish> or I<--ro-fish> option the mount points are mapped to "
23207 "L<guestfish(1)> command line parameters, so that you can go in afterwards "
23208 "and inspect the guest with everything mounted in the right place. For "
23213 #: ../inspector/virt-inspector.pl:254
23216 " guestfish $(virt-inspector --ro-fish guest.img)\n"
23217 " ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot\n"
23222 #: ../inspector/virt-inspector.pl:589
23227 #: ../inspector/virt-inspector.pl:591
23229 "When you use C<virt-inspector --query>, the output is a series of lines of "
23234 #: ../inspector/virt-inspector.pl:594
23240 " xen_pv_drivers=no\n"
23245 #: ../inspector/virt-inspector.pl:599
23247 "(each answer is usually C<yes> or C<no>, or the line is completely missing "
23248 "if we could not determine the answer at all)."
23252 #: ../inspector/virt-inspector.pl:602
23254 "If the guest is multiboot, you can get apparently conflicting answers (eg. "
23255 "C<windows=yes> and C<linux=yes>, or a guest which is both fullvirt and has a "
23256 "Xen PV kernel). This is normal, and just means that the guest can do both "
23257 "things, although it might require operator intervention such as selecting a "
23258 "boot option when the guest is booting."
23262 #: ../inspector/virt-inspector.pl:609
23263 msgid "This section describes the full range of answers possible."
23267 #: ../inspector/virt-inspector.pl:630
23268 msgid "windows=(yes|no)"
23272 #: ../inspector/virt-inspector.pl:632
23273 msgid "Answer C<yes> if Microsoft Windows is installed in the guest."
23277 #: ../inspector/virt-inspector.pl:645
23278 msgid "linux=(yes|no)"
23282 #: ../inspector/virt-inspector.pl:647
23283 msgid "Answer C<yes> if a Linux kernel is installed in the guest."
23287 #: ../inspector/virt-inspector.pl:660
23288 msgid "rhel=(yes|no)"
23292 #: ../inspector/virt-inspector.pl:662
23293 msgid "Answer C<yes> if the guest contains Red Hat Enterprise Linux."
23297 #: ../inspector/virt-inspector.pl:676
23298 msgid "fedora=(yes|no)"
23302 #: ../inspector/virt-inspector.pl:678
23303 msgid "Answer C<yes> if the guest contains the Fedora Linux distribution."
23307 #: ../inspector/virt-inspector.pl:691
23308 msgid "debian=(yes|no)"
23312 #: ../inspector/virt-inspector.pl:693
23313 msgid "Answer C<yes> if the guest contains the Debian Linux distribution."
23317 #: ../inspector/virt-inspector.pl:706
23318 msgid "fullvirt=(yes|no)"
23322 #: ../inspector/virt-inspector.pl:708
23324 "Answer C<yes> if there is at least one operating system kernel installed in "
23325 "the guest which runs fully virtualized. Such a guest would require a "
23326 "hypervisor which supports full system virtualization."
23330 #: ../inspector/virt-inspector.pl:731
23331 msgid "xen_domU_kernel=(yes|no)"
23335 #: ../inspector/virt-inspector.pl:733
23337 "Answer C<yes> if there is at least one Linux kernel installed in the guest "
23338 "which is compiled as a Xen DomU (a Xen paravirtualized guest)."
23342 #: ../inspector/virt-inspector.pl:753
23343 msgid "xen_pv_drivers=(yes|no)"
23347 #: ../inspector/virt-inspector.pl:755
23349 "Answer C<yes> if the guest has Xen paravirtualized drivers installed "
23350 "(usually the kernel itself will be fully virtualized, but the PV drivers "
23351 "have been installed by the administrator for performance reasons)."
23355 #: ../inspector/virt-inspector.pl:777
23356 msgid "virtio_drivers=(yes|no)"
23360 #: ../inspector/virt-inspector.pl:779
23362 "Answer C<yes> if the guest has virtio paravirtualized drivers installed. "
23363 "Virtio drivers are commonly used to improve the performance of KVM."
23367 #: ../inspector/virt-inspector.pl:800
23368 msgid "userspace_arch=(x86_64|...)"
23372 #: ../inspector/virt-inspector.pl:802
23373 msgid "Print the architecture of userspace."
23377 #: ../inspector/virt-inspector.pl:804 ../inspector/virt-inspector.pl:825
23378 msgid "NB. For multi-boot VMs this can print several lines."
23382 #: ../inspector/virt-inspector.pl:821
23383 msgid "kernel_arch=(x86_64|...)"
23387 #: ../inspector/virt-inspector.pl:823
23388 msgid "Print the architecture of the kernel."
23392 #: ../inspector/virt-inspector.pl:848 ../tools/virt-df.pl:484
23394 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23395 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23399 #: ../inspector/virt-inspector.pl:857 ../tools/virt-cat.pl:175
23400 #: ../tools/virt-df.pl:493 ../tools/virt-edit.pl:339
23401 #: ../tools/virt-list-filesystems.pl:205 ../tools/virt-list-partitions.pl:242
23402 #: ../tools/virt-ls.pl:223 ../tools/virt-make-fs.pl:554
23403 #: ../tools/virt-rescue.pl:243 ../tools/virt-resize.pl:1409
23404 #: ../tools/virt-tar.pl:270 ../tools/virt-win-reg.pl:489
23405 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
23409 #: ../inspector/virt-inspector.pl:859
23410 msgid "Matthew Booth L<mbooth@redhat.com>"
23414 #: ../inspector/virt-inspector.pl:863 ../tools/virt-cat.pl:179
23415 #: ../tools/virt-list-filesystems.pl:209 ../tools/virt-ls.pl:227
23416 #: ../tools/virt-tar.pl:274
23417 msgid "Copyright (C) 2009 Red Hat Inc."
23421 #: ../tools/virt-cat.pl:34
23422 msgid "virt-cat - Display a file in a virtual machine"
23426 #: ../tools/virt-cat.pl:38
23429 " virt-cat [--options] domname file\n"
23434 #: ../tools/virt-cat.pl:40
23437 " virt-cat [--options] disk.img [disk.img ...] file\n"
23442 #: ../tools/virt-cat.pl:44
23444 "C<virt-cat> is a command line tool to display the contents of C<file> where "
23445 "C<file> exists in the named virtual machine (or disk image)."
23449 #: ../tools/virt-cat.pl:47
23451 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
23452 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
23457 #: ../tools/virt-cat.pl:53
23459 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
23463 #: ../tools/virt-cat.pl:56
23466 " virt-cat mydomain /etc/fstab\n"
23471 #: ../tools/virt-cat.pl:58
23472 msgid "List syslog messages from a VM:"
23476 #: ../tools/virt-cat.pl:60
23479 " virt-cat mydomain /var/log/messages | tail\n"
23484 #: ../tools/virt-cat.pl:62
23485 msgid "Find out what DHCP IP address a VM acquired:"
23489 #: ../tools/virt-cat.pl:64
23492 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
23497 #: ../tools/virt-cat.pl:66
23498 msgid "Find out what packages were recently installed:"
23502 #: ../tools/virt-cat.pl:68
23505 " virt-cat mydomain /var/log/yum.log | tail\n"
23510 #: ../tools/virt-cat.pl:70
23511 msgid "Find out who is logged on inside a virtual machine:"
23515 #: ../tools/virt-cat.pl:72
23518 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
23524 #: ../tools/virt-cat.pl:75
23525 msgid "or who was logged on:"
23529 #: ../tools/virt-cat.pl:77
23532 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
23533 " last -f /tmp/wtmp\n"
23538 #: ../tools/virt-cat.pl:109 ../tools/virt-df.pl:100 ../tools/virt-edit.pl:118
23539 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
23540 #: ../tools/virt-ls.pl:108 ../tools/virt-rescue.pl:140
23541 #: ../tools/virt-tar.pl:128 ../tools/virt-win-reg.pl:209
23543 "If you specify guest block devices directly, then libvirt is not used at all."
23547 #: ../tools/virt-cat.pl:165
23549 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, L<Sys::"
23550 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23554 #: ../tools/virt-cat.pl:173 ../tools/virt-df.pl:491 ../tools/virt-edit.pl:337
23555 #: ../tools/virt-list-filesystems.pl:203 ../tools/virt-list-partitions.pl:240
23556 #: ../tools/virt-ls.pl:221 ../tools/virt-make-fs.pl:552
23557 #: ../tools/virt-rescue.pl:241 ../tools/virt-resize.pl:1407
23558 #: ../tools/virt-tar.pl:268 ../tools/virt-win-reg.pl:487
23563 #: ../tools/virt-df.pl:36
23564 msgid "virt-df - Display free space on virtual filesystems"
23568 #: ../tools/virt-df.pl:40
23571 " virt-df [--options]\n"
23576 #: ../tools/virt-df.pl:42
23579 " virt-df [--options] domname\n"
23584 #: ../tools/virt-df.pl:44
23587 " virt-df [--options] disk.img [disk.img ...]\n"
23592 #: ../tools/virt-df.pl:48
23594 "C<virt-df> is a command line tool to display free space on virtual machine "
23595 "filesystems. Unlike other tools, it doesn't just display the amount of "
23596 "space allocated to a virtual machine, but can look inside the virtual "
23597 "machine to see how much space is really being used."
23601 #: ../tools/virt-df.pl:53
23603 "It is like the L<df(1)> command, but for virtual machines, except that it "
23604 "also works for Windows virtual machines."
23608 #: ../tools/virt-df.pl:56
23610 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
23611 "of all active and inactive guests, and performs a C<df>-type operation on "
23612 "each one in turn, printing out the results."
23616 #: ../tools/virt-df.pl:60
23618 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
23619 "either the single named libvirt domain, or on the disk image(s) listed on "
23620 "the command line (which must all belong to a single VM). In this mode (with "
23621 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
23622 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
23626 #: ../tools/virt-df.pl:67
23628 "Use the C<--csv> option to get a format which can be easily parsed by other "
23629 "programs. Other options are mostly similar to standard C<df> options. See "
23630 "below for the complete list."
23634 #: ../tools/virt-df.pl:107
23639 #: ../tools/virt-df.pl:109
23641 "Write out the results in CSV format (comma-separated values). This format "
23642 "can be imported easily into databases and spreadsheets, but read L</NOTE "
23643 "ABOUT CSV FORMAT> below."
23647 #: ../tools/virt-df.pl:117
23648 msgid "B<--human-readable> | B<-h>"
23652 #: ../tools/virt-df.pl:119
23653 msgid "Print sizes in human-readable format."
23657 #: ../tools/virt-df.pl:121
23658 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
23662 #: ../tools/virt-df.pl:127
23663 msgid "B<--inodes> | B<-i>"
23667 #: ../tools/virt-df.pl:129
23668 msgid "Print inodes instead of blocks."
23672 #: ../tools/virt-df.pl:458
23673 msgid "NOTE ABOUT CSV FORMAT"
23677 #: ../tools/virt-df.pl:460
23679 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
23680 "should be easy to parse, but it is definitely not easy to parse."
23684 #: ../tools/virt-df.pl:463
23686 "Myth: Just split fields at commas. Reality: This does I<not> work "
23687 "reliably. This example has two columns:"
23691 #: ../tools/virt-df.pl:466
23694 " \"foo,bar\",baz\n"
23699 #: ../tools/virt-df.pl:468
23701 "Myth: Read the file one line at a time. Reality: This does I<not> work "
23702 "reliably. This example has one row:"
23706 #: ../tools/virt-df.pl:471
23715 #: ../tools/virt-df.pl:474
23717 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
23718 "packaged in major Linux distributions)."
23722 #: ../tools/virt-df.pl:477
23724 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
23725 "or Python's built-in csv library)."
23729 #: ../tools/virt-df.pl:480
23730 msgid "Most spreadsheets and databases can import CSV directly."
23734 #: ../tools/virt-df.pl:497 ../tools/virt-edit.pl:343
23735 #: ../tools/virt-list-partitions.pl:246 ../tools/virt-rescue.pl:247
23736 msgid "Copyright (C) 2009-2010 Red Hat Inc."
23740 #: ../tools/virt-edit.pl:35
23741 msgid "virt-edit - Edit a file in a virtual machine"
23745 #: ../tools/virt-edit.pl:39
23748 " virt-edit [--options] domname file\n"
23753 #: ../tools/virt-edit.pl:41
23756 " virt-edit [--options] disk.img [disk.img ...] file\n"
23761 #: ../tools/virt-edit.pl:43
23764 " virt-edit [domname|disk.img] file -e 'expr'\n"
23769 #: ../tools/virt-edit.pl:47
23771 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
23772 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
23773 "doing this, but doesn't catch all cases."
23777 #: ../tools/virt-edit.pl:53
23779 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
23780 "the named virtual machine (or disk image)."
23784 #: ../tools/virt-edit.pl:56
23786 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
23787 "you should look at the L<guestfish(1)> tool."
23791 #: ../tools/virt-edit.pl:61
23792 msgid "Edit the named files interactively:"
23796 #: ../tools/virt-edit.pl:63
23799 " virt-edit mydomain /boot/grub/grub.conf\n"
23804 #: ../tools/virt-edit.pl:65
23807 " virt-edit mydomain /etc/passwd\n"
23812 #: ../tools/virt-edit.pl:67
23814 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
23815 "below). To change the init default level to 5:"
23819 #: ../tools/virt-edit.pl:71
23822 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
23827 #: ../tools/virt-edit.pl:97
23828 msgid "B<--backup extension> | B<-b extension>"
23832 #: ../tools/virt-edit.pl:99
23834 "Create a backup of the original file I<in the guest disk image>. The backup "
23835 "has the original filename with C<extension> added."
23839 #: ../tools/virt-edit.pl:102
23841 "Usually the first character of C<extension> would be a dot C<.> so you would "
23846 #: ../tools/virt-edit.pl:105
23849 " virt-edit -b .orig [etc]\n"
23854 #: ../tools/virt-edit.pl:107
23855 msgid "By default, no backup file is made."
23859 #: ../tools/virt-edit.pl:125
23860 msgid "B<--expr EXPR> | B<-e EXPR>"
23864 #: ../tools/virt-edit.pl:127
23866 "Instead of launching the external editor, non-interactively apply the Perl "
23867 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
23872 #: ../tools/virt-edit.pl:131
23874 "Be careful to properly quote the expression to prevent it from being altered "
23879 #: ../tools/virt-edit.pl:250
23880 msgid "NON-INTERACTIVE EDITING"
23884 #: ../tools/virt-edit.pl:252
23886 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
23887 "administrator can interactively edit the file."
23891 #: ../tools/virt-edit.pl:255
23893 "There are two ways also to use C<virt-edit> from scripts in order to make "
23894 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
23895 "like this, it's less error-prone to write scripts directly using the "
23896 "libguestfs API and Augeas for configuration file editing.)"
23900 #: ../tools/virt-edit.pl:261
23902 "The first method is to temporarily set C<$EDITOR> to any script or program "
23903 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
23904 "update C<tmpfile> in place however it likes."
23908 #: ../tools/virt-edit.pl:265
23910 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
23911 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
23912 "instances of C<foo> with C<bar> in a file:"
23916 #: ../tools/virt-edit.pl:269
23919 " virt-edit domname filename -e 's/foo/bar/'\n"
23924 #: ../tools/virt-edit.pl:271
23926 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
23927 "For example to delete root's password you could do:"
23931 #: ../tools/virt-edit.pl:274
23934 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
23939 #: ../tools/virt-edit.pl:276
23941 "What really happens is that the snippet is evaluated as a Perl expression "
23942 "for each line of the file. The line, including the final C<\\n>, is passed "
23943 "in C<$_> and the expression should update C<$_> or leave it unchanged."
23947 #: ../tools/virt-edit.pl:281
23949 "To delete a line, set C<$_> to the empty string. For example, to delete the "
23950 "C<apache> user account from the password file you can do:"
23954 #: ../tools/virt-edit.pl:284
23957 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
23962 #: ../tools/virt-edit.pl:286
23964 "To insert a line, prepend or append it to C<$_>. However appending lines to "
23965 "the end of the file is rather difficult this way since there is no concept "
23966 "of \"last line of the file\" - your expression just doesn't get called "
23967 "again. You might want to use the first method (setting C<$EDITOR>) if you "
23972 #: ../tools/virt-edit.pl:292
23974 "The variable C<$lineno> contains the current line number. As is "
23975 "traditional, the first line in the file is number C<1>."
23979 #: ../tools/virt-edit.pl:295
23981 "The return value from the expression is ignored, but the expression may call "
23982 "C<die> in order to abort the whole program, leaving the original file "
23987 #: ../tools/virt-edit.pl:299
23989 "Remember when matching the end of a line that C<$_> may contain the final C<"
23990 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
23991 "newline then neither of these. Thus to match or substitute some text at the "
23992 "end of a line, use this regular expression:"
23996 #: ../tools/virt-edit.pl:304
23999 " /some text(\\r?\\n)?$/\n"
24004 #: ../tools/virt-edit.pl:306
24006 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
24007 "$_> itself (since that would remove all newlines from the file):"
24011 #: ../tools/virt-edit.pl:310
24014 " my $m = $_; chomp $m; $m =~ /some text$/\n"
24019 #: ../tools/virt-edit.pl:316
24024 #: ../tools/virt-edit.pl:318
24026 "If set, this string is used as the editor. It may contain arguments, eg. C<"
24031 #: ../tools/virt-edit.pl:321
24032 msgid "If not set, C<vi> is used."
24036 #: ../tools/virt-edit.pl:327
24038 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24039 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
24044 #: ../tools/virt-list-filesystems.pl:32
24046 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
24050 #: ../tools/virt-list-filesystems.pl:36
24053 " virt-list-filesystems [--options] domname\n"
24058 #: ../tools/virt-list-filesystems.pl:38
24061 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
24066 #: ../tools/virt-list-filesystems.pl:42
24068 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
24069 "are contained in a virtual machine or disk image."
24073 #: ../tools/virt-list-filesystems.pl:46
24075 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
24076 "functionality. For more complex cases you should look at the L<guestfish(1)"
24081 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-list-partitions.pl:95
24082 #: ../tools/virt-ls.pl:115
24083 msgid "B<-l> | B<--long>"
24087 #: ../tools/virt-list-filesystems.pl:88
24089 "With this option, C<virt-list-filesystems> displays the type of each "
24090 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
24094 #: ../tools/virt-list-filesystems.pl:95
24095 msgid "B<-a> | B<--all>"
24099 #: ../tools/virt-list-filesystems.pl:97
24101 "Normally we only show mountable filesystems. If this option is given then "
24102 "swap devices are shown too."
24106 #: ../tools/virt-list-filesystems.pl:193
24108 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
24109 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
24110 ">, L<http://libguestfs.org/>."
24114 #: ../tools/virt-list-partitions.pl:32
24116 "virt-list-partitions - List partitions in a virtual machine or disk image"
24120 #: ../tools/virt-list-partitions.pl:36
24123 " virt-list-partitions [--options] domname\n"
24128 #: ../tools/virt-list-partitions.pl:38
24131 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
24136 #: ../tools/virt-list-partitions.pl:42
24138 "C<virt-list-partitions> is a command line tool to list the partitions that "
24139 "are contained in a virtual machine or disk image. It is mainly useful as a "
24140 "first step to using L<virt-resize(1)>."
24144 #: ../tools/virt-list-partitions.pl:47
24146 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
24147 "functionality. For more complex cases you should look at the L<guestfish(1)"
24152 #: ../tools/virt-list-partitions.pl:87
24153 msgid "B<-h> | B<--human-readable>"
24157 #: ../tools/virt-list-partitions.pl:89
24158 msgid "Show sizes in human-readable form (eg. \"1G\")."
24162 #: ../tools/virt-list-partitions.pl:97
24164 "With this option, C<virt-list-partitions> displays the type and size of each "
24165 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
24169 #: ../tools/virt-list-partitions.pl:104
24170 msgid "B<-t> | B<--total>"
24174 #: ../tools/virt-list-partitions.pl:106
24176 "Display the total size of each block device (as a separate row or rows)."
24180 #: ../tools/virt-list-partitions.pl:231
24182 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
24183 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
24184 "libguestfs.org/>."
24188 #: ../tools/virt-ls.pl:35
24189 msgid "virt-ls - List files in a virtual machine"
24193 #: ../tools/virt-ls.pl:39
24196 " virt-ls [--options] domname directory\n"
24201 #: ../tools/virt-ls.pl:41
24204 " virt-ls [--options] disk.img [disk.img ...] directory\n"
24209 #: ../tools/virt-ls.pl:45
24211 "C<virt-ls> is a command line tool to list the names of files in a directory "
24212 "inside a virtual machine or disk image."
24216 #: ../tools/virt-ls.pl:48
24218 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
24219 "For more complex cases you should look at the L<guestfish(1)> tool."
24223 #: ../tools/virt-ls.pl:52
24225 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
24226 "simple listing is like the ordinary L<ls(1)> command:"
24230 #: ../tools/virt-ls.pl:55
24233 " $ virt-ls myguest /\n"
24241 #: ../tools/virt-ls.pl:60
24242 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
24246 #: ../tools/virt-ls.pl:62
24249 " $ virt-ls -l myguest /\n"
24251 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
24252 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
24258 #: ../tools/virt-ls.pl:68
24260 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
24261 "and directories recursively:"
24265 #: ../tools/virt-ls.pl:71
24268 " $ virt-ls -R myguest /tmp\n"
24276 #: ../tools/virt-ls.pl:76
24278 "You I<cannot> combine these options. To do more complicated things, use "
24283 #: ../tools/virt-ls.pl:117
24284 msgid "B<-R> | B<--recursive>"
24288 #: ../tools/virt-ls.pl:119
24290 "Select the mode. With neither of these options, C<virt-ls> produces a "
24291 "simple, flat list of the files in the named directory."
24295 #: ../tools/virt-ls.pl:122
24297 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
24298 "like the plain C<ls -l> command)."
24302 #: ../tools/virt-ls.pl:125
24304 "C<virt-ls -R> produces a recursive list of files starting at the named "
24305 "directory. See the documentation for the C<guestfs_find> command L<guestfs"
24306 "(3)> for precise details."
24310 #: ../tools/virt-ls.pl:129
24311 msgid "You cannot combine these options."
24315 #: ../tools/virt-ls.pl:212
24317 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
24318 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
24323 #: ../tools/virt-make-fs.pl:37
24324 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
24328 #: ../tools/virt-make-fs.pl:41
24331 " virt-make-fs [--options] input.tar output.img\n"
24336 #: ../tools/virt-make-fs.pl:43
24339 " virt-make-fs [--options] input.tar.gz output.img\n"
24344 #: ../tools/virt-make-fs.pl:45
24347 " virt-make-fs [--options] directory output.img\n"
24352 #: ../tools/virt-make-fs.pl:49
24354 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
24355 "archive or some files in a directory. It is similar to tools like L<mkisofs"
24356 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
24357 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
24358 "you want to attach these filesystems to existing virtual machines (eg. to "
24359 "import large amounts of read-only data to a VM)."
24363 #: ../tools/virt-make-fs.pl:57
24364 msgid "Basic usage is:"
24368 #: ../tools/virt-make-fs.pl:59
24371 " virt-make-fs input output\n"
24376 #: ../tools/virt-make-fs.pl:61
24378 "where C<input> is either a directory containing files that you want to add, "
24379 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
24380 "C<output> is a disk image. The input type is detected automatically. The "
24381 "output disk image defaults to a raw ext2 image unless you specify extra "
24382 "flags (see L</OPTIONS> below)."
24386 #: ../tools/virt-make-fs.pl:67
24387 msgid "EXTRA SPACE"
24391 #: ../tools/virt-make-fs.pl:69
24393 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
24394 "the files that it contains, but might have extra space. Depending on how "
24395 "you are going to use the output, you might think this extra space is wasted "
24396 "and want to minimize it, or you might want to leave space so that more files "
24397 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
24398 "but you can use the C<--size> flag to leave space in the filesystem if you "
24403 #: ../tools/virt-make-fs.pl:77
24405 "An alternative way to leave extra space but not make the output image any "
24406 "bigger is to use an alternative disk image format (instead of the default "
24407 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
24408 "image format (check your hypervisor supports this before using it). This "
24409 "allows you to choose a large C<--size> but the extra space won't actually be "
24410 "allocated in the image until you try to store something in it."
24414 #: ../tools/virt-make-fs.pl:85
24416 "Don't forget that you can also use local commands including L<resize2fs(8)> "
24417 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
24418 "resize to build another image from scratch."
24422 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
24423 #: ../tools/virt-make-fs.pl:142
24428 #: ../tools/virt-make-fs.pl:91
24431 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
24436 #: ../tools/virt-make-fs.pl:93
24437 msgid "FILESYSTEM TYPE"
24441 #: ../tools/virt-make-fs.pl:95
24443 "The default filesystem type is C<ext2>. Just about any filesystem type that "
24444 "libguestfs supports can be used (but I<not> read-only formats like "
24445 "ISO9660). Here are some of the more common choices:"
24449 #: ../tools/virt-make-fs.pl:101
24454 #: ../tools/virt-make-fs.pl:103
24456 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
24457 "you are not going to use the filesystem in a way that requires the journal, "
24458 "then this is just wasted overhead."
24462 #: ../tools/virt-make-fs.pl:107
24463 msgid "I<ntfs> or I<vfat>"
24467 #: ../tools/virt-make-fs.pl:109
24468 msgid "Useful if exporting data to a Windows guest."
24472 #: ../tools/virt-make-fs.pl:111
24474 "I<Note for vfat>: The tar archive or local directory must only contain files "
24475 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
24476 "program running within libguestfs is unable to change the ownership of non-"
24477 "root files, since vfat itself does not support this."
24481 #: ../tools/virt-make-fs.pl:116
24486 #: ../tools/virt-make-fs.pl:118
24488 "Lower overhead than C<ext2>, but certain limitations on filename length and "
24489 "total filesystem size."
24493 #: ../tools/virt-make-fs.pl:125
24496 " virt-make-fs --type=minix input minixfs.img\n"
24501 #: ../tools/virt-make-fs.pl:127
24502 msgid "TO PARTITION OR NOT TO PARTITION"
24506 #: ../tools/virt-make-fs.pl:129
24507 msgid "Optionally virt-make-fs can add a partition table to the output disk."
24511 #: ../tools/virt-make-fs.pl:131
24513 "Adding a partition can make the disk image more compatible with certain "
24514 "virtualized operating systems which don't expect to see a filesystem "
24515 "directly located on a block device (Linux doesn't care and will happily "
24516 "handle both types)."
24520 #: ../tools/virt-make-fs.pl:136
24522 "On the other hand, if you have a partition table then the output image is no "
24523 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
24524 "directly on a partitioned disk image. (However libguestfs tools such as "
24525 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
24529 #: ../tools/virt-make-fs.pl:144
24530 msgid "Add an MBR partition:"
24534 #: ../tools/virt-make-fs.pl:146
24537 " virt-make-fs --partition -- input disk.img\n"
24542 #: ../tools/virt-make-fs.pl:148
24544 "If the output disk image could be terabyte-sized or larger, it's better to "
24545 "use an EFI/GPT-compatible partition table:"
24549 #: ../tools/virt-make-fs.pl:151
24552 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
24557 #: ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:196
24562 #: ../tools/virt-make-fs.pl:179
24563 msgid "Enable debugging information."
24567 #: ../tools/virt-make-fs.pl:185
24568 msgid "B<--size=E<lt>NE<gt>>"
24572 #: ../tools/virt-make-fs.pl:187
24573 msgid "B<--size=+E<lt>NE<gt>>"
24577 #: ../tools/virt-make-fs.pl:189
24578 msgid "B<-s E<lt>NE<gt>>"
24582 #: ../tools/virt-make-fs.pl:191
24583 msgid "B<-s +E<lt>NE<gt>>"
24587 #: ../tools/virt-make-fs.pl:193
24589 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
24593 #: ../tools/virt-make-fs.pl:196
24595 "If this option is I<not> given, then the output image will be just large "
24596 "enough to contain all the files, with not much wasted space."
24600 #: ../tools/virt-make-fs.pl:199
24602 "To choose a fixed size output disk, specify an absolute number followed by b/"
24603 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24604 "Petabytes or Exabytes. This must be large enough to contain all the input "
24605 "files, else you will get an error."
24609 #: ../tools/virt-make-fs.pl:204
24611 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
24612 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24613 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
24614 "the input files, and (approximately) an extra 200 MB free space."
24618 #: ../tools/virt-make-fs.pl:210
24620 "Note that virt-make-fs estimates free space, and therefore will not produce "
24621 "filesystems containing precisely the free space requested. (It is much more "
24622 "expensive and time-consuming to produce a filesystem which has precisely the "
24623 "desired free space)."
24627 #: ../tools/virt-make-fs.pl:219
24628 msgid "B<--format=E<lt>fmtE<gt>>"
24632 #: ../tools/virt-make-fs.pl:221
24633 msgid "B<-F E<lt>fmtE<gt>>"
24637 #: ../tools/virt-make-fs.pl:223
24638 msgid "Choose the output disk image format."
24642 #: ../tools/virt-make-fs.pl:225
24643 msgid "The default is C<raw> (raw disk image)."
24647 #: ../tools/virt-make-fs.pl:227
24649 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
24650 "that would really make sense here is C<qcow2>."
24654 #: ../tools/virt-make-fs.pl:234
24655 msgid "B<--type=E<lt>fsE<gt>>"
24659 #: ../tools/virt-make-fs.pl:236
24660 msgid "B<-t E<lt>fsE<gt>>"
24664 #: ../tools/virt-make-fs.pl:238
24665 msgid "Choose the output filesystem type."
24669 #: ../tools/virt-make-fs.pl:240
24670 msgid "The default is C<ext2>."
24674 #: ../tools/virt-make-fs.pl:242
24676 "Any filesystem which is supported read-write by libguestfs can be used here."
24680 #: ../tools/virt-make-fs.pl:249
24681 msgid "B<--partition>"
24685 #: ../tools/virt-make-fs.pl:251
24686 msgid "B<--partition=E<lt>parttypeE<gt>>"
24690 #: ../tools/virt-make-fs.pl:253
24692 "If specified, this flag adds an MBR partition table to the output disk image."
24696 #: ../tools/virt-make-fs.pl:256
24698 "You can change the partition table type, eg. C<--partition=gpt> for large "
24703 #: ../tools/virt-make-fs.pl:259
24705 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
24706 "might consider the next parameter to be the partition type. For example:"
24710 #: ../tools/virt-make-fs.pl:263
24713 " virt-make-fs --partition input.tar ...\n"
24718 #: ../tools/virt-make-fs.pl:265
24720 "would cause virt-make-fs to think you wanted to use a partition type of "
24721 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
24722 "dash) between options and the input file argument:"
24726 #: ../tools/virt-make-fs.pl:269
24729 " virt-make-fs --partition -- input.tar ...\n"
24734 #: ../tools/virt-make-fs.pl:529
24736 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
24737 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
24738 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
24742 #: ../tools/virt-make-fs.pl:543 ../tools/virt-win-reg.pl:478
24744 "When reporting bugs, please enable debugging and capture the I<complete> "
24749 #: ../tools/virt-make-fs.pl:546
24752 " export LIBGUESTFS_DEBUG=1\n"
24753 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
24758 #: ../tools/virt-make-fs.pl:549
24760 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
24765 #: ../tools/virt-make-fs.pl:558 ../tools/virt-resize.pl:1413
24766 #: ../tools/virt-win-reg.pl:493
24767 msgid "Copyright (C) 2010 Red Hat Inc."
24771 #: ../tools/virt-rescue.pl:33
24772 msgid "virt-rescue - Run a rescue shell on a virtual machine"
24776 #: ../tools/virt-rescue.pl:37
24779 " virt-rescue [--options] domname\n"
24784 #: ../tools/virt-rescue.pl:39
24787 " virt-rescue [--options] disk.img [disk.img ...]\n"
24792 #: ../tools/virt-rescue.pl:43
24794 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
24795 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
24796 "you from doing this, but doesn't catch all cases."
24800 #: ../tools/virt-rescue.pl:47
24802 "However if you use the I<--ro> (read only) option, then you can attach a "
24803 "shell to a live virtual machine. The results might be strange or "
24804 "inconsistent at times but you won't get disk corruption."
24808 #: ../tools/virt-rescue.pl:53
24810 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
24811 "need for a CD. virt-rescue gives you a rescue shell and some simple "
24812 "recovery tools which you can use to examine or rescue a virtual machine or "
24817 #: ../tools/virt-rescue.pl:58
24819 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
24820 "on disk image(s):"
24824 #: ../tools/virt-rescue.pl:61
24827 " virt-rescue GuestName\n"
24832 #: ../tools/virt-rescue.pl:63
24835 " virt-rescue --ro /path/to/disk.img\n"
24840 #: ../tools/virt-rescue.pl:65
24843 " virt-rescue /dev/sdc\n"
24848 #: ../tools/virt-rescue.pl:67
24849 msgid "For live VMs you I<must> use the --ro option."
24853 #: ../tools/virt-rescue.pl:69
24855 "When you run virt-rescue on a virtual machine or disk image, you are placed "
24856 "in an interactive bash shell where you can use many ordinary Linux "
24857 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
24858 "appliance. You must mount the virtual machine's filesystems by hand. There "
24859 "is an empty directory called C</sysroot> where you can mount filesystems."
24863 #: ../tools/virt-rescue.pl:76
24865 "In the example below, we list logical volumes, then choose one to mount "
24866 "under C</sysroot>:"
24870 #: ../tools/virt-rescue.pl:79
24874 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
24875 " lv_root vg_f11x64 -wi-a- 8.83G\n"
24876 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
24877 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
24878 " ><rescue> ls /sysroot\n"
24883 #: ../tools/virt-rescue.pl:86
24885 "If you don't know what filesystems are available on the virtual machine then "
24886 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
24890 #: ../tools/virt-rescue.pl:90 ../tools/virt-resize.pl:1350
24895 #: ../tools/virt-rescue.pl:92
24897 "Virt-rescue can be used on I<any> disk image file or device, not just a "
24898 "virtual machine. For example you can use it on a blank file if you want to "
24899 "partition that file (although we would recommend using L<guestfish(1)> "
24900 "instead as it is more suitable for this purpose). You can even use virt-"
24901 "rescue on things like SD cards."
24905 #: ../tools/virt-rescue.pl:98
24907 "This tool is just designed for quick interactive hacking on a virtual "
24908 "machine. For more structured access to a virtual machine disk image, you "
24909 "should use L<guestfs(3)>. To get a structured shell that you can use to "
24910 "make scripted changes to guests, use L<guestfish(1)>."
24914 #: ../tools/virt-rescue.pl:127
24915 msgid "B<--append kernelopts>"
24919 #: ../tools/virt-rescue.pl:129
24920 msgid "Pass additional options to the rescue kernel."
24924 #: ../tools/virt-rescue.pl:147
24925 msgid "B<--memsize MB> | B<-m MB>"
24929 #: ../tools/virt-rescue.pl:149
24931 "Change the amount of memory allocated to the rescue system. The default is "
24932 "set by libguestfs and is small but adequate for running system tools. The "
24933 "occasional program might need more memory. The parameter is specified in "
24938 #: ../tools/virt-rescue.pl:158
24939 msgid "B<--ro> | B<-r>"
24943 #: ../tools/virt-rescue.pl:160
24944 msgid "Open the image read-only."
24948 #: ../tools/virt-rescue.pl:172
24950 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
24951 "SELINUX> before using this option."
24955 #: ../tools/virt-rescue.pl:228
24957 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
24958 "ENVIRONMENT VARIABLES> for the complete list."
24962 #: ../tools/virt-rescue.pl:233
24964 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24965 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24969 #: ../tools/virt-resize.pl:42
24970 msgid "virt-resize - Resize a virtual machine disk"
24974 #: ../tools/virt-resize.pl:46
24977 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24978 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24979 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24984 #: ../tools/virt-resize.pl:52
24986 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24987 "larger or smaller overall, and resizing or deleting any partitions contained "
24992 #: ../tools/virt-resize.pl:56
24994 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24995 "not> be used on live virtual machines - for consistent results, shut the "
24996 "virtual machine down before resizing it."
25000 #: ../tools/virt-resize.pl:60
25002 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
25003 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
25004 "read those manual pages first."
25008 #: ../tools/virt-resize.pl:68
25010 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
25011 "fill the extra 5GB of space."
25015 #: ../tools/virt-resize.pl:71
25018 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
25019 " virt-list-partitions -lht olddisk\n"
25020 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
25021 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
25026 #: ../tools/virt-resize.pl:76
25028 "As above, but make the /boot partition 200MB bigger, while giving the "
25029 "remaining space to /dev/sda2:"
25033 #: ../tools/virt-resize.pl:79
25036 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
25041 #: ../tools/virt-resize.pl:81
25042 msgid "DETAILED USAGE"
25046 #: ../tools/virt-resize.pl:83
25047 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25051 #: ../tools/virt-resize.pl:87
25052 msgid "1. Shut down the virtual machine"
25056 #: ../tools/virt-resize.pl:89
25057 msgid "2. Locate input disk image"
25061 #: ../tools/virt-resize.pl:91
25063 "Locate the input disk image (ie. the file or device on the host containing "
25064 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25065 "dumpxml> like this to find the disk image name:"
25069 #: ../tools/virt-resize.pl:95
25072 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25073 " Found 1 nodes:\n"
25075 " <source dev=\"/dev/vg/lv_guest\" />\n"
25080 #: ../tools/virt-resize.pl:100
25081 msgid "3. Look at current sizing"
25085 #: ../tools/virt-resize.pl:102
25087 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25091 #: ../tools/virt-resize.pl:105
25094 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25095 " /dev/sda1 ext3 101.9M\n"
25096 " /dev/sda2 pv 7.9G\n"
25097 " /dev/sda device 8.0G\n"
25102 #: ../tools/virt-resize.pl:110
25104 "(This example is a virtual machine with an 8 GB disk which we would like to "
25105 "expand up to 10 GB)."
25109 #: ../tools/virt-resize.pl:113
25110 msgid "4. Create output disk"
25114 #: ../tools/virt-resize.pl:115
25116 "Virt-resize cannot do in-place disk modifications. You have to have space "
25117 "to store the resized output disk."
25121 #: ../tools/virt-resize.pl:118
25123 "To store the resized disk image in a file, create a file of a suitable size:"
25127 #: ../tools/virt-resize.pl:121
25130 " # rm -f outdisk\n"
25131 " # truncate -s 10G outdisk\n"
25136 #: ../tools/virt-resize.pl:124
25137 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25141 #: ../tools/virt-resize.pl:126
25144 " # lvcreate -L 10G -n lv_name vg_name\n"
25149 #: ../tools/virt-resize.pl:128
25150 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25154 #: ../tools/virt-resize.pl:130
25157 " # virsh pool-list\n"
25158 " # virsh vol-create-as poolname newvol 10G\n"
25163 #: ../tools/virt-resize.pl:133
25168 #: ../tools/virt-resize.pl:135
25170 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25171 "file) and the output disk. The output disk is the one created in the "
25176 #: ../tools/virt-resize.pl:139
25179 " # virt-resize indisk outdisk\n"
25184 #: ../tools/virt-resize.pl:141
25186 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25187 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25188 "larger, then an extra, empty partition is created at the end of the disk "
25189 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25194 #: ../tools/virt-resize.pl:147
25196 "More realistically you'd want to expand existing partitions in the disk "
25197 "image by passing extra options (for the full list see the L</OPTIONS> "
25202 #: ../tools/virt-resize.pl:151
25204 "L</--expand> is the most useful option. It expands the named partition "
25205 "within the disk to fill any extra space:"
25209 #: ../tools/virt-resize.pl:154
25212 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25217 #: ../tools/virt-resize.pl:156
25219 "(In this case, an extra partition is I<not> created at the end of the disk, "
25220 "because there will be no unused space)."
25224 #: ../tools/virt-resize.pl:159
25226 "L</--resize> is the other commonly used option. The following would "
25227 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25228 "rest of the available space:"
25232 #: ../tools/virt-resize.pl:163
25235 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25236 " indisk outdisk\n"
25241 #: ../tools/virt-resize.pl:166
25243 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25244 "if virt-resize knows how, it will resize the contents, the equivalent of "
25245 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
25246 ">. However virt-resize does not know how to resize some filesystems, so you "
25247 "would have to online resize them after booting the guest. And virt-resize "
25248 "also does not resize anything inside an LVM PV, it just resizes the PV "
25249 "itself and leaves the user to resize any LVs inside that PV as desired."
25253 #: ../tools/virt-resize.pl:175
25254 msgid "Other options are covered below."
25258 #: ../tools/virt-resize.pl:177
25263 #: ../tools/virt-resize.pl:179
25264 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25268 #: ../tools/virt-resize.pl:181
25269 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25273 #: ../tools/virt-resize.pl:183
25276 " # virsh edit guestname\n"
25281 #: ../tools/virt-resize.pl:185
25283 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
25284 "html#elementsDisks>"
25288 #: ../tools/virt-resize.pl:188
25289 msgid "Then start up the domain with the new, resized disk:"
25293 #: ../tools/virt-resize.pl:190
25296 " # virsh start guestname\n"
25301 #: ../tools/virt-resize.pl:192
25303 "and check that it still works. See also the L</NOTES> section below for "
25304 "additional information."
25308 #: ../tools/virt-resize.pl:195
25309 msgid "7. Resize LVs etc inside the guest"
25313 #: ../tools/virt-resize.pl:197
25314 msgid "(This can also be done offline using L<guestfish(1)>)"
25318 #: ../tools/virt-resize.pl:199
25320 "Once the guest has booted you should see the new space available, at least "
25321 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25322 "may need to resize LVs inside PVs, and also resize filesystem types that "
25323 "virt-resize does not know how to expand."
25327 #: ../tools/virt-resize.pl:206
25328 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25332 #: ../tools/virt-resize.pl:208
25334 "Shrinking is somewhat more complex than expanding, and only an overview is "
25339 #: ../tools/virt-resize.pl:211
25341 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25342 "filesystems). The user has to shrink content before passing the disk image "
25343 "to virt-resize, and virt-resize will check that the content has been shrunk "
25348 #: ../tools/virt-resize.pl:216
25349 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25353 #: ../tools/virt-resize.pl:218
25355 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25356 "steps 3 and 4 above to allocate a new disk image."
25360 #: ../tools/virt-resize.pl:221
25362 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25366 #: ../tools/virt-resize.pl:224
25367 msgid "IGNORING OR DELETING PARTITIONS"
25371 #: ../tools/virt-resize.pl:226
25373 "virt-resize also gives a convenient way to ignore or delete partitions when "
25374 "copying from the input disk to the output disk. Ignoring a partition speeds "
25375 "up the copy where you don't care about the existing contents of a "
25376 "partition. Deleting a partition removes it completely, but note that it "
25377 "also renumbers any partitions after the one which is deleted, which can "
25378 "leave some guests unbootable."
25382 #: ../tools/virt-resize.pl:243
25383 msgid "Display help."
25387 #: ../tools/virt-resize.pl:257
25388 msgid "B<--resize part=size>"
25392 #: ../tools/virt-resize.pl:259
25394 "Resize the named partition (expanding or shrinking it) so that it has the "
25399 #: ../tools/virt-resize.pl:262
25401 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25402 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25403 "Exabytes; or as a percentage of the current size; or as a relative number or "
25404 "percentage. For example:"
25408 #: ../tools/virt-resize.pl:267
25411 " --resize /dev/sda2=10G\n"
25416 #: ../tools/virt-resize.pl:269
25419 " --resize /dev/sda4=90%\n"
25424 #: ../tools/virt-resize.pl:271
25427 " --resize /dev/sda2=+1G\n"
25432 #: ../tools/virt-resize.pl:273
25435 " --resize /dev/sda2=-200M\n"
25440 #: ../tools/virt-resize.pl:275
25443 " --resize /dev/sda1=+128K\n"
25448 #: ../tools/virt-resize.pl:277
25451 " --resize /dev/sda1=+10%\n"
25456 #: ../tools/virt-resize.pl:279
25459 " --resize /dev/sda1=-10%\n"
25464 #: ../tools/virt-resize.pl:281
25466 "You can increase the size of any partition. Virt-resize will expand the "
25467 "direct content of the partition if it knows how (see C<--expand> below)."
25471 #: ../tools/virt-resize.pl:285
25473 "You can only I<decrease> the size of partitions that contain filesystems or "
25474 "PVs which have already been shrunk. Virt-resize will check this has been "
25475 "done before proceeding, or else will print an error (see also C<--resize-"
25480 #: ../tools/virt-resize.pl:290 ../tools/virt-resize.pl:382
25481 #: ../tools/virt-resize.pl:399
25482 msgid "You can give this option multiple times."
25486 #: ../tools/virt-resize.pl:296
25487 msgid "B<--resize-force part=size>"
25491 #: ../tools/virt-resize.pl:298
25493 "This is the same as C<--resize> except that it will let you decrease the "
25494 "size of any partition. Generally this means you will lose any data which "
25495 "was at the end of the partition you shrink, but you may not care about that "
25496 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25497 "as a swap partition)."
25501 #: ../tools/virt-resize.pl:304
25502 msgid "See also the C<--ignore> option."
25506 #: ../tools/virt-resize.pl:310
25507 msgid "B<--expand part>"
25511 #: ../tools/virt-resize.pl:312
25513 "Expand the named partition so it uses up all extra space (space left over "
25514 "after any other resize changes that you request have been done)."
25518 #: ../tools/virt-resize.pl:315
25520 "If virt-resize knows how, it will expand the direct content of the "
25521 "partition. For example, if the partition is an LVM PV, it will expand the "
25522 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25523 "content it doesn't know about alone."
25527 #: ../tools/virt-resize.pl:320
25528 msgid "Currently virt-resize can resize:"
25532 #: ../tools/virt-resize.pl:326
25534 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25539 #: ../tools/virt-resize.pl:331
25541 "NTFS filesystems contained directly in a partition, if libguestfs was "
25542 "compiled with support for NTFS."
25546 #: ../tools/virt-resize.pl:334
25548 "The filesystem must have been shut down consistently last time it was used. "
25549 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25550 "consistency check, so at the first boot after resizing Windows will check "
25555 #: ../tools/virt-resize.pl:341
25557 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25558 "inside the PV. The user will have to resize LVs as desired."
25562 #: ../tools/virt-resize.pl:347 ../tools/virt-resize.pl:369
25563 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25567 #: ../tools/virt-resize.pl:353
25568 msgid "B<--shrink part>"
25572 #: ../tools/virt-resize.pl:355
25574 "Shrink the named partition until the overall disk image fits in the "
25575 "destination. The named partition B<must> contain a filesystem or PV which "
25576 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25577 "online tools). Virt-resize will check this and give an error if it has not "
25582 #: ../tools/virt-resize.pl:361
25584 "The amount by which the overall disk must be shrunk (after carrying out all "
25585 "other operations requested by the user) is called the \"deficit\". For "
25586 "example, a straight copy (assume no other operations) from a 5GB disk image "
25587 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25588 "would give an error unless the user specified a partition to shrink and that "
25589 "partition had more than a gigabyte of free space."
25593 #: ../tools/virt-resize.pl:375
25594 msgid "B<--ignore part>"
25598 #: ../tools/virt-resize.pl:377
25600 "Ignore the named partition. Effectively this means the partition is "
25601 "allocated on the destination disk, but the content is not copied across from "
25602 "the source disk. The content of the partition will be blank (all zero "
25607 #: ../tools/virt-resize.pl:388
25608 msgid "B<--delete part>"
25612 #: ../tools/virt-resize.pl:390
25614 "Delete the named partition. It would be more accurate to describe this as "
25615 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25616 "the original disk image is left intact."
25620 #: ../tools/virt-resize.pl:394
25622 "Note that when you delete a partition, then anything contained in the "
25623 "partition is also deleted. Furthermore, this causes any partitions that "
25624 "come after to be I<renumbered>, which can easily make your guest unbootable."
25628 #: ../tools/virt-resize.pl:405
25629 msgid "B<--LV-expand logvol>"
25633 #: ../tools/virt-resize.pl:407
25635 "This takes the logical volume and, as a final step, expands it to fill all "
25636 "the space available in its volume group. A typical usage, assuming a Linux "
25637 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
25638 "lv_root> would be:"
25642 #: ../tools/virt-resize.pl:412
25645 " virt-resize indisk outdisk \\\n"
25646 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25651 #: ../tools/virt-resize.pl:415
25653 "This would first expand the partition (and PV), and then expand the root "
25654 "device to fill the extra space in the PV."
25658 #: ../tools/virt-resize.pl:418
25660 "The contents of the LV are also resized if virt-resize knows how to do "
25661 "that. You can stop virt-resize from trying to expand the content by using "
25662 "the option C<--no-expand-content>."
25666 #: ../tools/virt-resize.pl:422
25667 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25671 #: ../tools/virt-resize.pl:425
25673 "You can give this option multiple times, I<but> it doesn't make sense to do "
25674 "this unless the logical volumes you specify are all in different volume "
25679 #: ../tools/virt-resize.pl:433
25680 msgid "B<--no-copy-boot-loader>"
25684 #: ../tools/virt-resize.pl:435
25686 "By default, virt-resize copies over some sectors at the start of the disk "
25687 "(up to the beginning of the first partition). Commonly these sectors "
25688 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25689 "in order for the guest to boot correctly."
25693 #: ../tools/virt-resize.pl:440
25695 "If you specify this flag, then this initial copy is not done. You may need "
25696 "to reinstall the boot loader in this case."
25700 #: ../tools/virt-resize.pl:448
25701 msgid "B<--no-extra-partition>"
25705 #: ../tools/virt-resize.pl:450
25707 "By default, virt-resize creates an extra partition if there is any extra, "
25708 "unused space after all resizing has happened. Use this option to prevent "
25709 "the extra partition from being created. If you do this then the extra space "
25710 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25711 "tool in the guest."
25715 #: ../tools/virt-resize.pl:456
25717 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25722 #: ../tools/virt-resize.pl:463
25723 msgid "B<--no-expand-content>"
25727 #: ../tools/virt-resize.pl:465
25729 "By default, virt-resize will try to expand the direct contents of "
25730 "partitions, if it knows how (see C<--expand> option above)."
25734 #: ../tools/virt-resize.pl:468
25736 "If you give the C<--no-expand-content> option then virt-resize will not "
25741 #: ../tools/virt-resize.pl:475
25742 msgid "B<-d> | B<--debug>"
25746 #: ../tools/virt-resize.pl:477 ../tools/virt-win-reg.pl:198
25747 msgid "Enable debugging messages."
25751 #: ../tools/virt-resize.pl:483
25752 msgid "B<-n> | B<--dryrun>"
25756 #: ../tools/virt-resize.pl:485
25757 msgid "Print a summary of what would be done, but don't do anything."
25761 #: ../tools/virt-resize.pl:491
25762 msgid "B<-q> | B<--quiet>"
25766 #: ../tools/virt-resize.pl:493
25767 msgid "Don't print the summary."
25771 #: ../tools/virt-resize.pl:1352
25772 msgid "\"Partition 1 does not end on cylinder boundary.\""
25776 #: ../tools/virt-resize.pl:1354
25778 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25779 "means the partitions will not be aligned to the ancient CHS geometry. "
25780 "However CHS geometry is meaningless for disks manufactured since the early "
25781 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25782 "cylinders is not required by any modern operating system."
25786 #: ../tools/virt-resize.pl:1361
25787 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25791 #: ../tools/virt-resize.pl:1363
25793 "In Windows Vista and later versions, Microsoft switched to using a separate "
25794 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25795 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
25796 "the boot partition. Doing so seems to break the guest completely. However "
25797 "expanding the second partition (ie. C: drive) should work."
25801 #: ../tools/virt-resize.pl:1370
25803 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25804 "NTFS partitions have been expanded. This is just a safety check and (unless "
25805 "it find errors) is nothing to worry about."
25809 #: ../tools/virt-resize.pl:1374
25810 msgid "ALTERNATIVE TOOLS"
25814 #: ../tools/virt-resize.pl:1376
25816 "There are several proprietary tools for resizing partitions. We won't "
25817 "mention any here."
25821 #: ../tools/virt-resize.pl:1379
25823 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25824 "operations on disk images. They can resize and move partitions, but I don't "
25825 "think they can do anything with the contents, and they certainly don't "
25830 #: ../tools/virt-resize.pl:1384
25832 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25833 "but at a much lower level. You will probably end up hand-calculating sector "
25834 "offsets, which is something that virt-resize was designed to avoid. If you "
25835 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25840 #: ../tools/virt-resize.pl:1392
25842 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
25843 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
25844 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<Sys::Guestfs"
25845 "(3)>, L<http://libguestfs.org/>."
25849 #: ../tools/virt-tar.pl:34
25850 msgid "virt-tar - Extract or upload files to a virtual machine"
25854 #: ../tools/virt-tar.pl:38
25857 " virt-tar [--options] -x domname directory tarball\n"
25862 #: ../tools/virt-tar.pl:40
25865 " virt-tar [--options] -u domname tarball directory\n"
25870 #: ../tools/virt-tar.pl:42
25873 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
25878 #: ../tools/virt-tar.pl:44
25881 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
25886 #: ../tools/virt-tar.pl:48
25887 msgid "Download C</home> from the VM into a local tarball:"
25891 #: ../tools/virt-tar.pl:50
25894 " virt-tar -x domname /home home.tar\n"
25899 #: ../tools/virt-tar.pl:52
25902 " virt-tar -zx domname /home home.tar.gz\n"
25907 #: ../tools/virt-tar.pl:54
25908 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
25912 #: ../tools/virt-tar.pl:56
25915 " virt-tar -u domname uploadstuff.tar /tmp\n"
25920 #: ../tools/virt-tar.pl:58
25923 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
25928 #: ../tools/virt-tar.pl:62
25930 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
25931 "virtual machines. If you do this, you risk disk corruption in the VM. "
25932 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
25936 #: ../tools/virt-tar.pl:67
25938 "You can use C<-x> (extract) on live virtual machines, but you might get "
25939 "inconsistent results or errors if there is filesystem activity inside the "
25940 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
25941 "work, but the only way to guarantee consistent results is if the virtual "
25942 "machine is shut down."
25946 #: ../tools/virt-tar.pl:75
25948 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
25949 "parts of a guest filesystem. There are many possibilities: making backups, "
25950 "uploading data files, snooping on guest activity, fixing or customizing "
25955 #: ../tools/virt-tar.pl:80
25957 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
25958 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
25959 "should look at the L<guestfish(1)> tool."
25963 #: ../tools/virt-tar.pl:84
25965 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
25966 "its contents (recursively) from the virtual machine into a local tarball. "
25967 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
25968 "virtual machine. You cannot use these two options together."
25972 #: ../tools/virt-tar.pl:90
25974 "In addition, you may need to use the C<-z> (gZip) option to enable "
25975 "compression. When uploading, you have to specify C<-z> if the upload file "
25976 "is compressed because virt-tar won't detect this on its own."
25980 #: ../tools/virt-tar.pl:94
25982 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
25983 "example it cannot do PKZip files or bzip2 compression. If you want that "
25984 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
25985 "the L<libguestfs(3)> API)."
25989 #: ../tools/virt-tar.pl:135
25990 msgid "B<-x> | B<--extract> | B<--download>"
25994 #: ../tools/virt-tar.pl:137
25995 msgid "B<-u> | B<--upload>"
25999 #: ../tools/virt-tar.pl:139
26001 "Use C<-x> to extract (download) a directory from a virtual machine to a "
26006 #: ../tools/virt-tar.pl:142
26008 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
26009 "Please read the L</WARNING> section above before using this option."
26013 #: ../tools/virt-tar.pl:146
26014 msgid "You must specify exactly one of these options."
26018 #: ../tools/virt-tar.pl:152
26019 msgid "B<-z> | B<--gzip>"
26023 #: ../tools/virt-tar.pl:154
26024 msgid "Specify that the input or output tarball is gzip-compressed."
26028 #: ../tools/virt-tar.pl:259
26030 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
26031 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
26036 #: ../tools/virt-win-reg.pl:38
26038 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26042 #: ../tools/virt-win-reg.pl:42
26045 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26050 #: ../tools/virt-win-reg.pl:44
26053 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26058 #: ../tools/virt-win-reg.pl:46
26061 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26066 #: ../tools/virt-win-reg.pl:48
26069 " virt-win-reg --merge domname [input.reg ...]\n"
26074 #: ../tools/virt-win-reg.pl:50
26077 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26082 #: ../tools/virt-win-reg.pl:54
26084 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26085 "virtual machines. If you do this, you I<will> get irreversible disk "
26086 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26087 "but doesn't catch all cases."
26091 #: ../tools/virt-win-reg.pl:59
26093 "Modifying the Windows Registry is an inherently risky operation. The format "
26094 "is deliberately obscure and undocumented, and Registry changes can leave the "
26095 "system unbootable. Therefore when using the C<--merge> option, make sure "
26096 "you have a reliable backup first."
26100 #: ../tools/virt-win-reg.pl:66
26102 "This program can export and merge Windows Registry entries from a Windows "
26107 #: ../tools/virt-win-reg.pl:69
26109 "The first parameter is the libvirt guest name or the raw disk image of a "
26114 #: ../tools/virt-win-reg.pl:72
26116 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26117 "exported (recursively). For example:"
26121 #: ../tools/virt-win-reg.pl:75
26124 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26129 #: ../tools/virt-win-reg.pl:77
26131 "You can also display single values from within registry keys, for example:"
26135 #: ../tools/virt-win-reg.pl:80
26138 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26139 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26140 " Windows 7 Enterprise\n"
26145 #: ../tools/virt-win-reg.pl:84
26147 "With C<--merge>, you can merge a textual regedit file into the Windows "
26152 #: ../tools/virt-win-reg.pl:87
26155 " $ virt-win-reg --merge Windows7 changes.reg\n"
26160 #: ../tools/virt-win-reg.pl:89
26161 msgid "SUPPORTED SYSTEMS"
26165 #: ../tools/virt-win-reg.pl:91
26167 "The program currently supports Windows NT-derived guests starting with "
26168 "Windows XP through to at least Windows 7."
26172 #: ../tools/virt-win-reg.pl:94
26174 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26175 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26176 "and C<HKEY_USERS\\.DEFAULT>."
26180 #: ../tools/virt-win-reg.pl:98
26182 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26187 #: ../tools/virt-win-reg.pl:101
26189 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26194 #: ../tools/virt-win-reg.pl:104
26199 #: ../tools/virt-win-reg.pl:106
26201 "This program is only meant for simple access to the registry. If you want "
26202 "to do complicated things with the registry, we suggest you download the "
26203 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26204 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26205 "L<hivexregedit(1)>."
26209 #: ../tools/virt-win-reg.pl:112
26214 #: ../tools/virt-win-reg.pl:114
26216 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26217 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26218 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26219 "Windows-style line endings, you may need to reencode the whole file before "
26220 "or after processing."
26224 #: ../tools/virt-win-reg.pl:120
26226 "To reencode a file from Windows format to Linux (before processing it with "
26227 "the C<--merge> option), you would do something like this:"
26231 #: ../tools/virt-win-reg.pl:123
26234 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26239 #: ../tools/virt-win-reg.pl:125
26241 "To go in the opposite direction, after exporting and before sending the file "
26242 "to a Windows user, do something like this:"
26246 #: ../tools/virt-win-reg.pl:128
26249 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26254 #: ../tools/virt-win-reg.pl:130
26255 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26259 #: ../tools/virt-win-reg.pl:132
26261 "If you are unsure about the current encoding, use the L<file(1)> command. "
26262 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26263 "style (CRLF) line endings, like this:"
26267 #: ../tools/virt-win-reg.pl:136
26270 " $ file software.reg\n"
26271 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26272 " with CRLF line terminators\n"
26277 #: ../tools/virt-win-reg.pl:140
26278 msgid "This file would need conversion before you could C<--merge> it."
26282 #: ../tools/virt-win-reg.pl:142
26283 msgid "SHELL QUOTING"
26287 #: ../tools/virt-win-reg.pl:144
26289 "Be careful when passing parameters containing C<\\> (backslash) in the "
26290 "shell. Usually you will have to use 'single quotes' or double backslashes "
26291 "(but not both) to protect them from the shell."
26295 #: ../tools/virt-win-reg.pl:148
26296 msgid "Paths and value names are case-insensitive."
26300 #: ../tools/virt-win-reg.pl:150
26301 msgid "CurrentControlSet etc."
26305 #: ../tools/virt-win-reg.pl:152
26307 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26308 "Registry at the level of the hive file, and therefore you cannot modify "
26313 #: ../tools/virt-win-reg.pl:156
26315 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26316 "circumstances it might refer to another control set. The way to find out is "
26317 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26321 #: ../tools/virt-win-reg.pl:160
26324 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26325 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26326 " \"Current\"=dword:00000001\n"
26327 " \"Default\"=dword:00000001\n"
26328 " \"Failed\"=dword:00000000\n"
26329 " \"LastKnownGood\"=dword:00000002\n"
26334 #: ../tools/virt-win-reg.pl:167
26335 msgid "\"Default\" is the one which Windows will choose when it boots."
26339 #: ../tools/virt-win-reg.pl:169
26341 "Similarly, other C<Current...> keys in the path may need to be replaced."
26345 #: ../tools/virt-win-reg.pl:216
26350 #: ../tools/virt-win-reg.pl:218
26352 "In merge mode, this merges a textual regedit file into the Windows Registry "
26353 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26354 "displays or exports Registry entries instead."
26358 #: ../tools/virt-win-reg.pl:222
26360 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26361 "result in disk corruption. However exporting (without this flag) is always "
26366 #: ../tools/virt-win-reg.pl:230
26367 msgid "B<--encoding> UTF-16LE|ASCII"
26371 #: ../tools/virt-win-reg.pl:232
26373 "When merging (only), you may need to specify the encoding for strings to be "
26374 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26375 "(3)/ENCODING STRINGS>."
26379 #: ../tools/virt-win-reg.pl:236
26381 "The default is to use UTF-16LE, which should work with recent versions of "
26386 #: ../tools/virt-win-reg.pl:463
26388 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26389 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26390 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26394 #: ../tools/virt-win-reg.pl:481
26397 " export LIBGUESTFS_DEBUG=1\n"
26398 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26403 #: ../tools/virt-win-reg.pl:484
26405 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."