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-10 10:25+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"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
19 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1
20 #: ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1
21 #: ../inspector/virt-inspector.pl:36 ../tools/virt-cat.pl:30
22 #: ../tools/virt-df.pl:32 ../tools/virt-edit.pl:31
23 #: ../tools/virt-list-filesystems.pl:28 ../tools/virt-list-partitions.pl:28
24 #: ../tools/virt-ls.pl:31 ../tools/virt-make-fs.pl:33
25 #: ../tools/virt-rescue.pl:29 ../tools/virt-resize.pl:38
26 #: ../tools/virt-tar.pl:30 ../tools/virt-win-reg.pl:34
31 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
32 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
33 #: ../inspector/virt-inspector.pl:38 ../tools/virt-cat.pl:32
34 #: ../tools/virt-df.pl:34 ../tools/virt-edit.pl:33
35 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
36 #: ../tools/virt-ls.pl:33 ../tools/virt-make-fs.pl:35
37 #: ../tools/virt-rescue.pl:31 ../tools/virt-resize.pl:40
38 #: ../tools/virt-tar.pl:32 ../tools/virt-win-reg.pl:36
43 #: ../src/guestfs.pod:5
44 msgid "guestfs - Library for accessing and modifying virtual machine images"
48 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
49 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
50 #: ../inspector/virt-inspector.pl:42 ../tools/virt-cat.pl:36
51 #: ../tools/virt-df.pl:38 ../tools/virt-edit.pl:37
52 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
53 #: ../tools/virt-ls.pl:37 ../tools/virt-make-fs.pl:39
54 #: ../tools/virt-rescue.pl:35 ../tools/virt-resize.pl:44
55 #: ../tools/virt-tar.pl:36 ../tools/virt-win-reg.pl:40
60 #: ../src/guestfs.pod:9
63 " #include <guestfs.h>\n"
68 #: ../src/guestfs.pod:11
71 " guestfs_h *g = guestfs_create ();\n"
72 " guestfs_add_drive (g, \"guest.img\");\n"
73 " guestfs_launch (g);\n"
74 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
75 " guestfs_touch (g, \"/hello\");\n"
76 " guestfs_umount (g, \"/\");\n"
77 " guestfs_sync (g);\n"
78 " guestfs_close (g);\n"
83 #: ../src/guestfs.pod:20
86 " cc prog.c -o prog -lguestfs\n"
88 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
93 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:115
94 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:16
95 #: ../inspector/virt-inspector.pl:48 ../tools/virt-cat.pl:42
96 #: ../tools/virt-df.pl:46 ../tools/virt-edit.pl:51
97 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
98 #: ../tools/virt-ls.pl:43 ../tools/virt-make-fs.pl:47
99 #: ../tools/virt-rescue.pl:51 ../tools/virt-resize.pl:50
100 #: ../tools/virt-tar.pl:73 ../tools/virt-win-reg.pl:64
105 #: ../src/guestfs.pod:26
107 "Libguestfs is a library for accessing and modifying guest disk images. "
108 "Amongst the things this is good for: making batch configuration changes to "
109 "guests, getting disk used/free statistics (see also: virt-df), migrating "
110 "between virtualization systems (see also: virt-p2v), performing partial "
111 "backups, performing partial guest clones, cloning guests and changing "
112 "registry/UUID/hostname info, and much else besides."
116 #: ../src/guestfs.pod:34
118 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
119 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
120 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
125 #: ../src/guestfs.pod:39
127 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
128 "what filesystem is in each LV, etc.). It can also run commands in the "
129 "context of the guest. Also you can access filesystems over FUSE."
133 #: ../src/guestfs.pod:44
135 "Libguestfs is a library that can be linked with C and C++ management "
136 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
137 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
142 #: ../src/guestfs.pod:49
144 "You don't need to be root to use libguestfs, although obviously you do need "
145 "enough permissions to access the disk images."
149 #: ../src/guestfs.pod:52
151 "Libguestfs is a large API because it can do many things. For a gentle "
152 "introduction, please read the L</API OVERVIEW> section next."
156 #: ../src/guestfs.pod:55
161 #: ../src/guestfs.pod:57
163 "This section provides a gentler overview of the libguestfs API. We also try "
164 "to group API calls together, where that may not be obvious from reading "
165 "about the individual calls in the main section of this manual."
169 #: ../src/guestfs.pod:62
174 #: ../src/guestfs.pod:64
176 "Before you can use libguestfs calls, you have to create a handle. Then you "
177 "must add at least one disk image to the handle, followed by launching the "
178 "handle, then performing whatever operations you want, and finally closing "
179 "the handle. By convention we use the single letter C<g> for the name of the "
180 "handle variable, although of course you can use any name you want."
184 #: ../src/guestfs.pod:71
185 msgid "The general structure of all libguestfs-using programs looks like this:"
189 #: ../src/guestfs.pod:74
192 " guestfs_h *g = guestfs_create ();\n"
197 #: ../src/guestfs.pod:76
200 " /* Call guestfs_add_drive additional times if there are\n"
201 " * multiple disk images.\n"
203 " guestfs_add_drive (g, \"guest.img\");\n"
208 #: ../src/guestfs.pod:81
211 " /* Most manipulation calls won't work until you've launched\n"
212 " * the handle 'g'. You have to do this _after_ adding drives\n"
213 " * and _before_ other commands.\n"
215 " guestfs_launch (g);\n"
220 #: ../src/guestfs.pod:87
223 " /* Now you can examine what partitions, LVs etc are available.\n"
225 " char **partitions = guestfs_list_partitions (g);\n"
226 " char **logvols = guestfs_lvs (g);\n"
231 #: ../src/guestfs.pod:92
234 " /* To access a filesystem in the image, you must mount it.\n"
236 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
241 #: ../src/guestfs.pod:96
244 " /* Now you can perform filesystem actions on the guest\n"
247 " guestfs_touch (g, \"/hello\");\n"
252 #: ../src/guestfs.pod:101
255 " /* You only need to call guestfs_sync if you have made\n"
256 " * changes to the guest image. (But if you've made changes\n"
257 " * then you *must* sync). See also: guestfs_umount and\n"
258 " * guestfs_umount_all calls.\n"
260 " guestfs_sync (g);\n"
265 #: ../src/guestfs.pod:108
268 " /* Close the handle 'g'. */\n"
269 " guestfs_close (g);\n"
274 #: ../src/guestfs.pod:111
276 "The code above doesn't include any error checking. In real code you should "
277 "check return values carefully for errors. In general all functions that "
278 "return integers return C<-1> on error, and all functions that return "
279 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
280 "how to handle errors, and consult the documentation for each function call "
281 "below to see precisely how they return error indications."
285 #: ../src/guestfs.pod:119
290 #: ../src/guestfs.pod:121
292 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
293 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
294 "actual block device, or simply an empty file of zeroes that you have created "
295 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
300 #: ../src/guestfs.pod:127
302 "You can add a disk read-only using L</guestfs_add_drive_ro>, in which case "
303 "libguestfs won't modify the file."
307 #: ../src/guestfs.pod:130
309 "Be extremely cautious if the disk image is in use, eg. if it is being used "
310 "by a virtual machine. Adding it read-write will almost certainly cause disk "
311 "corruption, but adding it read-only is safe."
315 #: ../src/guestfs.pod:134
317 "You must add at least one disk image, and you may add multiple disk images. "
318 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
319 "first one you added), C</dev/sdb> (for the second one you added), etc."
323 #: ../src/guestfs.pod:139
325 "Once L</guestfs_launch> has been called you cannot add any more images. You "
326 "can call L</guestfs_list_devices> to get a list of the device names, in the "
327 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
331 #: ../src/guestfs.pod:144
336 #: ../src/guestfs.pod:146
338 "Before you can read or write files, create directories and so on in a disk "
339 "image that contains filesystems, you have to mount those filesystems using "
340 "L</guestfs_mount>. If you already know that a disk image contains (for "
341 "example) one partition with a filesystem on that partition, then you can "
346 #: ../src/guestfs.pod:152
349 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
354 #: ../src/guestfs.pod:154
356 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
357 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
358 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
362 #: ../src/guestfs.pod:158
364 "If you are given a disk image and you don't know what it contains then you "
365 "have to find out. Libguestfs can do that too: use L</"
366 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
367 "LVs, and either try mounting each to see what is mountable, or else examine "
368 "them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also has a "
369 "set of APIs for inspection of disk images (see L</INSPECTION> below). But "
370 "you might find it easier to look at higher level programs built on top of "
371 "libguestfs, in particular L<virt-inspector(1)>."
375 #: ../src/guestfs.pod:168
377 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
378 "several other variations of the C<guestfs_mount_*> call."
382 #: ../src/guestfs.pod:171
383 msgid "FILESYSTEM ACCESS AND MODIFICATION"
387 #: ../src/guestfs.pod:173
389 "The majority of the libguestfs API consists of fairly low-level calls for "
390 "accessing and modifying the files, directories, symlinks etc on mounted "
391 "filesystems. There are over a hundred such calls which you can find listed "
392 "in detail below in this man page, and we don't even pretend to cover them "
393 "all in this overview."
397 #: ../src/guestfs.pod:179
399 "Specify filenames as full paths, starting with C<\"/\"> and including the "
404 #: ../src/guestfs.pod:182
406 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
407 "the file called C<\"etc/passwd\"> then you could do:"
411 #: ../src/guestfs.pod:185
414 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
419 #: ../src/guestfs.pod:187
421 "This would return C<data> as a newly allocated buffer containing the full "
422 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
423 "or C<NULL> if there was an error."
427 #: ../src/guestfs.pod:191
429 "As another example, to create a top-level directory on that filesystem "
430 "called C<\"var\"> you would do:"
434 #: ../src/guestfs.pod:194
437 " guestfs_mkdir (g, \"/var\");\n"
442 #: ../src/guestfs.pod:196
443 msgid "To create a symlink you could do:"
447 #: ../src/guestfs.pod:198
450 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
451 " \"/etc/rc3.d/S30portmap\");\n"
456 #: ../src/guestfs.pod:201
458 "Libguestfs will reject attempts to use relative paths and there is no "
459 "concept of a current working directory."
463 #: ../src/guestfs.pod:204
465 "Libguestfs can return errors in many situations: for example if the "
466 "filesystem isn't writable, or if a file or directory that you requested "
467 "doesn't exist. If you are using the C API (documented here) you have to "
468 "check for those error conditions after each call. (Other language bindings "
469 "turn these errors into exceptions)."
473 #: ../src/guestfs.pod:210
475 "File writes are affected by the per-handle umask, set by calling L</"
476 "guestfs_umask> and defaulting to 022. See L</UMASK>."
480 #: ../src/guestfs.pod:213
485 #: ../src/guestfs.pod:215
487 "Libguestfs contains API calls to read, create and modify partition tables on "
492 #: ../src/guestfs.pod:218
494 "In the common case where you want to create a single partition covering the "
495 "whole disk, you should use the L</guestfs_part_disk> call:"
499 #: ../src/guestfs.pod:222
502 " const char *parttype = \"mbr\";\n"
503 " if (disk_is_larger_than_2TB)\n"
504 " parttype = \"gpt\";\n"
505 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
510 #: ../src/guestfs.pod:227
512 "Obviously this effectively wipes anything that was on that disk image before."
516 #: ../src/guestfs.pod:230
521 #: ../src/guestfs.pod:232
523 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
524 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
525 "you familiarize yourself with the concepts of physical volumes, volume "
526 "groups and logical volumes."
530 #: ../src/guestfs.pod:237
532 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
533 "tldp.org/HOWTO/LVM-HOWTO/>."
537 #: ../src/guestfs.pod:240
542 #: ../src/guestfs.pod:242
544 "Use L</guestfs_cat> to download small, text only files. This call is "
545 "limited to files which are less than 2 MB and which cannot contain any ASCII "
546 "NUL (C<\\0>) characters. However it has a very simple to use API."
550 #: ../src/guestfs.pod:247
552 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
553 "bit data, since it returns a (pointer, size) pair. However it is still "
554 "limited to \"small\" files, less than 2 MB."
558 #: ../src/guestfs.pod:251
560 "L</guestfs_download> can be used to download any file, with no limits on "
561 "content or size (even files larger than 4 GB)."
565 #: ../src/guestfs.pod:254
567 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
571 #: ../src/guestfs.pod:257
576 #: ../src/guestfs.pod:259
578 "It's often the case that you want to write a file or files to the disk image."
582 #: ../src/guestfs.pod:262
584 "To write a small file with fixed content, use L</guestfs_write>. To create "
585 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
586 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
587 "of other functions for creating test files, for example L</guestfs_fill> and "
588 "L</guestfs_fill_pattern>."
592 #: ../src/guestfs.pod:268
594 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
595 "file content or size (even files larger than 4 GB)."
599 #: ../src/guestfs.pod:271
601 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
605 #: ../src/guestfs.pod:273
607 "However the fastest way to upload I<large numbers of arbitrary files> is to "
608 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
609 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
610 "in a predictable way (eg. adding it last after all other drives) then you "
611 "can get the device name from L</guestfs_list_devices> and mount it directly "
612 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
613 "portable between kernel versions, and they don't support labels or UUIDs. "
614 "If you want to pre-build an image or you need to mount it using a label or "
615 "UUID, use an ISO image instead."
619 #: ../src/guestfs.pod:284
624 #: ../src/guestfs.pod:286
626 "There are various different commands for copying between files and devices "
627 "and in and out of the guest filesystem. These are summarised in the table "
632 #: ../src/guestfs.pod:292
633 msgid "B<file> to B<file>"
637 #: ../src/guestfs.pod:294
639 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
640 "directories recursively."
644 #: ../src/guestfs.pod:297
645 msgid "B<file or device> to B<file or device>"
649 #: ../src/guestfs.pod:299
651 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
652 "devices in the guest."
656 #: ../src/guestfs.pod:302
657 msgid "Example: duplicate the contents of an LV:"
661 #: ../src/guestfs.pod:304
664 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
669 #: ../src/guestfs.pod:306
671 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
672 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
673 "guestfs_copy_size>."
677 #: ../src/guestfs.pod:310
678 msgid "B<file on the host> to B<file or device>"
682 #: ../src/guestfs.pod:312
683 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
687 #: ../src/guestfs.pod:314
688 msgid "B<file or device> to B<file on the host>"
692 #: ../src/guestfs.pod:316
693 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
697 #: ../src/guestfs.pod:320
698 msgid "LISTING FILES"
702 #: ../src/guestfs.pod:322
704 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
705 "L<guestfish(1)>-equivalent command C<ll>)."
709 #: ../src/guestfs.pod:325
711 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
712 "programs, as a flat list of strings."
716 #: ../src/guestfs.pod:328
718 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
719 "directory, plus additional information about each one. It is more "
720 "equivalent to using the L<readdir(3)> call on a local filesystem."
724 #: ../src/guestfs.pod:332
726 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
730 #: ../src/guestfs.pod:335
731 msgid "RUNNING COMMANDS"
735 #: ../src/guestfs.pod:337
737 "Although libguestfs is primarily an API for manipulating files inside guest "
738 "images, we also provide some limited facilities for running commands inside "
743 #: ../src/guestfs.pod:341
744 msgid "There are many limitations to this:"
748 #: ../src/guestfs.pod:345 ../src/guestfs.pod:350 ../src/guestfs.pod:355
749 #: ../src/guestfs.pod:359 ../src/guestfs.pod:364 ../src/guestfs.pod:368
750 #: ../src/guestfs.pod:373 ../src/guestfs.pod:1223 ../src/guestfs.pod:1228
751 #: ../src/guestfs.pod:1232 ../src/guestfs.pod:1334 ../src/guestfs.pod:1338
752 #: ../src/guestfs.pod:1342 ../src/guestfs.pod:1347 ../src/guestfs.pod:1355
753 #: ../src/guestfs.pod:1374 ../src/guestfs.pod:1382 ../src/guestfs.pod:1612
754 #: ../src/guestfs.pod:1618 ../src/guestfs.pod:1623 ../src/guestfs.pod:1629
755 #: ../src/guestfs.pod:1736 ../src/guestfs.pod:1740 ../src/guestfs.pod:1744
756 #: ../src/guestfs.pod:1748 ../src/guestfs-actions.pod:14
757 #: ../src/guestfs-actions.pod:21 ../src/guestfs-actions.pod:372
758 #: ../src/guestfs-actions.pod:380 ../src/guestfs-actions.pod:387
759 #: ../src/guestfs-actions.pod:394 ../src/guestfs-actions.pod:1257
760 #: ../src/guestfs-actions.pod:1261 ../src/guestfs-actions.pod:1265
761 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:1277
762 #: ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:1285
763 #: ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1299
764 #: ../src/guestfs-actions.pod:1303 ../src/guestfs-actions.pod:1426
765 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1435
766 #: ../src/guestfs-actions.pod:1440 ../src/guestfs-actions.pod:1492
767 #: ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:1501
768 #: ../fish/guestfish.pod:309 ../fish/guestfish.pod:313
769 #: ../fish/guestfish.pod:317 ../fish/guestfish.pod:321
770 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
771 #: ../fish/guestfish-actions.pod:300 ../fish/guestfish-actions.pod:308
772 #: ../fish/guestfish-actions.pod:315 ../fish/guestfish-actions.pod:322
773 #: ../fish/guestfish-actions.pod:998 ../fish/guestfish-actions.pod:1002
774 #: ../fish/guestfish-actions.pod:1006 ../fish/guestfish-actions.pod:1010
775 #: ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1022
776 #: ../fish/guestfish-actions.pod:1026 ../fish/guestfish-actions.pod:1036
777 #: ../fish/guestfish-actions.pod:1040 ../fish/guestfish-actions.pod:1044
778 #: ../fish/guestfish-actions.pod:1134 ../fish/guestfish-actions.pod:1138
779 #: ../fish/guestfish-actions.pod:1143 ../fish/guestfish-actions.pod:1148
780 #: ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1194
781 #: ../fish/guestfish-actions.pod:1199 ../tools/virt-resize.pl:324
782 #: ../tools/virt-resize.pl:329 ../tools/virt-resize.pl:339
787 #: ../src/guestfs.pod:347
789 "The kernel version that the command runs under will be different from what "
794 #: ../src/guestfs.pod:352
796 "If the command needs to communicate with daemons, then most likely they "
801 #: ../src/guestfs.pod:357
802 msgid "The command will be running in limited memory."
806 #: ../src/guestfs.pod:361
808 "The network may not be available unless you enable it (see L</"
809 "guestfs_set_network>)."
813 #: ../src/guestfs.pod:366
814 msgid "Only supports Linux guests (not Windows, BSD, etc)."
818 #: ../src/guestfs.pod:370
820 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
824 #: ../src/guestfs.pod:375
826 "For SELinux guests, you may need to enable SELinux and load policy first. "
827 "See L</SELINUX> in this manpage."
831 #: ../src/guestfs.pod:380
833 "The two main API calls to run commands are L</guestfs_command> and L</"
834 "guestfs_sh> (there are also variations)."
838 #: ../src/guestfs.pod:383
840 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
841 "shell globs, redirections, etc will work."
845 #: ../src/guestfs.pod:386
846 msgid "CONFIGURATION FILES"
850 #: ../src/guestfs.pod:388
852 "To read and write configuration files in Linux guest filesystems, we "
853 "strongly recommend using Augeas. For example, Augeas understands how to "
854 "read and write, say, a Linux shadow password file or X.org configuration "
855 "file, and so avoids you having to write that code."
859 #: ../src/guestfs.pod:393
861 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
862 "document Augeas itself here because there is excellent documentation on the "
863 "L<http://augeas.net/> website."
867 #: ../src/guestfs.pod:397
869 "If you don't want to use Augeas (you fool!) then try calling L</"
870 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
875 #: ../src/guestfs.pod:401
880 #: ../src/guestfs.pod:403
882 "We support SELinux guests. To ensure that labeling happens correctly in "
883 "SELinux guests, you need to enable SELinux and load the guest's policy:"
887 #: ../src/guestfs.pod:409
892 #: ../src/guestfs.pod:411
893 msgid "Before launching, do:"
897 #: ../src/guestfs.pod:413
900 " guestfs_set_selinux (g, 1);\n"
905 #: ../src/guestfs.pod:415
910 #: ../src/guestfs.pod:417
912 "After mounting the guest's filesystem(s), load the policy. This is best "
913 "done by running the L<load_policy(8)> command in the guest itself:"
917 #: ../src/guestfs.pod:421
920 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
925 #: ../src/guestfs.pod:423
927 "(Older versions of C<load_policy> require you to specify the name of the "
932 #: ../src/guestfs.pod:426
937 #: ../src/guestfs.pod:428
939 "Optionally, set the security context for the API. The correct security "
940 "context to use can only be known by inspecting the guest. As an example:"
944 #: ../src/guestfs.pod:432
947 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
952 #: ../src/guestfs.pod:436
953 msgid "This will work for running commands and editing existing files."
957 #: ../src/guestfs.pod:438
959 "When new files are created, you may need to label them explicitly, for "
960 "example by running the external command C<restorecon pathname>."
964 #: ../src/guestfs.pod:442
969 #: ../src/guestfs.pod:444
971 "Certain calls are affected by the current file mode creation mask (the "
972 "\"umask\"). In particular ones which create files or directories, such as "
973 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
974 "either the default mode that the file is created with or modifies the mode "
979 #: ../src/guestfs.pod:450
981 "The default umask is C<022>, so files are created with modes such as C<0644> "
982 "and directories with C<0755>."
986 #: ../src/guestfs.pod:453
988 "There are two ways to avoid being affected by umask. Either set umask to 0 "
989 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
990 "guestfs_chmod> after creating each file or directory."
994 #: ../src/guestfs.pod:457
995 msgid "For more information about umask, see L<umask(2)>."
999 #: ../src/guestfs.pod:459 ../fish/guestfish.pod:559
1000 msgid "ENCRYPTED DISKS"
1004 #: ../src/guestfs.pod:461
1006 "Libguestfs allows you to access Linux guests which have been encrypted using "
1007 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1008 "standard. This includes nearly all whole disk encryption systems used by "
1009 "modern Linux guests."
1013 #: ../src/guestfs.pod:467
1015 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1016 "returns the string C<crypto_LUKS>)."
1020 #: ../src/guestfs.pod:470
1022 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1023 "will require the passphrase!"
1027 #: ../src/guestfs.pod:473
1029 "Opening a LUKS device creates a new device mapper device called C</dev/"
1030 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1031 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1032 "from and encrypted to the underlying block device respectively."
1036 #: ../src/guestfs.pod:479
1038 "LVM volume groups on the device can be made visible by calling L</"
1039 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1040 "(s) can now be mounted in the usual way."
1044 #: ../src/guestfs.pod:483
1046 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1047 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1048 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1049 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1050 "underlying encrypted block device)."
1054 #: ../src/guestfs.pod:490
1059 #: ../src/guestfs.pod:492
1061 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1062 "contains operating systems. (These APIs used to be in a separate Perl-only "
1063 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1064 "frequently used part of this library has been rewritten in C and moved into "
1069 #: ../src/guestfs.pod:498
1071 "Add all disks belonging to the unknown virtual machine and call L</"
1072 "guestfs_launch> in the usual way."
1076 #: ../src/guestfs.pod:501
1078 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1079 "and certain heuristics, and returns a list of operating systems that were "
1080 "found. An empty list means none were found. A single element is the root "
1081 "filesystem of the operating system. For dual- or multi-boot guests, "
1082 "multiple roots can be returned, each one corresponding to a separate "
1083 "operating system. (Multi-boot virtual machines are extremely rare in the "
1084 "world of virtualization, but since this scenario can happen, we have built "
1085 "libguestfs to deal with it.)"
1089 #: ../src/guestfs.pod:510
1091 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1092 "to get additional details about that operating system. For example, call L</"
1093 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1094 "Windows and Linux-based operating systems respectively."
1098 #: ../src/guestfs.pod:516
1100 "Un*x-like and Linux-based operating systems usually consist of several "
1101 "filesystems which are mounted at boot time (for example, a separate boot "
1102 "partition mounted on C</boot>). The inspection rules are able to detect how "
1103 "filesystems correspond to mount points. Call "
1104 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1105 "hash table like this example:"
1109 #: ../src/guestfs.pod:523
1112 " /boot => /dev/sda1\n"
1113 " / => /dev/vg_guest/lv_root\n"
1114 " /usr => /dev/vg_guest/lv_usr\n"
1119 #: ../src/guestfs.pod:527
1121 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1122 "filesystems as suggested."
1126 #: ../src/guestfs.pod:530
1128 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1129 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1133 #: ../src/guestfs.pod:534
1135 "Inspection currently only works for some common operating systems. "
1136 "Contributors are welcome to send patches for other operating systems that we "
1137 "currently cannot detect."
1141 #: ../src/guestfs.pod:538
1143 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1144 "for more details. The L</guestfs_inspect_os> function just ignores any "
1145 "encrypted devices."
1149 #: ../src/guestfs.pod:542
1151 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1152 "inspection and caches the results in the guest handle. Subsequent calls to "
1153 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1154 "read the disks. If you change the content of the guest disks, you can redo "
1155 "inspection by calling L</guestfs_inspect_os> again."
1159 #: ../src/guestfs.pod:549
1160 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1164 #: ../src/guestfs.pod:551
1166 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1167 "ntfs-3g.org/> driver."
1171 #: ../src/guestfs.pod:554
1173 "DOS and Windows still use drive letters, and the filesystems are always "
1174 "treated as case insensitive by Windows itself, and therefore you might find "
1175 "a Windows configuration file referring to a path like C<c:\\windows"
1176 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1177 "might be referred to as C</WINDOWS/System32>."
1181 #: ../src/guestfs.pod:560
1183 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1184 "libguestfs to read the appropriate Windows Registry and configuration files, "
1185 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1190 #: ../src/guestfs.pod:565
1192 "Replacing backslash characters with forward slash characters is also outside "
1193 "the scope of libguestfs, but something that you can easily do."
1197 #: ../src/guestfs.pod:568
1199 "Where we can help is in resolving the case insensitivity of paths. For "
1200 "this, call L</guestfs_case_sensitive_path>."
1204 #: ../src/guestfs.pod:571
1206 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1207 "files, through the library C<hivex> which is part of the libguestfs project "
1208 "although ships as a separate tarball. You have to locate and download the "
1209 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1210 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1211 "reg(1)> for more help on this issue."
1215 #: ../src/guestfs.pod:579
1216 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1220 #: ../src/guestfs.pod:581
1222 "Although we don't want to discourage you from using the C API, we will "
1223 "mention here that the same API is also available in other languages."
1227 #: ../src/guestfs.pod:584
1229 "The API is broadly identical in all supported languages. This means that "
1230 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1231 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1232 "words, a straightforward, predictable isomorphism between each language."
1236 #: ../src/guestfs.pod:590
1238 "Error messages are automatically transformed into exceptions if the language "
1243 #: ../src/guestfs.pod:593
1245 "We don't try to \"object orientify\" parts of the API in OO languages, "
1246 "although contributors are welcome to write higher level APIs above what we "
1247 "provide in their favourite languages if they wish."
1251 #: ../src/guestfs.pod:599
1256 #: ../src/guestfs.pod:601
1258 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1259 "identical to the C API. C++ classes and exceptions are not used."
1263 #: ../src/guestfs.pod:605
1268 #: ../src/guestfs.pod:607
1270 "The C# bindings are highly experimental. Please read the warnings at the "
1271 "top of C<csharp/Libguestfs.cs>."
1275 #: ../src/guestfs.pod:610
1280 #: ../src/guestfs.pod:612
1282 "This is the only language binding that is working but incomplete. Only "
1283 "calls which return simple integers have been bound in Haskell, and we are "
1284 "looking for help to complete this binding."
1288 #: ../src/guestfs.pod:616
1293 #: ../src/guestfs.pod:618
1295 "Full documentation is contained in the Javadoc which is distributed with "
1300 #: ../src/guestfs.pod:621
1305 #: ../src/guestfs.pod:623
1306 msgid "For documentation see the file C<guestfs.mli>."
1310 #: ../src/guestfs.pod:625
1315 #: ../src/guestfs.pod:627
1316 msgid "For documentation see L<Sys::Guestfs(3)>."
1320 #: ../src/guestfs.pod:629
1325 #: ../src/guestfs.pod:631
1327 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1328 "the php-libguestfs package for your distribution."
1332 #: ../src/guestfs.pod:634
1333 msgid "The PHP binding only works correctly on 64 bit machines."
1337 #: ../src/guestfs.pod:636
1342 #: ../src/guestfs.pod:638
1343 msgid "For documentation do:"
1347 #: ../src/guestfs.pod:640
1351 " >>> import guestfs\n"
1352 " >>> help (guestfs)\n"
1357 #: ../src/guestfs.pod:644
1362 #: ../src/guestfs.pod:646
1364 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1365 "can find examples written in Ruby in the libguestfs source."
1369 #: ../src/guestfs.pod:649
1370 msgid "B<shell scripts>"
1374 #: ../src/guestfs.pod:651
1375 msgid "For documentation see L<guestfish(1)>."
1379 #: ../src/guestfs.pod:655
1380 msgid "LIBGUESTFS GOTCHAS"
1384 #: ../src/guestfs.pod:657
1386 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1387 "system [...] that works in the way it is documented but is counterintuitive "
1388 "and almost invites mistakes.\""
1392 #: ../src/guestfs.pod:661
1394 "Since we developed libguestfs and the associated tools, there are several "
1395 "things we would have designed differently, but are now stuck with for "
1396 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1397 "release, you can expect these to change. Beware of them."
1401 #: ../src/guestfs.pod:669
1402 msgid "Autosync / forgetting to sync."
1406 #: ../src/guestfs.pod:671
1408 "When modifying a filesystem from C or another language, you B<must> unmount "
1409 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1410 "libguestfs handle. You can also call:"
1414 #: ../src/guestfs.pod:675
1417 " guestfs_set_autosync (g, 1);\n"
1422 #: ../src/guestfs.pod:677
1424 "to have the unmount/sync done automatically for you when the handle 'g' is "
1425 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1429 #: ../src/guestfs.pod:681
1431 "If you forget to do this, then it is entirely possible that your changes "
1432 "won't be written out, or will be partially written, or (very rarely) that "
1433 "you'll get disk corruption."
1437 #: ../src/guestfs.pod:685
1439 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1440 "guestfish scripts that forget to sync will work just fine, which can make "
1441 "this very puzzling if you are trying to debug a problem."
1445 #: ../src/guestfs.pod:689
1446 msgid "Mount option C<-o sync> should not be the default."
1450 #: ../src/guestfs.pod:691
1452 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1453 "However C<-o sync> does not add any reliability benefit, but does have a "
1454 "very large performance impact."
1458 #: ../src/guestfs.pod:695
1460 "The work around is to use L</guestfs_mount_options> and set the mount "
1461 "options that you actually want to use."
1465 #: ../src/guestfs.pod:698
1466 msgid "Read-only should be the default."
1470 #: ../src/guestfs.pod:700
1472 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1473 "specify I<--rw> if you want to make changes to the image."
1477 #: ../src/guestfs.pod:703
1478 msgid "This would reduce the potential to corrupt live VM images."
1482 #: ../src/guestfs.pod:705
1484 "Note that many filesystems change the disk when you just mount and unmount, "
1485 "even if you didn't perform any writes. You need to use L</"
1486 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1490 #: ../src/guestfs.pod:709
1491 msgid "guestfish command line is hard to use."
1495 #: ../src/guestfs.pod:711
1497 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1498 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1499 "exist, so it fails. In earlier versions of guestfish the error message was "
1500 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1501 "we should have used C<guestfish -c command> to run commands."
1505 #: ../src/guestfs.pod:718
1506 msgid "guestfish megabyte modifiers don't work right on all commands"
1510 #: ../src/guestfs.pod:720
1512 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1513 "other modifiers). What guestfish actually does is to multiply the number "
1514 "part by the modifier part and pass the result to the C API. However this "
1515 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1516 "expecting some other unit (eg. megabytes)."
1520 #: ../src/guestfs.pod:727
1521 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1525 #: ../src/guestfs.pod:729
1528 " lvcreate LV VG 100M\n"
1533 #: ../src/guestfs.pod:731
1535 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1536 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1537 "megabytes * megabytes) logical volume. The error message you get from this "
1538 "is also a little obscure."
1542 #: ../src/guestfs.pod:736
1544 "This could be fixed in the generator by specially marking parameters and "
1545 "return values which take bytes or other units."
1549 #: ../src/guestfs.pod:739
1550 msgid "Library should return errno with error messages."
1554 #: ../src/guestfs.pod:741
1556 "It would be a nice-to-have to be able to get the original value of 'errno' "
1557 "from inside the appliance along error paths (where set). Currently "
1558 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1559 "string into an errno, see the function error() in fuse/guestmount.c."
1563 #: ../src/guestfs.pod:747
1565 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1566 "sent back from the daemon."
1570 #: ../src/guestfs.pod:752
1571 msgid "PROTOCOL LIMITS"
1575 #: ../src/guestfs.pod:754
1577 "Internally libguestfs uses a message-based protocol to pass API calls and "
1578 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1579 "plenty more detail about this). The maximum message size used by the "
1580 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1581 "aware of this limit. The API calls which may be affected are individually "
1582 "documented, with a link back to this section of the documentation."
1586 #: ../src/guestfs.pod:762
1588 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1589 "a simple string. Because this string is at some point internally encoded as "
1590 "a message, the maximum size that it can return is slightly under 4 MB. If "
1591 "the requested file is larger than this then you will get an error."
1595 #: ../src/guestfs.pod:768
1597 "In order to transfer large files into and out of the guest filesystem, you "
1598 "need to use particular calls that support this. The sections L</UPLOADING> "
1599 "and L</DOWNLOADING> document how to do this."
1603 #: ../src/guestfs.pod:772
1605 "You might also consider mounting the disk image using our FUSE filesystem "
1606 "support (L<guestmount(1)>)."
1610 #: ../src/guestfs.pod:775
1611 msgid "KEYS AND PASSPHRASES"
1615 #: ../src/guestfs.pod:777
1617 "Certain libguestfs calls take a parameter that contains sensitive key "
1618 "material, passed in as a C string."
1622 #: ../src/guestfs.pod:780
1624 "In the future we would hope to change the libguestfs implementation so that "
1625 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1626 "swap. However this is I<not> done at the moment, because of the complexity "
1627 "of such an implementation."
1631 #: ../src/guestfs.pod:785
1633 "Therefore you should be aware that any key parameter you pass to libguestfs "
1634 "might end up being written out to the swap partition. If this is a concern, "
1635 "scrub the swap partition or don't use libguestfs on encrypted devices."
1639 #: ../src/guestfs.pod:790
1640 msgid "CONNECTION MANAGEMENT"
1644 #: ../src/guestfs.pod:792
1649 #: ../src/guestfs.pod:794
1651 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1652 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1653 "handle and release all resources used."
1657 #: ../src/guestfs.pod:798
1659 "For information on using multiple handles and threads, see the section L</"
1660 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1664 #: ../src/guestfs.pod:801
1665 msgid "guestfs_create"
1669 #: ../src/guestfs.pod:803
1672 " guestfs_h *guestfs_create (void);\n"
1677 #: ../src/guestfs.pod:805
1678 msgid "Create a connection handle."
1682 #: ../src/guestfs.pod:807
1683 msgid "You have to call L</guestfs_add_drive> on the handle at least once."
1687 #: ../src/guestfs.pod:809
1689 "This function returns a non-NULL pointer to a handle on success or NULL on "
1694 #: ../src/guestfs.pod:812
1695 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1699 #: ../src/guestfs.pod:814
1701 "You may also want to configure error handling for the handle. See L</ERROR "
1702 "HANDLING> section below."
1706 #: ../src/guestfs.pod:817
1707 msgid "guestfs_close"
1711 #: ../src/guestfs.pod:819
1714 " void guestfs_close (guestfs_h *g);\n"
1719 #: ../src/guestfs.pod:821
1720 msgid "This closes the connection handle and frees up all resources used."
1724 #: ../src/guestfs.pod:823
1725 msgid "ERROR HANDLING"
1729 #: ../src/guestfs.pod:825
1731 "The convention in all functions that return C<int> is that they return C<-1> "
1732 "to indicate an error. You can get additional information on errors by "
1733 "calling L</guestfs_last_error> and/or by setting up an error handler with L</"
1734 "guestfs_set_error_handler>."
1738 #: ../src/guestfs.pod:830
1739 msgid "The default error handler prints the information string to C<stderr>."
1743 #: ../src/guestfs.pod:832
1745 "Out of memory errors are handled differently. The default action is to call "
1746 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
1747 "guestfs_set_out_of_memory_handler>."
1751 #: ../src/guestfs.pod:836
1752 msgid "guestfs_last_error"
1756 #: ../src/guestfs.pod:838
1759 " const char *guestfs_last_error (guestfs_h *g);\n"
1764 #: ../src/guestfs.pod:840
1766 "This returns the last error message that happened on C<g>. If there has not "
1767 "been an error since the handle was created, then this returns C<NULL>."
1771 #: ../src/guestfs.pod:844
1773 "The lifetime of the returned string is until the next error occurs, or L</"
1774 "guestfs_close> is called."
1778 #: ../src/guestfs.pod:847
1780 "The error string is not localized (ie. is always in English), because this "
1781 "makes searching for error messages in search engines give the largest number "
1786 #: ../src/guestfs.pod:851
1787 msgid "guestfs_set_error_handler"
1791 #: ../src/guestfs.pod:853
1794 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1796 " const char *msg);\n"
1797 " void guestfs_set_error_handler (guestfs_h *g,\n"
1798 " guestfs_error_handler_cb cb,\n"
1804 #: ../src/guestfs.pod:860
1806 "The callback C<cb> will be called if there is an error. The parameters "
1807 "passed to the callback are an opaque data pointer and the error message "
1812 #: ../src/guestfs.pod:864
1814 "Note that the message string C<msg> is freed as soon as the callback "
1815 "function returns, so if you want to stash it somewhere you must make your "
1820 #: ../src/guestfs.pod:868
1821 msgid "The default handler prints messages on C<stderr>."
1825 #: ../src/guestfs.pod:870
1826 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1830 #: ../src/guestfs.pod:872
1831 msgid "guestfs_get_error_handler"
1835 #: ../src/guestfs.pod:874
1838 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1839 " void **opaque_rtn);\n"
1844 #: ../src/guestfs.pod:877
1845 msgid "Returns the current error handler callback."
1849 #: ../src/guestfs.pod:879
1850 msgid "guestfs_set_out_of_memory_handler"
1854 #: ../src/guestfs.pod:881
1857 " typedef void (*guestfs_abort_cb) (void);\n"
1858 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1859 " guestfs_abort_cb);\n"
1864 #: ../src/guestfs.pod:885
1866 "The callback C<cb> will be called if there is an out of memory situation. "
1867 "I<Note this callback must not return>."
1871 #: ../src/guestfs.pod:888
1872 msgid "The default is to call L<abort(3)>."
1876 #: ../src/guestfs.pod:890
1878 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
1882 #: ../src/guestfs.pod:893
1883 msgid "guestfs_get_out_of_memory_handler"
1887 #: ../src/guestfs.pod:895
1890 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
1895 #: ../src/guestfs.pod:897
1896 msgid "This returns the current out of memory handler."
1900 #: ../src/guestfs.pod:899
1905 #: ../src/guestfs.pod:901
1907 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1912 #: ../src/guestfs.pod:904
1914 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1915 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1919 #: ../src/guestfs.pod:907
1921 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1922 "to change the directories that libguestfs will search in. The value is a "
1923 "colon-separated list of paths. The current directory is I<not> searched "
1924 "unless the path contains an empty element or C<.>. For example "
1925 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1926 "then C</usr/lib/guestfs>."
1930 #: ../src/guestfs.pod:914
1931 msgid "HIGH-LEVEL API ACTIONS"
1935 #: ../src/guestfs.pod:916
1936 msgid "ABI GUARANTEE"
1940 #: ../src/guestfs.pod:918
1942 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1943 "actions as outlined in this section. Although we will deprecate some "
1944 "actions, for example if they get replaced by newer calls, we will keep the "
1945 "old actions forever. This allows you the developer to program in confidence "
1946 "against the libguestfs API."
1950 #: ../src/guestfs.pod:924 ../fish/guestfish.pod:926
1955 #: ../src/guestfs.pod:926
1960 #: ../src/guestfs.pod:928
1965 #: ../src/guestfs.pod:930
1966 msgid "AVAILABILITY"
1970 #: ../src/guestfs.pod:932
1971 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
1975 #: ../src/guestfs.pod:934
1977 "Using L</guestfs_available> you can test availability of the following "
1978 "groups of functions. This test queries the appliance to see if the "
1979 "appliance you are currently using supports the functionality."
1983 #: ../src/guestfs.pod:939
1984 msgid "@AVAILABILITY@"
1988 #: ../src/guestfs.pod:941
1989 msgid "GUESTFISH supported COMMAND"
1993 #: ../src/guestfs.pod:943
1995 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
1996 "prints out the available groups and whether they are supported by this build "
1997 "of libguestfs. Note however that you have to do C<run> first."
2001 #: ../src/guestfs.pod:948
2002 msgid "SINGLE CALLS AT COMPILE TIME"
2006 #: ../src/guestfs.pod:950
2008 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2009 "function, such as:"
2013 #: ../src/guestfs.pod:953
2016 " #define LIBGUESTFS_HAVE_DD 1\n"
2021 #: ../src/guestfs.pod:955
2022 msgid "if L</guestfs_dd> is available."
2026 #: ../src/guestfs.pod:957
2028 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2029 "function is available at compile time, we recommended using build tools such "
2030 "as autoconf or cmake. For example in autotools you could use:"
2034 #: ../src/guestfs.pod:962
2037 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2038 " AC_CHECK_FUNCS([guestfs_dd])\n"
2043 #: ../src/guestfs.pod:965
2045 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2050 #: ../src/guestfs.pod:968
2051 msgid "SINGLE CALLS AT RUN TIME"
2055 #: ../src/guestfs.pod:970
2057 "Testing at compile time doesn't guarantee that a function really exists in "
2058 "the library. The reason is that you might be dynamically linked against a "
2059 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2060 "This situation unfortunately results in a segmentation fault, which is a "
2061 "shortcoming of the C dynamic linking system itself."
2065 #: ../src/guestfs.pod:977
2067 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2068 "in this example program (note that you still need the compile time check as "
2073 #: ../src/guestfs.pod:981
2076 " #include <stdio.h>\n"
2077 " #include <stdlib.h>\n"
2078 " #include <unistd.h>\n"
2079 " #include <dlfcn.h>\n"
2080 " #include <guestfs.h>\n"
2085 #: ../src/guestfs.pod:987
2090 " #ifdef LIBGUESTFS_HAVE_DD\n"
2092 " int has_function;\n"
2097 #: ../src/guestfs.pod:993
2100 " /* Test if the function guestfs_dd is really available. */\n"
2101 " dl = dlopen (NULL, RTLD_LAZY);\n"
2103 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2104 " exit (EXIT_FAILURE);\n"
2106 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2112 #: ../src/guestfs.pod:1002
2115 " if (!has_function)\n"
2116 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2118 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2119 " /* Now it's safe to call\n"
2120 " guestfs_dd (g, \"foo\", \"bar\");\n"
2124 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2131 #: ../src/guestfs.pod:1015
2133 "You may think the above is an awful lot of hassle, and it is. There are "
2134 "other ways outside of the C linking system to ensure that this kind of "
2135 "incompatibility never arises, such as using package versioning:"
2139 #: ../src/guestfs.pod:1020
2142 " Requires: libguestfs >= 1.0.80\n"
2147 #: ../src/guestfs.pod:1022 ../src/guestfs.pod:1027
2152 #: ../src/guestfs.pod:1024
2154 "<!-- old anchor for the next section --> <a name="
2155 "\"state_machine_and_low_level_event_api\"/>"
2159 #: ../src/guestfs.pod:1029
2160 msgid "ARCHITECTURE"
2164 #: ../src/guestfs.pod:1031
2166 "Internally, libguestfs is implemented by running an appliance (a special "
2167 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2168 "process of the main program."
2172 #: ../src/guestfs.pod:1035
2175 " ___________________\n"
2177 " | main program |\n"
2179 " | | child process / appliance\n"
2180 " | | __________________________\n"
2182 " +-------------------+ RPC | +-----------------+ |\n"
2183 " | libguestfs <--------------------> guestfsd | |\n"
2184 " | | | +-----------------+ |\n"
2185 " \\___________________/ | | Linux kernel | |\n"
2186 " | +--^--------------+ |\n"
2187 " \\_________|________________/\n"
2193 " \\______________/\n"
2198 #: ../src/guestfs.pod:1055
2200 "The library, linked to the main program, creates the child process and hence "
2201 "the appliance in the L</guestfs_launch> function."
2205 #: ../src/guestfs.pod:1058
2207 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2208 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2209 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2210 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2211 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2212 "attached to the qemu process which translates device access by the "
2213 "appliance's Linux kernel into accesses to the image."
2217 #: ../src/guestfs.pod:1067
2219 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2220 "Although the disk image you are attached to might also be used by some "
2221 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2222 "care if both libguestfs's qemu process and your virtual machine are trying "
2223 "to update the disk image at the same time, since these usually results in "
2224 "massive disk corruption)."
2228 #: ../src/guestfs.pod:1074
2229 msgid "STATE MACHINE"
2233 #: ../src/guestfs.pod:1076
2234 msgid "libguestfs uses a state machine to model the child process:"
2238 #: ../src/guestfs.pod:1078
2250 " / | \\ \\ guestfs_launch\n"
2251 " / | _\\__V______\n"
2253 " / | | LAUNCHING |\n"
2254 " / | \\___________/\n"
2256 " / | guestfs_launch\n"
2258 " ______ / __|____V\n"
2259 " / \\ ------> / \\\n"
2260 " | BUSY | | READY |\n"
2261 " \\______/ <------ \\________/\n"
2266 #: ../src/guestfs.pod:1100
2268 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2269 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2270 "(3) alternating between READY and BUSY as commands are issued to, and "
2271 "carried out by, the child process."
2275 #: ../src/guestfs.pod:1105
2277 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2278 "asynchronously at any time (eg. due to some internal error), and that causes "
2279 "the state to transition back to CONFIG."
2283 #: ../src/guestfs.pod:1109
2285 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2286 "issued when in the CONFIG state."
2290 #: ../src/guestfs.pod:1112
2292 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2293 "L</guestfs_launch> blocks until the child process is READY to accept "
2294 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2295 "moves the state from CONFIG to LAUNCHING while it is running."
2299 #: ../src/guestfs.pod:1118
2301 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2302 "state. These API calls block waiting for the command to be carried out (ie. "
2303 "the state to transition to BUSY and then back to READY). There are no non-"
2304 "blocking versions, and no way to issue more than one command per handle at "
2309 #: ../src/guestfs.pod:1124
2311 "Finally, the child process sends asynchronous messages back to the main "
2312 "program, such as kernel log messages. You can register a callback to "
2313 "receive these messages."
2317 #: ../src/guestfs.pod:1128
2318 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2322 #: ../src/guestfs.pod:1130
2324 "The child process generates events in some situations. Current events "
2325 "include: receiving a log message, the child process exits."
2329 #: ../src/guestfs.pod:1133
2331 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2336 #: ../src/guestfs.pod:1136
2338 "Only I<one callback of each type> can be registered for each handle. "
2339 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2340 "that type. Cancel all callbacks of this type by calling this function with "
2341 "C<cb> set to C<NULL>."
2345 #: ../src/guestfs.pod:1141
2346 msgid "guestfs_set_log_message_callback"
2350 #: ../src/guestfs.pod:1143
2353 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2354 " char *buf, int len);\n"
2355 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2356 " guestfs_log_message_cb cb,\n"
2362 #: ../src/guestfs.pod:1149
2364 "The callback function C<cb> will be called whenever qemu or the guest writes "
2365 "anything to the console."
2369 #: ../src/guestfs.pod:1152
2370 msgid "Use this function to capture kernel messages and similar."
2374 #: ../src/guestfs.pod:1154
2376 "Normally there is no log message handler, and log messages are just "
2381 #: ../src/guestfs.pod:1157
2382 msgid "guestfs_set_subprocess_quit_callback"
2386 #: ../src/guestfs.pod:1159
2389 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2390 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2391 " guestfs_subprocess_quit_cb cb,\n"
2397 #: ../src/guestfs.pod:1164
2399 "The callback function C<cb> will be called when the child process quits, "
2400 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2401 "corresponds to a transition from any state to the CONFIG state)."
2405 #: ../src/guestfs.pod:1169
2406 msgid "guestfs_set_launch_done_callback"
2410 #: ../src/guestfs.pod:1171
2413 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2414 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2415 " guestfs_launch_done_cb cb,\n"
2421 #: ../src/guestfs.pod:1176
2423 "The callback function C<cb> will be called when the child process becomes "
2424 "ready first time after it has been launched. (This corresponds to a "
2425 "transition from LAUNCHING to the READY state)."
2429 #: ../src/guestfs.pod:1180
2430 msgid "guestfs_set_close_callback"
2434 #: ../src/guestfs.pod:1182
2437 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2438 " void guestfs_set_close_callback (guestfs_h *g,\n"
2439 " guestfs_close_cb cb,\n"
2445 #: ../src/guestfs.pod:1187
2447 "The callback function C<cb> will be called while the handle is being closed "
2448 "(synchronously from L</guestfs_close>)."
2452 #: ../src/guestfs.pod:1190
2454 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2455 "handles that are open when the program exits. This means that this callback "
2456 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2457 "problems in higher-level languages (eg. if your HLL interpreter has already "
2458 "been cleaned up by the time this is called, and if your callback then jumps "
2459 "into some HLL function)."
2463 #: ../src/guestfs.pod:1198
2464 msgid "guestfs_set_progress_callback"
2468 #: ../src/guestfs.pod:1200
2471 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2472 " int proc_nr, int serial,\n"
2473 " uint64_t position, uint64_t total);\n"
2474 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2475 " guestfs_progress_cb cb,\n"
2481 #: ../src/guestfs.pod:1207
2483 "Some long-running operations can generate progress messages. If this "
2484 "callback is registered, then it will be called each time a progress message "
2485 "is generated (usually two seconds after the operation started, and three "
2486 "times per second thereafter until it completes, although the frequency may "
2487 "change in future versions)."
2491 #: ../src/guestfs.pod:1213
2493 "The callback receives two numbers: C<position> and C<total>. The units of "
2494 "C<total> are not defined, although for some operations C<total> may relate "
2495 "in some way to the amount of data to be transferred (eg. in bytes or "
2496 "megabytes), and C<position> may be the portion which has been transferred."
2500 #: ../src/guestfs.pod:1219
2501 msgid "The only defined and stable parts of the API are:"
2505 #: ../src/guestfs.pod:1225
2507 "The callback can display to the user some type of progress bar or indicator "
2508 "which shows the ratio of C<position>:C<total>."
2512 #: ../src/guestfs.pod:1230
2513 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2517 #: ../src/guestfs.pod:1234
2519 "If any progress notification is sent during a call, then a final progress "
2520 "notification is always sent when C<position> = C<total>."
2524 #: ../src/guestfs.pod:1237
2526 "This is to simplify caller code, so callers can easily set the progress "
2527 "indicator to \"100%\" at the end of the operation, without requiring special "
2528 "code to detect this case."
2532 #: ../src/guestfs.pod:1243
2534 "The callback also receives the procedure number and serial number of the "
2535 "call. These are only useful for debugging protocol issues, and the callback "
2536 "can normally ignore them. The callback may want to print these numbers in "
2537 "error messages or debugging messages."
2541 #: ../src/guestfs.pod:1248
2542 msgid "PRIVATE DATA AREA"
2546 #: ../src/guestfs.pod:1250
2548 "You can attach named pieces of private data to the libguestfs handle, and "
2549 "fetch them by name for the lifetime of the handle. This is called the "
2550 "private data area and is only available from the C API."
2554 #: ../src/guestfs.pod:1254
2555 msgid "To attach a named piece of data, use the following call:"
2559 #: ../src/guestfs.pod:1256
2562 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2567 #: ../src/guestfs.pod:1258
2569 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2570 "pointer (which can be C<NULL>). Any previous item with the same name is "
2575 #: ../src/guestfs.pod:1262
2577 "You can use any C<key> you want, but names beginning with an underscore "
2578 "character are reserved for internal libguestfs purposes (for implementing "
2579 "language bindings). It is recommended to prefix the name with some unique "
2580 "string to avoid collisions with other users."
2584 #: ../src/guestfs.pod:1267
2585 msgid "To retrieve the pointer, use:"
2589 #: ../src/guestfs.pod:1269
2592 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2597 #: ../src/guestfs.pod:1271
2599 "This function returns C<NULL> if either no data is found associated with "
2600 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2605 #: ../src/guestfs.pod:1275
2607 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2608 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2609 "all. In particular, libguestfs does I<not> try to free the data when the "
2610 "handle is closed. If the data must be freed, then the caller must either "
2611 "free it before calling L</guestfs_close> or must set up a close callback to "
2612 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2613 "can be registered for a handle)."
2617 #: ../src/guestfs.pod:1283
2619 "The private data area is implemented using a hash table, and should be "
2620 "reasonably efficient for moderate numbers of keys."
2624 #: ../src/guestfs.pod:1286
2625 msgid "BLOCK DEVICE NAMING"
2629 #: ../src/guestfs.pod:1288
2631 "In the kernel there is now quite a profusion of schemata for naming block "
2632 "devices (in this context, by I<block device> I mean a physical or virtual "
2633 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2634 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2635 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2636 "for the old IDE driver (particularly for SATA devices) those devices also "
2637 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2638 "paravirtualized drivers. This has created several different naming systems, "
2639 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2643 #: ../src/guestfs.pod:1300
2645 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2646 "Linux kernel to access block devices. We can run a variety of appliances "
2647 "based on a variety of Linux kernels."
2651 #: ../src/guestfs.pod:1304
2653 "This causes a problem for libguestfs because many API calls use device or "
2654 "partition names. Working scripts and the recipe (example) scripts that we "
2655 "make available over the internet could fail if the naming scheme changes."
2659 #: ../src/guestfs.pod:1309
2661 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2662 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2663 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2664 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2668 #: ../src/guestfs.pod:1315
2670 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2671 "L</guestfs_list_partitions> and similar calls return the true names of the "
2672 "devices and partitions as known to the appliance."
2676 #: ../src/guestfs.pod:1320
2677 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2681 #: ../src/guestfs.pod:1322
2683 "Usually this translation is transparent. However in some (very rare) cases "
2684 "you may need to know the exact algorithm. Such cases include where you use "
2685 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2686 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2690 #: ../src/guestfs.pod:1328
2692 "The algorithm is applied only to I<parameters> which are known to be either "
2693 "device or partition names. Return values from functions such as L</"
2694 "guestfs_list_devices> are never changed."
2698 #: ../src/guestfs.pod:1336
2699 msgid "Is the string a parameter which is a device or partition name?"
2703 #: ../src/guestfs.pod:1340
2704 msgid "Does the string begin with C</dev/sd>?"
2708 #: ../src/guestfs.pod:1344
2710 "Does the named device exist? If so, we use that device. However if I<not> "
2711 "then we continue with this algorithm."
2715 #: ../src/guestfs.pod:1349
2716 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2720 #: ../src/guestfs.pod:1351
2721 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2725 #: ../src/guestfs.pod:1353
2726 msgid "If that named device exists, use it. If not, continue."
2730 #: ../src/guestfs.pod:1357
2731 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2735 #: ../src/guestfs.pod:1359
2736 msgid "If that named device exists, use it. If not, return an error."
2740 #: ../src/guestfs.pod:1363
2741 msgid "PORTABILITY CONCERNS"
2745 #: ../src/guestfs.pod:1365
2747 "Although the standard naming scheme and automatic translation is useful for "
2748 "simple programs and guestfish scripts, for larger programs it is best not to "
2749 "rely on this mechanism."
2753 #: ../src/guestfs.pod:1369
2755 "Where possible for maximum future portability programs using libguestfs "
2756 "should use these future-proof techniques:"
2760 #: ../src/guestfs.pod:1376
2762 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2763 "device names, and then use those names directly."
2767 #: ../src/guestfs.pod:1379
2769 "Since those device names exist by definition, they will never be translated."
2773 #: ../src/guestfs.pod:1384
2775 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2776 "filesystem labels."
2780 #: ../src/guestfs.pod:1389
2785 #: ../src/guestfs.pod:1391
2786 msgid "COMMUNICATION PROTOCOL"
2790 #: ../src/guestfs.pod:1393
2792 "Don't rely on using this protocol directly. This section documents how it "
2793 "currently works, but it may change at any time."
2797 #: ../src/guestfs.pod:1396
2799 "The protocol used to talk between the library and the daemon running inside "
2800 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
2801 "1014, RFC 1832, RFC 4506)."
2805 #: ../src/guestfs.pod:1400
2807 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
2808 "this file is automatically generated)."
2812 #: ../src/guestfs.pod:1403
2814 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
2815 "and C<FileOut> parameters, which are handled with very simple request/reply "
2816 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
2817 "parameters, which use the same request and reply messages, but they may also "
2818 "be followed by files sent using a chunked encoding."
2822 #: ../src/guestfs.pod:1410
2823 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
2827 #: ../src/guestfs.pod:1412
2828 msgid "For ordinary functions, the request message is:"
2832 #: ../src/guestfs.pod:1414
2835 " total length (header + arguments,\n"
2836 " but not including the length word itself)\n"
2837 " struct guestfs_message_header (encoded as XDR)\n"
2838 " struct guestfs_<foo>_args (encoded as XDR)\n"
2843 #: ../src/guestfs.pod:1419
2845 "The total length field allows the daemon to allocate a fixed size buffer "
2846 "into which it slurps the rest of the message. As a result, the total length "
2847 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
2848 "effective size of any request is limited to somewhere under this size."
2852 #: ../src/guestfs.pod:1425
2854 "Note also that many functions don't take any arguments, in which case the "
2855 "C<guestfs_I<foo>_args> is completely omitted."
2859 #: ../src/guestfs.pod:1428
2861 "The header contains the procedure number (C<guestfs_proc>) which is how the "
2862 "receiver knows what type of args structure to expect, or none at all."
2866 #: ../src/guestfs.pod:1432
2867 msgid "The reply message for ordinary functions is:"
2871 #: ../src/guestfs.pod:1434
2874 " total length (header + ret,\n"
2875 " but not including the length word itself)\n"
2876 " struct guestfs_message_header (encoded as XDR)\n"
2877 " struct guestfs_<foo>_ret (encoded as XDR)\n"
2882 #: ../src/guestfs.pod:1439
2884 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
2885 "functions that return no formal return values."
2889 #: ../src/guestfs.pod:1442
2891 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
2895 #: ../src/guestfs.pod:1445
2897 "In the case of an error, a flag is set in the header, and the reply message "
2898 "is slightly changed:"
2902 #: ../src/guestfs.pod:1448
2905 " total length (header + error,\n"
2906 " but not including the length word itself)\n"
2907 " struct guestfs_message_header (encoded as XDR)\n"
2908 " struct guestfs_message_error (encoded as XDR)\n"
2913 #: ../src/guestfs.pod:1453
2915 "The C<guestfs_message_error> structure contains the error message as a "
2920 #: ../src/guestfs.pod:1456
2921 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
2925 #: ../src/guestfs.pod:1458
2927 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
2928 "The normal request message is sent (see above). However this is followed by "
2929 "a sequence of file chunks."
2933 #: ../src/guestfs.pod:1462
2936 " total length (header + arguments,\n"
2937 " but not including the length word itself,\n"
2938 " and not including the chunks)\n"
2939 " struct guestfs_message_header (encoded as XDR)\n"
2940 " struct guestfs_<foo>_args (encoded as XDR)\n"
2941 " sequence of chunks for FileIn param #0\n"
2942 " sequence of chunks for FileIn param #1 etc.\n"
2947 #: ../src/guestfs.pod:1470
2948 msgid "The \"sequence of chunks\" is:"
2952 #: ../src/guestfs.pod:1472
2955 " length of chunk (not including length word itself)\n"
2956 " struct guestfs_chunk (encoded as XDR)\n"
2957 " length of chunk\n"
2958 " struct guestfs_chunk (encoded as XDR)\n"
2960 " length of chunk\n"
2961 " struct guestfs_chunk (with data.data_len == 0)\n"
2966 #: ../src/guestfs.pod:1480
2968 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
2969 "is set in the final chunk to indicate either successful completion or early "
2974 #: ../src/guestfs.pod:1484
2976 "At time of writing there are no functions that have more than one FileIn "
2977 "parameter. However this is (theoretically) supported, by sending the "
2978 "sequence of chunks for each FileIn parameter one after another (from left to "
2983 #: ../src/guestfs.pod:1489
2985 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
2986 "transfer. The library does this by sending a chunk with a special flag set "
2987 "to indicate cancellation. When the daemon sees this, it cancels the whole "
2988 "RPC, does I<not> send any reply, and goes back to reading the next request."
2992 #: ../src/guestfs.pod:1495
2994 "The daemon may also cancel. It does this by writing a special word "
2995 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
2996 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
2997 "cancel chunk). The special word is chosen so that even if cancellation "
2998 "happens right at the end of the transfer (after the library has finished "
2999 "writing and has started listening for the reply), the \"spurious\" cancel "
3000 "flag will not be confused with the reply message."
3004 #: ../src/guestfs.pod:1504
3006 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3007 "limit), and also files where the size is not known in advance (eg. from "
3008 "pipes or sockets). However the chunks are rather small "
3009 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3010 "to keep much in memory."
3014 #: ../src/guestfs.pod:1510
3015 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3019 #: ../src/guestfs.pod:1512
3021 "The protocol for FileOut parameters is exactly the same as for FileIn "
3022 "parameters, but with the roles of daemon and library reversed."
3026 #: ../src/guestfs.pod:1515
3029 " total length (header + ret,\n"
3030 " but not including the length word itself,\n"
3031 " and not including the chunks)\n"
3032 " struct guestfs_message_header (encoded as XDR)\n"
3033 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3034 " sequence of chunks for FileOut param #0\n"
3035 " sequence of chunks for FileOut param #1 etc.\n"
3040 #: ../src/guestfs.pod:1523
3041 msgid "INITIAL MESSAGE"
3045 #: ../src/guestfs.pod:1525
3047 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3048 "which indicates that the guest and daemon is alive. This is what L</"
3049 "guestfs_launch> waits for."
3053 #: ../src/guestfs.pod:1529
3054 msgid "PROGRESS NOTIFICATION MESSAGES"
3058 #: ../src/guestfs.pod:1531
3060 "The daemon may send progress notification messages at any time. These are "
3061 "distinguished by the normal length word being replaced by "
3062 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3066 #: ../src/guestfs.pod:1535
3068 "The library turns them into progress callbacks (see "
3069 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3070 "discards them if not."
3074 #: ../src/guestfs.pod:1539
3076 "The daemon self-limits the frequency of progress messages it sends (see "
3077 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3082 #: ../src/guestfs.pod:1543
3083 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3087 #: ../src/guestfs.pod:1545
3089 "All high-level libguestfs actions are synchronous. If you want to use "
3090 "libguestfs asynchronously then you must create a thread."
3094 #: ../src/guestfs.pod:1548
3096 "Only use the handle from a single thread. Either use the handle exclusively "
3097 "from one thread, or provide your own mutex so that two threads cannot issue "
3098 "calls on the same handle at the same time."
3102 #: ../src/guestfs.pod:1552
3104 "See the graphical program guestfs-browser for one possible architecture for "
3105 "multithreaded programs using libvirt and libguestfs."
3109 #: ../src/guestfs.pod:1555
3110 msgid "QEMU WRAPPERS"
3114 #: ../src/guestfs.pod:1557
3116 "If you want to compile your own qemu, run qemu from a non-standard location, "
3117 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3122 #: ../src/guestfs.pod:1561
3124 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3125 "last command in the shell script (so that qemu replaces the shell and "
3126 "becomes the direct child of the libguestfs-using program). If you don't do "
3127 "this, then the qemu process won't be cleaned up correctly."
3131 #: ../src/guestfs.pod:1566
3133 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3138 #: ../src/guestfs.pod:1569
3142 " qemudir=/home/rjones/d/qemu\n"
3143 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
3148 #: ../src/guestfs.pod:1573
3150 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3151 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3156 #: ../src/guestfs.pod:1577
3159 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3164 #: ../src/guestfs.pod:1579
3166 "Note that libguestfs also calls qemu with the -help and -version options in "
3167 "order to determine features."
3171 #: ../src/guestfs.pod:1582
3172 msgid "LIBGUESTFS VERSION NUMBERS"
3176 #: ../src/guestfs.pod:1584
3178 "Since April 2010, libguestfs has started to make separate development and "
3179 "stable releases, along with corresponding branches in our git repository. "
3180 "These separate releases can be identified by version number:"
3184 #: ../src/guestfs.pod:1589
3187 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3188 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3194 " | `-------- sub-version\n"
3196 " `------ always '1' because we don't change the ABI\n"
3201 #: ../src/guestfs.pod:1600
3202 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3206 #: ../src/guestfs.pod:1602
3208 "As time passes we cherry pick fixes from the development branch and backport "
3209 "those into the stable branch, the effect being that the stable branch should "
3210 "get more stable and less buggy over time. So the stable releases are ideal "
3211 "for people who don't need new features but would just like the software to "
3216 #: ../src/guestfs.pod:1608
3217 msgid "Our criteria for backporting changes are:"
3221 #: ../src/guestfs.pod:1614
3223 "Documentation changes which don't affect any code are backported unless the "
3224 "documentation refers to a future feature which is not in stable."
3228 #: ../src/guestfs.pod:1620
3230 "Bug fixes which are not controversial, fix obvious problems, and have been "
3231 "well tested are backported."
3235 #: ../src/guestfs.pod:1625
3237 "Simple rearrangements of code which shouldn't affect how it works get "
3238 "backported. This is so that the code in the two branches doesn't get too "
3239 "far out of step, allowing us to backport future fixes more easily."
3243 #: ../src/guestfs.pod:1631
3245 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3246 "exceptional case: the new feature is required in order to implement an "
3247 "important bug fix."
3251 #: ../src/guestfs.pod:1637
3253 "A new stable branch starts when we think the new features in development are "
3254 "substantial and compelling enough over the current stable branch to warrant "
3255 "it. When that happens we create new stable and development versions 1.N.0 "
3256 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3257 "stable at this point, but by backporting fixes from development, that branch "
3258 "will stabilize over time."
3262 #: ../src/guestfs.pod:1645 ../fish/guestfish.pod:933
3263 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:312
3264 #: ../tools/virt-rescue.pl:226
3265 msgid "ENVIRONMENT VARIABLES"
3269 #: ../src/guestfs.pod:1649 ../fish/guestfish.pod:953
3270 msgid "LIBGUESTFS_APPEND"
3274 #: ../src/guestfs.pod:1651 ../fish/guestfish.pod:955
3275 msgid "Pass additional options to the guest kernel."
3279 #: ../src/guestfs.pod:1653 ../fish/guestfish.pod:957
3280 msgid "LIBGUESTFS_DEBUG"
3284 #: ../src/guestfs.pod:1655
3286 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3287 "effect as calling C<guestfs_set_verbose (g, 1)>."
3291 #: ../src/guestfs.pod:1658 ../fish/guestfish.pod:962
3292 msgid "LIBGUESTFS_MEMSIZE"
3296 #: ../src/guestfs.pod:1660 ../fish/guestfish.pod:964
3298 "Set the memory allocated to the qemu process, in megabytes. For example:"
3302 #: ../src/guestfs.pod:1663 ../fish/guestfish.pod:967
3305 " LIBGUESTFS_MEMSIZE=700\n"
3310 #: ../src/guestfs.pod:1665 ../fish/guestfish.pod:969
3311 msgid "LIBGUESTFS_PATH"
3315 #: ../src/guestfs.pod:1667
3317 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3318 "the discussion of paths in section PATH above."
3322 #: ../src/guestfs.pod:1670 ../fish/guestfish.pod:974
3323 msgid "LIBGUESTFS_QEMU"
3327 #: ../src/guestfs.pod:1672 ../fish/guestfish.pod:976
3329 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3330 "which was found at compile time by the configure script is used."
3334 #: ../src/guestfs.pod:1676
3335 msgid "See also L</QEMU WRAPPERS> above."
3339 #: ../src/guestfs.pod:1678 ../fish/guestfish.pod:980
3340 msgid "LIBGUESTFS_TRACE"
3344 #: ../src/guestfs.pod:1680
3346 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3347 "effect as calling C<guestfs_set_trace (g, 1)>."
3351 #: ../src/guestfs.pod:1683 ../fish/guestfish.pod:989
3356 #: ../src/guestfs.pod:1685 ../fish/guestfish.pod:991
3357 msgid "Location of temporary directory, defaults to C</tmp>."
3361 #: ../src/guestfs.pod:1687 ../fish/guestfish.pod:993
3363 "If libguestfs was compiled to use the supermin appliance then each handle "
3364 "will require rather a large amount of space in this directory for short "
3365 "periods of time (~ 80 MB). You can use C<$TMPDIR> to configure another "
3366 "directory to use in case C</tmp> is not large enough."
3370 #: ../src/guestfs.pod:1695 ../fish/guestfish.pod:1051
3371 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:178
3372 #: ../inspector/virt-inspector.pl:846 ../tools/virt-cat.pl:163
3373 #: ../tools/virt-df.pl:482 ../tools/virt-edit.pl:325
3374 #: ../tools/virt-list-filesystems.pl:191 ../tools/virt-list-partitions.pl:229
3375 #: ../tools/virt-ls.pl:210 ../tools/virt-make-fs.pl:527
3376 #: ../tools/virt-rescue.pl:231 ../tools/virt-resize.pl:1390
3377 #: ../tools/virt-tar.pl:257 ../tools/virt-win-reg.pl:461
3382 #: ../src/guestfs.pod:1697
3384 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-edit"
3385 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
3386 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
3387 "tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
3388 "L<http://libguestfs.org/>."
3392 #: ../src/guestfs.pod:1715
3394 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
3395 "(8)>, L<disktype(1)>."
3399 #: ../src/guestfs.pod:1722 ../tools/virt-make-fs.pl:541
3400 #: ../tools/virt-win-reg.pl:476
3405 #: ../src/guestfs.pod:1724
3406 msgid "To get a list of bugs against libguestfs use this link:"
3410 #: ../src/guestfs.pod:1726
3412 "L<https://bugzilla.redhat.com/buglist.cgi?"
3413 "component=libguestfs&product=Virtualization+Tools>"
3417 #: ../src/guestfs.pod:1728
3418 msgid "To report a new bug against libguestfs use this link:"
3422 #: ../src/guestfs.pod:1730
3424 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
3425 "component=libguestfs&product=Virtualization+Tools>"
3429 #: ../src/guestfs.pod:1732
3430 msgid "When reporting a bug, please check:"
3434 #: ../src/guestfs.pod:1738
3435 msgid "That the bug hasn't been reported already."
3439 #: ../src/guestfs.pod:1742
3440 msgid "That you are testing a recent version."
3444 #: ../src/guestfs.pod:1746
3445 msgid "Describe the bug accurately, and give a way to reproduce it."
3449 #: ../src/guestfs.pod:1750
3451 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3456 #: ../src/guestfs.pod:1755 ../fish/guestfish.pod:1067
3457 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:189
3458 #: ../inspector/virt-inspector.pl:855
3463 #: ../src/guestfs.pod:1757 ../fish/guestfish.pod:1069
3464 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:191
3465 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3469 #: ../src/guestfs.pod:1759 ../fish/guestfish.pod:1071
3470 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:193
3471 #: ../inspector/virt-inspector.pl:861 ../tools/virt-cat.pl:177
3472 #: ../tools/virt-df.pl:495 ../tools/virt-edit.pl:341
3473 #: ../tools/virt-list-filesystems.pl:207 ../tools/virt-list-partitions.pl:244
3474 #: ../tools/virt-ls.pl:225 ../tools/virt-make-fs.pl:556
3475 #: ../tools/virt-rescue.pl:245 ../tools/virt-resize.pl:1411
3476 #: ../tools/virt-tar.pl:272 ../tools/virt-win-reg.pl:491
3481 #: ../src/guestfs.pod:1761 ../fish/guestfish.pod:1073
3482 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3486 #: ../src/guestfs.pod:1764
3488 "This library is free software; you can redistribute it and/or modify it "
3489 "under the terms of the GNU Lesser General Public License as published by the "
3490 "Free Software Foundation; either version 2 of the License, or (at your "
3491 "option) any later version."
3495 #: ../src/guestfs.pod:1769
3497 "This library is distributed in the hope that it will be useful, but WITHOUT "
3498 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3499 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3504 #: ../src/guestfs.pod:1774
3506 "You should have received a copy of the GNU Lesser General Public License "
3507 "along with this library; if not, write to the Free Software Foundation, "
3508 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3512 #: ../src/guestfs-actions.pod:1
3513 msgid "guestfs_add_cdrom"
3517 #: ../src/guestfs-actions.pod:3
3520 " int guestfs_add_cdrom (guestfs_h *g,\n"
3521 "\t\tconst char *filename);\n"
3526 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:5
3527 msgid "This function adds a virtual CD-ROM disk image to the guest."
3531 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:7
3532 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3536 #: ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:1488
3537 #: ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1186
3542 #: ../src/guestfs-actions.pod:16
3544 "This call checks for the existence of C<filename>. This stops you from "
3545 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3546 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3551 #: ../src/guestfs-actions.pod:23
3553 "If you just want to add an ISO file (often you use this as an efficient way "
3554 "to transfer large files into the guest), then you should probably use "
3555 "C<guestfs_add_drive_ro> instead."
3559 #: ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:63
3560 #: ../src/guestfs-actions.pod:92 ../src/guestfs-actions.pod:103
3561 #: ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:124
3562 #: ../src/guestfs-actions.pod:135 ../src/guestfs-actions.pod:238
3563 #: ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:266
3564 #: ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:324
3565 #: ../src/guestfs-actions.pod:339 ../src/guestfs-actions.pod:403
3566 #: ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:441
3567 #: ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:534
3568 #: ../src/guestfs-actions.pod:549 ../src/guestfs-actions.pod:560
3569 #: ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:717
3570 #: ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:749
3571 #: ../src/guestfs-actions.pod:824 ../src/guestfs-actions.pod:839
3572 #: ../src/guestfs-actions.pod:855 ../src/guestfs-actions.pod:866
3573 #: ../src/guestfs-actions.pod:883 ../src/guestfs-actions.pod:916
3574 #: ../src/guestfs-actions.pod:974 ../src/guestfs-actions.pod:996
3575 #: ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1115
3576 #: ../src/guestfs-actions.pod:1146 ../src/guestfs-actions.pod:1346
3577 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1446
3578 #: ../src/guestfs-actions.pod:1794 ../src/guestfs-actions.pod:1917
3579 #: ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:2002
3580 #: ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2421
3581 #: ../src/guestfs-actions.pod:2438 ../src/guestfs-actions.pod:2503
3582 #: ../src/guestfs-actions.pod:2514 ../src/guestfs-actions.pod:2524
3583 #: ../src/guestfs-actions.pod:2535 ../src/guestfs-actions.pod:2547
3584 #: ../src/guestfs-actions.pod:2577 ../src/guestfs-actions.pod:2641
3585 #: ../src/guestfs-actions.pod:2658 ../src/guestfs-actions.pod:2672
3586 #: ../src/guestfs-actions.pod:2692 ../src/guestfs-actions.pod:2712
3587 #: ../src/guestfs-actions.pod:2741 ../src/guestfs-actions.pod:2757
3588 #: ../src/guestfs-actions.pod:2773 ../src/guestfs-actions.pod:2785
3589 #: ../src/guestfs-actions.pod:2794 ../src/guestfs-actions.pod:2827
3590 #: ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:2850
3591 #: ../src/guestfs-actions.pod:2862 ../src/guestfs-actions.pod:2876
3592 #: ../src/guestfs-actions.pod:2956 ../src/guestfs-actions.pod:2973
3593 #: ../src/guestfs-actions.pod:2983 ../src/guestfs-actions.pod:3028
3594 #: ../src/guestfs-actions.pod:3043 ../src/guestfs-actions.pod:3058
3595 #: ../src/guestfs-actions.pod:3071 ../src/guestfs-actions.pod:3082
3596 #: ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3107
3597 #: ../src/guestfs-actions.pod:3119 ../src/guestfs-actions.pod:3136
3598 #: ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3195
3599 #: ../src/guestfs-actions.pod:3211 ../src/guestfs-actions.pod:3227
3600 #: ../src/guestfs-actions.pod:3236 ../src/guestfs-actions.pod:3250
3601 #: ../src/guestfs-actions.pod:3260 ../src/guestfs-actions.pod:3272
3602 #: ../src/guestfs-actions.pod:3284 ../src/guestfs-actions.pod:3316
3603 #: ../src/guestfs-actions.pod:3328 ../src/guestfs-actions.pod:3345
3604 #: ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:3370
3605 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3441
3606 #: ../src/guestfs-actions.pod:3452 ../src/guestfs-actions.pod:3477
3607 #: ../src/guestfs-actions.pod:3491 ../src/guestfs-actions.pod:3506
3608 #: ../src/guestfs-actions.pod:3628 ../src/guestfs-actions.pod:3680
3609 #: ../src/guestfs-actions.pod:3699 ../src/guestfs-actions.pod:3714
3610 #: ../src/guestfs-actions.pod:3725 ../src/guestfs-actions.pod:3759
3611 #: ../src/guestfs-actions.pod:3773 ../src/guestfs-actions.pod:3783
3612 #: ../src/guestfs-actions.pod:3794 ../src/guestfs-actions.pod:4026
3613 #: ../src/guestfs-actions.pod:4042 ../src/guestfs-actions.pod:4053
3614 #: ../src/guestfs-actions.pod:4062 ../src/guestfs-actions.pod:4073
3615 #: ../src/guestfs-actions.pod:4082 ../src/guestfs-actions.pod:4093
3616 #: ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4124
3617 #: ../src/guestfs-actions.pod:4140 ../src/guestfs-actions.pod:4156
3618 #: ../src/guestfs-actions.pod:4171 ../src/guestfs-actions.pod:4191
3619 #: ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:4222
3620 #: ../src/guestfs-actions.pod:4240 ../src/guestfs-actions.pod:4256
3621 #: ../src/guestfs-actions.pod:4270 ../src/guestfs-actions.pod:4295
3622 #: ../src/guestfs-actions.pod:4316 ../src/guestfs-actions.pod:4332
3623 #: ../src/guestfs-actions.pod:4353 ../src/guestfs-actions.pod:4365
3624 #: ../src/guestfs-actions.pod:4377 ../src/guestfs-actions.pod:4393
3625 #: ../src/guestfs-actions.pod:4427 ../src/guestfs-actions.pod:4447
3626 #: ../src/guestfs-actions.pod:4470 ../src/guestfs-actions.pod:4560
3627 #: ../src/guestfs-actions.pod:4666 ../src/guestfs-actions.pod:4675
3628 #: ../src/guestfs-actions.pod:4685 ../src/guestfs-actions.pod:4695
3629 #: ../src/guestfs-actions.pod:4714 ../src/guestfs-actions.pod:4724
3630 #: ../src/guestfs-actions.pod:4734 ../src/guestfs-actions.pod:4744
3631 #: ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4806
3632 #: ../src/guestfs-actions.pod:4820 ../src/guestfs-actions.pod:4833
3633 #: ../src/guestfs-actions.pod:4846 ../src/guestfs-actions.pod:4860
3634 #: ../src/guestfs-actions.pod:4870 ../src/guestfs-actions.pod:4887
3635 #: ../src/guestfs-actions.pod:4917 ../src/guestfs-actions.pod:4928
3636 #: ../src/guestfs-actions.pod:4963 ../src/guestfs-actions.pod:4973
3637 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5016
3638 #: ../src/guestfs-actions.pod:5120 ../src/guestfs-actions.pod:5135
3639 #: ../src/guestfs-actions.pod:5146 ../src/guestfs-actions.pod:5192
3640 #: ../src/guestfs-actions.pod:5202 ../src/guestfs-actions.pod:5239
3641 #: ../src/guestfs-actions.pod:5266 ../src/guestfs-actions.pod:5308
3642 #: ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5388
3643 #: ../src/guestfs-actions.pod:5404 ../src/guestfs-actions.pod:5430
3644 msgid "This function returns 0 on success or -1 on error."
3648 #: ../src/guestfs-actions.pod:31
3649 msgid "guestfs_add_drive"
3653 #: ../src/guestfs-actions.pod:33
3656 " int guestfs_add_drive (guestfs_h *g,\n"
3657 "\t\tconst char *filename);\n"
3662 #: ../src/guestfs-actions.pod:36 ../fish/guestfish-actions.pod:32
3664 "This function adds a virtual machine disk image C<filename> to the guest. "
3665 "The first time you call this function, the disk appears as IDE disk 0 (C</"
3666 "dev/sda>) in the guest, the second time as C</dev/sdb>, and so on."
3670 #: ../src/guestfs-actions.pod:41 ../fish/guestfish-actions.pod:37
3672 "You don't necessarily need to be root when using libguestfs. However you "
3673 "obviously do need sufficient permissions to access the filename for whatever "
3674 "operations you want to perform (ie. read access if you just want to read the "
3675 "image or write access if you want to modify the image)."
3679 #: ../src/guestfs-actions.pod:47 ../fish/guestfish-actions.pod:43
3681 "This is equivalent to the qemu parameter C<-drive file=filename,cache=off,"
3686 #: ../src/guestfs-actions.pod:50 ../fish/guestfish-actions.pod:46
3688 "C<cache=off> is omitted in cases where it is not supported by the underlying "
3693 #: ../src/guestfs-actions.pod:53 ../src/guestfs-actions.pod:82
3695 "C<if=...> is set at compile time by the configuration option C<./configure --"
3696 "with-drive-if=...>. In the rare case where you might need to change this at "
3697 "run time, use C<guestfs_add_drive_with_if> or "
3698 "C<guestfs_add_drive_ro_with_if>."
3702 #: ../src/guestfs-actions.pod:58 ../src/guestfs-actions.pod:87
3704 "Note that this call checks for the existence of C<filename>. This stops you "
3705 "from specifying other types of drive which are supported by qemu such as "
3706 "C<nbd:> and C<http:> URLs. To specify those, use the general "
3707 "C<guestfs_config> call instead."
3711 #: ../src/guestfs-actions.pod:65
3712 msgid "guestfs_add_drive_ro"
3716 #: ../src/guestfs-actions.pod:67
3719 " int guestfs_add_drive_ro (guestfs_h *g,\n"
3720 "\t\tconst char *filename);\n"
3725 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:63
3726 msgid "This adds a drive in snapshot mode, making it effectively read-only."
3730 #: ../src/guestfs-actions.pod:73 ../fish/guestfish-actions.pod:66
3732 "Note that writes to the device are allowed, and will be seen for the "
3733 "duration of the guestfs handle, but they are written to a temporary file "
3734 "which is discarded as soon as the guestfs handle is closed. We don't "
3735 "currently have any method to enable changes to be committed, although qemu "
3740 #: ../src/guestfs-actions.pod:79 ../fish/guestfish-actions.pod:72
3742 "This is equivalent to the qemu parameter C<-drive file=filename,snapshot=on,"
3747 #: ../src/guestfs-actions.pod:94
3748 msgid "guestfs_add_drive_ro_with_if"
3752 #: ../src/guestfs-actions.pod:96
3755 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
3756 "\t\tconst char *filename,\n"
3757 "\t\tconst char *iface);\n"
3762 #: ../src/guestfs-actions.pod:100
3764 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
3765 "QEMU interface emulation to use at run time."
3769 #: ../src/guestfs-actions.pod:105
3770 msgid "guestfs_add_drive_with_if"
3774 #: ../src/guestfs-actions.pod:107
3777 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
3778 "\t\tconst char *filename,\n"
3779 "\t\tconst char *iface);\n"
3784 #: ../src/guestfs-actions.pod:111
3786 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
3787 "QEMU interface emulation to use at run time."
3791 #: ../src/guestfs-actions.pod:116
3792 msgid "guestfs_aug_clear"
3796 #: ../src/guestfs-actions.pod:118
3799 " int guestfs_aug_clear (guestfs_h *g,\n"
3800 "\t\tconst char *augpath);\n"
3805 #: ../src/guestfs-actions.pod:121 ../fish/guestfish-actions.pod:103
3807 "Set the value associated with C<path> to C<NULL>. This is the same as the "
3808 "L<augtool(1)> C<clear> command."
3812 #: ../src/guestfs-actions.pod:126
3813 msgid "guestfs_aug_close"
3817 #: ../src/guestfs-actions.pod:128
3820 " int guestfs_aug_close (guestfs_h *g);\n"
3825 #: ../src/guestfs-actions.pod:130
3827 "Close the current Augeas handle and free up any resources used by it. After "
3828 "calling this, you have to call C<guestfs_aug_init> again before you can use "
3829 "any other Augeas functions."
3833 #: ../src/guestfs-actions.pod:137
3834 msgid "guestfs_aug_defnode"
3838 #: ../src/guestfs-actions.pod:139
3841 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
3842 "\t\tconst char *name,\n"
3843 "\t\tconst char *expr,\n"
3844 "\t\tconst char *val);\n"
3849 #: ../src/guestfs-actions.pod:144 ../fish/guestfish-actions.pod:119
3851 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
3855 #: ../src/guestfs-actions.pod:147
3857 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
3858 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
3859 "containing that single node."
3863 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:126
3865 "On success this returns a pair containing the number of nodes in the "
3866 "nodeset, and a boolean flag if a node was created."
3870 #: ../src/guestfs-actions.pod:155
3872 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
3873 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
3877 #: ../src/guestfs-actions.pod:159
3878 msgid "guestfs_aug_defvar"
3882 #: ../src/guestfs-actions.pod:161
3885 " int guestfs_aug_defvar (guestfs_h *g,\n"
3886 "\t\tconst char *name,\n"
3887 "\t\tconst char *expr);\n"
3892 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:134
3894 "Defines an Augeas variable C<name> whose value is the result of evaluating "
3895 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
3899 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:138
3901 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
3902 "evaluates to something which is not a nodeset."
3906 #: ../src/guestfs-actions.pod:172 ../src/guestfs-actions.pod:313
3907 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:492
3908 #: ../src/guestfs-actions.pod:507 ../src/guestfs-actions.pod:523
3909 #: ../src/guestfs-actions.pod:1013 ../src/guestfs-actions.pod:1328
3910 #: ../src/guestfs-actions.pod:1510 ../src/guestfs-actions.pod:1591
3911 #: ../src/guestfs-actions.pod:1622 ../src/guestfs-actions.pod:1665
3912 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1907
3913 #: ../src/guestfs-actions.pod:2119 ../src/guestfs-actions.pod:2137
3914 #: ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3537
3915 #: ../src/guestfs-actions.pod:3853 ../src/guestfs-actions.pod:4952
3916 #: ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5286
3917 #: ../src/guestfs-actions.pod:5296
3918 msgid "On error this function returns -1."
3922 #: ../src/guestfs-actions.pod:174
3923 msgid "guestfs_aug_get"
3927 #: ../src/guestfs-actions.pod:176
3930 " char *guestfs_aug_get (guestfs_h *g,\n"
3931 "\t\tconst char *augpath);\n"
3936 #: ../src/guestfs-actions.pod:179 ../fish/guestfish-actions.pod:145
3938 "Look up the value associated with C<path>. If C<path> matches exactly one "
3939 "node, the C<value> is returned."
3943 #: ../src/guestfs-actions.pod:182 ../src/guestfs-actions.pod:610
3944 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:682
3945 #: ../src/guestfs-actions.pod:695 ../src/guestfs-actions.pod:786
3946 #: ../src/guestfs-actions.pod:899 ../src/guestfs-actions.pod:928
3947 #: ../src/guestfs-actions.pod:942 ../src/guestfs-actions.pod:958
3948 #: ../src/guestfs-actions.pod:1041 ../src/guestfs-actions.pod:1205
3949 #: ../src/guestfs-actions.pod:1314 ../src/guestfs-actions.pod:1459
3950 #: ../src/guestfs-actions.pod:1473 ../src/guestfs-actions.pod:1549
3951 #: ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:1701
3952 #: ../src/guestfs-actions.pod:1840 ../src/guestfs-actions.pod:2021
3953 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2187
3954 #: ../src/guestfs-actions.pod:2222 ../src/guestfs-actions.pod:2492
3955 #: ../src/guestfs-actions.pod:2913 ../src/guestfs-actions.pod:3009
3956 #: ../src/guestfs-actions.pod:3552 ../src/guestfs-actions.pod:3831
3957 #: ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:4012
3958 #: ../src/guestfs-actions.pod:4488 ../src/guestfs-actions.pod:4501
3959 #: ../src/guestfs-actions.pod:4515 ../src/guestfs-actions.pod:4536
3960 #: ../src/guestfs-actions.pod:5069 ../src/guestfs-actions.pod:5085
3961 #: ../src/guestfs-actions.pod:5100 ../src/guestfs-actions.pod:5248
3962 #: ../src/guestfs-actions.pod:5478
3964 "This function returns a string, or NULL on error. I<The caller must free "
3965 "the returned string after use>."
3969 #: ../src/guestfs-actions.pod:185
3970 msgid "guestfs_aug_init"
3974 #: ../src/guestfs-actions.pod:187
3977 " int guestfs_aug_init (guestfs_h *g,\n"
3978 "\t\tconst char *root,\n"
3984 #: ../src/guestfs-actions.pod:191 ../fish/guestfish-actions.pod:152
3986 "Create a new Augeas handle for editing configuration files. If there was "
3987 "any previous Augeas handle associated with this guestfs session, then it is "
3992 #: ../src/guestfs-actions.pod:195
3993 msgid "You must call this before using any other C<guestfs_aug_*> commands."
3997 #: ../src/guestfs-actions.pod:198 ../fish/guestfish-actions.pod:159
3999 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4003 #: ../src/guestfs-actions.pod:201 ../fish/guestfish-actions.pod:162
4005 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4006 "logical I<or> of the following integers:"
4010 #: ../src/guestfs-actions.pod:207 ../fish/guestfish-actions.pod:168
4011 msgid "C<AUG_SAVE_BACKUP> = 1"
4015 #: ../src/guestfs-actions.pod:209 ../fish/guestfish-actions.pod:170
4016 msgid "Keep the original file with a C<.augsave> extension."
4020 #: ../src/guestfs-actions.pod:211 ../fish/guestfish-actions.pod:172
4021 msgid "C<AUG_SAVE_NEWFILE> = 2"
4025 #: ../src/guestfs-actions.pod:213 ../fish/guestfish-actions.pod:174
4027 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4028 "original. Overrides C<AUG_SAVE_BACKUP>."
4032 #: ../src/guestfs-actions.pod:216 ../fish/guestfish-actions.pod:177
4033 msgid "C<AUG_TYPE_CHECK> = 4"
4037 #: ../src/guestfs-actions.pod:218 ../fish/guestfish-actions.pod:179
4038 msgid "Typecheck lenses (can be expensive)."
4042 #: ../src/guestfs-actions.pod:220 ../fish/guestfish-actions.pod:181
4043 msgid "C<AUG_NO_STDINC> = 8"
4047 #: ../src/guestfs-actions.pod:222 ../fish/guestfish-actions.pod:183
4048 msgid "Do not use standard load path for modules."
4052 #: ../src/guestfs-actions.pod:224 ../fish/guestfish-actions.pod:185
4053 msgid "C<AUG_SAVE_NOOP> = 16"
4057 #: ../src/guestfs-actions.pod:226 ../fish/guestfish-actions.pod:187
4058 msgid "Make save a no-op, just record what would have been changed."
4062 #: ../src/guestfs-actions.pod:228 ../fish/guestfish-actions.pod:189
4063 msgid "C<AUG_NO_LOAD> = 32"
4067 #: ../src/guestfs-actions.pod:230
4068 msgid "Do not load the tree in C<guestfs_aug_init>."
4072 #: ../src/guestfs-actions.pod:234
4073 msgid "To close the handle, you can call C<guestfs_aug_close>."
4077 #: ../src/guestfs-actions.pod:236 ../fish/guestfish-actions.pod:197
4078 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4082 #: ../src/guestfs-actions.pod:240
4083 msgid "guestfs_aug_insert"
4087 #: ../src/guestfs-actions.pod:242
4090 " int guestfs_aug_insert (guestfs_h *g,\n"
4091 "\t\tconst char *augpath,\n"
4092 "\t\tconst char *label,\n"
4093 "\t\tint before);\n"
4098 #: ../src/guestfs-actions.pod:247 ../fish/guestfish-actions.pod:203
4100 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4101 "or after C<path> (depending on the boolean flag C<before>)."
4105 #: ../src/guestfs-actions.pod:251 ../fish/guestfish-actions.pod:207
4107 "C<path> must match exactly one existing node in the tree, and C<label> must "
4108 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4112 #: ../src/guestfs-actions.pod:257
4113 msgid "guestfs_aug_load"
4117 #: ../src/guestfs-actions.pod:259
4120 " int guestfs_aug_load (guestfs_h *g);\n"
4125 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:215
4126 msgid "Load files into the tree."
4130 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:217
4131 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4135 #: ../src/guestfs-actions.pod:268
4136 msgid "guestfs_aug_ls"
4140 #: ../src/guestfs-actions.pod:270
4143 " char **guestfs_aug_ls (guestfs_h *g,\n"
4144 "\t\tconst char *augpath);\n"
4149 #: ../src/guestfs-actions.pod:273
4151 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4152 "sorting the resulting nodes into alphabetical order."
4156 #: ../src/guestfs-actions.pod:276 ../src/guestfs-actions.pod:289
4157 #: ../src/guestfs-actions.pod:417 ../src/guestfs-actions.pod:802
4158 #: ../src/guestfs-actions.pod:1053 ../src/guestfs-actions.pod:1069
4159 #: ../src/guestfs-actions.pod:1157 ../src/guestfs-actions.pod:1173
4160 #: ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1738
4161 #: ../src/guestfs-actions.pod:1751 ../src/guestfs-actions.pod:1767
4162 #: ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1825
4163 #: ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1927
4164 #: ../src/guestfs-actions.pod:2093 ../src/guestfs-actions.pod:2259
4165 #: ../src/guestfs-actions.pod:2462 ../src/guestfs-actions.pod:2477
4166 #: ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2890
4167 #: ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:3808
4168 #: ../src/guestfs-actions.pod:3894 ../src/guestfs-actions.pod:4000
4169 #: ../src/guestfs-actions.pod:4549 ../src/guestfs-actions.pod:4598
4170 #: ../src/guestfs-actions.pod:4650 ../src/guestfs-actions.pod:4766
4171 #: ../src/guestfs-actions.pod:4787 ../src/guestfs-actions.pod:5161
4172 #: ../src/guestfs-actions.pod:5178 ../src/guestfs-actions.pod:5216
4173 #: ../src/guestfs-actions.pod:5352 ../src/guestfs-actions.pod:5368
4174 #: ../src/guestfs-actions.pod:5441 ../src/guestfs-actions.pod:5457
4175 #: ../src/guestfs-actions.pod:5497 ../src/guestfs-actions.pod:5513
4177 "This function returns a NULL-terminated array of strings (like L<environ(3)"
4178 ">), or NULL if there was an error. I<The caller must free the strings and "
4179 "the array after use>."
4183 #: ../src/guestfs-actions.pod:280
4184 msgid "guestfs_aug_match"
4188 #: ../src/guestfs-actions.pod:282
4191 " char **guestfs_aug_match (guestfs_h *g,\n"
4192 "\t\tconst char *augpath);\n"
4197 #: ../src/guestfs-actions.pod:285 ../fish/guestfish-actions.pod:231
4199 "Returns a list of paths which match the path expression C<path>. The "
4200 "returned paths are sufficiently qualified so that they match exactly one "
4201 "node in the current tree."
4205 #: ../src/guestfs-actions.pod:293
4206 msgid "guestfs_aug_mv"
4210 #: ../src/guestfs-actions.pod:295
4213 " int guestfs_aug_mv (guestfs_h *g,\n"
4214 "\t\tconst char *src,\n"
4215 "\t\tconst char *dest);\n"
4220 #: ../src/guestfs-actions.pod:299 ../fish/guestfish-actions.pod:239
4222 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4223 "C<dest> is overwritten if it exists."
4227 #: ../src/guestfs-actions.pod:304
4228 msgid "guestfs_aug_rm"
4232 #: ../src/guestfs-actions.pod:306
4235 " int guestfs_aug_rm (guestfs_h *g,\n"
4236 "\t\tconst char *augpath);\n"
4241 #: ../src/guestfs-actions.pod:309 ../fish/guestfish-actions.pod:246
4242 msgid "Remove C<path> and all of its children."
4246 #: ../src/guestfs-actions.pod:311 ../fish/guestfish-actions.pod:248
4247 msgid "On success this returns the number of entries which were removed."
4251 #: ../src/guestfs-actions.pod:315
4252 msgid "guestfs_aug_save"
4256 #: ../src/guestfs-actions.pod:317
4259 " int guestfs_aug_save (guestfs_h *g);\n"
4264 #: ../src/guestfs-actions.pod:319 ../fish/guestfish-actions.pod:254
4265 msgid "This writes all pending changes to disk."
4269 #: ../src/guestfs-actions.pod:321
4271 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4276 #: ../src/guestfs-actions.pod:326
4277 msgid "guestfs_aug_set"
4281 #: ../src/guestfs-actions.pod:328
4284 " int guestfs_aug_set (guestfs_h *g,\n"
4285 "\t\tconst char *augpath,\n"
4286 "\t\tconst char *val);\n"
4291 #: ../src/guestfs-actions.pod:332 ../fish/guestfish-actions.pod:263
4292 msgid "Set the value associated with C<path> to C<val>."
4296 #: ../src/guestfs-actions.pod:334
4298 "In the Augeas API, it is possible to clear a node by setting the value to "
4299 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4300 "this call. Instead you must use the C<guestfs_aug_clear> call."
4304 #: ../src/guestfs-actions.pod:341
4305 msgid "guestfs_available"
4309 #: ../src/guestfs-actions.pod:343
4312 " int guestfs_available (guestfs_h *g,\n"
4313 "\t\tchar *const *groups);\n"
4318 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:274
4320 "This command is used to check the availability of some groups of "
4321 "functionality in the appliance, which not all builds of the libguestfs "
4322 "appliance will be able to provide."
4326 #: ../src/guestfs-actions.pod:350
4328 "The libguestfs groups, and the functions that those groups correspond to, "
4329 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4330 "runtime by calling C<guestfs_available_all_groups>."
4334 #: ../src/guestfs-actions.pod:355 ../fish/guestfish-actions.pod:283
4336 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
4337 "\"]> would check for the availability of the Linux inotify functions and "
4338 "Augeas (configuration file editing) functions."
4342 #: ../src/guestfs-actions.pod:360 ../fish/guestfish-actions.pod:288
4343 msgid "The command returns no error if I<all> requested groups are available."
4347 #: ../src/guestfs-actions.pod:362 ../fish/guestfish-actions.pod:290
4349 "It fails with an error if one or more of the requested groups is unavailable "
4354 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:293
4356 "If an unknown group name is included in the list of groups then an error is "
4361 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:296
4366 #: ../src/guestfs-actions.pod:374
4367 msgid "You must call C<guestfs_launch> before calling this function."
4371 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:304
4373 "The reason is because we don't know what groups are supported by the "
4374 "appliance/daemon until it is running and can be queried."
4378 #: ../src/guestfs-actions.pod:382 ../fish/guestfish-actions.pod:310
4380 "If a group of functions is available, this does not necessarily mean that "
4381 "they will work. You still have to check for errors when calling individual "
4382 "API functions even if they are available."
4386 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:317
4388 "It is usually the job of distro packagers to build complete functionality "
4389 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4390 "with all requirements satisfied, will support everything."
4394 #: ../src/guestfs-actions.pod:396
4396 "This call was added in version C<1.0.80>. In previous versions of "
4397 "libguestfs all you could do would be to speculatively execute a command to "
4398 "find out if the daemon implemented it. See also C<guestfs_version>."
4402 #: ../src/guestfs-actions.pod:405
4403 msgid "guestfs_available_all_groups"
4407 #: ../src/guestfs-actions.pod:407
4410 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4415 #: ../src/guestfs-actions.pod:409
4417 "This command returns a list of all optional groups that this daemon knows "
4418 "about. Note this returns both supported and unsupported groups. To find "
4419 "out which ones the daemon can actually support you have to call "
4420 "C<guestfs_available> on each member of the returned list."
4424 #: ../src/guestfs-actions.pod:415
4425 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4429 #: ../src/guestfs-actions.pod:421
4430 msgid "guestfs_base64_in"
4434 #: ../src/guestfs-actions.pod:423
4437 " int guestfs_base64_in (guestfs_h *g,\n"
4438 "\t\tconst char *base64file,\n"
4439 "\t\tconst char *filename);\n"
4444 #: ../src/guestfs-actions.pod:427 ../fish/guestfish-actions.pod:347
4446 "This command uploads base64-encoded data from C<base64file> to C<filename>."
4450 #: ../src/guestfs-actions.pod:432
4451 msgid "guestfs_base64_out"
4455 #: ../src/guestfs-actions.pod:434
4458 " int guestfs_base64_out (guestfs_h *g,\n"
4459 "\t\tconst char *filename,\n"
4460 "\t\tconst char *base64file);\n"
4465 #: ../src/guestfs-actions.pod:438 ../fish/guestfish-actions.pod:356
4467 "This command downloads the contents of C<filename>, writing it out to local "
4468 "file C<base64file> encoded as base64."
4472 #: ../src/guestfs-actions.pod:443
4473 msgid "guestfs_blockdev_flushbufs"
4477 #: ../src/guestfs-actions.pod:445
4480 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4481 "\t\tconst char *device);\n"
4486 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:365
4488 "This tells the kernel to flush internal buffers associated with C<device>."
4492 #: ../src/guestfs-actions.pod:451 ../src/guestfs-actions.pod:465
4493 #: ../src/guestfs-actions.pod:477 ../src/guestfs-actions.pod:490
4494 #: ../src/guestfs-actions.pod:505 ../src/guestfs-actions.pod:521
4495 #: ../src/guestfs-actions.pod:532 ../src/guestfs-actions.pod:547
4496 #: ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:569
4497 #: ../fish/guestfish-actions.pod:368 ../fish/guestfish-actions.pod:379
4498 #: ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:398
4499 #: ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:423
4500 #: ../fish/guestfish-actions.pod:431 ../fish/guestfish-actions.pod:442
4501 #: ../fish/guestfish-actions.pod:450 ../fish/guestfish-actions.pod:458
4502 msgid "This uses the L<blockdev(8)> command."
4506 #: ../src/guestfs-actions.pod:455
4507 msgid "guestfs_blockdev_getbsz"
4511 #: ../src/guestfs-actions.pod:457
4514 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4515 "\t\tconst char *device);\n"
4520 #: ../src/guestfs-actions.pod:460 ../fish/guestfish-actions.pod:374
4521 msgid "This returns the block size of a device."
4525 #: ../src/guestfs-actions.pod:462 ../src/guestfs-actions.pod:544
4526 #: ../fish/guestfish-actions.pod:376 ../fish/guestfish-actions.pod:439
4528 "(Note this is different from both I<size in blocks> and I<filesystem block "
4533 #: ../src/guestfs-actions.pod:469
4534 msgid "guestfs_blockdev_getro"
4538 #: ../src/guestfs-actions.pod:471
4541 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4542 "\t\tconst char *device);\n"
4547 #: ../src/guestfs-actions.pod:474 ../fish/guestfish-actions.pod:385
4549 "Returns a boolean indicating if the block device is read-only (true if read-"
4550 "only, false if not)."
4554 #: ../src/guestfs-actions.pod:479 ../src/guestfs-actions.pod:1087
4555 #: ../src/guestfs-actions.pod:1099 ../src/guestfs-actions.pod:1531
4556 #: ../src/guestfs-actions.pod:1539 ../src/guestfs-actions.pod:1599
4557 #: ../src/guestfs-actions.pod:1642 ../src/guestfs-actions.pod:1654
4558 #: ../src/guestfs-actions.pod:1673 ../src/guestfs-actions.pod:1690
4559 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2284
4560 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:2307
4561 #: ../src/guestfs-actions.pod:2320 ../src/guestfs-actions.pod:2332
4562 #: ../src/guestfs-actions.pod:2345 ../src/guestfs-actions.pod:2356
4563 #: ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:2377
4564 #: ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2401
4565 #: ../src/guestfs-actions.pod:3522
4566 msgid "This function returns a C truth value on success or -1 on error."
4570 #: ../src/guestfs-actions.pod:481
4571 msgid "guestfs_blockdev_getsize64"
4575 #: ../src/guestfs-actions.pod:483
4578 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
4579 "\t\tconst char *device);\n"
4584 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:394
4585 msgid "This returns the size of the device in bytes."
4589 #: ../src/guestfs-actions.pod:488
4590 msgid "See also C<guestfs_blockdev_getsz>."
4594 #: ../src/guestfs-actions.pod:494
4595 msgid "guestfs_blockdev_getss"
4599 #: ../src/guestfs-actions.pod:496
4602 " int guestfs_blockdev_getss (guestfs_h *g,\n"
4603 "\t\tconst char *device);\n"
4608 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:404
4610 "This returns the size of sectors on a block device. Usually 512, but can be "
4611 "larger for modern devices."
4615 #: ../src/guestfs-actions.pod:502
4617 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
4622 #: ../src/guestfs-actions.pod:509
4623 msgid "guestfs_blockdev_getsz"
4627 #: ../src/guestfs-actions.pod:511
4630 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
4631 "\t\tconst char *device);\n"
4636 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:416
4638 "This returns the size of the device in units of 512-byte sectors (even if "
4639 "the sectorsize isn't 512 bytes ... weird)."
4643 #: ../src/guestfs-actions.pod:517
4645 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
4646 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
4650 #: ../src/guestfs-actions.pod:525
4651 msgid "guestfs_blockdev_rereadpt"
4655 #: ../src/guestfs-actions.pod:527
4658 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
4659 "\t\tconst char *device);\n"
4664 #: ../src/guestfs-actions.pod:530 ../fish/guestfish-actions.pod:429
4665 msgid "Reread the partition table on C<device>."
4669 #: ../src/guestfs-actions.pod:536
4670 msgid "guestfs_blockdev_setbsz"
4674 #: ../src/guestfs-actions.pod:538
4677 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
4678 "\t\tconst char *device,\n"
4679 "\t\tint blocksize);\n"
4684 #: ../src/guestfs-actions.pod:542 ../fish/guestfish-actions.pod:437
4685 msgid "This sets the block size of a device."
4689 #: ../src/guestfs-actions.pod:551
4690 msgid "guestfs_blockdev_setro"
4694 #: ../src/guestfs-actions.pod:553
4697 " int guestfs_blockdev_setro (guestfs_h *g,\n"
4698 "\t\tconst char *device);\n"
4703 #: ../src/guestfs-actions.pod:556 ../fish/guestfish-actions.pod:448
4704 msgid "Sets the block device named C<device> to read-only."
4708 #: ../src/guestfs-actions.pod:562
4709 msgid "guestfs_blockdev_setrw"
4713 #: ../src/guestfs-actions.pod:564
4716 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
4717 "\t\tconst char *device);\n"
4722 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:456
4723 msgid "Sets the block device named C<device> to read-write."
4727 #: ../src/guestfs-actions.pod:573
4728 msgid "guestfs_case_sensitive_path"
4732 #: ../src/guestfs-actions.pod:575
4735 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
4736 "\t\tconst char *path);\n"
4741 #: ../src/guestfs-actions.pod:578 ../fish/guestfish-actions.pod:464
4743 "This can be used to resolve case insensitive paths on a filesystem which is "
4744 "case sensitive. The use case is to resolve paths which you have read from "
4745 "Windows configuration files or the Windows Registry, to the true path."
4749 #: ../src/guestfs-actions.pod:583 ../fish/guestfish-actions.pod:469
4751 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4752 "(and probably others), which is that although the underlying filesystem is "
4753 "case-insensitive, the driver exports the filesystem to Linux as case-"
4758 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:474
4760 "One consequence of this is that special directories such as C<c:\\windows> "
4761 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4762 "precise details of how they were created. In Windows itself this would not "
4767 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:480
4769 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
4774 #: ../src/guestfs-actions.pod:597 ../fish/guestfish-actions.pod:483
4776 "This function resolves the true case of each element in the path and returns "
4777 "the case-sensitive path."
4781 #: ../src/guestfs-actions.pod:600
4783 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
4784 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4785 "how the directories were originally created under Windows)."
4789 #: ../src/guestfs-actions.pod:605 ../fish/guestfish-actions.pod:491
4790 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4794 #: ../src/guestfs-actions.pod:608
4795 msgid "See also C<guestfs_realpath>."
4799 #: ../src/guestfs-actions.pod:613
4804 #: ../src/guestfs-actions.pod:615
4807 " char *guestfs_cat (guestfs_h *g,\n"
4808 "\t\tconst char *path);\n"
4813 #: ../src/guestfs-actions.pod:618 ../src/guestfs-actions.pod:3884
4814 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:2989
4815 msgid "Return the contents of the file named C<path>."
4819 #: ../src/guestfs-actions.pod:620
4821 "Note that this function cannot correctly handle binary files (specifically, "
4822 "files containing C<\\0> character which is treated as end of string). For "
4823 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
4824 "functions which have a more complex interface."
4828 #: ../src/guestfs-actions.pod:628 ../src/guestfs-actions.pod:789
4829 #: ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:1057
4830 #: ../src/guestfs-actions.pod:1073 ../src/guestfs-actions.pod:1161
4831 #: ../src/guestfs-actions.pod:1177 ../src/guestfs-actions.pod:1408
4832 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:1771
4833 #: ../src/guestfs-actions.pod:1808 ../src/guestfs-actions.pod:1829
4834 #: ../src/guestfs-actions.pod:1843 ../src/guestfs-actions.pod:1869
4835 #: ../src/guestfs-actions.pod:3747 ../src/guestfs-actions.pod:3855
4836 #: ../src/guestfs-actions.pod:3876 ../src/guestfs-actions.pod:4602
4837 #: ../src/guestfs-actions.pod:4654 ../src/guestfs-actions.pod:4770
4838 #: ../src/guestfs-actions.pod:4791 ../src/guestfs-actions.pod:5310
4839 #: ../src/guestfs-actions.pod:5333 ../src/guestfs-actions.pod:5356
4840 #: ../src/guestfs-actions.pod:5372 ../src/guestfs-actions.pod:5445
4841 #: ../src/guestfs-actions.pod:5461 ../src/guestfs-actions.pod:5501
4842 #: ../src/guestfs-actions.pod:5517 ../fish/guestfish-actions.pod:507
4843 #: ../fish/guestfish-actions.pod:642 ../fish/guestfish-actions.pod:654
4844 #: ../fish/guestfish-actions.pod:836 ../fish/guestfish-actions.pod:846
4845 #: ../fish/guestfish-actions.pod:913 ../fish/guestfish-actions.pod:923
4846 #: ../fish/guestfish-actions.pod:1118 ../fish/guestfish-actions.pod:1391
4847 #: ../fish/guestfish-actions.pod:1401 ../fish/guestfish-actions.pod:1429
4848 #: ../fish/guestfish-actions.pod:1444 ../fish/guestfish-actions.pod:1454
4849 #: ../fish/guestfish-actions.pod:1473 ../fish/guestfish-actions.pod:2891
4850 #: ../fish/guestfish-actions.pod:2967 ../fish/guestfish-actions.pod:2982
4851 #: ../fish/guestfish-actions.pod:3543 ../fish/guestfish-actions.pod:3589
4852 #: ../fish/guestfish-actions.pod:3674 ../fish/guestfish-actions.pod:3689
4853 #: ../fish/guestfish-actions.pod:4072 ../fish/guestfish-actions.pod:4090
4854 #: ../fish/guestfish-actions.pod:4107 ../fish/guestfish-actions.pod:4117
4855 #: ../fish/guestfish-actions.pod:4165 ../fish/guestfish-actions.pod:4175
4856 #: ../fish/guestfish-actions.pod:4204 ../fish/guestfish-actions.pod:4214
4858 "Because of the message protocol, there is a transfer limit of somewhere "
4859 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4863 #: ../src/guestfs-actions.pod:631
4864 msgid "guestfs_checksum"
4868 #: ../src/guestfs-actions.pod:633
4871 " char *guestfs_checksum (guestfs_h *g,\n"
4872 "\t\tconst char *csumtype,\n"
4873 "\t\tconst char *path);\n"
4878 #: ../src/guestfs-actions.pod:637 ../fish/guestfish-actions.pod:514
4880 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4884 #: ../src/guestfs-actions.pod:640 ../fish/guestfish-actions.pod:517
4886 "The type of checksum to compute is given by the C<csumtype> parameter which "
4887 "must have one of the following values:"
4891 #: ../src/guestfs-actions.pod:645 ../fish/guestfish-actions.pod:522
4896 #: ../src/guestfs-actions.pod:647 ../fish/guestfish-actions.pod:524
4898 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
4903 #: ../src/guestfs-actions.pod:650 ../fish/guestfish-actions.pod:527
4908 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:529
4909 msgid "Compute the MD5 hash (using the C<md5sum> program)."
4913 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:531
4918 #: ../src/guestfs-actions.pod:656 ../fish/guestfish-actions.pod:533
4919 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
4923 #: ../src/guestfs-actions.pod:658 ../fish/guestfish-actions.pod:535
4928 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:537
4929 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
4933 #: ../src/guestfs-actions.pod:662 ../fish/guestfish-actions.pod:539
4938 #: ../src/guestfs-actions.pod:664 ../fish/guestfish-actions.pod:541
4939 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
4943 #: ../src/guestfs-actions.pod:666 ../fish/guestfish-actions.pod:543
4948 #: ../src/guestfs-actions.pod:668 ../fish/guestfish-actions.pod:545
4949 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
4953 #: ../src/guestfs-actions.pod:670 ../fish/guestfish-actions.pod:547
4958 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:549
4959 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
4963 #: ../src/guestfs-actions.pod:676 ../fish/guestfish-actions.pod:553
4964 msgid "The checksum is returned as a printable string."
4968 #: ../src/guestfs-actions.pod:678
4969 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
4973 #: ../src/guestfs-actions.pod:680
4974 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
4978 #: ../src/guestfs-actions.pod:685
4979 msgid "guestfs_checksum_device"
4983 #: ../src/guestfs-actions.pod:687
4986 " char *guestfs_checksum_device (guestfs_h *g,\n"
4987 "\t\tconst char *csumtype,\n"
4988 "\t\tconst char *device);\n"
4993 #: ../src/guestfs-actions.pod:691
4995 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
4996 "device named C<device>. For the types of checksums supported see the "
4997 "C<guestfs_checksum> command."
5001 #: ../src/guestfs-actions.pod:698
5002 msgid "guestfs_checksums_out"
5006 #: ../src/guestfs-actions.pod:700
5009 " int guestfs_checksums_out (guestfs_h *g,\n"
5010 "\t\tconst char *csumtype,\n"
5011 "\t\tconst char *directory,\n"
5012 "\t\tconst char *sumsfile);\n"
5017 #: ../src/guestfs-actions.pod:705 ../fish/guestfish-actions.pod:571
5019 "This command computes the checksums of all regular files in C<directory> and "
5020 "then emits a list of those checksums to the local output file C<sumsfile>."
5024 #: ../src/guestfs-actions.pod:709 ../fish/guestfish-actions.pod:575
5026 "This can be used for verifying the integrity of a virtual machine. However "
5027 "to be properly secure you should pay attention to the output of the checksum "
5028 "command (it uses the ones from GNU coreutils). In particular when the "
5029 "filename is not printable, coreutils uses a special backslash syntax. For "
5030 "more information, see the GNU coreutils info file."
5034 #: ../src/guestfs-actions.pod:719
5035 msgid "guestfs_chmod"
5039 #: ../src/guestfs-actions.pod:721
5042 " int guestfs_chmod (guestfs_h *g,\n"
5044 "\t\tconst char *path);\n"
5049 #: ../src/guestfs-actions.pod:725 ../fish/guestfish-actions.pod:589
5051 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5056 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:592
5058 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5059 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5064 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:3105
5065 #: ../src/guestfs-actions.pod:3193 ../src/guestfs-actions.pod:3209
5066 #: ../src/guestfs-actions.pod:3225 ../fish/guestfish-actions.pod:596
5067 #: ../fish/guestfish-actions.pod:2407 ../fish/guestfish-actions.pod:2477
5068 #: ../fish/guestfish-actions.pod:2487 ../fish/guestfish-actions.pod:2497
5069 msgid "The mode actually set is affected by the umask."
5073 #: ../src/guestfs-actions.pod:736
5074 msgid "guestfs_chown"
5078 #: ../src/guestfs-actions.pod:738
5081 " int guestfs_chown (guestfs_h *g,\n"
5084 "\t\tconst char *path);\n"
5089 #: ../src/guestfs-actions.pod:743 ../fish/guestfish-actions.pod:602
5090 msgid "Change the file owner to C<owner> and group to C<group>."
5094 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:2434
5095 #: ../fish/guestfish-actions.pod:604 ../fish/guestfish-actions.pod:1935
5097 "Only numeric uid and gid are supported. If you want to use names, you will "
5098 "need to locate and parse the password file yourself (Augeas support makes "
5099 "this relatively easy)."
5103 #: ../src/guestfs-actions.pod:751
5104 msgid "guestfs_command"
5108 #: ../src/guestfs-actions.pod:753
5111 " char *guestfs_command (guestfs_h *g,\n"
5112 "\t\tchar *const *arguments);\n"
5117 #: ../src/guestfs-actions.pod:756 ../fish/guestfish-actions.pod:612
5119 "This call runs a command from the guest filesystem. The filesystem must be "
5120 "mounted, and must contain a compatible operating system (ie. something "
5121 "Linux, with the same or compatible processor architecture)."
5125 #: ../src/guestfs-actions.pod:761
5127 "The single parameter is an argv-style list of arguments. The first element "
5128 "is the name of the program to run. Subsequent elements are parameters. The "
5129 "list must be non-empty (ie. must contain a program name). Note that the "
5130 "command runs directly, and is I<not> invoked via the shell (see "
5135 #: ../src/guestfs-actions.pod:768 ../fish/guestfish-actions.pod:624
5136 msgid "The return value is anything printed to I<stdout> by the command."
5140 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:627
5142 "If the command returns a non-zero exit status, then this function returns an "
5143 "error message. The error message string is the content of I<stderr> from "
5148 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:631
5150 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5151 "bin>. If you require a program from another location, you should provide "
5152 "the full path in the first parameter."
5156 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:636
5158 "Shared libraries and data files required by the program must be available on "
5159 "filesystems which are mounted in the correct places. It is the caller's "
5160 "responsibility to ensure all filesystems that are needed are mounted at the "
5165 #: ../src/guestfs-actions.pod:792
5166 msgid "guestfs_command_lines"
5170 #: ../src/guestfs-actions.pod:794
5173 " char **guestfs_command_lines (guestfs_h *g,\n"
5174 "\t\tchar *const *arguments);\n"
5179 #: ../src/guestfs-actions.pod:797
5181 "This is the same as C<guestfs_command>, but splits the result into a list of "
5186 #: ../src/guestfs-actions.pod:800
5187 msgid "See also: C<guestfs_sh_lines>"
5191 #: ../src/guestfs-actions.pod:809
5192 msgid "guestfs_config"
5196 #: ../src/guestfs-actions.pod:811
5199 " int guestfs_config (guestfs_h *g,\n"
5200 "\t\tconst char *qemuparam,\n"
5201 "\t\tconst char *qemuvalue);\n"
5206 #: ../src/guestfs-actions.pod:815 ../fish/guestfish-actions.pod:661
5208 "This can be used to add arbitrary qemu command line parameters of the form "
5209 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
5210 "setting some parameters which would interfere with parameters that we use."
5214 #: ../src/guestfs-actions.pod:820 ../fish/guestfish-actions.pod:666
5215 msgid "The first character of C<param> string must be a C<-> (dash)."
5219 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:668
5220 msgid "C<value> can be NULL."
5224 #: ../src/guestfs-actions.pod:826
5225 msgid "guestfs_copy_size"
5229 #: ../src/guestfs-actions.pod:828
5232 " int guestfs_copy_size (guestfs_h *g,\n"
5233 "\t\tconst char *src,\n"
5234 "\t\tconst char *dest,\n"
5235 "\t\tint64_t size);\n"
5240 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:674
5242 "This command copies exactly C<size> bytes from one source device or file "
5243 "C<src> to another destination device or file C<dest>."
5247 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:677
5249 "Note this will fail if the source is too short or if the destination is not "
5254 #: ../src/guestfs-actions.pod:841 ../src/guestfs-actions.pod:976
5255 #: ../src/guestfs-actions.pod:1348 ../src/guestfs-actions.pod:1367
5256 #: ../src/guestfs-actions.pod:5390 ../src/guestfs-actions.pod:5406
5258 "This long-running command can generate progress notification messages so "
5259 "that the caller can display a progress bar or indicator. To receive these "
5260 "messages, the caller must register a progress callback. See L<guestfs(3)/"
5261 "guestfs_set_progress_callback>."
5265 #: ../src/guestfs-actions.pod:846
5270 #: ../src/guestfs-actions.pod:848
5273 " int guestfs_cp (guestfs_h *g,\n"
5274 "\t\tconst char *src,\n"
5275 "\t\tconst char *dest);\n"
5280 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:684
5282 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5283 "destination filename or destination directory."
5287 #: ../src/guestfs-actions.pod:857
5288 msgid "guestfs_cp_a"
5292 #: ../src/guestfs-actions.pod:859
5295 " int guestfs_cp_a (guestfs_h *g,\n"
5296 "\t\tconst char *src,\n"
5297 "\t\tconst char *dest);\n"
5302 #: ../src/guestfs-actions.pod:863 ../fish/guestfish-actions.pod:691
5304 "This copies a file or directory from C<src> to C<dest> recursively using the "
5309 #: ../src/guestfs-actions.pod:868
5314 #: ../src/guestfs-actions.pod:870
5317 " int guestfs_dd (guestfs_h *g,\n"
5318 "\t\tconst char *src,\n"
5319 "\t\tconst char *dest);\n"
5324 #: ../src/guestfs-actions.pod:874 ../fish/guestfish-actions.pod:698
5326 "This command copies from one source device or file C<src> to another "
5327 "destination device or file C<dest>. Normally you would use this to copy to "
5328 "or from a device or partition, for example to duplicate a filesystem."
5332 #: ../src/guestfs-actions.pod:879
5334 "If the destination is a device, it must be as large or larger than the "
5335 "source file or device, otherwise the copy will fail. This command cannot do "
5336 "partial copies (see C<guestfs_copy_size>)."
5340 #: ../src/guestfs-actions.pod:885
5341 msgid "guestfs_debug"
5345 #: ../src/guestfs-actions.pod:887
5348 " char *guestfs_debug (guestfs_h *g,\n"
5349 "\t\tconst char *subcmd,\n"
5350 "\t\tchar *const *extraargs);\n"
5355 #: ../src/guestfs-actions.pod:891
5357 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5358 "guestfs daemon) that runs inside the qemu subprocess."
5362 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:715
5364 "There is no comprehensive help for this command. You have to look at the "
5365 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5369 #: ../src/guestfs-actions.pod:902
5370 msgid "guestfs_debug_upload"
5374 #: ../src/guestfs-actions.pod:904
5377 " int guestfs_debug_upload (guestfs_h *g,\n"
5378 "\t\tconst char *filename,\n"
5379 "\t\tconst char *tmpname,\n"
5385 #: ../src/guestfs-actions.pod:909
5387 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5392 #: ../src/guestfs-actions.pod:912 ../fish/guestfish-actions.pod:726
5394 "There is no comprehensive help for this command. You have to look at the "
5395 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5399 #: ../src/guestfs-actions.pod:918
5404 #: ../src/guestfs-actions.pod:920
5407 " char *guestfs_df (guestfs_h *g);\n"
5412 #: ../src/guestfs-actions.pod:922 ../fish/guestfish-actions.pod:736
5413 msgid "This command runs the C<df> command to report disk space used."
5417 #: ../src/guestfs-actions.pod:924 ../src/guestfs-actions.pod:938
5418 #: ../fish/guestfish-actions.pod:738 ../fish/guestfish-actions.pod:749
5420 "This command is mostly useful for interactive sessions. It is I<not> "
5421 "intended that you try to parse the output string. Use C<statvfs> from "
5426 #: ../src/guestfs-actions.pod:931
5427 msgid "guestfs_df_h"
5431 #: ../src/guestfs-actions.pod:933
5434 " char *guestfs_df_h (guestfs_h *g);\n"
5439 #: ../src/guestfs-actions.pod:935 ../fish/guestfish-actions.pod:746
5441 "This command runs the C<df -h> command to report disk space used in human-"
5446 #: ../src/guestfs-actions.pod:945
5447 msgid "guestfs_dmesg"
5451 #: ../src/guestfs-actions.pod:947
5454 " char *guestfs_dmesg (guestfs_h *g);\n"
5459 #: ../src/guestfs-actions.pod:949 ../fish/guestfish-actions.pod:757
5461 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5462 "This is sometimes useful for extended debugging of problems."
5466 #: ../src/guestfs-actions.pod:953
5468 "Another way to get the same information is to enable verbose messages with "
5469 "C<guestfs_set_verbose> or by setting the environment variable "
5470 "C<LIBGUESTFS_DEBUG=1> before running the program."
5474 #: ../src/guestfs-actions.pod:961
5475 msgid "guestfs_download"
5479 #: ../src/guestfs-actions.pod:963
5482 " int guestfs_download (guestfs_h *g,\n"
5483 "\t\tconst char *remotefilename,\n"
5484 "\t\tconst char *filename);\n"
5489 #: ../src/guestfs-actions.pod:967 ../fish/guestfish-actions.pod:770
5491 "Download file C<remotefilename> and save it as C<filename> on the local "
5496 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:4984
5497 #: ../fish/guestfish-actions.pod:773 ../fish/guestfish-actions.pod:3843
5498 msgid "C<filename> can also be a named pipe."
5502 #: ../src/guestfs-actions.pod:972
5503 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5507 #: ../src/guestfs-actions.pod:981
5508 msgid "guestfs_drop_caches"
5512 #: ../src/guestfs-actions.pod:983
5515 " int guestfs_drop_caches (guestfs_h *g,\n"
5516 "\t\tint whattodrop);\n"
5521 #: ../src/guestfs-actions.pod:986 ../fish/guestfish-actions.pod:783
5523 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5524 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5525 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5529 #: ../src/guestfs-actions.pod:991 ../fish/guestfish-actions.pod:788
5530 msgid "Setting C<whattodrop> to 3 should drop everything."
5534 #: ../src/guestfs-actions.pod:993 ../fish/guestfish-actions.pod:790
5536 "This automatically calls L<sync(2)> before the operation, so that the "
5537 "maximum guest memory is freed."
5541 #: ../src/guestfs-actions.pod:998
5546 #: ../src/guestfs-actions.pod:1000
5549 " int64_t guestfs_du (guestfs_h *g,\n"
5550 "\t\tconst char *path);\n"
5555 #: ../src/guestfs-actions.pod:1003 ../fish/guestfish-actions.pod:797
5557 "This command runs the C<du -s> command to estimate file space usage for "
5562 #: ../src/guestfs-actions.pod:1006 ../fish/guestfish-actions.pod:800
5564 "C<path> can be a file or a directory. If C<path> is a directory then the "
5565 "estimate includes the contents of the directory and all subdirectories "
5570 #: ../src/guestfs-actions.pod:1010 ../fish/guestfish-actions.pod:804
5572 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5576 #: ../src/guestfs-actions.pod:1015
5577 msgid "guestfs_e2fsck_f"
5581 #: ../src/guestfs-actions.pod:1017
5584 " int guestfs_e2fsck_f (guestfs_h *g,\n"
5585 "\t\tconst char *device);\n"
5590 #: ../src/guestfs-actions.pod:1020 ../fish/guestfish-actions.pod:811
5592 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5593 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
5598 #: ../src/guestfs-actions.pod:1024
5600 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
5601 "Normally you should use C<guestfs_fsck>."
5605 #: ../src/guestfs-actions.pod:1029
5606 msgid "guestfs_echo_daemon"
5610 #: ../src/guestfs-actions.pod:1031
5613 " char *guestfs_echo_daemon (guestfs_h *g,\n"
5614 "\t\tchar *const *words);\n"
5619 #: ../src/guestfs-actions.pod:1034 ../fish/guestfish-actions.pod:822
5621 "This command concatenates the list of C<words> passed with single spaces "
5622 "between them and returns the resulting string."
5626 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:825
5627 msgid "You can use this command to test the connection through to the daemon."
5631 #: ../src/guestfs-actions.pod:1039
5632 msgid "See also C<guestfs_ping_daemon>."
5636 #: ../src/guestfs-actions.pod:1044
5637 msgid "guestfs_egrep"
5641 #: ../src/guestfs-actions.pod:1046
5644 " char **guestfs_egrep (guestfs_h *g,\n"
5645 "\t\tconst char *regex,\n"
5646 "\t\tconst char *path);\n"
5651 #: ../src/guestfs-actions.pod:1050 ../fish/guestfish-actions.pod:833
5653 "This calls the external C<egrep> program and returns the matching lines."
5657 #: ../src/guestfs-actions.pod:1060
5658 msgid "guestfs_egrepi"
5662 #: ../src/guestfs-actions.pod:1062
5665 " char **guestfs_egrepi (guestfs_h *g,\n"
5666 "\t\tconst char *regex,\n"
5667 "\t\tconst char *path);\n"
5672 #: ../src/guestfs-actions.pod:1066 ../fish/guestfish-actions.pod:843
5674 "This calls the external C<egrep -i> program and returns the matching lines."
5678 #: ../src/guestfs-actions.pod:1076
5679 msgid "guestfs_equal"
5683 #: ../src/guestfs-actions.pod:1078
5686 " int guestfs_equal (guestfs_h *g,\n"
5687 "\t\tconst char *file1,\n"
5688 "\t\tconst char *file2);\n"
5693 #: ../src/guestfs-actions.pod:1082 ../fish/guestfish-actions.pod:853
5695 "This compares the two files C<file1> and C<file2> and returns true if their "
5696 "content is exactly equal, or false otherwise."
5700 #: ../src/guestfs-actions.pod:1085 ../fish/guestfish-actions.pod:856
5701 msgid "The external L<cmp(1)> program is used for the comparison."
5705 #: ../src/guestfs-actions.pod:1089
5706 msgid "guestfs_exists"
5710 #: ../src/guestfs-actions.pod:1091
5713 " int guestfs_exists (guestfs_h *g,\n"
5714 "\t\tconst char *path);\n"
5719 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:862
5721 "This returns C<true> if and only if there is a file, directory (or anything) "
5722 "with the given C<path> name."
5726 #: ../src/guestfs-actions.pod:1097
5727 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
5731 #: ../src/guestfs-actions.pod:1101
5732 msgid "guestfs_fallocate"
5736 #: ../src/guestfs-actions.pod:1103
5739 " int guestfs_fallocate (guestfs_h *g,\n"
5740 "\t\tconst char *path,\n"
5746 #: ../src/guestfs-actions.pod:1107 ../src/guestfs-actions.pod:1130
5747 #: ../fish/guestfish-actions.pod:871 ../fish/guestfish-actions.pod:890
5749 "This command preallocates a file (containing zero bytes) named C<path> of "
5750 "size C<len> bytes. If the file exists already, it is overwritten."
5754 #: ../src/guestfs-actions.pod:1111 ../fish/guestfish-actions.pod:875
5756 "Do not confuse this with the guestfish-specific C<alloc> command which "
5757 "allocates a file in the host and attaches it as a device."
5761 #: ../src/guestfs-actions.pod:1117 ../fish/guestfish-actions.pod:879
5763 "This function is deprecated. In new code, use the C<fallocate64> call "
5768 #: ../src/guestfs-actions.pod:1120 ../src/guestfs-actions.pod:1555
5769 #: ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:5339
5770 #: ../src/guestfs-actions.pod:5484 ../fish/guestfish-actions.pod:882
5771 #: ../fish/guestfish-actions.pod:1239 ../fish/guestfish-actions.pod:1253
5772 #: ../fish/guestfish-actions.pod:4096 ../fish/guestfish-actions.pod:4193
5774 "Deprecated functions will not be removed from the API, but the fact that "
5775 "they are deprecated indicates that there are problems with correct use of "
5780 #: ../src/guestfs-actions.pod:1124
5781 msgid "guestfs_fallocate64"
5785 #: ../src/guestfs-actions.pod:1126
5788 " int guestfs_fallocate64 (guestfs_h *g,\n"
5789 "\t\tconst char *path,\n"
5790 "\t\tint64_t len);\n"
5795 #: ../src/guestfs-actions.pod:1134
5797 "Note that this call allocates disk blocks for the file. To create a sparse "
5798 "file use C<guestfs_truncate_size> instead."
5802 #: ../src/guestfs-actions.pod:1137
5804 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
5805 "oversight it only allowed 30 bit lengths to be specified, effectively "
5806 "limiting the maximum size of files created through that call to 1GB."
5810 #: ../src/guestfs-actions.pod:1142 ../fish/guestfish-actions.pod:902
5812 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5813 "commands which create a file in the host and attach it as a device."
5817 #: ../src/guestfs-actions.pod:1148
5818 msgid "guestfs_fgrep"
5822 #: ../src/guestfs-actions.pod:1150
5825 " char **guestfs_fgrep (guestfs_h *g,\n"
5826 "\t\tconst char *pattern,\n"
5827 "\t\tconst char *path);\n"
5832 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:910
5834 "This calls the external C<fgrep> program and returns the matching lines."
5838 #: ../src/guestfs-actions.pod:1164
5839 msgid "guestfs_fgrepi"
5843 #: ../src/guestfs-actions.pod:1166
5846 " char **guestfs_fgrepi (guestfs_h *g,\n"
5847 "\t\tconst char *pattern,\n"
5848 "\t\tconst char *path);\n"
5853 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:920
5855 "This calls the external C<fgrep -i> program and returns the matching lines."
5859 #: ../src/guestfs-actions.pod:1180
5860 msgid "guestfs_file"
5864 #: ../src/guestfs-actions.pod:1182
5867 " char *guestfs_file (guestfs_h *g,\n"
5868 "\t\tconst char *path);\n"
5873 #: ../src/guestfs-actions.pod:1185 ../fish/guestfish-actions.pod:930
5875 "This call uses the standard L<file(1)> command to determine the type or "
5876 "contents of the file."
5880 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:933
5882 "This call will also transparently look inside various types of compressed "
5887 #: ../src/guestfs-actions.pod:1191 ../fish/guestfish-actions.pod:936
5889 "The exact command which runs is C<file -zb path>. Note in particular that "
5890 "the filename is not prepended to the output (the C<-b> option)."
5894 #: ../src/guestfs-actions.pod:1195
5896 "This command can also be used on C</dev/> devices (and partitions, LV "
5897 "names). You can for example use this to determine if a device contains a "
5898 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
5902 #: ../src/guestfs-actions.pod:1200 ../fish/guestfish-actions.pod:945
5904 "If the C<path> does not begin with C</dev/> then this command only works for "
5905 "the content of regular files. For other file types (directory, symbolic "
5906 "link etc) it will just return the string C<directory> etc."
5910 #: ../src/guestfs-actions.pod:1208
5911 msgid "guestfs_file_architecture"
5915 #: ../src/guestfs-actions.pod:1210
5918 " char *guestfs_file_architecture (guestfs_h *g,\n"
5919 "\t\tconst char *filename);\n"
5924 #: ../src/guestfs-actions.pod:1213 ../fish/guestfish-actions.pod:954
5926 "This detects the architecture of the binary C<filename>, and returns it if "
5931 #: ../src/guestfs-actions.pod:1216 ../fish/guestfish-actions.pod:957
5932 msgid "Currently defined architectures are:"
5936 #: ../src/guestfs-actions.pod:1220 ../fish/guestfish-actions.pod:961
5941 #: ../src/guestfs-actions.pod:1222 ../fish/guestfish-actions.pod:963
5943 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5944 "irrespective of the precise processor requirements of the binary."
5948 #: ../src/guestfs-actions.pod:1225 ../fish/guestfish-actions.pod:966
5953 #: ../src/guestfs-actions.pod:1227 ../fish/guestfish-actions.pod:968
5954 msgid "64 bit x86-64."
5958 #: ../src/guestfs-actions.pod:1229 ../fish/guestfish-actions.pod:970
5963 #: ../src/guestfs-actions.pod:1231 ../fish/guestfish-actions.pod:972
5964 msgid "32 bit SPARC."
5968 #: ../src/guestfs-actions.pod:1233 ../fish/guestfish-actions.pod:974
5973 #: ../src/guestfs-actions.pod:1235 ../fish/guestfish-actions.pod:976
5974 msgid "64 bit SPARC V9 and above."
5978 #: ../src/guestfs-actions.pod:1237 ../fish/guestfish-actions.pod:978
5983 #: ../src/guestfs-actions.pod:1239 ../fish/guestfish-actions.pod:980
5984 msgid "Intel Itanium."
5988 #: ../src/guestfs-actions.pod:1241 ../fish/guestfish-actions.pod:982
5993 #: ../src/guestfs-actions.pod:1243 ../fish/guestfish-actions.pod:984
5994 msgid "32 bit Power PC."
5998 #: ../src/guestfs-actions.pod:1245 ../fish/guestfish-actions.pod:986
6003 #: ../src/guestfs-actions.pod:1247 ../fish/guestfish-actions.pod:988
6004 msgid "64 bit Power PC."
6008 #: ../src/guestfs-actions.pod:1251 ../fish/guestfish-actions.pod:992
6009 msgid "Libguestfs may return other architecture strings in future."
6013 #: ../src/guestfs-actions.pod:1253 ../fish/guestfish-actions.pod:994
6014 msgid "The function works on at least the following types of files:"
6018 #: ../src/guestfs-actions.pod:1259 ../fish/guestfish-actions.pod:1000
6019 msgid "many types of Un*x and Linux binary"
6023 #: ../src/guestfs-actions.pod:1263 ../fish/guestfish-actions.pod:1004
6024 msgid "many types of Un*x and Linux shared library"
6028 #: ../src/guestfs-actions.pod:1267 ../fish/guestfish-actions.pod:1008
6029 msgid "Windows Win32 and Win64 binaries"
6033 #: ../src/guestfs-actions.pod:1271 ../fish/guestfish-actions.pod:1012
6034 msgid "Windows Win32 and Win64 DLLs"
6038 #: ../src/guestfs-actions.pod:1273 ../fish/guestfish-actions.pod:1014
6039 msgid "Win32 binaries and DLLs return C<i386>."
6043 #: ../src/guestfs-actions.pod:1275 ../fish/guestfish-actions.pod:1016
6044 msgid "Win64 binaries and DLLs return C<x86_64>."
6048 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:1020
6049 msgid "Linux kernel modules"
6053 #: ../src/guestfs-actions.pod:1283 ../fish/guestfish-actions.pod:1024
6054 msgid "Linux new-style initrd images"
6058 #: ../src/guestfs-actions.pod:1287 ../fish/guestfish-actions.pod:1028
6059 msgid "some non-x86 Linux vmlinuz kernels"
6063 #: ../src/guestfs-actions.pod:1291 ../fish/guestfish-actions.pod:1032
6064 msgid "What it can't do currently:"
6068 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:1038
6069 msgid "static libraries (libfoo.a)"
6073 #: ../src/guestfs-actions.pod:1301 ../fish/guestfish-actions.pod:1042
6074 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6078 #: ../src/guestfs-actions.pod:1305 ../fish/guestfish-actions.pod:1046
6079 msgid "x86 Linux vmlinuz kernels"
6083 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1048
6085 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6086 "compressed code, and are horribly hard to unpack. If you want to find the "
6087 "architecture of a kernel, use the architecture of the associated initrd or "
6088 "kernel module(s) instead."
6092 #: ../src/guestfs-actions.pod:1317
6093 msgid "guestfs_filesize"
6097 #: ../src/guestfs-actions.pod:1319
6100 " int64_t guestfs_filesize (guestfs_h *g,\n"
6101 "\t\tconst char *file);\n"
6106 #: ../src/guestfs-actions.pod:1322 ../fish/guestfish-actions.pod:1059
6107 msgid "This command returns the size of C<file> in bytes."
6111 #: ../src/guestfs-actions.pod:1324
6113 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6114 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6115 "devices, use C<guestfs_blockdev_getsize64>."
6119 #: ../src/guestfs-actions.pod:1330
6120 msgid "guestfs_fill"
6124 #: ../src/guestfs-actions.pod:1332
6127 " int guestfs_fill (guestfs_h *g,\n"
6130 "\t\tconst char *path);\n"
6135 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:1069
6137 "This command creates a new file called C<path>. The initial content of the "
6138 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6143 #: ../src/guestfs-actions.pod:1341
6145 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6146 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6147 "bytes use C<guestfs_fill_pattern>."
6151 #: ../src/guestfs-actions.pod:1353
6152 msgid "guestfs_fill_pattern"
6156 #: ../src/guestfs-actions.pod:1355
6159 " int guestfs_fill_pattern (guestfs_h *g,\n"
6160 "\t\tconst char *pattern,\n"
6162 "\t\tconst char *path);\n"
6167 #: ../src/guestfs-actions.pod:1360
6169 "This function is like C<guestfs_fill> except that it creates a new file of "
6170 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
6171 "pattern is truncated if necessary to ensure the length of the file is "
6172 "exactly C<len> bytes."
6176 #: ../src/guestfs-actions.pod:1372
6177 msgid "guestfs_find"
6181 #: ../src/guestfs-actions.pod:1374
6184 " char **guestfs_find (guestfs_h *g,\n"
6185 "\t\tconst char *directory);\n"
6190 #: ../src/guestfs-actions.pod:1377 ../fish/guestfish-actions.pod:1091
6192 "This command lists out all files and directories, recursively, starting at "
6193 "C<directory>. It is essentially equivalent to running the shell command "
6194 "C<find directory -print> but some post-processing happens on the output, "
6199 #: ../src/guestfs-actions.pod:1382 ../fish/guestfish-actions.pod:1096
6201 "This returns a list of strings I<without any prefix>. Thus if the directory "
6206 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:1099
6216 #: ../src/guestfs-actions.pod:1389
6218 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
6222 #: ../src/guestfs-actions.pod:1392 ../fish/guestfish-actions.pod:1106
6233 #: ../src/guestfs-actions.pod:1397 ../fish/guestfish-actions.pod:1111
6234 msgid "If C<directory> is not a directory, then this command returns an error."
6238 #: ../src/guestfs-actions.pod:1400 ../fish/guestfish-actions.pod:1114
6239 msgid "The returned list is sorted."
6243 #: ../src/guestfs-actions.pod:1402
6244 msgid "See also C<guestfs_find0>."
6248 #: ../src/guestfs-actions.pod:1411
6249 msgid "guestfs_find0"
6253 #: ../src/guestfs-actions.pod:1413
6256 " int guestfs_find0 (guestfs_h *g,\n"
6257 "\t\tconst char *directory,\n"
6258 "\t\tconst char *files);\n"
6263 #: ../src/guestfs-actions.pod:1417 ../fish/guestfish-actions.pod:1125
6265 "This command lists out all files and directories, recursively, starting at "
6266 "C<directory>, placing the resulting list in the external file called "
6271 #: ../src/guestfs-actions.pod:1421
6273 "This command works the same way as C<guestfs_find> with the following "
6278 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:1136
6279 msgid "The resulting list is written to an external file."
6283 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:1140
6285 "Items (filenames) in the result are separated by C<\\0> characters. See "
6286 "L<find(1)> option I<-print0>."
6290 #: ../src/guestfs-actions.pod:1437 ../fish/guestfish-actions.pod:1145
6291 msgid "This command is not limited in the number of names that it can return."
6295 #: ../src/guestfs-actions.pod:1442 ../fish/guestfish-actions.pod:1150
6296 msgid "The result list is not sorted."
6300 #: ../src/guestfs-actions.pod:1448
6301 msgid "guestfs_findfs_label"
6305 #: ../src/guestfs-actions.pod:1450
6308 " char *guestfs_findfs_label (guestfs_h *g,\n"
6309 "\t\tconst char *label);\n"
6314 #: ../src/guestfs-actions.pod:1453 ../fish/guestfish-actions.pod:1160
6316 "This command searches the filesystems and returns the one which has the "
6317 "given label. An error is returned if no such filesystem can be found."
6321 #: ../src/guestfs-actions.pod:1457
6322 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6326 #: ../src/guestfs-actions.pod:1462
6327 msgid "guestfs_findfs_uuid"
6331 #: ../src/guestfs-actions.pod:1464
6334 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6335 "\t\tconst char *uuid);\n"
6340 #: ../src/guestfs-actions.pod:1467 ../fish/guestfish-actions.pod:1170
6342 "This command searches the filesystems and returns the one which has the "
6343 "given UUID. An error is returned if no such filesystem can be found."
6347 #: ../src/guestfs-actions.pod:1471
6348 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6352 #: ../src/guestfs-actions.pod:1476
6353 msgid "guestfs_fsck"
6357 #: ../src/guestfs-actions.pod:1478
6360 " int guestfs_fsck (guestfs_h *g,\n"
6361 "\t\tconst char *fstype,\n"
6362 "\t\tconst char *device);\n"
6367 #: ../src/guestfs-actions.pod:1482 ../fish/guestfish-actions.pod:1180
6369 "This runs the filesystem checker (fsck) on C<device> which should have "
6370 "filesystem type C<fstype>."
6374 #: ../src/guestfs-actions.pod:1485 ../fish/guestfish-actions.pod:1183
6376 "The returned integer is the status. See L<fsck(8)> for the list of status "
6377 "codes from C<fsck>."
6381 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:1192
6382 msgid "Multiple status codes can be summed together."
6386 #: ../src/guestfs-actions.pod:1498 ../fish/guestfish-actions.pod:1196
6388 "A non-zero return code can mean \"success\", for example if errors have been "
6389 "corrected on the filesystem."
6393 #: ../src/guestfs-actions.pod:1503 ../fish/guestfish-actions.pod:1201
6394 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6398 #: ../src/guestfs-actions.pod:1508 ../fish/guestfish-actions.pod:1206
6400 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6404 #: ../src/guestfs-actions.pod:1512
6405 msgid "guestfs_get_append"
6409 #: ../src/guestfs-actions.pod:1514
6412 " const char *guestfs_get_append (guestfs_h *g);\n"
6417 #: ../src/guestfs-actions.pod:1516 ../fish/guestfish-actions.pod:1212
6419 "Return the additional kernel options which are added to the guest kernel "
6424 #: ../src/guestfs-actions.pod:1519 ../fish/guestfish-actions.pod:1215
6425 msgid "If C<NULL> then no options are added."
6429 #: ../src/guestfs-actions.pod:1521
6431 "This function returns a string which may be NULL. There is no way to return "
6432 "an error from this function. The string is owned by the guest handle and "
6433 "must I<not> be freed."
6437 #: ../src/guestfs-actions.pod:1525
6438 msgid "guestfs_get_autosync"
6442 #: ../src/guestfs-actions.pod:1527
6445 " int guestfs_get_autosync (guestfs_h *g);\n"
6450 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1221
6451 msgid "Get the autosync flag."
6455 #: ../src/guestfs-actions.pod:1533
6456 msgid "guestfs_get_direct"
6460 #: ../src/guestfs-actions.pod:1535
6463 " int guestfs_get_direct (guestfs_h *g);\n"
6468 #: ../src/guestfs-actions.pod:1537 ../fish/guestfish-actions.pod:1227
6469 msgid "Return the direct appliance mode flag."
6473 #: ../src/guestfs-actions.pod:1541
6474 msgid "guestfs_get_e2label"
6478 #: ../src/guestfs-actions.pod:1543
6481 " char *guestfs_get_e2label (guestfs_h *g,\n"
6482 "\t\tconst char *device);\n"
6487 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1233
6489 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6493 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1236
6495 "This function is deprecated. In new code, use the C<vfs_label> call instead."
6499 #: ../src/guestfs-actions.pod:1559
6500 msgid "guestfs_get_e2uuid"
6504 #: ../src/guestfs-actions.pod:1561
6507 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6508 "\t\tconst char *device);\n"
6513 #: ../src/guestfs-actions.pod:1564 ../fish/guestfish-actions.pod:1247
6515 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6519 #: ../src/guestfs-actions.pod:1570 ../fish/guestfish-actions.pod:1250
6521 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6525 #: ../src/guestfs-actions.pod:1577
6526 msgid "guestfs_get_memsize"
6530 #: ../src/guestfs-actions.pod:1579
6533 " int guestfs_get_memsize (guestfs_h *g);\n"
6538 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1261
6540 "This gets the memory size in megabytes allocated to the qemu subprocess."
6544 #: ../src/guestfs-actions.pod:1584
6546 "If C<guestfs_set_memsize> was not called on this handle, and if "
6547 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6548 "value for memsize."
6552 #: ../src/guestfs-actions.pod:1588 ../src/guestfs-actions.pod:1651
6553 #: ../src/guestfs-actions.pod:4237 ../src/guestfs-actions.pod:4329
6554 #: ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1317
6555 #: ../fish/guestfish-actions.pod:3268 ../fish/guestfish-actions.pod:3345
6557 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6561 #: ../src/guestfs-actions.pod:1593
6562 msgid "guestfs_get_network"
6566 #: ../src/guestfs-actions.pod:1595
6569 " int guestfs_get_network (guestfs_h *g);\n"
6574 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1275
6575 msgid "This returns the enable network flag."
6579 #: ../src/guestfs-actions.pod:1601
6580 msgid "guestfs_get_path"
6584 #: ../src/guestfs-actions.pod:1603
6587 " const char *guestfs_get_path (guestfs_h *g);\n"
6592 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1281
6593 msgid "Return the current search path."
6597 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1283
6599 "This is always non-NULL. If it wasn't set already, then this will return "
6604 #: ../src/guestfs-actions.pod:1610 ../src/guestfs-actions.pod:1633
6606 "This function returns a string, or NULL on error. The string is owned by "
6607 "the guest handle and must I<not> be freed."
6611 #: ../src/guestfs-actions.pod:1613
6612 msgid "guestfs_get_pid"
6616 #: ../src/guestfs-actions.pod:1615
6619 " int guestfs_get_pid (guestfs_h *g);\n"
6624 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1290
6626 "Return the process ID of the qemu subprocess. If there is no qemu "
6627 "subprocess, then this will return an error."
6631 #: ../src/guestfs-actions.pod:1620 ../fish/guestfish-actions.pod:1293
6632 msgid "This is an internal call used for debugging and testing."
6636 #: ../src/guestfs-actions.pod:1624
6637 msgid "guestfs_get_qemu"
6641 #: ../src/guestfs-actions.pod:1626
6644 " const char *guestfs_get_qemu (guestfs_h *g);\n"
6649 #: ../src/guestfs-actions.pod:1628 ../fish/guestfish-actions.pod:1299
6650 msgid "Return the current qemu binary."
6654 #: ../src/guestfs-actions.pod:1630 ../fish/guestfish-actions.pod:1301
6656 "This is always non-NULL. If it wasn't set already, then this will return "
6657 "the default qemu binary name."
6661 #: ../src/guestfs-actions.pod:1636
6662 msgid "guestfs_get_recovery_proc"
6666 #: ../src/guestfs-actions.pod:1638
6669 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
6674 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1308
6675 msgid "Return the recovery process enabled flag."
6679 #: ../src/guestfs-actions.pod:1644
6680 msgid "guestfs_get_selinux"
6684 #: ../src/guestfs-actions.pod:1646
6687 " int guestfs_get_selinux (guestfs_h *g);\n"
6692 #: ../src/guestfs-actions.pod:1648
6694 "This returns the current setting of the selinux flag which is passed to the "
6695 "appliance at boot time. See C<guestfs_set_selinux>."
6699 #: ../src/guestfs-actions.pod:1656
6700 msgid "guestfs_get_state"
6704 #: ../src/guestfs-actions.pod:1658
6707 " int guestfs_get_state (guestfs_h *g);\n"
6712 #: ../src/guestfs-actions.pod:1660 ../fish/guestfish-actions.pod:1324
6714 "This returns the current state as an opaque integer. This is only useful "
6715 "for printing debug and internal error messages."
6719 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:2282
6720 #: ../src/guestfs-actions.pod:2305 ../src/guestfs-actions.pod:2354
6721 #: ../src/guestfs-actions.pod:2375 ../fish/guestfish-actions.pod:1327
6722 #: ../fish/guestfish-actions.pod:1819 ../fish/guestfish-actions.pod:1837
6723 #: ../fish/guestfish-actions.pod:1875 ../fish/guestfish-actions.pod:1891
6724 msgid "For more information on states, see L<guestfs(3)>."
6728 #: ../src/guestfs-actions.pod:1667
6729 msgid "guestfs_get_trace"
6733 #: ../src/guestfs-actions.pod:1669
6736 " int guestfs_get_trace (guestfs_h *g);\n"
6741 #: ../src/guestfs-actions.pod:1671 ../fish/guestfish-actions.pod:1333
6742 msgid "Return the command trace flag."
6746 #: ../src/guestfs-actions.pod:1675
6747 msgid "guestfs_get_umask"
6751 #: ../src/guestfs-actions.pod:1677
6754 " int guestfs_get_umask (guestfs_h *g);\n"
6759 #: ../src/guestfs-actions.pod:1679
6761 "Return the current umask. By default the umask is C<022> unless it has been "
6762 "set by calling C<guestfs_umask>."
6766 #: ../src/guestfs-actions.pod:1684
6767 msgid "guestfs_get_verbose"
6771 #: ../src/guestfs-actions.pod:1686
6774 " int guestfs_get_verbose (guestfs_h *g);\n"
6779 #: ../src/guestfs-actions.pod:1688 ../fish/guestfish-actions.pod:1346
6780 msgid "This returns the verbose messages flag."
6784 #: ../src/guestfs-actions.pod:1692
6785 msgid "guestfs_getcon"
6789 #: ../src/guestfs-actions.pod:1694
6792 " char *guestfs_getcon (guestfs_h *g);\n"
6797 #: ../src/guestfs-actions.pod:1696 ../fish/guestfish-actions.pod:1352
6798 msgid "This gets the SELinux security context of the daemon."
6802 #: ../src/guestfs-actions.pod:1698
6804 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
6808 #: ../src/guestfs-actions.pod:1704
6809 msgid "guestfs_getxattrs"
6813 #: ../src/guestfs-actions.pod:1706
6816 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
6817 "\t\tconst char *path);\n"
6822 #: ../src/guestfs-actions.pod:1709 ../fish/guestfish-actions.pod:1361
6824 "This call lists the extended attributes of the file or directory C<path>."
6828 #: ../src/guestfs-actions.pod:1712 ../fish/guestfish-actions.pod:1364
6830 "At the system call level, this is a combination of the L<listxattr(2)> and "
6831 "L<getxattr(2)> calls."
6835 #: ../src/guestfs-actions.pod:1715
6836 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
6840 #: ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:2449
6841 #: ../src/guestfs-actions.pod:2944
6843 "This function returns a C<struct guestfs_xattr_list *> (see E<lt>guestfs-"
6844 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
6845 "C<guestfs_free_xattr_list> after use>."
6849 #: ../src/guestfs-actions.pod:1722
6850 msgid "guestfs_glob_expand"
6854 #: ../src/guestfs-actions.pod:1724
6857 " char **guestfs_glob_expand (guestfs_h *g,\n"
6858 "\t\tconst char *pattern);\n"
6863 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1373
6865 "This command searches for all the pathnames matching C<pattern> according to "
6866 "the wildcard expansion rules used by the shell."
6870 #: ../src/guestfs-actions.pod:1731 ../fish/guestfish-actions.pod:1377
6872 "If no paths match, then this returns an empty list (note: not an error)."
6876 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1380
6878 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
6879 "GLOB_BRACE>. See that manual page for more details."
6883 #: ../src/guestfs-actions.pod:1742
6884 msgid "guestfs_grep"
6888 #: ../src/guestfs-actions.pod:1744
6891 " char **guestfs_grep (guestfs_h *g,\n"
6892 "\t\tconst char *regex,\n"
6893 "\t\tconst char *path);\n"
6898 #: ../src/guestfs-actions.pod:1748 ../fish/guestfish-actions.pod:1388
6899 msgid "This calls the external C<grep> program and returns the matching lines."
6903 #: ../src/guestfs-actions.pod:1758
6904 msgid "guestfs_grepi"
6908 #: ../src/guestfs-actions.pod:1760
6911 " char **guestfs_grepi (guestfs_h *g,\n"
6912 "\t\tconst char *regex,\n"
6913 "\t\tconst char *path);\n"
6918 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1398
6920 "This calls the external C<grep -i> program and returns the matching lines."
6924 #: ../src/guestfs-actions.pod:1774
6925 msgid "guestfs_grub_install"
6929 #: ../src/guestfs-actions.pod:1776
6932 " int guestfs_grub_install (guestfs_h *g,\n"
6933 "\t\tconst char *root,\n"
6934 "\t\tconst char *device);\n"
6939 #: ../src/guestfs-actions.pod:1780 ../fish/guestfish-actions.pod:1408
6941 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
6942 "the root directory being C<root>."
6946 #: ../src/guestfs-actions.pod:1783 ../fish/guestfish-actions.pod:1411
6948 "Note: If grub-install reports the error \"No suitable drive was found in the "
6949 "generated device map.\" it may be that you need to create a C</boot/grub/"
6950 "device.map> file first that contains the mapping between grub device names "
6951 "and Linux device names. It is usually sufficient to create a file "
6956 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1418
6964 #: ../src/guestfs-actions.pod:1792 ../fish/guestfish-actions.pod:1420
6965 msgid "replacing C</dev/vda> with the name of the installation device."
6969 #: ../src/guestfs-actions.pod:1796
6970 msgid "guestfs_head"
6974 #: ../src/guestfs-actions.pod:1798
6977 " char **guestfs_head (guestfs_h *g,\n"
6978 "\t\tconst char *path);\n"
6983 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1426
6985 "This command returns up to the first 10 lines of a file as a list of strings."
6989 #: ../src/guestfs-actions.pod:1811
6990 msgid "guestfs_head_n"
6994 #: ../src/guestfs-actions.pod:1813
6997 " char **guestfs_head_n (guestfs_h *g,\n"
6998 "\t\tint nrlines,\n"
6999 "\t\tconst char *path);\n"
7004 #: ../src/guestfs-actions.pod:1817 ../fish/guestfish-actions.pod:1436
7006 "If the parameter C<nrlines> is a positive number, this returns the first "
7007 "C<nrlines> lines of the file C<path>."
7011 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1439
7013 "If the parameter C<nrlines> is a negative number, this returns lines from "
7014 "the file C<path>, excluding the last C<nrlines> lines."
7018 #: ../src/guestfs-actions.pod:1823 ../src/guestfs-actions.pod:4785
7019 #: ../fish/guestfish-actions.pod:1442 ../fish/guestfish-actions.pod:3687
7020 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7024 #: ../src/guestfs-actions.pod:1832
7025 msgid "guestfs_hexdump"
7029 #: ../src/guestfs-actions.pod:1834
7032 " char *guestfs_hexdump (guestfs_h *g,\n"
7033 "\t\tconst char *path);\n"
7038 #: ../src/guestfs-actions.pod:1837 ../fish/guestfish-actions.pod:1451
7040 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7041 "readable, canonical hex dump of the file."
7045 #: ../src/guestfs-actions.pod:1846
7046 msgid "guestfs_initrd_cat"
7050 #: ../src/guestfs-actions.pod:1848
7053 " char *guestfs_initrd_cat (guestfs_h *g,\n"
7054 "\t\tconst char *initrdpath,\n"
7055 "\t\tconst char *filename,\n"
7056 "\t\tsize_t *size_r);\n"
7061 #: ../src/guestfs-actions.pod:1853 ../fish/guestfish-actions.pod:1461
7063 "This command unpacks the file C<filename> from the initrd file called "
7064 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7069 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1465
7071 "For example, in guestfish you could use the following command to examine the "
7072 "boot script (usually called C</init>) contained in a Linux initrd or "
7077 #: ../src/guestfs-actions.pod:1861 ../fish/guestfish-actions.pod:1469
7080 " initrd-cat /boot/initrd-<version>.img init\n"
7085 #: ../src/guestfs-actions.pod:1863
7086 msgid "See also C<guestfs_initrd_list>."
7090 #: ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:3743
7091 #: ../src/guestfs-actions.pod:3872
7093 "This function returns a buffer, or NULL on error. The size of the returned "
7094 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
7099 #: ../src/guestfs-actions.pod:1872
7100 msgid "guestfs_initrd_list"
7104 #: ../src/guestfs-actions.pod:1874
7107 " char **guestfs_initrd_list (guestfs_h *g,\n"
7108 "\t\tconst char *path);\n"
7113 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1480
7114 msgid "This command lists out files contained in an initrd."
7118 #: ../src/guestfs-actions.pod:1879 ../fish/guestfish-actions.pod:1482
7120 "The files are listed without any initial C</> character. The files are "
7121 "listed in the order they appear (not necessarily alphabetical). Directory "
7122 "names are listed as separate items."
7126 #: ../src/guestfs-actions.pod:1883 ../fish/guestfish-actions.pod:1486
7128 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7129 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7134 #: ../src/guestfs-actions.pod:1891
7135 msgid "guestfs_inotify_add_watch"
7139 #: ../src/guestfs-actions.pod:1893
7142 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
7143 "\t\tconst char *path,\n"
7149 #: ../src/guestfs-actions.pod:1897 ../fish/guestfish-actions.pod:1494
7150 msgid "Watch C<path> for the events listed in C<mask>."
7154 #: ../src/guestfs-actions.pod:1899 ../fish/guestfish-actions.pod:1496
7156 "Note that if C<path> is a directory then events within that directory are "
7157 "watched, but this does I<not> happen recursively (in subdirectories)."
7161 #: ../src/guestfs-actions.pod:1903 ../fish/guestfish-actions.pod:1500
7163 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7164 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7168 #: ../src/guestfs-actions.pod:1909
7169 msgid "guestfs_inotify_close"
7173 #: ../src/guestfs-actions.pod:1911
7176 " int guestfs_inotify_close (guestfs_h *g);\n"
7181 #: ../src/guestfs-actions.pod:1913 ../fish/guestfish-actions.pod:1508
7183 "This closes the inotify handle which was previously opened by inotify_init. "
7184 "It removes all watches, throws away any pending events, and deallocates all "
7189 #: ../src/guestfs-actions.pod:1919
7190 msgid "guestfs_inotify_files"
7194 #: ../src/guestfs-actions.pod:1921
7197 " char **guestfs_inotify_files (guestfs_h *g);\n"
7202 #: ../src/guestfs-actions.pod:1923
7204 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
7205 "returns a list of pathnames of objects that were touched. The returned "
7206 "pathnames are sorted and deduplicated."
7210 #: ../src/guestfs-actions.pod:1931
7211 msgid "guestfs_inotify_init"
7215 #: ../src/guestfs-actions.pod:1933
7218 " int guestfs_inotify_init (guestfs_h *g,\n"
7219 "\t\tint maxevents);\n"
7224 #: ../src/guestfs-actions.pod:1936 ../fish/guestfish-actions.pod:1524
7226 "This command creates a new inotify handle. The inotify subsystem can be "
7227 "used to notify events which happen to objects in the guest filesystem."
7231 #: ../src/guestfs-actions.pod:1940
7233 "C<maxevents> is the maximum number of events which will be queued up between "
7234 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
7235 "passed as C<0>, then the kernel (or previously set) default is used. For "
7236 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
7237 "throws away events, but records the fact that it threw them away by setting "
7238 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
7239 "C<guestfs_inotify_read>)."
7243 #: ../src/guestfs-actions.pod:1950
7245 "Before any events are generated, you have to add some watches to the "
7246 "internal watch list. See: C<guestfs_inotify_add_watch>, "
7247 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
7251 #: ../src/guestfs-actions.pod:1956
7253 "Queued up events should be read periodically by calling "
7254 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
7255 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
7256 "often enough then you risk the internal queue overflowing."
7260 #: ../src/guestfs-actions.pod:1963
7262 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
7263 "This also removes any watches automatically."
7267 #: ../src/guestfs-actions.pod:1967 ../fish/guestfish-actions.pod:1555
7269 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7270 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7271 "that there is one global inotify handle per libguestfs instance."
7275 #: ../src/guestfs-actions.pod:1974
7276 msgid "guestfs_inotify_read"
7280 #: ../src/guestfs-actions.pod:1976
7283 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
7288 #: ../src/guestfs-actions.pod:1978 ../fish/guestfish-actions.pod:1564
7290 "Return the complete queue of events that have happened since the previous "
7295 #: ../src/guestfs-actions.pod:1981 ../fish/guestfish-actions.pod:1567
7296 msgid "If no events have happened, this returns an empty list."
7300 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1569
7302 "I<Note>: In order to make sure that all events have been read, you must call "
7303 "this function repeatedly until it returns an empty list. The reason is that "
7304 "the call will read events up to the maximum appliance-to-host message size "
7305 "and leave remaining events in the queue."
7309 #: ../src/guestfs-actions.pod:1989
7311 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7312 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7313 "must call C<guestfs_free_inotify_event_list> after use>."
7317 #: ../src/guestfs-actions.pod:1994
7318 msgid "guestfs_inotify_rm_watch"
7322 #: ../src/guestfs-actions.pod:1996
7325 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7331 #: ../src/guestfs-actions.pod:1999
7333 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
7337 #: ../src/guestfs-actions.pod:2004
7338 msgid "guestfs_inspect_get_arch"
7342 #: ../src/guestfs-actions.pod:2006
7345 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7346 "\t\tconst char *root);\n"
7351 #: ../src/guestfs-actions.pod:2009 ../src/guestfs-actions.pod:2029
7352 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:2102
7353 #: ../src/guestfs-actions.pod:2126 ../src/guestfs-actions.pod:2144
7354 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:2195
7356 "This function should only be called with a root device string as returned by "
7357 "C<guestfs_inspect_os>."
7361 #: ../src/guestfs-actions.pod:2012
7363 "This returns the architecture of the inspected operating system. The "
7364 "possible return values are listed under C<guestfs_file_architecture>."
7368 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1593
7370 "If the architecture could not be determined, then the string C<unknown> is "
7375 #: ../src/guestfs-actions.pod:2019 ../src/guestfs-actions.pod:2069
7376 #: ../src/guestfs-actions.pod:2117 ../src/guestfs-actions.pod:2185
7377 #: ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2257
7378 #: ../fish/guestfish-actions.pod:1596 ../fish/guestfish-actions.pod:1642
7379 #: ../fish/guestfish-actions.pod:1681 ../fish/guestfish-actions.pod:1736
7380 #: ../fish/guestfish-actions.pod:1767 ../fish/guestfish-actions.pod:1801
7381 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7385 #: ../src/guestfs-actions.pod:2024
7386 msgid "guestfs_inspect_get_distro"
7390 #: ../src/guestfs-actions.pod:2026
7393 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7394 "\t\tconst char *root);\n"
7399 #: ../src/guestfs-actions.pod:2032 ../fish/guestfish-actions.pod:1605
7401 "This returns the distro (distribution) of the inspected operating system."
7405 #: ../src/guestfs-actions.pod:2035 ../fish/guestfish-actions.pod:1608
7406 msgid "Currently defined distros are:"
7410 #: ../src/guestfs-actions.pod:2039 ../fish/guestfish-actions.pod:1612
7415 #: ../src/guestfs-actions.pod:2041 ../fish/guestfish-actions.pod:1614
7416 msgid "Debian or a Debian-derived distro such as Ubuntu."
7420 #: ../src/guestfs-actions.pod:2043 ../fish/guestfish-actions.pod:1616
7425 #: ../src/guestfs-actions.pod:2045 ../fish/guestfish-actions.pod:1618
7430 #: ../src/guestfs-actions.pod:2047 ../fish/guestfish-actions.pod:1620
7431 msgid "\"redhat-based\""
7435 #: ../src/guestfs-actions.pod:2049 ../fish/guestfish-actions.pod:1622
7436 msgid "Some Red Hat-derived distro."
7440 #: ../src/guestfs-actions.pod:2051 ../fish/guestfish-actions.pod:1624
7445 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1626
7446 msgid "Red Hat Enterprise Linux and some derivatives."
7450 #: ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2207
7451 #: ../fish/guestfish-actions.pod:1628 ../fish/guestfish-actions.pod:1754
7456 #: ../src/guestfs-actions.pod:2057 ../fish/guestfish-actions.pod:1630
7458 "Windows does not have distributions. This string is returned if the OS type "
7463 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2211
7464 #: ../fish/guestfish-actions.pod:1633 ../fish/guestfish-actions.pod:1758
7469 #: ../src/guestfs-actions.pod:2062 ../fish/guestfish-actions.pod:1635
7470 msgid "The distro could not be determined."
7474 #: ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2217
7475 #: ../fish/guestfish-actions.pod:1639 ../fish/guestfish-actions.pod:1764
7477 "Future versions of libguestfs may return other strings here. The caller "
7478 "should be prepared to handle any string."
7482 #: ../src/guestfs-actions.pod:2074
7483 msgid "guestfs_inspect_get_filesystems"
7487 #: ../src/guestfs-actions.pod:2076
7490 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7491 "\t\tconst char *root);\n"
7496 #: ../src/guestfs-actions.pod:2082 ../fish/guestfish-actions.pod:1651
7498 "This returns a list of all the filesystems that we think are associated with "
7499 "this operating system. This includes the root filesystem, other ordinary "
7500 "filesystems, and non-mounted devices like swap partitions."
7504 #: ../src/guestfs-actions.pod:2087 ../fish/guestfish-actions.pod:1656
7506 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7507 "to be shared between operating systems."
7511 #: ../src/guestfs-actions.pod:2090
7513 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7514 "C<guestfs_inspect_get_mountpoints>."
7518 #: ../src/guestfs-actions.pod:2097
7519 msgid "guestfs_inspect_get_major_version"
7523 #: ../src/guestfs-actions.pod:2099
7526 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
7527 "\t\tconst char *root);\n"
7532 #: ../src/guestfs-actions.pod:2105 ../fish/guestfish-actions.pod:1669
7534 "This returns the major version number of the inspected operating system."
7538 #: ../src/guestfs-actions.pod:2108 ../fish/guestfish-actions.pod:1672
7540 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7541 "popular public names used by the operating system. Notably the operating "
7542 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7543 "1). You can find out the real versions corresponding to releases of Windows "
7544 "by consulting Wikipedia or MSDN."
7548 #: ../src/guestfs-actions.pod:2115 ../src/guestfs-actions.pod:2132
7549 #: ../fish/guestfish-actions.pod:1679 ../fish/guestfish-actions.pod:1693
7550 msgid "If the version could not be determined, then C<0> is returned."
7554 #: ../src/guestfs-actions.pod:2121
7555 msgid "guestfs_inspect_get_minor_version"
7559 #: ../src/guestfs-actions.pod:2123
7562 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
7563 "\t\tconst char *root);\n"
7568 #: ../src/guestfs-actions.pod:2129 ../fish/guestfish-actions.pod:1690
7570 "This returns the minor version number of the inspected operating system."
7574 #: ../src/guestfs-actions.pod:2134
7576 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7577 "C<guestfs_inspect_get_major_version>."
7581 #: ../src/guestfs-actions.pod:2139
7582 msgid "guestfs_inspect_get_mountpoints"
7586 #: ../src/guestfs-actions.pod:2141
7589 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
7590 "\t\tconst char *root);\n"
7595 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1705
7597 "This returns a hash of where we think the filesystems associated with this "
7598 "operating system should be mounted. Callers should note that this is at "
7599 "best an educated guess made by reading configuration files such as C</etc/"
7604 #: ../src/guestfs-actions.pod:2152 ../fish/guestfish-actions.pod:1710
7606 "Each element in the returned hashtable has a key which is the path of the "
7607 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7608 "mounted there (eg. C</dev/sda1>)."
7612 #: ../src/guestfs-actions.pod:2157 ../fish/guestfish-actions.pod:1715
7614 "Non-mounted devices such as swap devices are I<not> returned in this list."
7618 #: ../src/guestfs-actions.pod:2160
7620 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7621 "C<guestfs_inspect_get_filesystems>."
7625 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:3380
7626 #: ../src/guestfs-actions.pod:4902
7628 "This function returns a NULL-terminated array of strings, or NULL if there "
7629 "was an error. The array of strings will always have length C<2n+1>, where "
7630 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
7631 "caller must free the strings and the array after use>."
7635 #: ../src/guestfs-actions.pod:2169
7636 msgid "guestfs_inspect_get_product_name"
7640 #: ../src/guestfs-actions.pod:2171
7643 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
7644 "\t\tconst char *root);\n"
7649 #: ../src/guestfs-actions.pod:2177 ../fish/guestfish-actions.pod:1728
7651 "This returns the product name of the inspected operating system. The "
7652 "product name is generally some freeform string which can be displayed to the "
7653 "user, but should not be parsed by programs."
7657 #: ../src/guestfs-actions.pod:2182 ../fish/guestfish-actions.pod:1733
7659 "If the product name could not be determined, then the string C<unknown> is "
7664 #: ../src/guestfs-actions.pod:2190
7665 msgid "guestfs_inspect_get_type"
7669 #: ../src/guestfs-actions.pod:2192
7672 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
7673 "\t\tconst char *root);\n"
7678 #: ../src/guestfs-actions.pod:2198 ../fish/guestfish-actions.pod:1745
7680 "This returns the type of the inspected operating system. Currently defined "
7685 #: ../src/guestfs-actions.pod:2203 ../fish/guestfish-actions.pod:1750
7690 #: ../src/guestfs-actions.pod:2205 ../fish/guestfish-actions.pod:1752
7691 msgid "Any Linux-based operating system."
7695 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1756
7696 msgid "Any Microsoft Windows operating system."
7700 #: ../src/guestfs-actions.pod:2213 ../fish/guestfish-actions.pod:1760
7701 msgid "The operating system type could not be determined."
7705 #: ../src/guestfs-actions.pod:2225
7706 msgid "guestfs_inspect_os"
7710 #: ../src/guestfs-actions.pod:2227
7713 " char **guestfs_inspect_os (guestfs_h *g);\n"
7718 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1773
7720 "This function uses other libguestfs functions and certain heuristics to "
7721 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
7722 "for operating systems."
7726 #: ../src/guestfs-actions.pod:2233 ../fish/guestfish-actions.pod:1777
7727 msgid "The list returned is empty if no operating systems were found."
7731 #: ../src/guestfs-actions.pod:2235 ../fish/guestfish-actions.pod:1779
7733 "If one operating system was found, then this returns a list with a single "
7734 "element, which is the name of the root filesystem of this operating system. "
7735 "It is also possible for this function to return a list containing more than "
7736 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
7737 "element being the root filesystem of one of the operating systems."
7741 #: ../src/guestfs-actions.pod:2242
7743 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
7744 "functions in order to query further information about each operating system, "
7745 "such as the name and version."
7749 #: ../src/guestfs-actions.pod:2247
7751 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
7752 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
7753 "the contents. This should be called with no disks currently mounted. The "
7754 "function may also use Augeas, so any existing Augeas handle will be closed."
7758 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1797
7760 "This function cannot decrypt encrypted disks. The caller must do that first "
7761 "(supplying the necessary keys) if the disk is encrypted."
7765 #: ../src/guestfs-actions.pod:2263
7766 msgid "guestfs_is_blockdev"
7770 #: ../src/guestfs-actions.pod:2265
7773 " int guestfs_is_blockdev (guestfs_h *g,\n"
7774 "\t\tconst char *path);\n"
7779 #: ../src/guestfs-actions.pod:2268 ../fish/guestfish-actions.pod:1807
7781 "This returns C<true> if and only if there is a block device with the given "
7786 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:2294
7787 #: ../src/guestfs-actions.pod:2318 ../src/guestfs-actions.pod:2330
7788 #: ../src/guestfs-actions.pod:2343 ../src/guestfs-actions.pod:2387
7789 #: ../src/guestfs-actions.pod:2399
7790 msgid "See also C<guestfs_stat>."
7794 #: ../src/guestfs-actions.pod:2275
7795 msgid "guestfs_is_busy"
7799 #: ../src/guestfs-actions.pod:2277
7802 " int guestfs_is_busy (guestfs_h *g);\n"
7807 #: ../src/guestfs-actions.pod:2279 ../fish/guestfish-actions.pod:1816
7809 "This returns true iff this handle is busy processing a command (in the "
7814 #: ../src/guestfs-actions.pod:2286
7815 msgid "guestfs_is_chardev"
7819 #: ../src/guestfs-actions.pod:2288
7822 " int guestfs_is_chardev (guestfs_h *g,\n"
7823 "\t\tconst char *path);\n"
7828 #: ../src/guestfs-actions.pod:2291 ../fish/guestfish-actions.pod:1825
7830 "This returns C<true> if and only if there is a character device with the "
7831 "given C<path> name."
7835 #: ../src/guestfs-actions.pod:2298
7836 msgid "guestfs_is_config"
7840 #: ../src/guestfs-actions.pod:2300
7843 " int guestfs_is_config (guestfs_h *g);\n"
7848 #: ../src/guestfs-actions.pod:2302 ../fish/guestfish-actions.pod:1834
7850 "This returns true iff this handle is being configured (in the C<CONFIG> "
7855 #: ../src/guestfs-actions.pod:2309
7856 msgid "guestfs_is_dir"
7860 #: ../src/guestfs-actions.pod:2311
7863 " int guestfs_is_dir (guestfs_h *g,\n"
7864 "\t\tconst char *path);\n"
7869 #: ../src/guestfs-actions.pod:2314 ../fish/guestfish-actions.pod:1843
7871 "This returns C<true> if and only if there is a directory with the given "
7872 "C<path> name. Note that it returns false for other objects like files."
7876 #: ../src/guestfs-actions.pod:2322
7877 msgid "guestfs_is_fifo"
7881 #: ../src/guestfs-actions.pod:2324
7884 " int guestfs_is_fifo (guestfs_h *g,\n"
7885 "\t\tconst char *path);\n"
7890 #: ../src/guestfs-actions.pod:2327 ../fish/guestfish-actions.pod:1853
7892 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
7893 "given C<path> name."
7897 #: ../src/guestfs-actions.pod:2334
7898 msgid "guestfs_is_file"
7902 #: ../src/guestfs-actions.pod:2336
7905 " int guestfs_is_file (guestfs_h *g,\n"
7906 "\t\tconst char *path);\n"
7911 #: ../src/guestfs-actions.pod:2339 ../fish/guestfish-actions.pod:1862
7913 "This returns C<true> if and only if there is a regular file with the given "
7914 "C<path> name. Note that it returns false for other objects like directories."
7918 #: ../src/guestfs-actions.pod:2347
7919 msgid "guestfs_is_launching"
7923 #: ../src/guestfs-actions.pod:2349
7926 " int guestfs_is_launching (guestfs_h *g);\n"
7931 #: ../src/guestfs-actions.pod:2351 ../fish/guestfish-actions.pod:1872
7933 "This returns true iff this handle is launching the subprocess (in the "
7934 "C<LAUNCHING> state)."
7938 #: ../src/guestfs-actions.pod:2358
7939 msgid "guestfs_is_lv"
7943 #: ../src/guestfs-actions.pod:2360
7946 " int guestfs_is_lv (guestfs_h *g,\n"
7947 "\t\tconst char *device);\n"
7952 #: ../src/guestfs-actions.pod:2363 ../fish/guestfish-actions.pod:1881
7954 "This command tests whether C<device> is a logical volume, and returns true "
7955 "iff this is the case."
7959 #: ../src/guestfs-actions.pod:2368
7960 msgid "guestfs_is_ready"
7964 #: ../src/guestfs-actions.pod:2370
7967 " int guestfs_is_ready (guestfs_h *g);\n"
7972 #: ../src/guestfs-actions.pod:2372 ../fish/guestfish-actions.pod:1888
7974 "This returns true iff this handle is ready to accept commands (in the "
7979 #: ../src/guestfs-actions.pod:2379
7980 msgid "guestfs_is_socket"
7984 #: ../src/guestfs-actions.pod:2381
7987 " int guestfs_is_socket (guestfs_h *g,\n"
7988 "\t\tconst char *path);\n"
7993 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1897
7995 "This returns C<true> if and only if there is a Unix domain socket with the "
7996 "given C<path> name."
8000 #: ../src/guestfs-actions.pod:2391
8001 msgid "guestfs_is_symlink"
8005 #: ../src/guestfs-actions.pod:2393
8008 " int guestfs_is_symlink (guestfs_h *g,\n"
8009 "\t\tconst char *path);\n"
8014 #: ../src/guestfs-actions.pod:2396 ../fish/guestfish-actions.pod:1906
8016 "This returns C<true> if and only if there is a symbolic link with the given "
8021 #: ../src/guestfs-actions.pod:2403
8022 msgid "guestfs_kill_subprocess"
8026 #: ../src/guestfs-actions.pod:2405
8029 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8034 #: ../src/guestfs-actions.pod:2407 ../fish/guestfish-actions.pod:1915
8035 msgid "This kills the qemu subprocess. You should never need to call this."
8039 #: ../src/guestfs-actions.pod:2411
8040 msgid "guestfs_launch"
8044 #: ../src/guestfs-actions.pod:2413
8047 " int guestfs_launch (guestfs_h *g);\n"
8052 #: ../src/guestfs-actions.pod:2415 ../fish/guestfish-actions.pod:1921
8054 "Internally libguestfs is implemented by running a virtual machine using "
8059 #: ../src/guestfs-actions.pod:2418 ../fish/guestfish-actions.pod:1924
8061 "You should call this after configuring the handle (eg. adding drives) but "
8062 "before performing any actions."
8066 #: ../src/guestfs-actions.pod:2423
8067 msgid "guestfs_lchown"
8071 #: ../src/guestfs-actions.pod:2425
8074 " int guestfs_lchown (guestfs_h *g,\n"
8077 "\t\tconst char *path);\n"
8082 #: ../src/guestfs-actions.pod:2430
8084 "Change the file owner to C<owner> and group to C<group>. This is like "
8085 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8086 "changed, not the target."
8090 #: ../src/guestfs-actions.pod:2440
8091 msgid "guestfs_lgetxattrs"
8095 #: ../src/guestfs-actions.pod:2442
8098 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8099 "\t\tconst char *path);\n"
8104 #: ../src/guestfs-actions.pod:2445
8106 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8107 "then it returns the extended attributes of the link itself."
8111 #: ../src/guestfs-actions.pod:2454
8112 msgid "guestfs_list_devices"
8116 #: ../src/guestfs-actions.pod:2456
8119 " char **guestfs_list_devices (guestfs_h *g);\n"
8124 #: ../src/guestfs-actions.pod:2458 ../fish/guestfish-actions.pod:1951
8125 msgid "List all the block devices."
8129 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1953
8130 msgid "The full block device names are returned, eg. C</dev/sda>"
8134 #: ../src/guestfs-actions.pod:2466
8135 msgid "guestfs_list_partitions"
8139 #: ../src/guestfs-actions.pod:2468
8142 " char **guestfs_list_partitions (guestfs_h *g);\n"
8147 #: ../src/guestfs-actions.pod:2470 ../fish/guestfish-actions.pod:1959
8148 msgid "List all the partitions detected on all block devices."
8152 #: ../src/guestfs-actions.pod:2472 ../fish/guestfish-actions.pod:1961
8153 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8157 #: ../src/guestfs-actions.pod:2474
8159 "This does not return logical volumes. For that you will need to call "
8164 #: ../src/guestfs-actions.pod:2481
8169 #: ../src/guestfs-actions.pod:2483
8172 " char *guestfs_ll (guestfs_h *g,\n"
8173 "\t\tconst char *directory);\n"
8178 #: ../src/guestfs-actions.pod:2486 ../fish/guestfish-actions.pod:1970
8180 "List the files in C<directory> (relative to the root directory, there is no "
8181 "cwd) in the format of 'ls -la'."
8185 #: ../src/guestfs-actions.pod:2489 ../fish/guestfish-actions.pod:1973
8187 "This command is mostly useful for interactive sessions. It is I<not> "
8188 "intended that you try to parse the output string."
8192 #: ../src/guestfs-actions.pod:2495
8197 #: ../src/guestfs-actions.pod:2497
8200 " int guestfs_ln (guestfs_h *g,\n"
8201 "\t\tconst char *target,\n"
8202 "\t\tconst char *linkname);\n"
8207 #: ../src/guestfs-actions.pod:2501 ../fish/guestfish-actions.pod:1980
8208 msgid "This command creates a hard link using the C<ln> command."
8212 #: ../src/guestfs-actions.pod:2505
8213 msgid "guestfs_ln_f"
8217 #: ../src/guestfs-actions.pod:2507
8220 " int guestfs_ln_f (guestfs_h *g,\n"
8221 "\t\tconst char *target,\n"
8222 "\t\tconst char *linkname);\n"
8227 #: ../src/guestfs-actions.pod:2511 ../fish/guestfish-actions.pod:1986
8229 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8230 "option removes the link (C<linkname>) if it exists already."
8234 #: ../src/guestfs-actions.pod:2516
8235 msgid "guestfs_ln_s"
8239 #: ../src/guestfs-actions.pod:2518
8242 " int guestfs_ln_s (guestfs_h *g,\n"
8243 "\t\tconst char *target,\n"
8244 "\t\tconst char *linkname);\n"
8249 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1993
8250 msgid "This command creates a symbolic link using the C<ln -s> command."
8254 #: ../src/guestfs-actions.pod:2526
8255 msgid "guestfs_ln_sf"
8259 #: ../src/guestfs-actions.pod:2528
8262 " int guestfs_ln_sf (guestfs_h *g,\n"
8263 "\t\tconst char *target,\n"
8264 "\t\tconst char *linkname);\n"
8269 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1999
8271 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8272 "option removes the link (C<linkname>) if it exists already."
8276 #: ../src/guestfs-actions.pod:2537
8277 msgid "guestfs_lremovexattr"
8281 #: ../src/guestfs-actions.pod:2539
8284 " int guestfs_lremovexattr (guestfs_h *g,\n"
8285 "\t\tconst char *xattr,\n"
8286 "\t\tconst char *path);\n"
8291 #: ../src/guestfs-actions.pod:2543
8293 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8294 "link, then it removes an extended attribute of the link itself."
8298 #: ../src/guestfs-actions.pod:2549
8303 #: ../src/guestfs-actions.pod:2551
8306 " char **guestfs_ls (guestfs_h *g,\n"
8307 "\t\tconst char *directory);\n"
8312 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:2014
8314 "List the files in C<directory> (relative to the root directory, there is no "
8315 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
8319 #: ../src/guestfs-actions.pod:2558
8321 "This command is mostly useful for interactive sessions. Programs should "
8322 "probably use C<guestfs_readdir> instead."
8326 #: ../src/guestfs-actions.pod:2565
8327 msgid "guestfs_lsetxattr"
8331 #: ../src/guestfs-actions.pod:2567
8334 " int guestfs_lsetxattr (guestfs_h *g,\n"
8335 "\t\tconst char *xattr,\n"
8336 "\t\tconst char *val,\n"
8338 "\t\tconst char *path);\n"
8343 #: ../src/guestfs-actions.pod:2573
8345 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8346 "then it sets an extended attribute of the link itself."
8350 #: ../src/guestfs-actions.pod:2579
8351 msgid "guestfs_lstat"
8355 #: ../src/guestfs-actions.pod:2581
8358 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8359 "\t\tconst char *path);\n"
8364 #: ../src/guestfs-actions.pod:2584 ../src/guestfs-actions.pod:4567
8365 #: ../fish/guestfish-actions.pod:2033 ../fish/guestfish-actions.pod:3522
8366 msgid "Returns file information for the given C<path>."
8370 #: ../src/guestfs-actions.pod:2586
8372 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8373 "link, then the link is stat-ed, not the file it refers to."
8377 #: ../src/guestfs-actions.pod:2590 ../fish/guestfish-actions.pod:2039
8378 msgid "This is the same as the C<lstat(2)> system call."
8382 #: ../src/guestfs-actions.pod:2592 ../src/guestfs-actions.pod:4571
8384 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8385 "error. I<The caller must call C<guestfs_free_stat> after use>."
8389 #: ../src/guestfs-actions.pod:2596
8390 msgid "guestfs_lstatlist"
8394 #: ../src/guestfs-actions.pod:2598
8397 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8398 "\t\tconst char *path,\n"
8399 "\t\tchar *const *names);\n"
8404 #: ../src/guestfs-actions.pod:2602
8406 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8407 "files, where all files are in the directory C<path>. C<names> is the list "
8408 "of files from this directory."
8412 #: ../src/guestfs-actions.pod:2606 ../fish/guestfish-actions.pod:2049
8414 "On return you get a list of stat structs, with a one-to-one correspondence "
8415 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8416 "then the C<ino> field of that structure is set to C<-1>."
8420 #: ../src/guestfs-actions.pod:2611
8422 "This call is intended for programs that want to efficiently list a directory "
8423 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8424 "for a similarly efficient call for getting extended attributes. Very long "
8425 "directory listings might cause the protocol message size to be exceeded, "
8426 "causing this call to fail. The caller must split up such requests into "
8427 "smaller groups of names."
8431 #: ../src/guestfs-actions.pod:2619
8433 "This function returns a C<struct guestfs_stat_list *> (see E<lt>guestfs-"
8434 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
8435 "C<guestfs_free_stat_list> after use>."
8439 #: ../src/guestfs-actions.pod:2624
8440 msgid "guestfs_luks_add_key"
8444 #: ../src/guestfs-actions.pod:2626
8447 " int guestfs_luks_add_key (guestfs_h *g,\n"
8448 "\t\tconst char *device,\n"
8449 "\t\tconst char *key,\n"
8450 "\t\tconst char *newkey,\n"
8451 "\t\tint keyslot);\n"
8456 #: ../src/guestfs-actions.pod:2632 ../fish/guestfish-actions.pod:2066
8458 "This command adds a new key on LUKS device C<device>. C<key> is any "
8459 "existing key, and is used to access the device. C<newkey> is the new key to "
8460 "add. C<keyslot> is the key slot that will be replaced."
8464 #: ../src/guestfs-actions.pod:2637
8466 "Note that if C<keyslot> already contains a key, then this command will "
8467 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8471 #: ../src/guestfs-actions.pod:2643 ../src/guestfs-actions.pod:2677
8472 #: ../src/guestfs-actions.pod:2697 ../src/guestfs-actions.pod:2714
8473 #: ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:2759
8475 "This function takes a key or passphrase parameter which could contain "
8476 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8481 #: ../src/guestfs-actions.pod:2647
8482 msgid "guestfs_luks_close"
8486 #: ../src/guestfs-actions.pod:2649
8489 " int guestfs_luks_close (guestfs_h *g,\n"
8490 "\t\tconst char *device);\n"
8495 #: ../src/guestfs-actions.pod:2652
8497 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8498 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8499 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8500 "underlying block device."
8504 #: ../src/guestfs-actions.pod:2660
8505 msgid "guestfs_luks_format"
8509 #: ../src/guestfs-actions.pod:2662
8512 " int guestfs_luks_format (guestfs_h *g,\n"
8513 "\t\tconst char *device,\n"
8514 "\t\tconst char *key,\n"
8515 "\t\tint keyslot);\n"
8520 #: ../src/guestfs-actions.pod:2667 ../fish/guestfish-actions.pod:2092
8522 "This command erases existing data on C<device> and formats the device as a "
8523 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8524 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8528 #: ../src/guestfs-actions.pod:2674 ../src/guestfs-actions.pod:2694
8529 #: ../src/guestfs-actions.pod:2796 ../src/guestfs-actions.pod:3508
8530 #: ../src/guestfs-actions.pod:4108 ../src/guestfs-actions.pod:4429
8531 #: ../src/guestfs-actions.pod:4449 ../src/guestfs-actions.pod:4472
8532 #: ../src/guestfs-actions.pod:5411 ../fish/guestfish-actions.pod:2100
8533 #: ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2184
8534 #: ../fish/guestfish-actions.pod:2699 ../fish/guestfish-actions.pod:3163
8535 #: ../fish/guestfish-actions.pod:3421 ../fish/guestfish-actions.pod:3437
8536 #: ../fish/guestfish-actions.pod:3452 ../fish/guestfish-actions.pod:4140
8538 "B<This command is dangerous. Without careful use you can easily destroy all "
8543 #: ../src/guestfs-actions.pod:2681
8544 msgid "guestfs_luks_format_cipher"
8548 #: ../src/guestfs-actions.pod:2683
8551 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8552 "\t\tconst char *device,\n"
8553 "\t\tconst char *key,\n"
8554 "\t\tint keyslot,\n"
8555 "\t\tconst char *cipher);\n"
8560 #: ../src/guestfs-actions.pod:2689
8562 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8563 "set the C<cipher> used."
8567 #: ../src/guestfs-actions.pod:2701
8568 msgid "guestfs_luks_kill_slot"
8572 #: ../src/guestfs-actions.pod:2703
8575 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8576 "\t\tconst char *device,\n"
8577 "\t\tconst char *key,\n"
8578 "\t\tint keyslot);\n"
8583 #: ../src/guestfs-actions.pod:2708 ../fish/guestfish-actions.pod:2120
8585 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8586 "device C<device>. C<key> must be one of the I<other> keys."
8590 #: ../src/guestfs-actions.pod:2718
8591 msgid "guestfs_luks_open"
8595 #: ../src/guestfs-actions.pod:2720
8598 " int guestfs_luks_open (guestfs_h *g,\n"
8599 "\t\tconst char *device,\n"
8600 "\t\tconst char *key,\n"
8601 "\t\tconst char *mapname);\n"
8606 #: ../src/guestfs-actions.pod:2725 ../fish/guestfish-actions.pod:2131
8608 "This command opens a block device which has been encrypted according to the "
8609 "Linux Unified Key Setup (LUKS) standard."
8613 #: ../src/guestfs-actions.pod:2728 ../fish/guestfish-actions.pod:2134
8614 msgid "C<device> is the encrypted block device or partition."
8618 #: ../src/guestfs-actions.pod:2730 ../fish/guestfish-actions.pod:2136
8620 "The caller must supply one of the keys associated with the LUKS block "
8621 "device, in the C<key> parameter."
8625 #: ../src/guestfs-actions.pod:2733 ../fish/guestfish-actions.pod:2139
8627 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8628 "writes to this block device are decrypted from and encrypted to the "
8629 "underlying C<device> respectively."
8633 #: ../src/guestfs-actions.pod:2737
8635 "If this block device contains LVM volume groups, then calling "
8636 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8641 #: ../src/guestfs-actions.pod:2747
8642 msgid "guestfs_luks_open_ro"
8646 #: ../src/guestfs-actions.pod:2749
8649 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8650 "\t\tconst char *device,\n"
8651 "\t\tconst char *key,\n"
8652 "\t\tconst char *mapname);\n"
8657 #: ../src/guestfs-actions.pod:2754
8659 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8664 #: ../src/guestfs-actions.pod:2763
8665 msgid "guestfs_lvcreate"
8669 #: ../src/guestfs-actions.pod:2765
8672 " int guestfs_lvcreate (guestfs_h *g,\n"
8673 "\t\tconst char *logvol,\n"
8674 "\t\tconst char *volgroup,\n"
8675 "\t\tint mbytes);\n"
8680 #: ../src/guestfs-actions.pod:2770 ../fish/guestfish-actions.pod:2164
8682 "This creates an LVM logical volume called C<logvol> on the volume group "
8683 "C<volgroup>, with C<size> megabytes."
8687 #: ../src/guestfs-actions.pod:2775
8688 msgid "guestfs_lvm_clear_filter"
8692 #: ../src/guestfs-actions.pod:2777
8695 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8700 #: ../src/guestfs-actions.pod:2779
8702 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8703 "see every block device."
8707 #: ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:2818
8708 #: ../fish/guestfish-actions.pod:2174 ../fish/guestfish-actions.pod:2205
8710 "This command also clears the LVM cache and performs a volume group scan."
8714 #: ../src/guestfs-actions.pod:2787
8715 msgid "guestfs_lvm_remove_all"
8719 #: ../src/guestfs-actions.pod:2789
8722 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8727 #: ../src/guestfs-actions.pod:2791 ../fish/guestfish-actions.pod:2181
8729 "This command removes all LVM logical volumes, volume groups and physical "
8734 #: ../src/guestfs-actions.pod:2799
8735 msgid "guestfs_lvm_set_filter"
8739 #: ../src/guestfs-actions.pod:2801
8742 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8743 "\t\tchar *const *devices);\n"
8748 #: ../src/guestfs-actions.pod:2804 ../fish/guestfish-actions.pod:2191
8750 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
8751 "block devices in the list C<devices>, and will ignore all other attached "
8756 #: ../src/guestfs-actions.pod:2808 ../fish/guestfish-actions.pod:2195
8758 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
8759 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
8760 "there are two types of duplication possible: either cloned PVs/VGs which "
8761 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
8762 "same name. In normal operation you cannot create this situation, but you "
8763 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
8764 "inside the LVM metadata."
8768 #: ../src/guestfs-actions.pod:2821 ../fish/guestfish-actions.pod:2208
8769 msgid "You can filter whole block devices or individual partitions."
8773 #: ../src/guestfs-actions.pod:2823 ../fish/guestfish-actions.pod:2210
8775 "You cannot use this if any VG is currently in use (eg. contains a mounted "
8776 "filesystem), even if you are not filtering out that VG."
8780 #: ../src/guestfs-actions.pod:2829
8781 msgid "guestfs_lvremove"
8785 #: ../src/guestfs-actions.pod:2831
8788 " int guestfs_lvremove (guestfs_h *g,\n"
8789 "\t\tconst char *device);\n"
8794 #: ../src/guestfs-actions.pod:2834 ../fish/guestfish-actions.pod:2218
8796 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
8797 "LV, such as C</dev/VG/LV>."
8801 #: ../src/guestfs-actions.pod:2837 ../fish/guestfish-actions.pod:2221
8803 "You can also remove all LVs in a volume group by specifying the VG name, C</"
8808 #: ../src/guestfs-actions.pod:2842
8809 msgid "guestfs_lvrename"
8813 #: ../src/guestfs-actions.pod:2844
8816 " int guestfs_lvrename (guestfs_h *g,\n"
8817 "\t\tconst char *logvol,\n"
8818 "\t\tconst char *newlogvol);\n"
8823 #: ../src/guestfs-actions.pod:2848 ../fish/guestfish-actions.pod:2228
8824 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
8828 #: ../src/guestfs-actions.pod:2852
8829 msgid "guestfs_lvresize"
8833 #: ../src/guestfs-actions.pod:2854
8836 " int guestfs_lvresize (guestfs_h *g,\n"
8837 "\t\tconst char *device,\n"
8838 "\t\tint mbytes);\n"
8843 #: ../src/guestfs-actions.pod:2858 ../fish/guestfish-actions.pod:2234
8845 "This resizes (expands or shrinks) an existing LVM logical volume to "
8846 "C<mbytes>. When reducing, data in the reduced part is lost."
8850 #: ../src/guestfs-actions.pod:2864
8851 msgid "guestfs_lvresize_free"
8855 #: ../src/guestfs-actions.pod:2866
8858 " int guestfs_lvresize_free (guestfs_h *g,\n"
8859 "\t\tconst char *lv,\n"
8860 "\t\tint percent);\n"
8865 #: ../src/guestfs-actions.pod:2870 ../fish/guestfish-actions.pod:2242
8867 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
8868 "remaining free space in the volume group. Commonly you would call this with "
8869 "pc = 100 which expands the logical volume as much as possible, using all "
8870 "remaining free space in the volume group."
8874 #: ../src/guestfs-actions.pod:2878
8879 #: ../src/guestfs-actions.pod:2880
8882 " char **guestfs_lvs (guestfs_h *g);\n"
8887 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:2252
8889 "List all the logical volumes detected. This is the equivalent of the L<lvs"
8894 #: ../src/guestfs-actions.pod:2885 ../fish/guestfish-actions.pod:2255
8896 "This returns a list of the logical volume device names (eg. C</dev/"
8897 "VolGroup00/LogVol00>)."
8901 #: ../src/guestfs-actions.pod:2888
8902 msgid "See also C<guestfs_lvs_full>."
8906 #: ../src/guestfs-actions.pod:2894
8907 msgid "guestfs_lvs_full"
8911 #: ../src/guestfs-actions.pod:2896
8914 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
8919 #: ../src/guestfs-actions.pod:2898 ../fish/guestfish-actions.pod:2264
8921 "List all the logical volumes detected. This is the equivalent of the L<lvs"
8922 "(8)> command. The \"full\" version includes all fields."
8926 #: ../src/guestfs-actions.pod:2901
8928 "This function returns a C<struct guestfs_lvm_lv_list *> (see E<lt>guestfs-"
8929 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
8930 "C<guestfs_free_lvm_lv_list> after use>."
8934 #: ../src/guestfs-actions.pod:2906
8935 msgid "guestfs_lvuuid"
8939 #: ../src/guestfs-actions.pod:2908
8942 " char *guestfs_lvuuid (guestfs_h *g,\n"
8943 "\t\tconst char *device);\n"
8948 #: ../src/guestfs-actions.pod:2911 ../fish/guestfish-actions.pod:2271
8949 msgid "This command returns the UUID of the LVM LV C<device>."
8953 #: ../src/guestfs-actions.pod:2916
8954 msgid "guestfs_lxattrlist"
8958 #: ../src/guestfs-actions.pod:2918
8961 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
8962 "\t\tconst char *path,\n"
8963 "\t\tchar *const *names);\n"
8968 #: ../src/guestfs-actions.pod:2922 ../fish/guestfish-actions.pod:2277
8970 "This call allows you to get the extended attributes of multiple files, where "
8971 "all files are in the directory C<path>. C<names> is the list of files from "
8976 #: ../src/guestfs-actions.pod:2926 ../fish/guestfish-actions.pod:2281
8978 "On return you get a flat list of xattr structs which must be interpreted "
8979 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
8980 "C<attrval> in this struct is zero-length to indicate there was an error "
8981 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
8982 "number (the number of following attributes for this file, which could be C<"
8983 "\"0\">). Then after the first xattr struct are the zero or more attributes "
8984 "for the first named file. This repeats for the second and subsequent files."
8988 #: ../src/guestfs-actions.pod:2936
8990 "This call is intended for programs that want to efficiently list a directory "
8991 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
8992 "a similarly efficient call for getting standard stats. Very long directory "
8993 "listings might cause the protocol message size to be exceeded, causing this "
8994 "call to fail. The caller must split up such requests into smaller groups of "
8999 #: ../src/guestfs-actions.pod:2949
9000 msgid "guestfs_mkdir"
9004 #: ../src/guestfs-actions.pod:2951
9007 " int guestfs_mkdir (guestfs_h *g,\n"
9008 "\t\tconst char *path);\n"
9013 #: ../src/guestfs-actions.pod:2954 ../fish/guestfish-actions.pod:2303
9014 msgid "Create a directory named C<path>."
9018 #: ../src/guestfs-actions.pod:2958
9019 msgid "guestfs_mkdir_mode"
9023 #: ../src/guestfs-actions.pod:2960
9026 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9027 "\t\tconst char *path,\n"
9033 #: ../src/guestfs-actions.pod:2964 ../fish/guestfish-actions.pod:2309
9035 "This command creates a directory, setting the initial permissions of the "
9036 "directory to C<mode>."
9040 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2312
9042 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9043 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9048 #: ../src/guestfs-actions.pod:2971
9049 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9053 #: ../src/guestfs-actions.pod:2975
9054 msgid "guestfs_mkdir_p"
9058 #: ../src/guestfs-actions.pod:2977
9061 " int guestfs_mkdir_p (guestfs_h *g,\n"
9062 "\t\tconst char *path);\n"
9067 #: ../src/guestfs-actions.pod:2980 ../fish/guestfish-actions.pod:2322
9069 "Create a directory named C<path>, creating any parent directories as "
9070 "necessary. This is like the C<mkdir -p> shell command."
9074 #: ../src/guestfs-actions.pod:2985
9075 msgid "guestfs_mkdtemp"
9079 #: ../src/guestfs-actions.pod:2987
9082 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9083 "\t\tconst char *template);\n"
9088 #: ../src/guestfs-actions.pod:2990 ../fish/guestfish-actions.pod:2329
9090 "This command creates a temporary directory. The C<template> parameter "
9091 "should be a full pathname for the temporary directory name with the final "
9092 "six characters being \"XXXXXX\"."
9096 #: ../src/guestfs-actions.pod:2995 ../fish/guestfish-actions.pod:2334
9098 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9099 "being suitable for Windows filesystems."
9103 #: ../src/guestfs-actions.pod:2998 ../fish/guestfish-actions.pod:2337
9104 msgid "The name of the temporary directory that was created is returned."
9108 #: ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:2340
9109 msgid "The temporary directory is created with mode 0700 and is owned by root."
9113 #: ../src/guestfs-actions.pod:3004 ../fish/guestfish-actions.pod:2343
9115 "The caller is responsible for deleting the temporary directory and its "
9116 "contents after use."
9120 #: ../src/guestfs-actions.pod:3007 ../fish/guestfish-actions.pod:2346
9121 msgid "See also: L<mkdtemp(3)>"
9125 #: ../src/guestfs-actions.pod:3012
9126 msgid "guestfs_mke2fs_J"
9130 #: ../src/guestfs-actions.pod:3014
9133 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9134 "\t\tconst char *fstype,\n"
9135 "\t\tint blocksize,\n"
9136 "\t\tconst char *device,\n"
9137 "\t\tconst char *journal);\n"
9142 #: ../src/guestfs-actions.pod:3020 ../fish/guestfish-actions.pod:2352
9144 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9145 "C<journal>. It is equivalent to the command:"
9149 #: ../src/guestfs-actions.pod:3024 ../fish/guestfish-actions.pod:2356
9152 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9157 #: ../src/guestfs-actions.pod:3026
9158 msgid "See also C<guestfs_mke2journal>."
9162 #: ../src/guestfs-actions.pod:3030
9163 msgid "guestfs_mke2fs_JL"
9167 #: ../src/guestfs-actions.pod:3032
9170 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9171 "\t\tconst char *fstype,\n"
9172 "\t\tint blocksize,\n"
9173 "\t\tconst char *device,\n"
9174 "\t\tconst char *label);\n"
9179 #: ../src/guestfs-actions.pod:3038 ../fish/guestfish-actions.pod:2364
9181 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9182 "the journal labeled C<label>."
9186 #: ../src/guestfs-actions.pod:3041
9187 msgid "See also C<guestfs_mke2journal_L>."
9191 #: ../src/guestfs-actions.pod:3045
9192 msgid "guestfs_mke2fs_JU"
9196 #: ../src/guestfs-actions.pod:3047
9199 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9200 "\t\tconst char *fstype,\n"
9201 "\t\tint blocksize,\n"
9202 "\t\tconst char *device,\n"
9203 "\t\tconst char *uuid);\n"
9208 #: ../src/guestfs-actions.pod:3053 ../fish/guestfish-actions.pod:2373
9210 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9211 "the journal with UUID C<uuid>."
9215 #: ../src/guestfs-actions.pod:3056
9216 msgid "See also C<guestfs_mke2journal_U>."
9220 #: ../src/guestfs-actions.pod:3060
9221 msgid "guestfs_mke2journal"
9225 #: ../src/guestfs-actions.pod:3062
9228 " int guestfs_mke2journal (guestfs_h *g,\n"
9229 "\t\tint blocksize,\n"
9230 "\t\tconst char *device);\n"
9235 #: ../src/guestfs-actions.pod:3066 ../fish/guestfish-actions.pod:2382
9237 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9242 #: ../src/guestfs-actions.pod:3069 ../fish/guestfish-actions.pod:2385
9245 " mke2fs -O journal_dev -b blocksize device\n"
9250 #: ../src/guestfs-actions.pod:3073
9251 msgid "guestfs_mke2journal_L"
9255 #: ../src/guestfs-actions.pod:3075
9258 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9259 "\t\tint blocksize,\n"
9260 "\t\tconst char *label,\n"
9261 "\t\tconst char *device);\n"
9266 #: ../src/guestfs-actions.pod:3080 ../fish/guestfish-actions.pod:2391
9267 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9271 #: ../src/guestfs-actions.pod:3084
9272 msgid "guestfs_mke2journal_U"
9276 #: ../src/guestfs-actions.pod:3086
9279 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9280 "\t\tint blocksize,\n"
9281 "\t\tconst char *uuid,\n"
9282 "\t\tconst char *device);\n"
9287 #: ../src/guestfs-actions.pod:3091 ../fish/guestfish-actions.pod:2397
9288 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9292 #: ../src/guestfs-actions.pod:3095
9293 msgid "guestfs_mkfifo"
9297 #: ../src/guestfs-actions.pod:3097
9300 " int guestfs_mkfifo (guestfs_h *g,\n"
9302 "\t\tconst char *path);\n"
9307 #: ../src/guestfs-actions.pod:3101
9309 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9310 "is just a convenient wrapper around C<guestfs_mknod>."
9314 #: ../src/guestfs-actions.pod:3109
9315 msgid "guestfs_mkfs"
9319 #: ../src/guestfs-actions.pod:3111
9322 " int guestfs_mkfs (guestfs_h *g,\n"
9323 "\t\tconst char *fstype,\n"
9324 "\t\tconst char *device);\n"
9329 #: ../src/guestfs-actions.pod:3115 ../fish/guestfish-actions.pod:2413
9331 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9332 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9336 #: ../src/guestfs-actions.pod:3121
9337 msgid "guestfs_mkfs_b"
9341 #: ../src/guestfs-actions.pod:3123
9344 " int guestfs_mkfs_b (guestfs_h *g,\n"
9345 "\t\tconst char *fstype,\n"
9346 "\t\tint blocksize,\n"
9347 "\t\tconst char *device);\n"
9352 #: ../src/guestfs-actions.pod:3128
9354 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9355 "block size of the resulting filesystem. Supported block sizes depend on the "
9356 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9360 #: ../src/guestfs-actions.pod:3133 ../fish/guestfish-actions.pod:2426
9362 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9367 #: ../src/guestfs-actions.pod:3138
9368 msgid "guestfs_mkmountpoint"
9372 #: ../src/guestfs-actions.pod:3140
9375 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9376 "\t\tconst char *exemptpath);\n"
9381 #: ../src/guestfs-actions.pod:3143
9383 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9384 "that can be used to create extra mountpoints before mounting the first "
9389 #: ../src/guestfs-actions.pod:3147 ../fish/guestfish-actions.pod:2437
9391 "These calls are I<only> necessary in some very limited circumstances, mainly "
9392 "the case where you want to mount a mix of unrelated and/or read-only "
9393 "filesystems together."
9397 #: ../src/guestfs-actions.pod:3151 ../fish/guestfish-actions.pod:2441
9399 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9400 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9401 "inside that. You can unpack this as follows in guestfish:"
9405 #: ../src/guestfs-actions.pod:3156 ../fish/guestfish-actions.pod:2446
9408 " add-ro Fedora-11-i686-Live.iso\n"
9410 " mkmountpoint /cd\n"
9411 " mkmountpoint /squash\n"
9412 " mkmountpoint /ext3\n"
9413 " mount /dev/sda /cd\n"
9414 " mount-loop /cd/LiveOS/squashfs.img /squash\n"
9415 " mount-loop /squash/LiveOS/ext3fs.img /ext3\n"
9420 #: ../src/guestfs-actions.pod:3165 ../fish/guestfish-actions.pod:2455
9421 msgid "The inner filesystem is now unpacked under the /ext3 mountpoint."
9425 #: ../src/guestfs-actions.pod:3169
9426 msgid "guestfs_mknod"
9430 #: ../src/guestfs-actions.pod:3171
9433 " int guestfs_mknod (guestfs_h *g,\n"
9435 "\t\tint devmajor,\n"
9436 "\t\tint devminor,\n"
9437 "\t\tconst char *path);\n"
9442 #: ../src/guestfs-actions.pod:3177 ../fish/guestfish-actions.pod:2461
9444 "This call creates block or character special devices, or named pipes (FIFOs)."
9448 #: ../src/guestfs-actions.pod:3180 ../fish/guestfish-actions.pod:2464
9450 "The C<mode> parameter should be the mode, using the standard constants. "
9451 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9452 "used when creating block and character special devices."
9456 #: ../src/guestfs-actions.pod:3185
9458 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9459 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9460 "regular file). These constants are available in the standard Linux header "
9461 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9462 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9463 "the appropriate constant for you."
9467 #: ../src/guestfs-actions.pod:3197
9468 msgid "guestfs_mknod_b"
9472 #: ../src/guestfs-actions.pod:3199
9475 " int guestfs_mknod_b (guestfs_h *g,\n"
9477 "\t\tint devmajor,\n"
9478 "\t\tint devminor,\n"
9479 "\t\tconst char *path);\n"
9484 #: ../src/guestfs-actions.pod:3205
9486 "This call creates a block device node called C<path> with mode C<mode> and "
9487 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9488 "wrapper around C<guestfs_mknod>."
9492 #: ../src/guestfs-actions.pod:3213
9493 msgid "guestfs_mknod_c"
9497 #: ../src/guestfs-actions.pod:3215
9500 " int guestfs_mknod_c (guestfs_h *g,\n"
9502 "\t\tint devmajor,\n"
9503 "\t\tint devminor,\n"
9504 "\t\tconst char *path);\n"
9509 #: ../src/guestfs-actions.pod:3221
9511 "This call creates a char device node called C<path> with mode C<mode> and "
9512 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9513 "wrapper around C<guestfs_mknod>."
9517 #: ../src/guestfs-actions.pod:3229
9518 msgid "guestfs_mkswap"
9522 #: ../src/guestfs-actions.pod:3231
9525 " int guestfs_mkswap (guestfs_h *g,\n"
9526 "\t\tconst char *device);\n"
9531 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2503
9532 msgid "Create a swap partition on C<device>."
9536 #: ../src/guestfs-actions.pod:3238
9537 msgid "guestfs_mkswap_L"
9541 #: ../src/guestfs-actions.pod:3240
9544 " int guestfs_mkswap_L (guestfs_h *g,\n"
9545 "\t\tconst char *label,\n"
9546 "\t\tconst char *device);\n"
9551 #: ../src/guestfs-actions.pod:3244 ../fish/guestfish-actions.pod:2509
9552 msgid "Create a swap partition on C<device> with label C<label>."
9556 #: ../src/guestfs-actions.pod:3246 ../fish/guestfish-actions.pod:2511
9558 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
9559 "sda>), just to a partition. This appears to be a limitation of the kernel "
9564 #: ../src/guestfs-actions.pod:3252
9565 msgid "guestfs_mkswap_U"
9569 #: ../src/guestfs-actions.pod:3254
9572 " int guestfs_mkswap_U (guestfs_h *g,\n"
9573 "\t\tconst char *uuid,\n"
9574 "\t\tconst char *device);\n"
9579 #: ../src/guestfs-actions.pod:3258 ../fish/guestfish-actions.pod:2519
9580 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9584 #: ../src/guestfs-actions.pod:3262
9585 msgid "guestfs_mkswap_file"
9589 #: ../src/guestfs-actions.pod:3264
9592 " int guestfs_mkswap_file (guestfs_h *g,\n"
9593 "\t\tconst char *path);\n"
9598 #: ../src/guestfs-actions.pod:3267 ../fish/guestfish-actions.pod:2525
9599 msgid "Create a swap file."
9603 #: ../src/guestfs-actions.pod:3269
9605 "This command just writes a swap file signature to an existing file. To "
9606 "create the file itself, use something like C<guestfs_fallocate>."
9610 #: ../src/guestfs-actions.pod:3274
9611 msgid "guestfs_modprobe"
9615 #: ../src/guestfs-actions.pod:3276
9618 " int guestfs_modprobe (guestfs_h *g,\n"
9619 "\t\tconst char *modulename);\n"
9624 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2534
9625 msgid "This loads a kernel module in the appliance."
9629 #: ../src/guestfs-actions.pod:3281 ../fish/guestfish-actions.pod:2536
9631 "The kernel module must have been whitelisted when libguestfs was built (see "
9632 "C<appliance/kmod.whitelist.in> in the source)."
9636 #: ../src/guestfs-actions.pod:3286
9637 msgid "guestfs_mount"
9641 #: ../src/guestfs-actions.pod:3288
9644 " int guestfs_mount (guestfs_h *g,\n"
9645 "\t\tconst char *device,\n"
9646 "\t\tconst char *mountpoint);\n"
9651 #: ../src/guestfs-actions.pod:3292 ../fish/guestfish-actions.pod:2543
9653 "Mount a guest disk at a position in the filesystem. Block devices are named "
9654 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9655 "those block devices contain partitions, they will have the usual names (eg. "
9656 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9660 #: ../src/guestfs-actions.pod:3298 ../fish/guestfish-actions.pod:2549
9662 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9663 "mounted on C</> before others can be mounted. Other filesystems can only be "
9664 "mounted on directories which already exist."
9668 #: ../src/guestfs-actions.pod:3303 ../fish/guestfish-actions.pod:2554
9670 "The mounted filesystem is writable, if we have sufficient permissions on the "
9671 "underlying device."
9675 #: ../src/guestfs-actions.pod:3306
9677 "B<Important note:> When you use this call, the filesystem options C<sync> "
9678 "and C<noatime> are set implicitly. This was originally done because we "
9679 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9680 "very large negative performance impact and negligible effect on "
9681 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9682 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9683 "(use an empty string for the first parameter if you don't want any options)."
9687 #: ../src/guestfs-actions.pod:3318
9688 msgid "guestfs_mount_loop"
9692 #: ../src/guestfs-actions.pod:3320
9695 " int guestfs_mount_loop (guestfs_h *g,\n"
9696 "\t\tconst char *file,\n"
9697 "\t\tconst char *mountpoint);\n"
9702 #: ../src/guestfs-actions.pod:3324 ../fish/guestfish-actions.pod:2571
9704 "This command lets you mount C<file> (a filesystem image in a file) on a "
9705 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9710 #: ../src/guestfs-actions.pod:3330
9711 msgid "guestfs_mount_options"
9715 #: ../src/guestfs-actions.pod:3332
9718 " int guestfs_mount_options (guestfs_h *g,\n"
9719 "\t\tconst char *options,\n"
9720 "\t\tconst char *device,\n"
9721 "\t\tconst char *mountpoint);\n"
9726 #: ../src/guestfs-actions.pod:3337
9728 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9729 "the mount options as for the L<mount(8)> I<-o> flag."
9733 #: ../src/guestfs-actions.pod:3341 ../fish/guestfish-actions.pod:2583
9735 "If the C<options> parameter is an empty string, then no options are passed "
9736 "(all options default to whatever the filesystem uses)."
9740 #: ../src/guestfs-actions.pod:3347
9741 msgid "guestfs_mount_ro"
9745 #: ../src/guestfs-actions.pod:3349
9748 " int guestfs_mount_ro (guestfs_h *g,\n"
9749 "\t\tconst char *device,\n"
9750 "\t\tconst char *mountpoint);\n"
9755 #: ../src/guestfs-actions.pod:3353
9757 "This is the same as the C<guestfs_mount> command, but it mounts the "
9758 "filesystem with the read-only (I<-o ro>) flag."
9762 #: ../src/guestfs-actions.pod:3358
9763 msgid "guestfs_mount_vfs"
9767 #: ../src/guestfs-actions.pod:3360
9770 " int guestfs_mount_vfs (guestfs_h *g,\n"
9771 "\t\tconst char *options,\n"
9772 "\t\tconst char *vfstype,\n"
9773 "\t\tconst char *device,\n"
9774 "\t\tconst char *mountpoint);\n"
9779 #: ../src/guestfs-actions.pod:3366
9781 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9782 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
9787 #: ../src/guestfs-actions.pod:3372
9788 msgid "guestfs_mountpoints"
9792 #: ../src/guestfs-actions.pod:3374
9795 " char **guestfs_mountpoints (guestfs_h *g);\n"
9800 #: ../src/guestfs-actions.pod:3376
9802 "This call is similar to C<guestfs_mounts>. That call returns a list of "
9803 "devices. This one returns a hash table (map) of device name to directory "
9804 "where the device is mounted."
9808 #: ../src/guestfs-actions.pod:3386
9809 msgid "guestfs_mounts"
9813 #: ../src/guestfs-actions.pod:3388
9816 " char **guestfs_mounts (guestfs_h *g);\n"
9821 #: ../src/guestfs-actions.pod:3390 ../fish/guestfish-actions.pod:2614
9823 "This returns the list of currently mounted filesystems. It returns the list "
9824 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
9828 #: ../src/guestfs-actions.pod:3393 ../fish/guestfish-actions.pod:2617
9829 msgid "Some internal mounts are not shown."
9833 #: ../src/guestfs-actions.pod:3395
9834 msgid "See also: C<guestfs_mountpoints>"
9838 #: ../src/guestfs-actions.pod:3401
9843 #: ../src/guestfs-actions.pod:3403
9846 " int guestfs_mv (guestfs_h *g,\n"
9847 "\t\tconst char *src,\n"
9848 "\t\tconst char *dest);\n"
9853 #: ../src/guestfs-actions.pod:3407 ../fish/guestfish-actions.pod:2625
9855 "This moves a file from C<src> to C<dest> where C<dest> is either a "
9856 "destination filename or destination directory."
9860 #: ../src/guestfs-actions.pod:3412
9861 msgid "guestfs_ntfs_3g_probe"
9865 #: ../src/guestfs-actions.pod:3414
9868 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
9870 "\t\tconst char *device);\n"
9875 #: ../src/guestfs-actions.pod:3418 ../fish/guestfish-actions.pod:2632
9877 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
9878 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
9879 "write, and some cannot be mounted at all)."
9883 #: ../src/guestfs-actions.pod:3422 ../fish/guestfish-actions.pod:2636
9885 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
9886 "can be mounted read-write. Set it to false if you want to test if the "
9887 "volume can be mounted read-only."
9891 #: ../src/guestfs-actions.pod:3426 ../fish/guestfish-actions.pod:2640
9893 "The return value is an integer which C<0> if the operation would succeed, or "
9894 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
9898 #: ../src/guestfs-actions.pod:3432
9899 msgid "guestfs_ntfsresize"
9903 #: ../src/guestfs-actions.pod:3434
9906 " int guestfs_ntfsresize (guestfs_h *g,\n"
9907 "\t\tconst char *device);\n"
9912 #: ../src/guestfs-actions.pod:3437 ../fish/guestfish-actions.pod:2648
9914 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
9915 "size of the underlying device. See also L<ntfsresize(8)>."
9919 #: ../src/guestfs-actions.pod:3443
9920 msgid "guestfs_ntfsresize_size"
9924 #: ../src/guestfs-actions.pod:3445
9927 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
9928 "\t\tconst char *device,\n"
9929 "\t\tint64_t size);\n"
9934 #: ../src/guestfs-actions.pod:3449
9936 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
9937 "to specify the new size (in bytes) explicitly."
9941 #: ../src/guestfs-actions.pod:3454
9942 msgid "guestfs_part_add"
9946 #: ../src/guestfs-actions.pod:3456
9949 " int guestfs_part_add (guestfs_h *g,\n"
9950 "\t\tconst char *device,\n"
9951 "\t\tconst char *prlogex,\n"
9952 "\t\tint64_t startsect,\n"
9953 "\t\tint64_t endsect);\n"
9958 #: ../src/guestfs-actions.pod:3462
9960 "This command adds a partition to C<device>. If there is no partition table "
9961 "on the device, call C<guestfs_part_init> first."
9965 #: ../src/guestfs-actions.pod:3465 ../fish/guestfish-actions.pod:2666
9967 "The C<prlogex> parameter is the type of partition. Normally you should pass "
9968 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
9969 "C<logical>) and C<e> (or C<extended>) partition types."
9973 #: ../src/guestfs-actions.pod:3470 ../fish/guestfish-actions.pod:2671
9975 "C<startsect> and C<endsect> are the start and end of the partition in "
9976 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
9977 "from the end of the disk (C<-1> is the last sector)."
9981 #: ../src/guestfs-actions.pod:3474
9983 "Creating a partition which covers the whole disk is not so easy. Use "
9984 "C<guestfs_part_disk> to do that."
9988 #: ../src/guestfs-actions.pod:3479
9989 msgid "guestfs_part_del"
9993 #: ../src/guestfs-actions.pod:3481
9996 " int guestfs_part_del (guestfs_h *g,\n"
9997 "\t\tconst char *device,\n"
9998 "\t\tint partnum);\n"
10003 #: ../src/guestfs-actions.pod:3485 ../fish/guestfish-actions.pod:2682
10004 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10008 #: ../src/guestfs-actions.pod:3487 ../fish/guestfish-actions.pod:2684
10010 "Note that in the case of MBR partitioning, deleting an extended partition "
10011 "also deletes any logical partitions it contains."
10015 #: ../src/guestfs-actions.pod:3493
10016 msgid "guestfs_part_disk"
10020 #: ../src/guestfs-actions.pod:3495
10023 " int guestfs_part_disk (guestfs_h *g,\n"
10024 "\t\tconst char *device,\n"
10025 "\t\tconst char *parttype);\n"
10030 #: ../src/guestfs-actions.pod:3499
10032 "This command is simply a combination of C<guestfs_part_init> followed by "
10033 "C<guestfs_part_add> to create a single primary partition covering the whole "
10038 #: ../src/guestfs-actions.pod:3503
10040 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10041 "possible values are described in C<guestfs_part_init>."
10045 #: ../src/guestfs-actions.pod:3511
10046 msgid "guestfs_part_get_bootable"
10050 #: ../src/guestfs-actions.pod:3513
10053 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10054 "\t\tconst char *device,\n"
10055 "\t\tint partnum);\n"
10060 #: ../src/guestfs-actions.pod:3517 ../fish/guestfish-actions.pod:2706
10062 "This command returns true if the partition C<partnum> on C<device> has the "
10063 "bootable flag set."
10067 #: ../src/guestfs-actions.pod:3520
10068 msgid "See also C<guestfs_part_set_bootable>."
10072 #: ../src/guestfs-actions.pod:3524
10073 msgid "guestfs_part_get_mbr_id"
10077 #: ../src/guestfs-actions.pod:3526
10080 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10081 "\t\tconst char *device,\n"
10082 "\t\tint partnum);\n"
10087 #: ../src/guestfs-actions.pod:3530 ../fish/guestfish-actions.pod:2715
10089 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10090 "partition C<partnum>."
10094 #: ../src/guestfs-actions.pod:3533 ../src/guestfs-actions.pod:3695
10096 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10097 "undefined results for other partition table types (see "
10098 "C<guestfs_part_get_parttype>)."
10102 #: ../src/guestfs-actions.pod:3539
10103 msgid "guestfs_part_get_parttype"
10107 #: ../src/guestfs-actions.pod:3541
10110 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10111 "\t\tconst char *device);\n"
10116 #: ../src/guestfs-actions.pod:3544 ../fish/guestfish-actions.pod:2726
10118 "This command examines the partition table on C<device> and returns the "
10119 "partition table type (format) being used."
10123 #: ../src/guestfs-actions.pod:3547
10125 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10126 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10127 "possible, although unusual. See C<guestfs_part_init> for a full list."
10131 #: ../src/guestfs-actions.pod:3555
10132 msgid "guestfs_part_init"
10136 #: ../src/guestfs-actions.pod:3557
10139 " int guestfs_part_init (guestfs_h *g,\n"
10140 "\t\tconst char *device,\n"
10141 "\t\tconst char *parttype);\n"
10146 #: ../src/guestfs-actions.pod:3561 ../fish/guestfish-actions.pod:2738
10148 "This creates an empty partition table on C<device> of one of the partition "
10149 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10150 "(for large disks)."
10154 #: ../src/guestfs-actions.pod:3565
10156 "Initially there are no partitions. Following this, you should call "
10157 "C<guestfs_part_add> for each partition required."
10161 #: ../src/guestfs-actions.pod:3568 ../fish/guestfish-actions.pod:2745
10162 msgid "Possible values for C<parttype> are:"
10166 #: ../src/guestfs-actions.pod:3572 ../fish/guestfish-actions.pod:2749
10167 msgid "B<efi> | B<gpt>"
10171 #: ../src/guestfs-actions.pod:3574 ../fish/guestfish-actions.pod:2751
10172 msgid "Intel EFI / GPT partition table."
10176 #: ../src/guestfs-actions.pod:3576 ../fish/guestfish-actions.pod:2753
10178 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10179 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10180 "the C<mbr> format."
10184 #: ../src/guestfs-actions.pod:3580 ../fish/guestfish-actions.pod:2757
10185 msgid "B<mbr> | B<msdos>"
10189 #: ../src/guestfs-actions.pod:3582 ../fish/guestfish-actions.pod:2759
10191 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10192 "Windows. This partition type will B<only> work for device sizes up to 2 "
10193 "TB. For large disks we recommend using C<gpt>."
10197 #: ../src/guestfs-actions.pod:3589 ../fish/guestfish-actions.pod:2766
10199 "Other partition table types that may work but are not supported include:"
10203 #: ../src/guestfs-actions.pod:3594 ../fish/guestfish-actions.pod:2771
10208 #: ../src/guestfs-actions.pod:3596 ../fish/guestfish-actions.pod:2773
10209 msgid "AIX disk labels."
10213 #: ../src/guestfs-actions.pod:3598 ../fish/guestfish-actions.pod:2775
10214 msgid "B<amiga> | B<rdb>"
10218 #: ../src/guestfs-actions.pod:3600 ../fish/guestfish-actions.pod:2777
10219 msgid "Amiga \"Rigid Disk Block\" format."
10223 #: ../src/guestfs-actions.pod:3602 ../fish/guestfish-actions.pod:2779
10228 #: ../src/guestfs-actions.pod:3604 ../fish/guestfish-actions.pod:2781
10229 msgid "BSD disk labels."
10233 #: ../src/guestfs-actions.pod:3606 ../fish/guestfish-actions.pod:2783
10238 #: ../src/guestfs-actions.pod:3608 ../fish/guestfish-actions.pod:2785
10239 msgid "DASD, used on IBM mainframes."
10243 #: ../src/guestfs-actions.pod:3610 ../fish/guestfish-actions.pod:2787
10248 #: ../src/guestfs-actions.pod:3612 ../fish/guestfish-actions.pod:2789
10249 msgid "MIPS/SGI volumes."
10253 #: ../src/guestfs-actions.pod:3614 ../fish/guestfish-actions.pod:2791
10258 #: ../src/guestfs-actions.pod:3616 ../fish/guestfish-actions.pod:2793
10259 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10263 #: ../src/guestfs-actions.pod:3618 ../fish/guestfish-actions.pod:2795
10268 #: ../src/guestfs-actions.pod:3620 ../fish/guestfish-actions.pod:2797
10269 msgid "NEC PC-98 format, common in Japan apparently."
10273 #: ../src/guestfs-actions.pod:3622 ../fish/guestfish-actions.pod:2799
10278 #: ../src/guestfs-actions.pod:3624 ../fish/guestfish-actions.pod:2801
10279 msgid "Sun disk labels."
10283 #: ../src/guestfs-actions.pod:3630
10284 msgid "guestfs_part_list"
10288 #: ../src/guestfs-actions.pod:3632
10291 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10292 "\t\tconst char *device);\n"
10297 #: ../src/guestfs-actions.pod:3635 ../fish/guestfish-actions.pod:2809
10299 "This command parses the partition table on C<device> and returns the list of "
10300 "partitions found."
10304 #: ../src/guestfs-actions.pod:3638 ../fish/guestfish-actions.pod:2812
10305 msgid "The fields in the returned structure are:"
10309 #: ../src/guestfs-actions.pod:3642 ../fish/guestfish-actions.pod:2816
10310 msgid "B<part_num>"
10314 #: ../src/guestfs-actions.pod:3644 ../fish/guestfish-actions.pod:2818
10315 msgid "Partition number, counting from 1."
10319 #: ../src/guestfs-actions.pod:3646 ../fish/guestfish-actions.pod:2820
10320 msgid "B<part_start>"
10324 #: ../src/guestfs-actions.pod:3648
10326 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10327 "the device's sector size, see C<guestfs_blockdev_getss>."
10331 #: ../src/guestfs-actions.pod:3651 ../fish/guestfish-actions.pod:2825
10332 msgid "B<part_end>"
10336 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2827
10337 msgid "End of the partition in bytes."
10341 #: ../src/guestfs-actions.pod:3655 ../fish/guestfish-actions.pod:2829
10342 msgid "B<part_size>"
10346 #: ../src/guestfs-actions.pod:3657 ../fish/guestfish-actions.pod:2831
10347 msgid "Size of the partition in bytes."
10351 #: ../src/guestfs-actions.pod:3661
10353 "This function returns a C<struct guestfs_partition_list *> (see E<lt>guestfs-"
10354 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10355 "C<guestfs_free_partition_list> after use>."
10359 #: ../src/guestfs-actions.pod:3666
10360 msgid "guestfs_part_set_bootable"
10364 #: ../src/guestfs-actions.pod:3668
10367 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10368 "\t\tconst char *device,\n"
10369 "\t\tint partnum,\n"
10370 "\t\tint bootable);\n"
10375 #: ../src/guestfs-actions.pod:3673 ../fish/guestfish-actions.pod:2839
10377 "This sets the bootable flag on partition numbered C<partnum> on device "
10378 "C<device>. Note that partitions are numbered from 1."
10382 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2842
10384 "The bootable flag is used by some operating systems (notably Windows) to "
10385 "determine which partition to boot from. It is by no means universally "
10390 #: ../src/guestfs-actions.pod:3682
10391 msgid "guestfs_part_set_mbr_id"
10395 #: ../src/guestfs-actions.pod:3684
10398 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10399 "\t\tconst char *device,\n"
10400 "\t\tint partnum,\n"
10401 "\t\tint idbyte);\n"
10406 #: ../src/guestfs-actions.pod:3689 ../fish/guestfish-actions.pod:2850
10408 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10409 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10410 "documentation are in fact hexadecimal numbers, but usually documented "
10411 "without any leading \"0x\" which might be confusing."
10415 #: ../src/guestfs-actions.pod:3701
10416 msgid "guestfs_part_set_name"
10420 #: ../src/guestfs-actions.pod:3703
10423 " int guestfs_part_set_name (guestfs_h *g,\n"
10424 "\t\tconst char *device,\n"
10425 "\t\tint partnum,\n"
10426 "\t\tconst char *name);\n"
10431 #: ../src/guestfs-actions.pod:3708 ../fish/guestfish-actions.pod:2864
10433 "This sets the partition name on partition numbered C<partnum> on device "
10434 "C<device>. Note that partitions are numbered from 1."
10438 #: ../src/guestfs-actions.pod:3711 ../fish/guestfish-actions.pod:2867
10440 "The partition name can only be set on certain types of partition table. "
10441 "This works on C<gpt> but not on C<mbr> partitions."
10445 #: ../src/guestfs-actions.pod:3716
10446 msgid "guestfs_ping_daemon"
10450 #: ../src/guestfs-actions.pod:3718
10453 " int guestfs_ping_daemon (guestfs_h *g);\n"
10458 #: ../src/guestfs-actions.pod:3720 ../fish/guestfish-actions.pod:2874
10460 "This is a test probe into the guestfs daemon running inside the qemu "
10461 "subprocess. Calling this function checks that the daemon responds to the "
10462 "ping message, without affecting the daemon or attached block device(s) in "
10467 #: ../src/guestfs-actions.pod:3727
10468 msgid "guestfs_pread"
10472 #: ../src/guestfs-actions.pod:3729
10475 " char *guestfs_pread (guestfs_h *g,\n"
10476 "\t\tconst char *path,\n"
10478 "\t\tint64_t offset,\n"
10479 "\t\tsize_t *size_r);\n"
10484 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2883
10486 "This command lets you read part of a file. It reads C<count> bytes of the "
10487 "file, starting at C<offset>, from file C<path>."
10491 #: ../src/guestfs-actions.pod:3738 ../fish/guestfish-actions.pod:2886
10493 "This may read fewer bytes than requested. For further details see the "
10494 "L<pread(2)> system call."
10498 #: ../src/guestfs-actions.pod:3741
10499 msgid "See also C<guestfs_pwrite>."
10503 #: ../src/guestfs-actions.pod:3750
10504 msgid "guestfs_pvcreate"
10508 #: ../src/guestfs-actions.pod:3752
10511 " int guestfs_pvcreate (guestfs_h *g,\n"
10512 "\t\tconst char *device);\n"
10517 #: ../src/guestfs-actions.pod:3755 ../fish/guestfish-actions.pod:2898
10519 "This creates an LVM physical volume on the named C<device>, where C<device> "
10520 "should usually be a partition name such as C</dev/sda1>."
10524 #: ../src/guestfs-actions.pod:3761
10525 msgid "guestfs_pvremove"
10529 #: ../src/guestfs-actions.pod:3763
10532 " int guestfs_pvremove (guestfs_h *g,\n"
10533 "\t\tconst char *device);\n"
10538 #: ../src/guestfs-actions.pod:3766 ../fish/guestfish-actions.pod:2906
10540 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10545 #: ../src/guestfs-actions.pod:3769 ../fish/guestfish-actions.pod:2909
10547 "The implementation uses the C<pvremove> command which refuses to wipe "
10548 "physical volumes that contain any volume groups, so you have to remove those "
10553 #: ../src/guestfs-actions.pod:3775
10554 msgid "guestfs_pvresize"
10558 #: ../src/guestfs-actions.pod:3777
10561 " int guestfs_pvresize (guestfs_h *g,\n"
10562 "\t\tconst char *device);\n"
10567 #: ../src/guestfs-actions.pod:3780 ../fish/guestfish-actions.pod:2917
10569 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10570 "the new size of the underlying device."
10574 #: ../src/guestfs-actions.pod:3785
10575 msgid "guestfs_pvresize_size"
10579 #: ../src/guestfs-actions.pod:3787
10582 " int guestfs_pvresize_size (guestfs_h *g,\n"
10583 "\t\tconst char *device,\n"
10584 "\t\tint64_t size);\n"
10589 #: ../src/guestfs-actions.pod:3791
10591 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10592 "specify the new size (in bytes) explicitly."
10596 #: ../src/guestfs-actions.pod:3796
10597 msgid "guestfs_pvs"
10601 #: ../src/guestfs-actions.pod:3798
10604 " char **guestfs_pvs (guestfs_h *g);\n"
10609 #: ../src/guestfs-actions.pod:3800 ../fish/guestfish-actions.pod:2931
10611 "List all the physical volumes detected. This is the equivalent of the L<pvs"
10616 #: ../src/guestfs-actions.pod:3803 ../fish/guestfish-actions.pod:2934
10618 "This returns a list of just the device names that contain PVs (eg. C</dev/"
10623 #: ../src/guestfs-actions.pod:3806
10624 msgid "See also C<guestfs_pvs_full>."
10628 #: ../src/guestfs-actions.pod:3812
10629 msgid "guestfs_pvs_full"
10633 #: ../src/guestfs-actions.pod:3814
10636 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10641 #: ../src/guestfs-actions.pod:3816 ../fish/guestfish-actions.pod:2943
10643 "List all the physical volumes detected. This is the equivalent of the L<pvs"
10644 "(8)> command. The \"full\" version includes all fields."
10648 #: ../src/guestfs-actions.pod:3819
10650 "This function returns a C<struct guestfs_lvm_pv_list *> (see E<lt>guestfs-"
10651 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10652 "C<guestfs_free_lvm_pv_list> after use>."
10656 #: ../src/guestfs-actions.pod:3824
10657 msgid "guestfs_pvuuid"
10661 #: ../src/guestfs-actions.pod:3826
10664 " char *guestfs_pvuuid (guestfs_h *g,\n"
10665 "\t\tconst char *device);\n"
10670 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2950
10671 msgid "This command returns the UUID of the LVM PV C<device>."
10675 #: ../src/guestfs-actions.pod:3834
10676 msgid "guestfs_pwrite"
10680 #: ../src/guestfs-actions.pod:3836
10683 " int guestfs_pwrite (guestfs_h *g,\n"
10684 "\t\tconst char *path,\n"
10685 "\t\tconst char *content,\n"
10686 "\t\tsize_t content_size,\n"
10687 "\t\tint64_t offset);\n"
10692 #: ../src/guestfs-actions.pod:3842 ../fish/guestfish-actions.pod:2956
10694 "This command writes to part of a file. It writes the data buffer C<content> "
10695 "to the file C<path> starting at offset C<offset>."
10699 #: ../src/guestfs-actions.pod:3845 ../fish/guestfish-actions.pod:2959
10701 "This command implements the L<pwrite(2)> system call, and like that system "
10702 "call it may not write the full data requested. The return value is the "
10703 "number of bytes that were actually written to the file. This could even be "
10704 "0, although short writes are unlikely for regular files in ordinary "
10709 #: ../src/guestfs-actions.pod:3851
10710 msgid "See also C<guestfs_pread>."
10714 #: ../src/guestfs-actions.pod:3858
10715 msgid "guestfs_read_file"
10719 #: ../src/guestfs-actions.pod:3860
10722 " char *guestfs_read_file (guestfs_h *g,\n"
10723 "\t\tconst char *path,\n"
10724 "\t\tsize_t *size_r);\n"
10729 #: ../src/guestfs-actions.pod:3864 ../fish/guestfish-actions.pod:2974
10730 msgid "This calls returns the contents of the file C<path> as a buffer."
10734 #: ../src/guestfs-actions.pod:3867
10736 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
10737 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
10738 "function is limited in the total size of file that can be handled."
10742 #: ../src/guestfs-actions.pod:3879
10743 msgid "guestfs_read_lines"
10747 #: ../src/guestfs-actions.pod:3881
10750 " char **guestfs_read_lines (guestfs_h *g,\n"
10751 "\t\tconst char *path);\n"
10756 #: ../src/guestfs-actions.pod:3886 ../fish/guestfish-actions.pod:2991
10758 "The file contents are returned as a list of lines. Trailing C<LF> and "
10759 "C<CRLF> character sequences are I<not> returned."
10763 #: ../src/guestfs-actions.pod:3889
10765 "Note that this function cannot correctly handle binary files (specifically, "
10766 "files containing C<\\0> character which is treated as end of line). For "
10767 "those you need to use the C<guestfs_read_file> function which has a more "
10768 "complex interface."
10772 #: ../src/guestfs-actions.pod:3898
10773 msgid "guestfs_readdir"
10777 #: ../src/guestfs-actions.pod:3900
10780 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
10781 "\t\tconst char *dir);\n"
10786 #: ../src/guestfs-actions.pod:3903 ../fish/guestfish-actions.pod:3003
10787 msgid "This returns the list of directory entries in directory C<dir>."
10791 #: ../src/guestfs-actions.pod:3905 ../fish/guestfish-actions.pod:3005
10793 "All entries in the directory are returned, including C<.> and C<..>. The "
10794 "entries are I<not> sorted, but returned in the same order as the underlying "
10799 #: ../src/guestfs-actions.pod:3909 ../fish/guestfish-actions.pod:3009
10801 "Also this call returns basic file type information about each file. The "
10802 "C<ftyp> field will contain one of the following characters:"
10806 #: ../src/guestfs-actions.pod:3914 ../fish/guestfish-actions.pod:3014
10811 #: ../src/guestfs-actions.pod:3916 ../fish/guestfish-actions.pod:3016
10812 msgid "Block special"
10816 #: ../src/guestfs-actions.pod:3918 ../fish/guestfish-actions.pod:3018
10821 #: ../src/guestfs-actions.pod:3920 ../fish/guestfish-actions.pod:3020
10822 msgid "Char special"
10826 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:3022
10831 #: ../src/guestfs-actions.pod:3924 ../fish/guestfish-actions.pod:3024
10836 #: ../src/guestfs-actions.pod:3926 ../fish/guestfish-actions.pod:3026
10841 #: ../src/guestfs-actions.pod:3928 ../fish/guestfish-actions.pod:3028
10842 msgid "FIFO (named pipe)"
10846 #: ../src/guestfs-actions.pod:3930 ../fish/guestfish-actions.pod:3030
10851 #: ../src/guestfs-actions.pod:3932 ../fish/guestfish-actions.pod:3032
10852 msgid "Symbolic link"
10856 #: ../src/guestfs-actions.pod:3934 ../fish/guestfish-actions.pod:3034
10861 #: ../src/guestfs-actions.pod:3936 ../fish/guestfish-actions.pod:3036
10862 msgid "Regular file"
10866 #: ../src/guestfs-actions.pod:3938 ../fish/guestfish-actions.pod:3038
10871 #: ../src/guestfs-actions.pod:3940 ../fish/guestfish-actions.pod:3040
10876 #: ../src/guestfs-actions.pod:3942 ../fish/guestfish-actions.pod:3042
10881 #: ../src/guestfs-actions.pod:3944 ../fish/guestfish-actions.pod:3044
10882 msgid "Unknown file type"
10886 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:3046
10891 #: ../src/guestfs-actions.pod:3948 ../fish/guestfish-actions.pod:3048
10893 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
10897 #: ../src/guestfs-actions.pod:3953
10899 "This function is primarily intended for use by programs. To get a simple "
10900 "list of names, use C<guestfs_ls>. To get a printable directory for human "
10901 "consumption, use C<guestfs_ll>."
10905 #: ../src/guestfs-actions.pod:3957
10907 "This function returns a C<struct guestfs_dirent_list *> (see E<lt>guestfs-"
10908 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10909 "C<guestfs_free_dirent_list> after use>."
10913 #: ../src/guestfs-actions.pod:3962
10914 msgid "guestfs_readlink"
10918 #: ../src/guestfs-actions.pod:3964
10921 " char *guestfs_readlink (guestfs_h *g,\n"
10922 "\t\tconst char *path);\n"
10927 #: ../src/guestfs-actions.pod:3967 ../fish/guestfish-actions.pod:3061
10928 msgid "This command reads the target of a symbolic link."
10932 #: ../src/guestfs-actions.pod:3972
10933 msgid "guestfs_readlinklist"
10937 #: ../src/guestfs-actions.pod:3974
10940 " char **guestfs_readlinklist (guestfs_h *g,\n"
10941 "\t\tconst char *path,\n"
10942 "\t\tchar *const *names);\n"
10947 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:3067
10949 "This call allows you to do a C<readlink> operation on multiple files, where "
10950 "all files are in the directory C<path>. C<names> is the list of files from "
10955 #: ../src/guestfs-actions.pod:3982 ../fish/guestfish-actions.pod:3071
10957 "On return you get a list of strings, with a one-to-one correspondence to the "
10958 "C<names> list. Each string is the value of the symbolic link."
10962 #: ../src/guestfs-actions.pod:3986 ../fish/guestfish-actions.pod:3075
10964 "If the C<readlink(2)> operation fails on any name, then the corresponding "
10965 "result string is the empty string C<\"\">. However the whole operation is "
10966 "completed even if there were C<readlink(2)> errors, and so you can call this "
10967 "function with names where you don't know if they are symbolic links already "
10968 "(albeit slightly less efficient)."
10972 #: ../src/guestfs-actions.pod:3993 ../fish/guestfish-actions.pod:3082
10974 "This call is intended for programs that want to efficiently list a directory "
10975 "contents without making many round-trips. Very long directory listings "
10976 "might cause the protocol message size to be exceeded, causing this call to "
10977 "fail. The caller must split up such requests into smaller groups of names."
10981 #: ../src/guestfs-actions.pod:4004
10982 msgid "guestfs_realpath"
10986 #: ../src/guestfs-actions.pod:4006
10989 " char *guestfs_realpath (guestfs_h *g,\n"
10990 "\t\tconst char *path);\n"
10995 #: ../src/guestfs-actions.pod:4009 ../fish/guestfish-actions.pod:3093
10997 "Return the canonicalized absolute pathname of C<path>. The returned path "
10998 "has no C<.>, C<..> or symbolic link path elements."
11002 #: ../src/guestfs-actions.pod:4015
11003 msgid "guestfs_removexattr"
11007 #: ../src/guestfs-actions.pod:4017
11010 " int guestfs_removexattr (guestfs_h *g,\n"
11011 "\t\tconst char *xattr,\n"
11012 "\t\tconst char *path);\n"
11017 #: ../src/guestfs-actions.pod:4021 ../fish/guestfish-actions.pod:3100
11019 "This call removes the extended attribute named C<xattr> of the file C<path>."
11023 #: ../src/guestfs-actions.pod:4024
11024 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11028 #: ../src/guestfs-actions.pod:4028
11029 msgid "guestfs_resize2fs"
11033 #: ../src/guestfs-actions.pod:4030
11036 " int guestfs_resize2fs (guestfs_h *g,\n"
11037 "\t\tconst char *device);\n"
11042 #: ../src/guestfs-actions.pod:4033 ../fish/guestfish-actions.pod:3109
11044 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11045 "underlying device."
11049 #: ../src/guestfs-actions.pod:4036
11051 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11052 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11053 "sometimes gives an error about this and sometimes not. In any case, it is "
11054 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11058 #: ../src/guestfs-actions.pod:4044
11059 msgid "guestfs_resize2fs_size"
11063 #: ../src/guestfs-actions.pod:4046
11066 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11067 "\t\tconst char *device,\n"
11068 "\t\tint64_t size);\n"
11073 #: ../src/guestfs-actions.pod:4050
11075 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11076 "to specify the new size (in bytes) explicitly."
11080 #: ../src/guestfs-actions.pod:4055
11085 #: ../src/guestfs-actions.pod:4057
11088 " int guestfs_rm (guestfs_h *g,\n"
11089 "\t\tconst char *path);\n"
11094 #: ../src/guestfs-actions.pod:4060 ../fish/guestfish-actions.pod:3129
11095 msgid "Remove the single file C<path>."
11099 #: ../src/guestfs-actions.pod:4064
11100 msgid "guestfs_rm_rf"
11104 #: ../src/guestfs-actions.pod:4066
11107 " int guestfs_rm_rf (guestfs_h *g,\n"
11108 "\t\tconst char *path);\n"
11113 #: ../src/guestfs-actions.pod:4069 ../fish/guestfish-actions.pod:3135
11115 "Remove the file or directory C<path>, recursively removing the contents if "
11116 "its a directory. This is like the C<rm -rf> shell command."
11120 #: ../src/guestfs-actions.pod:4075
11121 msgid "guestfs_rmdir"
11125 #: ../src/guestfs-actions.pod:4077
11128 " int guestfs_rmdir (guestfs_h *g,\n"
11129 "\t\tconst char *path);\n"
11134 #: ../src/guestfs-actions.pod:4080 ../fish/guestfish-actions.pod:3143
11135 msgid "Remove the single directory C<path>."
11139 #: ../src/guestfs-actions.pod:4084
11140 msgid "guestfs_rmmountpoint"
11144 #: ../src/guestfs-actions.pod:4086
11147 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11148 "\t\tconst char *exemptpath);\n"
11153 #: ../src/guestfs-actions.pod:4089
11155 "This calls removes a mountpoint that was previously created with "
11156 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11160 #: ../src/guestfs-actions.pod:4095
11161 msgid "guestfs_scrub_device"
11165 #: ../src/guestfs-actions.pod:4097
11168 " int guestfs_scrub_device (guestfs_h *g,\n"
11169 "\t\tconst char *device);\n"
11174 #: ../src/guestfs-actions.pod:4100 ../fish/guestfish-actions.pod:3157
11176 "This command writes patterns over C<device> to make data retrieval more "
11181 #: ../src/guestfs-actions.pod:4103 ../src/guestfs-actions.pod:4121
11182 #: ../src/guestfs-actions.pod:4137 ../fish/guestfish-actions.pod:3160
11183 #: ../fish/guestfish-actions.pod:3175 ../fish/guestfish-actions.pod:3188
11185 "It is an interface to the L<scrub(1)> program. See that manual page for "
11190 #: ../src/guestfs-actions.pod:4111
11191 msgid "guestfs_scrub_file"
11195 #: ../src/guestfs-actions.pod:4113
11198 " int guestfs_scrub_file (guestfs_h *g,\n"
11199 "\t\tconst char *file);\n"
11204 #: ../src/guestfs-actions.pod:4116 ../fish/guestfish-actions.pod:3170
11206 "This command writes patterns over a file to make data retrieval more "
11211 #: ../src/guestfs-actions.pod:4119 ../fish/guestfish-actions.pod:3173
11212 msgid "The file is I<removed> after scrubbing."
11216 #: ../src/guestfs-actions.pod:4126
11217 msgid "guestfs_scrub_freespace"
11221 #: ../src/guestfs-actions.pod:4128
11224 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11225 "\t\tconst char *dir);\n"
11230 #: ../src/guestfs-actions.pod:4131
11232 "This command creates the directory C<dir> and then fills it with files until "
11233 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11234 "and deletes them. The intention is to scrub any free space on the partition "
11235 "containing C<dir>."
11239 #: ../src/guestfs-actions.pod:4142
11240 msgid "guestfs_set_append"
11244 #: ../src/guestfs-actions.pod:4144
11247 " int guestfs_set_append (guestfs_h *g,\n"
11248 "\t\tconst char *append);\n"
11253 #: ../src/guestfs-actions.pod:4147 ../fish/guestfish-actions.pod:3195
11255 "This function is used to add additional options to the guest kernel command "
11260 #: ../src/guestfs-actions.pod:4150 ../fish/guestfish-actions.pod:3198
11262 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11263 "environment variable."
11267 #: ../src/guestfs-actions.pod:4153 ../fish/guestfish-actions.pod:3201
11269 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11270 "(libguestfs always adds a few of its own)."
11274 #: ../src/guestfs-actions.pod:4158
11275 msgid "guestfs_set_autosync"
11279 #: ../src/guestfs-actions.pod:4160
11282 " int guestfs_set_autosync (guestfs_h *g,\n"
11283 "\t\tint autosync);\n"
11288 #: ../src/guestfs-actions.pod:4163
11290 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11291 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11292 "the handle is closed (also if the program exits without closing handles)."
11296 #: ../src/guestfs-actions.pod:4168 ../fish/guestfish-actions.pod:3213
11298 "This is disabled by default (except in guestfish where it is enabled by "
11303 #: ../src/guestfs-actions.pod:4173
11304 msgid "guestfs_set_direct"
11308 #: ../src/guestfs-actions.pod:4175
11311 " int guestfs_set_direct (guestfs_h *g,\n"
11312 "\t\tint direct);\n"
11317 #: ../src/guestfs-actions.pod:4178 ../fish/guestfish-actions.pod:3220
11319 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11320 "passed directly through to the appliance once it is launched."
11324 #: ../src/guestfs-actions.pod:4182
11326 "One consequence of this is that log messages aren't caught by the library "
11327 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11332 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:3228
11333 msgid "You probably don't want to use this unless you know what you are doing."
11337 #: ../src/guestfs-actions.pod:4189 ../fish/guestfish-actions.pod:3231
11338 msgid "The default is disabled."
11342 #: ../src/guestfs-actions.pod:4193
11343 msgid "guestfs_set_e2label"
11347 #: ../src/guestfs-actions.pod:4195
11350 " int guestfs_set_e2label (guestfs_h *g,\n"
11351 "\t\tconst char *device,\n"
11352 "\t\tconst char *label);\n"
11357 #: ../src/guestfs-actions.pod:4199 ../fish/guestfish-actions.pod:3237
11359 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11360 "C<label>. Filesystem labels are limited to 16 characters."
11364 #: ../src/guestfs-actions.pod:4203
11366 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11367 "the existing label on a filesystem."
11371 #: ../src/guestfs-actions.pod:4208
11372 msgid "guestfs_set_e2uuid"
11376 #: ../src/guestfs-actions.pod:4210
11379 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11380 "\t\tconst char *device,\n"
11381 "\t\tconst char *uuid);\n"
11386 #: ../src/guestfs-actions.pod:4214 ../fish/guestfish-actions.pod:3248
11388 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11389 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11390 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11394 #: ../src/guestfs-actions.pod:4219
11396 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11397 "the existing UUID of a filesystem."
11401 #: ../src/guestfs-actions.pod:4224
11402 msgid "guestfs_set_memsize"
11406 #: ../src/guestfs-actions.pod:4226
11409 " int guestfs_set_memsize (guestfs_h *g,\n"
11410 "\t\tint memsize);\n"
11415 #: ../src/guestfs-actions.pod:4229
11417 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11418 "This only has any effect if called before C<guestfs_launch>."
11422 #: ../src/guestfs-actions.pod:4233 ../fish/guestfish-actions.pod:3264
11424 "You can also change this by setting the environment variable "
11425 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11429 #: ../src/guestfs-actions.pod:4242
11430 msgid "guestfs_set_network"
11434 #: ../src/guestfs-actions.pod:4244
11437 " int guestfs_set_network (guestfs_h *g,\n"
11438 "\t\tint network);\n"
11443 #: ../src/guestfs-actions.pod:4247 ../fish/guestfish-actions.pod:3275
11445 "If C<network> is true, then the network is enabled in the libguestfs "
11446 "appliance. The default is false."
11450 #: ../src/guestfs-actions.pod:4250 ../fish/guestfish-actions.pod:3278
11452 "This affects whether commands are able to access the network (see L<guestfs"
11453 "(3)/RUNNING COMMANDS>)."
11457 #: ../src/guestfs-actions.pod:4253
11459 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11464 #: ../src/guestfs-actions.pod:4258
11465 msgid "guestfs_set_path"
11469 #: ../src/guestfs-actions.pod:4260
11472 " int guestfs_set_path (guestfs_h *g,\n"
11473 "\t\tconst char *searchpath);\n"
11478 #: ../src/guestfs-actions.pod:4263 ../fish/guestfish-actions.pod:3288
11479 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11483 #: ../src/guestfs-actions.pod:4265 ../fish/guestfish-actions.pod:3290
11485 "The default is C<$libdir/guestfs> unless overridden by setting "
11486 "C<LIBGUESTFS_PATH> environment variable."
11490 #: ../src/guestfs-actions.pod:4268 ../fish/guestfish-actions.pod:3293
11491 msgid "Setting C<path> to C<NULL> restores the default path."
11495 #: ../src/guestfs-actions.pod:4272
11496 msgid "guestfs_set_qemu"
11500 #: ../src/guestfs-actions.pod:4274
11503 " int guestfs_set_qemu (guestfs_h *g,\n"
11504 "\t\tconst char *qemu);\n"
11509 #: ../src/guestfs-actions.pod:4277 ../fish/guestfish-actions.pod:3299
11510 msgid "Set the qemu binary that we will use."
11514 #: ../src/guestfs-actions.pod:4279 ../fish/guestfish-actions.pod:3301
11516 "The default is chosen when the library was compiled by the configure script."
11520 #: ../src/guestfs-actions.pod:4282 ../fish/guestfish-actions.pod:3304
11522 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11527 #: ../src/guestfs-actions.pod:4285 ../fish/guestfish-actions.pod:3307
11528 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11532 #: ../src/guestfs-actions.pod:4287 ../fish/guestfish-actions.pod:3309
11534 "Note that you should call this function as early as possible after creating "
11535 "the handle. This is because some pre-launch operations depend on testing "
11536 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11537 "don't retest features, and so you might see inconsistent results. Using the "
11538 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11539 "the qemu binary at the same time as the handle is created."
11543 #: ../src/guestfs-actions.pod:4297
11544 msgid "guestfs_set_recovery_proc"
11548 #: ../src/guestfs-actions.pod:4299
11551 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11552 "\t\tint recoveryproc);\n"
11557 #: ../src/guestfs-actions.pod:4302
11559 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11560 "not create a recovery process. The purpose of the recovery process is to "
11561 "stop runaway qemu processes in the case where the main program aborts "
11566 #: ../src/guestfs-actions.pod:4307
11568 "This only has any effect if called before C<guestfs_launch>, and the default "
11573 #: ../src/guestfs-actions.pod:4310 ../fish/guestfish-actions.pod:3329
11575 "About the only time when you would want to disable this is if the main "
11576 "process will fork itself into the background (\"daemonize\" itself). In "
11577 "this case the recovery process thinks that the main program has disappeared "
11578 "and so kills qemu, which is not very helpful."
11582 #: ../src/guestfs-actions.pod:4318
11583 msgid "guestfs_set_selinux"
11587 #: ../src/guestfs-actions.pod:4320
11590 " int guestfs_set_selinux (guestfs_h *g,\n"
11591 "\t\tint selinux);\n"
11596 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:3339
11598 "This sets the selinux flag that is passed to the appliance at boot time. "
11599 "The default is C<selinux=0> (disabled)."
11603 #: ../src/guestfs-actions.pod:4326 ../fish/guestfish-actions.pod:3342
11605 "Note that if SELinux is enabled, it is always in Permissive mode "
11606 "(C<enforcing=0>)."
11610 #: ../src/guestfs-actions.pod:4334
11611 msgid "guestfs_set_trace"
11615 #: ../src/guestfs-actions.pod:4336
11618 " int guestfs_set_trace (guestfs_h *g,\n"
11619 "\t\tint trace);\n"
11624 #: ../src/guestfs-actions.pod:4339 ../fish/guestfish-actions.pod:3352
11626 "If the command trace flag is set to 1, then commands are printed on stderr "
11627 "before they are executed in a format which is very similar to the one used "
11628 "by guestfish. In other words, you can run a program with this enabled, and "
11629 "you will get out a script which you can feed to guestfish to perform the "
11630 "same set of actions."
11634 #: ../src/guestfs-actions.pod:4346 ../fish/guestfish-actions.pod:3359
11636 "If you want to trace C API calls into libguestfs (and other libraries) then "
11637 "possibly a better way is to use the external ltrace(1) command."
11641 #: ../src/guestfs-actions.pod:4350 ../fish/guestfish-actions.pod:3363
11643 "Command traces are disabled unless the environment variable "
11644 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
11648 #: ../src/guestfs-actions.pod:4355
11649 msgid "guestfs_set_verbose"
11653 #: ../src/guestfs-actions.pod:4357
11656 " int guestfs_set_verbose (guestfs_h *g,\n"
11657 "\t\tint verbose);\n"
11662 #: ../src/guestfs-actions.pod:4360 ../fish/guestfish-actions.pod:3370
11663 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
11667 #: ../src/guestfs-actions.pod:4362 ../fish/guestfish-actions.pod:3372
11669 "Verbose messages are disabled unless the environment variable "
11670 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
11674 #: ../src/guestfs-actions.pod:4367
11675 msgid "guestfs_setcon"
11679 #: ../src/guestfs-actions.pod:4369
11682 " int guestfs_setcon (guestfs_h *g,\n"
11683 "\t\tconst char *context);\n"
11688 #: ../src/guestfs-actions.pod:4372 ../fish/guestfish-actions.pod:3379
11690 "This sets the SELinux security context of the daemon to the string "
11695 #: ../src/guestfs-actions.pod:4375 ../fish/guestfish-actions.pod:3382
11696 msgid "See the documentation about SELINUX in L<guestfs(3)>."
11700 #: ../src/guestfs-actions.pod:4379
11701 msgid "guestfs_setxattr"
11705 #: ../src/guestfs-actions.pod:4381
11708 " int guestfs_setxattr (guestfs_h *g,\n"
11709 "\t\tconst char *xattr,\n"
11710 "\t\tconst char *val,\n"
11711 "\t\tint vallen,\n"
11712 "\t\tconst char *path);\n"
11717 #: ../src/guestfs-actions.pod:4387 ../fish/guestfish-actions.pod:3388
11719 "This call sets the extended attribute named C<xattr> of the file C<path> to "
11720 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
11724 #: ../src/guestfs-actions.pod:4391
11725 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
11729 #: ../src/guestfs-actions.pod:4395
11730 msgid "guestfs_sfdisk"
11734 #: ../src/guestfs-actions.pod:4397
11737 " int guestfs_sfdisk (guestfs_h *g,\n"
11738 "\t\tconst char *device,\n"
11741 "\t\tint sectors,\n"
11742 "\t\tchar *const *lines);\n"
11747 #: ../src/guestfs-actions.pod:4404 ../fish/guestfish-actions.pod:3398
11749 "This is a direct interface to the L<sfdisk(8)> program for creating "
11750 "partitions on block devices."
11754 #: ../src/guestfs-actions.pod:4407 ../fish/guestfish-actions.pod:3401
11755 msgid "C<device> should be a block device, for example C</dev/sda>."
11759 #: ../src/guestfs-actions.pod:4409 ../fish/guestfish-actions.pod:3403
11761 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
11762 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
11763 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
11764 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
11765 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
11766 "the kernel) cannot work out the right geometry and you will need to tell it."
11770 #: ../src/guestfs-actions.pod:4417 ../fish/guestfish-actions.pod:3411
11772 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
11773 "refer to the L<sfdisk(8)> manpage."
11777 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:3414
11779 "To create a single partition occupying the whole disk, you would pass "
11780 "C<lines> as a single element list, when the single element being the string "
11785 #: ../src/guestfs-actions.pod:4424
11787 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
11791 #: ../src/guestfs-actions.pod:4432
11792 msgid "guestfs_sfdiskM"
11796 #: ../src/guestfs-actions.pod:4434
11799 " int guestfs_sfdiskM (guestfs_h *g,\n"
11800 "\t\tconst char *device,\n"
11801 "\t\tchar *const *lines);\n"
11806 #: ../src/guestfs-actions.pod:4438
11808 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
11809 "partition sizes are specified in megabytes only (rounded to the nearest "
11810 "cylinder) and you don't need to specify the cyls, heads and sectors "
11811 "parameters which were rarely if ever used anyway."
11815 #: ../src/guestfs-actions.pod:4444
11817 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
11818 "C<guestfs_part_disk>"
11822 #: ../src/guestfs-actions.pod:4452
11823 msgid "guestfs_sfdisk_N"
11827 #: ../src/guestfs-actions.pod:4454
11830 " int guestfs_sfdisk_N (guestfs_h *g,\n"
11831 "\t\tconst char *device,\n"
11832 "\t\tint partnum,\n"
11835 "\t\tint sectors,\n"
11836 "\t\tconst char *line);\n"
11841 #: ../src/guestfs-actions.pod:4462 ../fish/guestfish-actions.pod:3444
11843 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
11844 "(note: C<n> counts from 1)."
11848 #: ../src/guestfs-actions.pod:4465
11850 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
11851 "for the cyls/heads/sectors parameters."
11855 #: ../src/guestfs-actions.pod:4468
11856 msgid "See also: C<guestfs_part_add>"
11860 #: ../src/guestfs-actions.pod:4475
11861 msgid "guestfs_sfdisk_disk_geometry"
11865 #: ../src/guestfs-actions.pod:4477
11868 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
11869 "\t\tconst char *device);\n"
11874 #: ../src/guestfs-actions.pod:4480
11876 "This displays the disk geometry of C<device> read from the partition table. "
11877 "Especially in the case where the underlying block device has been resized, "
11878 "this can be different from the kernel's idea of the geometry (see "
11879 "C<guestfs_sfdisk_kernel_geometry>)."
11883 #: ../src/guestfs-actions.pod:4485 ../src/guestfs-actions.pod:4498
11884 #: ../fish/guestfish-actions.pod:3464 ../fish/guestfish-actions.pod:3473
11885 msgid "The result is in human-readable format, and not designed to be parsed."
11889 #: ../src/guestfs-actions.pod:4491
11890 msgid "guestfs_sfdisk_kernel_geometry"
11894 #: ../src/guestfs-actions.pod:4493
11897 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
11898 "\t\tconst char *device);\n"
11903 #: ../src/guestfs-actions.pod:4496 ../fish/guestfish-actions.pod:3471
11904 msgid "This displays the kernel's idea of the geometry of C<device>."
11908 #: ../src/guestfs-actions.pod:4504
11909 msgid "guestfs_sfdisk_l"
11913 #: ../src/guestfs-actions.pod:4506
11916 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
11917 "\t\tconst char *device);\n"
11922 #: ../src/guestfs-actions.pod:4509 ../fish/guestfish-actions.pod:3480
11924 "This displays the partition table on C<device>, in the human-readable output "
11925 "of the L<sfdisk(8)> command. It is not intended to be parsed."
11929 #: ../src/guestfs-actions.pod:4513
11930 msgid "See also: C<guestfs_part_list>"
11934 #: ../src/guestfs-actions.pod:4518
11939 #: ../src/guestfs-actions.pod:4520
11942 " char *guestfs_sh (guestfs_h *g,\n"
11943 "\t\tconst char *command);\n"
11948 #: ../src/guestfs-actions.pod:4523 ../fish/guestfish-actions.pod:3490
11950 "This call runs a command from the guest filesystem via the guest's C</bin/"
11955 #: ../src/guestfs-actions.pod:4526
11956 msgid "This is like C<guestfs_command>, but passes the command to:"
11960 #: ../src/guestfs-actions.pod:4528 ../fish/guestfish-actions.pod:3495
11963 " /bin/sh -c \"command\"\n"
11968 #: ../src/guestfs-actions.pod:4530 ../fish/guestfish-actions.pod:3497
11970 "Depending on the guest's shell, this usually results in wildcards being "
11971 "expanded, shell expressions being interpolated and so on."
11975 #: ../src/guestfs-actions.pod:4534
11976 msgid "All the provisos about C<guestfs_command> apply to this call."
11980 #: ../src/guestfs-actions.pod:4539
11981 msgid "guestfs_sh_lines"
11985 #: ../src/guestfs-actions.pod:4541
11988 " char **guestfs_sh_lines (guestfs_h *g,\n"
11989 "\t\tconst char *command);\n"
11994 #: ../src/guestfs-actions.pod:4544
11996 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12001 #: ../src/guestfs-actions.pod:4547
12002 msgid "See also: C<guestfs_command_lines>"
12006 #: ../src/guestfs-actions.pod:4553
12007 msgid "guestfs_sleep"
12011 #: ../src/guestfs-actions.pod:4555
12014 " int guestfs_sleep (guestfs_h *g,\n"
12020 #: ../src/guestfs-actions.pod:4558 ../fish/guestfish-actions.pod:3516
12021 msgid "Sleep for C<secs> seconds."
12025 #: ../src/guestfs-actions.pod:4562 ../src/guestfs-structs.pod:109
12026 msgid "guestfs_stat"
12030 #: ../src/guestfs-actions.pod:4564
12033 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12034 "\t\tconst char *path);\n"
12039 #: ../src/guestfs-actions.pod:4569 ../fish/guestfish-actions.pod:3524
12040 msgid "This is the same as the C<stat(2)> system call."
12044 #: ../src/guestfs-actions.pod:4575 ../src/guestfs-structs.pod:135
12045 msgid "guestfs_statvfs"
12049 #: ../src/guestfs-actions.pod:4577
12052 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12053 "\t\tconst char *path);\n"
12058 #: ../src/guestfs-actions.pod:4580 ../fish/guestfish-actions.pod:3530
12060 "Returns file system statistics for any mounted file system. C<path> should "
12061 "be a file or directory in the mounted file system (typically it is the mount "
12062 "point itself, but it doesn't need to be)."
12066 #: ../src/guestfs-actions.pod:4584 ../fish/guestfish-actions.pod:3534
12067 msgid "This is the same as the C<statvfs(2)> system call."
12071 #: ../src/guestfs-actions.pod:4586
12073 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12074 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12078 #: ../src/guestfs-actions.pod:4590
12079 msgid "guestfs_strings"
12083 #: ../src/guestfs-actions.pod:4592
12086 " char **guestfs_strings (guestfs_h *g,\n"
12087 "\t\tconst char *path);\n"
12092 #: ../src/guestfs-actions.pod:4595 ../fish/guestfish-actions.pod:3540
12094 "This runs the L<strings(1)> command on a file and returns the list of "
12095 "printable strings found."
12099 #: ../src/guestfs-actions.pod:4605
12100 msgid "guestfs_strings_e"
12104 #: ../src/guestfs-actions.pod:4607
12107 " char **guestfs_strings_e (guestfs_h *g,\n"
12108 "\t\tconst char *encoding,\n"
12109 "\t\tconst char *path);\n"
12114 #: ../src/guestfs-actions.pod:4611
12116 "This is like the C<guestfs_strings> command, but allows you to specify the "
12117 "encoding of strings that are looked for in the source file C<path>."
12121 #: ../src/guestfs-actions.pod:4615 ../fish/guestfish-actions.pod:3554
12122 msgid "Allowed encodings are:"
12126 #: ../src/guestfs-actions.pod:4619 ../fish/guestfish-actions.pod:3558
12131 #: ../src/guestfs-actions.pod:4621
12133 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12134 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12138 #: ../src/guestfs-actions.pod:4624 ../fish/guestfish-actions.pod:3563
12143 #: ../src/guestfs-actions.pod:4626 ../fish/guestfish-actions.pod:3565
12144 msgid "Single 8-bit-byte characters."
12148 #: ../src/guestfs-actions.pod:4628 ../fish/guestfish-actions.pod:3567
12153 #: ../src/guestfs-actions.pod:4630 ../fish/guestfish-actions.pod:3569
12154 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12158 #: ../src/guestfs-actions.pod:4633 ../fish/guestfish-actions.pod:3572
12159 msgid "l (lower case letter L)"
12163 #: ../src/guestfs-actions.pod:4635 ../fish/guestfish-actions.pod:3574
12165 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12166 "examining binaries in Windows guests."
12170 #: ../src/guestfs-actions.pod:4638 ../fish/guestfish-actions.pod:3577
12175 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3579
12176 msgid "32-bit big endian such as UCS-4BE."
12180 #: ../src/guestfs-actions.pod:4642 ../fish/guestfish-actions.pod:3581
12185 #: ../src/guestfs-actions.pod:4644 ../fish/guestfish-actions.pod:3583
12186 msgid "32-bit little endian such as UCS-4LE."
12190 #: ../src/guestfs-actions.pod:4648 ../fish/guestfish-actions.pod:3587
12191 msgid "The returned strings are transcoded to UTF-8."
12195 #: ../src/guestfs-actions.pod:4657
12196 msgid "guestfs_swapoff_device"
12200 #: ../src/guestfs-actions.pod:4659
12203 " int guestfs_swapoff_device (guestfs_h *g,\n"
12204 "\t\tconst char *device);\n"
12209 #: ../src/guestfs-actions.pod:4662
12211 "This command disables the libguestfs appliance swap device or partition "
12212 "named C<device>. See C<guestfs_swapon_device>."
12216 #: ../src/guestfs-actions.pod:4668
12217 msgid "guestfs_swapoff_file"
12221 #: ../src/guestfs-actions.pod:4670
12224 " int guestfs_swapoff_file (guestfs_h *g,\n"
12225 "\t\tconst char *file);\n"
12230 #: ../src/guestfs-actions.pod:4673 ../fish/guestfish-actions.pod:3604
12231 msgid "This command disables the libguestfs appliance swap on file."
12235 #: ../src/guestfs-actions.pod:4677
12236 msgid "guestfs_swapoff_label"
12240 #: ../src/guestfs-actions.pod:4679
12243 " int guestfs_swapoff_label (guestfs_h *g,\n"
12244 "\t\tconst char *label);\n"
12249 #: ../src/guestfs-actions.pod:4682 ../fish/guestfish-actions.pod:3610
12251 "This command disables the libguestfs appliance swap on labeled swap "
12256 #: ../src/guestfs-actions.pod:4687
12257 msgid "guestfs_swapoff_uuid"
12261 #: ../src/guestfs-actions.pod:4689
12264 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12265 "\t\tconst char *uuid);\n"
12270 #: ../src/guestfs-actions.pod:4692 ../fish/guestfish-actions.pod:3617
12272 "This command disables the libguestfs appliance swap partition with the given "
12277 #: ../src/guestfs-actions.pod:4697
12278 msgid "guestfs_swapon_device"
12282 #: ../src/guestfs-actions.pod:4699
12285 " int guestfs_swapon_device (guestfs_h *g,\n"
12286 "\t\tconst char *device);\n"
12291 #: ../src/guestfs-actions.pod:4702
12293 "This command enables the libguestfs appliance to use the swap device or "
12294 "partition named C<device>. The increased memory is made available for all "
12295 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12299 #: ../src/guestfs-actions.pod:4707 ../fish/guestfish-actions.pod:3629
12301 "Note that you should not swap to existing guest swap partitions unless you "
12302 "know what you are doing. They may contain hibernation information, or other "
12303 "information that the guest doesn't want you to trash. You also risk leaking "
12304 "information about the host to the guest this way. Instead, attach a new "
12305 "host device to the guest and swap on that."
12309 #: ../src/guestfs-actions.pod:4716
12310 msgid "guestfs_swapon_file"
12314 #: ../src/guestfs-actions.pod:4718
12317 " int guestfs_swapon_file (guestfs_h *g,\n"
12318 "\t\tconst char *file);\n"
12323 #: ../src/guestfs-actions.pod:4721
12325 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12330 #: ../src/guestfs-actions.pod:4726
12331 msgid "guestfs_swapon_label"
12335 #: ../src/guestfs-actions.pod:4728
12338 " int guestfs_swapon_label (guestfs_h *g,\n"
12339 "\t\tconst char *label);\n"
12344 #: ../src/guestfs-actions.pod:4731
12346 "This command enables swap to a labeled swap partition. See "
12347 "C<guestfs_swapon_device> for other notes."
12351 #: ../src/guestfs-actions.pod:4736
12352 msgid "guestfs_swapon_uuid"
12356 #: ../src/guestfs-actions.pod:4738
12359 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12360 "\t\tconst char *uuid);\n"
12365 #: ../src/guestfs-actions.pod:4741
12367 "This command enables swap to a swap partition with the given UUID. See "
12368 "C<guestfs_swapon_device> for other notes."
12372 #: ../src/guestfs-actions.pod:4746
12373 msgid "guestfs_sync"
12377 #: ../src/guestfs-actions.pod:4748
12380 " int guestfs_sync (guestfs_h *g);\n"
12385 #: ../src/guestfs-actions.pod:4750 ../fish/guestfish-actions.pod:3661
12387 "This syncs the disk, so that any writes are flushed through to the "
12388 "underlying disk image."
12392 #: ../src/guestfs-actions.pod:4753 ../fish/guestfish-actions.pod:3664
12394 "You should always call this if you have modified a disk image, before "
12395 "closing the handle."
12399 #: ../src/guestfs-actions.pod:4758
12400 msgid "guestfs_tail"
12404 #: ../src/guestfs-actions.pod:4760
12407 " char **guestfs_tail (guestfs_h *g,\n"
12408 "\t\tconst char *path);\n"
12413 #: ../src/guestfs-actions.pod:4763 ../fish/guestfish-actions.pod:3671
12415 "This command returns up to the last 10 lines of a file as a list of strings."
12419 #: ../src/guestfs-actions.pod:4773
12420 msgid "guestfs_tail_n"
12424 #: ../src/guestfs-actions.pod:4775
12427 " char **guestfs_tail_n (guestfs_h *g,\n"
12428 "\t\tint nrlines,\n"
12429 "\t\tconst char *path);\n"
12434 #: ../src/guestfs-actions.pod:4779 ../fish/guestfish-actions.pod:3681
12436 "If the parameter C<nrlines> is a positive number, this returns the last "
12437 "C<nrlines> lines of the file C<path>."
12441 #: ../src/guestfs-actions.pod:4782 ../fish/guestfish-actions.pod:3684
12443 "If the parameter C<nrlines> is a negative number, this returns lines from "
12444 "the file C<path>, starting with the C<-nrlines>th line."
12448 #: ../src/guestfs-actions.pod:4794
12449 msgid "guestfs_tar_in"
12453 #: ../src/guestfs-actions.pod:4796
12456 " int guestfs_tar_in (guestfs_h *g,\n"
12457 "\t\tconst char *tarfile,\n"
12458 "\t\tconst char *directory);\n"
12463 #: ../src/guestfs-actions.pod:4800 ../fish/guestfish-actions.pod:3696
12465 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12466 "tar file) into C<directory>."
12470 #: ../src/guestfs-actions.pod:4803
12472 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12476 #: ../src/guestfs-actions.pod:4808
12477 msgid "guestfs_tar_out"
12481 #: ../src/guestfs-actions.pod:4810
12484 " int guestfs_tar_out (guestfs_h *g,\n"
12485 "\t\tconst char *directory,\n"
12486 "\t\tconst char *tarfile);\n"
12491 #: ../src/guestfs-actions.pod:4814 ../fish/guestfish-actions.pod:3708
12493 "This command packs the contents of C<directory> and downloads it to local "
12498 #: ../src/guestfs-actions.pod:4817
12500 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12501 "C<guestfs_txz_out>."
12505 #: ../src/guestfs-actions.pod:4822
12506 msgid "guestfs_tgz_in"
12510 #: ../src/guestfs-actions.pod:4824
12513 " int guestfs_tgz_in (guestfs_h *g,\n"
12514 "\t\tconst char *tarball,\n"
12515 "\t\tconst char *directory);\n"
12520 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3720
12522 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12523 "tar file) into C<directory>."
12527 #: ../src/guestfs-actions.pod:4831
12528 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12532 #: ../src/guestfs-actions.pod:4835
12533 msgid "guestfs_tgz_out"
12537 #: ../src/guestfs-actions.pod:4837
12540 " int guestfs_tgz_out (guestfs_h *g,\n"
12541 "\t\tconst char *directory,\n"
12542 "\t\tconst char *tarball);\n"
12547 #: ../src/guestfs-actions.pod:4841 ../fish/guestfish-actions.pod:3731
12549 "This command packs the contents of C<directory> and downloads it to local "
12554 #: ../src/guestfs-actions.pod:4844
12555 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12559 #: ../src/guestfs-actions.pod:4848
12560 msgid "guestfs_touch"
12564 #: ../src/guestfs-actions.pod:4850
12567 " int guestfs_touch (guestfs_h *g,\n"
12568 "\t\tconst char *path);\n"
12573 #: ../src/guestfs-actions.pod:4853 ../fish/guestfish-actions.pod:3742
12575 "Touch acts like the L<touch(1)> command. It can be used to update the "
12576 "timestamps on a file, or, if the file does not exist, to create a new zero-"
12581 #: ../src/guestfs-actions.pod:4857 ../fish/guestfish-actions.pod:3746
12583 "This command only works on regular files, and will fail on other file types "
12584 "such as directories, symbolic links, block special etc."
12588 #: ../src/guestfs-actions.pod:4862
12589 msgid "guestfs_truncate"
12593 #: ../src/guestfs-actions.pod:4864
12596 " int guestfs_truncate (guestfs_h *g,\n"
12597 "\t\tconst char *path);\n"
12602 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3753
12604 "This command truncates C<path> to a zero-length file. The file must exist "
12609 #: ../src/guestfs-actions.pod:4872
12610 msgid "guestfs_truncate_size"
12614 #: ../src/guestfs-actions.pod:4874
12617 " int guestfs_truncate_size (guestfs_h *g,\n"
12618 "\t\tconst char *path,\n"
12619 "\t\tint64_t size);\n"
12624 #: ../src/guestfs-actions.pod:4878 ../fish/guestfish-actions.pod:3760
12626 "This command truncates C<path> to size C<size> bytes. The file must exist "
12631 #: ../src/guestfs-actions.pod:4881
12633 "If the current file size is less than C<size> then the file is extended to "
12634 "the required size with zero bytes. This creates a sparse file (ie. disk "
12635 "blocks are not allocated for the file until you write to it). To create a "
12636 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
12640 #: ../src/guestfs-actions.pod:4889
12641 msgid "guestfs_tune2fs_l"
12645 #: ../src/guestfs-actions.pod:4891
12648 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
12649 "\t\tconst char *device);\n"
12654 #: ../src/guestfs-actions.pod:4894 ../fish/guestfish-actions.pod:3773
12656 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
12661 #: ../src/guestfs-actions.pod:4897 ../fish/guestfish-actions.pod:3776
12663 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
12664 "for more details. The list of fields returned isn't clearly defined, and "
12665 "depends on both the version of C<tune2fs> that libguestfs was built against, "
12666 "and the filesystem itself."
12670 #: ../src/guestfs-actions.pod:4908
12671 msgid "guestfs_txz_in"
12675 #: ../src/guestfs-actions.pod:4910
12678 " int guestfs_txz_in (guestfs_h *g,\n"
12679 "\t\tconst char *tarball,\n"
12680 "\t\tconst char *directory);\n"
12685 #: ../src/guestfs-actions.pod:4914 ../fish/guestfish-actions.pod:3785
12687 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
12688 "tar file) into C<directory>."
12692 #: ../src/guestfs-actions.pod:4919
12693 msgid "guestfs_txz_out"
12697 #: ../src/guestfs-actions.pod:4921
12700 " int guestfs_txz_out (guestfs_h *g,\n"
12701 "\t\tconst char *directory,\n"
12702 "\t\tconst char *tarball);\n"
12707 #: ../src/guestfs-actions.pod:4925 ../fish/guestfish-actions.pod:3794
12709 "This command packs the contents of C<directory> and downloads it to local "
12710 "file C<tarball> (as an xz compressed tar archive)."
12714 #: ../src/guestfs-actions.pod:4930
12715 msgid "guestfs_umask"
12719 #: ../src/guestfs-actions.pod:4932
12722 " int guestfs_umask (guestfs_h *g,\n"
12728 #: ../src/guestfs-actions.pod:4935 ../fish/guestfish-actions.pod:3803
12730 "This function sets the mask used for creating new files and device nodes to "
12735 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3806
12737 "Typical umask values would be C<022> which creates new files with "
12738 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
12739 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
12743 #: ../src/guestfs-actions.pod:4943 ../fish/guestfish-actions.pod:3811
12745 "The default umask is C<022>. This is important because it means that "
12746 "directories and device nodes will be created with C<0644> or C<0755> mode "
12747 "even if you specify C<0777>."
12751 #: ../src/guestfs-actions.pod:4947
12753 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
12754 "C<guestfs_mkdir>."
12758 #: ../src/guestfs-actions.pod:4950 ../fish/guestfish-actions.pod:3818
12759 msgid "This call returns the previous umask."
12763 #: ../src/guestfs-actions.pod:4954
12764 msgid "guestfs_umount"
12768 #: ../src/guestfs-actions.pod:4956
12771 " int guestfs_umount (guestfs_h *g,\n"
12772 "\t\tconst char *pathordevice);\n"
12777 #: ../src/guestfs-actions.pod:4959 ../fish/guestfish-actions.pod:3824
12779 "This unmounts the given filesystem. The filesystem may be specified either "
12780 "by its mountpoint (path) or the device which contains the filesystem."
12784 #: ../src/guestfs-actions.pod:4965
12785 msgid "guestfs_umount_all"
12789 #: ../src/guestfs-actions.pod:4967
12792 " int guestfs_umount_all (guestfs_h *g);\n"
12797 #: ../src/guestfs-actions.pod:4969 ../fish/guestfish-actions.pod:3832
12798 msgid "This unmounts all mounted filesystems."
12802 #: ../src/guestfs-actions.pod:4971 ../fish/guestfish-actions.pod:3834
12803 msgid "Some internal mounts are not unmounted by this call."
12807 #: ../src/guestfs-actions.pod:4975
12808 msgid "guestfs_upload"
12812 #: ../src/guestfs-actions.pod:4977
12815 " int guestfs_upload (guestfs_h *g,\n"
12816 "\t\tconst char *filename,\n"
12817 "\t\tconst char *remotefilename);\n"
12822 #: ../src/guestfs-actions.pod:4981 ../fish/guestfish-actions.pod:3840
12823 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
12827 #: ../src/guestfs-actions.pod:4986
12828 msgid "See also C<guestfs_download>."
12832 #: ../src/guestfs-actions.pod:4990
12833 msgid "guestfs_utimens"
12837 #: ../src/guestfs-actions.pod:4992
12840 " int guestfs_utimens (guestfs_h *g,\n"
12841 "\t\tconst char *path,\n"
12842 "\t\tint64_t atsecs,\n"
12843 "\t\tint64_t atnsecs,\n"
12844 "\t\tint64_t mtsecs,\n"
12845 "\t\tint64_t mtnsecs);\n"
12850 #: ../src/guestfs-actions.pod:4999 ../fish/guestfish-actions.pod:3853
12851 msgid "This command sets the timestamps of a file with nanosecond precision."
12855 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3856
12857 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
12862 #: ../src/guestfs-actions.pod:5005 ../fish/guestfish-actions.pod:3859
12864 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
12865 "nanoseconds from the epoch."
12869 #: ../src/guestfs-actions.pod:5008 ../fish/guestfish-actions.pod:3862
12871 "If the C<*nsecs> field contains the special value C<-1> then the "
12872 "corresponding timestamp is set to the current time. (The C<*secs> field is "
12873 "ignored in this case)."
12877 #: ../src/guestfs-actions.pod:5012 ../fish/guestfish-actions.pod:3866
12879 "If the C<*nsecs> field contains the special value C<-2> then the "
12880 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
12885 #: ../src/guestfs-actions.pod:5018 ../src/guestfs-structs.pod:175
12886 msgid "guestfs_version"
12890 #: ../src/guestfs-actions.pod:5020
12893 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
12898 #: ../src/guestfs-actions.pod:5022 ../fish/guestfish-actions.pod:3874
12900 "Return the libguestfs version number that the program is linked against."
12904 #: ../src/guestfs-actions.pod:5025 ../fish/guestfish-actions.pod:3877
12906 "Note that because of dynamic linking this is not necessarily the version of "
12907 "libguestfs that you compiled against. You can compile the program, and then "
12908 "at runtime dynamically link against a completely different C<libguestfs.so> "
12913 #: ../src/guestfs-actions.pod:5030 ../fish/guestfish-actions.pod:3882
12915 "This call was added in version C<1.0.58>. In previous versions of "
12916 "libguestfs there was no way to get the version number. From C code you can "
12917 "use dynamic linker functions to find out if this symbol exists (if it "
12918 "doesn't, then it's an earlier version)."
12922 #: ../src/guestfs-actions.pod:5036 ../fish/guestfish-actions.pod:3888
12924 "The call returns a structure with four elements. The first three (C<major>, "
12925 "C<minor> and C<release>) are numbers and correspond to the usual version "
12926 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
12927 "but may be used for distro-specific information."
12931 #: ../src/guestfs-actions.pod:5042 ../fish/guestfish-actions.pod:3894
12933 "To construct the original version string: C<$major.$minor.$release$extra>"
12937 #: ../src/guestfs-actions.pod:5045 ../fish/guestfish-actions.pod:3897
12938 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
12942 #: ../src/guestfs-actions.pod:5047
12944 "I<Note:> Don't use this call to test for availability of features. In "
12945 "enterprise distributions we backport features from later versions into "
12946 "earlier versions, making this an unreliable way to test for features. Use "
12947 "C<guestfs_available> instead."
12951 #: ../src/guestfs-actions.pod:5053
12953 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
12954 "error. I<The caller must call C<guestfs_free_version> after use>."
12958 #: ../src/guestfs-actions.pod:5057
12959 msgid "guestfs_vfs_label"
12963 #: ../src/guestfs-actions.pod:5059
12966 " char *guestfs_vfs_label (guestfs_h *g,\n"
12967 "\t\tconst char *device);\n"
12972 #: ../src/guestfs-actions.pod:5062 ../fish/guestfish-actions.pod:3909
12973 msgid "This returns the filesystem label of the filesystem on C<device>."
12977 #: ../src/guestfs-actions.pod:5065 ../fish/guestfish-actions.pod:3912
12978 msgid "If the filesystem is unlabeled, this returns the empty string."
12982 #: ../src/guestfs-actions.pod:5067
12983 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
12987 #: ../src/guestfs-actions.pod:5072
12988 msgid "guestfs_vfs_type"
12992 #: ../src/guestfs-actions.pod:5074
12995 " char *guestfs_vfs_type (guestfs_h *g,\n"
12996 "\t\tconst char *device);\n"
13001 #: ../src/guestfs-actions.pod:5077 ../fish/guestfish-actions.pod:3920
13003 "This command gets the filesystem type corresponding to the filesystem on "
13008 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3923
13010 "For most filesystems, the result is the name of the Linux VFS module which "
13011 "would be used to mount this filesystem if you mounted it without specifying "
13012 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13016 #: ../src/guestfs-actions.pod:5088
13017 msgid "guestfs_vfs_uuid"
13021 #: ../src/guestfs-actions.pod:5090
13024 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13025 "\t\tconst char *device);\n"
13030 #: ../src/guestfs-actions.pod:5093 ../fish/guestfish-actions.pod:3932
13031 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13035 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3935
13036 msgid "If the filesystem does not have a UUID, this returns the empty string."
13040 #: ../src/guestfs-actions.pod:5098
13041 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13045 #: ../src/guestfs-actions.pod:5103
13046 msgid "guestfs_vg_activate"
13050 #: ../src/guestfs-actions.pod:5105
13053 " int guestfs_vg_activate (guestfs_h *g,\n"
13054 "\t\tint activate,\n"
13055 "\t\tchar *const *volgroups);\n"
13060 #: ../src/guestfs-actions.pod:5109 ../fish/guestfish-actions.pod:3943
13062 "This command activates or (if C<activate> is false) deactivates all logical "
13063 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13064 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13065 "deactivated, then those devices disappear."
13069 #: ../src/guestfs-actions.pod:5115 ../fish/guestfish-actions.pod:3949
13070 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13074 #: ../src/guestfs-actions.pod:5117 ../fish/guestfish-actions.pod:3951
13076 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13077 "activated or deactivated."
13081 #: ../src/guestfs-actions.pod:5122
13082 msgid "guestfs_vg_activate_all"
13086 #: ../src/guestfs-actions.pod:5124
13089 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13090 "\t\tint activate);\n"
13095 #: ../src/guestfs-actions.pod:5127 ../fish/guestfish-actions.pod:3958
13097 "This command activates or (if C<activate> is false) deactivates all logical "
13098 "volumes in all volume groups. If activated, then they are made known to the "
13099 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13100 "those devices disappear."
13104 #: ../src/guestfs-actions.pod:5133 ../fish/guestfish-actions.pod:3964
13105 msgid "This command is the same as running C<vgchange -a y|n>"
13109 #: ../src/guestfs-actions.pod:5137
13110 msgid "guestfs_vgcreate"
13114 #: ../src/guestfs-actions.pod:5139
13117 " int guestfs_vgcreate (guestfs_h *g,\n"
13118 "\t\tconst char *volgroup,\n"
13119 "\t\tchar *const *physvols);\n"
13124 #: ../src/guestfs-actions.pod:5143 ../fish/guestfish-actions.pod:3970
13126 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13127 "of physical volumes C<physvols>."
13131 #: ../src/guestfs-actions.pod:5148
13132 msgid "guestfs_vglvuuids"
13136 #: ../src/guestfs-actions.pod:5150
13139 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13140 "\t\tconst char *vgname);\n"
13145 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3977
13147 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13148 "volumes created in this volume group."
13152 #: ../src/guestfs-actions.pod:5156
13154 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13155 "associate logical volumes and volume groups."
13159 #: ../src/guestfs-actions.pod:5159
13160 msgid "See also C<guestfs_vgpvuuids>."
13164 #: ../src/guestfs-actions.pod:5165
13165 msgid "guestfs_vgpvuuids"
13169 #: ../src/guestfs-actions.pod:5167
13172 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13173 "\t\tconst char *vgname);\n"
13178 #: ../src/guestfs-actions.pod:5170 ../fish/guestfish-actions.pod:3989
13180 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13181 "volumes that this volume group resides on."
13185 #: ../src/guestfs-actions.pod:5173
13187 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13188 "associate physical volumes and volume groups."
13192 #: ../src/guestfs-actions.pod:5176
13193 msgid "See also C<guestfs_vglvuuids>."
13197 #: ../src/guestfs-actions.pod:5182
13198 msgid "guestfs_vgremove"
13202 #: ../src/guestfs-actions.pod:5184
13205 " int guestfs_vgremove (guestfs_h *g,\n"
13206 "\t\tconst char *vgname);\n"
13211 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:4001
13212 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13216 #: ../src/guestfs-actions.pod:5189 ../fish/guestfish-actions.pod:4003
13218 "This also forcibly removes all logical volumes in the volume group (if any)."
13222 #: ../src/guestfs-actions.pod:5194
13223 msgid "guestfs_vgrename"
13227 #: ../src/guestfs-actions.pod:5196
13230 " int guestfs_vgrename (guestfs_h *g,\n"
13231 "\t\tconst char *volgroup,\n"
13232 "\t\tconst char *newvolgroup);\n"
13237 #: ../src/guestfs-actions.pod:5200 ../fish/guestfish-actions.pod:4010
13238 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
13242 #: ../src/guestfs-actions.pod:5204
13243 msgid "guestfs_vgs"
13247 #: ../src/guestfs-actions.pod:5206
13250 " char **guestfs_vgs (guestfs_h *g);\n"
13255 #: ../src/guestfs-actions.pod:5208 ../fish/guestfish-actions.pod:4016
13257 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
13262 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:4019
13264 "This returns a list of just the volume group names that were detected (eg. "
13269 #: ../src/guestfs-actions.pod:5214
13270 msgid "See also C<guestfs_vgs_full>."
13274 #: ../src/guestfs-actions.pod:5220
13275 msgid "guestfs_vgs_full"
13279 #: ../src/guestfs-actions.pod:5222
13282 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13287 #: ../src/guestfs-actions.pod:5224 ../fish/guestfish-actions.pod:4028
13289 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
13290 "> command. The \"full\" version includes all fields."
13294 #: ../src/guestfs-actions.pod:5227
13296 "This function returns a C<struct guestfs_lvm_vg_list *> (see E<lt>guestfs-"
13297 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
13298 "C<guestfs_free_lvm_vg_list> after use>."
13302 #: ../src/guestfs-actions.pod:5232
13303 msgid "guestfs_vgscan"
13307 #: ../src/guestfs-actions.pod:5234
13310 " int guestfs_vgscan (guestfs_h *g);\n"
13315 #: ../src/guestfs-actions.pod:5236 ../fish/guestfish-actions.pod:4035
13317 "This rescans all block devices and rebuilds the list of LVM physical "
13318 "volumes, volume groups and logical volumes."
13322 #: ../src/guestfs-actions.pod:5241
13323 msgid "guestfs_vguuid"
13327 #: ../src/guestfs-actions.pod:5243
13330 " char *guestfs_vguuid (guestfs_h *g,\n"
13331 "\t\tconst char *vgname);\n"
13336 #: ../src/guestfs-actions.pod:5246 ../fish/guestfish-actions.pod:4042
13337 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13341 #: ../src/guestfs-actions.pod:5251
13342 msgid "guestfs_wait_ready"
13346 #: ../src/guestfs-actions.pod:5253
13349 " int guestfs_wait_ready (guestfs_h *g);\n"
13354 #: ../src/guestfs-actions.pod:5255
13355 msgid "This function is a no op."
13359 #: ../src/guestfs-actions.pod:5257
13361 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13362 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13363 "is no longer necessary because C<guestfs_launch> now does the waiting."
13367 #: ../src/guestfs-actions.pod:5262
13369 "If you see any calls to this function in code then you can just remove them, "
13370 "unless you want to retain compatibility with older versions of the API."
13374 #: ../src/guestfs-actions.pod:5268
13375 msgid "guestfs_wc_c"
13379 #: ../src/guestfs-actions.pod:5270
13382 " int guestfs_wc_c (guestfs_h *g,\n"
13383 "\t\tconst char *path);\n"
13388 #: ../src/guestfs-actions.pod:5273 ../fish/guestfish-actions.pod:4048
13390 "This command counts the characters in a file, using the C<wc -c> external "
13395 #: ../src/guestfs-actions.pod:5278
13396 msgid "guestfs_wc_l"
13400 #: ../src/guestfs-actions.pod:5280
13403 " int guestfs_wc_l (guestfs_h *g,\n"
13404 "\t\tconst char *path);\n"
13409 #: ../src/guestfs-actions.pod:5283 ../fish/guestfish-actions.pod:4055
13411 "This command counts the lines in a file, using the C<wc -l> external command."
13415 #: ../src/guestfs-actions.pod:5288
13416 msgid "guestfs_wc_w"
13420 #: ../src/guestfs-actions.pod:5290
13423 " int guestfs_wc_w (guestfs_h *g,\n"
13424 "\t\tconst char *path);\n"
13429 #: ../src/guestfs-actions.pod:5293 ../fish/guestfish-actions.pod:4062
13431 "This command counts the words in a file, using the C<wc -w> external command."
13435 #: ../src/guestfs-actions.pod:5298
13436 msgid "guestfs_write"
13440 #: ../src/guestfs-actions.pod:5300
13443 " int guestfs_write (guestfs_h *g,\n"
13444 "\t\tconst char *path,\n"
13445 "\t\tconst char *content,\n"
13446 "\t\tsize_t content_size);\n"
13451 #: ../src/guestfs-actions.pod:5305 ../fish/guestfish-actions.pod:4069
13453 "This call creates a file called C<path>. The content of the file is the "
13454 "string C<content> (which can contain any 8 bit data)."
13458 #: ../src/guestfs-actions.pod:5313
13459 msgid "guestfs_write_file"
13463 #: ../src/guestfs-actions.pod:5315
13466 " int guestfs_write_file (guestfs_h *g,\n"
13467 "\t\tconst char *path,\n"
13468 "\t\tconst char *content,\n"
13474 #: ../src/guestfs-actions.pod:5320 ../fish/guestfish-actions.pod:4079
13476 "This call creates a file called C<path>. The contents of the file is the "
13477 "string C<content> (which can contain any 8 bit data), with length C<size>."
13481 #: ../src/guestfs-actions.pod:5324 ../fish/guestfish-actions.pod:4083
13483 "As a special case, if C<size> is C<0> then the length is calculated using "
13484 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13488 #: ../src/guestfs-actions.pod:5328 ../fish/guestfish-actions.pod:4087
13490 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13491 "I<not> work, even if the length is specified."
13495 #: ../src/guestfs-actions.pod:5336 ../fish/guestfish-actions.pod:4093
13497 "This function is deprecated. In new code, use the C<write> call instead."
13501 #: ../src/guestfs-actions.pod:5343
13502 msgid "guestfs_zegrep"
13506 #: ../src/guestfs-actions.pod:5345
13509 " char **guestfs_zegrep (guestfs_h *g,\n"
13510 "\t\tconst char *regex,\n"
13511 "\t\tconst char *path);\n"
13516 #: ../src/guestfs-actions.pod:5349 ../fish/guestfish-actions.pod:4104
13518 "This calls the external C<zegrep> program and returns the matching lines."
13522 #: ../src/guestfs-actions.pod:5359
13523 msgid "guestfs_zegrepi"
13527 #: ../src/guestfs-actions.pod:5361
13530 " char **guestfs_zegrepi (guestfs_h *g,\n"
13531 "\t\tconst char *regex,\n"
13532 "\t\tconst char *path);\n"
13537 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:4114
13539 "This calls the external C<zegrep -i> program and returns the matching lines."
13543 #: ../src/guestfs-actions.pod:5375
13544 msgid "guestfs_zero"
13548 #: ../src/guestfs-actions.pod:5377
13551 " int guestfs_zero (guestfs_h *g,\n"
13552 "\t\tconst char *device);\n"
13557 #: ../src/guestfs-actions.pod:5380 ../fish/guestfish-actions.pod:4124
13558 msgid "This command writes zeroes over the first few blocks of C<device>."
13562 #: ../src/guestfs-actions.pod:5382 ../fish/guestfish-actions.pod:4126
13564 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13565 "securely wipe the device). It should be sufficient to remove any partition "
13566 "tables, filesystem superblocks and so on."
13570 #: ../src/guestfs-actions.pod:5386
13571 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13575 #: ../src/guestfs-actions.pod:5395
13576 msgid "guestfs_zero_device"
13580 #: ../src/guestfs-actions.pod:5397
13583 " int guestfs_zero_device (guestfs_h *g,\n"
13584 "\t\tconst char *device);\n"
13589 #: ../src/guestfs-actions.pod:5400
13591 "This command writes zeroes over the entire C<device>. Compare with "
13592 "C<guestfs_zero> which just zeroes the first few blocks of a device."
13596 #: ../src/guestfs-actions.pod:5414
13597 msgid "guestfs_zerofree"
13601 #: ../src/guestfs-actions.pod:5416
13604 " int guestfs_zerofree (guestfs_h *g,\n"
13605 "\t\tconst char *device);\n"
13610 #: ../src/guestfs-actions.pod:5419 ../fish/guestfish-actions.pod:4147
13612 "This runs the I<zerofree> program on C<device>. This program claims to zero "
13613 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
13614 "possible to compress the filesystem more effectively."
13618 #: ../src/guestfs-actions.pod:5424 ../fish/guestfish-actions.pod:4152
13619 msgid "You should B<not> run this program if the filesystem is mounted."
13623 #: ../src/guestfs-actions.pod:5427 ../fish/guestfish-actions.pod:4155
13625 "It is possible that using this program can damage the filesystem or data on "
13630 #: ../src/guestfs-actions.pod:5432
13631 msgid "guestfs_zfgrep"
13635 #: ../src/guestfs-actions.pod:5434
13638 " char **guestfs_zfgrep (guestfs_h *g,\n"
13639 "\t\tconst char *pattern,\n"
13640 "\t\tconst char *path);\n"
13645 #: ../src/guestfs-actions.pod:5438 ../fish/guestfish-actions.pod:4162
13647 "This calls the external C<zfgrep> program and returns the matching lines."
13651 #: ../src/guestfs-actions.pod:5448
13652 msgid "guestfs_zfgrepi"
13656 #: ../src/guestfs-actions.pod:5450
13659 " char **guestfs_zfgrepi (guestfs_h *g,\n"
13660 "\t\tconst char *pattern,\n"
13661 "\t\tconst char *path);\n"
13666 #: ../src/guestfs-actions.pod:5454 ../fish/guestfish-actions.pod:4172
13668 "This calls the external C<zfgrep -i> program and returns the matching lines."
13672 #: ../src/guestfs-actions.pod:5464
13673 msgid "guestfs_zfile"
13677 #: ../src/guestfs-actions.pod:5466
13680 " char *guestfs_zfile (guestfs_h *g,\n"
13681 "\t\tconst char *meth,\n"
13682 "\t\tconst char *path);\n"
13687 #: ../src/guestfs-actions.pod:5470 ../fish/guestfish-actions.pod:4182
13689 "This command runs C<file> after first decompressing C<path> using C<method>."
13693 #: ../src/guestfs-actions.pod:5473 ../fish/guestfish-actions.pod:4185
13694 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
13698 #: ../src/guestfs-actions.pod:5475
13700 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
13705 #: ../src/guestfs-actions.pod:5481 ../fish/guestfish-actions.pod:4190
13707 "This function is deprecated. In new code, use the C<file> call instead."
13711 #: ../src/guestfs-actions.pod:5488
13712 msgid "guestfs_zgrep"
13716 #: ../src/guestfs-actions.pod:5490
13719 " char **guestfs_zgrep (guestfs_h *g,\n"
13720 "\t\tconst char *regex,\n"
13721 "\t\tconst char *path);\n"
13726 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:4201
13728 "This calls the external C<zgrep> program and returns the matching lines."
13732 #: ../src/guestfs-actions.pod:5504
13733 msgid "guestfs_zgrepi"
13737 #: ../src/guestfs-actions.pod:5506
13740 " char **guestfs_zgrepi (guestfs_h *g,\n"
13741 "\t\tconst char *regex,\n"
13742 "\t\tconst char *path);\n"
13747 #: ../src/guestfs-actions.pod:5510 ../fish/guestfish-actions.pod:4211
13749 "This calls the external C<zgrep -i> program and returns the matching lines."
13753 #: ../src/guestfs-availability.pod:3
13758 #: ../src/guestfs-availability.pod:5
13760 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
13761 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
13762 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
13763 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
13764 "L</guestfs_aug_save> L</guestfs_aug_set>"
13768 #: ../src/guestfs-availability.pod:21
13773 #: ../src/guestfs-availability.pod:23
13775 "The following functions: L</guestfs_inotify_add_watch> L</"
13776 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
13777 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
13781 #: ../src/guestfs-availability.pod:31
13782 msgid "B<linuxfsuuid>"
13786 #: ../src/guestfs-availability.pod:33
13788 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
13789 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
13793 #: ../src/guestfs-availability.pod:40
13794 msgid "B<linuxmodules>"
13798 #: ../src/guestfs-availability.pod:42
13799 msgid "The following functions: L</guestfs_modprobe>"
13803 #: ../src/guestfs-availability.pod:45
13804 msgid "B<linuxxattrs>"
13808 #: ../src/guestfs-availability.pod:47
13810 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
13811 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
13812 "guestfs_removexattr> L</guestfs_setxattr>"
13816 #: ../src/guestfs-availability.pod:56
13821 #: ../src/guestfs-availability.pod:58
13823 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
13824 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
13825 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
13829 #: ../src/guestfs-availability.pod:67
13834 #: ../src/guestfs-availability.pod:69
13836 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
13837 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
13838 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
13839 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
13840 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
13841 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
13842 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
13846 #: ../src/guestfs-availability.pod:92
13851 #: ../src/guestfs-availability.pod:94
13853 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
13854 "guestfs_mknod_b> L</guestfs_mknod_c>"
13858 #: ../src/guestfs-availability.pod:100
13863 #: ../src/guestfs-availability.pod:102
13864 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
13868 #: ../src/guestfs-availability.pod:105
13869 msgid "B<ntfsprogs>"
13873 #: ../src/guestfs-availability.pod:107
13875 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
13879 #: ../src/guestfs-availability.pod:111
13880 msgid "B<realpath>"
13884 #: ../src/guestfs-availability.pod:113
13885 msgid "The following functions: L</guestfs_realpath>"
13889 #: ../src/guestfs-availability.pod:116
13894 #: ../src/guestfs-availability.pod:118
13896 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
13897 "guestfs_scrub_freespace>"
13901 #: ../src/guestfs-availability.pod:123
13906 #: ../src/guestfs-availability.pod:125
13907 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
13911 #: ../src/guestfs-availability.pod:129
13916 #: ../src/guestfs-availability.pod:131
13917 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
13921 #: ../src/guestfs-availability.pod:135
13922 msgid "B<zerofree>"
13926 #: ../src/guestfs-availability.pod:137
13927 msgid "The following functions: L</guestfs_zerofree>"
13931 #: ../src/guestfs-structs.pod:1
13932 msgid "guestfs_int_bool"
13936 #: ../src/guestfs-structs.pod:3
13939 " struct guestfs_int_bool {\n"
13947 #: ../src/guestfs-structs.pod:8
13950 " struct guestfs_int_bool_list {\n"
13951 " uint32_t len; /* Number of elements in list. */\n"
13952 " struct guestfs_int_bool *val; /* Elements. */\n"
13958 #: ../src/guestfs-structs.pod:13
13961 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
13962 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
13967 #: ../src/guestfs-structs.pod:16
13968 msgid "guestfs_lvm_pv"
13972 #: ../src/guestfs-structs.pod:18
13975 " struct guestfs_lvm_pv {\n"
13976 " char *pv_name;\n"
13977 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
13978 " char pv_uuid[32];\n"
13980 " uint64_t pv_size;\n"
13981 " uint64_t dev_size;\n"
13982 " uint64_t pv_free;\n"
13983 " uint64_t pv_used;\n"
13984 " char *pv_attr;\n"
13985 " int64_t pv_pe_count;\n"
13986 " int64_t pv_pe_alloc_count;\n"
13987 " char *pv_tags;\n"
13988 " uint64_t pe_start;\n"
13989 " int64_t pv_mda_count;\n"
13990 " uint64_t pv_mda_free;\n"
13996 #: ../src/guestfs-structs.pod:36
13999 " struct guestfs_lvm_pv_list {\n"
14000 " uint32_t len; /* Number of elements in list. */\n"
14001 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14007 #: ../src/guestfs-structs.pod:41
14010 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14011 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14016 #: ../src/guestfs-structs.pod:44
14017 msgid "guestfs_lvm_vg"
14021 #: ../src/guestfs-structs.pod:46
14024 " struct guestfs_lvm_vg {\n"
14025 " char *vg_name;\n"
14026 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14027 " char vg_uuid[32];\n"
14029 " char *vg_attr;\n"
14030 " uint64_t vg_size;\n"
14031 " uint64_t vg_free;\n"
14032 " char *vg_sysid;\n"
14033 " uint64_t vg_extent_size;\n"
14034 " int64_t vg_extent_count;\n"
14035 " int64_t vg_free_count;\n"
14036 " int64_t max_lv;\n"
14037 " int64_t max_pv;\n"
14038 " int64_t pv_count;\n"
14039 " int64_t lv_count;\n"
14040 " int64_t snap_count;\n"
14041 " int64_t vg_seqno;\n"
14042 " char *vg_tags;\n"
14043 " int64_t vg_mda_count;\n"
14044 " uint64_t vg_mda_free;\n"
14050 #: ../src/guestfs-structs.pod:69
14053 " struct guestfs_lvm_vg_list {\n"
14054 " uint32_t len; /* Number of elements in list. */\n"
14055 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14061 #: ../src/guestfs-structs.pod:74
14064 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14065 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14070 #: ../src/guestfs-structs.pod:77
14071 msgid "guestfs_lvm_lv"
14075 #: ../src/guestfs-structs.pod:79
14078 " struct guestfs_lvm_lv {\n"
14079 " char *lv_name;\n"
14080 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14081 " char lv_uuid[32];\n"
14082 " char *lv_attr;\n"
14083 " int64_t lv_major;\n"
14084 " int64_t lv_minor;\n"
14085 " int64_t lv_kernel_major;\n"
14086 " int64_t lv_kernel_minor;\n"
14087 " uint64_t lv_size;\n"
14088 " int64_t seg_count;\n"
14090 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14091 " float snap_percent;\n"
14092 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14093 " float copy_percent;\n"
14094 " char *move_pv;\n"
14095 " char *lv_tags;\n"
14096 " char *mirror_log;\n"
14097 " char *modules;\n"
14103 #: ../src/guestfs-structs.pod:101
14106 " struct guestfs_lvm_lv_list {\n"
14107 " uint32_t len; /* Number of elements in list. */\n"
14108 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14114 #: ../src/guestfs-structs.pod:106
14117 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14118 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14123 #: ../src/guestfs-structs.pod:111
14126 " struct guestfs_stat {\n"
14130 " int64_t nlink;\n"
14135 " int64_t blksize;\n"
14136 " int64_t blocks;\n"
14137 " int64_t atime;\n"
14138 " int64_t mtime;\n"
14139 " int64_t ctime;\n"
14145 #: ../src/guestfs-structs.pod:127
14148 " struct guestfs_stat_list {\n"
14149 " uint32_t len; /* Number of elements in list. */\n"
14150 " struct guestfs_stat *val; /* Elements. */\n"
14156 #: ../src/guestfs-structs.pod:132
14159 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14160 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14165 #: ../src/guestfs-structs.pod:137
14168 " struct guestfs_statvfs {\n"
14169 " int64_t bsize;\n"
14170 " int64_t frsize;\n"
14171 " int64_t blocks;\n"
14172 " int64_t bfree;\n"
14173 " int64_t bavail;\n"
14174 " int64_t files;\n"
14175 " int64_t ffree;\n"
14176 " int64_t favail;\n"
14179 " int64_t namemax;\n"
14185 #: ../src/guestfs-structs.pod:151
14188 " struct guestfs_statvfs_list {\n"
14189 " uint32_t len; /* Number of elements in list. */\n"
14190 " struct guestfs_statvfs *val; /* Elements. */\n"
14196 #: ../src/guestfs-structs.pod:156
14199 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14200 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14205 #: ../src/guestfs-structs.pod:159
14206 msgid "guestfs_dirent"
14210 #: ../src/guestfs-structs.pod:161
14213 " struct guestfs_dirent {\n"
14222 #: ../src/guestfs-structs.pod:167
14225 " struct guestfs_dirent_list {\n"
14226 " uint32_t len; /* Number of elements in list. */\n"
14227 " struct guestfs_dirent *val; /* Elements. */\n"
14233 #: ../src/guestfs-structs.pod:172
14236 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
14237 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
14242 #: ../src/guestfs-structs.pod:177
14245 " struct guestfs_version {\n"
14246 " int64_t major;\n"
14247 " int64_t minor;\n"
14248 " int64_t release;\n"
14255 #: ../src/guestfs-structs.pod:184
14258 " struct guestfs_version_list {\n"
14259 " uint32_t len; /* Number of elements in list. */\n"
14260 " struct guestfs_version *val; /* Elements. */\n"
14266 #: ../src/guestfs-structs.pod:189
14269 " void guestfs_free_version (struct guestfs_free_version *);\n"
14270 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14275 #: ../src/guestfs-structs.pod:192
14276 msgid "guestfs_xattr"
14280 #: ../src/guestfs-structs.pod:194
14283 " struct guestfs_xattr {\n"
14284 " char *attrname;\n"
14285 " /* The next two fields describe a byte array. */\n"
14286 " uint32_t attrval_len;\n"
14287 " char *attrval;\n"
14293 #: ../src/guestfs-structs.pod:201
14296 " struct guestfs_xattr_list {\n"
14297 " uint32_t len; /* Number of elements in list. */\n"
14298 " struct guestfs_xattr *val; /* Elements. */\n"
14304 #: ../src/guestfs-structs.pod:206
14307 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14308 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14313 #: ../src/guestfs-structs.pod:209
14314 msgid "guestfs_inotify_event"
14318 #: ../src/guestfs-structs.pod:211
14321 " struct guestfs_inotify_event {\n"
14322 " int64_t in_wd;\n"
14323 " uint32_t in_mask;\n"
14324 " uint32_t in_cookie;\n"
14325 " char *in_name;\n"
14331 #: ../src/guestfs-structs.pod:218
14334 " struct guestfs_inotify_event_list {\n"
14335 " uint32_t len; /* Number of elements in list. */\n"
14336 " struct guestfs_inotify_event *val; /* Elements. */\n"
14342 #: ../src/guestfs-structs.pod:223
14345 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14346 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
14351 #: ../src/guestfs-structs.pod:226
14352 msgid "guestfs_partition"
14356 #: ../src/guestfs-structs.pod:228
14359 " struct guestfs_partition {\n"
14360 " int32_t part_num;\n"
14361 " uint64_t part_start;\n"
14362 " uint64_t part_end;\n"
14363 " uint64_t part_size;\n"
14369 #: ../src/guestfs-structs.pod:235
14372 " struct guestfs_partition_list {\n"
14373 " uint32_t len; /* Number of elements in list. */\n"
14374 " struct guestfs_partition *val; /* Elements. */\n"
14380 #: ../src/guestfs-structs.pod:240
14383 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14384 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14389 #: ../fish/guestfish.pod:5
14390 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14394 #: ../fish/guestfish.pod:9
14397 " guestfish [--options] [commands]\n"
14402 #: ../fish/guestfish.pod:11
14410 #: ../fish/guestfish.pod:13
14413 " guestfish -a disk.img\n"
14418 #: ../fish/guestfish.pod:15
14421 " guestfish -a disk.img -m dev[:mountpoint]\n"
14426 #: ../fish/guestfish.pod:17
14429 " guestfish -d libvirt-domain\n"
14434 #: ../fish/guestfish.pod:19
14437 " guestfish -a disk.img -i\n"
14442 #: ../fish/guestfish.pod:21
14445 " guestfish -d libvirt-domain -i\n"
14450 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:11 ../tools/virt-edit.pl:45
14451 #: ../tools/virt-rescue.pl:41 ../tools/virt-tar.pl:60
14452 #: ../tools/virt-win-reg.pl:52
14457 #: ../fish/guestfish.pod:25
14459 "Using guestfish in read/write mode on live virtual machines can be "
14460 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14461 "option to use guestfish safely if the disk image or virtual machine might be "
14466 #: ../fish/guestfish.pod:30 ../fish/guestfish.pod:729
14467 #: ../fuse/guestmount.pod:35 ../tools/virt-cat.pl:51 ../tools/virt-edit.pl:59
14468 #: ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:46
14473 #: ../fish/guestfish.pod:32
14474 msgid "As an interactive shell"
14478 #: ../fish/guestfish.pod:34
14486 #: ../fish/guestfish.pod:36
14489 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14490 " editing virtual machine filesystems.\n"
14495 #: ../fish/guestfish.pod:39
14498 " Type: 'help' for a list of commands\n"
14499 " 'man' to read the manual\n"
14500 " 'quit' to quit the shell\n"
14505 #: ../fish/guestfish.pod:43
14513 #: ../fish/guestfish.pod:45
14514 msgid "From shell scripts"
14518 #: ../fish/guestfish.pod:47
14519 msgid "Create a new C</etc/motd> file in a guest:"
14523 #: ../fish/guestfish.pod:49
14526 " guestfish <<_EOF_\n"
14529 " mount /dev/vg_guest/lv_root /\n"
14530 " write /etc/motd \"Welcome, new users\"\n"
14536 #: ../fish/guestfish.pod:56
14537 msgid "List the LVM logical volumes in a guest:"
14541 #: ../fish/guestfish.pod:58
14544 " guestfish -a disk.img --ro <<_EOF_\n"
14552 #: ../fish/guestfish.pod:63
14553 msgid "On one command line"
14557 #: ../fish/guestfish.pod:65
14558 msgid "Update C</etc/resolv.conf> in a guest:"
14562 #: ../fish/guestfish.pod:67
14566 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
14567 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
14572 #: ../fish/guestfish.pod:71
14573 msgid "Edit C</boot/grub/grub.conf> interactively:"
14577 #: ../fish/guestfish.pod:73
14580 " guestfish --add disk.img \\\n"
14581 " --mount /dev/vg_guest/lv_root \\\n"
14582 " --mount /dev/sda1:/boot \\\n"
14583 " edit /boot/grub/grub.conf\n"
14588 #: ../fish/guestfish.pod:78
14589 msgid "Mount disks automatically"
14593 #: ../fish/guestfish.pod:80
14595 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
14599 #: ../fish/guestfish.pod:83
14602 " guestfish --ro -a disk.img -i cat /etc/group\n"
14607 #: ../fish/guestfish.pod:85
14610 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
14615 #: ../fish/guestfish.pod:87
14616 msgid "As a script interpreter"
14620 #: ../fish/guestfish.pod:89
14621 msgid "Create a 100MB disk containing an ext2-formatted partition:"
14625 #: ../fish/guestfish.pod:91
14628 " #!/usr/bin/guestfish -f\n"
14629 " sparse test1.img 100M\n"
14631 " part-disk /dev/sda mbr\n"
14632 " mkfs ext2 /dev/sda1\n"
14637 #: ../fish/guestfish.pod:97
14638 msgid "Start with a prepared disk"
14642 #: ../fish/guestfish.pod:99
14644 "An alternate way to create a 100MB disk called C<test1.img> containing a "
14645 "single ext2-formatted partition:"
14649 #: ../fish/guestfish.pod:102
14652 " guestfish -N fs\n"
14657 #: ../fish/guestfish.pod:104
14658 msgid "To list what is available do:"
14662 #: ../fish/guestfish.pod:106 ../fish/guestfish.pod:720
14665 " guestfish -N help | less\n"
14670 #: ../fish/guestfish.pod:108
14671 msgid "Remote control"
14675 #: ../fish/guestfish.pod:110
14678 " eval `guestfish --listen --ro`\n"
14679 " guestfish --remote add disk.img\n"
14680 " guestfish --remote run\n"
14681 " guestfish --remote lvs\n"
14686 #: ../fish/guestfish.pod:117
14688 "Guestfish is a shell and command-line tool for examining and modifying "
14689 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14690 "functionality of the guestfs API, see L<guestfs(3)>."
14694 #: ../fish/guestfish.pod:121
14696 "Guestfish gives you structured access to the libguestfs API, from shell "
14697 "scripts or the command line or interactively. If you want to rescue a "
14698 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14703 #: ../fish/guestfish.pod:126 ../test-tool/libguestfs-test-tool.pod:37
14704 #: ../fuse/guestmount.pod:70 ../inspector/virt-inspector.pl:75
14705 #: ../tools/virt-cat.pl:80 ../tools/virt-df.pl:71 ../tools/virt-edit.pl:73
14706 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-list-partitions.pl:51
14707 #: ../tools/virt-ls.pl:79 ../tools/virt-make-fs.pl:153
14708 #: ../tools/virt-rescue.pl:103 ../tools/virt-resize.pl:233
14709 #: ../tools/virt-tar.pl:99 ../tools/virt-win-reg.pl:172
14714 #: ../fish/guestfish.pod:130 ../fuse/guestmount.pod:94
14715 #: ../inspector/virt-inspector.pl:83 ../tools/virt-cat.pl:88
14716 #: ../tools/virt-df.pl:79 ../tools/virt-edit.pl:81
14717 #: ../tools/virt-list-filesystems.pl:58 ../tools/virt-list-partitions.pl:59
14718 #: ../tools/virt-ls.pl:87 ../tools/virt-make-fs.pl:161
14719 #: ../tools/virt-rescue.pl:111 ../tools/virt-resize.pl:241
14720 #: ../tools/virt-tar.pl:107 ../tools/virt-win-reg.pl:180
14725 #: ../fish/guestfish.pod:132
14726 msgid "Displays general help on options."
14730 #: ../fish/guestfish.pod:134
14731 msgid "B<-h> | B<--cmd-help>"
14735 #: ../fish/guestfish.pod:136
14736 msgid "Lists all available guestfish commands."
14740 #: ../fish/guestfish.pod:138
14741 msgid "B<-h cmd> | B<--cmd-help cmd>"
14745 #: ../fish/guestfish.pod:140
14746 msgid "Displays detailed help on a single command C<cmd>."
14750 #: ../fish/guestfish.pod:142 ../fuse/guestmount.pod:74
14751 msgid "B<-a image> | B<--add image>"
14755 #: ../fish/guestfish.pod:144
14756 msgid "Add a block device or virtual machine image to the shell."
14760 #: ../fish/guestfish.pod:146
14761 msgid "B<-c URI> | B<--connect URI>"
14765 #: ../fish/guestfish.pod:148
14767 "When used in conjunction with the I<-d> option, this specifies the libvirt "
14768 "URI to use. The default is to use the default libvirt connection."
14772 #: ../fish/guestfish.pod:152
14773 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
14777 #: ../fish/guestfish.pod:154
14779 "Add disks from the named libvirt domain. If the I<--ro> option is also "
14780 "used, then any libvirt domain can be used. However in write mode, only "
14781 "libvirt domains which are shut down can be named here."
14785 #: ../fish/guestfish.pod:158
14786 msgid "B<-D> | B<--no-dest-paths>"
14790 #: ../fish/guestfish.pod:160
14792 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
14793 "to hit the tab key to complete paths on the guest filesystem, but this "
14794 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
14795 "allow this feature to be disabled."
14799 #: ../fish/guestfish.pod:165
14800 msgid "B<-f file> | B<--file file>"
14804 #: ../fish/guestfish.pod:167
14805 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
14809 #: ../fish/guestfish.pod:170
14812 " #!/usr/bin/guestfish -f\n"
14817 #: ../fish/guestfish.pod:172
14818 msgid "B<-i> | B<--inspector>"
14822 #: ../fish/guestfish.pod:174
14824 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
14825 "system and mount filesystems as they would be mounted on the real virtual "
14830 #: ../fish/guestfish.pod:178
14831 msgid "Typical usage is either:"
14835 #: ../fish/guestfish.pod:180
14838 " guestfish -d myguest -i\n"
14843 #: ../fish/guestfish.pod:182
14844 msgid "(for an inactive libvirt domain called I<myguest>), or:"
14848 #: ../fish/guestfish.pod:184
14851 " guestfish --ro -d myguest -i\n"
14856 #: ../fish/guestfish.pod:186
14857 msgid "(for active domains, readonly), or specify the block device directly:"
14861 #: ../fish/guestfish.pod:188
14864 " guestfish -a /dev/Guests/MyGuest -i\n"
14869 #: ../fish/guestfish.pod:190
14871 "Note that the command line syntax changed slightly over older versions of "
14872 "guestfish. You can still use the old syntax:"
14876 #: ../fish/guestfish.pod:193
14879 " guestfish [--ro] -i disk.img\n"
14884 #: ../fish/guestfish.pod:195
14887 " guestfish [--ro] -i libvirt-domain\n"
14892 #: ../fish/guestfish.pod:197
14893 msgid "B<--keys-from-stdin>"
14897 #: ../fish/guestfish.pod:199
14899 "Read key or passphrase parameters from stdin. The default is to try to read "
14900 "passphrases from the user by opening C</dev/tty>."
14904 #: ../fish/guestfish.pod:202
14905 msgid "B<--listen>"
14909 #: ../fish/guestfish.pod:204
14911 "Fork into the background and listen for remote commands. See section L</"
14912 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
14916 #: ../fish/guestfish.pod:207
14917 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
14921 #: ../fish/guestfish.pod:209
14922 msgid "Mount the named partition or logical volume on the given mountpoint."
14926 #: ../fish/guestfish.pod:211
14927 msgid "If the mountpoint is omitted, it defaults to C</>."
14931 #: ../fish/guestfish.pod:213
14932 msgid "You have to mount something on C</> before most commands will work."
14936 #: ../fish/guestfish.pod:215
14938 "If any I<-m> or I<--mount> options are given, the guest is automatically "
14943 #: ../fish/guestfish.pod:218
14945 "If you don't know what filesystems a disk image contains, you can either run "
14946 "guestfish without this option, then list the partitions and LVs available "
14947 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
14948 "list-filesystems(1)> program."
14952 #: ../fish/guestfish.pod:223 ../fuse/guestmount.pod:106
14953 msgid "B<-n> | B<--no-sync>"
14957 #: ../fish/guestfish.pod:225
14959 "Disable autosync. This is enabled by default. See the discussion of "
14960 "autosync in the L<guestfs(3)> manpage."
14964 #: ../fish/guestfish.pod:228
14965 msgid "B<-N type> | B<--new type> | B<-N help>"
14969 #: ../fish/guestfish.pod:230
14971 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
14972 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
14973 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
14978 #: ../fish/guestfish.pod:235
14979 msgid "B<--progress-bars>"
14983 #: ../fish/guestfish.pod:237
14984 msgid "Enable progress bars, even when guestfish is used non-interactively."
14988 #: ../fish/guestfish.pod:239
14990 "Progress bars are enabled by default when guestfish is used as an "
14991 "interactive shell."
14995 #: ../fish/guestfish.pod:242
14996 msgid "B<--no-progress-bars>"
15000 #: ../fish/guestfish.pod:244
15001 msgid "Disable progress bars."
15005 #: ../fish/guestfish.pod:246
15006 msgid "B<--remote[=pid]>"
15010 #: ../fish/guestfish.pod:248
15012 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15013 "CONTROL GUESTFISH OVER A SOCKET> below."
15017 #: ../fish/guestfish.pod:251 ../fuse/guestmount.pod:148
15018 msgid "B<-r> | B<--ro>"
15022 #: ../fish/guestfish.pod:253
15024 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15025 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15029 #: ../fish/guestfish.pod:256 ../tools/virt-rescue.pl:162
15031 "The option must always be used if the disk image or virtual machine might be "
15032 "running, and is generally recommended in cases where you don't need write "
15033 "access to the disk."
15037 #: ../fish/guestfish.pod:260
15039 "Note that prepared disk images created with I<-N> are not affected by the "
15044 #: ../fish/guestfish.pod:263 ../fuse/guestmount.pod:158
15045 #: ../tools/virt-rescue.pl:170
15046 msgid "B<--selinux>"
15050 #: ../fish/guestfish.pod:265
15051 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15055 #: ../fish/guestfish.pod:267 ../fuse/guestmount.pod:168
15056 msgid "B<-v> | B<--verbose>"
15060 #: ../fish/guestfish.pod:269
15062 "Enable very verbose messages. This is particularly useful if you find a bug."
15066 #: ../fish/guestfish.pod:272 ../fuse/guestmount.pod:172
15067 msgid "B<-V> | B<--version>"
15071 #: ../fish/guestfish.pod:274
15072 msgid "Display the guestfish / libguestfs version number and exit."
15076 #: ../fish/guestfish.pod:276
15081 #: ../fish/guestfish.pod:278
15082 msgid "Echo each command before executing it."
15086 #: ../fish/guestfish.pod:282
15087 msgid "COMMANDS ON COMMAND LINE"
15091 #: ../fish/guestfish.pod:284
15093 "Any additional (non-option) arguments are treated as commands to execute."
15097 #: ../fish/guestfish.pod:287
15099 "Commands to execute should be separated by a colon (C<:>), where the colon "
15100 "is a separate parameter. Thus:"
15104 #: ../fish/guestfish.pod:290
15107 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
15112 #: ../fish/guestfish.pod:292
15114 "If there are no additional arguments, then we enter a shell, either an "
15115 "interactive shell with a prompt (if the input is a terminal) or a non-"
15116 "interactive shell."
15120 #: ../fish/guestfish.pod:296
15122 "In either command line mode or non-interactive shell, the first command that "
15123 "gives an error causes the whole shell to exit. In interactive mode (with a "
15124 "prompt) if a command fails, you can continue to enter commands."
15128 #: ../fish/guestfish.pod:301
15129 msgid "USING launch (OR run)"
15133 #: ../fish/guestfish.pod:303
15135 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
15136 "then launch it, then mount any disks you need, and finally issue actions/"
15137 "commands. So the general order of the day is:"
15141 #: ../fish/guestfish.pod:311
15142 msgid "add or -a/--add"
15146 #: ../fish/guestfish.pod:315
15147 msgid "launch (aka run)"
15151 #: ../fish/guestfish.pod:319
15152 msgid "mount or -m/--mount"
15156 #: ../fish/guestfish.pod:323
15157 msgid "any other commands"
15161 #: ../fish/guestfish.pod:327
15163 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
15164 "guest before mounting or performing any other commands."
15168 #: ../fish/guestfish.pod:330
15170 "The only exception is that if the I<-m> or I<--mount> option was given, the "
15171 "guest is automatically run for you (simply because guestfish can't mount the "
15172 "disks you asked for without doing this)."
15176 #: ../fish/guestfish.pod:334
15181 #: ../fish/guestfish.pod:336
15183 "You can quote ordinary parameters using either single or double quotes. For "
15188 #: ../fish/guestfish.pod:339
15191 " add \"file with a space.img\"\n"
15196 #: ../fish/guestfish.pod:341
15199 " rm '/file name'\n"
15204 #: ../fish/guestfish.pod:343
15212 #: ../fish/guestfish.pod:345
15214 "A few commands require a list of strings to be passed. For these, use a "
15215 "whitespace-separated list, enclosed in quotes. Strings containing "
15216 "whitespace to be passed through must be enclosed in single quotes. A "
15217 "literal single quote must be escaped with a backslash."
15221 #: ../fish/guestfish.pod:350
15224 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
15225 " command \"/bin/echo 'foo bar'\"\n"
15226 " command \"/bin/echo \\'foo\\'\"\n"
15231 #: ../fish/guestfish.pod:354
15236 #: ../fish/guestfish.pod:356
15238 "This section applies to all commands which can take integers as parameters."
15242 #: ../fish/guestfish.pod:359
15243 msgid "SIZE SUFFIX"
15247 #: ../fish/guestfish.pod:361
15249 "When the command takes a parameter measured in bytes, you can use one of the "
15250 "following suffixes to specify kilobytes, megabytes and larger sizes:"
15254 #: ../fish/guestfish.pod:367
15255 msgid "B<k> or B<K> or B<KiB>"
15259 #: ../fish/guestfish.pod:369
15260 msgid "The size in kilobytes (multiplied by 1024)."
15264 #: ../fish/guestfish.pod:371
15269 #: ../fish/guestfish.pod:373
15270 msgid "The size in SI 1000 byte units."
15274 #: ../fish/guestfish.pod:375
15275 msgid "B<M> or B<MiB>"
15279 #: ../fish/guestfish.pod:377
15280 msgid "The size in megabytes (multiplied by 1048576)."
15284 #: ../fish/guestfish.pod:379
15289 #: ../fish/guestfish.pod:381
15290 msgid "The size in SI 1000000 byte units."
15294 #: ../fish/guestfish.pod:383
15295 msgid "B<G> or B<GiB>"
15299 #: ../fish/guestfish.pod:385
15300 msgid "The size in gigabytes (multiplied by 2**30)."
15304 #: ../fish/guestfish.pod:387
15309 #: ../fish/guestfish.pod:389
15310 msgid "The size in SI 10**9 byte units."
15314 #: ../fish/guestfish.pod:391
15315 msgid "B<T> or B<TiB>"
15319 #: ../fish/guestfish.pod:393
15320 msgid "The size in terabytes (multiplied by 2**40)."
15324 #: ../fish/guestfish.pod:395
15329 #: ../fish/guestfish.pod:397
15330 msgid "The size in SI 10**12 byte units."
15334 #: ../fish/guestfish.pod:399
15335 msgid "B<P> or B<PiB>"
15339 #: ../fish/guestfish.pod:401
15340 msgid "The size in petabytes (multiplied by 2**50)."
15344 #: ../fish/guestfish.pod:403
15349 #: ../fish/guestfish.pod:405
15350 msgid "The size in SI 10**15 byte units."
15354 #: ../fish/guestfish.pod:407
15355 msgid "B<E> or B<EiB>"
15359 #: ../fish/guestfish.pod:409
15360 msgid "The size in exabytes (multiplied by 2**60)."
15364 #: ../fish/guestfish.pod:411
15369 #: ../fish/guestfish.pod:413
15370 msgid "The size in SI 10**18 byte units."
15374 #: ../fish/guestfish.pod:415
15375 msgid "B<Z> or B<ZiB>"
15379 #: ../fish/guestfish.pod:417
15380 msgid "The size in zettabytes (multiplied by 2**70)."
15384 #: ../fish/guestfish.pod:419
15389 #: ../fish/guestfish.pod:421
15390 msgid "The size in SI 10**21 byte units."
15394 #: ../fish/guestfish.pod:423
15395 msgid "B<Y> or B<YiB>"
15399 #: ../fish/guestfish.pod:425
15400 msgid "The size in yottabytes (multiplied by 2**80)."
15404 #: ../fish/guestfish.pod:427
15409 #: ../fish/guestfish.pod:429
15410 msgid "The size in SI 10**24 byte units."
15414 #: ../fish/guestfish.pod:433
15415 msgid "For example:"
15419 #: ../fish/guestfish.pod:435
15422 " truncate-size /file 1G\n"
15427 #: ../fish/guestfish.pod:437
15428 msgid "would truncate the file to 1 gigabyte."
15432 #: ../fish/guestfish.pod:439
15434 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
15435 "the parameter to L</memsize> is specified in megabytes already). Adding a "
15436 "suffix will probably not do what you expect."
15440 #: ../fish/guestfish.pod:443
15441 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15445 #: ../fish/guestfish.pod:445
15447 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15448 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15452 #: ../fish/guestfish.pod:448
15455 " 1234 decimal number 1234\n"
15456 " 02322 octal number, equivalent to decimal 1234\n"
15457 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
15462 #: ../fish/guestfish.pod:452
15464 "When using the C<chmod> command, you almost always want to specify an octal "
15465 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
15466 "L<chmod(1)> program):"
15470 #: ../fish/guestfish.pod:456
15473 " chmod 0777 /public # OK\n"
15474 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
15479 #: ../fish/guestfish.pod:459
15481 "Commands that return numbers usually print them in decimal, but some "
15482 "commands print numbers in other radices (eg. C<umask> prints the mode in "
15483 "octal, preceeded by C<0>)."
15487 #: ../fish/guestfish.pod:463
15488 msgid "WILDCARDS AND GLOBBING"
15492 #: ../fish/guestfish.pod:465
15494 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
15495 "(globbing) by default. So for example the following will not do what you "
15500 #: ../fish/guestfish.pod:469
15508 #: ../fish/guestfish.pod:471
15510 "Assuming you don't have a directory literally called C</home/*> then the "
15511 "above command will return an error."
15515 #: ../fish/guestfish.pod:474
15516 msgid "To perform wildcard expansion, use the C<glob> command."
15520 #: ../fish/guestfish.pod:476
15523 " glob rm-rf /home/*\n"
15528 #: ../fish/guestfish.pod:478
15530 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
15531 "many times), equivalent to:"
15535 #: ../fish/guestfish.pod:481
15538 " rm-rf /home/jim\n"
15539 " rm-rf /home/joe\n"
15540 " rm-rf /home/mary\n"
15545 #: ../fish/guestfish.pod:485
15546 msgid "C<glob> only works on simple guest paths and not on device names."
15550 #: ../fish/guestfish.pod:487
15552 "If you have several parameters, each containing a wildcard, then glob will "
15553 "perform a cartesian product."
15557 #: ../fish/guestfish.pod:490
15562 #: ../fish/guestfish.pod:492
15564 "Any line which starts with a I<#> character is treated as a comment and "
15565 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
15566 "a command. For example:"
15570 #: ../fish/guestfish.pod:496
15573 " # this is a comment\n"
15574 " # this is a comment\n"
15575 " foo # NOT a comment\n"
15580 #: ../fish/guestfish.pod:500
15581 msgid "Blank lines are also ignored."
15585 #: ../fish/guestfish.pod:502
15586 msgid "RUNNING COMMANDS LOCALLY"
15590 #: ../fish/guestfish.pod:504
15592 "Any line which starts with a I<!> character is treated as a command sent to "
15593 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
15597 #: ../fish/guestfish.pod:508
15601 " tgz-out /remote local/remote-data.tar.gz\n"
15606 #: ../fish/guestfish.pod:511
15608 "will create a directory C<local> on the host, and then export the contents "
15609 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
15610 "(See C<tgz-out>)."
15614 #: ../fish/guestfish.pod:515
15616 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
15617 "effect, due to the way that subprocesses work in Unix."
15621 #: ../fish/guestfish.pod:518
15626 #: ../fish/guestfish.pod:520
15628 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
15629 "command (a guestfish command) to the second command (any host command). For "
15634 #: ../fish/guestfish.pod:524
15637 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
15642 #: ../fish/guestfish.pod:526
15644 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
15645 "program). The above command would list all accounts in the guest filesystem "
15646 "which have UID 0, ie. root accounts including backdoors. Other examples:"
15650 #: ../fish/guestfish.pod:531
15653 " hexdump /bin/ls | head\n"
15654 " list-devices | tail -1\n"
15655 " tgz-out / - | tar ztf -\n"
15660 #: ../fish/guestfish.pod:535
15662 "The space before the pipe symbol is required, any space after the pipe "
15663 "symbol is optional. Everything after the pipe symbol is just passed "
15664 "straight to the host shell, so it can contain redirections, globs and "
15665 "anything else that makes sense on the host side."
15669 #: ../fish/guestfish.pod:540
15671 "To use a literal argument which begins with a pipe symbol, you have to quote "
15676 #: ../fish/guestfish.pod:543
15684 #: ../fish/guestfish.pod:545
15685 msgid "HOME DIRECTORIES"
15689 #: ../fish/guestfish.pod:547
15691 "If a parameter starts with the character C<~> then the tilde may be expanded "
15692 "as a home directory path (either C<~> for the current user's home directory, "
15693 "or C<~user> for another user)."
15697 #: ../fish/guestfish.pod:551
15699 "Note that home directory expansion happens for users known I<on the host>, "
15700 "not in the guest filesystem."
15704 #: ../fish/guestfish.pod:554
15706 "To use a literal argument which begins with a tilde, you have to quote it, "
15711 #: ../fish/guestfish.pod:557
15719 #: ../fish/guestfish.pod:561
15721 "Libguestfs has some support for Linux guests encrypted according to the "
15722 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
15723 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
15724 "LUKS is supported."
15728 #: ../fish/guestfish.pod:566
15729 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
15733 #: ../fish/guestfish.pod:568
15736 " ><fs> vfs-type /dev/sda2\n"
15742 #: ../fish/guestfish.pod:571
15744 "Then open those devices using L</luks-open>. This creates a device-mapper "
15745 "device called C</dev/mapper/luksdev>."
15749 #: ../fish/guestfish.pod:574
15752 " ><fs> luks-open /dev/sda2 luksdev\n"
15753 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
15758 #: ../fish/guestfish.pod:577
15760 "Finally you have to tell LVM to scan for volume groups on the newly created "
15765 #: ../fish/guestfish.pod:580
15769 " ><fs> vg-activate-all true\n"
15774 #: ../fish/guestfish.pod:583
15775 msgid "The logical volume(s) can now be mounted in the usual way."
15779 #: ../fish/guestfish.pod:585
15781 "Before closing a LUKS device you must unmount any logical volumes on it and "
15782 "deactivate the volume groups by calling C<vg-activate false VG> on each "
15783 "one. Then you can close the mapper device:"
15787 #: ../fish/guestfish.pod:589
15790 " ><fs> vg-activate false /dev/VG\n"
15791 " ><fs> luks-close /dev/mapper/luksdev\n"
15796 #: ../fish/guestfish.pod:592
15797 msgid "WINDOWS PATHS"
15801 #: ../fish/guestfish.pod:594
15803 "If a path is prefixed with C<win:> then you can use Windows-style paths "
15804 "(with some limitations). The following commands are equivalent:"
15808 #: ../fish/guestfish.pod:597
15811 " file /WINDOWS/system32/config/system.LOG\n"
15816 #: ../fish/guestfish.pod:599
15819 " file win:/windows/system32/config/system.log\n"
15824 #: ../fish/guestfish.pod:601
15827 " file win:\\windows\\system32\\config\\system.log\n"
15832 #: ../fish/guestfish.pod:603
15835 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
15840 #: ../fish/guestfish.pod:605
15842 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
15843 "handles case insensitivity like Windows would. This only works in argument "
15844 "positions that expect a path."
15848 #: ../fish/guestfish.pod:609
15849 msgid "UPLOADING AND DOWNLOADING FILES"
15853 #: ../fish/guestfish.pod:611
15855 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
15856 "others which upload from or download to a local file, you can use the "
15857 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
15861 #: ../fish/guestfish.pod:615
15869 #: ../fish/guestfish.pod:617
15871 "reads stdin and creates from that a file C</foo> in the disk image, and:"
15875 #: ../fish/guestfish.pod:620
15878 " tar-out /etc - | tar tf -\n"
15883 #: ../fish/guestfish.pod:622
15885 "writes the tarball to stdout and then pipes that into the external \"tar\" "
15886 "command (see L</PIPES>)."
15890 #: ../fish/guestfish.pod:625
15892 "When using C<-> to read from stdin, the input is read up to the end of "
15893 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
15894 "some arbitrary end marker:"
15898 #: ../fish/guestfish.pod:629
15901 " upload -<<END /foo\n"
15910 #: ../fish/guestfish.pod:635
15912 "Any string of characters can be used instead of C<END>. The end marker must "
15913 "appear on a line of its own, without any preceeding or following characters "
15914 "(not even spaces)."
15918 #: ../fish/guestfish.pod:639
15920 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
15921 "upload local files (so-called \"FileIn\" parameters in the generator)."
15925 #: ../fish/guestfish.pod:642
15926 msgid "EXIT ON ERROR BEHAVIOUR"
15930 #: ../fish/guestfish.pod:644
15932 "By default, guestfish will ignore any errors when in interactive mode (ie. "
15933 "taking commands from a human over a tty), and will exit on the first error "
15934 "in non-interactive mode (scripts, commands given on the command line)."
15938 #: ../fish/guestfish.pod:649
15940 "If you prefix a command with a I<-> character, then that command will not "
15941 "cause guestfish to exit, even if that (one) command returns an error."
15945 #: ../fish/guestfish.pod:653
15946 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
15950 #: ../fish/guestfish.pod:655
15952 "Guestfish can be remote-controlled over a socket. This is useful "
15953 "particularly in shell scripts where you want to make several different "
15954 "changes to a filesystem, but you don't want the overhead of starting up a "
15955 "guestfish process each time."
15959 #: ../fish/guestfish.pod:660
15960 msgid "Start a guestfish server process using:"
15964 #: ../fish/guestfish.pod:662
15967 " eval `guestfish --listen`\n"
15972 #: ../fish/guestfish.pod:664
15973 msgid "and then send it commands by doing:"
15977 #: ../fish/guestfish.pod:666
15980 " guestfish --remote cmd [...]\n"
15985 #: ../fish/guestfish.pod:668
15986 msgid "To cause the server to exit, send it the exit command:"
15990 #: ../fish/guestfish.pod:670
15993 " guestfish --remote exit\n"
15998 #: ../fish/guestfish.pod:672
16000 "Note that the server will normally exit if there is an error in a command. "
16001 "You can change this in the usual way. See section L</EXIT ON ERROR "
16006 #: ../fish/guestfish.pod:676
16007 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16011 #: ../fish/guestfish.pod:678
16013 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16014 "is how the I<--remote> option knows where to send the commands. You can "
16015 "have several guestfish listener processes running using:"
16019 #: ../fish/guestfish.pod:682
16022 " eval `guestfish --listen`\n"
16023 " pid1=$GUESTFISH_PID\n"
16024 " eval `guestfish --listen`\n"
16025 " pid2=$GUESTFISH_PID\n"
16027 " guestfish --remote=$pid1 cmd\n"
16028 " guestfish --remote=$pid2 cmd\n"
16033 #: ../fish/guestfish.pod:690
16034 msgid "REMOTE CONTROL DETAILS"
16038 #: ../fish/guestfish.pod:692
16040 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
16041 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
16042 "and C<$PID> is the process ID of the server."
16046 #: ../fish/guestfish.pod:696
16047 msgid "Guestfish client and server versions must match exactly."
16051 #: ../fish/guestfish.pod:698
16052 msgid "PREPARED DISK IMAGES"
16056 #: ../fish/guestfish.pod:700
16058 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
16059 "preformatted disk images that guestfish can make for you to save typing. "
16060 "This is particularly useful for testing purposes. This option is used "
16061 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
16062 "can be mixed with I<-a>)."
16066 #: ../fish/guestfish.pod:706
16068 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
16069 "the second and so on. Existing files in the current directory are "
16074 #: ../fish/guestfish.pod:710
16076 "The type briefly describes how the disk should be sized, partitioned, how "
16077 "filesystem(s) should be created, and how content should be added. "
16078 "Optionally the type can be followed by extra parameters, separated by C<:> "
16079 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
16080 "allocated disk, containing a single partition, with the partition formatted "
16081 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
16086 #: ../fish/guestfish.pod:718
16087 msgid "To list the available types and any extra parameters they take, run:"
16091 #: ../fish/guestfish.pod:722
16093 "Note that the prepared filesystem is not mounted. You would usually have to "
16094 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
16098 #: ../fish/guestfish.pod:726
16100 "If any I<-N> or I<--new> options are given, the guest is automatically "
16105 #: ../fish/guestfish.pod:731
16106 msgid "Create a 100MB disk with an ext4-formatted partition:"
16110 #: ../fish/guestfish.pod:733
16113 " guestfish -N fs:ext4\n"
16118 #: ../fish/guestfish.pod:735
16119 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
16123 #: ../fish/guestfish.pod:737
16126 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
16131 #: ../fish/guestfish.pod:739
16132 msgid "Create a blank 200MB disk:"
16136 #: ../fish/guestfish.pod:741
16139 " guestfish -N disk:200M\n"
16144 #: ../fish/guestfish.pod:743
16145 msgid "PROGRESS BARS"
16149 #: ../fish/guestfish.pod:745
16151 "Some (not all) long-running commands send progress notification messages as "
16152 "they are running. Guestfish turns these messages into progress bars."
16156 #: ../fish/guestfish.pod:749
16158 "When a command that supports progress bars takes longer than two seconds to "
16159 "run, and if progress bars are enabled, then you will see one appearing below "
16164 #: ../fish/guestfish.pod:753
16167 " ><fs> copy-size /large-file /another-file 2048M\n"
16168 " / 10% [#####-----------------------------------------] 00:30\n"
16173 #: ../fish/guestfish.pod:756
16175 "The spinner on the left hand side moves round once for every progress "
16176 "notification received from the backend. This is a (reasonably) golden "
16177 "assurance that the command is \"doing something\" even if the progress bar "
16178 "is not moving, because the command is able to send the progress "
16179 "notifications. When the bar reaches 100% and the command finishes, the "
16180 "spinner disappears."
16184 #: ../fish/guestfish.pod:763
16186 "Progress bars are enabled by default when guestfish is used interactively. "
16187 "You can enable them even for non-interactive modes using I<--progress-bars>, "
16188 "and you can disable them completely using I<--no-progress-bars>."
16192 #: ../fish/guestfish.pod:768
16193 msgid "GUESTFISH COMMANDS"
16197 #: ../fish/guestfish.pod:770
16199 "The commands in this section are guestfish convenience commands, in other "
16200 "words, they are not part of the L<guestfs(3)> API."
16204 #: ../fish/guestfish.pod:773
16205 msgid "alloc | allocate"
16209 #: ../fish/guestfish.pod:775
16212 " alloc filename size\n"
16217 #: ../fish/guestfish.pod:777
16219 "This creates an empty (zeroed) file of the given size, and then adds so it "
16220 "can be further examined."
16224 #: ../fish/guestfish.pod:780 ../fish/guestfish.pod:903
16225 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16229 #: ../fish/guestfish.pod:782 ../fish/guestfish.pod:905
16230 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16234 #: ../fish/guestfish.pod:784
16239 #: ../fish/guestfish.pod:786
16242 " copy-in local [local ...] /remotedir\n"
16247 #: ../fish/guestfish.pod:788
16249 "C<copy-in> copies local files or directories recursively into the disk "
16250 "image, placing them in the directory called C</remotedir> (which must "
16251 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16252 "other commands as necessary."
16256 #: ../fish/guestfish.pod:793
16258 "Multiple local files and directories can be specified, but the last "
16259 "parameter must always be a remote directory. Wildcards cannot be used."
16263 #: ../fish/guestfish.pod:797
16268 #: ../fish/guestfish.pod:799
16271 " copy-out remote [remote ...] localdir\n"
16276 #: ../fish/guestfish.pod:801
16278 "C<copy-out> copies remote files or directories recursively out of the disk "
16279 "image, placing them on the host disk in a local directory called C<localdir> "
16280 "(which must exist). This guestfish meta-command turns into a sequence of L</"
16281 "download>, L</tar-out> and other commands as necessary."
16285 #: ../fish/guestfish.pod:807
16287 "Multiple remote files and directories can be specified, but the last "
16288 "parameter must always be a local directory. To download to the current "
16289 "directory, use C<.> as in:"
16293 #: ../fish/guestfish.pod:811
16296 " copy-out /home .\n"
16301 #: ../fish/guestfish.pod:813
16303 "Wildcards cannot be used in the ordinary command, but you can use them with "
16304 "the help of L</glob> like this:"
16308 #: ../fish/guestfish.pod:816
16311 " glob copy-out /home/* .\n"
16316 #: ../fish/guestfish.pod:818
16321 #: ../fish/guestfish.pod:820
16324 " echo [params ...]\n"
16329 #: ../fish/guestfish.pod:822
16330 msgid "This echos the parameters to the terminal."
16334 #: ../fish/guestfish.pod:824
16335 msgid "edit | vi | emacs"
16339 #: ../fish/guestfish.pod:826
16347 #: ../fish/guestfish.pod:828
16349 "This is used to edit a file. It downloads the file, edits it locally using "
16350 "your editor, then uploads the result."
16354 #: ../fish/guestfish.pod:831
16356 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16357 "or C<emacs> you will get those corresponding editors."
16361 #: ../fish/guestfish.pod:835
16366 #: ../fish/guestfish.pod:837
16369 " glob command args...\n"
16374 #: ../fish/guestfish.pod:839
16376 "Expand wildcards in any paths in the args list, and run C<command> "
16377 "repeatedly on each matching path."
16381 #: ../fish/guestfish.pod:842
16382 msgid "See section WILDCARDS AND GLOBBING."
16386 #: ../fish/guestfish.pod:844
16391 #: ../fish/guestfish.pod:846
16400 #: ../fish/guestfish.pod:849
16402 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
16403 "this displays detailed help for a command."
16407 #: ../fish/guestfish.pod:852
16412 #: ../fish/guestfish.pod:854
16420 #: ../fish/guestfish.pod:856
16422 "Change the local directory, ie. the current directory of guestfish itself."
16426 #: ../fish/guestfish.pod:859
16427 msgid "Note that C<!cd> won't do what you might expect."
16431 #: ../fish/guestfish.pod:861
16432 msgid "man | manual"
16436 #: ../fish/guestfish.pod:863
16444 #: ../fish/guestfish.pod:865
16445 msgid "Opens the manual page for guestfish."
16449 #: ../fish/guestfish.pod:867
16450 msgid "more | less"
16454 #: ../fish/guestfish.pod:869
16462 #: ../fish/guestfish.pod:871
16470 #: ../fish/guestfish.pod:873
16471 msgid "This is used to view a file."
16475 #: ../fish/guestfish.pod:875
16477 "The default viewer is C<$PAGER>. However if you use the alternate command "
16478 "C<less> you will get the C<less> command specifically."
16482 #: ../fish/guestfish.pod:878
16483 msgid "quit | exit"
16487 #: ../fish/guestfish.pod:880
16488 msgid "This exits guestfish. You can also use C<^D> key."
16492 #: ../fish/guestfish.pod:882
16497 #: ../fish/guestfish.pod:884
16505 #: ../fish/guestfish.pod:886
16507 "Close and reopen the libguestfs handle. It is not necessary to use this "
16508 "normally, because the handle is closed properly when guestfish exits. "
16509 "However this is occasionally useful for testing."
16513 #: ../fish/guestfish.pod:890
16518 #: ../fish/guestfish.pod:892
16521 " sparse filename size\n"
16526 #: ../fish/guestfish.pod:894
16528 "This creates an empty sparse file of the given size, and then adds so it can "
16529 "be further examined."
16533 #: ../fish/guestfish.pod:897
16535 "In all respects it works the same as the C<alloc> command, except that the "
16536 "image file is allocated sparsely, which means that disk blocks are not "
16537 "assigned to the file until they are needed. Sparse disk files only use "
16538 "space when written to, but they are slower and there is a danger you could "
16539 "run out of real disk space during a write operation."
16543 #: ../fish/guestfish.pod:907
16548 #: ../fish/guestfish.pod:909
16556 #: ../fish/guestfish.pod:911
16558 "This command returns a list of the optional groups known to the daemon, and "
16559 "indicates which ones are supported by this build of the libguestfs appliance."
16563 #: ../fish/guestfish.pod:915
16564 msgid "See also L<guestfs(3)/AVAILABILITY>."
16568 #: ../fish/guestfish.pod:917
16573 #: ../fish/guestfish.pod:919
16576 " time command args...\n"
16581 #: ../fish/guestfish.pod:921
16583 "Run the command as usual, but print the elapsed time afterwards. This can "
16584 "be useful for benchmarking operations."
16588 #: ../fish/guestfish.pod:924
16593 #: ../fish/guestfish.pod:928 ../test-tool/libguestfs-test-tool.pod:83
16598 #: ../fish/guestfish.pod:930
16600 "guestfish returns 0 if the commands completed without error, or 1 if there "
16605 #: ../fish/guestfish.pod:937
16610 #: ../fish/guestfish.pod:939
16612 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
16617 #: ../fish/guestfish.pod:942
16618 msgid "GUESTFISH_PID"
16622 #: ../fish/guestfish.pod:944
16624 "Used with the I<--remote> option to specify the remote guestfish process to "
16625 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16629 #: ../fish/guestfish.pod:948
16634 #: ../fish/guestfish.pod:950
16636 "If compiled with GNU readline support, various files in the home directory "
16637 "can be used. See L</FILES>."
16641 #: ../fish/guestfish.pod:959
16643 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16644 "effect as using the B<-v> option."
16648 #: ../fish/guestfish.pod:971
16650 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16651 "the discussion of paths in L<guestfs(3)>."
16655 #: ../fish/guestfish.pod:982
16656 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16660 #: ../fish/guestfish.pod:984
16665 #: ../fish/guestfish.pod:986
16667 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16672 #: ../fish/guestfish.pod:1001 ../test-tool/libguestfs-test-tool.pod:88
16677 #: ../fish/guestfish.pod:1005
16678 msgid "$HOME/.guestfish"
16682 #: ../fish/guestfish.pod:1007
16684 "If compiled with GNU readline support, then the command history is saved in "
16689 #: ../fish/guestfish.pod:1010
16690 msgid "$HOME/.inputrc"
16694 #: ../fish/guestfish.pod:1012
16695 msgid "/etc/inputrc"
16699 #: ../fish/guestfish.pod:1014
16701 "If compiled with GNU readline support, then these files can be used to "
16702 "configure readline. For further information, please see L<readline(3)/"
16703 "INITIALIZATION FILE>."
16707 #: ../fish/guestfish.pod:1018
16708 msgid "To write rules which only apply to guestfish, use:"
16712 #: ../fish/guestfish.pod:1020
16722 #: ../fish/guestfish.pod:1024
16724 "Variables that you can set in inputrc that change the behaviour of guestfish "
16725 "in useful ways include:"
16729 #: ../fish/guestfish.pod:1029
16730 msgid "completion-ignore-case (default: on)"
16734 #: ../fish/guestfish.pod:1031
16736 "By default, guestfish will ignore case when tab-completing paths on the "
16741 #: ../fish/guestfish.pod:1034
16744 " set completion-ignore-case off\n"
16749 #: ../fish/guestfish.pod:1036
16750 msgid "to make guestfish case sensitive."
16754 #: ../fish/guestfish.pod:1040
16759 #: ../fish/guestfish.pod:1042
16760 msgid "test2.img (etc)"
16764 #: ../fish/guestfish.pod:1044
16766 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16767 "will be created in the file C<test1.img> in the current directory. The "
16768 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16769 "the same name will be overwritten."
16773 #: ../fish/guestfish.pod:1053
16775 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16776 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16777 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16778 "L<virt-tar(1)>, L<virt-win-reg(1)>."
16782 #: ../fish/guestfish.pod:1076 ../test-tool/libguestfs-test-tool.pod:124
16783 #: ../fuse/guestmount.pod:198 ../inspector/virt-inspector.pl:865
16784 #: ../tools/virt-cat.pl:181 ../tools/virt-df.pl:499 ../tools/virt-edit.pl:345
16785 #: ../tools/virt-list-filesystems.pl:211 ../tools/virt-list-partitions.pl:248
16786 #: ../tools/virt-ls.pl:229 ../tools/virt-make-fs.pl:560
16787 #: ../tools/virt-rescue.pl:249 ../tools/virt-resize.pl:1415
16788 #: ../tools/virt-tar.pl:276 ../tools/virt-win-reg.pl:495
16790 "This program is free software; you can redistribute it and/or modify it "
16791 "under the terms of the GNU General Public License as published by the Free "
16792 "Software Foundation; either version 2 of the License, or (at your option) "
16793 "any later version."
16797 #: ../fish/guestfish.pod:1081 ../test-tool/libguestfs-test-tool.pod:129
16798 #: ../fuse/guestmount.pod:203 ../inspector/virt-inspector.pl:870
16799 #: ../tools/virt-cat.pl:186 ../tools/virt-df.pl:504 ../tools/virt-edit.pl:350
16800 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:253
16801 #: ../tools/virt-ls.pl:234 ../tools/virt-make-fs.pl:565
16802 #: ../tools/virt-rescue.pl:254 ../tools/virt-resize.pl:1420
16803 #: ../tools/virt-tar.pl:281 ../tools/virt-win-reg.pl:500
16805 "This program is distributed in the hope that it will be useful, but WITHOUT "
16806 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
16807 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
16812 #: ../fish/guestfish.pod:1086 ../test-tool/libguestfs-test-tool.pod:134
16813 #: ../fuse/guestmount.pod:208 ../inspector/virt-inspector.pl:875
16814 #: ../tools/virt-cat.pl:191 ../tools/virt-df.pl:509 ../tools/virt-edit.pl:355
16815 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:258
16816 #: ../tools/virt-ls.pl:239 ../tools/virt-make-fs.pl:570
16817 #: ../tools/virt-rescue.pl:259 ../tools/virt-resize.pl:1425
16818 #: ../tools/virt-tar.pl:286 ../tools/virt-win-reg.pl:505
16820 "You should have received a copy of the GNU General Public License along with "
16821 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
16822 "Ave, Cambridge, MA 02139, USA."
16826 #: ../fish/guestfish-actions.pod:1
16827 msgid "add-cdrom | cdrom"
16831 #: ../fish/guestfish-actions.pod:3
16834 " add-cdrom filename\n"
16839 #: ../fish/guestfish-actions.pod:15
16841 "This call checks for the existence of C<filename>. This stops you from "
16842 "specifying other types of drive which are supported by qemu such as C<nbd:> "
16843 "and C<http:> URLs. To specify those, use the general C<config> call instead."
16847 #: ../fish/guestfish-actions.pod:22
16849 "If you just want to add an ISO file (often you use this as an efficient way "
16850 "to transfer large files into the guest), then you should probably use C<add-"
16851 "drive-ro> instead."
16855 #: ../fish/guestfish-actions.pod:28
16856 msgid "add-drive | add"
16860 #: ../fish/guestfish-actions.pod:30
16863 " add-drive filename\n"
16868 #: ../fish/guestfish-actions.pod:49 ../fish/guestfish-actions.pod:75
16870 "C<if=...> is set at compile time by the configuration option C<./configure --"
16871 "with-drive-if=...>. In the rare case where you might need to change this at "
16872 "run time, use C<add-drive-with-if> or C<add-drive-ro-with-if>."
16876 #: ../fish/guestfish-actions.pod:54 ../fish/guestfish-actions.pod:80
16878 "Note that this call checks for the existence of C<filename>. This stops you "
16879 "from specifying other types of drive which are supported by qemu such as "
16880 "C<nbd:> and C<http:> URLs. To specify those, use the general C<config> call "
16885 #: ../fish/guestfish-actions.pod:59
16886 msgid "add-drive-ro | add-ro"
16890 #: ../fish/guestfish-actions.pod:61
16893 " add-drive-ro filename\n"
16898 #: ../fish/guestfish-actions.pod:85
16899 msgid "add-drive-ro-with-if"
16903 #: ../fish/guestfish-actions.pod:87
16906 " add-drive-ro-with-if filename iface\n"
16911 #: ../fish/guestfish-actions.pod:89
16913 "This is the same as C<add-drive-ro> but it allows you to specify the QEMU "
16914 "interface emulation to use at run time."
16918 #: ../fish/guestfish-actions.pod:92
16919 msgid "add-drive-with-if"
16923 #: ../fish/guestfish-actions.pod:94
16926 " add-drive-with-if filename iface\n"
16931 #: ../fish/guestfish-actions.pod:96
16933 "This is the same as C<add-drive> but it allows you to specify the QEMU "
16934 "interface emulation to use at run time."
16938 #: ../fish/guestfish-actions.pod:99
16943 #: ../fish/guestfish-actions.pod:101
16946 " aug-clear augpath\n"
16951 #: ../fish/guestfish-actions.pod:106
16956 #: ../fish/guestfish-actions.pod:108
16964 #: ../fish/guestfish-actions.pod:110
16966 "Close the current Augeas handle and free up any resources used by it. After "
16967 "calling this, you have to call C<aug-init> again before you can use any "
16968 "other Augeas functions."
16972 #: ../fish/guestfish-actions.pod:115
16973 msgid "aug-defnode"
16977 #: ../fish/guestfish-actions.pod:117
16980 " aug-defnode name expr val\n"
16985 #: ../fish/guestfish-actions.pod:122
16987 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
16988 "calling C<aug-set> C<expr>, C<value>. C<name> will be the nodeset "
16989 "containing that single node."
16993 #: ../fish/guestfish-actions.pod:130
16998 #: ../fish/guestfish-actions.pod:132
17001 " aug-defvar name expr\n"
17006 #: ../fish/guestfish-actions.pod:141
17011 #: ../fish/guestfish-actions.pod:143
17014 " aug-get augpath\n"
17019 #: ../fish/guestfish-actions.pod:148
17024 #: ../fish/guestfish-actions.pod:150
17027 " aug-init root flags\n"
17032 #: ../fish/guestfish-actions.pod:156
17033 msgid "You must call this before using any other C<aug-*> commands."
17037 #: ../fish/guestfish-actions.pod:191
17038 msgid "Do not load the tree in C<aug-init>."
17042 #: ../fish/guestfish-actions.pod:195
17043 msgid "To close the handle, you can call C<aug-close>."
17047 #: ../fish/guestfish-actions.pod:199
17052 #: ../fish/guestfish-actions.pod:201
17055 " aug-insert augpath label true|false\n"
17060 #: ../fish/guestfish-actions.pod:211
17065 #: ../fish/guestfish-actions.pod:213
17073 #: ../fish/guestfish-actions.pod:220
17078 #: ../fish/guestfish-actions.pod:222
17081 " aug-ls augpath\n"
17086 #: ../fish/guestfish-actions.pod:224
17088 "This is just a shortcut for listing C<aug-match> C<path/*> and sorting the "
17089 "resulting nodes into alphabetical order."
17093 #: ../fish/guestfish-actions.pod:227
17098 #: ../fish/guestfish-actions.pod:229
17101 " aug-match augpath\n"
17106 #: ../fish/guestfish-actions.pod:235
17111 #: ../fish/guestfish-actions.pod:237
17114 " aug-mv src dest\n"
17119 #: ../fish/guestfish-actions.pod:242
17124 #: ../fish/guestfish-actions.pod:244
17127 " aug-rm augpath\n"
17132 #: ../fish/guestfish-actions.pod:250
17137 #: ../fish/guestfish-actions.pod:252
17145 #: ../fish/guestfish-actions.pod:256
17147 "The flags which were passed to C<aug-init> affect exactly how files are "
17152 #: ../fish/guestfish-actions.pod:259
17157 #: ../fish/guestfish-actions.pod:261
17160 " aug-set augpath val\n"
17165 #: ../fish/guestfish-actions.pod:265
17167 "In the Augeas API, it is possible to clear a node by setting the value to "
17168 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17169 "this call. Instead you must use the C<aug-clear> call."
17173 #: ../fish/guestfish-actions.pod:270
17178 #: ../fish/guestfish-actions.pod:272
17181 " available 'groups ...'\n"
17186 #: ../fish/guestfish-actions.pod:278
17188 "The libguestfs groups, and the functions that those groups correspond to, "
17189 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17190 "runtime by calling C<available-all-groups>."
17194 #: ../fish/guestfish-actions.pod:302
17195 msgid "You must call C<launch> before calling this function."
17199 #: ../fish/guestfish-actions.pod:324
17201 "This call was added in version C<1.0.80>. In previous versions of "
17202 "libguestfs all you could do would be to speculatively execute a command to "
17203 "find out if the daemon implemented it. See also C<version>."
17207 #: ../fish/guestfish-actions.pod:331
17208 msgid "available-all-groups"
17212 #: ../fish/guestfish-actions.pod:333
17215 " available-all-groups\n"
17220 #: ../fish/guestfish-actions.pod:335
17222 "This command returns a list of all optional groups that this daemon knows "
17223 "about. Note this returns both supported and unsupported groups. To find "
17224 "out which ones the daemon can actually support you have to call C<available> "
17225 "on each member of the returned list."
17229 #: ../fish/guestfish-actions.pod:341
17230 msgid "See also C<available> and L<guestfs(3)/AVAILABILITY>."
17234 #: ../fish/guestfish-actions.pod:343
17239 #: ../fish/guestfish-actions.pod:345
17242 " base64-in (base64file|-) filename\n"
17247 #: ../fish/guestfish-actions.pod:350 ../fish/guestfish-actions.pod:359
17248 #: ../fish/guestfish-actions.pod:583 ../fish/guestfish-actions.pod:730
17249 #: ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:1154
17250 #: ../fish/guestfish-actions.pod:3702 ../fish/guestfish-actions.pod:3714
17251 #: ../fish/guestfish-actions.pod:3725 ../fish/guestfish-actions.pod:3736
17252 #: ../fish/guestfish-actions.pod:3788 ../fish/guestfish-actions.pod:3797
17253 #: ../fish/guestfish-actions.pod:3847
17254 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17258 #: ../fish/guestfish-actions.pod:352
17263 #: ../fish/guestfish-actions.pod:354
17266 " base64-out filename (base64file|-)\n"
17271 #: ../fish/guestfish-actions.pod:361
17272 msgid "blockdev-flushbufs"
17276 #: ../fish/guestfish-actions.pod:363
17279 " blockdev-flushbufs device\n"
17284 #: ../fish/guestfish-actions.pod:370
17285 msgid "blockdev-getbsz"
17289 #: ../fish/guestfish-actions.pod:372
17292 " blockdev-getbsz device\n"
17297 #: ../fish/guestfish-actions.pod:381
17298 msgid "blockdev-getro"
17302 #: ../fish/guestfish-actions.pod:383
17305 " blockdev-getro device\n"
17310 #: ../fish/guestfish-actions.pod:390
17311 msgid "blockdev-getsize64"
17315 #: ../fish/guestfish-actions.pod:392
17318 " blockdev-getsize64 device\n"
17323 #: ../fish/guestfish-actions.pod:396
17324 msgid "See also C<blockdev-getsz>."
17328 #: ../fish/guestfish-actions.pod:400
17329 msgid "blockdev-getss"
17333 #: ../fish/guestfish-actions.pod:402
17336 " blockdev-getss device\n"
17341 #: ../fish/guestfish-actions.pod:407
17343 "(Note, this is not the size in sectors, use C<blockdev-getsz> for that)."
17347 #: ../fish/guestfish-actions.pod:412
17348 msgid "blockdev-getsz"
17352 #: ../fish/guestfish-actions.pod:414
17355 " blockdev-getsz device\n"
17360 #: ../fish/guestfish-actions.pod:419
17362 "See also C<blockdev-getss> for the real sector size of the device, and "
17363 "C<blockdev-getsize64> for the more useful I<size in bytes>."
17367 #: ../fish/guestfish-actions.pod:425
17368 msgid "blockdev-rereadpt"
17372 #: ../fish/guestfish-actions.pod:427
17375 " blockdev-rereadpt device\n"
17380 #: ../fish/guestfish-actions.pod:433
17381 msgid "blockdev-setbsz"
17385 #: ../fish/guestfish-actions.pod:435
17388 " blockdev-setbsz device blocksize\n"
17393 #: ../fish/guestfish-actions.pod:444
17394 msgid "blockdev-setro"
17398 #: ../fish/guestfish-actions.pod:446
17401 " blockdev-setro device\n"
17406 #: ../fish/guestfish-actions.pod:452
17407 msgid "blockdev-setrw"
17411 #: ../fish/guestfish-actions.pod:454
17414 " blockdev-setrw device\n"
17419 #: ../fish/guestfish-actions.pod:460
17420 msgid "case-sensitive-path"
17424 #: ../fish/guestfish-actions.pod:462
17427 " case-sensitive-path path\n"
17432 #: ../fish/guestfish-actions.pod:486
17434 "Thus C<case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
17435 "WINDOWS/system32\"> (the exact return value would depend on details of how "
17436 "the directories were originally created under Windows)."
17440 #: ../fish/guestfish-actions.pod:494
17441 msgid "See also C<realpath>."
17445 #: ../fish/guestfish-actions.pod:496
17450 #: ../fish/guestfish-actions.pod:498
17458 #: ../fish/guestfish-actions.pod:502
17460 "Note that this function cannot correctly handle binary files (specifically, "
17461 "files containing C<\\0> character which is treated as end of string). For "
17462 "those you need to use the C<read-file> or C<download> functions which have a "
17463 "more complex interface."
17467 #: ../fish/guestfish-actions.pod:510
17472 #: ../fish/guestfish-actions.pod:512
17475 " checksum csumtype path\n"
17480 #: ../fish/guestfish-actions.pod:555
17481 msgid "To get the checksum for a device, use C<checksum-device>."
17485 #: ../fish/guestfish-actions.pod:557
17486 msgid "To get the checksums for many files, use C<checksums-out>."
17490 #: ../fish/guestfish-actions.pod:559
17491 msgid "checksum-device"
17495 #: ../fish/guestfish-actions.pod:561
17498 " checksum-device csumtype device\n"
17503 #: ../fish/guestfish-actions.pod:563
17505 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
17506 "device named C<device>. For the types of checksums supported see the "
17507 "C<checksum> command."
17511 #: ../fish/guestfish-actions.pod:567
17512 msgid "checksums-out"
17516 #: ../fish/guestfish-actions.pod:569
17519 " checksums-out csumtype directory (sumsfile|-)\n"
17524 #: ../fish/guestfish-actions.pod:585
17529 #: ../fish/guestfish-actions.pod:587
17532 " chmod mode path\n"
17537 #: ../fish/guestfish-actions.pod:598
17542 #: ../fish/guestfish-actions.pod:600
17545 " chown owner group path\n"
17550 #: ../fish/guestfish-actions.pod:608
17555 #: ../fish/guestfish-actions.pod:610
17558 " command 'arguments ...'\n"
17563 #: ../fish/guestfish-actions.pod:617
17565 "The single parameter is an argv-style list of arguments. The first element "
17566 "is the name of the program to run. Subsequent elements are parameters. The "
17567 "list must be non-empty (ie. must contain a program name). Note that the "
17568 "command runs directly, and is I<not> invoked via the shell (see C<sh>)."
17572 #: ../fish/guestfish-actions.pod:645
17573 msgid "command-lines"
17577 #: ../fish/guestfish-actions.pod:647
17580 " command-lines 'arguments ...'\n"
17585 #: ../fish/guestfish-actions.pod:649
17587 "This is the same as C<command>, but splits the result into a list of lines."
17591 #: ../fish/guestfish-actions.pod:652
17592 msgid "See also: C<sh-lines>"
17596 #: ../fish/guestfish-actions.pod:657
17601 #: ../fish/guestfish-actions.pod:659
17604 " config qemuparam qemuvalue\n"
17609 #: ../fish/guestfish-actions.pod:670
17614 #: ../fish/guestfish-actions.pod:672
17617 " copy-size src dest size\n"
17622 #: ../fish/guestfish-actions.pod:680
17627 #: ../fish/guestfish-actions.pod:682
17635 #: ../fish/guestfish-actions.pod:687
17640 #: ../fish/guestfish-actions.pod:689
17648 #: ../fish/guestfish-actions.pod:694
17653 #: ../fish/guestfish-actions.pod:696
17661 #: ../fish/guestfish-actions.pod:703
17663 "If the destination is a device, it must be as large or larger than the "
17664 "source file or device, otherwise the copy will fail. This command cannot do "
17665 "partial copies (see C<copy-size>)."
17669 #: ../fish/guestfish-actions.pod:707
17674 #: ../fish/guestfish-actions.pod:709
17677 " debug subcmd 'extraargs ...'\n"
17682 #: ../fish/guestfish-actions.pod:711
17684 "The C<debug> command exposes some internals of C<guestfsd> (the guestfs "
17685 "daemon) that runs inside the qemu subprocess."
17689 #: ../fish/guestfish-actions.pod:719
17690 msgid "debug-upload"
17694 #: ../fish/guestfish-actions.pod:721
17697 " debug-upload (filename|-) tmpname mode\n"
17702 #: ../fish/guestfish-actions.pod:723
17703 msgid "The C<debug-upload> command uploads a file to the libguestfs appliance."
17707 #: ../fish/guestfish-actions.pod:732
17712 #: ../fish/guestfish-actions.pod:734
17720 #: ../fish/guestfish-actions.pod:742
17725 #: ../fish/guestfish-actions.pod:744
17733 #: ../fish/guestfish-actions.pod:753
17738 #: ../fish/guestfish-actions.pod:755
17746 #: ../fish/guestfish-actions.pod:761
17748 "Another way to get the same information is to enable verbose messages with "
17749 "C<set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17750 "before running the program."
17754 #: ../fish/guestfish-actions.pod:766
17759 #: ../fish/guestfish-actions.pod:768
17762 " download remotefilename (filename|-)\n"
17767 #: ../fish/guestfish-actions.pod:775
17768 msgid "See also C<upload>, C<cat>."
17772 #: ../fish/guestfish-actions.pod:779
17773 msgid "drop-caches"
17777 #: ../fish/guestfish-actions.pod:781
17780 " drop-caches whattodrop\n"
17785 #: ../fish/guestfish-actions.pod:793
17790 #: ../fish/guestfish-actions.pod:795
17798 #: ../fish/guestfish-actions.pod:807
17803 #: ../fish/guestfish-actions.pod:809
17806 " e2fsck-f device\n"
17811 #: ../fish/guestfish-actions.pod:815
17813 "This command is only needed because of C<resize2fs> (q.v.). Normally you "
17814 "should use C<fsck>."
17818 #: ../fish/guestfish-actions.pod:818
17819 msgid "echo-daemon"
17823 #: ../fish/guestfish-actions.pod:820
17826 " echo-daemon 'words ...'\n"
17831 #: ../fish/guestfish-actions.pod:827
17832 msgid "See also C<ping-daemon>."
17836 #: ../fish/guestfish-actions.pod:829
17841 #: ../fish/guestfish-actions.pod:831
17844 " egrep regex path\n"
17849 #: ../fish/guestfish-actions.pod:839
17854 #: ../fish/guestfish-actions.pod:841
17857 " egrepi regex path\n"
17862 #: ../fish/guestfish-actions.pod:849
17867 #: ../fish/guestfish-actions.pod:851
17870 " equal file1 file2\n"
17875 #: ../fish/guestfish-actions.pod:858
17880 #: ../fish/guestfish-actions.pod:860
17888 #: ../fish/guestfish-actions.pod:865
17889 msgid "See also C<is-file>, C<is-dir>, C<stat>."
17893 #: ../fish/guestfish-actions.pod:867
17898 #: ../fish/guestfish-actions.pod:869
17901 " fallocate path len\n"
17906 #: ../fish/guestfish-actions.pod:886
17907 msgid "fallocate64"
17911 #: ../fish/guestfish-actions.pod:888
17914 " fallocate64 path len\n"
17919 #: ../fish/guestfish-actions.pod:894
17921 "Note that this call allocates disk blocks for the file. To create a sparse "
17922 "file use C<truncate-size> instead."
17926 #: ../fish/guestfish-actions.pod:897
17928 "The deprecated call C<fallocate> does the same, but owing to an oversight it "
17929 "only allowed 30 bit lengths to be specified, effectively limiting the "
17930 "maximum size of files created through that call to 1GB."
17934 #: ../fish/guestfish-actions.pod:906
17939 #: ../fish/guestfish-actions.pod:908
17942 " fgrep pattern path\n"
17947 #: ../fish/guestfish-actions.pod:916
17952 #: ../fish/guestfish-actions.pod:918
17955 " fgrepi pattern path\n"
17960 #: ../fish/guestfish-actions.pod:926
17965 #: ../fish/guestfish-actions.pod:928
17973 #: ../fish/guestfish-actions.pod:940
17975 "This command can also be used on C</dev/> devices (and partitions, LV "
17976 "names). You can for example use this to determine if a device contains a "
17977 "filesystem, although it's usually better to use C<vfs-type>."
17981 #: ../fish/guestfish-actions.pod:950
17982 msgid "file-architecture"
17986 #: ../fish/guestfish-actions.pod:952
17989 " file-architecture filename\n"
17994 #: ../fish/guestfish-actions.pod:1055
17999 #: ../fish/guestfish-actions.pod:1057
18007 #: ../fish/guestfish-actions.pod:1061
18009 "To get other stats about a file, use C<stat>, C<lstat>, C<is-dir>, C<is-"
18010 "file> etc. To get the size of block devices, use C<blockdev-getsize64>."
18014 #: ../fish/guestfish-actions.pod:1065
18019 #: ../fish/guestfish-actions.pod:1067
18022 " fill c len path\n"
18027 #: ../fish/guestfish-actions.pod:1073
18029 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18030 "C<truncate-size>. To create a file with a pattern of repeating bytes use "
18035 #: ../fish/guestfish-actions.pod:1078
18036 msgid "fill-pattern"
18040 #: ../fish/guestfish-actions.pod:1080
18043 " fill-pattern pattern len path\n"
18048 #: ../fish/guestfish-actions.pod:1082
18050 "This function is like C<fill> except that it creates a new file of length "
18051 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18052 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18057 #: ../fish/guestfish-actions.pod:1087
18062 #: ../fish/guestfish-actions.pod:1089
18065 " find directory\n"
18070 #: ../fish/guestfish-actions.pod:1103
18071 msgid "then the returned list from C<find> C</tmp> would be 4 elements:"
18075 #: ../fish/guestfish-actions.pod:1116
18076 msgid "See also C<find0>."
18080 #: ../fish/guestfish-actions.pod:1121
18085 #: ../fish/guestfish-actions.pod:1123
18088 " find0 directory (files|-)\n"
18093 #: ../fish/guestfish-actions.pod:1129
18095 "This command works the same way as C<find> with the following exceptions:"
18099 #: ../fish/guestfish-actions.pod:1156
18100 msgid "findfs-label"
18104 #: ../fish/guestfish-actions.pod:1158
18107 " findfs-label label\n"
18112 #: ../fish/guestfish-actions.pod:1164
18113 msgid "To find the label of a filesystem, use C<vfs-label>."
18117 #: ../fish/guestfish-actions.pod:1166
18118 msgid "findfs-uuid"
18122 #: ../fish/guestfish-actions.pod:1168
18125 " findfs-uuid uuid\n"
18130 #: ../fish/guestfish-actions.pod:1174
18131 msgid "To find the UUID of a filesystem, use C<vfs-uuid>."
18135 #: ../fish/guestfish-actions.pod:1176
18140 #: ../fish/guestfish-actions.pod:1178
18143 " fsck fstype device\n"
18148 #: ../fish/guestfish-actions.pod:1208
18153 #: ../fish/guestfish-actions.pod:1210
18161 #: ../fish/guestfish-actions.pod:1217
18162 msgid "get-autosync"
18166 #: ../fish/guestfish-actions.pod:1219
18174 #: ../fish/guestfish-actions.pod:1223
18179 #: ../fish/guestfish-actions.pod:1225
18187 #: ../fish/guestfish-actions.pod:1229
18188 msgid "get-e2label"
18192 #: ../fish/guestfish-actions.pod:1231
18195 " get-e2label device\n"
18200 #: ../fish/guestfish-actions.pod:1243
18205 #: ../fish/guestfish-actions.pod:1245
18208 " get-e2uuid device\n"
18213 #: ../fish/guestfish-actions.pod:1257
18214 msgid "get-memsize"
18218 #: ../fish/guestfish-actions.pod:1259
18226 #: ../fish/guestfish-actions.pod:1264
18228 "If C<set-memsize> was not called on this handle, and if "
18229 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18230 "value for memsize."
18234 #: ../fish/guestfish-actions.pod:1271
18235 msgid "get-network"
18239 #: ../fish/guestfish-actions.pod:1273
18247 #: ../fish/guestfish-actions.pod:1277
18252 #: ../fish/guestfish-actions.pod:1279
18260 #: ../fish/guestfish-actions.pod:1286
18261 msgid "get-pid | pid"
18265 #: ../fish/guestfish-actions.pod:1288
18273 #: ../fish/guestfish-actions.pod:1295
18278 #: ../fish/guestfish-actions.pod:1297
18286 #: ../fish/guestfish-actions.pod:1304
18287 msgid "get-recovery-proc"
18291 #: ../fish/guestfish-actions.pod:1306
18294 " get-recovery-proc\n"
18299 #: ../fish/guestfish-actions.pod:1310
18300 msgid "get-selinux"
18304 #: ../fish/guestfish-actions.pod:1312
18312 #: ../fish/guestfish-actions.pod:1314
18314 "This returns the current setting of the selinux flag which is passed to the "
18315 "appliance at boot time. See C<set-selinux>."
18319 #: ../fish/guestfish-actions.pod:1320
18324 #: ../fish/guestfish-actions.pod:1322
18332 #: ../fish/guestfish-actions.pod:1329
18337 #: ../fish/guestfish-actions.pod:1331
18345 #: ../fish/guestfish-actions.pod:1335
18350 #: ../fish/guestfish-actions.pod:1337
18358 #: ../fish/guestfish-actions.pod:1339
18360 "Return the current umask. By default the umask is C<022> unless it has been "
18361 "set by calling C<umask>."
18365 #: ../fish/guestfish-actions.pod:1342
18366 msgid "get-verbose"
18370 #: ../fish/guestfish-actions.pod:1344
18378 #: ../fish/guestfish-actions.pod:1348
18383 #: ../fish/guestfish-actions.pod:1350
18391 #: ../fish/guestfish-actions.pod:1354
18392 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<setcon>"
18396 #: ../fish/guestfish-actions.pod:1357
18401 #: ../fish/guestfish-actions.pod:1359
18404 " getxattrs path\n"
18409 #: ../fish/guestfish-actions.pod:1367
18410 msgid "See also: C<lgetxattrs>, L<attr(5)>."
18414 #: ../fish/guestfish-actions.pod:1369
18415 msgid "glob-expand"
18419 #: ../fish/guestfish-actions.pod:1371
18422 " glob-expand pattern\n"
18427 #: ../fish/guestfish-actions.pod:1384
18432 #: ../fish/guestfish-actions.pod:1386
18435 " grep regex path\n"
18440 #: ../fish/guestfish-actions.pod:1394
18445 #: ../fish/guestfish-actions.pod:1396
18448 " grepi regex path\n"
18453 #: ../fish/guestfish-actions.pod:1404
18454 msgid "grub-install"
18458 #: ../fish/guestfish-actions.pod:1406
18461 " grub-install root device\n"
18466 #: ../fish/guestfish-actions.pod:1422
18471 #: ../fish/guestfish-actions.pod:1424
18479 #: ../fish/guestfish-actions.pod:1432
18484 #: ../fish/guestfish-actions.pod:1434
18487 " head-n nrlines path\n"
18492 #: ../fish/guestfish-actions.pod:1447
18497 #: ../fish/guestfish-actions.pod:1449
18505 #: ../fish/guestfish-actions.pod:1457
18510 #: ../fish/guestfish-actions.pod:1459
18513 " initrd-cat initrdpath filename\n"
18518 #: ../fish/guestfish-actions.pod:1471
18519 msgid "See also C<initrd-list>."
18523 #: ../fish/guestfish-actions.pod:1476
18524 msgid "initrd-list"
18528 #: ../fish/guestfish-actions.pod:1478
18531 " initrd-list path\n"
18536 #: ../fish/guestfish-actions.pod:1490
18537 msgid "inotify-add-watch"
18541 #: ../fish/guestfish-actions.pod:1492
18544 " inotify-add-watch path mask\n"
18549 #: ../fish/guestfish-actions.pod:1504
18550 msgid "inotify-close"
18554 #: ../fish/guestfish-actions.pod:1506
18562 #: ../fish/guestfish-actions.pod:1512
18563 msgid "inotify-files"
18567 #: ../fish/guestfish-actions.pod:1514
18575 #: ../fish/guestfish-actions.pod:1516
18577 "This function is a helpful wrapper around C<inotify-read> which just returns "
18578 "a list of pathnames of objects that were touched. The returned pathnames "
18579 "are sorted and deduplicated."
18583 #: ../fish/guestfish-actions.pod:1520
18584 msgid "inotify-init"
18588 #: ../fish/guestfish-actions.pod:1522
18591 " inotify-init maxevents\n"
18596 #: ../fish/guestfish-actions.pod:1528
18598 "C<maxevents> is the maximum number of events which will be queued up between "
18599 "calls to C<inotify-read> or C<inotify-files>. If this is passed as C<0>, "
18600 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
18601 "default was 16384 events. Beyond this limit, the kernel throws away events, "
18602 "but records the fact that it threw them away by setting a flag "
18603 "C<IN_Q_OVERFLOW> in the returned structure list (see C<inotify-read>)."
18607 #: ../fish/guestfish-actions.pod:1538
18609 "Before any events are generated, you have to add some watches to the "
18610 "internal watch list. See: C<inotify-add-watch>, C<inotify-rm-watch> and "
18611 "C<inotify-watch-all>."
18615 #: ../fish/guestfish-actions.pod:1544
18617 "Queued up events should be read periodically by calling C<inotify-read> (or "
18618 "C<inotify-files> which is just a helpful wrapper around C<inotify-read>). "
18619 "If you don't read the events out often enough then you risk the internal "
18620 "queue overflowing."
18624 #: ../fish/guestfish-actions.pod:1551
18626 "The handle should be closed after use by calling C<inotify-close>. This "
18627 "also removes any watches automatically."
18631 #: ../fish/guestfish-actions.pod:1560
18632 msgid "inotify-read"
18636 #: ../fish/guestfish-actions.pod:1562
18644 #: ../fish/guestfish-actions.pod:1575
18645 msgid "inotify-rm-watch"
18649 #: ../fish/guestfish-actions.pod:1577
18652 " inotify-rm-watch wd\n"
18657 #: ../fish/guestfish-actions.pod:1579
18658 msgid "Remove a previously defined inotify watch. See C<inotify-add-watch>."
18662 #: ../fish/guestfish-actions.pod:1582
18663 msgid "inspect-get-arch"
18667 #: ../fish/guestfish-actions.pod:1584
18670 " inspect-get-arch root\n"
18675 #: ../fish/guestfish-actions.pod:1586 ../fish/guestfish-actions.pod:1602
18676 #: ../fish/guestfish-actions.pod:1648 ../fish/guestfish-actions.pod:1666
18677 #: ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:1702
18678 #: ../fish/guestfish-actions.pod:1725 ../fish/guestfish-actions.pod:1742
18680 "This function should only be called with a root device string as returned by "
18685 #: ../fish/guestfish-actions.pod:1589
18687 "This returns the architecture of the inspected operating system. The "
18688 "possible return values are listed under C<file-architecture>."
18692 #: ../fish/guestfish-actions.pod:1598
18693 msgid "inspect-get-distro"
18697 #: ../fish/guestfish-actions.pod:1600
18700 " inspect-get-distro root\n"
18705 #: ../fish/guestfish-actions.pod:1644
18706 msgid "inspect-get-filesystems"
18710 #: ../fish/guestfish-actions.pod:1646
18713 " inspect-get-filesystems root\n"
18718 #: ../fish/guestfish-actions.pod:1659
18720 "Please read L<guestfs(3)/INSPECTION> for more details. See also C<inspect-"
18721 "get-mountpoints>."
18725 #: ../fish/guestfish-actions.pod:1662
18726 msgid "inspect-get-major-version"
18730 #: ../fish/guestfish-actions.pod:1664
18733 " inspect-get-major-version root\n"
18738 #: ../fish/guestfish-actions.pod:1683
18739 msgid "inspect-get-minor-version"
18743 #: ../fish/guestfish-actions.pod:1685
18746 " inspect-get-minor-version root\n"
18751 #: ../fish/guestfish-actions.pod:1695
18753 "Please read L<guestfs(3)/INSPECTION> for more details. See also C<inspect-"
18754 "get-major-version>."
18758 #: ../fish/guestfish-actions.pod:1698
18759 msgid "inspect-get-mountpoints"
18763 #: ../fish/guestfish-actions.pod:1700
18766 " inspect-get-mountpoints root\n"
18771 #: ../fish/guestfish-actions.pod:1718
18773 "Please read L<guestfs(3)/INSPECTION> for more details. See also C<inspect-"
18774 "get-filesystems>."
18778 #: ../fish/guestfish-actions.pod:1721
18779 msgid "inspect-get-product-name"
18783 #: ../fish/guestfish-actions.pod:1723
18786 " inspect-get-product-name root\n"
18791 #: ../fish/guestfish-actions.pod:1738
18792 msgid "inspect-get-type"
18796 #: ../fish/guestfish-actions.pod:1740
18799 " inspect-get-type root\n"
18804 #: ../fish/guestfish-actions.pod:1769
18809 #: ../fish/guestfish-actions.pod:1771
18817 #: ../fish/guestfish-actions.pod:1786
18819 "You can pass the root string(s) returned to other C<inspect-get-*> functions "
18820 "in order to query further information about each operating system, such as "
18821 "the name and version."
18825 #: ../fish/guestfish-actions.pod:1791
18827 "This function uses other libguestfs features such as C<mount-ro> and "
18828 "C<umount-all> in order to mount and unmount filesystems and look at the "
18829 "contents. This should be called with no disks currently mounted. The "
18830 "function may also use Augeas, so any existing Augeas handle will be closed."
18834 #: ../fish/guestfish-actions.pod:1803
18835 msgid "is-blockdev"
18839 #: ../fish/guestfish-actions.pod:1805
18842 " is-blockdev path\n"
18847 #: ../fish/guestfish-actions.pod:1810 ../fish/guestfish-actions.pod:1828
18848 #: ../fish/guestfish-actions.pod:1847 ../fish/guestfish-actions.pod:1856
18849 #: ../fish/guestfish-actions.pod:1866 ../fish/guestfish-actions.pod:1900
18850 #: ../fish/guestfish-actions.pod:1909
18851 msgid "See also C<stat>."
18855 #: ../fish/guestfish-actions.pod:1812
18860 #: ../fish/guestfish-actions.pod:1814
18868 #: ../fish/guestfish-actions.pod:1821
18873 #: ../fish/guestfish-actions.pod:1823
18876 " is-chardev path\n"
18881 #: ../fish/guestfish-actions.pod:1830
18886 #: ../fish/guestfish-actions.pod:1832
18894 #: ../fish/guestfish-actions.pod:1839
18899 #: ../fish/guestfish-actions.pod:1841
18907 #: ../fish/guestfish-actions.pod:1849
18912 #: ../fish/guestfish-actions.pod:1851
18920 #: ../fish/guestfish-actions.pod:1858
18925 #: ../fish/guestfish-actions.pod:1860
18933 #: ../fish/guestfish-actions.pod:1868
18934 msgid "is-launching"
18938 #: ../fish/guestfish-actions.pod:1870
18946 #: ../fish/guestfish-actions.pod:1877
18951 #: ../fish/guestfish-actions.pod:1879
18959 #: ../fish/guestfish-actions.pod:1884
18964 #: ../fish/guestfish-actions.pod:1886
18972 #: ../fish/guestfish-actions.pod:1893
18977 #: ../fish/guestfish-actions.pod:1895
18980 " is-socket path\n"
18985 #: ../fish/guestfish-actions.pod:1902
18990 #: ../fish/guestfish-actions.pod:1904
18993 " is-symlink path\n"
18998 #: ../fish/guestfish-actions.pod:1911
18999 msgid "kill-subprocess"
19003 #: ../fish/guestfish-actions.pod:1913
19006 " kill-subprocess\n"
19011 #: ../fish/guestfish-actions.pod:1917
19012 msgid "launch | run"
19016 #: ../fish/guestfish-actions.pod:1919
19024 #: ../fish/guestfish-actions.pod:1927
19029 #: ../fish/guestfish-actions.pod:1929
19032 " lchown owner group path\n"
19037 #: ../fish/guestfish-actions.pod:1931
19039 "Change the file owner to C<owner> and group to C<group>. This is like "
19040 "C<chown> but if C<path> is a symlink then the link itself is changed, not "
19045 #: ../fish/guestfish-actions.pod:1939
19050 #: ../fish/guestfish-actions.pod:1941
19053 " lgetxattrs path\n"
19058 #: ../fish/guestfish-actions.pod:1943
19060 "This is the same as C<getxattrs>, but if C<path> is a symbolic link, then it "
19061 "returns the extended attributes of the link itself."
19065 #: ../fish/guestfish-actions.pod:1947
19066 msgid "list-devices"
19070 #: ../fish/guestfish-actions.pod:1949
19078 #: ../fish/guestfish-actions.pod:1955
19079 msgid "list-partitions"
19083 #: ../fish/guestfish-actions.pod:1957
19086 " list-partitions\n"
19091 #: ../fish/guestfish-actions.pod:1963
19093 "This does not return logical volumes. For that you will need to call C<lvs>."
19097 #: ../fish/guestfish-actions.pod:1966
19102 #: ../fish/guestfish-actions.pod:1968
19110 #: ../fish/guestfish-actions.pod:1976
19115 #: ../fish/guestfish-actions.pod:1978
19118 " ln target linkname\n"
19123 #: ../fish/guestfish-actions.pod:1982
19128 #: ../fish/guestfish-actions.pod:1984
19131 " ln-f target linkname\n"
19136 #: ../fish/guestfish-actions.pod:1989
19141 #: ../fish/guestfish-actions.pod:1991
19144 " ln-s target linkname\n"
19149 #: ../fish/guestfish-actions.pod:1995
19154 #: ../fish/guestfish-actions.pod:1997
19157 " ln-sf target linkname\n"
19162 #: ../fish/guestfish-actions.pod:2002
19163 msgid "lremovexattr"
19167 #: ../fish/guestfish-actions.pod:2004
19170 " lremovexattr xattr path\n"
19175 #: ../fish/guestfish-actions.pod:2006
19177 "This is the same as C<removexattr>, but if C<path> is a symbolic link, then "
19178 "it removes an extended attribute of the link itself."
19182 #: ../fish/guestfish-actions.pod:2010
19187 #: ../fish/guestfish-actions.pod:2012
19195 #: ../fish/guestfish-actions.pod:2018
19197 "This command is mostly useful for interactive sessions. Programs should "
19198 "probably use C<readdir> instead."
19202 #: ../fish/guestfish-actions.pod:2021
19207 #: ../fish/guestfish-actions.pod:2023
19210 " lsetxattr xattr val vallen path\n"
19215 #: ../fish/guestfish-actions.pod:2025
19217 "This is the same as C<setxattr>, but if C<path> is a symbolic link, then it "
19218 "sets an extended attribute of the link itself."
19222 #: ../fish/guestfish-actions.pod:2029
19227 #: ../fish/guestfish-actions.pod:2031
19235 #: ../fish/guestfish-actions.pod:2035
19237 "This is the same as C<stat> except that if C<path> is a symbolic link, then "
19238 "the link is stat-ed, not the file it refers to."
19242 #: ../fish/guestfish-actions.pod:2041
19247 #: ../fish/guestfish-actions.pod:2043
19250 " lstatlist path 'names ...'\n"
19255 #: ../fish/guestfish-actions.pod:2045
19257 "This call allows you to perform the C<lstat> operation on multiple files, "
19258 "where all files are in the directory C<path>. C<names> is the list of files "
19259 "from this directory."
19263 #: ../fish/guestfish-actions.pod:2054
19265 "This call is intended for programs that want to efficiently list a directory "
19266 "contents without making many round-trips. See also C<lxattrlist> for a "
19267 "similarly efficient call for getting extended attributes. Very long "
19268 "directory listings might cause the protocol message size to be exceeded, "
19269 "causing this call to fail. The caller must split up such requests into "
19270 "smaller groups of names."
19274 #: ../fish/guestfish-actions.pod:2062
19275 msgid "luks-add-key"
19279 #: ../fish/guestfish-actions.pod:2064
19282 " luks-add-key device keyslot\n"
19287 #: ../fish/guestfish-actions.pod:2071
19289 "Note that if C<keyslot> already contains a key, then this command will "
19290 "fail. You have to use C<luks-kill-slot> first to remove that key."
19294 #: ../fish/guestfish-actions.pod:2075 ../fish/guestfish-actions.pod:2097
19295 #: ../fish/guestfish-actions.pod:2110 ../fish/guestfish-actions.pod:2124
19296 #: ../fish/guestfish-actions.pod:2147 ../fish/guestfish-actions.pod:2157
19298 "This command has one or more key or passphrase parameters. Guestfish will "
19299 "prompt for these separately."
19303 #: ../fish/guestfish-actions.pod:2078
19308 #: ../fish/guestfish-actions.pod:2080
19311 " luks-close device\n"
19316 #: ../fish/guestfish-actions.pod:2082
19318 "This closes a LUKS device that was created earlier by C<luks-open> or C<luks-"
19319 "open-ro>. The C<device> parameter must be the name of the LUKS mapping "
19320 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
19325 #: ../fish/guestfish-actions.pod:2088
19326 msgid "luks-format"
19330 #: ../fish/guestfish-actions.pod:2090
19333 " luks-format device keyslot\n"
19338 #: ../fish/guestfish-actions.pod:2103
19339 msgid "luks-format-cipher"
19343 #: ../fish/guestfish-actions.pod:2105
19346 " luks-format-cipher device keyslot cipher\n"
19351 #: ../fish/guestfish-actions.pod:2107
19353 "This command is the same as C<luks-format> but it also allows you to set the "
19358 #: ../fish/guestfish-actions.pod:2116
19359 msgid "luks-kill-slot"
19363 #: ../fish/guestfish-actions.pod:2118
19366 " luks-kill-slot device keyslot\n"
19371 #: ../fish/guestfish-actions.pod:2127
19376 #: ../fish/guestfish-actions.pod:2129
19379 " luks-open device mapname\n"
19384 #: ../fish/guestfish-actions.pod:2143
19386 "If this block device contains LVM volume groups, then calling C<vgscan> "
19387 "followed by C<vg-activate-all> will make them visible."
19391 #: ../fish/guestfish-actions.pod:2150
19392 msgid "luks-open-ro"
19396 #: ../fish/guestfish-actions.pod:2152
19399 " luks-open-ro device mapname\n"
19404 #: ../fish/guestfish-actions.pod:2154
19406 "This is the same as C<luks-open> except that a read-only mapping is created."
19410 #: ../fish/guestfish-actions.pod:2160
19415 #: ../fish/guestfish-actions.pod:2162
19418 " lvcreate logvol volgroup mbytes\n"
19423 #: ../fish/guestfish-actions.pod:2167
19424 msgid "lvm-clear-filter"
19428 #: ../fish/guestfish-actions.pod:2169
19431 " lvm-clear-filter\n"
19436 #: ../fish/guestfish-actions.pod:2171
19438 "This undoes the effect of C<lvm-set-filter>. LVM will be able to see every "
19443 #: ../fish/guestfish-actions.pod:2177
19444 msgid "lvm-remove-all"
19448 #: ../fish/guestfish-actions.pod:2179
19451 " lvm-remove-all\n"
19456 #: ../fish/guestfish-actions.pod:2187
19457 msgid "lvm-set-filter"
19461 #: ../fish/guestfish-actions.pod:2189
19464 " lvm-set-filter 'devices ...'\n"
19469 #: ../fish/guestfish-actions.pod:2214
19474 #: ../fish/guestfish-actions.pod:2216
19477 " lvremove device\n"
19482 #: ../fish/guestfish-actions.pod:2224
19487 #: ../fish/guestfish-actions.pod:2226
19490 " lvrename logvol newlogvol\n"
19495 #: ../fish/guestfish-actions.pod:2230
19500 #: ../fish/guestfish-actions.pod:2232
19503 " lvresize device mbytes\n"
19508 #: ../fish/guestfish-actions.pod:2238
19509 msgid "lvresize-free"
19513 #: ../fish/guestfish-actions.pod:2240
19516 " lvresize-free lv percent\n"
19521 #: ../fish/guestfish-actions.pod:2248
19526 #: ../fish/guestfish-actions.pod:2250
19534 #: ../fish/guestfish-actions.pod:2258
19535 msgid "See also C<lvs-full>."
19539 #: ../fish/guestfish-actions.pod:2260
19544 #: ../fish/guestfish-actions.pod:2262
19552 #: ../fish/guestfish-actions.pod:2267
19557 #: ../fish/guestfish-actions.pod:2269
19565 #: ../fish/guestfish-actions.pod:2273
19570 #: ../fish/guestfish-actions.pod:2275
19573 " lxattrlist path 'names ...'\n"
19578 #: ../fish/guestfish-actions.pod:2291
19580 "This call is intended for programs that want to efficiently list a directory "
19581 "contents without making many round-trips. See also C<lstatlist> for a "
19582 "similarly efficient call for getting standard stats. Very long directory "
19583 "listings might cause the protocol message size to be exceeded, causing this "
19584 "call to fail. The caller must split up such requests into smaller groups of "
19589 #: ../fish/guestfish-actions.pod:2299
19594 #: ../fish/guestfish-actions.pod:2301
19602 #: ../fish/guestfish-actions.pod:2305
19607 #: ../fish/guestfish-actions.pod:2307
19610 " mkdir-mode path mode\n"
19615 #: ../fish/guestfish-actions.pod:2316
19616 msgid "See also C<mkdir>, C<umask>"
19620 #: ../fish/guestfish-actions.pod:2318
19625 #: ../fish/guestfish-actions.pod:2320
19633 #: ../fish/guestfish-actions.pod:2325
19638 #: ../fish/guestfish-actions.pod:2327
19641 " mkdtemp template\n"
19646 #: ../fish/guestfish-actions.pod:2348
19651 #: ../fish/guestfish-actions.pod:2350
19654 " mke2fs-J fstype blocksize device journal\n"
19659 #: ../fish/guestfish-actions.pod:2358
19660 msgid "See also C<mke2journal>."
19664 #: ../fish/guestfish-actions.pod:2360
19669 #: ../fish/guestfish-actions.pod:2362
19672 " mke2fs-JL fstype blocksize device label\n"
19677 #: ../fish/guestfish-actions.pod:2367
19678 msgid "See also C<mke2journal-L>."
19682 #: ../fish/guestfish-actions.pod:2369
19687 #: ../fish/guestfish-actions.pod:2371
19690 " mke2fs-JU fstype blocksize device uuid\n"
19695 #: ../fish/guestfish-actions.pod:2376
19696 msgid "See also C<mke2journal-U>."
19700 #: ../fish/guestfish-actions.pod:2378
19701 msgid "mke2journal"
19705 #: ../fish/guestfish-actions.pod:2380
19708 " mke2journal blocksize device\n"
19713 #: ../fish/guestfish-actions.pod:2387
19714 msgid "mke2journal-L"
19718 #: ../fish/guestfish-actions.pod:2389
19721 " mke2journal-L blocksize label device\n"
19726 #: ../fish/guestfish-actions.pod:2393
19727 msgid "mke2journal-U"
19731 #: ../fish/guestfish-actions.pod:2395
19734 " mke2journal-U blocksize uuid device\n"
19739 #: ../fish/guestfish-actions.pod:2399
19744 #: ../fish/guestfish-actions.pod:2401
19747 " mkfifo mode path\n"
19752 #: ../fish/guestfish-actions.pod:2403
19754 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
19755 "is just a convenient wrapper around C<mknod>."
19759 #: ../fish/guestfish-actions.pod:2409
19764 #: ../fish/guestfish-actions.pod:2411
19767 " mkfs fstype device\n"
19772 #: ../fish/guestfish-actions.pod:2417
19777 #: ../fish/guestfish-actions.pod:2419
19780 " mkfs-b fstype blocksize device\n"
19785 #: ../fish/guestfish-actions.pod:2421
19787 "This call is similar to C<mkfs>, but it allows you to control the block size "
19788 "of the resulting filesystem. Supported block sizes depend on the filesystem "
19789 "type, but typically they are C<1024>, C<2048> or C<4096> only."
19793 #: ../fish/guestfish-actions.pod:2429
19794 msgid "mkmountpoint"
19798 #: ../fish/guestfish-actions.pod:2431
19801 " mkmountpoint exemptpath\n"
19806 #: ../fish/guestfish-actions.pod:2433
19808 "C<mkmountpoint> and C<rmmountpoint> are specialized calls that can be used "
19809 "to create extra mountpoints before mounting the first filesystem."
19813 #: ../fish/guestfish-actions.pod:2457
19818 #: ../fish/guestfish-actions.pod:2459
19821 " mknod mode devmajor devminor path\n"
19826 #: ../fish/guestfish-actions.pod:2469
19828 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
19829 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
19830 "regular file). These constants are available in the standard Linux header "
19831 "files, or you can use C<mknod-b>, C<mknod-c> or C<mkfifo> which are wrappers "
19832 "around this command which bitwise OR in the appropriate constant for you."
19836 #: ../fish/guestfish-actions.pod:2479
19841 #: ../fish/guestfish-actions.pod:2481
19844 " mknod-b mode devmajor devminor path\n"
19849 #: ../fish/guestfish-actions.pod:2483
19851 "This call creates a block device node called C<path> with mode C<mode> and "
19852 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19853 "wrapper around C<mknod>."
19857 #: ../fish/guestfish-actions.pod:2489
19862 #: ../fish/guestfish-actions.pod:2491
19865 " mknod-c mode devmajor devminor path\n"
19870 #: ../fish/guestfish-actions.pod:2493
19872 "This call creates a char device node called C<path> with mode C<mode> and "
19873 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19874 "wrapper around C<mknod>."
19878 #: ../fish/guestfish-actions.pod:2499
19883 #: ../fish/guestfish-actions.pod:2501
19891 #: ../fish/guestfish-actions.pod:2505
19896 #: ../fish/guestfish-actions.pod:2507
19899 " mkswap-L label device\n"
19904 #: ../fish/guestfish-actions.pod:2515
19909 #: ../fish/guestfish-actions.pod:2517
19912 " mkswap-U uuid device\n"
19917 #: ../fish/guestfish-actions.pod:2521
19918 msgid "mkswap-file"
19922 #: ../fish/guestfish-actions.pod:2523
19925 " mkswap-file path\n"
19930 #: ../fish/guestfish-actions.pod:2527
19932 "This command just writes a swap file signature to an existing file. To "
19933 "create the file itself, use something like C<fallocate>."
19937 #: ../fish/guestfish-actions.pod:2530
19942 #: ../fish/guestfish-actions.pod:2532
19945 " modprobe modulename\n"
19950 #: ../fish/guestfish-actions.pod:2539
19955 #: ../fish/guestfish-actions.pod:2541
19958 " mount device mountpoint\n"
19963 #: ../fish/guestfish-actions.pod:2557
19965 "B<Important note:> When you use this call, the filesystem options C<sync> "
19966 "and C<noatime> are set implicitly. This was originally done because we "
19967 "thought it would improve reliability, but it turns out that I<-o sync> has a "
19968 "very large negative performance impact and negligible effect on "
19969 "reliability. Therefore we recommend that you avoid using C<mount> in any "
19970 "code that needs performance, and instead use C<mount-options> (use an empty "
19971 "string for the first parameter if you don't want any options)."
19975 #: ../fish/guestfish-actions.pod:2567
19980 #: ../fish/guestfish-actions.pod:2569
19983 " mount-loop file mountpoint\n"
19988 #: ../fish/guestfish-actions.pod:2575
19989 msgid "mount-options"
19993 #: ../fish/guestfish-actions.pod:2577
19996 " mount-options options device mountpoint\n"
20001 #: ../fish/guestfish-actions.pod:2579
20003 "This is the same as the C<mount> command, but it allows you to set the mount "
20004 "options as for the L<mount(8)> I<-o> flag."
20008 #: ../fish/guestfish-actions.pod:2587
20013 #: ../fish/guestfish-actions.pod:2589
20016 " mount-ro device mountpoint\n"
20021 #: ../fish/guestfish-actions.pod:2591
20023 "This is the same as the C<mount> command, but it mounts the filesystem with "
20024 "the read-only (I<-o ro>) flag."
20028 #: ../fish/guestfish-actions.pod:2594
20033 #: ../fish/guestfish-actions.pod:2596
20036 " mount-vfs options vfstype device mountpoint\n"
20041 #: ../fish/guestfish-actions.pod:2598
20043 "This is the same as the C<mount> command, but it allows you to set both the "
20044 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20048 #: ../fish/guestfish-actions.pod:2602
20049 msgid "mountpoints"
20053 #: ../fish/guestfish-actions.pod:2604
20061 #: ../fish/guestfish-actions.pod:2606
20063 "This call is similar to C<mounts>. That call returns a list of devices. "
20064 "This one returns a hash table (map) of device name to directory where the "
20065 "device is mounted."
20069 #: ../fish/guestfish-actions.pod:2610
20074 #: ../fish/guestfish-actions.pod:2612
20082 #: ../fish/guestfish-actions.pod:2619
20083 msgid "See also: C<mountpoints>"
20087 #: ../fish/guestfish-actions.pod:2621
20092 #: ../fish/guestfish-actions.pod:2623
20100 #: ../fish/guestfish-actions.pod:2628
20101 msgid "ntfs-3g-probe"
20105 #: ../fish/guestfish-actions.pod:2630
20108 " ntfs-3g-probe true|false device\n"
20113 #: ../fish/guestfish-actions.pod:2644
20118 #: ../fish/guestfish-actions.pod:2646
20121 " ntfsresize device\n"
20126 #: ../fish/guestfish-actions.pod:2652
20127 msgid "ntfsresize-size"
20131 #: ../fish/guestfish-actions.pod:2654
20134 " ntfsresize-size device size\n"
20139 #: ../fish/guestfish-actions.pod:2656
20141 "This command is the same as C<ntfsresize> except that it allows you to "
20142 "specify the new size (in bytes) explicitly."
20146 #: ../fish/guestfish-actions.pod:2659
20151 #: ../fish/guestfish-actions.pod:2661
20154 " part-add device prlogex startsect endsect\n"
20159 #: ../fish/guestfish-actions.pod:2663
20161 "This command adds a partition to C<device>. If there is no partition table "
20162 "on the device, call C<part-init> first."
20166 #: ../fish/guestfish-actions.pod:2675
20168 "Creating a partition which covers the whole disk is not so easy. Use C<part-"
20169 "disk> to do that."
20173 #: ../fish/guestfish-actions.pod:2678
20178 #: ../fish/guestfish-actions.pod:2680
20181 " part-del device partnum\n"
20186 #: ../fish/guestfish-actions.pod:2688
20191 #: ../fish/guestfish-actions.pod:2690
20194 " part-disk device parttype\n"
20199 #: ../fish/guestfish-actions.pod:2692
20201 "This command is simply a combination of C<part-init> followed by C<part-add> "
20202 "to create a single primary partition covering the whole disk."
20206 #: ../fish/guestfish-actions.pod:2696
20208 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
20209 "possible values are described in C<part-init>."
20213 #: ../fish/guestfish-actions.pod:2702
20214 msgid "part-get-bootable"
20218 #: ../fish/guestfish-actions.pod:2704
20221 " part-get-bootable device partnum\n"
20226 #: ../fish/guestfish-actions.pod:2709
20227 msgid "See also C<part-set-bootable>."
20231 #: ../fish/guestfish-actions.pod:2711
20232 msgid "part-get-mbr-id"
20236 #: ../fish/guestfish-actions.pod:2713
20239 " part-get-mbr-id device partnum\n"
20244 #: ../fish/guestfish-actions.pod:2718 ../fish/guestfish-actions.pod:2856
20246 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
20247 "undefined results for other partition table types (see C<part-get-parttype>)."
20251 #: ../fish/guestfish-actions.pod:2722
20252 msgid "part-get-parttype"
20256 #: ../fish/guestfish-actions.pod:2724
20259 " part-get-parttype device\n"
20264 #: ../fish/guestfish-actions.pod:2729
20266 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
20267 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
20268 "possible, although unusual. See C<part-init> for a full list."
20272 #: ../fish/guestfish-actions.pod:2734
20277 #: ../fish/guestfish-actions.pod:2736
20280 " part-init device parttype\n"
20285 #: ../fish/guestfish-actions.pod:2742
20287 "Initially there are no partitions. Following this, you should call C<part-"
20288 "add> for each partition required."
20292 #: ../fish/guestfish-actions.pod:2805
20297 #: ../fish/guestfish-actions.pod:2807
20300 " part-list device\n"
20305 #: ../fish/guestfish-actions.pod:2822
20307 "Start of the partition I<in bytes>. To get sectors you have to divide by "
20308 "the device's sector size, see C<blockdev-getss>."
20312 #: ../fish/guestfish-actions.pod:2835
20313 msgid "part-set-bootable"
20317 #: ../fish/guestfish-actions.pod:2837
20320 " part-set-bootable device partnum true|false\n"
20325 #: ../fish/guestfish-actions.pod:2846
20326 msgid "part-set-mbr-id"
20330 #: ../fish/guestfish-actions.pod:2848
20333 " part-set-mbr-id device partnum idbyte\n"
20338 #: ../fish/guestfish-actions.pod:2860
20339 msgid "part-set-name"
20343 #: ../fish/guestfish-actions.pod:2862
20346 " part-set-name device partnum name\n"
20351 #: ../fish/guestfish-actions.pod:2870
20352 msgid "ping-daemon"
20356 #: ../fish/guestfish-actions.pod:2872
20364 #: ../fish/guestfish-actions.pod:2879
20369 #: ../fish/guestfish-actions.pod:2881
20372 " pread path count offset\n"
20377 #: ../fish/guestfish-actions.pod:2889
20378 msgid "See also C<pwrite>."
20382 #: ../fish/guestfish-actions.pod:2894
20387 #: ../fish/guestfish-actions.pod:2896
20390 " pvcreate device\n"
20395 #: ../fish/guestfish-actions.pod:2902
20400 #: ../fish/guestfish-actions.pod:2904
20403 " pvremove device\n"
20408 #: ../fish/guestfish-actions.pod:2913
20413 #: ../fish/guestfish-actions.pod:2915
20416 " pvresize device\n"
20421 #: ../fish/guestfish-actions.pod:2920
20422 msgid "pvresize-size"
20426 #: ../fish/guestfish-actions.pod:2922
20429 " pvresize-size device size\n"
20434 #: ../fish/guestfish-actions.pod:2924
20436 "This command is the same as C<pvresize> except that it allows you to specify "
20437 "the new size (in bytes) explicitly."
20441 #: ../fish/guestfish-actions.pod:2927
20446 #: ../fish/guestfish-actions.pod:2929
20454 #: ../fish/guestfish-actions.pod:2937
20455 msgid "See also C<pvs-full>."
20459 #: ../fish/guestfish-actions.pod:2939
20464 #: ../fish/guestfish-actions.pod:2941
20472 #: ../fish/guestfish-actions.pod:2946
20477 #: ../fish/guestfish-actions.pod:2948
20485 #: ../fish/guestfish-actions.pod:2952
20490 #: ../fish/guestfish-actions.pod:2954
20493 " pwrite path content offset\n"
20498 #: ../fish/guestfish-actions.pod:2965
20499 msgid "See also C<pread>."
20503 #: ../fish/guestfish-actions.pod:2970
20508 #: ../fish/guestfish-actions.pod:2972
20511 " read-file path\n"
20516 #: ../fish/guestfish-actions.pod:2977
20518 "Unlike C<cat>, this function can correctly handle files that contain "
20519 "embedded ASCII NUL characters. However unlike C<download>, this function is "
20520 "limited in the total size of file that can be handled."
20524 #: ../fish/guestfish-actions.pod:2985
20529 #: ../fish/guestfish-actions.pod:2987
20532 " read-lines path\n"
20537 #: ../fish/guestfish-actions.pod:2994
20539 "Note that this function cannot correctly handle binary files (specifically, "
20540 "files containing C<\\0> character which is treated as end of line). For "
20541 "those you need to use the C<read-file> function which has a more complex "
20546 #: ../fish/guestfish-actions.pod:2999
20551 #: ../fish/guestfish-actions.pod:3001
20559 #: ../fish/guestfish-actions.pod:3053
20561 "This function is primarily intended for use by programs. To get a simple "
20562 "list of names, use C<ls>. To get a printable directory for human "
20563 "consumption, use C<ll>."
20567 #: ../fish/guestfish-actions.pod:3057
20572 #: ../fish/guestfish-actions.pod:3059
20580 #: ../fish/guestfish-actions.pod:3063
20581 msgid "readlinklist"
20585 #: ../fish/guestfish-actions.pod:3065
20588 " readlinklist path 'names ...'\n"
20593 #: ../fish/guestfish-actions.pod:3089
20598 #: ../fish/guestfish-actions.pod:3091
20606 #: ../fish/guestfish-actions.pod:3096
20607 msgid "removexattr"
20611 #: ../fish/guestfish-actions.pod:3098
20614 " removexattr xattr path\n"
20619 #: ../fish/guestfish-actions.pod:3103
20620 msgid "See also: C<lremovexattr>, L<attr(5)>."
20624 #: ../fish/guestfish-actions.pod:3105
20629 #: ../fish/guestfish-actions.pod:3107
20632 " resize2fs device\n"
20637 #: ../fish/guestfish-actions.pod:3112
20639 "I<Note:> It is sometimes required that you run C<e2fsck-f> on the C<device> "
20640 "before calling this command. For unknown reasons C<resize2fs> sometimes "
20641 "gives an error about this and sometimes not. In any case, it is always safe "
20642 "to call C<e2fsck-f> before calling this function."
20646 #: ../fish/guestfish-actions.pod:3118
20647 msgid "resize2fs-size"
20651 #: ../fish/guestfish-actions.pod:3120
20654 " resize2fs-size device size\n"
20659 #: ../fish/guestfish-actions.pod:3122
20661 "This command is the same as C<resize2fs> except that it allows you to "
20662 "specify the new size (in bytes) explicitly."
20666 #: ../fish/guestfish-actions.pod:3125
20671 #: ../fish/guestfish-actions.pod:3127
20679 #: ../fish/guestfish-actions.pod:3131
20684 #: ../fish/guestfish-actions.pod:3133
20692 #: ../fish/guestfish-actions.pod:3139
20697 #: ../fish/guestfish-actions.pod:3141
20705 #: ../fish/guestfish-actions.pod:3145
20706 msgid "rmmountpoint"
20710 #: ../fish/guestfish-actions.pod:3147
20713 " rmmountpoint exemptpath\n"
20718 #: ../fish/guestfish-actions.pod:3149
20720 "This calls removes a mountpoint that was previously created with "
20721 "C<mkmountpoint>. See C<mkmountpoint> for full details."
20725 #: ../fish/guestfish-actions.pod:3153
20726 msgid "scrub-device"
20730 #: ../fish/guestfish-actions.pod:3155
20733 " scrub-device device\n"
20738 #: ../fish/guestfish-actions.pod:3166
20743 #: ../fish/guestfish-actions.pod:3168
20746 " scrub-file file\n"
20751 #: ../fish/guestfish-actions.pod:3178
20752 msgid "scrub-freespace"
20756 #: ../fish/guestfish-actions.pod:3180
20759 " scrub-freespace dir\n"
20764 #: ../fish/guestfish-actions.pod:3182
20766 "This command creates the directory C<dir> and then fills it with files until "
20767 "the filesystem is full, and scrubs the files as for C<scrub-file>, and "
20768 "deletes them. The intention is to scrub any free space on the partition "
20769 "containing C<dir>."
20773 #: ../fish/guestfish-actions.pod:3191
20774 msgid "set-append | append"
20778 #: ../fish/guestfish-actions.pod:3193
20781 " set-append append\n"
20786 #: ../fish/guestfish-actions.pod:3204
20787 msgid "set-autosync | autosync"
20791 #: ../fish/guestfish-actions.pod:3206
20794 " set-autosync true|false\n"
20799 #: ../fish/guestfish-actions.pod:3208
20801 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
20802 "effort attempt to run C<umount-all> followed by C<sync> when the handle is "
20803 "closed (also if the program exits without closing handles)."
20807 #: ../fish/guestfish-actions.pod:3216
20808 msgid "set-direct | direct"
20812 #: ../fish/guestfish-actions.pod:3218
20815 " set-direct true|false\n"
20820 #: ../fish/guestfish-actions.pod:3224
20822 "One consequence of this is that log messages aren't caught by the library "
20823 "and handled by C<set-log-message-callback>, but go straight to stdout."
20827 #: ../fish/guestfish-actions.pod:3233
20828 msgid "set-e2label"
20832 #: ../fish/guestfish-actions.pod:3235
20835 " set-e2label device label\n"
20840 #: ../fish/guestfish-actions.pod:3241
20842 "You can use either C<tune2fs-l> or C<get-e2label> to return the existing "
20843 "label on a filesystem."
20847 #: ../fish/guestfish-actions.pod:3244
20852 #: ../fish/guestfish-actions.pod:3246
20855 " set-e2uuid device uuid\n"
20860 #: ../fish/guestfish-actions.pod:3253
20862 "You can use either C<tune2fs-l> or C<get-e2uuid> to return the existing UUID "
20867 #: ../fish/guestfish-actions.pod:3256
20868 msgid "set-memsize | memsize"
20872 #: ../fish/guestfish-actions.pod:3258
20875 " set-memsize memsize\n"
20880 #: ../fish/guestfish-actions.pod:3260
20882 "This sets the memory size in megabytes allocated to the qemu subprocess. "
20883 "This only has any effect if called before C<launch>."
20887 #: ../fish/guestfish-actions.pod:3271
20888 msgid "set-network | network"
20892 #: ../fish/guestfish-actions.pod:3273
20895 " set-network true|false\n"
20900 #: ../fish/guestfish-actions.pod:3281
20902 "You must call this before calling C<launch>, otherwise it has no effect."
20906 #: ../fish/guestfish-actions.pod:3284
20907 msgid "set-path | path"
20911 #: ../fish/guestfish-actions.pod:3286
20914 " set-path searchpath\n"
20919 #: ../fish/guestfish-actions.pod:3295
20920 msgid "set-qemu | qemu"
20924 #: ../fish/guestfish-actions.pod:3297
20932 #: ../fish/guestfish-actions.pod:3317
20933 msgid "set-recovery-proc | recovery-proc"
20937 #: ../fish/guestfish-actions.pod:3319
20940 " set-recovery-proc true|false\n"
20945 #: ../fish/guestfish-actions.pod:3321
20947 "If this is called with the parameter C<false> then C<launch> does not create "
20948 "a recovery process. The purpose of the recovery process is to stop runaway "
20949 "qemu processes in the case where the main program aborts abruptly."
20953 #: ../fish/guestfish-actions.pod:3326
20955 "This only has any effect if called before C<launch>, and the default is true."
20959 #: ../fish/guestfish-actions.pod:3335
20960 msgid "set-selinux | selinux"
20964 #: ../fish/guestfish-actions.pod:3337
20967 " set-selinux true|false\n"
20972 #: ../fish/guestfish-actions.pod:3348
20973 msgid "set-trace | trace"
20977 #: ../fish/guestfish-actions.pod:3350
20980 " set-trace true|false\n"
20985 #: ../fish/guestfish-actions.pod:3366
20986 msgid "set-verbose | verbose"
20990 #: ../fish/guestfish-actions.pod:3368
20993 " set-verbose true|false\n"
20998 #: ../fish/guestfish-actions.pod:3375
21003 #: ../fish/guestfish-actions.pod:3377
21006 " setcon context\n"
21011 #: ../fish/guestfish-actions.pod:3384
21016 #: ../fish/guestfish-actions.pod:3386
21019 " setxattr xattr val vallen path\n"
21024 #: ../fish/guestfish-actions.pod:3392
21025 msgid "See also: C<lsetxattr>, L<attr(5)>."
21029 #: ../fish/guestfish-actions.pod:3394
21034 #: ../fish/guestfish-actions.pod:3396
21037 " sfdisk device cyls heads sectors 'lines ...'\n"
21042 #: ../fish/guestfish-actions.pod:3418
21043 msgid "See also: C<sfdisk-l>, C<sfdisk-N>, C<part-init>"
21047 #: ../fish/guestfish-actions.pod:3424
21052 #: ../fish/guestfish-actions.pod:3426
21055 " sfdiskM device 'lines ...'\n"
21060 #: ../fish/guestfish-actions.pod:3428
21062 "This is a simplified interface to the C<sfdisk> command, where partition "
21063 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
21064 "you don't need to specify the cyls, heads and sectors parameters which were "
21065 "rarely if ever used anyway."
21069 #: ../fish/guestfish-actions.pod:3434
21070 msgid "See also: C<sfdisk>, the L<sfdisk(8)> manpage and C<part-disk>"
21074 #: ../fish/guestfish-actions.pod:3440
21079 #: ../fish/guestfish-actions.pod:3442
21082 " sfdisk-N device partnum cyls heads sectors line\n"
21087 #: ../fish/guestfish-actions.pod:3447
21089 "For other parameters, see C<sfdisk>. You should usually pass C<0> for the "
21090 "cyls/heads/sectors parameters."
21094 #: ../fish/guestfish-actions.pod:3450
21095 msgid "See also: C<part-add>"
21099 #: ../fish/guestfish-actions.pod:3455
21100 msgid "sfdisk-disk-geometry"
21104 #: ../fish/guestfish-actions.pod:3457
21107 " sfdisk-disk-geometry device\n"
21112 #: ../fish/guestfish-actions.pod:3459
21114 "This displays the disk geometry of C<device> read from the partition table. "
21115 "Especially in the case where the underlying block device has been resized, "
21116 "this can be different from the kernel's idea of the geometry (see C<sfdisk-"
21117 "kernel-geometry>)."
21121 #: ../fish/guestfish-actions.pod:3467
21122 msgid "sfdisk-kernel-geometry"
21126 #: ../fish/guestfish-actions.pod:3469
21129 " sfdisk-kernel-geometry device\n"
21134 #: ../fish/guestfish-actions.pod:3476
21139 #: ../fish/guestfish-actions.pod:3478
21142 " sfdisk-l device\n"
21147 #: ../fish/guestfish-actions.pod:3484
21148 msgid "See also: C<part-list>"
21152 #: ../fish/guestfish-actions.pod:3486
21157 #: ../fish/guestfish-actions.pod:3488
21165 #: ../fish/guestfish-actions.pod:3493
21166 msgid "This is like C<command>, but passes the command to:"
21170 #: ../fish/guestfish-actions.pod:3501
21171 msgid "All the provisos about C<command> apply to this call."
21175 #: ../fish/guestfish-actions.pod:3503
21180 #: ../fish/guestfish-actions.pod:3505
21183 " sh-lines command\n"
21188 #: ../fish/guestfish-actions.pod:3507
21189 msgid "This is the same as C<sh>, but splits the result into a list of lines."
21193 #: ../fish/guestfish-actions.pod:3510
21194 msgid "See also: C<command-lines>"
21198 #: ../fish/guestfish-actions.pod:3512
21203 #: ../fish/guestfish-actions.pod:3514
21211 #: ../fish/guestfish-actions.pod:3518
21216 #: ../fish/guestfish-actions.pod:3520
21224 #: ../fish/guestfish-actions.pod:3526
21229 #: ../fish/guestfish-actions.pod:3528
21237 #: ../fish/guestfish-actions.pod:3536
21242 #: ../fish/guestfish-actions.pod:3538
21250 #: ../fish/guestfish-actions.pod:3546
21255 #: ../fish/guestfish-actions.pod:3548
21258 " strings-e encoding path\n"
21263 #: ../fish/guestfish-actions.pod:3550
21265 "This is like the C<strings> command, but allows you to specify the encoding "
21266 "of strings that are looked for in the source file C<path>."
21270 #: ../fish/guestfish-actions.pod:3560
21272 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
21273 "ISO-8859-X (this is what C<strings> uses)."
21277 #: ../fish/guestfish-actions.pod:3592
21278 msgid "swapoff-device"
21282 #: ../fish/guestfish-actions.pod:3594
21285 " swapoff-device device\n"
21290 #: ../fish/guestfish-actions.pod:3596
21292 "This command disables the libguestfs appliance swap device or partition "
21293 "named C<device>. See C<swapon-device>."
21297 #: ../fish/guestfish-actions.pod:3600
21298 msgid "swapoff-file"
21302 #: ../fish/guestfish-actions.pod:3602
21305 " swapoff-file file\n"
21310 #: ../fish/guestfish-actions.pod:3606
21311 msgid "swapoff-label"
21315 #: ../fish/guestfish-actions.pod:3608
21318 " swapoff-label label\n"
21323 #: ../fish/guestfish-actions.pod:3613
21324 msgid "swapoff-uuid"
21328 #: ../fish/guestfish-actions.pod:3615
21331 " swapoff-uuid uuid\n"
21336 #: ../fish/guestfish-actions.pod:3620
21337 msgid "swapon-device"
21341 #: ../fish/guestfish-actions.pod:3622
21344 " swapon-device device\n"
21349 #: ../fish/guestfish-actions.pod:3624
21351 "This command enables the libguestfs appliance to use the swap device or "
21352 "partition named C<device>. The increased memory is made available for all "
21353 "commands, for example those run using C<command> or C<sh>."
21357 #: ../fish/guestfish-actions.pod:3636
21358 msgid "swapon-file"
21362 #: ../fish/guestfish-actions.pod:3638
21365 " swapon-file file\n"
21370 #: ../fish/guestfish-actions.pod:3640
21372 "This command enables swap to a file. See C<swapon-device> for other notes."
21376 #: ../fish/guestfish-actions.pod:3643
21377 msgid "swapon-label"
21381 #: ../fish/guestfish-actions.pod:3645
21384 " swapon-label label\n"
21389 #: ../fish/guestfish-actions.pod:3647
21391 "This command enables swap to a labeled swap partition. See C<swapon-device> "
21396 #: ../fish/guestfish-actions.pod:3650
21397 msgid "swapon-uuid"
21401 #: ../fish/guestfish-actions.pod:3652
21404 " swapon-uuid uuid\n"
21409 #: ../fish/guestfish-actions.pod:3654
21411 "This command enables swap to a swap partition with the given UUID. See "
21412 "C<swapon-device> for other notes."
21416 #: ../fish/guestfish-actions.pod:3657
21421 #: ../fish/guestfish-actions.pod:3659
21429 #: ../fish/guestfish-actions.pod:3667
21434 #: ../fish/guestfish-actions.pod:3669
21442 #: ../fish/guestfish-actions.pod:3677
21447 #: ../fish/guestfish-actions.pod:3679
21450 " tail-n nrlines path\n"
21455 #: ../fish/guestfish-actions.pod:3692
21460 #: ../fish/guestfish-actions.pod:3694
21463 " tar-in (tarfile|-) directory\n"
21468 #: ../fish/guestfish-actions.pod:3699
21469 msgid "To upload a compressed tarball, use C<tgz-in> or C<txz-in>."
21473 #: ../fish/guestfish-actions.pod:3704
21478 #: ../fish/guestfish-actions.pod:3706
21481 " tar-out directory (tarfile|-)\n"
21486 #: ../fish/guestfish-actions.pod:3711
21487 msgid "To download a compressed tarball, use C<tgz-out> or C<txz-out>."
21491 #: ../fish/guestfish-actions.pod:3716
21496 #: ../fish/guestfish-actions.pod:3718
21499 " tgz-in (tarball|-) directory\n"
21504 #: ../fish/guestfish-actions.pod:3723
21505 msgid "To upload an uncompressed tarball, use C<tar-in>."
21509 #: ../fish/guestfish-actions.pod:3727
21514 #: ../fish/guestfish-actions.pod:3729
21517 " tgz-out directory (tarball|-)\n"
21522 #: ../fish/guestfish-actions.pod:3734
21523 msgid "To download an uncompressed tarball, use C<tar-out>."
21527 #: ../fish/guestfish-actions.pod:3738
21532 #: ../fish/guestfish-actions.pod:3740
21540 #: ../fish/guestfish-actions.pod:3749
21545 #: ../fish/guestfish-actions.pod:3751
21553 #: ../fish/guestfish-actions.pod:3756
21554 msgid "truncate-size"
21558 #: ../fish/guestfish-actions.pod:3758
21561 " truncate-size path size\n"
21566 #: ../fish/guestfish-actions.pod:3763
21568 "If the current file size is less than C<size> then the file is extended to "
21569 "the required size with zero bytes. This creates a sparse file (ie. disk "
21570 "blocks are not allocated for the file until you write to it). To create a "
21571 "non-sparse file of zeroes, use C<fallocate64> instead."
21575 #: ../fish/guestfish-actions.pod:3769
21580 #: ../fish/guestfish-actions.pod:3771
21583 " tune2fs-l device\n"
21588 #: ../fish/guestfish-actions.pod:3781
21593 #: ../fish/guestfish-actions.pod:3783
21596 " txz-in (tarball|-) directory\n"
21601 #: ../fish/guestfish-actions.pod:3790
21606 #: ../fish/guestfish-actions.pod:3792
21609 " txz-out directory (tarball|-)\n"
21614 #: ../fish/guestfish-actions.pod:3799
21619 #: ../fish/guestfish-actions.pod:3801
21627 #: ../fish/guestfish-actions.pod:3815
21628 msgid "See also C<get-umask>, L<umask(2)>, C<mknod>, C<mkdir>."
21632 #: ../fish/guestfish-actions.pod:3820
21633 msgid "umount | unmount"
21637 #: ../fish/guestfish-actions.pod:3822
21640 " umount pathordevice\n"
21645 #: ../fish/guestfish-actions.pod:3828
21646 msgid "umount-all | unmount-all"
21650 #: ../fish/guestfish-actions.pod:3830
21658 #: ../fish/guestfish-actions.pod:3836
21663 #: ../fish/guestfish-actions.pod:3838
21666 " upload (filename|-) remotefilename\n"
21671 #: ../fish/guestfish-actions.pod:3845
21672 msgid "See also C<download>."
21676 #: ../fish/guestfish-actions.pod:3849
21681 #: ../fish/guestfish-actions.pod:3851
21684 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
21689 #: ../fish/guestfish-actions.pod:3870
21694 #: ../fish/guestfish-actions.pod:3872
21702 #: ../fish/guestfish-actions.pod:3899
21704 "I<Note:> Don't use this call to test for availability of features. In "
21705 "enterprise distributions we backport features from later versions into "
21706 "earlier versions, making this an unreliable way to test for features. Use "
21707 "C<available> instead."
21711 #: ../fish/guestfish-actions.pod:3905
21716 #: ../fish/guestfish-actions.pod:3907
21719 " vfs-label device\n"
21724 #: ../fish/guestfish-actions.pod:3914
21725 msgid "To find a filesystem from the label, use C<findfs-label>."
21729 #: ../fish/guestfish-actions.pod:3916
21734 #: ../fish/guestfish-actions.pod:3918
21737 " vfs-type device\n"
21742 #: ../fish/guestfish-actions.pod:3928
21747 #: ../fish/guestfish-actions.pod:3930
21750 " vfs-uuid device\n"
21755 #: ../fish/guestfish-actions.pod:3937
21756 msgid "To find a filesystem from the UUID, use C<findfs-uuid>."
21760 #: ../fish/guestfish-actions.pod:3939
21761 msgid "vg-activate"
21765 #: ../fish/guestfish-actions.pod:3941
21768 " vg-activate true|false 'volgroups ...'\n"
21773 #: ../fish/guestfish-actions.pod:3954
21774 msgid "vg-activate-all"
21778 #: ../fish/guestfish-actions.pod:3956
21781 " vg-activate-all true|false\n"
21786 #: ../fish/guestfish-actions.pod:3966
21791 #: ../fish/guestfish-actions.pod:3968
21794 " vgcreate volgroup 'physvols ...'\n"
21799 #: ../fish/guestfish-actions.pod:3973
21804 #: ../fish/guestfish-actions.pod:3975
21807 " vglvuuids vgname\n"
21812 #: ../fish/guestfish-actions.pod:3980
21814 "You can use this along with C<lvs> and C<lvuuid> calls to associate logical "
21815 "volumes and volume groups."
21819 #: ../fish/guestfish-actions.pod:3983
21820 msgid "See also C<vgpvuuids>."
21824 #: ../fish/guestfish-actions.pod:3985
21829 #: ../fish/guestfish-actions.pod:3987
21832 " vgpvuuids vgname\n"
21837 #: ../fish/guestfish-actions.pod:3992
21839 "You can use this along with C<pvs> and C<pvuuid> calls to associate physical "
21840 "volumes and volume groups."
21844 #: ../fish/guestfish-actions.pod:3995
21845 msgid "See also C<vglvuuids>."
21849 #: ../fish/guestfish-actions.pod:3997
21854 #: ../fish/guestfish-actions.pod:3999
21857 " vgremove vgname\n"
21862 #: ../fish/guestfish-actions.pod:4006
21867 #: ../fish/guestfish-actions.pod:4008
21870 " vgrename volgroup newvolgroup\n"
21875 #: ../fish/guestfish-actions.pod:4012
21880 #: ../fish/guestfish-actions.pod:4014
21888 #: ../fish/guestfish-actions.pod:4022
21889 msgid "See also C<vgs-full>."
21893 #: ../fish/guestfish-actions.pod:4024
21898 #: ../fish/guestfish-actions.pod:4026
21906 #: ../fish/guestfish-actions.pod:4031
21911 #: ../fish/guestfish-actions.pod:4033
21919 #: ../fish/guestfish-actions.pod:4038
21924 #: ../fish/guestfish-actions.pod:4040
21932 #: ../fish/guestfish-actions.pod:4044
21937 #: ../fish/guestfish-actions.pod:4046
21945 #: ../fish/guestfish-actions.pod:4051
21950 #: ../fish/guestfish-actions.pod:4053
21958 #: ../fish/guestfish-actions.pod:4058
21963 #: ../fish/guestfish-actions.pod:4060
21971 #: ../fish/guestfish-actions.pod:4065
21976 #: ../fish/guestfish-actions.pod:4067
21979 " write path content\n"
21984 #: ../fish/guestfish-actions.pod:4075
21989 #: ../fish/guestfish-actions.pod:4077
21992 " write-file path content size\n"
21997 #: ../fish/guestfish-actions.pod:4100
22002 #: ../fish/guestfish-actions.pod:4102
22005 " zegrep regex path\n"
22010 #: ../fish/guestfish-actions.pod:4110
22015 #: ../fish/guestfish-actions.pod:4112
22018 " zegrepi regex path\n"
22023 #: ../fish/guestfish-actions.pod:4120
22028 #: ../fish/guestfish-actions.pod:4122
22036 #: ../fish/guestfish-actions.pod:4130
22037 msgid "See also: C<zero-device>, C<scrub-device>."
22041 #: ../fish/guestfish-actions.pod:4132
22042 msgid "zero-device"
22046 #: ../fish/guestfish-actions.pod:4134
22049 " zero-device device\n"
22054 #: ../fish/guestfish-actions.pod:4136
22056 "This command writes zeroes over the entire C<device>. Compare with C<zero> "
22057 "which just zeroes the first few blocks of a device."
22061 #: ../fish/guestfish-actions.pod:4143
22066 #: ../fish/guestfish-actions.pod:4145
22069 " zerofree device\n"
22074 #: ../fish/guestfish-actions.pod:4158
22079 #: ../fish/guestfish-actions.pod:4160
22082 " zfgrep pattern path\n"
22087 #: ../fish/guestfish-actions.pod:4168
22092 #: ../fish/guestfish-actions.pod:4170
22095 " zfgrepi pattern path\n"
22100 #: ../fish/guestfish-actions.pod:4178
22105 #: ../fish/guestfish-actions.pod:4180
22108 " zfile meth path\n"
22113 #: ../fish/guestfish-actions.pod:4187
22115 "Since 1.0.63, use C<file> instead which can now process compressed files."
22119 #: ../fish/guestfish-actions.pod:4197
22124 #: ../fish/guestfish-actions.pod:4199
22127 " zgrep regex path\n"
22132 #: ../fish/guestfish-actions.pod:4207
22137 #: ../fish/guestfish-actions.pod:4209
22140 " zgrepi regex path\n"
22145 #: ../test-tool/libguestfs-test-tool.pod:5
22146 msgid "libguestfs-test-tool - End user tests for libguestfs"
22150 #: ../test-tool/libguestfs-test-tool.pod:9
22153 " libguestfs-test-tool [--options]\n"
22158 #: ../test-tool/libguestfs-test-tool.pod:13
22160 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
22161 "and developers, to allow them to check basic libguestfs functionality is "
22162 "working. This is needed because libguestfs occasionally breaks for reasons "
22163 "beyond our control: usually because of changes in the underlying qemu or "
22164 "kernel packages, or the host environment."
22168 #: ../test-tool/libguestfs-test-tool.pod:20
22169 msgid "If you suspect a problem in libguestfs, then just run:"
22173 #: ../test-tool/libguestfs-test-tool.pod:22
22176 " libguestfs-test-tool\n"
22181 #: ../test-tool/libguestfs-test-tool.pod:24
22182 msgid "It will print lots of diagnostic messages."
22186 #: ../test-tool/libguestfs-test-tool.pod:26
22187 msgid "If it runs to completion successfully, you will see this near the end:"
22191 #: ../test-tool/libguestfs-test-tool.pod:28
22194 " ===== TEST FINISHED OK =====\n"
22199 #: ../test-tool/libguestfs-test-tool.pod:30
22200 msgid "and the test tool will exit with code 0."
22204 #: ../test-tool/libguestfs-test-tool.pod:32
22206 "If it fails (and/or exits with non-zero error code), please paste the "
22207 "B<complete, unedited> output of the test tool into a bug report. More "
22208 "information about reporting bugs can be found on the L<http://libguestfs.org/"
22213 #: ../test-tool/libguestfs-test-tool.pod:41
22218 #: ../test-tool/libguestfs-test-tool.pod:43
22219 msgid "Display short usage information and exit."
22223 #: ../test-tool/libguestfs-test-tool.pod:45
22224 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
22228 #: ../test-tool/libguestfs-test-tool.pod:47
22230 "Pass an alternate name for the helper program. libguestfs-test-tool will "
22231 "normally look in the C<$libexec> directory that was configured when the tool "
22236 #: ../test-tool/libguestfs-test-tool.pod:51
22237 msgid "I<--qemu qemu_binary>"
22241 #: ../test-tool/libguestfs-test-tool.pod:53
22243 "If you have downloaded another qemu binary, point this option at the full "
22244 "path of the binary to try it."
22248 #: ../test-tool/libguestfs-test-tool.pod:56
22249 msgid "I<--qemudir qemu_source_dir>"
22253 #: ../test-tool/libguestfs-test-tool.pod:58
22255 "If you have compiled qemu from source, point this option at the source "
22256 "directory to try it."
22260 #: ../test-tool/libguestfs-test-tool.pod:61
22261 msgid "I<--timeout N>"
22265 #: ../test-tool/libguestfs-test-tool.pod:63
22267 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
22268 "does not usually need to be adjusted unless your machine is very slow."
22272 #: ../test-tool/libguestfs-test-tool.pod:69
22273 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
22277 #: ../test-tool/libguestfs-test-tool.pod:71
22279 "If you have compiled another version of qemu from source and would like to "
22280 "try that, then you can use the I<--qemudir> option to point to the qemu "
22281 "source directory."
22285 #: ../test-tool/libguestfs-test-tool.pod:75
22287 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
22288 "option to point to the binary."
22292 #: ../test-tool/libguestfs-test-tool.pod:78
22294 "When using an alternate qemu with libguestfs, usually you would need to "
22295 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
22296 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
22297 "use either of the I<--qemudir> or I<--qemu> options."
22301 #: ../test-tool/libguestfs-test-tool.pod:85
22303 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
22304 "I<1> if there was an error."
22308 #: ../test-tool/libguestfs-test-tool.pod:92
22309 msgid "/usr/libexec/libguestfs-test-tool-helper"
22313 #: ../test-tool/libguestfs-test-tool.pod:94
22315 "This helper program is run inside the appliance and provides additional "
22320 #: ../test-tool/libguestfs-test-tool.pod:97
22321 msgid "/usr/bin/mkisofs"
22325 #: ../test-tool/libguestfs-test-tool.pod:99
22327 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
22328 "which is used as part of the tests."
22332 #: ../test-tool/libguestfs-test-tool.pod:106
22334 "For the full list of environment variables which may affect libguestfs, "
22335 "please see the L<guestfs(3)> manual page."
22339 #: ../test-tool/libguestfs-test-tool.pod:111
22340 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
22344 #: ../test-tool/libguestfs-test-tool.pod:121 ../fuse/guestmount.pod:195
22345 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
22349 #: ../fuse/guestmount.pod:5
22351 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
22355 #: ../fuse/guestmount.pod:9
22358 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
22363 #: ../fuse/guestmount.pod:13
22365 "You must I<not> use C<guestmount> in read-write mode on live virtual "
22366 "machines. If you do this, you risk disk corruption in the VM."
22370 #: ../fuse/guestmount.pod:18
22372 "The guestmount program can be used to mount virtual machine filesystems and "
22373 "other disk images on the host. It uses libguestfs for access to the guest "
22374 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
22375 "a mountable device."
22379 #: ../fuse/guestmount.pod:23
22381 "Along with other options, you have to give at least one device (I<-a> "
22382 "option) and at least one mountpoint (I<-m> option). How this works is "
22383 "better explained in the L<guestfish(1)> manual page, or you can use L<virt-"
22384 "inspector(1)> and/or the wrapper script C<guestmount-wrapper> to help you."
22388 #: ../fuse/guestmount.pod:29
22390 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
22391 "by you, and the filesystem will not be visible to any other users unless you "
22392 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
22393 "the filesystem, use the C<fusermount -u> command."
22397 #: ../fuse/guestmount.pod:37
22399 "For a typical Windows guest which has its main filesystem on the first "
22404 #: ../fuse/guestmount.pod:40
22407 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
22412 #: ../fuse/guestmount.pod:42
22414 "For a typical Linux guest which has a /boot filesystem on the first "
22415 "partition, and the root filesystem on a logical volume:"
22419 #: ../fuse/guestmount.pod:45
22422 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
22427 #: ../fuse/guestmount.pod:47
22429 "To get L<virt-inspector(1)> to do the hard work of detecting guest "
22430 "mountpoints for you:"
22434 #: ../fuse/guestmount.pod:50
22437 " guestmount $(virt-inspector --ro-fish MyGuest) /mnt\n"
22442 #: ../fuse/guestmount.pod:52
22444 "(or use --fish if you don't want it to be a read only mount). The option is "
22445 "called I<--ro-fish> or I<--fish> because these parameters are compatible "
22446 "with L<guestfish(1)>."
22450 #: ../fuse/guestmount.pod:56
22452 "If you don't know what filesystems are contained in a guest or disk image, "
22453 "use L<virt-list-filesystems(1)> first:"
22457 #: ../fuse/guestmount.pod:59
22460 " virt-list-filesystems MyGuest\n"
22465 #: ../fuse/guestmount.pod:61
22467 "If you want to trace the libguestfs calls but without excessive debugging, "
22472 #: ../fuse/guestmount.pod:64
22475 " guestmount [-a ... -m ...] --trace /mnt\n"
22480 #: ../fuse/guestmount.pod:66
22481 msgid "If you want to debug the program, we recommend:"
22485 #: ../fuse/guestmount.pod:68
22488 " guestmount [-a ... -m ...] --trace --verbose /mnt\n"
22493 #: ../fuse/guestmount.pod:76
22494 msgid "Add a block device or virtual machine image."
22498 #: ../fuse/guestmount.pod:78
22499 msgid "B<--dir-cache-timeout N>"
22503 #: ../fuse/guestmount.pod:80
22505 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22506 "seconds. The readdir cache [actually, there are several semi-independent "
22507 "caches] is populated after a readdir(2) call with the stat and extended "
22508 "attributes of the files in the directory, in anticipation that they will be "
22509 "requested soon after."
22513 #: ../fuse/guestmount.pod:86
22515 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22516 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22517 "requests, only cache existing ones."
22521 #: ../fuse/guestmount.pod:90
22522 msgid "B<--fuse-help>"
22526 #: ../fuse/guestmount.pod:92
22527 msgid "Display help on special FUSE options (see I<-o> below)."
22531 #: ../fuse/guestmount.pod:96
22532 msgid "Display brief help and exit."
22536 #: ../fuse/guestmount.pod:98
22537 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
22541 #: ../fuse/guestmount.pod:100
22543 "Mount the named partition or logical volume on the given mountpoint B<in the "
22544 "guest> (this has nothing to do with mountpoints in the host)."
22548 #: ../fuse/guestmount.pod:103
22550 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22551 "something on C</>."
22555 #: ../fuse/guestmount.pod:108
22557 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22558 "unmounted. If you specify this option, then we don't attempt to sync the "
22559 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22563 #: ../fuse/guestmount.pod:113
22564 msgid "B<-o option> | B<--option option>"
22568 #: ../fuse/guestmount.pod:115
22569 msgid "Pass extra options to FUSE."
22573 #: ../fuse/guestmount.pod:117
22575 "To get a list of all the extra options supported by FUSE, use the command "
22576 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22577 "of them are a good idea."
22581 #: ../fuse/guestmount.pod:121
22584 " guestmount --fuse-help\n"
22589 #: ../fuse/guestmount.pod:123
22590 msgid "Some potentially useful FUSE options:"
22594 #: ../fuse/guestmount.pod:127
22595 msgid "B<-o allow_other>"
22599 #: ../fuse/guestmount.pod:129
22600 msgid "Allow other users to see the filesystem."
22604 #: ../fuse/guestmount.pod:131
22605 msgid "B<-o attr_timeout=N>"
22609 #: ../fuse/guestmount.pod:133
22610 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22614 #: ../fuse/guestmount.pod:135
22615 msgid "B<-o kernel_cache>"
22619 #: ../fuse/guestmount.pod:137
22621 "Allow the kernel to cache files (reduces the number of reads that have to go "
22622 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22623 "afford the extra memory usage."
22627 #: ../fuse/guestmount.pod:141
22628 msgid "B<-o uid=N> B<-o gid=N>"
22632 #: ../fuse/guestmount.pod:143
22634 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22635 "the chosen values."
22639 #: ../fuse/guestmount.pod:150
22641 "Add devices and mount everything read-only. Also disallow writes and make "
22642 "the disk appear read-only to FUSE."
22646 #: ../fuse/guestmount.pod:153
22648 "This is highly recommended if you are not going to edit the guest disk. If "
22649 "the guest is running and this option is I<not> supplied, then there is a "
22650 "strong risk of disk corruption in the guest. We try to prevent this from "
22651 "happening, but it is not always possible."
22655 #: ../fuse/guestmount.pod:160
22656 msgid "Enable SELinux support for the guest."
22660 #: ../fuse/guestmount.pod:162
22665 #: ../fuse/guestmount.pod:164
22666 msgid "Trace libguestfs calls (to stderr)."
22670 #: ../fuse/guestmount.pod:166
22671 msgid "This also stops the daemon from forking into the background."
22675 #: ../fuse/guestmount.pod:170
22676 msgid "Enable verbose messages from underlying libguestfs."
22680 #: ../fuse/guestmount.pod:174
22681 msgid "Display the program version and exit."
22685 #: ../fuse/guestmount.pod:180
22687 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22688 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
22693 #: ../inspector/virt-inspector.pl:40
22695 "virt-inspector - Display OS version, kernel, drivers, mount points, "
22696 "applications, etc. in a virtual machine"
22700 #: ../inspector/virt-inspector.pl:44
22703 " virt-inspector [--connect URI] domname\n"
22708 #: ../inspector/virt-inspector.pl:46
22711 " virt-inspector guest.img [guest.img ...]\n"
22716 #: ../inspector/virt-inspector.pl:50
22718 "B<virt-inspector> examines a virtual machine and tries to determine the "
22719 "version of the OS, the kernel version, what drivers are installed, whether "
22720 "the virtual machine is fully virtualized (FV) or para-virtualized (PV), what "
22721 "applications are installed and more."
22725 #: ../inspector/virt-inspector.pl:55
22727 "Virt-inspector can produce output in several formats, including a readable "
22728 "text report, and XML for feeding into other programs."
22732 #: ../inspector/virt-inspector.pl:58
22734 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
22735 "libvirt domain (see: C<virsh list --all>)."
22739 #: ../inspector/virt-inspector.pl:61
22741 "You can also run virt-inspector directly on disk images from a single "
22742 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
22743 "has several block devices, in which case you should list them one after "
22744 "another, with the first corresponding to the guest's C</dev/sda>, the second "
22745 "to the guest's C</dev/sdb> and so on."
22749 #: ../inspector/virt-inspector.pl:67
22751 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22752 "inspect several virtual machines, you have to run virt-inspector several "
22753 "times (for example, from a shell script for-loop)."
22757 #: ../inspector/virt-inspector.pl:72
22759 "Because virt-inspector needs direct access to guest images, it won't "
22760 "normally work over remote libvirt connections."
22764 #: ../inspector/virt-inspector.pl:85 ../tools/virt-cat.pl:90
22765 #: ../tools/virt-df.pl:81 ../tools/virt-edit.pl:83
22766 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-list-partitions.pl:61
22767 #: ../tools/virt-ls.pl:89 ../tools/virt-make-fs.pl:163
22768 #: ../tools/virt-rescue.pl:113 ../tools/virt-tar.pl:109
22769 #: ../tools/virt-win-reg.pl:182
22770 msgid "Display brief help."
22774 #: ../inspector/virt-inspector.pl:91 ../tools/virt-cat.pl:96
22775 #: ../tools/virt-df.pl:87 ../tools/virt-edit.pl:89
22776 #: ../tools/virt-list-filesystems.pl:66 ../tools/virt-list-partitions.pl:67
22777 #: ../tools/virt-ls.pl:95 ../tools/virt-make-fs.pl:169
22778 #: ../tools/virt-rescue.pl:119 ../tools/virt-resize.pl:249
22779 #: ../tools/virt-tar.pl:115 ../tools/virt-win-reg.pl:188
22780 msgid "B<--version>"
22784 #: ../inspector/virt-inspector.pl:93 ../tools/virt-cat.pl:98
22785 #: ../tools/virt-df.pl:89 ../tools/virt-edit.pl:91
22786 #: ../tools/virt-list-filesystems.pl:68 ../tools/virt-list-partitions.pl:69
22787 #: ../tools/virt-ls.pl:97 ../tools/virt-make-fs.pl:171
22788 #: ../tools/virt-rescue.pl:121 ../tools/virt-resize.pl:251
22789 #: ../tools/virt-tar.pl:117 ../tools/virt-win-reg.pl:190
22790 msgid "Display version number and exit."
22794 #: ../inspector/virt-inspector.pl:99 ../tools/virt-cat.pl:104
22795 #: ../tools/virt-df.pl:95 ../tools/virt-edit.pl:113
22796 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-list-partitions.pl:75
22797 #: ../tools/virt-ls.pl:103 ../tools/virt-rescue.pl:135
22798 #: ../tools/virt-tar.pl:123 ../tools/virt-win-reg.pl:204
22799 msgid "B<--connect URI> | B<-c URI>"
22803 #: ../inspector/virt-inspector.pl:101 ../tools/virt-cat.pl:106
22804 #: ../tools/virt-df.pl:97 ../tools/virt-edit.pl:115
22805 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-list-partitions.pl:77
22806 #: ../tools/virt-ls.pl:105 ../tools/virt-rescue.pl:137
22807 #: ../tools/virt-tar.pl:125 ../tools/virt-win-reg.pl:206
22809 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
22810 "to the default libvirt hypervisor."
22814 #: ../inspector/virt-inspector.pl:104
22816 "Libvirt is only used if you specify a C<domname> on the command line. If "
22817 "you specify guest block devices directly, then libvirt is not used at all."
22821 #: ../inspector/virt-inspector.pl:114
22823 "The following options select the output format. Use only one of them. The "
22824 "default is a readable text report."
22828 #: ../inspector/virt-inspector.pl:119
22829 msgid "B<--text> (default)"
22833 #: ../inspector/virt-inspector.pl:121
22834 msgid "Plain text report."
22838 #: ../inspector/virt-inspector.pl:123
22843 #: ../inspector/virt-inspector.pl:125
22844 msgid "Produce no output at all."
22848 #: ../inspector/virt-inspector.pl:127
22853 #: ../inspector/virt-inspector.pl:129
22855 "If you select I<--xml> then you get XML output which can be fed to other "
22860 #: ../inspector/virt-inspector.pl:132
22865 #: ../inspector/virt-inspector.pl:134
22867 "If you select I<--yaml> then you get YAML output which can be fed to other "
22872 #: ../inspector/virt-inspector.pl:137
22877 #: ../inspector/virt-inspector.pl:139
22879 "If you select I<--perl> then you get Perl structures output which can be "
22880 "used directly in another Perl program."
22884 #: ../inspector/virt-inspector.pl:142
22889 #: ../inspector/virt-inspector.pl:144
22890 msgid "B<--ro-fish>"
22894 #: ../inspector/virt-inspector.pl:146
22896 "If you select I<--fish> then we print a L<guestfish(1)> command line which "
22897 "will automatically mount up the filesystems on the correct mount points. "
22898 "Try this for example:"
22902 #: ../inspector/virt-inspector.pl:150
22905 " guestfish $(virt-inspector --fish guest.img)\n"
22910 #: ../inspector/virt-inspector.pl:152
22912 "I<--ro-fish> is the same, but the I<--ro> option is passed to guestfish so "
22913 "that the filesystems are mounted read-only."
22917 #: ../inspector/virt-inspector.pl:155
22922 #: ../inspector/virt-inspector.pl:157
22924 "In \"query mode\" we answer common questions about the guest, such as "
22925 "whether it is fullvirt or needs a Xen hypervisor to run."
22929 #: ../inspector/virt-inspector.pl:160
22930 msgid "See section I<QUERY MODE> below."
22934 #: ../inspector/virt-inspector.pl:166
22935 msgid "B<--windows-registry>"
22939 #: ../inspector/virt-inspector.pl:168
22941 "This flag is ignored for compatibility with earlier releases of the software."
22945 #: ../inspector/virt-inspector.pl:171
22947 "In this version, if L<Win::Hivex(3)> is available, then we attempt to parse "
22948 "information out of the Registry for any Windows guest."
22952 #: ../inspector/virt-inspector.pl:218
22953 msgid "OUTPUT FORMAT"
22957 #: ../inspector/virt-inspector.pl:220
22960 " Operating system(s)\n"
22961 " -------------------\n"
22962 " Linux (distro + version)\n"
22963 " Windows (version)\n"
22966 " +--- Filesystems ---------- Installed apps --- Kernel & drivers\n"
22967 " ----------- -------------- ----------------\n"
22968 " mount point => device List of apps Extra information\n"
22969 " mount point => device and versions about kernel(s)\n"
22970 " ... and drivers\n"
22971 " swap => swap device\n"
22972 " (plus lots of extra information\n"
22973 " about each filesystem)\n"
22978 #: ../inspector/virt-inspector.pl:235
22979 msgid "The output of virt-inspector is a complex two-level data structure."
22983 #: ../inspector/virt-inspector.pl:237
22985 "At the top level is a list of the operating systems installed on the guest. "
22986 "(For the vast majority of guests, only a single OS is installed.) The data "
22987 "returned for the OS includes the name (Linux, Windows), the distribution and "
22992 #: ../inspector/virt-inspector.pl:242
22993 msgid "The diagram above shows what we return for each OS."
22997 #: ../inspector/virt-inspector.pl:244
22999 "With the I<--xml> option the output is mapped into an XML document. There "
23000 "is a RELAX-NG schema for this XML in the file I<virt-inspector.rng> which "
23001 "normally ships with virt-inspector, or can be found in the source."
23005 #: ../inspector/virt-inspector.pl:249
23007 "With the I<--fish> or I<--ro-fish> option the mount points are mapped to "
23008 "L<guestfish(1)> command line parameters, so that you can go in afterwards "
23009 "and inspect the guest with everything mounted in the right place. For "
23014 #: ../inspector/virt-inspector.pl:254
23017 " guestfish $(virt-inspector --ro-fish guest.img)\n"
23018 " ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot\n"
23023 #: ../inspector/virt-inspector.pl:589
23028 #: ../inspector/virt-inspector.pl:591
23030 "When you use C<virt-inspector --query>, the output is a series of lines of "
23035 #: ../inspector/virt-inspector.pl:594
23041 " xen_pv_drivers=no\n"
23046 #: ../inspector/virt-inspector.pl:599
23048 "(each answer is usually C<yes> or C<no>, or the line is completely missing "
23049 "if we could not determine the answer at all)."
23053 #: ../inspector/virt-inspector.pl:602
23055 "If the guest is multiboot, you can get apparently conflicting answers (eg. "
23056 "C<windows=yes> and C<linux=yes>, or a guest which is both fullvirt and has a "
23057 "Xen PV kernel). This is normal, and just means that the guest can do both "
23058 "things, although it might require operator intervention such as selecting a "
23059 "boot option when the guest is booting."
23063 #: ../inspector/virt-inspector.pl:609
23064 msgid "This section describes the full range of answers possible."
23068 #: ../inspector/virt-inspector.pl:630
23069 msgid "windows=(yes|no)"
23073 #: ../inspector/virt-inspector.pl:632
23074 msgid "Answer C<yes> if Microsoft Windows is installed in the guest."
23078 #: ../inspector/virt-inspector.pl:645
23079 msgid "linux=(yes|no)"
23083 #: ../inspector/virt-inspector.pl:647
23084 msgid "Answer C<yes> if a Linux kernel is installed in the guest."
23088 #: ../inspector/virt-inspector.pl:660
23089 msgid "rhel=(yes|no)"
23093 #: ../inspector/virt-inspector.pl:662
23094 msgid "Answer C<yes> if the guest contains Red Hat Enterprise Linux."
23098 #: ../inspector/virt-inspector.pl:676
23099 msgid "fedora=(yes|no)"
23103 #: ../inspector/virt-inspector.pl:678
23104 msgid "Answer C<yes> if the guest contains the Fedora Linux distribution."
23108 #: ../inspector/virt-inspector.pl:691
23109 msgid "debian=(yes|no)"
23113 #: ../inspector/virt-inspector.pl:693
23114 msgid "Answer C<yes> if the guest contains the Debian Linux distribution."
23118 #: ../inspector/virt-inspector.pl:706
23119 msgid "fullvirt=(yes|no)"
23123 #: ../inspector/virt-inspector.pl:708
23125 "Answer C<yes> if there is at least one operating system kernel installed in "
23126 "the guest which runs fully virtualized. Such a guest would require a "
23127 "hypervisor which supports full system virtualization."
23131 #: ../inspector/virt-inspector.pl:731
23132 msgid "xen_domU_kernel=(yes|no)"
23136 #: ../inspector/virt-inspector.pl:733
23138 "Answer C<yes> if there is at least one Linux kernel installed in the guest "
23139 "which is compiled as a Xen DomU (a Xen paravirtualized guest)."
23143 #: ../inspector/virt-inspector.pl:753
23144 msgid "xen_pv_drivers=(yes|no)"
23148 #: ../inspector/virt-inspector.pl:755
23150 "Answer C<yes> if the guest has Xen paravirtualized drivers installed "
23151 "(usually the kernel itself will be fully virtualized, but the PV drivers "
23152 "have been installed by the administrator for performance reasons)."
23156 #: ../inspector/virt-inspector.pl:777
23157 msgid "virtio_drivers=(yes|no)"
23161 #: ../inspector/virt-inspector.pl:779
23163 "Answer C<yes> if the guest has virtio paravirtualized drivers installed. "
23164 "Virtio drivers are commonly used to improve the performance of KVM."
23168 #: ../inspector/virt-inspector.pl:800
23169 msgid "userspace_arch=(x86_64|...)"
23173 #: ../inspector/virt-inspector.pl:802
23174 msgid "Print the architecture of userspace."
23178 #: ../inspector/virt-inspector.pl:804 ../inspector/virt-inspector.pl:825
23179 msgid "NB. For multi-boot VMs this can print several lines."
23183 #: ../inspector/virt-inspector.pl:821
23184 msgid "kernel_arch=(x86_64|...)"
23188 #: ../inspector/virt-inspector.pl:823
23189 msgid "Print the architecture of the kernel."
23193 #: ../inspector/virt-inspector.pl:848 ../tools/virt-df.pl:484
23195 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23196 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23200 #: ../inspector/virt-inspector.pl:857 ../tools/virt-cat.pl:175
23201 #: ../tools/virt-df.pl:493 ../tools/virt-edit.pl:339
23202 #: ../tools/virt-list-filesystems.pl:205 ../tools/virt-list-partitions.pl:242
23203 #: ../tools/virt-ls.pl:223 ../tools/virt-make-fs.pl:554
23204 #: ../tools/virt-rescue.pl:243 ../tools/virt-resize.pl:1409
23205 #: ../tools/virt-tar.pl:270 ../tools/virt-win-reg.pl:489
23206 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
23210 #: ../inspector/virt-inspector.pl:859
23211 msgid "Matthew Booth L<mbooth@redhat.com>"
23215 #: ../inspector/virt-inspector.pl:863 ../tools/virt-cat.pl:179
23216 #: ../tools/virt-list-filesystems.pl:209 ../tools/virt-ls.pl:227
23217 #: ../tools/virt-tar.pl:274
23218 msgid "Copyright (C) 2009 Red Hat Inc."
23222 #: ../tools/virt-cat.pl:34
23223 msgid "virt-cat - Display a file in a virtual machine"
23227 #: ../tools/virt-cat.pl:38
23230 " virt-cat [--options] domname file\n"
23235 #: ../tools/virt-cat.pl:40
23238 " virt-cat [--options] disk.img [disk.img ...] file\n"
23243 #: ../tools/virt-cat.pl:44
23245 "C<virt-cat> is a command line tool to display the contents of C<file> where "
23246 "C<file> exists in the named virtual machine (or disk image)."
23250 #: ../tools/virt-cat.pl:47
23252 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
23253 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
23258 #: ../tools/virt-cat.pl:53
23260 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
23264 #: ../tools/virt-cat.pl:56
23267 " virt-cat mydomain /etc/fstab\n"
23272 #: ../tools/virt-cat.pl:58
23273 msgid "List syslog messages from a VM:"
23277 #: ../tools/virt-cat.pl:60
23280 " virt-cat mydomain /var/log/messages | tail\n"
23285 #: ../tools/virt-cat.pl:62
23286 msgid "Find out what DHCP IP address a VM acquired:"
23290 #: ../tools/virt-cat.pl:64
23293 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
23298 #: ../tools/virt-cat.pl:66
23299 msgid "Find out what packages were recently installed:"
23303 #: ../tools/virt-cat.pl:68
23306 " virt-cat mydomain /var/log/yum.log | tail\n"
23311 #: ../tools/virt-cat.pl:70
23312 msgid "Find out who is logged on inside a virtual machine:"
23316 #: ../tools/virt-cat.pl:72
23319 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
23325 #: ../tools/virt-cat.pl:75
23326 msgid "or who was logged on:"
23330 #: ../tools/virt-cat.pl:77
23333 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
23334 " last -f /tmp/wtmp\n"
23339 #: ../tools/virt-cat.pl:109 ../tools/virt-df.pl:100 ../tools/virt-edit.pl:118
23340 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
23341 #: ../tools/virt-ls.pl:108 ../tools/virt-rescue.pl:140
23342 #: ../tools/virt-tar.pl:128 ../tools/virt-win-reg.pl:209
23344 "If you specify guest block devices directly, then libvirt is not used at all."
23348 #: ../tools/virt-cat.pl:165
23350 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, L<Sys::"
23351 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23355 #: ../tools/virt-cat.pl:173 ../tools/virt-df.pl:491 ../tools/virt-edit.pl:337
23356 #: ../tools/virt-list-filesystems.pl:203 ../tools/virt-list-partitions.pl:240
23357 #: ../tools/virt-ls.pl:221 ../tools/virt-make-fs.pl:552
23358 #: ../tools/virt-rescue.pl:241 ../tools/virt-resize.pl:1407
23359 #: ../tools/virt-tar.pl:268 ../tools/virt-win-reg.pl:487
23364 #: ../tools/virt-df.pl:36
23365 msgid "virt-df - Display free space on virtual filesystems"
23369 #: ../tools/virt-df.pl:40
23372 " virt-df [--options]\n"
23377 #: ../tools/virt-df.pl:42
23380 " virt-df [--options] domname\n"
23385 #: ../tools/virt-df.pl:44
23388 " virt-df [--options] disk.img [disk.img ...]\n"
23393 #: ../tools/virt-df.pl:48
23395 "C<virt-df> is a command line tool to display free space on virtual machine "
23396 "filesystems. Unlike other tools, it doesn't just display the amount of "
23397 "space allocated to a virtual machine, but can look inside the virtual "
23398 "machine to see how much space is really being used."
23402 #: ../tools/virt-df.pl:53
23404 "It is like the L<df(1)> command, but for virtual machines, except that it "
23405 "also works for Windows virtual machines."
23409 #: ../tools/virt-df.pl:56
23411 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
23412 "of all active and inactive guests, and performs a C<df>-type operation on "
23413 "each one in turn, printing out the results."
23417 #: ../tools/virt-df.pl:60
23419 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
23420 "either the single named libvirt domain, or on the disk image(s) listed on "
23421 "the command line (which must all belong to a single VM). In this mode (with "
23422 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
23423 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
23427 #: ../tools/virt-df.pl:67
23429 "Use the C<--csv> option to get a format which can be easily parsed by other "
23430 "programs. Other options are mostly similar to standard C<df> options. See "
23431 "below for the complete list."
23435 #: ../tools/virt-df.pl:107
23440 #: ../tools/virt-df.pl:109
23442 "Write out the results in CSV format (comma-separated values). This format "
23443 "can be imported easily into databases and spreadsheets, but read L</NOTE "
23444 "ABOUT CSV FORMAT> below."
23448 #: ../tools/virt-df.pl:117
23449 msgid "B<--human-readable> | B<-h>"
23453 #: ../tools/virt-df.pl:119
23454 msgid "Print sizes in human-readable format."
23458 #: ../tools/virt-df.pl:121
23459 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
23463 #: ../tools/virt-df.pl:127
23464 msgid "B<--inodes> | B<-i>"
23468 #: ../tools/virt-df.pl:129
23469 msgid "Print inodes instead of blocks."
23473 #: ../tools/virt-df.pl:458
23474 msgid "NOTE ABOUT CSV FORMAT"
23478 #: ../tools/virt-df.pl:460
23480 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
23481 "should be easy to parse, but it is definitely not easy to parse."
23485 #: ../tools/virt-df.pl:463
23487 "Myth: Just split fields at commas. Reality: This does I<not> work "
23488 "reliably. This example has two columns:"
23492 #: ../tools/virt-df.pl:466
23495 " \"foo,bar\",baz\n"
23500 #: ../tools/virt-df.pl:468
23502 "Myth: Read the file one line at a time. Reality: This does I<not> work "
23503 "reliably. This example has one row:"
23507 #: ../tools/virt-df.pl:471
23516 #: ../tools/virt-df.pl:474
23518 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
23519 "packaged in major Linux distributions)."
23523 #: ../tools/virt-df.pl:477
23525 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
23526 "or Python's built-in csv library)."
23530 #: ../tools/virt-df.pl:480
23531 msgid "Most spreadsheets and databases can import CSV directly."
23535 #: ../tools/virt-df.pl:497 ../tools/virt-edit.pl:343
23536 #: ../tools/virt-list-partitions.pl:246 ../tools/virt-rescue.pl:247
23537 msgid "Copyright (C) 2009-2010 Red Hat Inc."
23541 #: ../tools/virt-edit.pl:35
23542 msgid "virt-edit - Edit a file in a virtual machine"
23546 #: ../tools/virt-edit.pl:39
23549 " virt-edit [--options] domname file\n"
23554 #: ../tools/virt-edit.pl:41
23557 " virt-edit [--options] disk.img [disk.img ...] file\n"
23562 #: ../tools/virt-edit.pl:43
23565 " virt-edit [domname|disk.img] file -e 'expr'\n"
23570 #: ../tools/virt-edit.pl:47
23572 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
23573 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
23574 "doing this, but doesn't catch all cases."
23578 #: ../tools/virt-edit.pl:53
23580 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
23581 "the named virtual machine (or disk image)."
23585 #: ../tools/virt-edit.pl:56
23587 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
23588 "you should look at the L<guestfish(1)> tool."
23592 #: ../tools/virt-edit.pl:61
23593 msgid "Edit the named files interactively:"
23597 #: ../tools/virt-edit.pl:63
23600 " virt-edit mydomain /boot/grub/grub.conf\n"
23605 #: ../tools/virt-edit.pl:65
23608 " virt-edit mydomain /etc/passwd\n"
23613 #: ../tools/virt-edit.pl:67
23615 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
23616 "below). To change the init default level to 5:"
23620 #: ../tools/virt-edit.pl:71
23623 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
23628 #: ../tools/virt-edit.pl:97
23629 msgid "B<--backup extension> | B<-b extension>"
23633 #: ../tools/virt-edit.pl:99
23635 "Create a backup of the original file I<in the guest disk image>. The backup "
23636 "has the original filename with C<extension> added."
23640 #: ../tools/virt-edit.pl:102
23642 "Usually the first character of C<extension> would be a dot C<.> so you would "
23647 #: ../tools/virt-edit.pl:105
23650 " virt-edit -b .orig [etc]\n"
23655 #: ../tools/virt-edit.pl:107
23656 msgid "By default, no backup file is made."
23660 #: ../tools/virt-edit.pl:125
23661 msgid "B<--expr EXPR> | B<-e EXPR>"
23665 #: ../tools/virt-edit.pl:127
23667 "Instead of launching the external editor, non-interactively apply the Perl "
23668 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
23673 #: ../tools/virt-edit.pl:131
23675 "Be careful to properly quote the expression to prevent it from being altered "
23680 #: ../tools/virt-edit.pl:250
23681 msgid "NON-INTERACTIVE EDITING"
23685 #: ../tools/virt-edit.pl:252
23687 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
23688 "administrator can interactively edit the file."
23692 #: ../tools/virt-edit.pl:255
23694 "There are two ways also to use C<virt-edit> from scripts in order to make "
23695 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
23696 "like this, it's less error-prone to write scripts directly using the "
23697 "libguestfs API and Augeas for configuration file editing.)"
23701 #: ../tools/virt-edit.pl:261
23703 "The first method is to temporarily set C<$EDITOR> to any script or program "
23704 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
23705 "update C<tmpfile> in place however it likes."
23709 #: ../tools/virt-edit.pl:265
23711 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
23712 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
23713 "instances of C<foo> with C<bar> in a file:"
23717 #: ../tools/virt-edit.pl:269
23720 " virt-edit domname filename -e 's/foo/bar/'\n"
23725 #: ../tools/virt-edit.pl:271
23727 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
23728 "For example to delete root's password you could do:"
23732 #: ../tools/virt-edit.pl:274
23735 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
23740 #: ../tools/virt-edit.pl:276
23742 "What really happens is that the snippet is evaluated as a Perl expression "
23743 "for each line of the file. The line, including the final C<\\n>, is passed "
23744 "in C<$_> and the expression should update C<$_> or leave it unchanged."
23748 #: ../tools/virt-edit.pl:281
23750 "To delete a line, set C<$_> to the empty string. For example, to delete the "
23751 "C<apache> user account from the password file you can do:"
23755 #: ../tools/virt-edit.pl:284
23758 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
23763 #: ../tools/virt-edit.pl:286
23765 "To insert a line, prepend or append it to C<$_>. However appending lines to "
23766 "the end of the file is rather difficult this way since there is no concept "
23767 "of \"last line of the file\" - your expression just doesn't get called "
23768 "again. You might want to use the first method (setting C<$EDITOR>) if you "
23773 #: ../tools/virt-edit.pl:292
23775 "The variable C<$lineno> contains the current line number. As is "
23776 "traditional, the first line in the file is number C<1>."
23780 #: ../tools/virt-edit.pl:295
23782 "The return value from the expression is ignored, but the expression may call "
23783 "C<die> in order to abort the whole program, leaving the original file "
23788 #: ../tools/virt-edit.pl:299
23790 "Remember when matching the end of a line that C<$_> may contain the final C<"
23791 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
23792 "newline then neither of these. Thus to match or substitute some text at the "
23793 "end of a line, use this regular expression:"
23797 #: ../tools/virt-edit.pl:304
23800 " /some text(\\r?\\n)?$/\n"
23805 #: ../tools/virt-edit.pl:306
23807 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
23808 "$_> itself (since that would remove all newlines from the file):"
23812 #: ../tools/virt-edit.pl:310
23815 " my $m = $_; chomp $m; $m =~ /some text$/\n"
23820 #: ../tools/virt-edit.pl:316
23825 #: ../tools/virt-edit.pl:318
23827 "If set, this string is used as the editor. It may contain arguments, eg. C<"
23832 #: ../tools/virt-edit.pl:321
23833 msgid "If not set, C<vi> is used."
23837 #: ../tools/virt-edit.pl:327
23839 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
23840 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
23845 #: ../tools/virt-list-filesystems.pl:32
23847 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
23851 #: ../tools/virt-list-filesystems.pl:36
23854 " virt-list-filesystems [--options] domname\n"
23859 #: ../tools/virt-list-filesystems.pl:38
23862 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
23867 #: ../tools/virt-list-filesystems.pl:42
23869 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
23870 "are contained in a virtual machine or disk image."
23874 #: ../tools/virt-list-filesystems.pl:46
23876 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
23877 "functionality. For more complex cases you should look at the L<guestfish(1)"
23882 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-list-partitions.pl:95
23883 #: ../tools/virt-ls.pl:115
23884 msgid "B<-l> | B<--long>"
23888 #: ../tools/virt-list-filesystems.pl:88
23890 "With this option, C<virt-list-filesystems> displays the type of each "
23891 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
23895 #: ../tools/virt-list-filesystems.pl:95
23896 msgid "B<-a> | B<--all>"
23900 #: ../tools/virt-list-filesystems.pl:97
23902 "Normally we only show mountable filesystems. If this option is given then "
23903 "swap devices are shown too."
23907 #: ../tools/virt-list-filesystems.pl:193
23909 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
23910 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
23911 ">, L<http://libguestfs.org/>."
23915 #: ../tools/virt-list-partitions.pl:32
23917 "virt-list-partitions - List partitions in a virtual machine or disk image"
23921 #: ../tools/virt-list-partitions.pl:36
23924 " virt-list-partitions [--options] domname\n"
23929 #: ../tools/virt-list-partitions.pl:38
23932 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
23937 #: ../tools/virt-list-partitions.pl:42
23939 "C<virt-list-partitions> is a command line tool to list the partitions that "
23940 "are contained in a virtual machine or disk image. It is mainly useful as a "
23941 "first step to using L<virt-resize(1)>."
23945 #: ../tools/virt-list-partitions.pl:47
23947 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
23948 "functionality. For more complex cases you should look at the L<guestfish(1)"
23953 #: ../tools/virt-list-partitions.pl:87
23954 msgid "B<-h> | B<--human-readable>"
23958 #: ../tools/virt-list-partitions.pl:89
23959 msgid "Show sizes in human-readable form (eg. \"1G\")."
23963 #: ../tools/virt-list-partitions.pl:97
23965 "With this option, C<virt-list-partitions> displays the type and size of each "
23966 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
23970 #: ../tools/virt-list-partitions.pl:104
23971 msgid "B<-t> | B<--total>"
23975 #: ../tools/virt-list-partitions.pl:106
23977 "Display the total size of each block device (as a separate row or rows)."
23981 #: ../tools/virt-list-partitions.pl:231
23983 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
23984 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
23985 "libguestfs.org/>."
23989 #: ../tools/virt-ls.pl:35
23990 msgid "virt-ls - List files in a virtual machine"
23994 #: ../tools/virt-ls.pl:39
23997 " virt-ls [--options] domname directory\n"
24002 #: ../tools/virt-ls.pl:41
24005 " virt-ls [--options] disk.img [disk.img ...] directory\n"
24010 #: ../tools/virt-ls.pl:45
24012 "C<virt-ls> is a command line tool to list the names of files in a directory "
24013 "inside a virtual machine or disk image."
24017 #: ../tools/virt-ls.pl:48
24019 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
24020 "For more complex cases you should look at the L<guestfish(1)> tool."
24024 #: ../tools/virt-ls.pl:52
24026 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
24027 "simple listing is like the ordinary L<ls(1)> command:"
24031 #: ../tools/virt-ls.pl:55
24034 " $ virt-ls myguest /\n"
24042 #: ../tools/virt-ls.pl:60
24043 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
24047 #: ../tools/virt-ls.pl:62
24050 " $ virt-ls -l myguest /\n"
24052 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
24053 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
24059 #: ../tools/virt-ls.pl:68
24061 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
24062 "and directories recursively:"
24066 #: ../tools/virt-ls.pl:71
24069 " $ virt-ls -R myguest /tmp\n"
24077 #: ../tools/virt-ls.pl:76
24079 "You I<cannot> combine these options. To do more complicated things, use "
24084 #: ../tools/virt-ls.pl:117
24085 msgid "B<-R> | B<--recursive>"
24089 #: ../tools/virt-ls.pl:119
24091 "Select the mode. With neither of these options, C<virt-ls> produces a "
24092 "simple, flat list of the files in the named directory."
24096 #: ../tools/virt-ls.pl:122
24098 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
24099 "like the plain C<ls -l> command)."
24103 #: ../tools/virt-ls.pl:125
24105 "C<virt-ls -R> produces a recursive list of files starting at the named "
24106 "directory. See the documentation for the C<guestfs_find> command L<guestfs"
24107 "(3)> for precise details."
24111 #: ../tools/virt-ls.pl:129
24112 msgid "You cannot combine these options."
24116 #: ../tools/virt-ls.pl:212
24118 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
24119 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
24124 #: ../tools/virt-make-fs.pl:37
24125 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
24129 #: ../tools/virt-make-fs.pl:41
24132 " virt-make-fs [--options] input.tar output.img\n"
24137 #: ../tools/virt-make-fs.pl:43
24140 " virt-make-fs [--options] input.tar.gz output.img\n"
24145 #: ../tools/virt-make-fs.pl:45
24148 " virt-make-fs [--options] directory output.img\n"
24153 #: ../tools/virt-make-fs.pl:49
24155 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
24156 "archive or some files in a directory. It is similar to tools like L<mkisofs"
24157 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
24158 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
24159 "you want to attach these filesystems to existing virtual machines (eg. to "
24160 "import large amounts of read-only data to a VM)."
24164 #: ../tools/virt-make-fs.pl:57
24165 msgid "Basic usage is:"
24169 #: ../tools/virt-make-fs.pl:59
24172 " virt-make-fs input output\n"
24177 #: ../tools/virt-make-fs.pl:61
24179 "where C<input> is either a directory containing files that you want to add, "
24180 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
24181 "C<output> is a disk image. The input type is detected automatically. The "
24182 "output disk image defaults to a raw ext2 image unless you specify extra "
24183 "flags (see L</OPTIONS> below)."
24187 #: ../tools/virt-make-fs.pl:67
24188 msgid "EXTRA SPACE"
24192 #: ../tools/virt-make-fs.pl:69
24194 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
24195 "the files that it contains, but might have extra space. Depending on how "
24196 "you are going to use the output, you might think this extra space is wasted "
24197 "and want to minimize it, or you might want to leave space so that more files "
24198 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
24199 "but you can use the C<--size> flag to leave space in the filesystem if you "
24204 #: ../tools/virt-make-fs.pl:77
24206 "An alternative way to leave extra space but not make the output image any "
24207 "bigger is to use an alternative disk image format (instead of the default "
24208 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
24209 "image format (check your hypervisor supports this before using it). This "
24210 "allows you to choose a large C<--size> but the extra space won't actually be "
24211 "allocated in the image until you try to store something in it."
24215 #: ../tools/virt-make-fs.pl:85
24217 "Don't forget that you can also use local commands including L<resize2fs(8)> "
24218 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
24219 "resize to build another image from scratch."
24223 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
24224 #: ../tools/virt-make-fs.pl:142
24229 #: ../tools/virt-make-fs.pl:91
24232 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
24237 #: ../tools/virt-make-fs.pl:93
24238 msgid "FILESYSTEM TYPE"
24242 #: ../tools/virt-make-fs.pl:95
24244 "The default filesystem type is C<ext2>. Just about any filesystem type that "
24245 "libguestfs supports can be used (but I<not> read-only formats like "
24246 "ISO9660). Here are some of the more common choices:"
24250 #: ../tools/virt-make-fs.pl:101
24255 #: ../tools/virt-make-fs.pl:103
24257 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
24258 "you are not going to use the filesystem in a way that requires the journal, "
24259 "then this is just wasted overhead."
24263 #: ../tools/virt-make-fs.pl:107
24264 msgid "I<ntfs> or I<vfat>"
24268 #: ../tools/virt-make-fs.pl:109
24269 msgid "Useful if exporting data to a Windows guest."
24273 #: ../tools/virt-make-fs.pl:111
24275 "I<Note for vfat>: The tar archive or local directory must only contain files "
24276 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
24277 "program running within libguestfs is unable to change the ownership of non-"
24278 "root files, since vfat itself does not support this."
24282 #: ../tools/virt-make-fs.pl:116
24287 #: ../tools/virt-make-fs.pl:118
24289 "Lower overhead than C<ext2>, but certain limitations on filename length and "
24290 "total filesystem size."
24294 #: ../tools/virt-make-fs.pl:125
24297 " virt-make-fs --type=minix input minixfs.img\n"
24302 #: ../tools/virt-make-fs.pl:127
24303 msgid "TO PARTITION OR NOT TO PARTITION"
24307 #: ../tools/virt-make-fs.pl:129
24308 msgid "Optionally virt-make-fs can add a partition table to the output disk."
24312 #: ../tools/virt-make-fs.pl:131
24314 "Adding a partition can make the disk image more compatible with certain "
24315 "virtualized operating systems which don't expect to see a filesystem "
24316 "directly located on a block device (Linux doesn't care and will happily "
24317 "handle both types)."
24321 #: ../tools/virt-make-fs.pl:136
24323 "On the other hand, if you have a partition table then the output image is no "
24324 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
24325 "directly on a partitioned disk image. (However libguestfs tools such as "
24326 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
24330 #: ../tools/virt-make-fs.pl:144
24331 msgid "Add an MBR partition:"
24335 #: ../tools/virt-make-fs.pl:146
24338 " virt-make-fs --partition -- input disk.img\n"
24343 #: ../tools/virt-make-fs.pl:148
24345 "If the output disk image could be terabyte-sized or larger, it's better to "
24346 "use an EFI/GPT-compatible partition table:"
24350 #: ../tools/virt-make-fs.pl:151
24353 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
24358 #: ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:196
24363 #: ../tools/virt-make-fs.pl:179
24364 msgid "Enable debugging information."
24368 #: ../tools/virt-make-fs.pl:185
24369 msgid "B<--size=E<lt>NE<gt>>"
24373 #: ../tools/virt-make-fs.pl:187
24374 msgid "B<--size=+E<lt>NE<gt>>"
24378 #: ../tools/virt-make-fs.pl:189
24379 msgid "B<-s E<lt>NE<gt>>"
24383 #: ../tools/virt-make-fs.pl:191
24384 msgid "B<-s +E<lt>NE<gt>>"
24388 #: ../tools/virt-make-fs.pl:193
24390 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
24394 #: ../tools/virt-make-fs.pl:196
24396 "If this option is I<not> given, then the output image will be just large "
24397 "enough to contain all the files, with not much wasted space."
24401 #: ../tools/virt-make-fs.pl:199
24403 "To choose a fixed size output disk, specify an absolute number followed by b/"
24404 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24405 "Petabytes or Exabytes. This must be large enough to contain all the input "
24406 "files, else you will get an error."
24410 #: ../tools/virt-make-fs.pl:204
24412 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
24413 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24414 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
24415 "the input files, and (approximately) an extra 200 MB free space."
24419 #: ../tools/virt-make-fs.pl:210
24421 "Note that virt-make-fs estimates free space, and therefore will not produce "
24422 "filesystems containing precisely the free space requested. (It is much more "
24423 "expensive and time-consuming to produce a filesystem which has precisely the "
24424 "desired free space)."
24428 #: ../tools/virt-make-fs.pl:219
24429 msgid "B<--format=E<lt>fmtE<gt>>"
24433 #: ../tools/virt-make-fs.pl:221
24434 msgid "B<-F E<lt>fmtE<gt>>"
24438 #: ../tools/virt-make-fs.pl:223
24439 msgid "Choose the output disk image format."
24443 #: ../tools/virt-make-fs.pl:225
24444 msgid "The default is C<raw> (raw disk image)."
24448 #: ../tools/virt-make-fs.pl:227
24450 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
24451 "that would really make sense here is C<qcow2>."
24455 #: ../tools/virt-make-fs.pl:234
24456 msgid "B<--type=E<lt>fsE<gt>>"
24460 #: ../tools/virt-make-fs.pl:236
24461 msgid "B<-t E<lt>fsE<gt>>"
24465 #: ../tools/virt-make-fs.pl:238
24466 msgid "Choose the output filesystem type."
24470 #: ../tools/virt-make-fs.pl:240
24471 msgid "The default is C<ext2>."
24475 #: ../tools/virt-make-fs.pl:242
24477 "Any filesystem which is supported read-write by libguestfs can be used here."
24481 #: ../tools/virt-make-fs.pl:249
24482 msgid "B<--partition>"
24486 #: ../tools/virt-make-fs.pl:251
24487 msgid "B<--partition=E<lt>parttypeE<gt>>"
24491 #: ../tools/virt-make-fs.pl:253
24493 "If specified, this flag adds an MBR partition table to the output disk image."
24497 #: ../tools/virt-make-fs.pl:256
24499 "You can change the partition table type, eg. C<--partition=gpt> for large "
24504 #: ../tools/virt-make-fs.pl:259
24506 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
24507 "might consider the next parameter to be the partition type. For example:"
24511 #: ../tools/virt-make-fs.pl:263
24514 " virt-make-fs --partition input.tar ...\n"
24519 #: ../tools/virt-make-fs.pl:265
24521 "would cause virt-make-fs to think you wanted to use a partition type of "
24522 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
24523 "dash) between options and the input file argument:"
24527 #: ../tools/virt-make-fs.pl:269
24530 " virt-make-fs --partition -- input.tar ...\n"
24535 #: ../tools/virt-make-fs.pl:529
24537 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
24538 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
24539 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
24543 #: ../tools/virt-make-fs.pl:543 ../tools/virt-win-reg.pl:478
24545 "When reporting bugs, please enable debugging and capture the I<complete> "
24550 #: ../tools/virt-make-fs.pl:546
24553 " export LIBGUESTFS_DEBUG=1\n"
24554 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
24559 #: ../tools/virt-make-fs.pl:549
24561 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
24566 #: ../tools/virt-make-fs.pl:558 ../tools/virt-resize.pl:1413
24567 #: ../tools/virt-win-reg.pl:493
24568 msgid "Copyright (C) 2010 Red Hat Inc."
24572 #: ../tools/virt-rescue.pl:33
24573 msgid "virt-rescue - Run a rescue shell on a virtual machine"
24577 #: ../tools/virt-rescue.pl:37
24580 " virt-rescue [--options] domname\n"
24585 #: ../tools/virt-rescue.pl:39
24588 " virt-rescue [--options] disk.img [disk.img ...]\n"
24593 #: ../tools/virt-rescue.pl:43
24595 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
24596 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
24597 "you from doing this, but doesn't catch all cases."
24601 #: ../tools/virt-rescue.pl:47
24603 "However if you use the I<--ro> (read only) option, then you can attach a "
24604 "shell to a live virtual machine. The results might be strange or "
24605 "inconsistent at times but you won't get disk corruption."
24609 #: ../tools/virt-rescue.pl:53
24611 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
24612 "need for a CD. virt-rescue gives you a rescue shell and some simple "
24613 "recovery tools which you can use to examine or rescue a virtual machine or "
24618 #: ../tools/virt-rescue.pl:58
24620 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
24621 "on disk image(s):"
24625 #: ../tools/virt-rescue.pl:61
24628 " virt-rescue GuestName\n"
24633 #: ../tools/virt-rescue.pl:63
24636 " virt-rescue --ro /path/to/disk.img\n"
24641 #: ../tools/virt-rescue.pl:65
24644 " virt-rescue /dev/sdc\n"
24649 #: ../tools/virt-rescue.pl:67
24650 msgid "For live VMs you I<must> use the --ro option."
24654 #: ../tools/virt-rescue.pl:69
24656 "When you run virt-rescue on a virtual machine or disk image, you are placed "
24657 "in an interactive bash shell where you can use many ordinary Linux "
24658 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
24659 "appliance. You must mount the virtual machine's filesystems by hand. There "
24660 "is an empty directory called C</sysroot> where you can mount filesystems."
24664 #: ../tools/virt-rescue.pl:76
24666 "In the example below, we list logical volumes, then choose one to mount "
24667 "under C</sysroot>:"
24671 #: ../tools/virt-rescue.pl:79
24675 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
24676 " lv_root vg_f11x64 -wi-a- 8.83G\n"
24677 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
24678 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
24679 " ><rescue> ls /sysroot\n"
24684 #: ../tools/virt-rescue.pl:86
24686 "If you don't know what filesystems are available on the virtual machine then "
24687 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
24691 #: ../tools/virt-rescue.pl:90 ../tools/virt-resize.pl:1350
24696 #: ../tools/virt-rescue.pl:92
24698 "Virt-rescue can be used on I<any> disk image file or device, not just a "
24699 "virtual machine. For example you can use it on a blank file if you want to "
24700 "partition that file (although we would recommend using L<guestfish(1)> "
24701 "instead as it is more suitable for this purpose). You can even use virt-"
24702 "rescue on things like SD cards."
24706 #: ../tools/virt-rescue.pl:98
24708 "This tool is just designed for quick interactive hacking on a virtual "
24709 "machine. For more structured access to a virtual machine disk image, you "
24710 "should use L<guestfs(3)>. To get a structured shell that you can use to "
24711 "make scripted changes to guests, use L<guestfish(1)>."
24715 #: ../tools/virt-rescue.pl:127
24716 msgid "B<--append kernelopts>"
24720 #: ../tools/virt-rescue.pl:129
24721 msgid "Pass additional options to the rescue kernel."
24725 #: ../tools/virt-rescue.pl:147
24726 msgid "B<--memsize MB> | B<-m MB>"
24730 #: ../tools/virt-rescue.pl:149
24732 "Change the amount of memory allocated to the rescue system. The default is "
24733 "set by libguestfs and is small but adequate for running system tools. The "
24734 "occasional program might need more memory. The parameter is specified in "
24739 #: ../tools/virt-rescue.pl:158
24740 msgid "B<--ro> | B<-r>"
24744 #: ../tools/virt-rescue.pl:160
24745 msgid "Open the image read-only."
24749 #: ../tools/virt-rescue.pl:172
24751 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
24752 "SELINUX> before using this option."
24756 #: ../tools/virt-rescue.pl:228
24758 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
24759 "ENVIRONMENT VARIABLES> for the complete list."
24763 #: ../tools/virt-rescue.pl:233
24765 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24766 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24770 #: ../tools/virt-resize.pl:42
24771 msgid "virt-resize - Resize a virtual machine disk"
24775 #: ../tools/virt-resize.pl:46
24778 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24779 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24780 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24785 #: ../tools/virt-resize.pl:52
24787 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24788 "larger or smaller overall, and resizing or deleting any partitions contained "
24793 #: ../tools/virt-resize.pl:56
24795 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24796 "not> be used on live virtual machines - for consistent results, shut the "
24797 "virtual machine down before resizing it."
24801 #: ../tools/virt-resize.pl:60
24803 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
24804 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
24805 "read those manual pages first."
24809 #: ../tools/virt-resize.pl:68
24811 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
24812 "fill the extra 5GB of space."
24816 #: ../tools/virt-resize.pl:71
24819 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
24820 " virt-list-partitions -lht olddisk\n"
24821 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
24822 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
24827 #: ../tools/virt-resize.pl:76
24829 "As above, but make the /boot partition 200MB bigger, while giving the "
24830 "remaining space to /dev/sda2:"
24834 #: ../tools/virt-resize.pl:79
24837 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
24842 #: ../tools/virt-resize.pl:81
24843 msgid "DETAILED USAGE"
24847 #: ../tools/virt-resize.pl:83
24848 msgid "EXPANDING A VIRTUAL MACHINE DISK"
24852 #: ../tools/virt-resize.pl:87
24853 msgid "1. Shut down the virtual machine"
24857 #: ../tools/virt-resize.pl:89
24858 msgid "2. Locate input disk image"
24862 #: ../tools/virt-resize.pl:91
24864 "Locate the input disk image (ie. the file or device on the host containing "
24865 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
24866 "dumpxml> like this to find the disk image name:"
24870 #: ../tools/virt-resize.pl:95
24873 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
24874 " Found 1 nodes:\n"
24876 " <source dev=\"/dev/vg/lv_guest\" />\n"
24881 #: ../tools/virt-resize.pl:100
24882 msgid "3. Look at current sizing"
24886 #: ../tools/virt-resize.pl:102
24888 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
24892 #: ../tools/virt-resize.pl:105
24895 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
24896 " /dev/sda1 ext3 101.9M\n"
24897 " /dev/sda2 pv 7.9G\n"
24898 " /dev/sda device 8.0G\n"
24903 #: ../tools/virt-resize.pl:110
24905 "(This example is a virtual machine with an 8 GB disk which we would like to "
24906 "expand up to 10 GB)."
24910 #: ../tools/virt-resize.pl:113
24911 msgid "4. Create output disk"
24915 #: ../tools/virt-resize.pl:115
24917 "Virt-resize cannot do in-place disk modifications. You have to have space "
24918 "to store the resized output disk."
24922 #: ../tools/virt-resize.pl:118
24924 "To store the resized disk image in a file, create a file of a suitable size:"
24928 #: ../tools/virt-resize.pl:121
24931 " # rm -f outdisk\n"
24932 " # truncate -s 10G outdisk\n"
24937 #: ../tools/virt-resize.pl:124
24938 msgid "Or use L<lvcreate(1)> to create a logical volume:"
24942 #: ../tools/virt-resize.pl:126
24945 " # lvcreate -L 10G -n lv_name vg_name\n"
24950 #: ../tools/virt-resize.pl:128
24951 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
24955 #: ../tools/virt-resize.pl:130
24958 " # virsh pool-list\n"
24959 " # virsh vol-create-as poolname newvol 10G\n"
24964 #: ../tools/virt-resize.pl:133
24969 #: ../tools/virt-resize.pl:135
24971 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
24972 "file) and the output disk. The output disk is the one created in the "
24977 #: ../tools/virt-resize.pl:139
24980 " # virt-resize indisk outdisk\n"
24985 #: ../tools/virt-resize.pl:141
24987 "This command just copies disk image C<indisk> to disk image C<outdisk> "
24988 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
24989 "larger, then an extra, empty partition is created at the end of the disk "
24990 "covering the extra space. If C<outdisk> is smaller, then it will give an "
24995 #: ../tools/virt-resize.pl:147
24997 "More realistically you'd want to expand existing partitions in the disk "
24998 "image by passing extra options (for the full list see the L</OPTIONS> "
25003 #: ../tools/virt-resize.pl:151
25005 "L</--expand> is the most useful option. It expands the named partition "
25006 "within the disk to fill any extra space:"
25010 #: ../tools/virt-resize.pl:154
25013 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25018 #: ../tools/virt-resize.pl:156
25020 "(In this case, an extra partition is I<not> created at the end of the disk, "
25021 "because there will be no unused space)."
25025 #: ../tools/virt-resize.pl:159
25027 "L</--resize> is the other commonly used option. The following would "
25028 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25029 "rest of the available space:"
25033 #: ../tools/virt-resize.pl:163
25036 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25037 " indisk outdisk\n"
25042 #: ../tools/virt-resize.pl:166
25044 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25045 "if virt-resize knows how, it will resize the contents, the equivalent of "
25046 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
25047 ">. However virt-resize does not know how to resize some filesystems, so you "
25048 "would have to online resize them after booting the guest. And virt-resize "
25049 "also does not resize anything inside an LVM PV, it just resizes the PV "
25050 "itself and leaves the user to resize any LVs inside that PV as desired."
25054 #: ../tools/virt-resize.pl:175
25055 msgid "Other options are covered below."
25059 #: ../tools/virt-resize.pl:177
25064 #: ../tools/virt-resize.pl:179
25065 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25069 #: ../tools/virt-resize.pl:181
25070 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25074 #: ../tools/virt-resize.pl:183
25077 " # virsh edit guestname\n"
25082 #: ../tools/virt-resize.pl:185
25084 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
25085 "html#elementsDisks>"
25089 #: ../tools/virt-resize.pl:188
25090 msgid "Then start up the domain with the new, resized disk:"
25094 #: ../tools/virt-resize.pl:190
25097 " # virsh start guestname\n"
25102 #: ../tools/virt-resize.pl:192
25104 "and check that it still works. See also the L</NOTES> section below for "
25105 "additional information."
25109 #: ../tools/virt-resize.pl:195
25110 msgid "7. Resize LVs etc inside the guest"
25114 #: ../tools/virt-resize.pl:197
25115 msgid "(This can also be done offline using L<guestfish(1)>)"
25119 #: ../tools/virt-resize.pl:199
25121 "Once the guest has booted you should see the new space available, at least "
25122 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25123 "may need to resize LVs inside PVs, and also resize filesystem types that "
25124 "virt-resize does not know how to expand."
25128 #: ../tools/virt-resize.pl:206
25129 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25133 #: ../tools/virt-resize.pl:208
25135 "Shrinking is somewhat more complex than expanding, and only an overview is "
25140 #: ../tools/virt-resize.pl:211
25142 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25143 "filesystems). The user has to shrink content before passing the disk image "
25144 "to virt-resize, and virt-resize will check that the content has been shrunk "
25149 #: ../tools/virt-resize.pl:216
25150 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25154 #: ../tools/virt-resize.pl:218
25156 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25157 "steps 3 and 4 above to allocate a new disk image."
25161 #: ../tools/virt-resize.pl:221
25163 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25167 #: ../tools/virt-resize.pl:224
25168 msgid "IGNORING OR DELETING PARTITIONS"
25172 #: ../tools/virt-resize.pl:226
25174 "virt-resize also gives a convenient way to ignore or delete partitions when "
25175 "copying from the input disk to the output disk. Ignoring a partition speeds "
25176 "up the copy where you don't care about the existing contents of a "
25177 "partition. Deleting a partition removes it completely, but note that it "
25178 "also renumbers any partitions after the one which is deleted, which can "
25179 "leave some guests unbootable."
25183 #: ../tools/virt-resize.pl:243
25184 msgid "Display help."
25188 #: ../tools/virt-resize.pl:257
25189 msgid "B<--resize part=size>"
25193 #: ../tools/virt-resize.pl:259
25195 "Resize the named partition (expanding or shrinking it) so that it has the "
25200 #: ../tools/virt-resize.pl:262
25202 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25203 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25204 "Exabytes; or as a percentage of the current size; or as a relative number or "
25205 "percentage. For example:"
25209 #: ../tools/virt-resize.pl:267
25212 " --resize /dev/sda2=10G\n"
25217 #: ../tools/virt-resize.pl:269
25220 " --resize /dev/sda4=90%\n"
25225 #: ../tools/virt-resize.pl:271
25228 " --resize /dev/sda2=+1G\n"
25233 #: ../tools/virt-resize.pl:273
25236 " --resize /dev/sda2=-200M\n"
25241 #: ../tools/virt-resize.pl:275
25244 " --resize /dev/sda1=+128K\n"
25249 #: ../tools/virt-resize.pl:277
25252 " --resize /dev/sda1=+10%\n"
25257 #: ../tools/virt-resize.pl:279
25260 " --resize /dev/sda1=-10%\n"
25265 #: ../tools/virt-resize.pl:281
25267 "You can increase the size of any partition. Virt-resize will expand the "
25268 "direct content of the partition if it knows how (see C<--expand> below)."
25272 #: ../tools/virt-resize.pl:285
25274 "You can only I<decrease> the size of partitions that contain filesystems or "
25275 "PVs which have already been shrunk. Virt-resize will check this has been "
25276 "done before proceeding, or else will print an error (see also C<--resize-"
25281 #: ../tools/virt-resize.pl:290 ../tools/virt-resize.pl:382
25282 #: ../tools/virt-resize.pl:399
25283 msgid "You can give this option multiple times."
25287 #: ../tools/virt-resize.pl:296
25288 msgid "B<--resize-force part=size>"
25292 #: ../tools/virt-resize.pl:298
25294 "This is the same as C<--resize> except that it will let you decrease the "
25295 "size of any partition. Generally this means you will lose any data which "
25296 "was at the end of the partition you shrink, but you may not care about that "
25297 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25298 "as a swap partition)."
25302 #: ../tools/virt-resize.pl:304
25303 msgid "See also the C<--ignore> option."
25307 #: ../tools/virt-resize.pl:310
25308 msgid "B<--expand part>"
25312 #: ../tools/virt-resize.pl:312
25314 "Expand the named partition so it uses up all extra space (space left over "
25315 "after any other resize changes that you request have been done)."
25319 #: ../tools/virt-resize.pl:315
25321 "If virt-resize knows how, it will expand the direct content of the "
25322 "partition. For example, if the partition is an LVM PV, it will expand the "
25323 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25324 "content it doesn't know about alone."
25328 #: ../tools/virt-resize.pl:320
25329 msgid "Currently virt-resize can resize:"
25333 #: ../tools/virt-resize.pl:326
25335 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25340 #: ../tools/virt-resize.pl:331
25342 "NTFS filesystems contained directly in a partition, if libguestfs was "
25343 "compiled with support for NTFS."
25347 #: ../tools/virt-resize.pl:334
25349 "The filesystem must have been shut down consistently last time it was used. "
25350 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25351 "consistency check, so at the first boot after resizing Windows will check "
25356 #: ../tools/virt-resize.pl:341
25358 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25359 "inside the PV. The user will have to resize LVs as desired."
25363 #: ../tools/virt-resize.pl:347 ../tools/virt-resize.pl:369
25364 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25368 #: ../tools/virt-resize.pl:353
25369 msgid "B<--shrink part>"
25373 #: ../tools/virt-resize.pl:355
25375 "Shrink the named partition until the overall disk image fits in the "
25376 "destination. The named partition B<must> contain a filesystem or PV which "
25377 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25378 "online tools). Virt-resize will check this and give an error if it has not "
25383 #: ../tools/virt-resize.pl:361
25385 "The amount by which the overall disk must be shrunk (after carrying out all "
25386 "other operations requested by the user) is called the \"deficit\". For "
25387 "example, a straight copy (assume no other operations) from a 5GB disk image "
25388 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25389 "would give an error unless the user specified a partition to shrink and that "
25390 "partition had more than a gigabyte of free space."
25394 #: ../tools/virt-resize.pl:375
25395 msgid "B<--ignore part>"
25399 #: ../tools/virt-resize.pl:377
25401 "Ignore the named partition. Effectively this means the partition is "
25402 "allocated on the destination disk, but the content is not copied across from "
25403 "the source disk. The content of the partition will be blank (all zero "
25408 #: ../tools/virt-resize.pl:388
25409 msgid "B<--delete part>"
25413 #: ../tools/virt-resize.pl:390
25415 "Delete the named partition. It would be more accurate to describe this as "
25416 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25417 "the original disk image is left intact."
25421 #: ../tools/virt-resize.pl:394
25423 "Note that when you delete a partition, then anything contained in the "
25424 "partition is also deleted. Furthermore, this causes any partitions that "
25425 "come after to be I<renumbered>, which can easily make your guest unbootable."
25429 #: ../tools/virt-resize.pl:405
25430 msgid "B<--LV-expand logvol>"
25434 #: ../tools/virt-resize.pl:407
25436 "This takes the logical volume and, as a final step, expands it to fill all "
25437 "the space available in its volume group. A typical usage, assuming a Linux "
25438 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
25439 "lv_root> would be:"
25443 #: ../tools/virt-resize.pl:412
25446 " virt-resize indisk outdisk \\\n"
25447 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25452 #: ../tools/virt-resize.pl:415
25454 "This would first expand the partition (and PV), and then expand the root "
25455 "device to fill the extra space in the PV."
25459 #: ../tools/virt-resize.pl:418
25461 "The contents of the LV are also resized if virt-resize knows how to do "
25462 "that. You can stop virt-resize from trying to expand the content by using "
25463 "the option C<--no-expand-content>."
25467 #: ../tools/virt-resize.pl:422
25468 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25472 #: ../tools/virt-resize.pl:425
25474 "You can give this option multiple times, I<but> it doesn't make sense to do "
25475 "this unless the logical volumes you specify are all in different volume "
25480 #: ../tools/virt-resize.pl:433
25481 msgid "B<--no-copy-boot-loader>"
25485 #: ../tools/virt-resize.pl:435
25487 "By default, virt-resize copies over some sectors at the start of the disk "
25488 "(up to the beginning of the first partition). Commonly these sectors "
25489 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25490 "in order for the guest to boot correctly."
25494 #: ../tools/virt-resize.pl:440
25496 "If you specify this flag, then this initial copy is not done. You may need "
25497 "to reinstall the boot loader in this case."
25501 #: ../tools/virt-resize.pl:448
25502 msgid "B<--no-extra-partition>"
25506 #: ../tools/virt-resize.pl:450
25508 "By default, virt-resize creates an extra partition if there is any extra, "
25509 "unused space after all resizing has happened. Use this option to prevent "
25510 "the extra partition from being created. If you do this then the extra space "
25511 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25512 "tool in the guest."
25516 #: ../tools/virt-resize.pl:456
25518 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25523 #: ../tools/virt-resize.pl:463
25524 msgid "B<--no-expand-content>"
25528 #: ../tools/virt-resize.pl:465
25530 "By default, virt-resize will try to expand the direct contents of "
25531 "partitions, if it knows how (see C<--expand> option above)."
25535 #: ../tools/virt-resize.pl:468
25537 "If you give the C<--no-expand-content> option then virt-resize will not "
25542 #: ../tools/virt-resize.pl:475
25543 msgid "B<-d> | B<--debug>"
25547 #: ../tools/virt-resize.pl:477 ../tools/virt-win-reg.pl:198
25548 msgid "Enable debugging messages."
25552 #: ../tools/virt-resize.pl:483
25553 msgid "B<-n> | B<--dryrun>"
25557 #: ../tools/virt-resize.pl:485
25558 msgid "Print a summary of what would be done, but don't do anything."
25562 #: ../tools/virt-resize.pl:491
25563 msgid "B<-q> | B<--quiet>"
25567 #: ../tools/virt-resize.pl:493
25568 msgid "Don't print the summary."
25572 #: ../tools/virt-resize.pl:1352
25573 msgid "\"Partition 1 does not end on cylinder boundary.\""
25577 #: ../tools/virt-resize.pl:1354
25579 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25580 "means the partitions will not be aligned to the ancient CHS geometry. "
25581 "However CHS geometry is meaningless for disks manufactured since the early "
25582 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25583 "cylinders is not required by any modern operating system."
25587 #: ../tools/virt-resize.pl:1361
25588 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25592 #: ../tools/virt-resize.pl:1363
25594 "In Windows Vista and later versions, Microsoft switched to using a separate "
25595 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25596 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
25597 "the boot partition. Doing so seems to break the guest completely. However "
25598 "expanding the second partition (ie. C: drive) should work."
25602 #: ../tools/virt-resize.pl:1370
25604 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25605 "NTFS partitions have been expanded. This is just a safety check and (unless "
25606 "it find errors) is nothing to worry about."
25610 #: ../tools/virt-resize.pl:1374
25611 msgid "ALTERNATIVE TOOLS"
25615 #: ../tools/virt-resize.pl:1376
25617 "There are several proprietary tools for resizing partitions. We won't "
25618 "mention any here."
25622 #: ../tools/virt-resize.pl:1379
25624 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25625 "operations on disk images. They can resize and move partitions, but I don't "
25626 "think they can do anything with the contents, and they certainly don't "
25631 #: ../tools/virt-resize.pl:1384
25633 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25634 "but at a much lower level. You will probably end up hand-calculating sector "
25635 "offsets, which is something that virt-resize was designed to avoid. If you "
25636 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25641 #: ../tools/virt-resize.pl:1392
25643 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
25644 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
25645 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<Sys::Guestfs"
25646 "(3)>, L<http://libguestfs.org/>."
25650 #: ../tools/virt-tar.pl:34
25651 msgid "virt-tar - Extract or upload files to a virtual machine"
25655 #: ../tools/virt-tar.pl:38
25658 " virt-tar [--options] -x domname directory tarball\n"
25663 #: ../tools/virt-tar.pl:40
25666 " virt-tar [--options] -u domname tarball directory\n"
25671 #: ../tools/virt-tar.pl:42
25674 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
25679 #: ../tools/virt-tar.pl:44
25682 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
25687 #: ../tools/virt-tar.pl:48
25688 msgid "Download C</home> from the VM into a local tarball:"
25692 #: ../tools/virt-tar.pl:50
25695 " virt-tar -x domname /home home.tar\n"
25700 #: ../tools/virt-tar.pl:52
25703 " virt-tar -zx domname /home home.tar.gz\n"
25708 #: ../tools/virt-tar.pl:54
25709 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
25713 #: ../tools/virt-tar.pl:56
25716 " virt-tar -u domname uploadstuff.tar /tmp\n"
25721 #: ../tools/virt-tar.pl:58
25724 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
25729 #: ../tools/virt-tar.pl:62
25731 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
25732 "virtual machines. If you do this, you risk disk corruption in the VM. "
25733 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
25737 #: ../tools/virt-tar.pl:67
25739 "You can use C<-x> (extract) on live virtual machines, but you might get "
25740 "inconsistent results or errors if there is filesystem activity inside the "
25741 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
25742 "work, but the only way to guarantee consistent results is if the virtual "
25743 "machine is shut down."
25747 #: ../tools/virt-tar.pl:75
25749 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
25750 "parts of a guest filesystem. There are many possibilities: making backups, "
25751 "uploading data files, snooping on guest activity, fixing or customizing "
25756 #: ../tools/virt-tar.pl:80
25758 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
25759 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
25760 "should look at the L<guestfish(1)> tool."
25764 #: ../tools/virt-tar.pl:84
25766 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
25767 "its contents (recursively) from the virtual machine into a local tarball. "
25768 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
25769 "virtual machine. You cannot use these two options together."
25773 #: ../tools/virt-tar.pl:90
25775 "In addition, you may need to use the C<-z> (gZip) option to enable "
25776 "compression. When uploading, you have to specify C<-z> if the upload file "
25777 "is compressed because virt-tar won't detect this on its own."
25781 #: ../tools/virt-tar.pl:94
25783 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
25784 "example it cannot do PKZip files or bzip2 compression. If you want that "
25785 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
25786 "the L<libguestfs(3)> API)."
25790 #: ../tools/virt-tar.pl:135
25791 msgid "B<-x> | B<--extract> | B<--download>"
25795 #: ../tools/virt-tar.pl:137
25796 msgid "B<-u> | B<--upload>"
25800 #: ../tools/virt-tar.pl:139
25802 "Use C<-x> to extract (download) a directory from a virtual machine to a "
25807 #: ../tools/virt-tar.pl:142
25809 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
25810 "Please read the L</WARNING> section above before using this option."
25814 #: ../tools/virt-tar.pl:146
25815 msgid "You must specify exactly one of these options."
25819 #: ../tools/virt-tar.pl:152
25820 msgid "B<-z> | B<--gzip>"
25824 #: ../tools/virt-tar.pl:154
25825 msgid "Specify that the input or output tarball is gzip-compressed."
25829 #: ../tools/virt-tar.pl:259
25831 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
25832 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
25837 #: ../tools/virt-win-reg.pl:38
25839 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
25843 #: ../tools/virt-win-reg.pl:42
25846 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
25851 #: ../tools/virt-win-reg.pl:44
25854 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
25859 #: ../tools/virt-win-reg.pl:46
25862 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
25867 #: ../tools/virt-win-reg.pl:48
25870 " virt-win-reg --merge domname [input.reg ...]\n"
25875 #: ../tools/virt-win-reg.pl:50
25878 " virt-win-reg [--options] disk.img ... # instead of domname\n"
25883 #: ../tools/virt-win-reg.pl:54
25885 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
25886 "virtual machines. If you do this, you I<will> get irreversible disk "
25887 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
25888 "but doesn't catch all cases."
25892 #: ../tools/virt-win-reg.pl:59
25894 "Modifying the Windows Registry is an inherently risky operation. The format "
25895 "is deliberately obscure and undocumented, and Registry changes can leave the "
25896 "system unbootable. Therefore when using the C<--merge> option, make sure "
25897 "you have a reliable backup first."
25901 #: ../tools/virt-win-reg.pl:66
25903 "This program can export and merge Windows Registry entries from a Windows "
25908 #: ../tools/virt-win-reg.pl:69
25910 "The first parameter is the libvirt guest name or the raw disk image of a "
25915 #: ../tools/virt-win-reg.pl:72
25917 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
25918 "exported (recursively). For example:"
25922 #: ../tools/virt-win-reg.pl:75
25925 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
25930 #: ../tools/virt-win-reg.pl:77
25932 "You can also display single values from within registry keys, for example:"
25936 #: ../tools/virt-win-reg.pl:80
25939 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
25940 " $ virt-win-reg Windows7 $cvkey ProductName\n"
25941 " Windows 7 Enterprise\n"
25946 #: ../tools/virt-win-reg.pl:84
25948 "With C<--merge>, you can merge a textual regedit file into the Windows "
25953 #: ../tools/virt-win-reg.pl:87
25956 " $ virt-win-reg --merge Windows7 changes.reg\n"
25961 #: ../tools/virt-win-reg.pl:89
25962 msgid "SUPPORTED SYSTEMS"
25966 #: ../tools/virt-win-reg.pl:91
25968 "The program currently supports Windows NT-derived guests starting with "
25969 "Windows XP through to at least Windows 7."
25973 #: ../tools/virt-win-reg.pl:94
25975 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
25976 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
25977 "and C<HKEY_USERS\\.DEFAULT>."
25981 #: ../tools/virt-win-reg.pl:98
25983 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
25988 #: ../tools/virt-win-reg.pl:101
25990 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
25995 #: ../tools/virt-win-reg.pl:104
26000 #: ../tools/virt-win-reg.pl:106
26002 "This program is only meant for simple access to the registry. If you want "
26003 "to do complicated things with the registry, we suggest you download the "
26004 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26005 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26006 "L<hivexregedit(1)>."
26010 #: ../tools/virt-win-reg.pl:112
26015 #: ../tools/virt-win-reg.pl:114
26017 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26018 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26019 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26020 "Windows-style line endings, you may need to reencode the whole file before "
26021 "or after processing."
26025 #: ../tools/virt-win-reg.pl:120
26027 "To reencode a file from Windows format to Linux (before processing it with "
26028 "the C<--merge> option), you would do something like this:"
26032 #: ../tools/virt-win-reg.pl:123
26035 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26040 #: ../tools/virt-win-reg.pl:125
26042 "To go in the opposite direction, after exporting and before sending the file "
26043 "to a Windows user, do something like this:"
26047 #: ../tools/virt-win-reg.pl:128
26050 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26055 #: ../tools/virt-win-reg.pl:130
26056 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26060 #: ../tools/virt-win-reg.pl:132
26062 "If you are unsure about the current encoding, use the L<file(1)> command. "
26063 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26064 "style (CRLF) line endings, like this:"
26068 #: ../tools/virt-win-reg.pl:136
26071 " $ file software.reg\n"
26072 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26073 " with CRLF line terminators\n"
26078 #: ../tools/virt-win-reg.pl:140
26079 msgid "This file would need conversion before you could C<--merge> it."
26083 #: ../tools/virt-win-reg.pl:142
26084 msgid "SHELL QUOTING"
26088 #: ../tools/virt-win-reg.pl:144
26090 "Be careful when passing parameters containing C<\\> (backslash) in the "
26091 "shell. Usually you will have to use 'single quotes' or double backslashes "
26092 "(but not both) to protect them from the shell."
26096 #: ../tools/virt-win-reg.pl:148
26097 msgid "Paths and value names are case-insensitive."
26101 #: ../tools/virt-win-reg.pl:150
26102 msgid "CurrentControlSet etc."
26106 #: ../tools/virt-win-reg.pl:152
26108 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26109 "Registry at the level of the hive file, and therefore you cannot modify "
26114 #: ../tools/virt-win-reg.pl:156
26116 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26117 "circumstances it might refer to another control set. The way to find out is "
26118 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26122 #: ../tools/virt-win-reg.pl:160
26125 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26126 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26127 " \"Current\"=dword:00000001\n"
26128 " \"Default\"=dword:00000001\n"
26129 " \"Failed\"=dword:00000000\n"
26130 " \"LastKnownGood\"=dword:00000002\n"
26135 #: ../tools/virt-win-reg.pl:167
26136 msgid "\"Default\" is the one which Windows will choose when it boots."
26140 #: ../tools/virt-win-reg.pl:169
26142 "Similarly, other C<Current...> keys in the path may need to be replaced."
26146 #: ../tools/virt-win-reg.pl:216
26151 #: ../tools/virt-win-reg.pl:218
26153 "In merge mode, this merges a textual regedit file into the Windows Registry "
26154 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26155 "displays or exports Registry entries instead."
26159 #: ../tools/virt-win-reg.pl:222
26161 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26162 "result in disk corruption. However exporting (without this flag) is always "
26167 #: ../tools/virt-win-reg.pl:230
26168 msgid "B<--encoding> UTF-16LE|ASCII"
26172 #: ../tools/virt-win-reg.pl:232
26174 "When merging (only), you may need to specify the encoding for strings to be "
26175 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26176 "(3)/ENCODING STRINGS>."
26180 #: ../tools/virt-win-reg.pl:236
26182 "The default is to use UTF-16LE, which should work with recent versions of "
26187 #: ../tools/virt-win-reg.pl:463
26189 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26190 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26191 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26195 #: ../tools/virt-win-reg.pl:481
26198 " export LIBGUESTFS_DEBUG=1\n"
26199 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26204 #: ../tools/virt-win-reg.pl:484
26206 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."