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-15 20:33+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:2411 ../src/guestfs-actions.pod:2423
3581 #: ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:2548
3582 #: ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2569
3583 #: ../src/guestfs-actions.pod:2580 ../src/guestfs-actions.pod:2592
3584 #: ../src/guestfs-actions.pod:2622 ../src/guestfs-actions.pod:2686
3585 #: ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2717
3586 #: ../src/guestfs-actions.pod:2737 ../src/guestfs-actions.pod:2757
3587 #: ../src/guestfs-actions.pod:2786 ../src/guestfs-actions.pod:2802
3588 #: ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:2830
3589 #: ../src/guestfs-actions.pod:2839 ../src/guestfs-actions.pod:2872
3590 #: ../src/guestfs-actions.pod:2885 ../src/guestfs-actions.pod:2895
3591 #: ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2921
3592 #: ../src/guestfs-actions.pod:3001 ../src/guestfs-actions.pod:3018
3593 #: ../src/guestfs-actions.pod:3028 ../src/guestfs-actions.pod:3073
3594 #: ../src/guestfs-actions.pod:3088 ../src/guestfs-actions.pod:3103
3595 #: ../src/guestfs-actions.pod:3116 ../src/guestfs-actions.pod:3127
3596 #: ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3152
3597 #: ../src/guestfs-actions.pod:3164 ../src/guestfs-actions.pod:3181
3598 #: ../src/guestfs-actions.pod:3212 ../src/guestfs-actions.pod:3240
3599 #: ../src/guestfs-actions.pod:3256 ../src/guestfs-actions.pod:3272
3600 #: ../src/guestfs-actions.pod:3281 ../src/guestfs-actions.pod:3295
3601 #: ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:3317
3602 #: ../src/guestfs-actions.pod:3329 ../src/guestfs-actions.pod:3361
3603 #: ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3390
3604 #: ../src/guestfs-actions.pod:3401 ../src/guestfs-actions.pod:3415
3605 #: ../src/guestfs-actions.pod:3455 ../src/guestfs-actions.pod:3486
3606 #: ../src/guestfs-actions.pod:3497 ../src/guestfs-actions.pod:3522
3607 #: ../src/guestfs-actions.pod:3536 ../src/guestfs-actions.pod:3551
3608 #: ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3725
3609 #: ../src/guestfs-actions.pod:3744 ../src/guestfs-actions.pod:3759
3610 #: ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:3819
3611 #: ../src/guestfs-actions.pod:3833 ../src/guestfs-actions.pod:3843
3612 #: ../src/guestfs-actions.pod:3854 ../src/guestfs-actions.pod:4086
3613 #: ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:4113
3614 #: ../src/guestfs-actions.pod:4122 ../src/guestfs-actions.pod:4133
3615 #: ../src/guestfs-actions.pod:4142 ../src/guestfs-actions.pod:4153
3616 #: ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4184
3617 #: ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4216
3618 #: ../src/guestfs-actions.pod:4231 ../src/guestfs-actions.pod:4251
3619 #: ../src/guestfs-actions.pod:4266 ../src/guestfs-actions.pod:4282
3620 #: ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4316
3621 #: ../src/guestfs-actions.pod:4330 ../src/guestfs-actions.pod:4355
3622 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4392
3623 #: ../src/guestfs-actions.pod:4413 ../src/guestfs-actions.pod:4425
3624 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:4453
3625 #: ../src/guestfs-actions.pod:4487 ../src/guestfs-actions.pod:4507
3626 #: ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4620
3627 #: ../src/guestfs-actions.pod:4726 ../src/guestfs-actions.pod:4735
3628 #: ../src/guestfs-actions.pod:4745 ../src/guestfs-actions.pod:4755
3629 #: ../src/guestfs-actions.pod:4774 ../src/guestfs-actions.pod:4784
3630 #: ../src/guestfs-actions.pod:4794 ../src/guestfs-actions.pod:4804
3631 #: ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:4866
3632 #: ../src/guestfs-actions.pod:4880 ../src/guestfs-actions.pod:4893
3633 #: ../src/guestfs-actions.pod:4906 ../src/guestfs-actions.pod:4920
3634 #: ../src/guestfs-actions.pod:4930 ../src/guestfs-actions.pod:4947
3635 #: ../src/guestfs-actions.pod:4977 ../src/guestfs-actions.pod:4988
3636 #: ../src/guestfs-actions.pod:5023 ../src/guestfs-actions.pod:5033
3637 #: ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5076
3638 #: ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5195
3639 #: ../src/guestfs-actions.pod:5206 ../src/guestfs-actions.pod:5252
3640 #: ../src/guestfs-actions.pod:5262 ../src/guestfs-actions.pod:5299
3641 #: ../src/guestfs-actions.pod:5326 ../src/guestfs-actions.pod:5368
3642 #: ../src/guestfs-actions.pod:5391 ../src/guestfs-actions.pod:5448
3643 #: ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5490
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:3475 ../src/guestfs-actions.pod:3582
3915 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5012
3916 #: ../src/guestfs-actions.pod:5336 ../src/guestfs-actions.pod:5346
3917 #: ../src/guestfs-actions.pod:5356
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:2537
3955 #: ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:3054
3956 #: ../src/guestfs-actions.pod:3597 ../src/guestfs-actions.pod:3773
3957 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:4029
3958 #: ../src/guestfs-actions.pod:4072 ../src/guestfs-actions.pod:4548
3959 #: ../src/guestfs-actions.pod:4561 ../src/guestfs-actions.pod:4575
3960 #: ../src/guestfs-actions.pod:4596 ../src/guestfs-actions.pod:5129
3961 #: ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5160
3962 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5538
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:2261
4165 #: ../src/guestfs-actions.pod:2466 ../src/guestfs-actions.pod:2522
4166 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2935
4167 #: ../src/guestfs-actions.pod:3442 ../src/guestfs-actions.pod:3868
4168 #: ../src/guestfs-actions.pod:3954 ../src/guestfs-actions.pod:4060
4169 #: ../src/guestfs-actions.pod:4609 ../src/guestfs-actions.pod:4658
4170 #: ../src/guestfs-actions.pod:4710 ../src/guestfs-actions.pod:4826
4171 #: ../src/guestfs-actions.pod:4847 ../src/guestfs-actions.pod:5221
4172 #: ../src/guestfs-actions.pod:5238 ../src/guestfs-actions.pod:5276
4173 #: ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:5428
4174 #: ../src/guestfs-actions.pod:5501 ../src/guestfs-actions.pod:5517
4175 #: ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:5573
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:2275 ../src/guestfs-actions.pod:2286
4560 #: ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:2309
4561 #: ../src/guestfs-actions.pod:2322 ../src/guestfs-actions.pod:2334
4562 #: ../src/guestfs-actions.pod:2347 ../src/guestfs-actions.pod:2358
4563 #: ../src/guestfs-actions.pod:2368 ../src/guestfs-actions.pod:2379
4564 #: ../src/guestfs-actions.pod:2391 ../src/guestfs-actions.pod:2403
4565 #: ../src/guestfs-actions.pod:3567
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:3944
4814 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:3039
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:3807 ../src/guestfs-actions.pod:3915
4836 #: ../src/guestfs-actions.pod:3936 ../src/guestfs-actions.pod:4662
4837 #: ../src/guestfs-actions.pod:4714 ../src/guestfs-actions.pod:4830
4838 #: ../src/guestfs-actions.pod:4851 ../src/guestfs-actions.pod:5370
4839 #: ../src/guestfs-actions.pod:5393 ../src/guestfs-actions.pod:5416
4840 #: ../src/guestfs-actions.pod:5432 ../src/guestfs-actions.pod:5505
4841 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5561
4842 #: ../src/guestfs-actions.pod:5577 ../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:2941
4850 #: ../fish/guestfish-actions.pod:3017 ../fish/guestfish-actions.pod:3032
4851 #: ../fish/guestfish-actions.pod:3593 ../fish/guestfish-actions.pod:3639
4852 #: ../fish/guestfish-actions.pod:3724 ../fish/guestfish-actions.pod:3739
4853 #: ../fish/guestfish-actions.pod:4122 ../fish/guestfish-actions.pod:4140
4854 #: ../fish/guestfish-actions.pod:4157 ../fish/guestfish-actions.pod:4167
4855 #: ../fish/guestfish-actions.pod:4215 ../fish/guestfish-actions.pod:4225
4856 #: ../fish/guestfish-actions.pod:4254 ../fish/guestfish-actions.pod:4264
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:3150
5065 #: ../src/guestfs-actions.pod:3238 ../src/guestfs-actions.pod:3254
5066 #: ../src/guestfs-actions.pod:3270 ../fish/guestfish-actions.pod:596
5067 #: ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2516
5068 #: ../fish/guestfish-actions.pod:2526 ../fish/guestfish-actions.pod:2536
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:2436
5095 #: ../fish/guestfish-actions.pod:604 ../fish/guestfish-actions.pod:1937
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:5450 ../src/guestfs-actions.pod:5466
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:5044
5497 #: ../fish/guestfish-actions.pod:773 ../fish/guestfish-actions.pod:3893
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:5399
5770 #: ../src/guestfs-actions.pod:5544 ../fish/guestfish-actions.pod:882
5771 #: ../fish/guestfish-actions.pod:1239 ../fish/guestfish-actions.pod:1253
5772 #: ../fish/guestfish-actions.pod:4146 ../fish/guestfish-actions.pod:4243
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:4297 ../src/guestfs-actions.pod:4389
6554 #: ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1317
6555 #: ../fish/guestfish-actions.pod:3318 ../fish/guestfish-actions.pod:3395
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:2284
6720 #: ../src/guestfs-actions.pod:2307 ../src/guestfs-actions.pod:2356
6721 #: ../src/guestfs-actions.pod:2377 ../fish/guestfish-actions.pod:1327
6722 #: ../fish/guestfish-actions.pod:1821 ../fish/guestfish-actions.pod:1839
6723 #: ../fish/guestfish-actions.pod:1877 ../fish/guestfish-actions.pod:1893
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:2451
6841 #: ../src/guestfs-actions.pod:2989
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:4845
7019 #: ../fish/guestfish-actions.pod:1442 ../fish/guestfish-actions.pod:3737
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:3803
7091 #: ../src/guestfs-actions.pod:3932
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:2503
7626 #: ../src/guestfs-actions.pod:3425 ../src/guestfs-actions.pod:4962
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:2259 ../src/guestfs-actions.pod:2464
7766 #: ../src/guestfs-actions.pod:2520
7767 msgid "See also C<guestfs_list_filesystems>."
7771 #: ../src/guestfs-actions.pod:2265
7772 msgid "guestfs_is_blockdev"
7776 #: ../src/guestfs-actions.pod:2267
7779 " int guestfs_is_blockdev (guestfs_h *g,\n"
7780 "\t\tconst char *path);\n"
7785 #: ../src/guestfs-actions.pod:2270 ../fish/guestfish-actions.pod:1809
7787 "This returns C<true> if and only if there is a block device with the given "
7792 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2296
7793 #: ../src/guestfs-actions.pod:2320 ../src/guestfs-actions.pod:2332
7794 #: ../src/guestfs-actions.pod:2345 ../src/guestfs-actions.pod:2389
7795 #: ../src/guestfs-actions.pod:2401
7796 msgid "See also C<guestfs_stat>."
7800 #: ../src/guestfs-actions.pod:2277
7801 msgid "guestfs_is_busy"
7805 #: ../src/guestfs-actions.pod:2279
7808 " int guestfs_is_busy (guestfs_h *g);\n"
7813 #: ../src/guestfs-actions.pod:2281 ../fish/guestfish-actions.pod:1818
7815 "This returns true iff this handle is busy processing a command (in the "
7820 #: ../src/guestfs-actions.pod:2288
7821 msgid "guestfs_is_chardev"
7825 #: ../src/guestfs-actions.pod:2290
7828 " int guestfs_is_chardev (guestfs_h *g,\n"
7829 "\t\tconst char *path);\n"
7834 #: ../src/guestfs-actions.pod:2293 ../fish/guestfish-actions.pod:1827
7836 "This returns C<true> if and only if there is a character device with the "
7837 "given C<path> name."
7841 #: ../src/guestfs-actions.pod:2300
7842 msgid "guestfs_is_config"
7846 #: ../src/guestfs-actions.pod:2302
7849 " int guestfs_is_config (guestfs_h *g);\n"
7854 #: ../src/guestfs-actions.pod:2304 ../fish/guestfish-actions.pod:1836
7856 "This returns true iff this handle is being configured (in the C<CONFIG> "
7861 #: ../src/guestfs-actions.pod:2311
7862 msgid "guestfs_is_dir"
7866 #: ../src/guestfs-actions.pod:2313
7869 " int guestfs_is_dir (guestfs_h *g,\n"
7870 "\t\tconst char *path);\n"
7875 #: ../src/guestfs-actions.pod:2316 ../fish/guestfish-actions.pod:1845
7877 "This returns C<true> if and only if there is a directory with the given "
7878 "C<path> name. Note that it returns false for other objects like files."
7882 #: ../src/guestfs-actions.pod:2324
7883 msgid "guestfs_is_fifo"
7887 #: ../src/guestfs-actions.pod:2326
7890 " int guestfs_is_fifo (guestfs_h *g,\n"
7891 "\t\tconst char *path);\n"
7896 #: ../src/guestfs-actions.pod:2329 ../fish/guestfish-actions.pod:1855
7898 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
7899 "given C<path> name."
7903 #: ../src/guestfs-actions.pod:2336
7904 msgid "guestfs_is_file"
7908 #: ../src/guestfs-actions.pod:2338
7911 " int guestfs_is_file (guestfs_h *g,\n"
7912 "\t\tconst char *path);\n"
7917 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1864
7919 "This returns C<true> if and only if there is a regular file with the given "
7920 "C<path> name. Note that it returns false for other objects like directories."
7924 #: ../src/guestfs-actions.pod:2349
7925 msgid "guestfs_is_launching"
7929 #: ../src/guestfs-actions.pod:2351
7932 " int guestfs_is_launching (guestfs_h *g);\n"
7937 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1874
7939 "This returns true iff this handle is launching the subprocess (in the "
7940 "C<LAUNCHING> state)."
7944 #: ../src/guestfs-actions.pod:2360
7945 msgid "guestfs_is_lv"
7949 #: ../src/guestfs-actions.pod:2362
7952 " int guestfs_is_lv (guestfs_h *g,\n"
7953 "\t\tconst char *device);\n"
7958 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1883
7960 "This command tests whether C<device> is a logical volume, and returns true "
7961 "iff this is the case."
7965 #: ../src/guestfs-actions.pod:2370
7966 msgid "guestfs_is_ready"
7970 #: ../src/guestfs-actions.pod:2372
7973 " int guestfs_is_ready (guestfs_h *g);\n"
7978 #: ../src/guestfs-actions.pod:2374 ../fish/guestfish-actions.pod:1890
7980 "This returns true iff this handle is ready to accept commands (in the "
7985 #: ../src/guestfs-actions.pod:2381
7986 msgid "guestfs_is_socket"
7990 #: ../src/guestfs-actions.pod:2383
7993 " int guestfs_is_socket (guestfs_h *g,\n"
7994 "\t\tconst char *path);\n"
7999 #: ../src/guestfs-actions.pod:2386 ../fish/guestfish-actions.pod:1899
8001 "This returns C<true> if and only if there is a Unix domain socket with the "
8002 "given C<path> name."
8006 #: ../src/guestfs-actions.pod:2393
8007 msgid "guestfs_is_symlink"
8011 #: ../src/guestfs-actions.pod:2395
8014 " int guestfs_is_symlink (guestfs_h *g,\n"
8015 "\t\tconst char *path);\n"
8020 #: ../src/guestfs-actions.pod:2398 ../fish/guestfish-actions.pod:1908
8022 "This returns C<true> if and only if there is a symbolic link with the given "
8027 #: ../src/guestfs-actions.pod:2405
8028 msgid "guestfs_kill_subprocess"
8032 #: ../src/guestfs-actions.pod:2407
8035 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8040 #: ../src/guestfs-actions.pod:2409 ../fish/guestfish-actions.pod:1917
8041 msgid "This kills the qemu subprocess. You should never need to call this."
8045 #: ../src/guestfs-actions.pod:2413
8046 msgid "guestfs_launch"
8050 #: ../src/guestfs-actions.pod:2415
8053 " int guestfs_launch (guestfs_h *g);\n"
8058 #: ../src/guestfs-actions.pod:2417 ../fish/guestfish-actions.pod:1923
8060 "Internally libguestfs is implemented by running a virtual machine using "
8065 #: ../src/guestfs-actions.pod:2420 ../fish/guestfish-actions.pod:1926
8067 "You should call this after configuring the handle (eg. adding drives) but "
8068 "before performing any actions."
8072 #: ../src/guestfs-actions.pod:2425
8073 msgid "guestfs_lchown"
8077 #: ../src/guestfs-actions.pod:2427
8080 " int guestfs_lchown (guestfs_h *g,\n"
8083 "\t\tconst char *path);\n"
8088 #: ../src/guestfs-actions.pod:2432
8090 "Change the file owner to C<owner> and group to C<group>. This is like "
8091 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8092 "changed, not the target."
8096 #: ../src/guestfs-actions.pod:2442
8097 msgid "guestfs_lgetxattrs"
8101 #: ../src/guestfs-actions.pod:2444
8104 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8105 "\t\tconst char *path);\n"
8110 #: ../src/guestfs-actions.pod:2447
8112 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8113 "then it returns the extended attributes of the link itself."
8117 #: ../src/guestfs-actions.pod:2456
8118 msgid "guestfs_list_devices"
8122 #: ../src/guestfs-actions.pod:2458
8125 " char **guestfs_list_devices (guestfs_h *g);\n"
8130 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1953
8131 msgid "List all the block devices."
8135 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1955
8136 msgid "The full block device names are returned, eg. C</dev/sda>."
8140 #: ../src/guestfs-actions.pod:2470
8141 msgid "guestfs_list_filesystems"
8145 #: ../src/guestfs-actions.pod:2472
8148 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8153 #: ../src/guestfs-actions.pod:2474 ../fish/guestfish-actions.pod:1963
8155 "This inspection command looks for filesystems on partitions, block devices "
8156 "and logical volumes, returning a list of devices containing filesystems and "
8161 #: ../src/guestfs-actions.pod:2478 ../fish/guestfish-actions.pod:1967
8163 "The return value is a hash, where the keys are the devices containing "
8164 "filesystems, and the values are the filesystem types. For example:"
8168 #: ../src/guestfs-actions.pod:2482 ../fish/guestfish-actions.pod:1971
8171 " \"/dev/sda1\" => \"ntfs\"\n"
8172 " \"/dev/sda2\" => \"ext2\"\n"
8173 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8174 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8179 #: ../src/guestfs-actions.pod:2487 ../fish/guestfish-actions.pod:1976
8181 "The value can have the special value \"unknown\", meaning the content of the "
8182 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8186 #: ../src/guestfs-actions.pod:2491
8188 "This command runs other libguestfs commands, which might include "
8189 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8190 "soon after launch and only when nothing is mounted."
8194 #: ../src/guestfs-actions.pod:2495
8196 "Not all of the filesystems returned will be mountable. In particular, swap "
8197 "partitions are returned in the list. Also this command does not check that "
8198 "each filesystem found is valid and mountable, and some filesystems might be "
8199 "mountable but require special options. Filesystems may not all belong to a "
8200 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
8204 #: ../src/guestfs-actions.pod:2509
8205 msgid "guestfs_list_partitions"
8209 #: ../src/guestfs-actions.pod:2511
8212 " char **guestfs_list_partitions (guestfs_h *g);\n"
8217 #: ../src/guestfs-actions.pod:2513 ../fish/guestfish-actions.pod:1996
8218 msgid "List all the partitions detected on all block devices."
8222 #: ../src/guestfs-actions.pod:2515 ../fish/guestfish-actions.pod:1998
8223 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8227 #: ../src/guestfs-actions.pod:2517
8229 "This does not return logical volumes. For that you will need to call "
8234 #: ../src/guestfs-actions.pod:2526
8239 #: ../src/guestfs-actions.pod:2528
8242 " char *guestfs_ll (guestfs_h *g,\n"
8243 "\t\tconst char *directory);\n"
8248 #: ../src/guestfs-actions.pod:2531 ../fish/guestfish-actions.pod:2009
8250 "List the files in C<directory> (relative to the root directory, there is no "
8251 "cwd) in the format of 'ls -la'."
8255 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:2012
8257 "This command is mostly useful for interactive sessions. It is I<not> "
8258 "intended that you try to parse the output string."
8262 #: ../src/guestfs-actions.pod:2540
8267 #: ../src/guestfs-actions.pod:2542
8270 " int guestfs_ln (guestfs_h *g,\n"
8271 "\t\tconst char *target,\n"
8272 "\t\tconst char *linkname);\n"
8277 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:2019
8278 msgid "This command creates a hard link using the C<ln> command."
8282 #: ../src/guestfs-actions.pod:2550
8283 msgid "guestfs_ln_f"
8287 #: ../src/guestfs-actions.pod:2552
8290 " int guestfs_ln_f (guestfs_h *g,\n"
8291 "\t\tconst char *target,\n"
8292 "\t\tconst char *linkname);\n"
8297 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:2025
8299 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8300 "option removes the link (C<linkname>) if it exists already."
8304 #: ../src/guestfs-actions.pod:2561
8305 msgid "guestfs_ln_s"
8309 #: ../src/guestfs-actions.pod:2563
8312 " int guestfs_ln_s (guestfs_h *g,\n"
8313 "\t\tconst char *target,\n"
8314 "\t\tconst char *linkname);\n"
8319 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:2032
8320 msgid "This command creates a symbolic link using the C<ln -s> command."
8324 #: ../src/guestfs-actions.pod:2571
8325 msgid "guestfs_ln_sf"
8329 #: ../src/guestfs-actions.pod:2573
8332 " int guestfs_ln_sf (guestfs_h *g,\n"
8333 "\t\tconst char *target,\n"
8334 "\t\tconst char *linkname);\n"
8339 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:2038
8341 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8342 "option removes the link (C<linkname>) if it exists already."
8346 #: ../src/guestfs-actions.pod:2582
8347 msgid "guestfs_lremovexattr"
8351 #: ../src/guestfs-actions.pod:2584
8354 " int guestfs_lremovexattr (guestfs_h *g,\n"
8355 "\t\tconst char *xattr,\n"
8356 "\t\tconst char *path);\n"
8361 #: ../src/guestfs-actions.pod:2588
8363 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8364 "link, then it removes an extended attribute of the link itself."
8368 #: ../src/guestfs-actions.pod:2594
8373 #: ../src/guestfs-actions.pod:2596
8376 " char **guestfs_ls (guestfs_h *g,\n"
8377 "\t\tconst char *directory);\n"
8382 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:2053
8384 "List the files in C<directory> (relative to the root directory, there is no "
8385 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
8389 #: ../src/guestfs-actions.pod:2603
8391 "This command is mostly useful for interactive sessions. Programs should "
8392 "probably use C<guestfs_readdir> instead."
8396 #: ../src/guestfs-actions.pod:2610
8397 msgid "guestfs_lsetxattr"
8401 #: ../src/guestfs-actions.pod:2612
8404 " int guestfs_lsetxattr (guestfs_h *g,\n"
8405 "\t\tconst char *xattr,\n"
8406 "\t\tconst char *val,\n"
8408 "\t\tconst char *path);\n"
8413 #: ../src/guestfs-actions.pod:2618
8415 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8416 "then it sets an extended attribute of the link itself."
8420 #: ../src/guestfs-actions.pod:2624
8421 msgid "guestfs_lstat"
8425 #: ../src/guestfs-actions.pod:2626
8428 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8429 "\t\tconst char *path);\n"
8434 #: ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:4627
8435 #: ../fish/guestfish-actions.pod:2072 ../fish/guestfish-actions.pod:3572
8436 msgid "Returns file information for the given C<path>."
8440 #: ../src/guestfs-actions.pod:2631
8442 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8443 "link, then the link is stat-ed, not the file it refers to."
8447 #: ../src/guestfs-actions.pod:2635 ../fish/guestfish-actions.pod:2078
8448 msgid "This is the same as the C<lstat(2)> system call."
8452 #: ../src/guestfs-actions.pod:2637 ../src/guestfs-actions.pod:4631
8454 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8455 "error. I<The caller must call C<guestfs_free_stat> after use>."
8459 #: ../src/guestfs-actions.pod:2641
8460 msgid "guestfs_lstatlist"
8464 #: ../src/guestfs-actions.pod:2643
8467 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8468 "\t\tconst char *path,\n"
8469 "\t\tchar *const *names);\n"
8474 #: ../src/guestfs-actions.pod:2647
8476 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8477 "files, where all files are in the directory C<path>. C<names> is the list "
8478 "of files from this directory."
8482 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:2088
8484 "On return you get a list of stat structs, with a one-to-one correspondence "
8485 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8486 "then the C<ino> field of that structure is set to C<-1>."
8490 #: ../src/guestfs-actions.pod:2656
8492 "This call is intended for programs that want to efficiently list a directory "
8493 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8494 "for a similarly efficient call for getting extended attributes. Very long "
8495 "directory listings might cause the protocol message size to be exceeded, "
8496 "causing this call to fail. The caller must split up such requests into "
8497 "smaller groups of names."
8501 #: ../src/guestfs-actions.pod:2664
8503 "This function returns a C<struct guestfs_stat_list *> (see E<lt>guestfs-"
8504 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
8505 "C<guestfs_free_stat_list> after use>."
8509 #: ../src/guestfs-actions.pod:2669
8510 msgid "guestfs_luks_add_key"
8514 #: ../src/guestfs-actions.pod:2671
8517 " int guestfs_luks_add_key (guestfs_h *g,\n"
8518 "\t\tconst char *device,\n"
8519 "\t\tconst char *key,\n"
8520 "\t\tconst char *newkey,\n"
8521 "\t\tint keyslot);\n"
8526 #: ../src/guestfs-actions.pod:2677 ../fish/guestfish-actions.pod:2105
8528 "This command adds a new key on LUKS device C<device>. C<key> is any "
8529 "existing key, and is used to access the device. C<newkey> is the new key to "
8530 "add. C<keyslot> is the key slot that will be replaced."
8534 #: ../src/guestfs-actions.pod:2682
8536 "Note that if C<keyslot> already contains a key, then this command will "
8537 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8541 #: ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2722
8542 #: ../src/guestfs-actions.pod:2742 ../src/guestfs-actions.pod:2759
8543 #: ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:2804
8545 "This function takes a key or passphrase parameter which could contain "
8546 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8551 #: ../src/guestfs-actions.pod:2692
8552 msgid "guestfs_luks_close"
8556 #: ../src/guestfs-actions.pod:2694
8559 " int guestfs_luks_close (guestfs_h *g,\n"
8560 "\t\tconst char *device);\n"
8565 #: ../src/guestfs-actions.pod:2697
8567 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8568 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8569 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8570 "underlying block device."
8574 #: ../src/guestfs-actions.pod:2705
8575 msgid "guestfs_luks_format"
8579 #: ../src/guestfs-actions.pod:2707
8582 " int guestfs_luks_format (guestfs_h *g,\n"
8583 "\t\tconst char *device,\n"
8584 "\t\tconst char *key,\n"
8585 "\t\tint keyslot);\n"
8590 #: ../src/guestfs-actions.pod:2712 ../fish/guestfish-actions.pod:2131
8592 "This command erases existing data on C<device> and formats the device as a "
8593 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8594 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8598 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2739
8599 #: ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:3553
8600 #: ../src/guestfs-actions.pod:4168 ../src/guestfs-actions.pod:4489
8601 #: ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4532
8602 #: ../src/guestfs-actions.pod:5471 ../fish/guestfish-actions.pod:2139
8603 #: ../fish/guestfish-actions.pod:2152 ../fish/guestfish-actions.pod:2223
8604 #: ../fish/guestfish-actions.pod:2738 ../fish/guestfish-actions.pod:3213
8605 #: ../fish/guestfish-actions.pod:3471 ../fish/guestfish-actions.pod:3487
8606 #: ../fish/guestfish-actions.pod:3502 ../fish/guestfish-actions.pod:4190
8608 "B<This command is dangerous. Without careful use you can easily destroy all "
8613 #: ../src/guestfs-actions.pod:2726
8614 msgid "guestfs_luks_format_cipher"
8618 #: ../src/guestfs-actions.pod:2728
8621 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8622 "\t\tconst char *device,\n"
8623 "\t\tconst char *key,\n"
8624 "\t\tint keyslot,\n"
8625 "\t\tconst char *cipher);\n"
8630 #: ../src/guestfs-actions.pod:2734
8632 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8633 "set the C<cipher> used."
8637 #: ../src/guestfs-actions.pod:2746
8638 msgid "guestfs_luks_kill_slot"
8642 #: ../src/guestfs-actions.pod:2748
8645 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8646 "\t\tconst char *device,\n"
8647 "\t\tconst char *key,\n"
8648 "\t\tint keyslot);\n"
8653 #: ../src/guestfs-actions.pod:2753 ../fish/guestfish-actions.pod:2159
8655 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8656 "device C<device>. C<key> must be one of the I<other> keys."
8660 #: ../src/guestfs-actions.pod:2763
8661 msgid "guestfs_luks_open"
8665 #: ../src/guestfs-actions.pod:2765
8668 " int guestfs_luks_open (guestfs_h *g,\n"
8669 "\t\tconst char *device,\n"
8670 "\t\tconst char *key,\n"
8671 "\t\tconst char *mapname);\n"
8676 #: ../src/guestfs-actions.pod:2770 ../fish/guestfish-actions.pod:2170
8678 "This command opens a block device which has been encrypted according to the "
8679 "Linux Unified Key Setup (LUKS) standard."
8683 #: ../src/guestfs-actions.pod:2773 ../fish/guestfish-actions.pod:2173
8684 msgid "C<device> is the encrypted block device or partition."
8688 #: ../src/guestfs-actions.pod:2775 ../fish/guestfish-actions.pod:2175
8690 "The caller must supply one of the keys associated with the LUKS block "
8691 "device, in the C<key> parameter."
8695 #: ../src/guestfs-actions.pod:2778 ../fish/guestfish-actions.pod:2178
8697 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8698 "writes to this block device are decrypted from and encrypted to the "
8699 "underlying C<device> respectively."
8703 #: ../src/guestfs-actions.pod:2782
8705 "If this block device contains LVM volume groups, then calling "
8706 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8711 #: ../src/guestfs-actions.pod:2792
8712 msgid "guestfs_luks_open_ro"
8716 #: ../src/guestfs-actions.pod:2794
8719 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8720 "\t\tconst char *device,\n"
8721 "\t\tconst char *key,\n"
8722 "\t\tconst char *mapname);\n"
8727 #: ../src/guestfs-actions.pod:2799
8729 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8734 #: ../src/guestfs-actions.pod:2808
8735 msgid "guestfs_lvcreate"
8739 #: ../src/guestfs-actions.pod:2810
8742 " int guestfs_lvcreate (guestfs_h *g,\n"
8743 "\t\tconst char *logvol,\n"
8744 "\t\tconst char *volgroup,\n"
8745 "\t\tint mbytes);\n"
8750 #: ../src/guestfs-actions.pod:2815 ../fish/guestfish-actions.pod:2203
8752 "This creates an LVM logical volume called C<logvol> on the volume group "
8753 "C<volgroup>, with C<size> megabytes."
8757 #: ../src/guestfs-actions.pod:2820
8758 msgid "guestfs_lvm_clear_filter"
8762 #: ../src/guestfs-actions.pod:2822
8765 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8770 #: ../src/guestfs-actions.pod:2824
8772 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8773 "see every block device."
8777 #: ../src/guestfs-actions.pod:2827 ../src/guestfs-actions.pod:2863
8778 #: ../fish/guestfish-actions.pod:2213 ../fish/guestfish-actions.pod:2244
8780 "This command also clears the LVM cache and performs a volume group scan."
8784 #: ../src/guestfs-actions.pod:2832
8785 msgid "guestfs_lvm_remove_all"
8789 #: ../src/guestfs-actions.pod:2834
8792 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8797 #: ../src/guestfs-actions.pod:2836 ../fish/guestfish-actions.pod:2220
8799 "This command removes all LVM logical volumes, volume groups and physical "
8804 #: ../src/guestfs-actions.pod:2844
8805 msgid "guestfs_lvm_set_filter"
8809 #: ../src/guestfs-actions.pod:2846
8812 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8813 "\t\tchar *const *devices);\n"
8818 #: ../src/guestfs-actions.pod:2849 ../fish/guestfish-actions.pod:2230
8820 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
8821 "block devices in the list C<devices>, and will ignore all other attached "
8826 #: ../src/guestfs-actions.pod:2853 ../fish/guestfish-actions.pod:2234
8828 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
8829 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
8830 "there are two types of duplication possible: either cloned PVs/VGs which "
8831 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
8832 "same name. In normal operation you cannot create this situation, but you "
8833 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
8834 "inside the LVM metadata."
8838 #: ../src/guestfs-actions.pod:2866 ../fish/guestfish-actions.pod:2247
8839 msgid "You can filter whole block devices or individual partitions."
8843 #: ../src/guestfs-actions.pod:2868 ../fish/guestfish-actions.pod:2249
8845 "You cannot use this if any VG is currently in use (eg. contains a mounted "
8846 "filesystem), even if you are not filtering out that VG."
8850 #: ../src/guestfs-actions.pod:2874
8851 msgid "guestfs_lvremove"
8855 #: ../src/guestfs-actions.pod:2876
8858 " int guestfs_lvremove (guestfs_h *g,\n"
8859 "\t\tconst char *device);\n"
8864 #: ../src/guestfs-actions.pod:2879 ../fish/guestfish-actions.pod:2257
8866 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
8867 "LV, such as C</dev/VG/LV>."
8871 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:2260
8873 "You can also remove all LVs in a volume group by specifying the VG name, C</"
8878 #: ../src/guestfs-actions.pod:2887
8879 msgid "guestfs_lvrename"
8883 #: ../src/guestfs-actions.pod:2889
8886 " int guestfs_lvrename (guestfs_h *g,\n"
8887 "\t\tconst char *logvol,\n"
8888 "\t\tconst char *newlogvol);\n"
8893 #: ../src/guestfs-actions.pod:2893 ../fish/guestfish-actions.pod:2267
8894 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
8898 #: ../src/guestfs-actions.pod:2897
8899 msgid "guestfs_lvresize"
8903 #: ../src/guestfs-actions.pod:2899
8906 " int guestfs_lvresize (guestfs_h *g,\n"
8907 "\t\tconst char *device,\n"
8908 "\t\tint mbytes);\n"
8913 #: ../src/guestfs-actions.pod:2903 ../fish/guestfish-actions.pod:2273
8915 "This resizes (expands or shrinks) an existing LVM logical volume to "
8916 "C<mbytes>. When reducing, data in the reduced part is lost."
8920 #: ../src/guestfs-actions.pod:2909
8921 msgid "guestfs_lvresize_free"
8925 #: ../src/guestfs-actions.pod:2911
8928 " int guestfs_lvresize_free (guestfs_h *g,\n"
8929 "\t\tconst char *lv,\n"
8930 "\t\tint percent);\n"
8935 #: ../src/guestfs-actions.pod:2915 ../fish/guestfish-actions.pod:2281
8937 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
8938 "remaining free space in the volume group. Commonly you would call this with "
8939 "pc = 100 which expands the logical volume as much as possible, using all "
8940 "remaining free space in the volume group."
8944 #: ../src/guestfs-actions.pod:2923
8949 #: ../src/guestfs-actions.pod:2925
8952 " char **guestfs_lvs (guestfs_h *g);\n"
8957 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2291
8959 "List all the logical volumes detected. This is the equivalent of the L<lvs"
8964 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2294
8966 "This returns a list of the logical volume device names (eg. C</dev/"
8967 "VolGroup00/LogVol00>)."
8971 #: ../src/guestfs-actions.pod:2933
8972 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
8976 #: ../src/guestfs-actions.pod:2939
8977 msgid "guestfs_lvs_full"
8981 #: ../src/guestfs-actions.pod:2941
8984 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
8989 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2303
8991 "List all the logical volumes detected. This is the equivalent of the L<lvs"
8992 "(8)> command. The \"full\" version includes all fields."
8996 #: ../src/guestfs-actions.pod:2946
8998 "This function returns a C<struct guestfs_lvm_lv_list *> (see E<lt>guestfs-"
8999 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9000 "C<guestfs_free_lvm_lv_list> after use>."
9004 #: ../src/guestfs-actions.pod:2951
9005 msgid "guestfs_lvuuid"
9009 #: ../src/guestfs-actions.pod:2953
9012 " char *guestfs_lvuuid (guestfs_h *g,\n"
9013 "\t\tconst char *device);\n"
9018 #: ../src/guestfs-actions.pod:2956 ../fish/guestfish-actions.pod:2310
9019 msgid "This command returns the UUID of the LVM LV C<device>."
9023 #: ../src/guestfs-actions.pod:2961
9024 msgid "guestfs_lxattrlist"
9028 #: ../src/guestfs-actions.pod:2963
9031 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9032 "\t\tconst char *path,\n"
9033 "\t\tchar *const *names);\n"
9038 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2316
9040 "This call allows you to get the extended attributes of multiple files, where "
9041 "all files are in the directory C<path>. C<names> is the list of files from "
9046 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2320
9048 "On return you get a flat list of xattr structs which must be interpreted "
9049 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9050 "C<attrval> in this struct is zero-length to indicate there was an error "
9051 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9052 "number (the number of following attributes for this file, which could be C<"
9053 "\"0\">). Then after the first xattr struct are the zero or more attributes "
9054 "for the first named file. This repeats for the second and subsequent files."
9058 #: ../src/guestfs-actions.pod:2981
9060 "This call is intended for programs that want to efficiently list a directory "
9061 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9062 "a similarly efficient call for getting standard stats. Very long directory "
9063 "listings might cause the protocol message size to be exceeded, causing this "
9064 "call to fail. The caller must split up such requests into smaller groups of "
9069 #: ../src/guestfs-actions.pod:2994
9070 msgid "guestfs_mkdir"
9074 #: ../src/guestfs-actions.pod:2996
9077 " int guestfs_mkdir (guestfs_h *g,\n"
9078 "\t\tconst char *path);\n"
9083 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2342
9084 msgid "Create a directory named C<path>."
9088 #: ../src/guestfs-actions.pod:3003
9089 msgid "guestfs_mkdir_mode"
9093 #: ../src/guestfs-actions.pod:3005
9096 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9097 "\t\tconst char *path,\n"
9103 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2348
9105 "This command creates a directory, setting the initial permissions of the "
9106 "directory to C<mode>."
9110 #: ../src/guestfs-actions.pod:3012 ../fish/guestfish-actions.pod:2351
9112 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9113 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9118 #: ../src/guestfs-actions.pod:3016
9119 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9123 #: ../src/guestfs-actions.pod:3020
9124 msgid "guestfs_mkdir_p"
9128 #: ../src/guestfs-actions.pod:3022
9131 " int guestfs_mkdir_p (guestfs_h *g,\n"
9132 "\t\tconst char *path);\n"
9137 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2361
9139 "Create a directory named C<path>, creating any parent directories as "
9140 "necessary. This is like the C<mkdir -p> shell command."
9144 #: ../src/guestfs-actions.pod:3030
9145 msgid "guestfs_mkdtemp"
9149 #: ../src/guestfs-actions.pod:3032
9152 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9153 "\t\tconst char *template);\n"
9158 #: ../src/guestfs-actions.pod:3035 ../fish/guestfish-actions.pod:2368
9160 "This command creates a temporary directory. The C<template> parameter "
9161 "should be a full pathname for the temporary directory name with the final "
9162 "six characters being \"XXXXXX\"."
9166 #: ../src/guestfs-actions.pod:3040 ../fish/guestfish-actions.pod:2373
9168 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9169 "being suitable for Windows filesystems."
9173 #: ../src/guestfs-actions.pod:3043 ../fish/guestfish-actions.pod:2376
9174 msgid "The name of the temporary directory that was created is returned."
9178 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2379
9179 msgid "The temporary directory is created with mode 0700 and is owned by root."
9183 #: ../src/guestfs-actions.pod:3049 ../fish/guestfish-actions.pod:2382
9185 "The caller is responsible for deleting the temporary directory and its "
9186 "contents after use."
9190 #: ../src/guestfs-actions.pod:3052 ../fish/guestfish-actions.pod:2385
9191 msgid "See also: L<mkdtemp(3)>"
9195 #: ../src/guestfs-actions.pod:3057
9196 msgid "guestfs_mke2fs_J"
9200 #: ../src/guestfs-actions.pod:3059
9203 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9204 "\t\tconst char *fstype,\n"
9205 "\t\tint blocksize,\n"
9206 "\t\tconst char *device,\n"
9207 "\t\tconst char *journal);\n"
9212 #: ../src/guestfs-actions.pod:3065 ../fish/guestfish-actions.pod:2391
9214 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9215 "C<journal>. It is equivalent to the command:"
9219 #: ../src/guestfs-actions.pod:3069 ../fish/guestfish-actions.pod:2395
9222 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9227 #: ../src/guestfs-actions.pod:3071
9228 msgid "See also C<guestfs_mke2journal>."
9232 #: ../src/guestfs-actions.pod:3075
9233 msgid "guestfs_mke2fs_JL"
9237 #: ../src/guestfs-actions.pod:3077
9240 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9241 "\t\tconst char *fstype,\n"
9242 "\t\tint blocksize,\n"
9243 "\t\tconst char *device,\n"
9244 "\t\tconst char *label);\n"
9249 #: ../src/guestfs-actions.pod:3083 ../fish/guestfish-actions.pod:2403
9251 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9252 "the journal labeled C<label>."
9256 #: ../src/guestfs-actions.pod:3086
9257 msgid "See also C<guestfs_mke2journal_L>."
9261 #: ../src/guestfs-actions.pod:3090
9262 msgid "guestfs_mke2fs_JU"
9266 #: ../src/guestfs-actions.pod:3092
9269 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9270 "\t\tconst char *fstype,\n"
9271 "\t\tint blocksize,\n"
9272 "\t\tconst char *device,\n"
9273 "\t\tconst char *uuid);\n"
9278 #: ../src/guestfs-actions.pod:3098 ../fish/guestfish-actions.pod:2412
9280 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9281 "the journal with UUID C<uuid>."
9285 #: ../src/guestfs-actions.pod:3101
9286 msgid "See also C<guestfs_mke2journal_U>."
9290 #: ../src/guestfs-actions.pod:3105
9291 msgid "guestfs_mke2journal"
9295 #: ../src/guestfs-actions.pod:3107
9298 " int guestfs_mke2journal (guestfs_h *g,\n"
9299 "\t\tint blocksize,\n"
9300 "\t\tconst char *device);\n"
9305 #: ../src/guestfs-actions.pod:3111 ../fish/guestfish-actions.pod:2421
9307 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9312 #: ../src/guestfs-actions.pod:3114 ../fish/guestfish-actions.pod:2424
9315 " mke2fs -O journal_dev -b blocksize device\n"
9320 #: ../src/guestfs-actions.pod:3118
9321 msgid "guestfs_mke2journal_L"
9325 #: ../src/guestfs-actions.pod:3120
9328 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9329 "\t\tint blocksize,\n"
9330 "\t\tconst char *label,\n"
9331 "\t\tconst char *device);\n"
9336 #: ../src/guestfs-actions.pod:3125 ../fish/guestfish-actions.pod:2430
9337 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9341 #: ../src/guestfs-actions.pod:3129
9342 msgid "guestfs_mke2journal_U"
9346 #: ../src/guestfs-actions.pod:3131
9349 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9350 "\t\tint blocksize,\n"
9351 "\t\tconst char *uuid,\n"
9352 "\t\tconst char *device);\n"
9357 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2436
9358 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9362 #: ../src/guestfs-actions.pod:3140
9363 msgid "guestfs_mkfifo"
9367 #: ../src/guestfs-actions.pod:3142
9370 " int guestfs_mkfifo (guestfs_h *g,\n"
9372 "\t\tconst char *path);\n"
9377 #: ../src/guestfs-actions.pod:3146
9379 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9380 "is just a convenient wrapper around C<guestfs_mknod>."
9384 #: ../src/guestfs-actions.pod:3154
9385 msgid "guestfs_mkfs"
9389 #: ../src/guestfs-actions.pod:3156
9392 " int guestfs_mkfs (guestfs_h *g,\n"
9393 "\t\tconst char *fstype,\n"
9394 "\t\tconst char *device);\n"
9399 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2452
9401 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9402 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9406 #: ../src/guestfs-actions.pod:3166
9407 msgid "guestfs_mkfs_b"
9411 #: ../src/guestfs-actions.pod:3168
9414 " int guestfs_mkfs_b (guestfs_h *g,\n"
9415 "\t\tconst char *fstype,\n"
9416 "\t\tint blocksize,\n"
9417 "\t\tconst char *device);\n"
9422 #: ../src/guestfs-actions.pod:3173
9424 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9425 "block size of the resulting filesystem. Supported block sizes depend on the "
9426 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9430 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2465
9432 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9437 #: ../src/guestfs-actions.pod:3183
9438 msgid "guestfs_mkmountpoint"
9442 #: ../src/guestfs-actions.pod:3185
9445 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9446 "\t\tconst char *exemptpath);\n"
9451 #: ../src/guestfs-actions.pod:3188
9453 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9454 "that can be used to create extra mountpoints before mounting the first "
9459 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2476
9461 "These calls are I<only> necessary in some very limited circumstances, mainly "
9462 "the case where you want to mount a mix of unrelated and/or read-only "
9463 "filesystems together."
9467 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2480
9469 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9470 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9471 "inside that. You can unpack this as follows in guestfish:"
9475 #: ../src/guestfs-actions.pod:3201 ../fish/guestfish-actions.pod:2485
9478 " add-ro Fedora-11-i686-Live.iso\n"
9480 " mkmountpoint /cd\n"
9481 " mkmountpoint /squash\n"
9482 " mkmountpoint /ext3\n"
9483 " mount /dev/sda /cd\n"
9484 " mount-loop /cd/LiveOS/squashfs.img /squash\n"
9485 " mount-loop /squash/LiveOS/ext3fs.img /ext3\n"
9490 #: ../src/guestfs-actions.pod:3210 ../fish/guestfish-actions.pod:2494
9491 msgid "The inner filesystem is now unpacked under the /ext3 mountpoint."
9495 #: ../src/guestfs-actions.pod:3214
9496 msgid "guestfs_mknod"
9500 #: ../src/guestfs-actions.pod:3216
9503 " int guestfs_mknod (guestfs_h *g,\n"
9505 "\t\tint devmajor,\n"
9506 "\t\tint devminor,\n"
9507 "\t\tconst char *path);\n"
9512 #: ../src/guestfs-actions.pod:3222 ../fish/guestfish-actions.pod:2500
9514 "This call creates block or character special devices, or named pipes (FIFOs)."
9518 #: ../src/guestfs-actions.pod:3225 ../fish/guestfish-actions.pod:2503
9520 "The C<mode> parameter should be the mode, using the standard constants. "
9521 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9522 "used when creating block and character special devices."
9526 #: ../src/guestfs-actions.pod:3230
9528 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9529 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9530 "regular file). These constants are available in the standard Linux header "
9531 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9532 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9533 "the appropriate constant for you."
9537 #: ../src/guestfs-actions.pod:3242
9538 msgid "guestfs_mknod_b"
9542 #: ../src/guestfs-actions.pod:3244
9545 " int guestfs_mknod_b (guestfs_h *g,\n"
9547 "\t\tint devmajor,\n"
9548 "\t\tint devminor,\n"
9549 "\t\tconst char *path);\n"
9554 #: ../src/guestfs-actions.pod:3250
9556 "This call creates a block device node called C<path> with mode C<mode> and "
9557 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9558 "wrapper around C<guestfs_mknod>."
9562 #: ../src/guestfs-actions.pod:3258
9563 msgid "guestfs_mknod_c"
9567 #: ../src/guestfs-actions.pod:3260
9570 " int guestfs_mknod_c (guestfs_h *g,\n"
9572 "\t\tint devmajor,\n"
9573 "\t\tint devminor,\n"
9574 "\t\tconst char *path);\n"
9579 #: ../src/guestfs-actions.pod:3266
9581 "This call creates a char device node called C<path> with mode C<mode> and "
9582 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9583 "wrapper around C<guestfs_mknod>."
9587 #: ../src/guestfs-actions.pod:3274
9588 msgid "guestfs_mkswap"
9592 #: ../src/guestfs-actions.pod:3276
9595 " int guestfs_mkswap (guestfs_h *g,\n"
9596 "\t\tconst char *device);\n"
9601 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2542
9602 msgid "Create a swap partition on C<device>."
9606 #: ../src/guestfs-actions.pod:3283
9607 msgid "guestfs_mkswap_L"
9611 #: ../src/guestfs-actions.pod:3285
9614 " int guestfs_mkswap_L (guestfs_h *g,\n"
9615 "\t\tconst char *label,\n"
9616 "\t\tconst char *device);\n"
9621 #: ../src/guestfs-actions.pod:3289 ../fish/guestfish-actions.pod:2548
9622 msgid "Create a swap partition on C<device> with label C<label>."
9626 #: ../src/guestfs-actions.pod:3291 ../fish/guestfish-actions.pod:2550
9628 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
9629 "sda>), just to a partition. This appears to be a limitation of the kernel "
9634 #: ../src/guestfs-actions.pod:3297
9635 msgid "guestfs_mkswap_U"
9639 #: ../src/guestfs-actions.pod:3299
9642 " int guestfs_mkswap_U (guestfs_h *g,\n"
9643 "\t\tconst char *uuid,\n"
9644 "\t\tconst char *device);\n"
9649 #: ../src/guestfs-actions.pod:3303 ../fish/guestfish-actions.pod:2558
9650 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9654 #: ../src/guestfs-actions.pod:3307
9655 msgid "guestfs_mkswap_file"
9659 #: ../src/guestfs-actions.pod:3309
9662 " int guestfs_mkswap_file (guestfs_h *g,\n"
9663 "\t\tconst char *path);\n"
9668 #: ../src/guestfs-actions.pod:3312 ../fish/guestfish-actions.pod:2564
9669 msgid "Create a swap file."
9673 #: ../src/guestfs-actions.pod:3314
9675 "This command just writes a swap file signature to an existing file. To "
9676 "create the file itself, use something like C<guestfs_fallocate>."
9680 #: ../src/guestfs-actions.pod:3319
9681 msgid "guestfs_modprobe"
9685 #: ../src/guestfs-actions.pod:3321
9688 " int guestfs_modprobe (guestfs_h *g,\n"
9689 "\t\tconst char *modulename);\n"
9694 #: ../src/guestfs-actions.pod:3324 ../fish/guestfish-actions.pod:2573
9695 msgid "This loads a kernel module in the appliance."
9699 #: ../src/guestfs-actions.pod:3326 ../fish/guestfish-actions.pod:2575
9701 "The kernel module must have been whitelisted when libguestfs was built (see "
9702 "C<appliance/kmod.whitelist.in> in the source)."
9706 #: ../src/guestfs-actions.pod:3331
9707 msgid "guestfs_mount"
9711 #: ../src/guestfs-actions.pod:3333
9714 " int guestfs_mount (guestfs_h *g,\n"
9715 "\t\tconst char *device,\n"
9716 "\t\tconst char *mountpoint);\n"
9721 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2582
9723 "Mount a guest disk at a position in the filesystem. Block devices are named "
9724 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9725 "those block devices contain partitions, they will have the usual names (eg. "
9726 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9730 #: ../src/guestfs-actions.pod:3343 ../fish/guestfish-actions.pod:2588
9732 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9733 "mounted on C</> before others can be mounted. Other filesystems can only be "
9734 "mounted on directories which already exist."
9738 #: ../src/guestfs-actions.pod:3348 ../fish/guestfish-actions.pod:2593
9740 "The mounted filesystem is writable, if we have sufficient permissions on the "
9741 "underlying device."
9745 #: ../src/guestfs-actions.pod:3351
9747 "B<Important note:> When you use this call, the filesystem options C<sync> "
9748 "and C<noatime> are set implicitly. This was originally done because we "
9749 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9750 "very large negative performance impact and negligible effect on "
9751 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9752 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9753 "(use an empty string for the first parameter if you don't want any options)."
9757 #: ../src/guestfs-actions.pod:3363
9758 msgid "guestfs_mount_loop"
9762 #: ../src/guestfs-actions.pod:3365
9765 " int guestfs_mount_loop (guestfs_h *g,\n"
9766 "\t\tconst char *file,\n"
9767 "\t\tconst char *mountpoint);\n"
9772 #: ../src/guestfs-actions.pod:3369 ../fish/guestfish-actions.pod:2610
9774 "This command lets you mount C<file> (a filesystem image in a file) on a "
9775 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9780 #: ../src/guestfs-actions.pod:3375
9781 msgid "guestfs_mount_options"
9785 #: ../src/guestfs-actions.pod:3377
9788 " int guestfs_mount_options (guestfs_h *g,\n"
9789 "\t\tconst char *options,\n"
9790 "\t\tconst char *device,\n"
9791 "\t\tconst char *mountpoint);\n"
9796 #: ../src/guestfs-actions.pod:3382
9798 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9799 "the mount options as for the L<mount(8)> I<-o> flag."
9803 #: ../src/guestfs-actions.pod:3386 ../fish/guestfish-actions.pod:2622
9805 "If the C<options> parameter is an empty string, then no options are passed "
9806 "(all options default to whatever the filesystem uses)."
9810 #: ../src/guestfs-actions.pod:3392
9811 msgid "guestfs_mount_ro"
9815 #: ../src/guestfs-actions.pod:3394
9818 " int guestfs_mount_ro (guestfs_h *g,\n"
9819 "\t\tconst char *device,\n"
9820 "\t\tconst char *mountpoint);\n"
9825 #: ../src/guestfs-actions.pod:3398
9827 "This is the same as the C<guestfs_mount> command, but it mounts the "
9828 "filesystem with the read-only (I<-o ro>) flag."
9832 #: ../src/guestfs-actions.pod:3403
9833 msgid "guestfs_mount_vfs"
9837 #: ../src/guestfs-actions.pod:3405
9840 " int guestfs_mount_vfs (guestfs_h *g,\n"
9841 "\t\tconst char *options,\n"
9842 "\t\tconst char *vfstype,\n"
9843 "\t\tconst char *device,\n"
9844 "\t\tconst char *mountpoint);\n"
9849 #: ../src/guestfs-actions.pod:3411
9851 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9852 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
9857 #: ../src/guestfs-actions.pod:3417
9858 msgid "guestfs_mountpoints"
9862 #: ../src/guestfs-actions.pod:3419
9865 " char **guestfs_mountpoints (guestfs_h *g);\n"
9870 #: ../src/guestfs-actions.pod:3421
9872 "This call is similar to C<guestfs_mounts>. That call returns a list of "
9873 "devices. This one returns a hash table (map) of device name to directory "
9874 "where the device is mounted."
9878 #: ../src/guestfs-actions.pod:3431
9879 msgid "guestfs_mounts"
9883 #: ../src/guestfs-actions.pod:3433
9886 " char **guestfs_mounts (guestfs_h *g);\n"
9891 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2653
9893 "This returns the list of currently mounted filesystems. It returns the list "
9894 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
9898 #: ../src/guestfs-actions.pod:3438 ../fish/guestfish-actions.pod:2656
9899 msgid "Some internal mounts are not shown."
9903 #: ../src/guestfs-actions.pod:3440
9904 msgid "See also: C<guestfs_mountpoints>"
9908 #: ../src/guestfs-actions.pod:3446
9913 #: ../src/guestfs-actions.pod:3448
9916 " int guestfs_mv (guestfs_h *g,\n"
9917 "\t\tconst char *src,\n"
9918 "\t\tconst char *dest);\n"
9923 #: ../src/guestfs-actions.pod:3452 ../fish/guestfish-actions.pod:2664
9925 "This moves a file from C<src> to C<dest> where C<dest> is either a "
9926 "destination filename or destination directory."
9930 #: ../src/guestfs-actions.pod:3457
9931 msgid "guestfs_ntfs_3g_probe"
9935 #: ../src/guestfs-actions.pod:3459
9938 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
9940 "\t\tconst char *device);\n"
9945 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2671
9947 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
9948 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
9949 "write, and some cannot be mounted at all)."
9953 #: ../src/guestfs-actions.pod:3467 ../fish/guestfish-actions.pod:2675
9955 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
9956 "can be mounted read-write. Set it to false if you want to test if the "
9957 "volume can be mounted read-only."
9961 #: ../src/guestfs-actions.pod:3471 ../fish/guestfish-actions.pod:2679
9963 "The return value is an integer which C<0> if the operation would succeed, or "
9964 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
9968 #: ../src/guestfs-actions.pod:3477
9969 msgid "guestfs_ntfsresize"
9973 #: ../src/guestfs-actions.pod:3479
9976 " int guestfs_ntfsresize (guestfs_h *g,\n"
9977 "\t\tconst char *device);\n"
9982 #: ../src/guestfs-actions.pod:3482 ../fish/guestfish-actions.pod:2687
9984 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
9985 "size of the underlying device. See also L<ntfsresize(8)>."
9989 #: ../src/guestfs-actions.pod:3488
9990 msgid "guestfs_ntfsresize_size"
9994 #: ../src/guestfs-actions.pod:3490
9997 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
9998 "\t\tconst char *device,\n"
9999 "\t\tint64_t size);\n"
10004 #: ../src/guestfs-actions.pod:3494
10006 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10007 "to specify the new size (in bytes) explicitly."
10011 #: ../src/guestfs-actions.pod:3499
10012 msgid "guestfs_part_add"
10016 #: ../src/guestfs-actions.pod:3501
10019 " int guestfs_part_add (guestfs_h *g,\n"
10020 "\t\tconst char *device,\n"
10021 "\t\tconst char *prlogex,\n"
10022 "\t\tint64_t startsect,\n"
10023 "\t\tint64_t endsect);\n"
10028 #: ../src/guestfs-actions.pod:3507
10030 "This command adds a partition to C<device>. If there is no partition table "
10031 "on the device, call C<guestfs_part_init> first."
10035 #: ../src/guestfs-actions.pod:3510 ../fish/guestfish-actions.pod:2705
10037 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10038 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10039 "C<logical>) and C<e> (or C<extended>) partition types."
10043 #: ../src/guestfs-actions.pod:3515 ../fish/guestfish-actions.pod:2710
10045 "C<startsect> and C<endsect> are the start and end of the partition in "
10046 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10047 "from the end of the disk (C<-1> is the last sector)."
10051 #: ../src/guestfs-actions.pod:3519
10053 "Creating a partition which covers the whole disk is not so easy. Use "
10054 "C<guestfs_part_disk> to do that."
10058 #: ../src/guestfs-actions.pod:3524
10059 msgid "guestfs_part_del"
10063 #: ../src/guestfs-actions.pod:3526
10066 " int guestfs_part_del (guestfs_h *g,\n"
10067 "\t\tconst char *device,\n"
10068 "\t\tint partnum);\n"
10073 #: ../src/guestfs-actions.pod:3530 ../fish/guestfish-actions.pod:2721
10074 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10078 #: ../src/guestfs-actions.pod:3532 ../fish/guestfish-actions.pod:2723
10080 "Note that in the case of MBR partitioning, deleting an extended partition "
10081 "also deletes any logical partitions it contains."
10085 #: ../src/guestfs-actions.pod:3538
10086 msgid "guestfs_part_disk"
10090 #: ../src/guestfs-actions.pod:3540
10093 " int guestfs_part_disk (guestfs_h *g,\n"
10094 "\t\tconst char *device,\n"
10095 "\t\tconst char *parttype);\n"
10100 #: ../src/guestfs-actions.pod:3544
10102 "This command is simply a combination of C<guestfs_part_init> followed by "
10103 "C<guestfs_part_add> to create a single primary partition covering the whole "
10108 #: ../src/guestfs-actions.pod:3548
10110 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10111 "possible values are described in C<guestfs_part_init>."
10115 #: ../src/guestfs-actions.pod:3556
10116 msgid "guestfs_part_get_bootable"
10120 #: ../src/guestfs-actions.pod:3558
10123 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10124 "\t\tconst char *device,\n"
10125 "\t\tint partnum);\n"
10130 #: ../src/guestfs-actions.pod:3562 ../fish/guestfish-actions.pod:2745
10132 "This command returns true if the partition C<partnum> on C<device> has the "
10133 "bootable flag set."
10137 #: ../src/guestfs-actions.pod:3565
10138 msgid "See also C<guestfs_part_set_bootable>."
10142 #: ../src/guestfs-actions.pod:3569
10143 msgid "guestfs_part_get_mbr_id"
10147 #: ../src/guestfs-actions.pod:3571
10150 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10151 "\t\tconst char *device,\n"
10152 "\t\tint partnum);\n"
10157 #: ../src/guestfs-actions.pod:3575 ../fish/guestfish-actions.pod:2754
10159 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10160 "partition C<partnum>."
10164 #: ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3740
10166 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10167 "undefined results for other partition table types (see "
10168 "C<guestfs_part_get_parttype>)."
10172 #: ../src/guestfs-actions.pod:3584
10173 msgid "guestfs_part_get_parttype"
10177 #: ../src/guestfs-actions.pod:3586
10180 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10181 "\t\tconst char *device);\n"
10186 #: ../src/guestfs-actions.pod:3589 ../fish/guestfish-actions.pod:2765
10188 "This command examines the partition table on C<device> and returns the "
10189 "partition table type (format) being used."
10193 #: ../src/guestfs-actions.pod:3592
10195 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10196 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10197 "possible, although unusual. See C<guestfs_part_init> for a full list."
10201 #: ../src/guestfs-actions.pod:3600
10202 msgid "guestfs_part_init"
10206 #: ../src/guestfs-actions.pod:3602
10209 " int guestfs_part_init (guestfs_h *g,\n"
10210 "\t\tconst char *device,\n"
10211 "\t\tconst char *parttype);\n"
10216 #: ../src/guestfs-actions.pod:3606 ../fish/guestfish-actions.pod:2777
10218 "This creates an empty partition table on C<device> of one of the partition "
10219 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10220 "(for large disks)."
10224 #: ../src/guestfs-actions.pod:3610
10226 "Initially there are no partitions. Following this, you should call "
10227 "C<guestfs_part_add> for each partition required."
10231 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2784
10232 msgid "Possible values for C<parttype> are:"
10236 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2788
10237 msgid "B<efi> | B<gpt>"
10241 #: ../src/guestfs-actions.pod:3619 ../fish/guestfish-actions.pod:2790
10242 msgid "Intel EFI / GPT partition table."
10246 #: ../src/guestfs-actions.pod:3621 ../fish/guestfish-actions.pod:2792
10248 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10249 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10250 "the C<mbr> format."
10254 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2796
10255 msgid "B<mbr> | B<msdos>"
10259 #: ../src/guestfs-actions.pod:3627 ../fish/guestfish-actions.pod:2798
10261 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10262 "Windows. This partition type will B<only> work for device sizes up to 2 "
10263 "TB. For large disks we recommend using C<gpt>."
10267 #: ../src/guestfs-actions.pod:3634 ../fish/guestfish-actions.pod:2805
10269 "Other partition table types that may work but are not supported include:"
10273 #: ../src/guestfs-actions.pod:3639 ../fish/guestfish-actions.pod:2810
10278 #: ../src/guestfs-actions.pod:3641 ../fish/guestfish-actions.pod:2812
10279 msgid "AIX disk labels."
10283 #: ../src/guestfs-actions.pod:3643 ../fish/guestfish-actions.pod:2814
10284 msgid "B<amiga> | B<rdb>"
10288 #: ../src/guestfs-actions.pod:3645 ../fish/guestfish-actions.pod:2816
10289 msgid "Amiga \"Rigid Disk Block\" format."
10293 #: ../src/guestfs-actions.pod:3647 ../fish/guestfish-actions.pod:2818
10298 #: ../src/guestfs-actions.pod:3649 ../fish/guestfish-actions.pod:2820
10299 msgid "BSD disk labels."
10303 #: ../src/guestfs-actions.pod:3651 ../fish/guestfish-actions.pod:2822
10308 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2824
10309 msgid "DASD, used on IBM mainframes."
10313 #: ../src/guestfs-actions.pod:3655 ../fish/guestfish-actions.pod:2826
10318 #: ../src/guestfs-actions.pod:3657 ../fish/guestfish-actions.pod:2828
10319 msgid "MIPS/SGI volumes."
10323 #: ../src/guestfs-actions.pod:3659 ../fish/guestfish-actions.pod:2830
10328 #: ../src/guestfs-actions.pod:3661 ../fish/guestfish-actions.pod:2832
10329 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10333 #: ../src/guestfs-actions.pod:3663 ../fish/guestfish-actions.pod:2834
10338 #: ../src/guestfs-actions.pod:3665 ../fish/guestfish-actions.pod:2836
10339 msgid "NEC PC-98 format, common in Japan apparently."
10343 #: ../src/guestfs-actions.pod:3667 ../fish/guestfish-actions.pod:2838
10348 #: ../src/guestfs-actions.pod:3669 ../fish/guestfish-actions.pod:2840
10349 msgid "Sun disk labels."
10353 #: ../src/guestfs-actions.pod:3675
10354 msgid "guestfs_part_list"
10358 #: ../src/guestfs-actions.pod:3677
10361 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10362 "\t\tconst char *device);\n"
10367 #: ../src/guestfs-actions.pod:3680 ../fish/guestfish-actions.pod:2848
10369 "This command parses the partition table on C<device> and returns the list of "
10370 "partitions found."
10374 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2851
10375 msgid "The fields in the returned structure are:"
10379 #: ../src/guestfs-actions.pod:3687 ../fish/guestfish-actions.pod:2855
10380 msgid "B<part_num>"
10384 #: ../src/guestfs-actions.pod:3689 ../fish/guestfish-actions.pod:2857
10385 msgid "Partition number, counting from 1."
10389 #: ../src/guestfs-actions.pod:3691 ../fish/guestfish-actions.pod:2859
10390 msgid "B<part_start>"
10394 #: ../src/guestfs-actions.pod:3693
10396 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10397 "the device's sector size, see C<guestfs_blockdev_getss>."
10401 #: ../src/guestfs-actions.pod:3696 ../fish/guestfish-actions.pod:2864
10402 msgid "B<part_end>"
10406 #: ../src/guestfs-actions.pod:3698 ../fish/guestfish-actions.pod:2866
10407 msgid "End of the partition in bytes."
10411 #: ../src/guestfs-actions.pod:3700 ../fish/guestfish-actions.pod:2868
10412 msgid "B<part_size>"
10416 #: ../src/guestfs-actions.pod:3702 ../fish/guestfish-actions.pod:2870
10417 msgid "Size of the partition in bytes."
10421 #: ../src/guestfs-actions.pod:3706
10423 "This function returns a C<struct guestfs_partition_list *> (see E<lt>guestfs-"
10424 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10425 "C<guestfs_free_partition_list> after use>."
10429 #: ../src/guestfs-actions.pod:3711
10430 msgid "guestfs_part_set_bootable"
10434 #: ../src/guestfs-actions.pod:3713
10437 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10438 "\t\tconst char *device,\n"
10439 "\t\tint partnum,\n"
10440 "\t\tint bootable);\n"
10445 #: ../src/guestfs-actions.pod:3718 ../fish/guestfish-actions.pod:2878
10447 "This sets the bootable flag on partition numbered C<partnum> on device "
10448 "C<device>. Note that partitions are numbered from 1."
10452 #: ../src/guestfs-actions.pod:3721 ../fish/guestfish-actions.pod:2881
10454 "The bootable flag is used by some operating systems (notably Windows) to "
10455 "determine which partition to boot from. It is by no means universally "
10460 #: ../src/guestfs-actions.pod:3727
10461 msgid "guestfs_part_set_mbr_id"
10465 #: ../src/guestfs-actions.pod:3729
10468 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10469 "\t\tconst char *device,\n"
10470 "\t\tint partnum,\n"
10471 "\t\tint idbyte);\n"
10476 #: ../src/guestfs-actions.pod:3734 ../fish/guestfish-actions.pod:2889
10478 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10479 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10480 "documentation are in fact hexadecimal numbers, but usually documented "
10481 "without any leading \"0x\" which might be confusing."
10485 #: ../src/guestfs-actions.pod:3746
10486 msgid "guestfs_part_set_name"
10490 #: ../src/guestfs-actions.pod:3748
10493 " int guestfs_part_set_name (guestfs_h *g,\n"
10494 "\t\tconst char *device,\n"
10495 "\t\tint partnum,\n"
10496 "\t\tconst char *name);\n"
10501 #: ../src/guestfs-actions.pod:3753 ../fish/guestfish-actions.pod:2903
10503 "This sets the partition name on partition numbered C<partnum> on device "
10504 "C<device>. Note that partitions are numbered from 1."
10508 #: ../src/guestfs-actions.pod:3756 ../fish/guestfish-actions.pod:2906
10510 "The partition name can only be set on certain types of partition table. "
10511 "This works on C<gpt> but not on C<mbr> partitions."
10515 #: ../src/guestfs-actions.pod:3761
10516 msgid "guestfs_part_to_dev"
10520 #: ../src/guestfs-actions.pod:3763
10523 " char *guestfs_part_to_dev (guestfs_h *g,\n"
10524 "\t\tconst char *partition);\n"
10529 #: ../src/guestfs-actions.pod:3766 ../fish/guestfish-actions.pod:2913
10531 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
10532 "partition number, returning the device name (eg. \"/dev/sdb\")."
10536 #: ../src/guestfs-actions.pod:3770
10538 "The named partition must exist, for example as a string returned from "
10539 "C<guestfs_list_partitions>."
10543 #: ../src/guestfs-actions.pod:3776
10544 msgid "guestfs_ping_daemon"
10548 #: ../src/guestfs-actions.pod:3778
10551 " int guestfs_ping_daemon (guestfs_h *g);\n"
10556 #: ../src/guestfs-actions.pod:3780 ../fish/guestfish-actions.pod:2924
10558 "This is a test probe into the guestfs daemon running inside the qemu "
10559 "subprocess. Calling this function checks that the daemon responds to the "
10560 "ping message, without affecting the daemon or attached block device(s) in "
10565 #: ../src/guestfs-actions.pod:3787
10566 msgid "guestfs_pread"
10570 #: ../src/guestfs-actions.pod:3789
10573 " char *guestfs_pread (guestfs_h *g,\n"
10574 "\t\tconst char *path,\n"
10576 "\t\tint64_t offset,\n"
10577 "\t\tsize_t *size_r);\n"
10582 #: ../src/guestfs-actions.pod:3795 ../fish/guestfish-actions.pod:2933
10584 "This command lets you read part of a file. It reads C<count> bytes of the "
10585 "file, starting at C<offset>, from file C<path>."
10589 #: ../src/guestfs-actions.pod:3798 ../fish/guestfish-actions.pod:2936
10591 "This may read fewer bytes than requested. For further details see the "
10592 "L<pread(2)> system call."
10596 #: ../src/guestfs-actions.pod:3801
10597 msgid "See also C<guestfs_pwrite>."
10601 #: ../src/guestfs-actions.pod:3810
10602 msgid "guestfs_pvcreate"
10606 #: ../src/guestfs-actions.pod:3812
10609 " int guestfs_pvcreate (guestfs_h *g,\n"
10610 "\t\tconst char *device);\n"
10615 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2948
10617 "This creates an LVM physical volume on the named C<device>, where C<device> "
10618 "should usually be a partition name such as C</dev/sda1>."
10622 #: ../src/guestfs-actions.pod:3821
10623 msgid "guestfs_pvremove"
10627 #: ../src/guestfs-actions.pod:3823
10630 " int guestfs_pvremove (guestfs_h *g,\n"
10631 "\t\tconst char *device);\n"
10636 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2956
10638 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10643 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2959
10645 "The implementation uses the C<pvremove> command which refuses to wipe "
10646 "physical volumes that contain any volume groups, so you have to remove those "
10651 #: ../src/guestfs-actions.pod:3835
10652 msgid "guestfs_pvresize"
10656 #: ../src/guestfs-actions.pod:3837
10659 " int guestfs_pvresize (guestfs_h *g,\n"
10660 "\t\tconst char *device);\n"
10665 #: ../src/guestfs-actions.pod:3840 ../fish/guestfish-actions.pod:2967
10667 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10668 "the new size of the underlying device."
10672 #: ../src/guestfs-actions.pod:3845
10673 msgid "guestfs_pvresize_size"
10677 #: ../src/guestfs-actions.pod:3847
10680 " int guestfs_pvresize_size (guestfs_h *g,\n"
10681 "\t\tconst char *device,\n"
10682 "\t\tint64_t size);\n"
10687 #: ../src/guestfs-actions.pod:3851
10689 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10690 "specify the new size (in bytes) explicitly."
10694 #: ../src/guestfs-actions.pod:3856
10695 msgid "guestfs_pvs"
10699 #: ../src/guestfs-actions.pod:3858
10702 " char **guestfs_pvs (guestfs_h *g);\n"
10707 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2981
10709 "List all the physical volumes detected. This is the equivalent of the L<pvs"
10714 #: ../src/guestfs-actions.pod:3863 ../fish/guestfish-actions.pod:2984
10716 "This returns a list of just the device names that contain PVs (eg. C</dev/"
10721 #: ../src/guestfs-actions.pod:3866
10722 msgid "See also C<guestfs_pvs_full>."
10726 #: ../src/guestfs-actions.pod:3872
10727 msgid "guestfs_pvs_full"
10731 #: ../src/guestfs-actions.pod:3874
10734 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10739 #: ../src/guestfs-actions.pod:3876 ../fish/guestfish-actions.pod:2993
10741 "List all the physical volumes detected. This is the equivalent of the L<pvs"
10742 "(8)> command. The \"full\" version includes all fields."
10746 #: ../src/guestfs-actions.pod:3879
10748 "This function returns a C<struct guestfs_lvm_pv_list *> (see E<lt>guestfs-"
10749 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10750 "C<guestfs_free_lvm_pv_list> after use>."
10754 #: ../src/guestfs-actions.pod:3884
10755 msgid "guestfs_pvuuid"
10759 #: ../src/guestfs-actions.pod:3886
10762 " char *guestfs_pvuuid (guestfs_h *g,\n"
10763 "\t\tconst char *device);\n"
10768 #: ../src/guestfs-actions.pod:3889 ../fish/guestfish-actions.pod:3000
10769 msgid "This command returns the UUID of the LVM PV C<device>."
10773 #: ../src/guestfs-actions.pod:3894
10774 msgid "guestfs_pwrite"
10778 #: ../src/guestfs-actions.pod:3896
10781 " int guestfs_pwrite (guestfs_h *g,\n"
10782 "\t\tconst char *path,\n"
10783 "\t\tconst char *content,\n"
10784 "\t\tsize_t content_size,\n"
10785 "\t\tint64_t offset);\n"
10790 #: ../src/guestfs-actions.pod:3902 ../fish/guestfish-actions.pod:3006
10792 "This command writes to part of a file. It writes the data buffer C<content> "
10793 "to the file C<path> starting at offset C<offset>."
10797 #: ../src/guestfs-actions.pod:3905 ../fish/guestfish-actions.pod:3009
10799 "This command implements the L<pwrite(2)> system call, and like that system "
10800 "call it may not write the full data requested. The return value is the "
10801 "number of bytes that were actually written to the file. This could even be "
10802 "0, although short writes are unlikely for regular files in ordinary "
10807 #: ../src/guestfs-actions.pod:3911
10808 msgid "See also C<guestfs_pread>."
10812 #: ../src/guestfs-actions.pod:3918
10813 msgid "guestfs_read_file"
10817 #: ../src/guestfs-actions.pod:3920
10820 " char *guestfs_read_file (guestfs_h *g,\n"
10821 "\t\tconst char *path,\n"
10822 "\t\tsize_t *size_r);\n"
10827 #: ../src/guestfs-actions.pod:3924 ../fish/guestfish-actions.pod:3024
10828 msgid "This calls returns the contents of the file C<path> as a buffer."
10832 #: ../src/guestfs-actions.pod:3927
10834 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
10835 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
10836 "function is limited in the total size of file that can be handled."
10840 #: ../src/guestfs-actions.pod:3939
10841 msgid "guestfs_read_lines"
10845 #: ../src/guestfs-actions.pod:3941
10848 " char **guestfs_read_lines (guestfs_h *g,\n"
10849 "\t\tconst char *path);\n"
10854 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:3041
10856 "The file contents are returned as a list of lines. Trailing C<LF> and "
10857 "C<CRLF> character sequences are I<not> returned."
10861 #: ../src/guestfs-actions.pod:3949
10863 "Note that this function cannot correctly handle binary files (specifically, "
10864 "files containing C<\\0> character which is treated as end of line). For "
10865 "those you need to use the C<guestfs_read_file> function which has a more "
10866 "complex interface."
10870 #: ../src/guestfs-actions.pod:3958
10871 msgid "guestfs_readdir"
10875 #: ../src/guestfs-actions.pod:3960
10878 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
10879 "\t\tconst char *dir);\n"
10884 #: ../src/guestfs-actions.pod:3963 ../fish/guestfish-actions.pod:3053
10885 msgid "This returns the list of directory entries in directory C<dir>."
10889 #: ../src/guestfs-actions.pod:3965 ../fish/guestfish-actions.pod:3055
10891 "All entries in the directory are returned, including C<.> and C<..>. The "
10892 "entries are I<not> sorted, but returned in the same order as the underlying "
10897 #: ../src/guestfs-actions.pod:3969 ../fish/guestfish-actions.pod:3059
10899 "Also this call returns basic file type information about each file. The "
10900 "C<ftyp> field will contain one of the following characters:"
10904 #: ../src/guestfs-actions.pod:3974 ../fish/guestfish-actions.pod:3064
10909 #: ../src/guestfs-actions.pod:3976 ../fish/guestfish-actions.pod:3066
10910 msgid "Block special"
10914 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:3068
10919 #: ../src/guestfs-actions.pod:3980 ../fish/guestfish-actions.pod:3070
10920 msgid "Char special"
10924 #: ../src/guestfs-actions.pod:3982 ../fish/guestfish-actions.pod:3072
10929 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:3074
10934 #: ../src/guestfs-actions.pod:3986 ../fish/guestfish-actions.pod:3076
10939 #: ../src/guestfs-actions.pod:3988 ../fish/guestfish-actions.pod:3078
10940 msgid "FIFO (named pipe)"
10944 #: ../src/guestfs-actions.pod:3990 ../fish/guestfish-actions.pod:3080
10949 #: ../src/guestfs-actions.pod:3992 ../fish/guestfish-actions.pod:3082
10950 msgid "Symbolic link"
10954 #: ../src/guestfs-actions.pod:3994 ../fish/guestfish-actions.pod:3084
10959 #: ../src/guestfs-actions.pod:3996 ../fish/guestfish-actions.pod:3086
10960 msgid "Regular file"
10964 #: ../src/guestfs-actions.pod:3998 ../fish/guestfish-actions.pod:3088
10969 #: ../src/guestfs-actions.pod:4000 ../fish/guestfish-actions.pod:3090
10974 #: ../src/guestfs-actions.pod:4002 ../fish/guestfish-actions.pod:3092
10979 #: ../src/guestfs-actions.pod:4004 ../fish/guestfish-actions.pod:3094
10980 msgid "Unknown file type"
10984 #: ../src/guestfs-actions.pod:4006 ../fish/guestfish-actions.pod:3096
10989 #: ../src/guestfs-actions.pod:4008 ../fish/guestfish-actions.pod:3098
10991 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
10995 #: ../src/guestfs-actions.pod:4013
10997 "This function is primarily intended for use by programs. To get a simple "
10998 "list of names, use C<guestfs_ls>. To get a printable directory for human "
10999 "consumption, use C<guestfs_ll>."
11003 #: ../src/guestfs-actions.pod:4017
11005 "This function returns a C<struct guestfs_dirent_list *> (see E<lt>guestfs-"
11006 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11007 "C<guestfs_free_dirent_list> after use>."
11011 #: ../src/guestfs-actions.pod:4022
11012 msgid "guestfs_readlink"
11016 #: ../src/guestfs-actions.pod:4024
11019 " char *guestfs_readlink (guestfs_h *g,\n"
11020 "\t\tconst char *path);\n"
11025 #: ../src/guestfs-actions.pod:4027 ../fish/guestfish-actions.pod:3111
11026 msgid "This command reads the target of a symbolic link."
11030 #: ../src/guestfs-actions.pod:4032
11031 msgid "guestfs_readlinklist"
11035 #: ../src/guestfs-actions.pod:4034
11038 " char **guestfs_readlinklist (guestfs_h *g,\n"
11039 "\t\tconst char *path,\n"
11040 "\t\tchar *const *names);\n"
11045 #: ../src/guestfs-actions.pod:4038 ../fish/guestfish-actions.pod:3117
11047 "This call allows you to do a C<readlink> operation on multiple files, where "
11048 "all files are in the directory C<path>. C<names> is the list of files from "
11053 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:3121
11055 "On return you get a list of strings, with a one-to-one correspondence to the "
11056 "C<names> list. Each string is the value of the symbolic link."
11060 #: ../src/guestfs-actions.pod:4046 ../fish/guestfish-actions.pod:3125
11062 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11063 "result string is the empty string C<\"\">. However the whole operation is "
11064 "completed even if there were C<readlink(2)> errors, and so you can call this "
11065 "function with names where you don't know if they are symbolic links already "
11066 "(albeit slightly less efficient)."
11070 #: ../src/guestfs-actions.pod:4053 ../fish/guestfish-actions.pod:3132
11072 "This call is intended for programs that want to efficiently list a directory "
11073 "contents without making many round-trips. Very long directory listings "
11074 "might cause the protocol message size to be exceeded, causing this call to "
11075 "fail. The caller must split up such requests into smaller groups of names."
11079 #: ../src/guestfs-actions.pod:4064
11080 msgid "guestfs_realpath"
11084 #: ../src/guestfs-actions.pod:4066
11087 " char *guestfs_realpath (guestfs_h *g,\n"
11088 "\t\tconst char *path);\n"
11093 #: ../src/guestfs-actions.pod:4069 ../fish/guestfish-actions.pod:3143
11095 "Return the canonicalized absolute pathname of C<path>. The returned path "
11096 "has no C<.>, C<..> or symbolic link path elements."
11100 #: ../src/guestfs-actions.pod:4075
11101 msgid "guestfs_removexattr"
11105 #: ../src/guestfs-actions.pod:4077
11108 " int guestfs_removexattr (guestfs_h *g,\n"
11109 "\t\tconst char *xattr,\n"
11110 "\t\tconst char *path);\n"
11115 #: ../src/guestfs-actions.pod:4081 ../fish/guestfish-actions.pod:3150
11117 "This call removes the extended attribute named C<xattr> of the file C<path>."
11121 #: ../src/guestfs-actions.pod:4084
11122 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11126 #: ../src/guestfs-actions.pod:4088
11127 msgid "guestfs_resize2fs"
11131 #: ../src/guestfs-actions.pod:4090
11134 " int guestfs_resize2fs (guestfs_h *g,\n"
11135 "\t\tconst char *device);\n"
11140 #: ../src/guestfs-actions.pod:4093 ../fish/guestfish-actions.pod:3159
11142 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11143 "underlying device."
11147 #: ../src/guestfs-actions.pod:4096
11149 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11150 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11151 "sometimes gives an error about this and sometimes not. In any case, it is "
11152 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11156 #: ../src/guestfs-actions.pod:4104
11157 msgid "guestfs_resize2fs_size"
11161 #: ../src/guestfs-actions.pod:4106
11164 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11165 "\t\tconst char *device,\n"
11166 "\t\tint64_t size);\n"
11171 #: ../src/guestfs-actions.pod:4110
11173 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11174 "to specify the new size (in bytes) explicitly."
11178 #: ../src/guestfs-actions.pod:4115
11183 #: ../src/guestfs-actions.pod:4117
11186 " int guestfs_rm (guestfs_h *g,\n"
11187 "\t\tconst char *path);\n"
11192 #: ../src/guestfs-actions.pod:4120 ../fish/guestfish-actions.pod:3179
11193 msgid "Remove the single file C<path>."
11197 #: ../src/guestfs-actions.pod:4124
11198 msgid "guestfs_rm_rf"
11202 #: ../src/guestfs-actions.pod:4126
11205 " int guestfs_rm_rf (guestfs_h *g,\n"
11206 "\t\tconst char *path);\n"
11211 #: ../src/guestfs-actions.pod:4129 ../fish/guestfish-actions.pod:3185
11213 "Remove the file or directory C<path>, recursively removing the contents if "
11214 "its a directory. This is like the C<rm -rf> shell command."
11218 #: ../src/guestfs-actions.pod:4135
11219 msgid "guestfs_rmdir"
11223 #: ../src/guestfs-actions.pod:4137
11226 " int guestfs_rmdir (guestfs_h *g,\n"
11227 "\t\tconst char *path);\n"
11232 #: ../src/guestfs-actions.pod:4140 ../fish/guestfish-actions.pod:3193
11233 msgid "Remove the single directory C<path>."
11237 #: ../src/guestfs-actions.pod:4144
11238 msgid "guestfs_rmmountpoint"
11242 #: ../src/guestfs-actions.pod:4146
11245 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11246 "\t\tconst char *exemptpath);\n"
11251 #: ../src/guestfs-actions.pod:4149
11253 "This calls removes a mountpoint that was previously created with "
11254 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11258 #: ../src/guestfs-actions.pod:4155
11259 msgid "guestfs_scrub_device"
11263 #: ../src/guestfs-actions.pod:4157
11266 " int guestfs_scrub_device (guestfs_h *g,\n"
11267 "\t\tconst char *device);\n"
11272 #: ../src/guestfs-actions.pod:4160 ../fish/guestfish-actions.pod:3207
11274 "This command writes patterns over C<device> to make data retrieval more "
11279 #: ../src/guestfs-actions.pod:4163 ../src/guestfs-actions.pod:4181
11280 #: ../src/guestfs-actions.pod:4197 ../fish/guestfish-actions.pod:3210
11281 #: ../fish/guestfish-actions.pod:3225 ../fish/guestfish-actions.pod:3238
11283 "It is an interface to the L<scrub(1)> program. See that manual page for "
11288 #: ../src/guestfs-actions.pod:4171
11289 msgid "guestfs_scrub_file"
11293 #: ../src/guestfs-actions.pod:4173
11296 " int guestfs_scrub_file (guestfs_h *g,\n"
11297 "\t\tconst char *file);\n"
11302 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:3220
11304 "This command writes patterns over a file to make data retrieval more "
11309 #: ../src/guestfs-actions.pod:4179 ../fish/guestfish-actions.pod:3223
11310 msgid "The file is I<removed> after scrubbing."
11314 #: ../src/guestfs-actions.pod:4186
11315 msgid "guestfs_scrub_freespace"
11319 #: ../src/guestfs-actions.pod:4188
11322 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11323 "\t\tconst char *dir);\n"
11328 #: ../src/guestfs-actions.pod:4191
11330 "This command creates the directory C<dir> and then fills it with files until "
11331 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11332 "and deletes them. The intention is to scrub any free space on the partition "
11333 "containing C<dir>."
11337 #: ../src/guestfs-actions.pod:4202
11338 msgid "guestfs_set_append"
11342 #: ../src/guestfs-actions.pod:4204
11345 " int guestfs_set_append (guestfs_h *g,\n"
11346 "\t\tconst char *append);\n"
11351 #: ../src/guestfs-actions.pod:4207 ../fish/guestfish-actions.pod:3245
11353 "This function is used to add additional options to the guest kernel command "
11358 #: ../src/guestfs-actions.pod:4210 ../fish/guestfish-actions.pod:3248
11360 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11361 "environment variable."
11365 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:3251
11367 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11368 "(libguestfs always adds a few of its own)."
11372 #: ../src/guestfs-actions.pod:4218
11373 msgid "guestfs_set_autosync"
11377 #: ../src/guestfs-actions.pod:4220
11380 " int guestfs_set_autosync (guestfs_h *g,\n"
11381 "\t\tint autosync);\n"
11386 #: ../src/guestfs-actions.pod:4223
11388 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11389 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11390 "the handle is closed (also if the program exits without closing handles)."
11394 #: ../src/guestfs-actions.pod:4228 ../fish/guestfish-actions.pod:3263
11396 "This is disabled by default (except in guestfish where it is enabled by "
11401 #: ../src/guestfs-actions.pod:4233
11402 msgid "guestfs_set_direct"
11406 #: ../src/guestfs-actions.pod:4235
11409 " int guestfs_set_direct (guestfs_h *g,\n"
11410 "\t\tint direct);\n"
11415 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:3270
11417 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11418 "passed directly through to the appliance once it is launched."
11422 #: ../src/guestfs-actions.pod:4242
11424 "One consequence of this is that log messages aren't caught by the library "
11425 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11430 #: ../src/guestfs-actions.pod:4246 ../fish/guestfish-actions.pod:3278
11431 msgid "You probably don't want to use this unless you know what you are doing."
11435 #: ../src/guestfs-actions.pod:4249 ../fish/guestfish-actions.pod:3281
11436 msgid "The default is disabled."
11440 #: ../src/guestfs-actions.pod:4253
11441 msgid "guestfs_set_e2label"
11445 #: ../src/guestfs-actions.pod:4255
11448 " int guestfs_set_e2label (guestfs_h *g,\n"
11449 "\t\tconst char *device,\n"
11450 "\t\tconst char *label);\n"
11455 #: ../src/guestfs-actions.pod:4259 ../fish/guestfish-actions.pod:3287
11457 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11458 "C<label>. Filesystem labels are limited to 16 characters."
11462 #: ../src/guestfs-actions.pod:4263
11464 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11465 "the existing label on a filesystem."
11469 #: ../src/guestfs-actions.pod:4268
11470 msgid "guestfs_set_e2uuid"
11474 #: ../src/guestfs-actions.pod:4270
11477 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11478 "\t\tconst char *device,\n"
11479 "\t\tconst char *uuid);\n"
11484 #: ../src/guestfs-actions.pod:4274 ../fish/guestfish-actions.pod:3298
11486 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11487 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11488 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11492 #: ../src/guestfs-actions.pod:4279
11494 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11495 "the existing UUID of a filesystem."
11499 #: ../src/guestfs-actions.pod:4284
11500 msgid "guestfs_set_memsize"
11504 #: ../src/guestfs-actions.pod:4286
11507 " int guestfs_set_memsize (guestfs_h *g,\n"
11508 "\t\tint memsize);\n"
11513 #: ../src/guestfs-actions.pod:4289
11515 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11516 "This only has any effect if called before C<guestfs_launch>."
11520 #: ../src/guestfs-actions.pod:4293 ../fish/guestfish-actions.pod:3314
11522 "You can also change this by setting the environment variable "
11523 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11527 #: ../src/guestfs-actions.pod:4302
11528 msgid "guestfs_set_network"
11532 #: ../src/guestfs-actions.pod:4304
11535 " int guestfs_set_network (guestfs_h *g,\n"
11536 "\t\tint network);\n"
11541 #: ../src/guestfs-actions.pod:4307 ../fish/guestfish-actions.pod:3325
11543 "If C<network> is true, then the network is enabled in the libguestfs "
11544 "appliance. The default is false."
11548 #: ../src/guestfs-actions.pod:4310 ../fish/guestfish-actions.pod:3328
11550 "This affects whether commands are able to access the network (see L<guestfs"
11551 "(3)/RUNNING COMMANDS>)."
11555 #: ../src/guestfs-actions.pod:4313
11557 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11562 #: ../src/guestfs-actions.pod:4318
11563 msgid "guestfs_set_path"
11567 #: ../src/guestfs-actions.pod:4320
11570 " int guestfs_set_path (guestfs_h *g,\n"
11571 "\t\tconst char *searchpath);\n"
11576 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:3338
11577 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11581 #: ../src/guestfs-actions.pod:4325 ../fish/guestfish-actions.pod:3340
11583 "The default is C<$libdir/guestfs> unless overridden by setting "
11584 "C<LIBGUESTFS_PATH> environment variable."
11588 #: ../src/guestfs-actions.pod:4328 ../fish/guestfish-actions.pod:3343
11589 msgid "Setting C<path> to C<NULL> restores the default path."
11593 #: ../src/guestfs-actions.pod:4332
11594 msgid "guestfs_set_qemu"
11598 #: ../src/guestfs-actions.pod:4334
11601 " int guestfs_set_qemu (guestfs_h *g,\n"
11602 "\t\tconst char *qemu);\n"
11607 #: ../src/guestfs-actions.pod:4337 ../fish/guestfish-actions.pod:3349
11608 msgid "Set the qemu binary that we will use."
11612 #: ../src/guestfs-actions.pod:4339 ../fish/guestfish-actions.pod:3351
11614 "The default is chosen when the library was compiled by the configure script."
11618 #: ../src/guestfs-actions.pod:4342 ../fish/guestfish-actions.pod:3354
11620 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11625 #: ../src/guestfs-actions.pod:4345 ../fish/guestfish-actions.pod:3357
11626 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11630 #: ../src/guestfs-actions.pod:4347 ../fish/guestfish-actions.pod:3359
11632 "Note that you should call this function as early as possible after creating "
11633 "the handle. This is because some pre-launch operations depend on testing "
11634 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11635 "don't retest features, and so you might see inconsistent results. Using the "
11636 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11637 "the qemu binary at the same time as the handle is created."
11641 #: ../src/guestfs-actions.pod:4357
11642 msgid "guestfs_set_recovery_proc"
11646 #: ../src/guestfs-actions.pod:4359
11649 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11650 "\t\tint recoveryproc);\n"
11655 #: ../src/guestfs-actions.pod:4362
11657 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11658 "not create a recovery process. The purpose of the recovery process is to "
11659 "stop runaway qemu processes in the case where the main program aborts "
11664 #: ../src/guestfs-actions.pod:4367
11666 "This only has any effect if called before C<guestfs_launch>, and the default "
11671 #: ../src/guestfs-actions.pod:4370 ../fish/guestfish-actions.pod:3379
11673 "About the only time when you would want to disable this is if the main "
11674 "process will fork itself into the background (\"daemonize\" itself). In "
11675 "this case the recovery process thinks that the main program has disappeared "
11676 "and so kills qemu, which is not very helpful."
11680 #: ../src/guestfs-actions.pod:4378
11681 msgid "guestfs_set_selinux"
11685 #: ../src/guestfs-actions.pod:4380
11688 " int guestfs_set_selinux (guestfs_h *g,\n"
11689 "\t\tint selinux);\n"
11694 #: ../src/guestfs-actions.pod:4383 ../fish/guestfish-actions.pod:3389
11696 "This sets the selinux flag that is passed to the appliance at boot time. "
11697 "The default is C<selinux=0> (disabled)."
11701 #: ../src/guestfs-actions.pod:4386 ../fish/guestfish-actions.pod:3392
11703 "Note that if SELinux is enabled, it is always in Permissive mode "
11704 "(C<enforcing=0>)."
11708 #: ../src/guestfs-actions.pod:4394
11709 msgid "guestfs_set_trace"
11713 #: ../src/guestfs-actions.pod:4396
11716 " int guestfs_set_trace (guestfs_h *g,\n"
11717 "\t\tint trace);\n"
11722 #: ../src/guestfs-actions.pod:4399 ../fish/guestfish-actions.pod:3402
11724 "If the command trace flag is set to 1, then commands are printed on stderr "
11725 "before they are executed in a format which is very similar to the one used "
11726 "by guestfish. In other words, you can run a program with this enabled, and "
11727 "you will get out a script which you can feed to guestfish to perform the "
11728 "same set of actions."
11732 #: ../src/guestfs-actions.pod:4406 ../fish/guestfish-actions.pod:3409
11734 "If you want to trace C API calls into libguestfs (and other libraries) then "
11735 "possibly a better way is to use the external ltrace(1) command."
11739 #: ../src/guestfs-actions.pod:4410 ../fish/guestfish-actions.pod:3413
11741 "Command traces are disabled unless the environment variable "
11742 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
11746 #: ../src/guestfs-actions.pod:4415
11747 msgid "guestfs_set_verbose"
11751 #: ../src/guestfs-actions.pod:4417
11754 " int guestfs_set_verbose (guestfs_h *g,\n"
11755 "\t\tint verbose);\n"
11760 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:3420
11761 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
11765 #: ../src/guestfs-actions.pod:4422 ../fish/guestfish-actions.pod:3422
11767 "Verbose messages are disabled unless the environment variable "
11768 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
11772 #: ../src/guestfs-actions.pod:4427
11773 msgid "guestfs_setcon"
11777 #: ../src/guestfs-actions.pod:4429
11780 " int guestfs_setcon (guestfs_h *g,\n"
11781 "\t\tconst char *context);\n"
11786 #: ../src/guestfs-actions.pod:4432 ../fish/guestfish-actions.pod:3429
11788 "This sets the SELinux security context of the daemon to the string "
11793 #: ../src/guestfs-actions.pod:4435 ../fish/guestfish-actions.pod:3432
11794 msgid "See the documentation about SELINUX in L<guestfs(3)>."
11798 #: ../src/guestfs-actions.pod:4439
11799 msgid "guestfs_setxattr"
11803 #: ../src/guestfs-actions.pod:4441
11806 " int guestfs_setxattr (guestfs_h *g,\n"
11807 "\t\tconst char *xattr,\n"
11808 "\t\tconst char *val,\n"
11809 "\t\tint vallen,\n"
11810 "\t\tconst char *path);\n"
11815 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:3438
11817 "This call sets the extended attribute named C<xattr> of the file C<path> to "
11818 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
11822 #: ../src/guestfs-actions.pod:4451
11823 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
11827 #: ../src/guestfs-actions.pod:4455
11828 msgid "guestfs_sfdisk"
11832 #: ../src/guestfs-actions.pod:4457
11835 " int guestfs_sfdisk (guestfs_h *g,\n"
11836 "\t\tconst char *device,\n"
11839 "\t\tint sectors,\n"
11840 "\t\tchar *const *lines);\n"
11845 #: ../src/guestfs-actions.pod:4464 ../fish/guestfish-actions.pod:3448
11847 "This is a direct interface to the L<sfdisk(8)> program for creating "
11848 "partitions on block devices."
11852 #: ../src/guestfs-actions.pod:4467 ../fish/guestfish-actions.pod:3451
11853 msgid "C<device> should be a block device, for example C</dev/sda>."
11857 #: ../src/guestfs-actions.pod:4469 ../fish/guestfish-actions.pod:3453
11859 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
11860 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
11861 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
11862 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
11863 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
11864 "the kernel) cannot work out the right geometry and you will need to tell it."
11868 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:3461
11870 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
11871 "refer to the L<sfdisk(8)> manpage."
11875 #: ../src/guestfs-actions.pod:4480 ../fish/guestfish-actions.pod:3464
11877 "To create a single partition occupying the whole disk, you would pass "
11878 "C<lines> as a single element list, when the single element being the string "
11883 #: ../src/guestfs-actions.pod:4484
11885 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
11889 #: ../src/guestfs-actions.pod:4492
11890 msgid "guestfs_sfdiskM"
11894 #: ../src/guestfs-actions.pod:4494
11897 " int guestfs_sfdiskM (guestfs_h *g,\n"
11898 "\t\tconst char *device,\n"
11899 "\t\tchar *const *lines);\n"
11904 #: ../src/guestfs-actions.pod:4498
11906 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
11907 "partition sizes are specified in megabytes only (rounded to the nearest "
11908 "cylinder) and you don't need to specify the cyls, heads and sectors "
11909 "parameters which were rarely if ever used anyway."
11913 #: ../src/guestfs-actions.pod:4504
11915 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
11916 "C<guestfs_part_disk>"
11920 #: ../src/guestfs-actions.pod:4512
11921 msgid "guestfs_sfdisk_N"
11925 #: ../src/guestfs-actions.pod:4514
11928 " int guestfs_sfdisk_N (guestfs_h *g,\n"
11929 "\t\tconst char *device,\n"
11930 "\t\tint partnum,\n"
11933 "\t\tint sectors,\n"
11934 "\t\tconst char *line);\n"
11939 #: ../src/guestfs-actions.pod:4522 ../fish/guestfish-actions.pod:3494
11941 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
11942 "(note: C<n> counts from 1)."
11946 #: ../src/guestfs-actions.pod:4525
11948 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
11949 "for the cyls/heads/sectors parameters."
11953 #: ../src/guestfs-actions.pod:4528
11954 msgid "See also: C<guestfs_part_add>"
11958 #: ../src/guestfs-actions.pod:4535
11959 msgid "guestfs_sfdisk_disk_geometry"
11963 #: ../src/guestfs-actions.pod:4537
11966 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
11967 "\t\tconst char *device);\n"
11972 #: ../src/guestfs-actions.pod:4540
11974 "This displays the disk geometry of C<device> read from the partition table. "
11975 "Especially in the case where the underlying block device has been resized, "
11976 "this can be different from the kernel's idea of the geometry (see "
11977 "C<guestfs_sfdisk_kernel_geometry>)."
11981 #: ../src/guestfs-actions.pod:4545 ../src/guestfs-actions.pod:4558
11982 #: ../fish/guestfish-actions.pod:3514 ../fish/guestfish-actions.pod:3523
11983 msgid "The result is in human-readable format, and not designed to be parsed."
11987 #: ../src/guestfs-actions.pod:4551
11988 msgid "guestfs_sfdisk_kernel_geometry"
11992 #: ../src/guestfs-actions.pod:4553
11995 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
11996 "\t\tconst char *device);\n"
12001 #: ../src/guestfs-actions.pod:4556 ../fish/guestfish-actions.pod:3521
12002 msgid "This displays the kernel's idea of the geometry of C<device>."
12006 #: ../src/guestfs-actions.pod:4564
12007 msgid "guestfs_sfdisk_l"
12011 #: ../src/guestfs-actions.pod:4566
12014 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12015 "\t\tconst char *device);\n"
12020 #: ../src/guestfs-actions.pod:4569 ../fish/guestfish-actions.pod:3530
12022 "This displays the partition table on C<device>, in the human-readable output "
12023 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12027 #: ../src/guestfs-actions.pod:4573
12028 msgid "See also: C<guestfs_part_list>"
12032 #: ../src/guestfs-actions.pod:4578
12037 #: ../src/guestfs-actions.pod:4580
12040 " char *guestfs_sh (guestfs_h *g,\n"
12041 "\t\tconst char *command);\n"
12046 #: ../src/guestfs-actions.pod:4583 ../fish/guestfish-actions.pod:3540
12048 "This call runs a command from the guest filesystem via the guest's C</bin/"
12053 #: ../src/guestfs-actions.pod:4586
12054 msgid "This is like C<guestfs_command>, but passes the command to:"
12058 #: ../src/guestfs-actions.pod:4588 ../fish/guestfish-actions.pod:3545
12061 " /bin/sh -c \"command\"\n"
12066 #: ../src/guestfs-actions.pod:4590 ../fish/guestfish-actions.pod:3547
12068 "Depending on the guest's shell, this usually results in wildcards being "
12069 "expanded, shell expressions being interpolated and so on."
12073 #: ../src/guestfs-actions.pod:4594
12074 msgid "All the provisos about C<guestfs_command> apply to this call."
12078 #: ../src/guestfs-actions.pod:4599
12079 msgid "guestfs_sh_lines"
12083 #: ../src/guestfs-actions.pod:4601
12086 " char **guestfs_sh_lines (guestfs_h *g,\n"
12087 "\t\tconst char *command);\n"
12092 #: ../src/guestfs-actions.pod:4604
12094 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12099 #: ../src/guestfs-actions.pod:4607
12100 msgid "See also: C<guestfs_command_lines>"
12104 #: ../src/guestfs-actions.pod:4613
12105 msgid "guestfs_sleep"
12109 #: ../src/guestfs-actions.pod:4615
12112 " int guestfs_sleep (guestfs_h *g,\n"
12118 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3566
12119 msgid "Sleep for C<secs> seconds."
12123 #: ../src/guestfs-actions.pod:4622 ../src/guestfs-structs.pod:109
12124 msgid "guestfs_stat"
12128 #: ../src/guestfs-actions.pod:4624
12131 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12132 "\t\tconst char *path);\n"
12137 #: ../src/guestfs-actions.pod:4629 ../fish/guestfish-actions.pod:3574
12138 msgid "This is the same as the C<stat(2)> system call."
12142 #: ../src/guestfs-actions.pod:4635 ../src/guestfs-structs.pod:135
12143 msgid "guestfs_statvfs"
12147 #: ../src/guestfs-actions.pod:4637
12150 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12151 "\t\tconst char *path);\n"
12156 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3580
12158 "Returns file system statistics for any mounted file system. C<path> should "
12159 "be a file or directory in the mounted file system (typically it is the mount "
12160 "point itself, but it doesn't need to be)."
12164 #: ../src/guestfs-actions.pod:4644 ../fish/guestfish-actions.pod:3584
12165 msgid "This is the same as the C<statvfs(2)> system call."
12169 #: ../src/guestfs-actions.pod:4646
12171 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12172 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12176 #: ../src/guestfs-actions.pod:4650
12177 msgid "guestfs_strings"
12181 #: ../src/guestfs-actions.pod:4652
12184 " char **guestfs_strings (guestfs_h *g,\n"
12185 "\t\tconst char *path);\n"
12190 #: ../src/guestfs-actions.pod:4655 ../fish/guestfish-actions.pod:3590
12192 "This runs the L<strings(1)> command on a file and returns the list of "
12193 "printable strings found."
12197 #: ../src/guestfs-actions.pod:4665
12198 msgid "guestfs_strings_e"
12202 #: ../src/guestfs-actions.pod:4667
12205 " char **guestfs_strings_e (guestfs_h *g,\n"
12206 "\t\tconst char *encoding,\n"
12207 "\t\tconst char *path);\n"
12212 #: ../src/guestfs-actions.pod:4671
12214 "This is like the C<guestfs_strings> command, but allows you to specify the "
12215 "encoding of strings that are looked for in the source file C<path>."
12219 #: ../src/guestfs-actions.pod:4675 ../fish/guestfish-actions.pod:3604
12220 msgid "Allowed encodings are:"
12224 #: ../src/guestfs-actions.pod:4679 ../fish/guestfish-actions.pod:3608
12229 #: ../src/guestfs-actions.pod:4681
12231 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12232 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12236 #: ../src/guestfs-actions.pod:4684 ../fish/guestfish-actions.pod:3613
12241 #: ../src/guestfs-actions.pod:4686 ../fish/guestfish-actions.pod:3615
12242 msgid "Single 8-bit-byte characters."
12246 #: ../src/guestfs-actions.pod:4688 ../fish/guestfish-actions.pod:3617
12251 #: ../src/guestfs-actions.pod:4690 ../fish/guestfish-actions.pod:3619
12252 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12256 #: ../src/guestfs-actions.pod:4693 ../fish/guestfish-actions.pod:3622
12257 msgid "l (lower case letter L)"
12261 #: ../src/guestfs-actions.pod:4695 ../fish/guestfish-actions.pod:3624
12263 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12264 "examining binaries in Windows guests."
12268 #: ../src/guestfs-actions.pod:4698 ../fish/guestfish-actions.pod:3627
12273 #: ../src/guestfs-actions.pod:4700 ../fish/guestfish-actions.pod:3629
12274 msgid "32-bit big endian such as UCS-4BE."
12278 #: ../src/guestfs-actions.pod:4702 ../fish/guestfish-actions.pod:3631
12283 #: ../src/guestfs-actions.pod:4704 ../fish/guestfish-actions.pod:3633
12284 msgid "32-bit little endian such as UCS-4LE."
12288 #: ../src/guestfs-actions.pod:4708 ../fish/guestfish-actions.pod:3637
12289 msgid "The returned strings are transcoded to UTF-8."
12293 #: ../src/guestfs-actions.pod:4717
12294 msgid "guestfs_swapoff_device"
12298 #: ../src/guestfs-actions.pod:4719
12301 " int guestfs_swapoff_device (guestfs_h *g,\n"
12302 "\t\tconst char *device);\n"
12307 #: ../src/guestfs-actions.pod:4722
12309 "This command disables the libguestfs appliance swap device or partition "
12310 "named C<device>. See C<guestfs_swapon_device>."
12314 #: ../src/guestfs-actions.pod:4728
12315 msgid "guestfs_swapoff_file"
12319 #: ../src/guestfs-actions.pod:4730
12322 " int guestfs_swapoff_file (guestfs_h *g,\n"
12323 "\t\tconst char *file);\n"
12328 #: ../src/guestfs-actions.pod:4733 ../fish/guestfish-actions.pod:3654
12329 msgid "This command disables the libguestfs appliance swap on file."
12333 #: ../src/guestfs-actions.pod:4737
12334 msgid "guestfs_swapoff_label"
12338 #: ../src/guestfs-actions.pod:4739
12341 " int guestfs_swapoff_label (guestfs_h *g,\n"
12342 "\t\tconst char *label);\n"
12347 #: ../src/guestfs-actions.pod:4742 ../fish/guestfish-actions.pod:3660
12349 "This command disables the libguestfs appliance swap on labeled swap "
12354 #: ../src/guestfs-actions.pod:4747
12355 msgid "guestfs_swapoff_uuid"
12359 #: ../src/guestfs-actions.pod:4749
12362 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12363 "\t\tconst char *uuid);\n"
12368 #: ../src/guestfs-actions.pod:4752 ../fish/guestfish-actions.pod:3667
12370 "This command disables the libguestfs appliance swap partition with the given "
12375 #: ../src/guestfs-actions.pod:4757
12376 msgid "guestfs_swapon_device"
12380 #: ../src/guestfs-actions.pod:4759
12383 " int guestfs_swapon_device (guestfs_h *g,\n"
12384 "\t\tconst char *device);\n"
12389 #: ../src/guestfs-actions.pod:4762
12391 "This command enables the libguestfs appliance to use the swap device or "
12392 "partition named C<device>. The increased memory is made available for all "
12393 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12397 #: ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:3679
12399 "Note that you should not swap to existing guest swap partitions unless you "
12400 "know what you are doing. They may contain hibernation information, or other "
12401 "information that the guest doesn't want you to trash. You also risk leaking "
12402 "information about the host to the guest this way. Instead, attach a new "
12403 "host device to the guest and swap on that."
12407 #: ../src/guestfs-actions.pod:4776
12408 msgid "guestfs_swapon_file"
12412 #: ../src/guestfs-actions.pod:4778
12415 " int guestfs_swapon_file (guestfs_h *g,\n"
12416 "\t\tconst char *file);\n"
12421 #: ../src/guestfs-actions.pod:4781
12423 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12428 #: ../src/guestfs-actions.pod:4786
12429 msgid "guestfs_swapon_label"
12433 #: ../src/guestfs-actions.pod:4788
12436 " int guestfs_swapon_label (guestfs_h *g,\n"
12437 "\t\tconst char *label);\n"
12442 #: ../src/guestfs-actions.pod:4791
12444 "This command enables swap to a labeled swap partition. See "
12445 "C<guestfs_swapon_device> for other notes."
12449 #: ../src/guestfs-actions.pod:4796
12450 msgid "guestfs_swapon_uuid"
12454 #: ../src/guestfs-actions.pod:4798
12457 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12458 "\t\tconst char *uuid);\n"
12463 #: ../src/guestfs-actions.pod:4801
12465 "This command enables swap to a swap partition with the given UUID. See "
12466 "C<guestfs_swapon_device> for other notes."
12470 #: ../src/guestfs-actions.pod:4806
12471 msgid "guestfs_sync"
12475 #: ../src/guestfs-actions.pod:4808
12478 " int guestfs_sync (guestfs_h *g);\n"
12483 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3711
12485 "This syncs the disk, so that any writes are flushed through to the "
12486 "underlying disk image."
12490 #: ../src/guestfs-actions.pod:4813 ../fish/guestfish-actions.pod:3714
12492 "You should always call this if you have modified a disk image, before "
12493 "closing the handle."
12497 #: ../src/guestfs-actions.pod:4818
12498 msgid "guestfs_tail"
12502 #: ../src/guestfs-actions.pod:4820
12505 " char **guestfs_tail (guestfs_h *g,\n"
12506 "\t\tconst char *path);\n"
12511 #: ../src/guestfs-actions.pod:4823 ../fish/guestfish-actions.pod:3721
12513 "This command returns up to the last 10 lines of a file as a list of strings."
12517 #: ../src/guestfs-actions.pod:4833
12518 msgid "guestfs_tail_n"
12522 #: ../src/guestfs-actions.pod:4835
12525 " char **guestfs_tail_n (guestfs_h *g,\n"
12526 "\t\tint nrlines,\n"
12527 "\t\tconst char *path);\n"
12532 #: ../src/guestfs-actions.pod:4839 ../fish/guestfish-actions.pod:3731
12534 "If the parameter C<nrlines> is a positive number, this returns the last "
12535 "C<nrlines> lines of the file C<path>."
12539 #: ../src/guestfs-actions.pod:4842 ../fish/guestfish-actions.pod:3734
12541 "If the parameter C<nrlines> is a negative number, this returns lines from "
12542 "the file C<path>, starting with the C<-nrlines>th line."
12546 #: ../src/guestfs-actions.pod:4854
12547 msgid "guestfs_tar_in"
12551 #: ../src/guestfs-actions.pod:4856
12554 " int guestfs_tar_in (guestfs_h *g,\n"
12555 "\t\tconst char *tarfile,\n"
12556 "\t\tconst char *directory);\n"
12561 #: ../src/guestfs-actions.pod:4860 ../fish/guestfish-actions.pod:3746
12563 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12564 "tar file) into C<directory>."
12568 #: ../src/guestfs-actions.pod:4863
12570 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12574 #: ../src/guestfs-actions.pod:4868
12575 msgid "guestfs_tar_out"
12579 #: ../src/guestfs-actions.pod:4870
12582 " int guestfs_tar_out (guestfs_h *g,\n"
12583 "\t\tconst char *directory,\n"
12584 "\t\tconst char *tarfile);\n"
12589 #: ../src/guestfs-actions.pod:4874 ../fish/guestfish-actions.pod:3758
12591 "This command packs the contents of C<directory> and downloads it to local "
12596 #: ../src/guestfs-actions.pod:4877
12598 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12599 "C<guestfs_txz_out>."
12603 #: ../src/guestfs-actions.pod:4882
12604 msgid "guestfs_tgz_in"
12608 #: ../src/guestfs-actions.pod:4884
12611 " int guestfs_tgz_in (guestfs_h *g,\n"
12612 "\t\tconst char *tarball,\n"
12613 "\t\tconst char *directory);\n"
12618 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3770
12620 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12621 "tar file) into C<directory>."
12625 #: ../src/guestfs-actions.pod:4891
12626 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12630 #: ../src/guestfs-actions.pod:4895
12631 msgid "guestfs_tgz_out"
12635 #: ../src/guestfs-actions.pod:4897
12638 " int guestfs_tgz_out (guestfs_h *g,\n"
12639 "\t\tconst char *directory,\n"
12640 "\t\tconst char *tarball);\n"
12645 #: ../src/guestfs-actions.pod:4901 ../fish/guestfish-actions.pod:3781
12647 "This command packs the contents of C<directory> and downloads it to local "
12652 #: ../src/guestfs-actions.pod:4904
12653 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12657 #: ../src/guestfs-actions.pod:4908
12658 msgid "guestfs_touch"
12662 #: ../src/guestfs-actions.pod:4910
12665 " int guestfs_touch (guestfs_h *g,\n"
12666 "\t\tconst char *path);\n"
12671 #: ../src/guestfs-actions.pod:4913 ../fish/guestfish-actions.pod:3792
12673 "Touch acts like the L<touch(1)> command. It can be used to update the "
12674 "timestamps on a file, or, if the file does not exist, to create a new zero-"
12679 #: ../src/guestfs-actions.pod:4917 ../fish/guestfish-actions.pod:3796
12681 "This command only works on regular files, and will fail on other file types "
12682 "such as directories, symbolic links, block special etc."
12686 #: ../src/guestfs-actions.pod:4922
12687 msgid "guestfs_truncate"
12691 #: ../src/guestfs-actions.pod:4924
12694 " int guestfs_truncate (guestfs_h *g,\n"
12695 "\t\tconst char *path);\n"
12700 #: ../src/guestfs-actions.pod:4927 ../fish/guestfish-actions.pod:3803
12702 "This command truncates C<path> to a zero-length file. The file must exist "
12707 #: ../src/guestfs-actions.pod:4932
12708 msgid "guestfs_truncate_size"
12712 #: ../src/guestfs-actions.pod:4934
12715 " int guestfs_truncate_size (guestfs_h *g,\n"
12716 "\t\tconst char *path,\n"
12717 "\t\tint64_t size);\n"
12722 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3810
12724 "This command truncates C<path> to size C<size> bytes. The file must exist "
12729 #: ../src/guestfs-actions.pod:4941
12731 "If the current file size is less than C<size> then the file is extended to "
12732 "the required size with zero bytes. This creates a sparse file (ie. disk "
12733 "blocks are not allocated for the file until you write to it). To create a "
12734 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
12738 #: ../src/guestfs-actions.pod:4949
12739 msgid "guestfs_tune2fs_l"
12743 #: ../src/guestfs-actions.pod:4951
12746 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
12747 "\t\tconst char *device);\n"
12752 #: ../src/guestfs-actions.pod:4954 ../fish/guestfish-actions.pod:3823
12754 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
12759 #: ../src/guestfs-actions.pod:4957 ../fish/guestfish-actions.pod:3826
12761 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
12762 "for more details. The list of fields returned isn't clearly defined, and "
12763 "depends on both the version of C<tune2fs> that libguestfs was built against, "
12764 "and the filesystem itself."
12768 #: ../src/guestfs-actions.pod:4968
12769 msgid "guestfs_txz_in"
12773 #: ../src/guestfs-actions.pod:4970
12776 " int guestfs_txz_in (guestfs_h *g,\n"
12777 "\t\tconst char *tarball,\n"
12778 "\t\tconst char *directory);\n"
12783 #: ../src/guestfs-actions.pod:4974 ../fish/guestfish-actions.pod:3835
12785 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
12786 "tar file) into C<directory>."
12790 #: ../src/guestfs-actions.pod:4979
12791 msgid "guestfs_txz_out"
12795 #: ../src/guestfs-actions.pod:4981
12798 " int guestfs_txz_out (guestfs_h *g,\n"
12799 "\t\tconst char *directory,\n"
12800 "\t\tconst char *tarball);\n"
12805 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3844
12807 "This command packs the contents of C<directory> and downloads it to local "
12808 "file C<tarball> (as an xz compressed tar archive)."
12812 #: ../src/guestfs-actions.pod:4990
12813 msgid "guestfs_umask"
12817 #: ../src/guestfs-actions.pod:4992
12820 " int guestfs_umask (guestfs_h *g,\n"
12826 #: ../src/guestfs-actions.pod:4995 ../fish/guestfish-actions.pod:3853
12828 "This function sets the mask used for creating new files and device nodes to "
12833 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3856
12835 "Typical umask values would be C<022> which creates new files with "
12836 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
12837 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
12841 #: ../src/guestfs-actions.pod:5003 ../fish/guestfish-actions.pod:3861
12843 "The default umask is C<022>. This is important because it means that "
12844 "directories and device nodes will be created with C<0644> or C<0755> mode "
12845 "even if you specify C<0777>."
12849 #: ../src/guestfs-actions.pod:5007
12851 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
12852 "C<guestfs_mkdir>."
12856 #: ../src/guestfs-actions.pod:5010 ../fish/guestfish-actions.pod:3868
12857 msgid "This call returns the previous umask."
12861 #: ../src/guestfs-actions.pod:5014
12862 msgid "guestfs_umount"
12866 #: ../src/guestfs-actions.pod:5016
12869 " int guestfs_umount (guestfs_h *g,\n"
12870 "\t\tconst char *pathordevice);\n"
12875 #: ../src/guestfs-actions.pod:5019 ../fish/guestfish-actions.pod:3874
12877 "This unmounts the given filesystem. The filesystem may be specified either "
12878 "by its mountpoint (path) or the device which contains the filesystem."
12882 #: ../src/guestfs-actions.pod:5025
12883 msgid "guestfs_umount_all"
12887 #: ../src/guestfs-actions.pod:5027
12890 " int guestfs_umount_all (guestfs_h *g);\n"
12895 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3882
12896 msgid "This unmounts all mounted filesystems."
12900 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3884
12901 msgid "Some internal mounts are not unmounted by this call."
12905 #: ../src/guestfs-actions.pod:5035
12906 msgid "guestfs_upload"
12910 #: ../src/guestfs-actions.pod:5037
12913 " int guestfs_upload (guestfs_h *g,\n"
12914 "\t\tconst char *filename,\n"
12915 "\t\tconst char *remotefilename);\n"
12920 #: ../src/guestfs-actions.pod:5041 ../fish/guestfish-actions.pod:3890
12921 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
12925 #: ../src/guestfs-actions.pod:5046
12926 msgid "See also C<guestfs_download>."
12930 #: ../src/guestfs-actions.pod:5050
12931 msgid "guestfs_utimens"
12935 #: ../src/guestfs-actions.pod:5052
12938 " int guestfs_utimens (guestfs_h *g,\n"
12939 "\t\tconst char *path,\n"
12940 "\t\tint64_t atsecs,\n"
12941 "\t\tint64_t atnsecs,\n"
12942 "\t\tint64_t mtsecs,\n"
12943 "\t\tint64_t mtnsecs);\n"
12948 #: ../src/guestfs-actions.pod:5059 ../fish/guestfish-actions.pod:3903
12949 msgid "This command sets the timestamps of a file with nanosecond precision."
12953 #: ../src/guestfs-actions.pod:5062 ../fish/guestfish-actions.pod:3906
12955 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
12960 #: ../src/guestfs-actions.pod:5065 ../fish/guestfish-actions.pod:3909
12962 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
12963 "nanoseconds from the epoch."
12967 #: ../src/guestfs-actions.pod:5068 ../fish/guestfish-actions.pod:3912
12969 "If the C<*nsecs> field contains the special value C<-1> then the "
12970 "corresponding timestamp is set to the current time. (The C<*secs> field is "
12971 "ignored in this case)."
12975 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3916
12977 "If the C<*nsecs> field contains the special value C<-2> then the "
12978 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
12983 #: ../src/guestfs-actions.pod:5078 ../src/guestfs-structs.pod:175
12984 msgid "guestfs_version"
12988 #: ../src/guestfs-actions.pod:5080
12991 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
12996 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3924
12998 "Return the libguestfs version number that the program is linked against."
13002 #: ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3927
13004 "Note that because of dynamic linking this is not necessarily the version of "
13005 "libguestfs that you compiled against. You can compile the program, and then "
13006 "at runtime dynamically link against a completely different C<libguestfs.so> "
13011 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3932
13013 "This call was added in version C<1.0.58>. In previous versions of "
13014 "libguestfs there was no way to get the version number. From C code you can "
13015 "use dynamic linker functions to find out if this symbol exists (if it "
13016 "doesn't, then it's an earlier version)."
13020 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3938
13022 "The call returns a structure with four elements. The first three (C<major>, "
13023 "C<minor> and C<release>) are numbers and correspond to the usual version "
13024 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13025 "but may be used for distro-specific information."
13029 #: ../src/guestfs-actions.pod:5102 ../fish/guestfish-actions.pod:3944
13031 "To construct the original version string: C<$major.$minor.$release$extra>"
13035 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3947
13036 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13040 #: ../src/guestfs-actions.pod:5107
13042 "I<Note:> Don't use this call to test for availability of features. In "
13043 "enterprise distributions we backport features from later versions into "
13044 "earlier versions, making this an unreliable way to test for features. Use "
13045 "C<guestfs_available> instead."
13049 #: ../src/guestfs-actions.pod:5113
13051 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13052 "error. I<The caller must call C<guestfs_free_version> after use>."
13056 #: ../src/guestfs-actions.pod:5117
13057 msgid "guestfs_vfs_label"
13061 #: ../src/guestfs-actions.pod:5119
13064 " char *guestfs_vfs_label (guestfs_h *g,\n"
13065 "\t\tconst char *device);\n"
13070 #: ../src/guestfs-actions.pod:5122 ../fish/guestfish-actions.pod:3959
13071 msgid "This returns the filesystem label of the filesystem on C<device>."
13075 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3962
13076 msgid "If the filesystem is unlabeled, this returns the empty string."
13080 #: ../src/guestfs-actions.pod:5127
13081 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13085 #: ../src/guestfs-actions.pod:5132
13086 msgid "guestfs_vfs_type"
13090 #: ../src/guestfs-actions.pod:5134
13093 " char *guestfs_vfs_type (guestfs_h *g,\n"
13094 "\t\tconst char *device);\n"
13099 #: ../src/guestfs-actions.pod:5137 ../fish/guestfish-actions.pod:3970
13101 "This command gets the filesystem type corresponding to the filesystem on "
13106 #: ../src/guestfs-actions.pod:5140 ../fish/guestfish-actions.pod:3973
13108 "For most filesystems, the result is the name of the Linux VFS module which "
13109 "would be used to mount this filesystem if you mounted it without specifying "
13110 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13114 #: ../src/guestfs-actions.pod:5148
13115 msgid "guestfs_vfs_uuid"
13119 #: ../src/guestfs-actions.pod:5150
13122 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13123 "\t\tconst char *device);\n"
13128 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3982
13129 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13133 #: ../src/guestfs-actions.pod:5156 ../fish/guestfish-actions.pod:3985
13134 msgid "If the filesystem does not have a UUID, this returns the empty string."
13138 #: ../src/guestfs-actions.pod:5158
13139 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13143 #: ../src/guestfs-actions.pod:5163
13144 msgid "guestfs_vg_activate"
13148 #: ../src/guestfs-actions.pod:5165
13151 " int guestfs_vg_activate (guestfs_h *g,\n"
13152 "\t\tint activate,\n"
13153 "\t\tchar *const *volgroups);\n"
13158 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:3993
13160 "This command activates or (if C<activate> is false) deactivates all logical "
13161 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13162 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13163 "deactivated, then those devices disappear."
13167 #: ../src/guestfs-actions.pod:5175 ../fish/guestfish-actions.pod:3999
13168 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13172 #: ../src/guestfs-actions.pod:5177 ../fish/guestfish-actions.pod:4001
13174 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13175 "activated or deactivated."
13179 #: ../src/guestfs-actions.pod:5182
13180 msgid "guestfs_vg_activate_all"
13184 #: ../src/guestfs-actions.pod:5184
13187 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13188 "\t\tint activate);\n"
13193 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:4008
13195 "This command activates or (if C<activate> is false) deactivates all logical "
13196 "volumes in all volume groups. If activated, then they are made known to the "
13197 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13198 "those devices disappear."
13202 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:4014
13203 msgid "This command is the same as running C<vgchange -a y|n>"
13207 #: ../src/guestfs-actions.pod:5197
13208 msgid "guestfs_vgcreate"
13212 #: ../src/guestfs-actions.pod:5199
13215 " int guestfs_vgcreate (guestfs_h *g,\n"
13216 "\t\tconst char *volgroup,\n"
13217 "\t\tchar *const *physvols);\n"
13222 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:4020
13224 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13225 "of physical volumes C<physvols>."
13229 #: ../src/guestfs-actions.pod:5208
13230 msgid "guestfs_vglvuuids"
13234 #: ../src/guestfs-actions.pod:5210
13237 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13238 "\t\tconst char *vgname);\n"
13243 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:4027
13245 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13246 "volumes created in this volume group."
13250 #: ../src/guestfs-actions.pod:5216
13252 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13253 "associate logical volumes and volume groups."
13257 #: ../src/guestfs-actions.pod:5219
13258 msgid "See also C<guestfs_vgpvuuids>."
13262 #: ../src/guestfs-actions.pod:5225
13263 msgid "guestfs_vgpvuuids"
13267 #: ../src/guestfs-actions.pod:5227
13270 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13271 "\t\tconst char *vgname);\n"
13276 #: ../src/guestfs-actions.pod:5230 ../fish/guestfish-actions.pod:4039
13278 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13279 "volumes that this volume group resides on."
13283 #: ../src/guestfs-actions.pod:5233
13285 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13286 "associate physical volumes and volume groups."
13290 #: ../src/guestfs-actions.pod:5236
13291 msgid "See also C<guestfs_vglvuuids>."
13295 #: ../src/guestfs-actions.pod:5242
13296 msgid "guestfs_vgremove"
13300 #: ../src/guestfs-actions.pod:5244
13303 " int guestfs_vgremove (guestfs_h *g,\n"
13304 "\t\tconst char *vgname);\n"
13309 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:4051
13310 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13314 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:4053
13316 "This also forcibly removes all logical volumes in the volume group (if any)."
13320 #: ../src/guestfs-actions.pod:5254
13321 msgid "guestfs_vgrename"
13325 #: ../src/guestfs-actions.pod:5256
13328 " int guestfs_vgrename (guestfs_h *g,\n"
13329 "\t\tconst char *volgroup,\n"
13330 "\t\tconst char *newvolgroup);\n"
13335 #: ../src/guestfs-actions.pod:5260 ../fish/guestfish-actions.pod:4060
13336 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
13340 #: ../src/guestfs-actions.pod:5264
13341 msgid "guestfs_vgs"
13345 #: ../src/guestfs-actions.pod:5266
13348 " char **guestfs_vgs (guestfs_h *g);\n"
13353 #: ../src/guestfs-actions.pod:5268 ../fish/guestfish-actions.pod:4066
13355 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
13360 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:4069
13362 "This returns a list of just the volume group names that were detected (eg. "
13367 #: ../src/guestfs-actions.pod:5274
13368 msgid "See also C<guestfs_vgs_full>."
13372 #: ../src/guestfs-actions.pod:5280
13373 msgid "guestfs_vgs_full"
13377 #: ../src/guestfs-actions.pod:5282
13380 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13385 #: ../src/guestfs-actions.pod:5284 ../fish/guestfish-actions.pod:4078
13387 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
13388 "> command. The \"full\" version includes all fields."
13392 #: ../src/guestfs-actions.pod:5287
13394 "This function returns a C<struct guestfs_lvm_vg_list *> (see E<lt>guestfs-"
13395 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
13396 "C<guestfs_free_lvm_vg_list> after use>."
13400 #: ../src/guestfs-actions.pod:5292
13401 msgid "guestfs_vgscan"
13405 #: ../src/guestfs-actions.pod:5294
13408 " int guestfs_vgscan (guestfs_h *g);\n"
13413 #: ../src/guestfs-actions.pod:5296 ../fish/guestfish-actions.pod:4085
13415 "This rescans all block devices and rebuilds the list of LVM physical "
13416 "volumes, volume groups and logical volumes."
13420 #: ../src/guestfs-actions.pod:5301
13421 msgid "guestfs_vguuid"
13425 #: ../src/guestfs-actions.pod:5303
13428 " char *guestfs_vguuid (guestfs_h *g,\n"
13429 "\t\tconst char *vgname);\n"
13434 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:4092
13435 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13439 #: ../src/guestfs-actions.pod:5311
13440 msgid "guestfs_wait_ready"
13444 #: ../src/guestfs-actions.pod:5313
13447 " int guestfs_wait_ready (guestfs_h *g);\n"
13452 #: ../src/guestfs-actions.pod:5315
13453 msgid "This function is a no op."
13457 #: ../src/guestfs-actions.pod:5317
13459 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13460 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13461 "is no longer necessary because C<guestfs_launch> now does the waiting."
13465 #: ../src/guestfs-actions.pod:5322
13467 "If you see any calls to this function in code then you can just remove them, "
13468 "unless you want to retain compatibility with older versions of the API."
13472 #: ../src/guestfs-actions.pod:5328
13473 msgid "guestfs_wc_c"
13477 #: ../src/guestfs-actions.pod:5330
13480 " int guestfs_wc_c (guestfs_h *g,\n"
13481 "\t\tconst char *path);\n"
13486 #: ../src/guestfs-actions.pod:5333 ../fish/guestfish-actions.pod:4098
13488 "This command counts the characters in a file, using the C<wc -c> external "
13493 #: ../src/guestfs-actions.pod:5338
13494 msgid "guestfs_wc_l"
13498 #: ../src/guestfs-actions.pod:5340
13501 " int guestfs_wc_l (guestfs_h *g,\n"
13502 "\t\tconst char *path);\n"
13507 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4105
13509 "This command counts the lines in a file, using the C<wc -l> external command."
13513 #: ../src/guestfs-actions.pod:5348
13514 msgid "guestfs_wc_w"
13518 #: ../src/guestfs-actions.pod:5350
13521 " int guestfs_wc_w (guestfs_h *g,\n"
13522 "\t\tconst char *path);\n"
13527 #: ../src/guestfs-actions.pod:5353 ../fish/guestfish-actions.pod:4112
13529 "This command counts the words in a file, using the C<wc -w> external command."
13533 #: ../src/guestfs-actions.pod:5358
13534 msgid "guestfs_write"
13538 #: ../src/guestfs-actions.pod:5360
13541 " int guestfs_write (guestfs_h *g,\n"
13542 "\t\tconst char *path,\n"
13543 "\t\tconst char *content,\n"
13544 "\t\tsize_t content_size);\n"
13549 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:4119
13551 "This call creates a file called C<path>. The content of the file is the "
13552 "string C<content> (which can contain any 8 bit data)."
13556 #: ../src/guestfs-actions.pod:5373
13557 msgid "guestfs_write_file"
13561 #: ../src/guestfs-actions.pod:5375
13564 " int guestfs_write_file (guestfs_h *g,\n"
13565 "\t\tconst char *path,\n"
13566 "\t\tconst char *content,\n"
13572 #: ../src/guestfs-actions.pod:5380 ../fish/guestfish-actions.pod:4129
13574 "This call creates a file called C<path>. The contents of the file is the "
13575 "string C<content> (which can contain any 8 bit data), with length C<size>."
13579 #: ../src/guestfs-actions.pod:5384 ../fish/guestfish-actions.pod:4133
13581 "As a special case, if C<size> is C<0> then the length is calculated using "
13582 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13586 #: ../src/guestfs-actions.pod:5388 ../fish/guestfish-actions.pod:4137
13588 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13589 "I<not> work, even if the length is specified."
13593 #: ../src/guestfs-actions.pod:5396 ../fish/guestfish-actions.pod:4143
13595 "This function is deprecated. In new code, use the C<write> call instead."
13599 #: ../src/guestfs-actions.pod:5403
13600 msgid "guestfs_zegrep"
13604 #: ../src/guestfs-actions.pod:5405
13607 " char **guestfs_zegrep (guestfs_h *g,\n"
13608 "\t\tconst char *regex,\n"
13609 "\t\tconst char *path);\n"
13614 #: ../src/guestfs-actions.pod:5409 ../fish/guestfish-actions.pod:4154
13616 "This calls the external C<zegrep> program and returns the matching lines."
13620 #: ../src/guestfs-actions.pod:5419
13621 msgid "guestfs_zegrepi"
13625 #: ../src/guestfs-actions.pod:5421
13628 " char **guestfs_zegrepi (guestfs_h *g,\n"
13629 "\t\tconst char *regex,\n"
13630 "\t\tconst char *path);\n"
13635 #: ../src/guestfs-actions.pod:5425 ../fish/guestfish-actions.pod:4164
13637 "This calls the external C<zegrep -i> program and returns the matching lines."
13641 #: ../src/guestfs-actions.pod:5435
13642 msgid "guestfs_zero"
13646 #: ../src/guestfs-actions.pod:5437
13649 " int guestfs_zero (guestfs_h *g,\n"
13650 "\t\tconst char *device);\n"
13655 #: ../src/guestfs-actions.pod:5440 ../fish/guestfish-actions.pod:4174
13656 msgid "This command writes zeroes over the first few blocks of C<device>."
13660 #: ../src/guestfs-actions.pod:5442 ../fish/guestfish-actions.pod:4176
13662 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13663 "securely wipe the device). It should be sufficient to remove any partition "
13664 "tables, filesystem superblocks and so on."
13668 #: ../src/guestfs-actions.pod:5446
13669 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13673 #: ../src/guestfs-actions.pod:5455
13674 msgid "guestfs_zero_device"
13678 #: ../src/guestfs-actions.pod:5457
13681 " int guestfs_zero_device (guestfs_h *g,\n"
13682 "\t\tconst char *device);\n"
13687 #: ../src/guestfs-actions.pod:5460
13689 "This command writes zeroes over the entire C<device>. Compare with "
13690 "C<guestfs_zero> which just zeroes the first few blocks of a device."
13694 #: ../src/guestfs-actions.pod:5474
13695 msgid "guestfs_zerofree"
13699 #: ../src/guestfs-actions.pod:5476
13702 " int guestfs_zerofree (guestfs_h *g,\n"
13703 "\t\tconst char *device);\n"
13708 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:4197
13710 "This runs the I<zerofree> program on C<device>. This program claims to zero "
13711 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
13712 "possible to compress the filesystem more effectively."
13716 #: ../src/guestfs-actions.pod:5484 ../fish/guestfish-actions.pod:4202
13717 msgid "You should B<not> run this program if the filesystem is mounted."
13721 #: ../src/guestfs-actions.pod:5487 ../fish/guestfish-actions.pod:4205
13723 "It is possible that using this program can damage the filesystem or data on "
13728 #: ../src/guestfs-actions.pod:5492
13729 msgid "guestfs_zfgrep"
13733 #: ../src/guestfs-actions.pod:5494
13736 " char **guestfs_zfgrep (guestfs_h *g,\n"
13737 "\t\tconst char *pattern,\n"
13738 "\t\tconst char *path);\n"
13743 #: ../src/guestfs-actions.pod:5498 ../fish/guestfish-actions.pod:4212
13745 "This calls the external C<zfgrep> program and returns the matching lines."
13749 #: ../src/guestfs-actions.pod:5508
13750 msgid "guestfs_zfgrepi"
13754 #: ../src/guestfs-actions.pod:5510
13757 " char **guestfs_zfgrepi (guestfs_h *g,\n"
13758 "\t\tconst char *pattern,\n"
13759 "\t\tconst char *path);\n"
13764 #: ../src/guestfs-actions.pod:5514 ../fish/guestfish-actions.pod:4222
13766 "This calls the external C<zfgrep -i> program and returns the matching lines."
13770 #: ../src/guestfs-actions.pod:5524
13771 msgid "guestfs_zfile"
13775 #: ../src/guestfs-actions.pod:5526
13778 " char *guestfs_zfile (guestfs_h *g,\n"
13779 "\t\tconst char *meth,\n"
13780 "\t\tconst char *path);\n"
13785 #: ../src/guestfs-actions.pod:5530 ../fish/guestfish-actions.pod:4232
13787 "This command runs C<file> after first decompressing C<path> using C<method>."
13791 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:4235
13792 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
13796 #: ../src/guestfs-actions.pod:5535
13798 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
13803 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:4240
13805 "This function is deprecated. In new code, use the C<file> call instead."
13809 #: ../src/guestfs-actions.pod:5548
13810 msgid "guestfs_zgrep"
13814 #: ../src/guestfs-actions.pod:5550
13817 " char **guestfs_zgrep (guestfs_h *g,\n"
13818 "\t\tconst char *regex,\n"
13819 "\t\tconst char *path);\n"
13824 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:4251
13826 "This calls the external C<zgrep> program and returns the matching lines."
13830 #: ../src/guestfs-actions.pod:5564
13831 msgid "guestfs_zgrepi"
13835 #: ../src/guestfs-actions.pod:5566
13838 " char **guestfs_zgrepi (guestfs_h *g,\n"
13839 "\t\tconst char *regex,\n"
13840 "\t\tconst char *path);\n"
13845 #: ../src/guestfs-actions.pod:5570 ../fish/guestfish-actions.pod:4261
13847 "This calls the external C<zgrep -i> program and returns the matching lines."
13851 #: ../src/guestfs-availability.pod:3
13856 #: ../src/guestfs-availability.pod:5
13858 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
13859 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
13860 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
13861 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
13862 "L</guestfs_aug_save> L</guestfs_aug_set>"
13866 #: ../src/guestfs-availability.pod:21
13871 #: ../src/guestfs-availability.pod:23
13873 "The following functions: L</guestfs_inotify_add_watch> L</"
13874 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
13875 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
13879 #: ../src/guestfs-availability.pod:31
13880 msgid "B<linuxfsuuid>"
13884 #: ../src/guestfs-availability.pod:33
13886 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
13887 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
13891 #: ../src/guestfs-availability.pod:40
13892 msgid "B<linuxmodules>"
13896 #: ../src/guestfs-availability.pod:42
13897 msgid "The following functions: L</guestfs_modprobe>"
13901 #: ../src/guestfs-availability.pod:45
13902 msgid "B<linuxxattrs>"
13906 #: ../src/guestfs-availability.pod:47
13908 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
13909 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
13910 "guestfs_removexattr> L</guestfs_setxattr>"
13914 #: ../src/guestfs-availability.pod:56
13919 #: ../src/guestfs-availability.pod:58
13921 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
13922 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
13923 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
13927 #: ../src/guestfs-availability.pod:67
13932 #: ../src/guestfs-availability.pod:69
13934 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
13935 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
13936 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
13937 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
13938 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
13939 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
13940 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
13944 #: ../src/guestfs-availability.pod:92
13949 #: ../src/guestfs-availability.pod:94
13951 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
13952 "guestfs_mknod_b> L</guestfs_mknod_c>"
13956 #: ../src/guestfs-availability.pod:100
13961 #: ../src/guestfs-availability.pod:102
13962 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
13966 #: ../src/guestfs-availability.pod:105
13967 msgid "B<ntfsprogs>"
13971 #: ../src/guestfs-availability.pod:107
13973 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
13977 #: ../src/guestfs-availability.pod:111
13978 msgid "B<realpath>"
13982 #: ../src/guestfs-availability.pod:113
13983 msgid "The following functions: L</guestfs_realpath>"
13987 #: ../src/guestfs-availability.pod:116
13992 #: ../src/guestfs-availability.pod:118
13994 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
13995 "guestfs_scrub_freespace>"
13999 #: ../src/guestfs-availability.pod:123
14004 #: ../src/guestfs-availability.pod:125
14005 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14009 #: ../src/guestfs-availability.pod:129
14014 #: ../src/guestfs-availability.pod:131
14015 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14019 #: ../src/guestfs-availability.pod:135
14020 msgid "B<zerofree>"
14024 #: ../src/guestfs-availability.pod:137
14025 msgid "The following functions: L</guestfs_zerofree>"
14029 #: ../src/guestfs-structs.pod:1
14030 msgid "guestfs_int_bool"
14034 #: ../src/guestfs-structs.pod:3
14037 " struct guestfs_int_bool {\n"
14045 #: ../src/guestfs-structs.pod:8
14048 " struct guestfs_int_bool_list {\n"
14049 " uint32_t len; /* Number of elements in list. */\n"
14050 " struct guestfs_int_bool *val; /* Elements. */\n"
14056 #: ../src/guestfs-structs.pod:13
14059 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14060 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14065 #: ../src/guestfs-structs.pod:16
14066 msgid "guestfs_lvm_pv"
14070 #: ../src/guestfs-structs.pod:18
14073 " struct guestfs_lvm_pv {\n"
14074 " char *pv_name;\n"
14075 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14076 " char pv_uuid[32];\n"
14078 " uint64_t pv_size;\n"
14079 " uint64_t dev_size;\n"
14080 " uint64_t pv_free;\n"
14081 " uint64_t pv_used;\n"
14082 " char *pv_attr;\n"
14083 " int64_t pv_pe_count;\n"
14084 " int64_t pv_pe_alloc_count;\n"
14085 " char *pv_tags;\n"
14086 " uint64_t pe_start;\n"
14087 " int64_t pv_mda_count;\n"
14088 " uint64_t pv_mda_free;\n"
14094 #: ../src/guestfs-structs.pod:36
14097 " struct guestfs_lvm_pv_list {\n"
14098 " uint32_t len; /* Number of elements in list. */\n"
14099 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14105 #: ../src/guestfs-structs.pod:41
14108 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14109 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14114 #: ../src/guestfs-structs.pod:44
14115 msgid "guestfs_lvm_vg"
14119 #: ../src/guestfs-structs.pod:46
14122 " struct guestfs_lvm_vg {\n"
14123 " char *vg_name;\n"
14124 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14125 " char vg_uuid[32];\n"
14127 " char *vg_attr;\n"
14128 " uint64_t vg_size;\n"
14129 " uint64_t vg_free;\n"
14130 " char *vg_sysid;\n"
14131 " uint64_t vg_extent_size;\n"
14132 " int64_t vg_extent_count;\n"
14133 " int64_t vg_free_count;\n"
14134 " int64_t max_lv;\n"
14135 " int64_t max_pv;\n"
14136 " int64_t pv_count;\n"
14137 " int64_t lv_count;\n"
14138 " int64_t snap_count;\n"
14139 " int64_t vg_seqno;\n"
14140 " char *vg_tags;\n"
14141 " int64_t vg_mda_count;\n"
14142 " uint64_t vg_mda_free;\n"
14148 #: ../src/guestfs-structs.pod:69
14151 " struct guestfs_lvm_vg_list {\n"
14152 " uint32_t len; /* Number of elements in list. */\n"
14153 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14159 #: ../src/guestfs-structs.pod:74
14162 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14163 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14168 #: ../src/guestfs-structs.pod:77
14169 msgid "guestfs_lvm_lv"
14173 #: ../src/guestfs-structs.pod:79
14176 " struct guestfs_lvm_lv {\n"
14177 " char *lv_name;\n"
14178 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14179 " char lv_uuid[32];\n"
14180 " char *lv_attr;\n"
14181 " int64_t lv_major;\n"
14182 " int64_t lv_minor;\n"
14183 " int64_t lv_kernel_major;\n"
14184 " int64_t lv_kernel_minor;\n"
14185 " uint64_t lv_size;\n"
14186 " int64_t seg_count;\n"
14188 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14189 " float snap_percent;\n"
14190 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14191 " float copy_percent;\n"
14192 " char *move_pv;\n"
14193 " char *lv_tags;\n"
14194 " char *mirror_log;\n"
14195 " char *modules;\n"
14201 #: ../src/guestfs-structs.pod:101
14204 " struct guestfs_lvm_lv_list {\n"
14205 " uint32_t len; /* Number of elements in list. */\n"
14206 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14212 #: ../src/guestfs-structs.pod:106
14215 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14216 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14221 #: ../src/guestfs-structs.pod:111
14224 " struct guestfs_stat {\n"
14228 " int64_t nlink;\n"
14233 " int64_t blksize;\n"
14234 " int64_t blocks;\n"
14235 " int64_t atime;\n"
14236 " int64_t mtime;\n"
14237 " int64_t ctime;\n"
14243 #: ../src/guestfs-structs.pod:127
14246 " struct guestfs_stat_list {\n"
14247 " uint32_t len; /* Number of elements in list. */\n"
14248 " struct guestfs_stat *val; /* Elements. */\n"
14254 #: ../src/guestfs-structs.pod:132
14257 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14258 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14263 #: ../src/guestfs-structs.pod:137
14266 " struct guestfs_statvfs {\n"
14267 " int64_t bsize;\n"
14268 " int64_t frsize;\n"
14269 " int64_t blocks;\n"
14270 " int64_t bfree;\n"
14271 " int64_t bavail;\n"
14272 " int64_t files;\n"
14273 " int64_t ffree;\n"
14274 " int64_t favail;\n"
14277 " int64_t namemax;\n"
14283 #: ../src/guestfs-structs.pod:151
14286 " struct guestfs_statvfs_list {\n"
14287 " uint32_t len; /* Number of elements in list. */\n"
14288 " struct guestfs_statvfs *val; /* Elements. */\n"
14294 #: ../src/guestfs-structs.pod:156
14297 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14298 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14303 #: ../src/guestfs-structs.pod:159
14304 msgid "guestfs_dirent"
14308 #: ../src/guestfs-structs.pod:161
14311 " struct guestfs_dirent {\n"
14320 #: ../src/guestfs-structs.pod:167
14323 " struct guestfs_dirent_list {\n"
14324 " uint32_t len; /* Number of elements in list. */\n"
14325 " struct guestfs_dirent *val; /* Elements. */\n"
14331 #: ../src/guestfs-structs.pod:172
14334 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
14335 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
14340 #: ../src/guestfs-structs.pod:177
14343 " struct guestfs_version {\n"
14344 " int64_t major;\n"
14345 " int64_t minor;\n"
14346 " int64_t release;\n"
14353 #: ../src/guestfs-structs.pod:184
14356 " struct guestfs_version_list {\n"
14357 " uint32_t len; /* Number of elements in list. */\n"
14358 " struct guestfs_version *val; /* Elements. */\n"
14364 #: ../src/guestfs-structs.pod:189
14367 " void guestfs_free_version (struct guestfs_free_version *);\n"
14368 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14373 #: ../src/guestfs-structs.pod:192
14374 msgid "guestfs_xattr"
14378 #: ../src/guestfs-structs.pod:194
14381 " struct guestfs_xattr {\n"
14382 " char *attrname;\n"
14383 " /* The next two fields describe a byte array. */\n"
14384 " uint32_t attrval_len;\n"
14385 " char *attrval;\n"
14391 #: ../src/guestfs-structs.pod:201
14394 " struct guestfs_xattr_list {\n"
14395 " uint32_t len; /* Number of elements in list. */\n"
14396 " struct guestfs_xattr *val; /* Elements. */\n"
14402 #: ../src/guestfs-structs.pod:206
14405 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14406 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14411 #: ../src/guestfs-structs.pod:209
14412 msgid "guestfs_inotify_event"
14416 #: ../src/guestfs-structs.pod:211
14419 " struct guestfs_inotify_event {\n"
14420 " int64_t in_wd;\n"
14421 " uint32_t in_mask;\n"
14422 " uint32_t in_cookie;\n"
14423 " char *in_name;\n"
14429 #: ../src/guestfs-structs.pod:218
14432 " struct guestfs_inotify_event_list {\n"
14433 " uint32_t len; /* Number of elements in list. */\n"
14434 " struct guestfs_inotify_event *val; /* Elements. */\n"
14440 #: ../src/guestfs-structs.pod:223
14443 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14444 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
14449 #: ../src/guestfs-structs.pod:226
14450 msgid "guestfs_partition"
14454 #: ../src/guestfs-structs.pod:228
14457 " struct guestfs_partition {\n"
14458 " int32_t part_num;\n"
14459 " uint64_t part_start;\n"
14460 " uint64_t part_end;\n"
14461 " uint64_t part_size;\n"
14467 #: ../src/guestfs-structs.pod:235
14470 " struct guestfs_partition_list {\n"
14471 " uint32_t len; /* Number of elements in list. */\n"
14472 " struct guestfs_partition *val; /* Elements. */\n"
14478 #: ../src/guestfs-structs.pod:240
14481 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14482 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14487 #: ../fish/guestfish.pod:5
14488 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14492 #: ../fish/guestfish.pod:9
14495 " guestfish [--options] [commands]\n"
14500 #: ../fish/guestfish.pod:11
14508 #: ../fish/guestfish.pod:13
14511 " guestfish -a disk.img\n"
14516 #: ../fish/guestfish.pod:15
14519 " guestfish -a disk.img -m dev[:mountpoint]\n"
14524 #: ../fish/guestfish.pod:17
14527 " guestfish -d libvirt-domain\n"
14532 #: ../fish/guestfish.pod:19
14535 " guestfish -a disk.img -i\n"
14540 #: ../fish/guestfish.pod:21
14543 " guestfish -d libvirt-domain -i\n"
14548 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:11 ../tools/virt-edit.pl:45
14549 #: ../tools/virt-rescue.pl:41 ../tools/virt-tar.pl:60
14550 #: ../tools/virt-win-reg.pl:52
14555 #: ../fish/guestfish.pod:25
14557 "Using guestfish in read/write mode on live virtual machines can be "
14558 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14559 "option to use guestfish safely if the disk image or virtual machine might be "
14564 #: ../fish/guestfish.pod:30 ../fish/guestfish.pod:729
14565 #: ../fuse/guestmount.pod:35 ../tools/virt-cat.pl:51 ../tools/virt-edit.pl:59
14566 #: ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:46
14571 #: ../fish/guestfish.pod:32
14572 msgid "As an interactive shell"
14576 #: ../fish/guestfish.pod:34
14584 #: ../fish/guestfish.pod:36
14587 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14588 " editing virtual machine filesystems.\n"
14593 #: ../fish/guestfish.pod:39
14596 " Type: 'help' for a list of commands\n"
14597 " 'man' to read the manual\n"
14598 " 'quit' to quit the shell\n"
14603 #: ../fish/guestfish.pod:43
14611 #: ../fish/guestfish.pod:45
14612 msgid "From shell scripts"
14616 #: ../fish/guestfish.pod:47
14617 msgid "Create a new C</etc/motd> file in a guest:"
14621 #: ../fish/guestfish.pod:49
14624 " guestfish <<_EOF_\n"
14627 " mount /dev/vg_guest/lv_root /\n"
14628 " write /etc/motd \"Welcome, new users\"\n"
14634 #: ../fish/guestfish.pod:56
14635 msgid "List the LVM logical volumes in a guest:"
14639 #: ../fish/guestfish.pod:58
14642 " guestfish -a disk.img --ro <<_EOF_\n"
14650 #: ../fish/guestfish.pod:63
14651 msgid "On one command line"
14655 #: ../fish/guestfish.pod:65
14656 msgid "Update C</etc/resolv.conf> in a guest:"
14660 #: ../fish/guestfish.pod:67
14664 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
14665 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
14670 #: ../fish/guestfish.pod:71
14671 msgid "Edit C</boot/grub/grub.conf> interactively:"
14675 #: ../fish/guestfish.pod:73
14678 " guestfish --add disk.img \\\n"
14679 " --mount /dev/vg_guest/lv_root \\\n"
14680 " --mount /dev/sda1:/boot \\\n"
14681 " edit /boot/grub/grub.conf\n"
14686 #: ../fish/guestfish.pod:78
14687 msgid "Mount disks automatically"
14691 #: ../fish/guestfish.pod:80
14693 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
14697 #: ../fish/guestfish.pod:83
14700 " guestfish --ro -a disk.img -i cat /etc/group\n"
14705 #: ../fish/guestfish.pod:85
14708 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
14713 #: ../fish/guestfish.pod:87
14714 msgid "As a script interpreter"
14718 #: ../fish/guestfish.pod:89
14719 msgid "Create a 100MB disk containing an ext2-formatted partition:"
14723 #: ../fish/guestfish.pod:91
14726 " #!/usr/bin/guestfish -f\n"
14727 " sparse test1.img 100M\n"
14729 " part-disk /dev/sda mbr\n"
14730 " mkfs ext2 /dev/sda1\n"
14735 #: ../fish/guestfish.pod:97
14736 msgid "Start with a prepared disk"
14740 #: ../fish/guestfish.pod:99
14742 "An alternate way to create a 100MB disk called C<test1.img> containing a "
14743 "single ext2-formatted partition:"
14747 #: ../fish/guestfish.pod:102
14750 " guestfish -N fs\n"
14755 #: ../fish/guestfish.pod:104
14756 msgid "To list what is available do:"
14760 #: ../fish/guestfish.pod:106 ../fish/guestfish.pod:720
14763 " guestfish -N help | less\n"
14768 #: ../fish/guestfish.pod:108
14769 msgid "Remote control"
14773 #: ../fish/guestfish.pod:110
14776 " eval `guestfish --listen --ro`\n"
14777 " guestfish --remote add disk.img\n"
14778 " guestfish --remote run\n"
14779 " guestfish --remote lvs\n"
14784 #: ../fish/guestfish.pod:117
14786 "Guestfish is a shell and command-line tool for examining and modifying "
14787 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14788 "functionality of the guestfs API, see L<guestfs(3)>."
14792 #: ../fish/guestfish.pod:121
14794 "Guestfish gives you structured access to the libguestfs API, from shell "
14795 "scripts or the command line or interactively. If you want to rescue a "
14796 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14801 #: ../fish/guestfish.pod:126 ../test-tool/libguestfs-test-tool.pod:37
14802 #: ../fuse/guestmount.pod:70 ../inspector/virt-inspector.pl:75
14803 #: ../tools/virt-cat.pl:80 ../tools/virt-df.pl:71 ../tools/virt-edit.pl:73
14804 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-list-partitions.pl:51
14805 #: ../tools/virt-ls.pl:79 ../tools/virt-make-fs.pl:153
14806 #: ../tools/virt-rescue.pl:103 ../tools/virt-resize.pl:233
14807 #: ../tools/virt-tar.pl:99 ../tools/virt-win-reg.pl:172
14812 #: ../fish/guestfish.pod:130 ../fuse/guestmount.pod:94
14813 #: ../inspector/virt-inspector.pl:83 ../tools/virt-cat.pl:88
14814 #: ../tools/virt-df.pl:79 ../tools/virt-edit.pl:81
14815 #: ../tools/virt-list-filesystems.pl:58 ../tools/virt-list-partitions.pl:59
14816 #: ../tools/virt-ls.pl:87 ../tools/virt-make-fs.pl:161
14817 #: ../tools/virt-rescue.pl:111 ../tools/virt-resize.pl:241
14818 #: ../tools/virt-tar.pl:107 ../tools/virt-win-reg.pl:180
14823 #: ../fish/guestfish.pod:132
14824 msgid "Displays general help on options."
14828 #: ../fish/guestfish.pod:134
14829 msgid "B<-h> | B<--cmd-help>"
14833 #: ../fish/guestfish.pod:136
14834 msgid "Lists all available guestfish commands."
14838 #: ../fish/guestfish.pod:138
14839 msgid "B<-h cmd> | B<--cmd-help cmd>"
14843 #: ../fish/guestfish.pod:140
14844 msgid "Displays detailed help on a single command C<cmd>."
14848 #: ../fish/guestfish.pod:142 ../fuse/guestmount.pod:74
14849 msgid "B<-a image> | B<--add image>"
14853 #: ../fish/guestfish.pod:144
14854 msgid "Add a block device or virtual machine image to the shell."
14858 #: ../fish/guestfish.pod:146
14859 msgid "B<-c URI> | B<--connect URI>"
14863 #: ../fish/guestfish.pod:148
14865 "When used in conjunction with the I<-d> option, this specifies the libvirt "
14866 "URI to use. The default is to use the default libvirt connection."
14870 #: ../fish/guestfish.pod:152
14871 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
14875 #: ../fish/guestfish.pod:154
14877 "Add disks from the named libvirt domain. If the I<--ro> option is also "
14878 "used, then any libvirt domain can be used. However in write mode, only "
14879 "libvirt domains which are shut down can be named here."
14883 #: ../fish/guestfish.pod:158
14884 msgid "B<-D> | B<--no-dest-paths>"
14888 #: ../fish/guestfish.pod:160
14890 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
14891 "to hit the tab key to complete paths on the guest filesystem, but this "
14892 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
14893 "allow this feature to be disabled."
14897 #: ../fish/guestfish.pod:165
14898 msgid "B<-f file> | B<--file file>"
14902 #: ../fish/guestfish.pod:167
14903 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
14907 #: ../fish/guestfish.pod:170
14910 " #!/usr/bin/guestfish -f\n"
14915 #: ../fish/guestfish.pod:172
14916 msgid "B<-i> | B<--inspector>"
14920 #: ../fish/guestfish.pod:174
14922 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
14923 "system and mount filesystems as they would be mounted on the real virtual "
14928 #: ../fish/guestfish.pod:178
14929 msgid "Typical usage is either:"
14933 #: ../fish/guestfish.pod:180
14936 " guestfish -d myguest -i\n"
14941 #: ../fish/guestfish.pod:182
14942 msgid "(for an inactive libvirt domain called I<myguest>), or:"
14946 #: ../fish/guestfish.pod:184
14949 " guestfish --ro -d myguest -i\n"
14954 #: ../fish/guestfish.pod:186
14955 msgid "(for active domains, readonly), or specify the block device directly:"
14959 #: ../fish/guestfish.pod:188
14962 " guestfish -a /dev/Guests/MyGuest -i\n"
14967 #: ../fish/guestfish.pod:190
14969 "Note that the command line syntax changed slightly over older versions of "
14970 "guestfish. You can still use the old syntax:"
14974 #: ../fish/guestfish.pod:193
14977 " guestfish [--ro] -i disk.img\n"
14982 #: ../fish/guestfish.pod:195
14985 " guestfish [--ro] -i libvirt-domain\n"
14990 #: ../fish/guestfish.pod:197
14991 msgid "B<--keys-from-stdin>"
14995 #: ../fish/guestfish.pod:199
14997 "Read key or passphrase parameters from stdin. The default is to try to read "
14998 "passphrases from the user by opening C</dev/tty>."
15002 #: ../fish/guestfish.pod:202
15003 msgid "B<--listen>"
15007 #: ../fish/guestfish.pod:204
15009 "Fork into the background and listen for remote commands. See section L</"
15010 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15014 #: ../fish/guestfish.pod:207
15015 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15019 #: ../fish/guestfish.pod:209
15020 msgid "Mount the named partition or logical volume on the given mountpoint."
15024 #: ../fish/guestfish.pod:211
15025 msgid "If the mountpoint is omitted, it defaults to C</>."
15029 #: ../fish/guestfish.pod:213
15030 msgid "You have to mount something on C</> before most commands will work."
15034 #: ../fish/guestfish.pod:215
15036 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15041 #: ../fish/guestfish.pod:218
15043 "If you don't know what filesystems a disk image contains, you can either run "
15044 "guestfish without this option, then list the partitions and LVs available "
15045 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
15046 "list-filesystems(1)> program."
15050 #: ../fish/guestfish.pod:223 ../fuse/guestmount.pod:106
15051 msgid "B<-n> | B<--no-sync>"
15055 #: ../fish/guestfish.pod:225
15057 "Disable autosync. This is enabled by default. See the discussion of "
15058 "autosync in the L<guestfs(3)> manpage."
15062 #: ../fish/guestfish.pod:228
15063 msgid "B<-N type> | B<--new type> | B<-N help>"
15067 #: ../fish/guestfish.pod:230
15069 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15070 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15071 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15076 #: ../fish/guestfish.pod:235
15077 msgid "B<--progress-bars>"
15081 #: ../fish/guestfish.pod:237
15082 msgid "Enable progress bars, even when guestfish is used non-interactively."
15086 #: ../fish/guestfish.pod:239
15088 "Progress bars are enabled by default when guestfish is used as an "
15089 "interactive shell."
15093 #: ../fish/guestfish.pod:242
15094 msgid "B<--no-progress-bars>"
15098 #: ../fish/guestfish.pod:244
15099 msgid "Disable progress bars."
15103 #: ../fish/guestfish.pod:246
15104 msgid "B<--remote[=pid]>"
15108 #: ../fish/guestfish.pod:248
15110 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15111 "CONTROL GUESTFISH OVER A SOCKET> below."
15115 #: ../fish/guestfish.pod:251 ../fuse/guestmount.pod:148
15116 msgid "B<-r> | B<--ro>"
15120 #: ../fish/guestfish.pod:253
15122 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15123 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15127 #: ../fish/guestfish.pod:256 ../tools/virt-rescue.pl:162
15129 "The option must always be used if the disk image or virtual machine might be "
15130 "running, and is generally recommended in cases where you don't need write "
15131 "access to the disk."
15135 #: ../fish/guestfish.pod:260
15137 "Note that prepared disk images created with I<-N> are not affected by the "
15142 #: ../fish/guestfish.pod:263 ../fuse/guestmount.pod:158
15143 #: ../tools/virt-rescue.pl:170
15144 msgid "B<--selinux>"
15148 #: ../fish/guestfish.pod:265
15149 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15153 #: ../fish/guestfish.pod:267 ../fuse/guestmount.pod:168
15154 msgid "B<-v> | B<--verbose>"
15158 #: ../fish/guestfish.pod:269
15160 "Enable very verbose messages. This is particularly useful if you find a bug."
15164 #: ../fish/guestfish.pod:272 ../fuse/guestmount.pod:172
15165 msgid "B<-V> | B<--version>"
15169 #: ../fish/guestfish.pod:274
15170 msgid "Display the guestfish / libguestfs version number and exit."
15174 #: ../fish/guestfish.pod:276
15179 #: ../fish/guestfish.pod:278
15180 msgid "Echo each command before executing it."
15184 #: ../fish/guestfish.pod:282
15185 msgid "COMMANDS ON COMMAND LINE"
15189 #: ../fish/guestfish.pod:284
15191 "Any additional (non-option) arguments are treated as commands to execute."
15195 #: ../fish/guestfish.pod:287
15197 "Commands to execute should be separated by a colon (C<:>), where the colon "
15198 "is a separate parameter. Thus:"
15202 #: ../fish/guestfish.pod:290
15205 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
15210 #: ../fish/guestfish.pod:292
15212 "If there are no additional arguments, then we enter a shell, either an "
15213 "interactive shell with a prompt (if the input is a terminal) or a non-"
15214 "interactive shell."
15218 #: ../fish/guestfish.pod:296
15220 "In either command line mode or non-interactive shell, the first command that "
15221 "gives an error causes the whole shell to exit. In interactive mode (with a "
15222 "prompt) if a command fails, you can continue to enter commands."
15226 #: ../fish/guestfish.pod:301
15227 msgid "USING launch (OR run)"
15231 #: ../fish/guestfish.pod:303
15233 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
15234 "then launch it, then mount any disks you need, and finally issue actions/"
15235 "commands. So the general order of the day is:"
15239 #: ../fish/guestfish.pod:311
15240 msgid "add or -a/--add"
15244 #: ../fish/guestfish.pod:315
15245 msgid "launch (aka run)"
15249 #: ../fish/guestfish.pod:319
15250 msgid "mount or -m/--mount"
15254 #: ../fish/guestfish.pod:323
15255 msgid "any other commands"
15259 #: ../fish/guestfish.pod:327
15261 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
15262 "guest before mounting or performing any other commands."
15266 #: ../fish/guestfish.pod:330
15268 "The only exception is that if the I<-m> or I<--mount> option was given, the "
15269 "guest is automatically run for you (simply because guestfish can't mount the "
15270 "disks you asked for without doing this)."
15274 #: ../fish/guestfish.pod:334
15279 #: ../fish/guestfish.pod:336
15281 "You can quote ordinary parameters using either single or double quotes. For "
15286 #: ../fish/guestfish.pod:339
15289 " add \"file with a space.img\"\n"
15294 #: ../fish/guestfish.pod:341
15297 " rm '/file name'\n"
15302 #: ../fish/guestfish.pod:343
15310 #: ../fish/guestfish.pod:345
15312 "A few commands require a list of strings to be passed. For these, use a "
15313 "whitespace-separated list, enclosed in quotes. Strings containing "
15314 "whitespace to be passed through must be enclosed in single quotes. A "
15315 "literal single quote must be escaped with a backslash."
15319 #: ../fish/guestfish.pod:350
15322 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
15323 " command \"/bin/echo 'foo bar'\"\n"
15324 " command \"/bin/echo \\'foo\\'\"\n"
15329 #: ../fish/guestfish.pod:354
15334 #: ../fish/guestfish.pod:356
15336 "This section applies to all commands which can take integers as parameters."
15340 #: ../fish/guestfish.pod:359
15341 msgid "SIZE SUFFIX"
15345 #: ../fish/guestfish.pod:361
15347 "When the command takes a parameter measured in bytes, you can use one of the "
15348 "following suffixes to specify kilobytes, megabytes and larger sizes:"
15352 #: ../fish/guestfish.pod:367
15353 msgid "B<k> or B<K> or B<KiB>"
15357 #: ../fish/guestfish.pod:369
15358 msgid "The size in kilobytes (multiplied by 1024)."
15362 #: ../fish/guestfish.pod:371
15367 #: ../fish/guestfish.pod:373
15368 msgid "The size in SI 1000 byte units."
15372 #: ../fish/guestfish.pod:375
15373 msgid "B<M> or B<MiB>"
15377 #: ../fish/guestfish.pod:377
15378 msgid "The size in megabytes (multiplied by 1048576)."
15382 #: ../fish/guestfish.pod:379
15387 #: ../fish/guestfish.pod:381
15388 msgid "The size in SI 1000000 byte units."
15392 #: ../fish/guestfish.pod:383
15393 msgid "B<G> or B<GiB>"
15397 #: ../fish/guestfish.pod:385
15398 msgid "The size in gigabytes (multiplied by 2**30)."
15402 #: ../fish/guestfish.pod:387
15407 #: ../fish/guestfish.pod:389
15408 msgid "The size in SI 10**9 byte units."
15412 #: ../fish/guestfish.pod:391
15413 msgid "B<T> or B<TiB>"
15417 #: ../fish/guestfish.pod:393
15418 msgid "The size in terabytes (multiplied by 2**40)."
15422 #: ../fish/guestfish.pod:395
15427 #: ../fish/guestfish.pod:397
15428 msgid "The size in SI 10**12 byte units."
15432 #: ../fish/guestfish.pod:399
15433 msgid "B<P> or B<PiB>"
15437 #: ../fish/guestfish.pod:401
15438 msgid "The size in petabytes (multiplied by 2**50)."
15442 #: ../fish/guestfish.pod:403
15447 #: ../fish/guestfish.pod:405
15448 msgid "The size in SI 10**15 byte units."
15452 #: ../fish/guestfish.pod:407
15453 msgid "B<E> or B<EiB>"
15457 #: ../fish/guestfish.pod:409
15458 msgid "The size in exabytes (multiplied by 2**60)."
15462 #: ../fish/guestfish.pod:411
15467 #: ../fish/guestfish.pod:413
15468 msgid "The size in SI 10**18 byte units."
15472 #: ../fish/guestfish.pod:415
15473 msgid "B<Z> or B<ZiB>"
15477 #: ../fish/guestfish.pod:417
15478 msgid "The size in zettabytes (multiplied by 2**70)."
15482 #: ../fish/guestfish.pod:419
15487 #: ../fish/guestfish.pod:421
15488 msgid "The size in SI 10**21 byte units."
15492 #: ../fish/guestfish.pod:423
15493 msgid "B<Y> or B<YiB>"
15497 #: ../fish/guestfish.pod:425
15498 msgid "The size in yottabytes (multiplied by 2**80)."
15502 #: ../fish/guestfish.pod:427
15507 #: ../fish/guestfish.pod:429
15508 msgid "The size in SI 10**24 byte units."
15512 #: ../fish/guestfish.pod:433
15513 msgid "For example:"
15517 #: ../fish/guestfish.pod:435
15520 " truncate-size /file 1G\n"
15525 #: ../fish/guestfish.pod:437
15526 msgid "would truncate the file to 1 gigabyte."
15530 #: ../fish/guestfish.pod:439
15532 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
15533 "the parameter to L</memsize> is specified in megabytes already). Adding a "
15534 "suffix will probably not do what you expect."
15538 #: ../fish/guestfish.pod:443
15539 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15543 #: ../fish/guestfish.pod:445
15545 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15546 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15550 #: ../fish/guestfish.pod:448
15553 " 1234 decimal number 1234\n"
15554 " 02322 octal number, equivalent to decimal 1234\n"
15555 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
15560 #: ../fish/guestfish.pod:452
15562 "When using the C<chmod> command, you almost always want to specify an octal "
15563 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
15564 "L<chmod(1)> program):"
15568 #: ../fish/guestfish.pod:456
15571 " chmod 0777 /public # OK\n"
15572 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
15577 #: ../fish/guestfish.pod:459
15579 "Commands that return numbers usually print them in decimal, but some "
15580 "commands print numbers in other radices (eg. C<umask> prints the mode in "
15581 "octal, preceeded by C<0>)."
15585 #: ../fish/guestfish.pod:463
15586 msgid "WILDCARDS AND GLOBBING"
15590 #: ../fish/guestfish.pod:465
15592 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
15593 "(globbing) by default. So for example the following will not do what you "
15598 #: ../fish/guestfish.pod:469
15606 #: ../fish/guestfish.pod:471
15608 "Assuming you don't have a directory literally called C</home/*> then the "
15609 "above command will return an error."
15613 #: ../fish/guestfish.pod:474
15614 msgid "To perform wildcard expansion, use the C<glob> command."
15618 #: ../fish/guestfish.pod:476
15621 " glob rm-rf /home/*\n"
15626 #: ../fish/guestfish.pod:478
15628 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
15629 "many times), equivalent to:"
15633 #: ../fish/guestfish.pod:481
15636 " rm-rf /home/jim\n"
15637 " rm-rf /home/joe\n"
15638 " rm-rf /home/mary\n"
15643 #: ../fish/guestfish.pod:485
15644 msgid "C<glob> only works on simple guest paths and not on device names."
15648 #: ../fish/guestfish.pod:487
15650 "If you have several parameters, each containing a wildcard, then glob will "
15651 "perform a cartesian product."
15655 #: ../fish/guestfish.pod:490
15660 #: ../fish/guestfish.pod:492
15662 "Any line which starts with a I<#> character is treated as a comment and "
15663 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
15664 "a command. For example:"
15668 #: ../fish/guestfish.pod:496
15671 " # this is a comment\n"
15672 " # this is a comment\n"
15673 " foo # NOT a comment\n"
15678 #: ../fish/guestfish.pod:500
15679 msgid "Blank lines are also ignored."
15683 #: ../fish/guestfish.pod:502
15684 msgid "RUNNING COMMANDS LOCALLY"
15688 #: ../fish/guestfish.pod:504
15690 "Any line which starts with a I<!> character is treated as a command sent to "
15691 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
15695 #: ../fish/guestfish.pod:508
15699 " tgz-out /remote local/remote-data.tar.gz\n"
15704 #: ../fish/guestfish.pod:511
15706 "will create a directory C<local> on the host, and then export the contents "
15707 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
15708 "(See C<tgz-out>)."
15712 #: ../fish/guestfish.pod:515
15714 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
15715 "effect, due to the way that subprocesses work in Unix."
15719 #: ../fish/guestfish.pod:518
15724 #: ../fish/guestfish.pod:520
15726 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
15727 "command (a guestfish command) to the second command (any host command). For "
15732 #: ../fish/guestfish.pod:524
15735 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
15740 #: ../fish/guestfish.pod:526
15742 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
15743 "program). The above command would list all accounts in the guest filesystem "
15744 "which have UID 0, ie. root accounts including backdoors. Other examples:"
15748 #: ../fish/guestfish.pod:531
15751 " hexdump /bin/ls | head\n"
15752 " list-devices | tail -1\n"
15753 " tgz-out / - | tar ztf -\n"
15758 #: ../fish/guestfish.pod:535
15760 "The space before the pipe symbol is required, any space after the pipe "
15761 "symbol is optional. Everything after the pipe symbol is just passed "
15762 "straight to the host shell, so it can contain redirections, globs and "
15763 "anything else that makes sense on the host side."
15767 #: ../fish/guestfish.pod:540
15769 "To use a literal argument which begins with a pipe symbol, you have to quote "
15774 #: ../fish/guestfish.pod:543
15782 #: ../fish/guestfish.pod:545
15783 msgid "HOME DIRECTORIES"
15787 #: ../fish/guestfish.pod:547
15789 "If a parameter starts with the character C<~> then the tilde may be expanded "
15790 "as a home directory path (either C<~> for the current user's home directory, "
15791 "or C<~user> for another user)."
15795 #: ../fish/guestfish.pod:551
15797 "Note that home directory expansion happens for users known I<on the host>, "
15798 "not in the guest filesystem."
15802 #: ../fish/guestfish.pod:554
15804 "To use a literal argument which begins with a tilde, you have to quote it, "
15809 #: ../fish/guestfish.pod:557
15817 #: ../fish/guestfish.pod:561
15819 "Libguestfs has some support for Linux guests encrypted according to the "
15820 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
15821 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
15822 "LUKS is supported."
15826 #: ../fish/guestfish.pod:566
15827 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
15831 #: ../fish/guestfish.pod:568
15834 " ><fs> vfs-type /dev/sda2\n"
15840 #: ../fish/guestfish.pod:571
15842 "Then open those devices using L</luks-open>. This creates a device-mapper "
15843 "device called C</dev/mapper/luksdev>."
15847 #: ../fish/guestfish.pod:574
15850 " ><fs> luks-open /dev/sda2 luksdev\n"
15851 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
15856 #: ../fish/guestfish.pod:577
15858 "Finally you have to tell LVM to scan for volume groups on the newly created "
15863 #: ../fish/guestfish.pod:580
15867 " ><fs> vg-activate-all true\n"
15872 #: ../fish/guestfish.pod:583
15873 msgid "The logical volume(s) can now be mounted in the usual way."
15877 #: ../fish/guestfish.pod:585
15879 "Before closing a LUKS device you must unmount any logical volumes on it and "
15880 "deactivate the volume groups by calling C<vg-activate false VG> on each "
15881 "one. Then you can close the mapper device:"
15885 #: ../fish/guestfish.pod:589
15888 " ><fs> vg-activate false /dev/VG\n"
15889 " ><fs> luks-close /dev/mapper/luksdev\n"
15894 #: ../fish/guestfish.pod:592
15895 msgid "WINDOWS PATHS"
15899 #: ../fish/guestfish.pod:594
15901 "If a path is prefixed with C<win:> then you can use Windows-style paths "
15902 "(with some limitations). The following commands are equivalent:"
15906 #: ../fish/guestfish.pod:597
15909 " file /WINDOWS/system32/config/system.LOG\n"
15914 #: ../fish/guestfish.pod:599
15917 " file win:/windows/system32/config/system.log\n"
15922 #: ../fish/guestfish.pod:601
15925 " file win:\\windows\\system32\\config\\system.log\n"
15930 #: ../fish/guestfish.pod:603
15933 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
15938 #: ../fish/guestfish.pod:605
15940 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
15941 "handles case insensitivity like Windows would. This only works in argument "
15942 "positions that expect a path."
15946 #: ../fish/guestfish.pod:609
15947 msgid "UPLOADING AND DOWNLOADING FILES"
15951 #: ../fish/guestfish.pod:611
15953 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
15954 "others which upload from or download to a local file, you can use the "
15955 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
15959 #: ../fish/guestfish.pod:615
15967 #: ../fish/guestfish.pod:617
15969 "reads stdin and creates from that a file C</foo> in the disk image, and:"
15973 #: ../fish/guestfish.pod:620
15976 " tar-out /etc - | tar tf -\n"
15981 #: ../fish/guestfish.pod:622
15983 "writes the tarball to stdout and then pipes that into the external \"tar\" "
15984 "command (see L</PIPES>)."
15988 #: ../fish/guestfish.pod:625
15990 "When using C<-> to read from stdin, the input is read up to the end of "
15991 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
15992 "some arbitrary end marker:"
15996 #: ../fish/guestfish.pod:629
15999 " upload -<<END /foo\n"
16008 #: ../fish/guestfish.pod:635
16010 "Any string of characters can be used instead of C<END>. The end marker must "
16011 "appear on a line of its own, without any preceeding or following characters "
16012 "(not even spaces)."
16016 #: ../fish/guestfish.pod:639
16018 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16019 "upload local files (so-called \"FileIn\" parameters in the generator)."
16023 #: ../fish/guestfish.pod:642
16024 msgid "EXIT ON ERROR BEHAVIOUR"
16028 #: ../fish/guestfish.pod:644
16030 "By default, guestfish will ignore any errors when in interactive mode (ie. "
16031 "taking commands from a human over a tty), and will exit on the first error "
16032 "in non-interactive mode (scripts, commands given on the command line)."
16036 #: ../fish/guestfish.pod:649
16038 "If you prefix a command with a I<-> character, then that command will not "
16039 "cause guestfish to exit, even if that (one) command returns an error."
16043 #: ../fish/guestfish.pod:653
16044 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16048 #: ../fish/guestfish.pod:655
16050 "Guestfish can be remote-controlled over a socket. This is useful "
16051 "particularly in shell scripts where you want to make several different "
16052 "changes to a filesystem, but you don't want the overhead of starting up a "
16053 "guestfish process each time."
16057 #: ../fish/guestfish.pod:660
16058 msgid "Start a guestfish server process using:"
16062 #: ../fish/guestfish.pod:662
16065 " eval `guestfish --listen`\n"
16070 #: ../fish/guestfish.pod:664
16071 msgid "and then send it commands by doing:"
16075 #: ../fish/guestfish.pod:666
16078 " guestfish --remote cmd [...]\n"
16083 #: ../fish/guestfish.pod:668
16084 msgid "To cause the server to exit, send it the exit command:"
16088 #: ../fish/guestfish.pod:670
16091 " guestfish --remote exit\n"
16096 #: ../fish/guestfish.pod:672
16098 "Note that the server will normally exit if there is an error in a command. "
16099 "You can change this in the usual way. See section L</EXIT ON ERROR "
16104 #: ../fish/guestfish.pod:676
16105 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16109 #: ../fish/guestfish.pod:678
16111 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16112 "is how the I<--remote> option knows where to send the commands. You can "
16113 "have several guestfish listener processes running using:"
16117 #: ../fish/guestfish.pod:682
16120 " eval `guestfish --listen`\n"
16121 " pid1=$GUESTFISH_PID\n"
16122 " eval `guestfish --listen`\n"
16123 " pid2=$GUESTFISH_PID\n"
16125 " guestfish --remote=$pid1 cmd\n"
16126 " guestfish --remote=$pid2 cmd\n"
16131 #: ../fish/guestfish.pod:690
16132 msgid "REMOTE CONTROL DETAILS"
16136 #: ../fish/guestfish.pod:692
16138 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
16139 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
16140 "and C<$PID> is the process ID of the server."
16144 #: ../fish/guestfish.pod:696
16145 msgid "Guestfish client and server versions must match exactly."
16149 #: ../fish/guestfish.pod:698
16150 msgid "PREPARED DISK IMAGES"
16154 #: ../fish/guestfish.pod:700
16156 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
16157 "preformatted disk images that guestfish can make for you to save typing. "
16158 "This is particularly useful for testing purposes. This option is used "
16159 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
16160 "can be mixed with I<-a>)."
16164 #: ../fish/guestfish.pod:706
16166 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
16167 "the second and so on. Existing files in the current directory are "
16172 #: ../fish/guestfish.pod:710
16174 "The type briefly describes how the disk should be sized, partitioned, how "
16175 "filesystem(s) should be created, and how content should be added. "
16176 "Optionally the type can be followed by extra parameters, separated by C<:> "
16177 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
16178 "allocated disk, containing a single partition, with the partition formatted "
16179 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
16184 #: ../fish/guestfish.pod:718
16185 msgid "To list the available types and any extra parameters they take, run:"
16189 #: ../fish/guestfish.pod:722
16191 "Note that the prepared filesystem is not mounted. You would usually have to "
16192 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
16196 #: ../fish/guestfish.pod:726
16198 "If any I<-N> or I<--new> options are given, the guest is automatically "
16203 #: ../fish/guestfish.pod:731
16204 msgid "Create a 100MB disk with an ext4-formatted partition:"
16208 #: ../fish/guestfish.pod:733
16211 " guestfish -N fs:ext4\n"
16216 #: ../fish/guestfish.pod:735
16217 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
16221 #: ../fish/guestfish.pod:737
16224 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
16229 #: ../fish/guestfish.pod:739
16230 msgid "Create a blank 200MB disk:"
16234 #: ../fish/guestfish.pod:741
16237 " guestfish -N disk:200M\n"
16242 #: ../fish/guestfish.pod:743
16243 msgid "PROGRESS BARS"
16247 #: ../fish/guestfish.pod:745
16249 "Some (not all) long-running commands send progress notification messages as "
16250 "they are running. Guestfish turns these messages into progress bars."
16254 #: ../fish/guestfish.pod:749
16256 "When a command that supports progress bars takes longer than two seconds to "
16257 "run, and if progress bars are enabled, then you will see one appearing below "
16262 #: ../fish/guestfish.pod:753
16265 " ><fs> copy-size /large-file /another-file 2048M\n"
16266 " / 10% [#####-----------------------------------------] 00:30\n"
16271 #: ../fish/guestfish.pod:756
16273 "The spinner on the left hand side moves round once for every progress "
16274 "notification received from the backend. This is a (reasonably) golden "
16275 "assurance that the command is \"doing something\" even if the progress bar "
16276 "is not moving, because the command is able to send the progress "
16277 "notifications. When the bar reaches 100% and the command finishes, the "
16278 "spinner disappears."
16282 #: ../fish/guestfish.pod:763
16284 "Progress bars are enabled by default when guestfish is used interactively. "
16285 "You can enable them even for non-interactive modes using I<--progress-bars>, "
16286 "and you can disable them completely using I<--no-progress-bars>."
16290 #: ../fish/guestfish.pod:768
16291 msgid "GUESTFISH COMMANDS"
16295 #: ../fish/guestfish.pod:770
16297 "The commands in this section are guestfish convenience commands, in other "
16298 "words, they are not part of the L<guestfs(3)> API."
16302 #: ../fish/guestfish.pod:773
16303 msgid "alloc | allocate"
16307 #: ../fish/guestfish.pod:775
16310 " alloc filename size\n"
16315 #: ../fish/guestfish.pod:777
16317 "This creates an empty (zeroed) file of the given size, and then adds so it "
16318 "can be further examined."
16322 #: ../fish/guestfish.pod:780 ../fish/guestfish.pod:903
16323 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16327 #: ../fish/guestfish.pod:782 ../fish/guestfish.pod:905
16328 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16332 #: ../fish/guestfish.pod:784
16337 #: ../fish/guestfish.pod:786
16340 " copy-in local [local ...] /remotedir\n"
16345 #: ../fish/guestfish.pod:788
16347 "C<copy-in> copies local files or directories recursively into the disk "
16348 "image, placing them in the directory called C</remotedir> (which must "
16349 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16350 "other commands as necessary."
16354 #: ../fish/guestfish.pod:793
16356 "Multiple local files and directories can be specified, but the last "
16357 "parameter must always be a remote directory. Wildcards cannot be used."
16361 #: ../fish/guestfish.pod:797
16366 #: ../fish/guestfish.pod:799
16369 " copy-out remote [remote ...] localdir\n"
16374 #: ../fish/guestfish.pod:801
16376 "C<copy-out> copies remote files or directories recursively out of the disk "
16377 "image, placing them on the host disk in a local directory called C<localdir> "
16378 "(which must exist). This guestfish meta-command turns into a sequence of L</"
16379 "download>, L</tar-out> and other commands as necessary."
16383 #: ../fish/guestfish.pod:807
16385 "Multiple remote files and directories can be specified, but the last "
16386 "parameter must always be a local directory. To download to the current "
16387 "directory, use C<.> as in:"
16391 #: ../fish/guestfish.pod:811
16394 " copy-out /home .\n"
16399 #: ../fish/guestfish.pod:813
16401 "Wildcards cannot be used in the ordinary command, but you can use them with "
16402 "the help of L</glob> like this:"
16406 #: ../fish/guestfish.pod:816
16409 " glob copy-out /home/* .\n"
16414 #: ../fish/guestfish.pod:818
16419 #: ../fish/guestfish.pod:820
16422 " echo [params ...]\n"
16427 #: ../fish/guestfish.pod:822
16428 msgid "This echos the parameters to the terminal."
16432 #: ../fish/guestfish.pod:824
16433 msgid "edit | vi | emacs"
16437 #: ../fish/guestfish.pod:826
16445 #: ../fish/guestfish.pod:828
16447 "This is used to edit a file. It downloads the file, edits it locally using "
16448 "your editor, then uploads the result."
16452 #: ../fish/guestfish.pod:831
16454 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16455 "or C<emacs> you will get those corresponding editors."
16459 #: ../fish/guestfish.pod:835
16464 #: ../fish/guestfish.pod:837
16467 " glob command args...\n"
16472 #: ../fish/guestfish.pod:839
16474 "Expand wildcards in any paths in the args list, and run C<command> "
16475 "repeatedly on each matching path."
16479 #: ../fish/guestfish.pod:842
16480 msgid "See section WILDCARDS AND GLOBBING."
16484 #: ../fish/guestfish.pod:844
16489 #: ../fish/guestfish.pod:846
16498 #: ../fish/guestfish.pod:849
16500 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
16501 "this displays detailed help for a command."
16505 #: ../fish/guestfish.pod:852
16510 #: ../fish/guestfish.pod:854
16518 #: ../fish/guestfish.pod:856
16520 "Change the local directory, ie. the current directory of guestfish itself."
16524 #: ../fish/guestfish.pod:859
16525 msgid "Note that C<!cd> won't do what you might expect."
16529 #: ../fish/guestfish.pod:861
16530 msgid "man | manual"
16534 #: ../fish/guestfish.pod:863
16542 #: ../fish/guestfish.pod:865
16543 msgid "Opens the manual page for guestfish."
16547 #: ../fish/guestfish.pod:867
16548 msgid "more | less"
16552 #: ../fish/guestfish.pod:869
16560 #: ../fish/guestfish.pod:871
16568 #: ../fish/guestfish.pod:873
16569 msgid "This is used to view a file."
16573 #: ../fish/guestfish.pod:875
16575 "The default viewer is C<$PAGER>. However if you use the alternate command "
16576 "C<less> you will get the C<less> command specifically."
16580 #: ../fish/guestfish.pod:878
16581 msgid "quit | exit"
16585 #: ../fish/guestfish.pod:880
16586 msgid "This exits guestfish. You can also use C<^D> key."
16590 #: ../fish/guestfish.pod:882
16595 #: ../fish/guestfish.pod:884
16603 #: ../fish/guestfish.pod:886
16605 "Close and reopen the libguestfs handle. It is not necessary to use this "
16606 "normally, because the handle is closed properly when guestfish exits. "
16607 "However this is occasionally useful for testing."
16611 #: ../fish/guestfish.pod:890
16616 #: ../fish/guestfish.pod:892
16619 " sparse filename size\n"
16624 #: ../fish/guestfish.pod:894
16626 "This creates an empty sparse file of the given size, and then adds so it can "
16627 "be further examined."
16631 #: ../fish/guestfish.pod:897
16633 "In all respects it works the same as the C<alloc> command, except that the "
16634 "image file is allocated sparsely, which means that disk blocks are not "
16635 "assigned to the file until they are needed. Sparse disk files only use "
16636 "space when written to, but they are slower and there is a danger you could "
16637 "run out of real disk space during a write operation."
16641 #: ../fish/guestfish.pod:907
16646 #: ../fish/guestfish.pod:909
16654 #: ../fish/guestfish.pod:911
16656 "This command returns a list of the optional groups known to the daemon, and "
16657 "indicates which ones are supported by this build of the libguestfs appliance."
16661 #: ../fish/guestfish.pod:915
16662 msgid "See also L<guestfs(3)/AVAILABILITY>."
16666 #: ../fish/guestfish.pod:917
16671 #: ../fish/guestfish.pod:919
16674 " time command args...\n"
16679 #: ../fish/guestfish.pod:921
16681 "Run the command as usual, but print the elapsed time afterwards. This can "
16682 "be useful for benchmarking operations."
16686 #: ../fish/guestfish.pod:924
16691 #: ../fish/guestfish.pod:928 ../test-tool/libguestfs-test-tool.pod:83
16696 #: ../fish/guestfish.pod:930
16698 "guestfish returns 0 if the commands completed without error, or 1 if there "
16703 #: ../fish/guestfish.pod:937
16708 #: ../fish/guestfish.pod:939
16710 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
16715 #: ../fish/guestfish.pod:942
16716 msgid "GUESTFISH_PID"
16720 #: ../fish/guestfish.pod:944
16722 "Used with the I<--remote> option to specify the remote guestfish process to "
16723 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16727 #: ../fish/guestfish.pod:948
16732 #: ../fish/guestfish.pod:950
16734 "If compiled with GNU readline support, various files in the home directory "
16735 "can be used. See L</FILES>."
16739 #: ../fish/guestfish.pod:959
16741 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16742 "effect as using the B<-v> option."
16746 #: ../fish/guestfish.pod:971
16748 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16749 "the discussion of paths in L<guestfs(3)>."
16753 #: ../fish/guestfish.pod:982
16754 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16758 #: ../fish/guestfish.pod:984
16763 #: ../fish/guestfish.pod:986
16765 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16770 #: ../fish/guestfish.pod:1001 ../test-tool/libguestfs-test-tool.pod:88
16775 #: ../fish/guestfish.pod:1005
16776 msgid "$HOME/.guestfish"
16780 #: ../fish/guestfish.pod:1007
16782 "If compiled with GNU readline support, then the command history is saved in "
16787 #: ../fish/guestfish.pod:1010
16788 msgid "$HOME/.inputrc"
16792 #: ../fish/guestfish.pod:1012
16793 msgid "/etc/inputrc"
16797 #: ../fish/guestfish.pod:1014
16799 "If compiled with GNU readline support, then these files can be used to "
16800 "configure readline. For further information, please see L<readline(3)/"
16801 "INITIALIZATION FILE>."
16805 #: ../fish/guestfish.pod:1018
16806 msgid "To write rules which only apply to guestfish, use:"
16810 #: ../fish/guestfish.pod:1020
16820 #: ../fish/guestfish.pod:1024
16822 "Variables that you can set in inputrc that change the behaviour of guestfish "
16823 "in useful ways include:"
16827 #: ../fish/guestfish.pod:1029
16828 msgid "completion-ignore-case (default: on)"
16832 #: ../fish/guestfish.pod:1031
16834 "By default, guestfish will ignore case when tab-completing paths on the "
16839 #: ../fish/guestfish.pod:1034
16842 " set completion-ignore-case off\n"
16847 #: ../fish/guestfish.pod:1036
16848 msgid "to make guestfish case sensitive."
16852 #: ../fish/guestfish.pod:1040
16857 #: ../fish/guestfish.pod:1042
16858 msgid "test2.img (etc)"
16862 #: ../fish/guestfish.pod:1044
16864 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16865 "will be created in the file C<test1.img> in the current directory. The "
16866 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16867 "the same name will be overwritten."
16871 #: ../fish/guestfish.pod:1053
16873 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16874 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16875 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16876 "L<virt-tar(1)>, L<virt-win-reg(1)>."
16880 #: ../fish/guestfish.pod:1076 ../test-tool/libguestfs-test-tool.pod:124
16881 #: ../fuse/guestmount.pod:198 ../inspector/virt-inspector.pl:865
16882 #: ../tools/virt-cat.pl:181 ../tools/virt-df.pl:499 ../tools/virt-edit.pl:345
16883 #: ../tools/virt-list-filesystems.pl:211 ../tools/virt-list-partitions.pl:248
16884 #: ../tools/virt-ls.pl:229 ../tools/virt-make-fs.pl:560
16885 #: ../tools/virt-rescue.pl:249 ../tools/virt-resize.pl:1415
16886 #: ../tools/virt-tar.pl:276 ../tools/virt-win-reg.pl:495
16888 "This program is free software; you can redistribute it and/or modify it "
16889 "under the terms of the GNU General Public License as published by the Free "
16890 "Software Foundation; either version 2 of the License, or (at your option) "
16891 "any later version."
16895 #: ../fish/guestfish.pod:1081 ../test-tool/libguestfs-test-tool.pod:129
16896 #: ../fuse/guestmount.pod:203 ../inspector/virt-inspector.pl:870
16897 #: ../tools/virt-cat.pl:186 ../tools/virt-df.pl:504 ../tools/virt-edit.pl:350
16898 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:253
16899 #: ../tools/virt-ls.pl:234 ../tools/virt-make-fs.pl:565
16900 #: ../tools/virt-rescue.pl:254 ../tools/virt-resize.pl:1420
16901 #: ../tools/virt-tar.pl:281 ../tools/virt-win-reg.pl:500
16903 "This program is distributed in the hope that it will be useful, but WITHOUT "
16904 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
16905 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
16910 #: ../fish/guestfish.pod:1086 ../test-tool/libguestfs-test-tool.pod:134
16911 #: ../fuse/guestmount.pod:208 ../inspector/virt-inspector.pl:875
16912 #: ../tools/virt-cat.pl:191 ../tools/virt-df.pl:509 ../tools/virt-edit.pl:355
16913 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:258
16914 #: ../tools/virt-ls.pl:239 ../tools/virt-make-fs.pl:570
16915 #: ../tools/virt-rescue.pl:259 ../tools/virt-resize.pl:1425
16916 #: ../tools/virt-tar.pl:286 ../tools/virt-win-reg.pl:505
16918 "You should have received a copy of the GNU General Public License along with "
16919 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
16920 "Ave, Cambridge, MA 02139, USA."
16924 #: ../fish/guestfish-actions.pod:1
16925 msgid "add-cdrom | cdrom"
16929 #: ../fish/guestfish-actions.pod:3
16932 " add-cdrom filename\n"
16937 #: ../fish/guestfish-actions.pod:15
16939 "This call checks for the existence of C<filename>. This stops you from "
16940 "specifying other types of drive which are supported by qemu such as C<nbd:> "
16941 "and C<http:> URLs. To specify those, use the general C<config> call instead."
16945 #: ../fish/guestfish-actions.pod:22
16947 "If you just want to add an ISO file (often you use this as an efficient way "
16948 "to transfer large files into the guest), then you should probably use C<add-"
16949 "drive-ro> instead."
16953 #: ../fish/guestfish-actions.pod:28
16954 msgid "add-drive | add"
16958 #: ../fish/guestfish-actions.pod:30
16961 " add-drive filename\n"
16966 #: ../fish/guestfish-actions.pod:49 ../fish/guestfish-actions.pod:75
16968 "C<if=...> is set at compile time by the configuration option C<./configure --"
16969 "with-drive-if=...>. In the rare case where you might need to change this at "
16970 "run time, use C<add-drive-with-if> or C<add-drive-ro-with-if>."
16974 #: ../fish/guestfish-actions.pod:54 ../fish/guestfish-actions.pod:80
16976 "Note that this call checks for the existence of C<filename>. This stops you "
16977 "from specifying other types of drive which are supported by qemu such as "
16978 "C<nbd:> and C<http:> URLs. To specify those, use the general C<config> call "
16983 #: ../fish/guestfish-actions.pod:59
16984 msgid "add-drive-ro | add-ro"
16988 #: ../fish/guestfish-actions.pod:61
16991 " add-drive-ro filename\n"
16996 #: ../fish/guestfish-actions.pod:85
16997 msgid "add-drive-ro-with-if"
17001 #: ../fish/guestfish-actions.pod:87
17004 " add-drive-ro-with-if filename iface\n"
17009 #: ../fish/guestfish-actions.pod:89
17011 "This is the same as C<add-drive-ro> but it allows you to specify the QEMU "
17012 "interface emulation to use at run time."
17016 #: ../fish/guestfish-actions.pod:92
17017 msgid "add-drive-with-if"
17021 #: ../fish/guestfish-actions.pod:94
17024 " add-drive-with-if filename iface\n"
17029 #: ../fish/guestfish-actions.pod:96
17031 "This is the same as C<add-drive> but it allows you to specify the QEMU "
17032 "interface emulation to use at run time."
17036 #: ../fish/guestfish-actions.pod:99
17041 #: ../fish/guestfish-actions.pod:101
17044 " aug-clear augpath\n"
17049 #: ../fish/guestfish-actions.pod:106
17054 #: ../fish/guestfish-actions.pod:108
17062 #: ../fish/guestfish-actions.pod:110
17064 "Close the current Augeas handle and free up any resources used by it. After "
17065 "calling this, you have to call C<aug-init> again before you can use any "
17066 "other Augeas functions."
17070 #: ../fish/guestfish-actions.pod:115
17071 msgid "aug-defnode"
17075 #: ../fish/guestfish-actions.pod:117
17078 " aug-defnode name expr val\n"
17083 #: ../fish/guestfish-actions.pod:122
17085 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
17086 "calling C<aug-set> C<expr>, C<value>. C<name> will be the nodeset "
17087 "containing that single node."
17091 #: ../fish/guestfish-actions.pod:130
17096 #: ../fish/guestfish-actions.pod:132
17099 " aug-defvar name expr\n"
17104 #: ../fish/guestfish-actions.pod:141
17109 #: ../fish/guestfish-actions.pod:143
17112 " aug-get augpath\n"
17117 #: ../fish/guestfish-actions.pod:148
17122 #: ../fish/guestfish-actions.pod:150
17125 " aug-init root flags\n"
17130 #: ../fish/guestfish-actions.pod:156
17131 msgid "You must call this before using any other C<aug-*> commands."
17135 #: ../fish/guestfish-actions.pod:191
17136 msgid "Do not load the tree in C<aug-init>."
17140 #: ../fish/guestfish-actions.pod:195
17141 msgid "To close the handle, you can call C<aug-close>."
17145 #: ../fish/guestfish-actions.pod:199
17150 #: ../fish/guestfish-actions.pod:201
17153 " aug-insert augpath label true|false\n"
17158 #: ../fish/guestfish-actions.pod:211
17163 #: ../fish/guestfish-actions.pod:213
17171 #: ../fish/guestfish-actions.pod:220
17176 #: ../fish/guestfish-actions.pod:222
17179 " aug-ls augpath\n"
17184 #: ../fish/guestfish-actions.pod:224
17186 "This is just a shortcut for listing C<aug-match> C<path/*> and sorting the "
17187 "resulting nodes into alphabetical order."
17191 #: ../fish/guestfish-actions.pod:227
17196 #: ../fish/guestfish-actions.pod:229
17199 " aug-match augpath\n"
17204 #: ../fish/guestfish-actions.pod:235
17209 #: ../fish/guestfish-actions.pod:237
17212 " aug-mv src dest\n"
17217 #: ../fish/guestfish-actions.pod:242
17222 #: ../fish/guestfish-actions.pod:244
17225 " aug-rm augpath\n"
17230 #: ../fish/guestfish-actions.pod:250
17235 #: ../fish/guestfish-actions.pod:252
17243 #: ../fish/guestfish-actions.pod:256
17245 "The flags which were passed to C<aug-init> affect exactly how files are "
17250 #: ../fish/guestfish-actions.pod:259
17255 #: ../fish/guestfish-actions.pod:261
17258 " aug-set augpath val\n"
17263 #: ../fish/guestfish-actions.pod:265
17265 "In the Augeas API, it is possible to clear a node by setting the value to "
17266 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17267 "this call. Instead you must use the C<aug-clear> call."
17271 #: ../fish/guestfish-actions.pod:270
17276 #: ../fish/guestfish-actions.pod:272
17279 " available 'groups ...'\n"
17284 #: ../fish/guestfish-actions.pod:278
17286 "The libguestfs groups, and the functions that those groups correspond to, "
17287 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17288 "runtime by calling C<available-all-groups>."
17292 #: ../fish/guestfish-actions.pod:302
17293 msgid "You must call C<launch> before calling this function."
17297 #: ../fish/guestfish-actions.pod:324
17299 "This call was added in version C<1.0.80>. In previous versions of "
17300 "libguestfs all you could do would be to speculatively execute a command to "
17301 "find out if the daemon implemented it. See also C<version>."
17305 #: ../fish/guestfish-actions.pod:331
17306 msgid "available-all-groups"
17310 #: ../fish/guestfish-actions.pod:333
17313 " available-all-groups\n"
17318 #: ../fish/guestfish-actions.pod:335
17320 "This command returns a list of all optional groups that this daemon knows "
17321 "about. Note this returns both supported and unsupported groups. To find "
17322 "out which ones the daemon can actually support you have to call C<available> "
17323 "on each member of the returned list."
17327 #: ../fish/guestfish-actions.pod:341
17328 msgid "See also C<available> and L<guestfs(3)/AVAILABILITY>."
17332 #: ../fish/guestfish-actions.pod:343
17337 #: ../fish/guestfish-actions.pod:345
17340 " base64-in (base64file|-) filename\n"
17345 #: ../fish/guestfish-actions.pod:350 ../fish/guestfish-actions.pod:359
17346 #: ../fish/guestfish-actions.pod:583 ../fish/guestfish-actions.pod:730
17347 #: ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:1154
17348 #: ../fish/guestfish-actions.pod:3752 ../fish/guestfish-actions.pod:3764
17349 #: ../fish/guestfish-actions.pod:3775 ../fish/guestfish-actions.pod:3786
17350 #: ../fish/guestfish-actions.pod:3838 ../fish/guestfish-actions.pod:3847
17351 #: ../fish/guestfish-actions.pod:3897
17352 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17356 #: ../fish/guestfish-actions.pod:352
17361 #: ../fish/guestfish-actions.pod:354
17364 " base64-out filename (base64file|-)\n"
17369 #: ../fish/guestfish-actions.pod:361
17370 msgid "blockdev-flushbufs"
17374 #: ../fish/guestfish-actions.pod:363
17377 " blockdev-flushbufs device\n"
17382 #: ../fish/guestfish-actions.pod:370
17383 msgid "blockdev-getbsz"
17387 #: ../fish/guestfish-actions.pod:372
17390 " blockdev-getbsz device\n"
17395 #: ../fish/guestfish-actions.pod:381
17396 msgid "blockdev-getro"
17400 #: ../fish/guestfish-actions.pod:383
17403 " blockdev-getro device\n"
17408 #: ../fish/guestfish-actions.pod:390
17409 msgid "blockdev-getsize64"
17413 #: ../fish/guestfish-actions.pod:392
17416 " blockdev-getsize64 device\n"
17421 #: ../fish/guestfish-actions.pod:396
17422 msgid "See also C<blockdev-getsz>."
17426 #: ../fish/guestfish-actions.pod:400
17427 msgid "blockdev-getss"
17431 #: ../fish/guestfish-actions.pod:402
17434 " blockdev-getss device\n"
17439 #: ../fish/guestfish-actions.pod:407
17441 "(Note, this is not the size in sectors, use C<blockdev-getsz> for that)."
17445 #: ../fish/guestfish-actions.pod:412
17446 msgid "blockdev-getsz"
17450 #: ../fish/guestfish-actions.pod:414
17453 " blockdev-getsz device\n"
17458 #: ../fish/guestfish-actions.pod:419
17460 "See also C<blockdev-getss> for the real sector size of the device, and "
17461 "C<blockdev-getsize64> for the more useful I<size in bytes>."
17465 #: ../fish/guestfish-actions.pod:425
17466 msgid "blockdev-rereadpt"
17470 #: ../fish/guestfish-actions.pod:427
17473 " blockdev-rereadpt device\n"
17478 #: ../fish/guestfish-actions.pod:433
17479 msgid "blockdev-setbsz"
17483 #: ../fish/guestfish-actions.pod:435
17486 " blockdev-setbsz device blocksize\n"
17491 #: ../fish/guestfish-actions.pod:444
17492 msgid "blockdev-setro"
17496 #: ../fish/guestfish-actions.pod:446
17499 " blockdev-setro device\n"
17504 #: ../fish/guestfish-actions.pod:452
17505 msgid "blockdev-setrw"
17509 #: ../fish/guestfish-actions.pod:454
17512 " blockdev-setrw device\n"
17517 #: ../fish/guestfish-actions.pod:460
17518 msgid "case-sensitive-path"
17522 #: ../fish/guestfish-actions.pod:462
17525 " case-sensitive-path path\n"
17530 #: ../fish/guestfish-actions.pod:486
17532 "Thus C<case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
17533 "WINDOWS/system32\"> (the exact return value would depend on details of how "
17534 "the directories were originally created under Windows)."
17538 #: ../fish/guestfish-actions.pod:494
17539 msgid "See also C<realpath>."
17543 #: ../fish/guestfish-actions.pod:496
17548 #: ../fish/guestfish-actions.pod:498
17556 #: ../fish/guestfish-actions.pod:502
17558 "Note that this function cannot correctly handle binary files (specifically, "
17559 "files containing C<\\0> character which is treated as end of string). For "
17560 "those you need to use the C<read-file> or C<download> functions which have a "
17561 "more complex interface."
17565 #: ../fish/guestfish-actions.pod:510
17570 #: ../fish/guestfish-actions.pod:512
17573 " checksum csumtype path\n"
17578 #: ../fish/guestfish-actions.pod:555
17579 msgid "To get the checksum for a device, use C<checksum-device>."
17583 #: ../fish/guestfish-actions.pod:557
17584 msgid "To get the checksums for many files, use C<checksums-out>."
17588 #: ../fish/guestfish-actions.pod:559
17589 msgid "checksum-device"
17593 #: ../fish/guestfish-actions.pod:561
17596 " checksum-device csumtype device\n"
17601 #: ../fish/guestfish-actions.pod:563
17603 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
17604 "device named C<device>. For the types of checksums supported see the "
17605 "C<checksum> command."
17609 #: ../fish/guestfish-actions.pod:567
17610 msgid "checksums-out"
17614 #: ../fish/guestfish-actions.pod:569
17617 " checksums-out csumtype directory (sumsfile|-)\n"
17622 #: ../fish/guestfish-actions.pod:585
17627 #: ../fish/guestfish-actions.pod:587
17630 " chmod mode path\n"
17635 #: ../fish/guestfish-actions.pod:598
17640 #: ../fish/guestfish-actions.pod:600
17643 " chown owner group path\n"
17648 #: ../fish/guestfish-actions.pod:608
17653 #: ../fish/guestfish-actions.pod:610
17656 " command 'arguments ...'\n"
17661 #: ../fish/guestfish-actions.pod:617
17663 "The single parameter is an argv-style list of arguments. The first element "
17664 "is the name of the program to run. Subsequent elements are parameters. The "
17665 "list must be non-empty (ie. must contain a program name). Note that the "
17666 "command runs directly, and is I<not> invoked via the shell (see C<sh>)."
17670 #: ../fish/guestfish-actions.pod:645
17671 msgid "command-lines"
17675 #: ../fish/guestfish-actions.pod:647
17678 " command-lines 'arguments ...'\n"
17683 #: ../fish/guestfish-actions.pod:649
17685 "This is the same as C<command>, but splits the result into a list of lines."
17689 #: ../fish/guestfish-actions.pod:652
17690 msgid "See also: C<sh-lines>"
17694 #: ../fish/guestfish-actions.pod:657
17699 #: ../fish/guestfish-actions.pod:659
17702 " config qemuparam qemuvalue\n"
17707 #: ../fish/guestfish-actions.pod:670
17712 #: ../fish/guestfish-actions.pod:672
17715 " copy-size src dest size\n"
17720 #: ../fish/guestfish-actions.pod:680
17725 #: ../fish/guestfish-actions.pod:682
17733 #: ../fish/guestfish-actions.pod:687
17738 #: ../fish/guestfish-actions.pod:689
17746 #: ../fish/guestfish-actions.pod:694
17751 #: ../fish/guestfish-actions.pod:696
17759 #: ../fish/guestfish-actions.pod:703
17761 "If the destination is a device, it must be as large or larger than the "
17762 "source file or device, otherwise the copy will fail. This command cannot do "
17763 "partial copies (see C<copy-size>)."
17767 #: ../fish/guestfish-actions.pod:707
17772 #: ../fish/guestfish-actions.pod:709
17775 " debug subcmd 'extraargs ...'\n"
17780 #: ../fish/guestfish-actions.pod:711
17782 "The C<debug> command exposes some internals of C<guestfsd> (the guestfs "
17783 "daemon) that runs inside the qemu subprocess."
17787 #: ../fish/guestfish-actions.pod:719
17788 msgid "debug-upload"
17792 #: ../fish/guestfish-actions.pod:721
17795 " debug-upload (filename|-) tmpname mode\n"
17800 #: ../fish/guestfish-actions.pod:723
17801 msgid "The C<debug-upload> command uploads a file to the libguestfs appliance."
17805 #: ../fish/guestfish-actions.pod:732
17810 #: ../fish/guestfish-actions.pod:734
17818 #: ../fish/guestfish-actions.pod:742
17823 #: ../fish/guestfish-actions.pod:744
17831 #: ../fish/guestfish-actions.pod:753
17836 #: ../fish/guestfish-actions.pod:755
17844 #: ../fish/guestfish-actions.pod:761
17846 "Another way to get the same information is to enable verbose messages with "
17847 "C<set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17848 "before running the program."
17852 #: ../fish/guestfish-actions.pod:766
17857 #: ../fish/guestfish-actions.pod:768
17860 " download remotefilename (filename|-)\n"
17865 #: ../fish/guestfish-actions.pod:775
17866 msgid "See also C<upload>, C<cat>."
17870 #: ../fish/guestfish-actions.pod:779
17871 msgid "drop-caches"
17875 #: ../fish/guestfish-actions.pod:781
17878 " drop-caches whattodrop\n"
17883 #: ../fish/guestfish-actions.pod:793
17888 #: ../fish/guestfish-actions.pod:795
17896 #: ../fish/guestfish-actions.pod:807
17901 #: ../fish/guestfish-actions.pod:809
17904 " e2fsck-f device\n"
17909 #: ../fish/guestfish-actions.pod:815
17911 "This command is only needed because of C<resize2fs> (q.v.). Normally you "
17912 "should use C<fsck>."
17916 #: ../fish/guestfish-actions.pod:818
17917 msgid "echo-daemon"
17921 #: ../fish/guestfish-actions.pod:820
17924 " echo-daemon 'words ...'\n"
17929 #: ../fish/guestfish-actions.pod:827
17930 msgid "See also C<ping-daemon>."
17934 #: ../fish/guestfish-actions.pod:829
17939 #: ../fish/guestfish-actions.pod:831
17942 " egrep regex path\n"
17947 #: ../fish/guestfish-actions.pod:839
17952 #: ../fish/guestfish-actions.pod:841
17955 " egrepi regex path\n"
17960 #: ../fish/guestfish-actions.pod:849
17965 #: ../fish/guestfish-actions.pod:851
17968 " equal file1 file2\n"
17973 #: ../fish/guestfish-actions.pod:858
17978 #: ../fish/guestfish-actions.pod:860
17986 #: ../fish/guestfish-actions.pod:865
17987 msgid "See also C<is-file>, C<is-dir>, C<stat>."
17991 #: ../fish/guestfish-actions.pod:867
17996 #: ../fish/guestfish-actions.pod:869
17999 " fallocate path len\n"
18004 #: ../fish/guestfish-actions.pod:886
18005 msgid "fallocate64"
18009 #: ../fish/guestfish-actions.pod:888
18012 " fallocate64 path len\n"
18017 #: ../fish/guestfish-actions.pod:894
18019 "Note that this call allocates disk blocks for the file. To create a sparse "
18020 "file use C<truncate-size> instead."
18024 #: ../fish/guestfish-actions.pod:897
18026 "The deprecated call C<fallocate> does the same, but owing to an oversight it "
18027 "only allowed 30 bit lengths to be specified, effectively limiting the "
18028 "maximum size of files created through that call to 1GB."
18032 #: ../fish/guestfish-actions.pod:906
18037 #: ../fish/guestfish-actions.pod:908
18040 " fgrep pattern path\n"
18045 #: ../fish/guestfish-actions.pod:916
18050 #: ../fish/guestfish-actions.pod:918
18053 " fgrepi pattern path\n"
18058 #: ../fish/guestfish-actions.pod:926
18063 #: ../fish/guestfish-actions.pod:928
18071 #: ../fish/guestfish-actions.pod:940
18073 "This command can also be used on C</dev/> devices (and partitions, LV "
18074 "names). You can for example use this to determine if a device contains a "
18075 "filesystem, although it's usually better to use C<vfs-type>."
18079 #: ../fish/guestfish-actions.pod:950
18080 msgid "file-architecture"
18084 #: ../fish/guestfish-actions.pod:952
18087 " file-architecture filename\n"
18092 #: ../fish/guestfish-actions.pod:1055
18097 #: ../fish/guestfish-actions.pod:1057
18105 #: ../fish/guestfish-actions.pod:1061
18107 "To get other stats about a file, use C<stat>, C<lstat>, C<is-dir>, C<is-"
18108 "file> etc. To get the size of block devices, use C<blockdev-getsize64>."
18112 #: ../fish/guestfish-actions.pod:1065
18117 #: ../fish/guestfish-actions.pod:1067
18120 " fill c len path\n"
18125 #: ../fish/guestfish-actions.pod:1073
18127 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18128 "C<truncate-size>. To create a file with a pattern of repeating bytes use "
18133 #: ../fish/guestfish-actions.pod:1078
18134 msgid "fill-pattern"
18138 #: ../fish/guestfish-actions.pod:1080
18141 " fill-pattern pattern len path\n"
18146 #: ../fish/guestfish-actions.pod:1082
18148 "This function is like C<fill> except that it creates a new file of length "
18149 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18150 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18155 #: ../fish/guestfish-actions.pod:1087
18160 #: ../fish/guestfish-actions.pod:1089
18163 " find directory\n"
18168 #: ../fish/guestfish-actions.pod:1103
18169 msgid "then the returned list from C<find> C</tmp> would be 4 elements:"
18173 #: ../fish/guestfish-actions.pod:1116
18174 msgid "See also C<find0>."
18178 #: ../fish/guestfish-actions.pod:1121
18183 #: ../fish/guestfish-actions.pod:1123
18186 " find0 directory (files|-)\n"
18191 #: ../fish/guestfish-actions.pod:1129
18193 "This command works the same way as C<find> with the following exceptions:"
18197 #: ../fish/guestfish-actions.pod:1156
18198 msgid "findfs-label"
18202 #: ../fish/guestfish-actions.pod:1158
18205 " findfs-label label\n"
18210 #: ../fish/guestfish-actions.pod:1164
18211 msgid "To find the label of a filesystem, use C<vfs-label>."
18215 #: ../fish/guestfish-actions.pod:1166
18216 msgid "findfs-uuid"
18220 #: ../fish/guestfish-actions.pod:1168
18223 " findfs-uuid uuid\n"
18228 #: ../fish/guestfish-actions.pod:1174
18229 msgid "To find the UUID of a filesystem, use C<vfs-uuid>."
18233 #: ../fish/guestfish-actions.pod:1176
18238 #: ../fish/guestfish-actions.pod:1178
18241 " fsck fstype device\n"
18246 #: ../fish/guestfish-actions.pod:1208
18251 #: ../fish/guestfish-actions.pod:1210
18259 #: ../fish/guestfish-actions.pod:1217
18260 msgid "get-autosync"
18264 #: ../fish/guestfish-actions.pod:1219
18272 #: ../fish/guestfish-actions.pod:1223
18277 #: ../fish/guestfish-actions.pod:1225
18285 #: ../fish/guestfish-actions.pod:1229
18286 msgid "get-e2label"
18290 #: ../fish/guestfish-actions.pod:1231
18293 " get-e2label device\n"
18298 #: ../fish/guestfish-actions.pod:1243
18303 #: ../fish/guestfish-actions.pod:1245
18306 " get-e2uuid device\n"
18311 #: ../fish/guestfish-actions.pod:1257
18312 msgid "get-memsize"
18316 #: ../fish/guestfish-actions.pod:1259
18324 #: ../fish/guestfish-actions.pod:1264
18326 "If C<set-memsize> was not called on this handle, and if "
18327 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18328 "value for memsize."
18332 #: ../fish/guestfish-actions.pod:1271
18333 msgid "get-network"
18337 #: ../fish/guestfish-actions.pod:1273
18345 #: ../fish/guestfish-actions.pod:1277
18350 #: ../fish/guestfish-actions.pod:1279
18358 #: ../fish/guestfish-actions.pod:1286
18359 msgid "get-pid | pid"
18363 #: ../fish/guestfish-actions.pod:1288
18371 #: ../fish/guestfish-actions.pod:1295
18376 #: ../fish/guestfish-actions.pod:1297
18384 #: ../fish/guestfish-actions.pod:1304
18385 msgid "get-recovery-proc"
18389 #: ../fish/guestfish-actions.pod:1306
18392 " get-recovery-proc\n"
18397 #: ../fish/guestfish-actions.pod:1310
18398 msgid "get-selinux"
18402 #: ../fish/guestfish-actions.pod:1312
18410 #: ../fish/guestfish-actions.pod:1314
18412 "This returns the current setting of the selinux flag which is passed to the "
18413 "appliance at boot time. See C<set-selinux>."
18417 #: ../fish/guestfish-actions.pod:1320
18422 #: ../fish/guestfish-actions.pod:1322
18430 #: ../fish/guestfish-actions.pod:1329
18435 #: ../fish/guestfish-actions.pod:1331
18443 #: ../fish/guestfish-actions.pod:1335
18448 #: ../fish/guestfish-actions.pod:1337
18456 #: ../fish/guestfish-actions.pod:1339
18458 "Return the current umask. By default the umask is C<022> unless it has been "
18459 "set by calling C<umask>."
18463 #: ../fish/guestfish-actions.pod:1342
18464 msgid "get-verbose"
18468 #: ../fish/guestfish-actions.pod:1344
18476 #: ../fish/guestfish-actions.pod:1348
18481 #: ../fish/guestfish-actions.pod:1350
18489 #: ../fish/guestfish-actions.pod:1354
18490 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<setcon>"
18494 #: ../fish/guestfish-actions.pod:1357
18499 #: ../fish/guestfish-actions.pod:1359
18502 " getxattrs path\n"
18507 #: ../fish/guestfish-actions.pod:1367
18508 msgid "See also: C<lgetxattrs>, L<attr(5)>."
18512 #: ../fish/guestfish-actions.pod:1369
18513 msgid "glob-expand"
18517 #: ../fish/guestfish-actions.pod:1371
18520 " glob-expand pattern\n"
18525 #: ../fish/guestfish-actions.pod:1384
18530 #: ../fish/guestfish-actions.pod:1386
18533 " grep regex path\n"
18538 #: ../fish/guestfish-actions.pod:1394
18543 #: ../fish/guestfish-actions.pod:1396
18546 " grepi regex path\n"
18551 #: ../fish/guestfish-actions.pod:1404
18552 msgid "grub-install"
18556 #: ../fish/guestfish-actions.pod:1406
18559 " grub-install root device\n"
18564 #: ../fish/guestfish-actions.pod:1422
18569 #: ../fish/guestfish-actions.pod:1424
18577 #: ../fish/guestfish-actions.pod:1432
18582 #: ../fish/guestfish-actions.pod:1434
18585 " head-n nrlines path\n"
18590 #: ../fish/guestfish-actions.pod:1447
18595 #: ../fish/guestfish-actions.pod:1449
18603 #: ../fish/guestfish-actions.pod:1457
18608 #: ../fish/guestfish-actions.pod:1459
18611 " initrd-cat initrdpath filename\n"
18616 #: ../fish/guestfish-actions.pod:1471
18617 msgid "See also C<initrd-list>."
18621 #: ../fish/guestfish-actions.pod:1476
18622 msgid "initrd-list"
18626 #: ../fish/guestfish-actions.pod:1478
18629 " initrd-list path\n"
18634 #: ../fish/guestfish-actions.pod:1490
18635 msgid "inotify-add-watch"
18639 #: ../fish/guestfish-actions.pod:1492
18642 " inotify-add-watch path mask\n"
18647 #: ../fish/guestfish-actions.pod:1504
18648 msgid "inotify-close"
18652 #: ../fish/guestfish-actions.pod:1506
18660 #: ../fish/guestfish-actions.pod:1512
18661 msgid "inotify-files"
18665 #: ../fish/guestfish-actions.pod:1514
18673 #: ../fish/guestfish-actions.pod:1516
18675 "This function is a helpful wrapper around C<inotify-read> which just returns "
18676 "a list of pathnames of objects that were touched. The returned pathnames "
18677 "are sorted and deduplicated."
18681 #: ../fish/guestfish-actions.pod:1520
18682 msgid "inotify-init"
18686 #: ../fish/guestfish-actions.pod:1522
18689 " inotify-init maxevents\n"
18694 #: ../fish/guestfish-actions.pod:1528
18696 "C<maxevents> is the maximum number of events which will be queued up between "
18697 "calls to C<inotify-read> or C<inotify-files>. If this is passed as C<0>, "
18698 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
18699 "default was 16384 events. Beyond this limit, the kernel throws away events, "
18700 "but records the fact that it threw them away by setting a flag "
18701 "C<IN_Q_OVERFLOW> in the returned structure list (see C<inotify-read>)."
18705 #: ../fish/guestfish-actions.pod:1538
18707 "Before any events are generated, you have to add some watches to the "
18708 "internal watch list. See: C<inotify-add-watch>, C<inotify-rm-watch> and "
18709 "C<inotify-watch-all>."
18713 #: ../fish/guestfish-actions.pod:1544
18715 "Queued up events should be read periodically by calling C<inotify-read> (or "
18716 "C<inotify-files> which is just a helpful wrapper around C<inotify-read>). "
18717 "If you don't read the events out often enough then you risk the internal "
18718 "queue overflowing."
18722 #: ../fish/guestfish-actions.pod:1551
18724 "The handle should be closed after use by calling C<inotify-close>. This "
18725 "also removes any watches automatically."
18729 #: ../fish/guestfish-actions.pod:1560
18730 msgid "inotify-read"
18734 #: ../fish/guestfish-actions.pod:1562
18742 #: ../fish/guestfish-actions.pod:1575
18743 msgid "inotify-rm-watch"
18747 #: ../fish/guestfish-actions.pod:1577
18750 " inotify-rm-watch wd\n"
18755 #: ../fish/guestfish-actions.pod:1579
18756 msgid "Remove a previously defined inotify watch. See C<inotify-add-watch>."
18760 #: ../fish/guestfish-actions.pod:1582
18761 msgid "inspect-get-arch"
18765 #: ../fish/guestfish-actions.pod:1584
18768 " inspect-get-arch root\n"
18773 #: ../fish/guestfish-actions.pod:1586 ../fish/guestfish-actions.pod:1602
18774 #: ../fish/guestfish-actions.pod:1648 ../fish/guestfish-actions.pod:1666
18775 #: ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:1702
18776 #: ../fish/guestfish-actions.pod:1725 ../fish/guestfish-actions.pod:1742
18778 "This function should only be called with a root device string as returned by "
18783 #: ../fish/guestfish-actions.pod:1589
18785 "This returns the architecture of the inspected operating system. The "
18786 "possible return values are listed under C<file-architecture>."
18790 #: ../fish/guestfish-actions.pod:1598
18791 msgid "inspect-get-distro"
18795 #: ../fish/guestfish-actions.pod:1600
18798 " inspect-get-distro root\n"
18803 #: ../fish/guestfish-actions.pod:1644
18804 msgid "inspect-get-filesystems"
18808 #: ../fish/guestfish-actions.pod:1646
18811 " inspect-get-filesystems root\n"
18816 #: ../fish/guestfish-actions.pod:1659
18818 "Please read L<guestfs(3)/INSPECTION> for more details. See also C<inspect-"
18819 "get-mountpoints>."
18823 #: ../fish/guestfish-actions.pod:1662
18824 msgid "inspect-get-major-version"
18828 #: ../fish/guestfish-actions.pod:1664
18831 " inspect-get-major-version root\n"
18836 #: ../fish/guestfish-actions.pod:1683
18837 msgid "inspect-get-minor-version"
18841 #: ../fish/guestfish-actions.pod:1685
18844 " inspect-get-minor-version root\n"
18849 #: ../fish/guestfish-actions.pod:1695
18851 "Please read L<guestfs(3)/INSPECTION> for more details. See also C<inspect-"
18852 "get-major-version>."
18856 #: ../fish/guestfish-actions.pod:1698
18857 msgid "inspect-get-mountpoints"
18861 #: ../fish/guestfish-actions.pod:1700
18864 " inspect-get-mountpoints root\n"
18869 #: ../fish/guestfish-actions.pod:1718
18871 "Please read L<guestfs(3)/INSPECTION> for more details. See also C<inspect-"
18872 "get-filesystems>."
18876 #: ../fish/guestfish-actions.pod:1721
18877 msgid "inspect-get-product-name"
18881 #: ../fish/guestfish-actions.pod:1723
18884 " inspect-get-product-name root\n"
18889 #: ../fish/guestfish-actions.pod:1738
18890 msgid "inspect-get-type"
18894 #: ../fish/guestfish-actions.pod:1740
18897 " inspect-get-type root\n"
18902 #: ../fish/guestfish-actions.pod:1769
18907 #: ../fish/guestfish-actions.pod:1771
18915 #: ../fish/guestfish-actions.pod:1786
18917 "You can pass the root string(s) returned to other C<inspect-get-*> functions "
18918 "in order to query further information about each operating system, such as "
18919 "the name and version."
18923 #: ../fish/guestfish-actions.pod:1791
18925 "This function uses other libguestfs features such as C<mount-ro> and "
18926 "C<umount-all> in order to mount and unmount filesystems and look at the "
18927 "contents. This should be called with no disks currently mounted. The "
18928 "function may also use Augeas, so any existing Augeas handle will be closed."
18932 #: ../fish/guestfish-actions.pod:1803 ../fish/guestfish-actions.pod:1957
18933 #: ../fish/guestfish-actions.pod:2003
18934 msgid "See also C<list-filesystems>."
18938 #: ../fish/guestfish-actions.pod:1805
18939 msgid "is-blockdev"
18943 #: ../fish/guestfish-actions.pod:1807
18946 " is-blockdev path\n"
18951 #: ../fish/guestfish-actions.pod:1812 ../fish/guestfish-actions.pod:1830
18952 #: ../fish/guestfish-actions.pod:1849 ../fish/guestfish-actions.pod:1858
18953 #: ../fish/guestfish-actions.pod:1868 ../fish/guestfish-actions.pod:1902
18954 #: ../fish/guestfish-actions.pod:1911
18955 msgid "See also C<stat>."
18959 #: ../fish/guestfish-actions.pod:1814
18964 #: ../fish/guestfish-actions.pod:1816
18972 #: ../fish/guestfish-actions.pod:1823
18977 #: ../fish/guestfish-actions.pod:1825
18980 " is-chardev path\n"
18985 #: ../fish/guestfish-actions.pod:1832
18990 #: ../fish/guestfish-actions.pod:1834
18998 #: ../fish/guestfish-actions.pod:1841
19003 #: ../fish/guestfish-actions.pod:1843
19011 #: ../fish/guestfish-actions.pod:1851
19016 #: ../fish/guestfish-actions.pod:1853
19024 #: ../fish/guestfish-actions.pod:1860
19029 #: ../fish/guestfish-actions.pod:1862
19037 #: ../fish/guestfish-actions.pod:1870
19038 msgid "is-launching"
19042 #: ../fish/guestfish-actions.pod:1872
19050 #: ../fish/guestfish-actions.pod:1879
19055 #: ../fish/guestfish-actions.pod:1881
19063 #: ../fish/guestfish-actions.pod:1886
19068 #: ../fish/guestfish-actions.pod:1888
19076 #: ../fish/guestfish-actions.pod:1895
19081 #: ../fish/guestfish-actions.pod:1897
19084 " is-socket path\n"
19089 #: ../fish/guestfish-actions.pod:1904
19094 #: ../fish/guestfish-actions.pod:1906
19097 " is-symlink path\n"
19102 #: ../fish/guestfish-actions.pod:1913
19103 msgid "kill-subprocess"
19107 #: ../fish/guestfish-actions.pod:1915
19110 " kill-subprocess\n"
19115 #: ../fish/guestfish-actions.pod:1919
19116 msgid "launch | run"
19120 #: ../fish/guestfish-actions.pod:1921
19128 #: ../fish/guestfish-actions.pod:1929
19133 #: ../fish/guestfish-actions.pod:1931
19136 " lchown owner group path\n"
19141 #: ../fish/guestfish-actions.pod:1933
19143 "Change the file owner to C<owner> and group to C<group>. This is like "
19144 "C<chown> but if C<path> is a symlink then the link itself is changed, not "
19149 #: ../fish/guestfish-actions.pod:1941
19154 #: ../fish/guestfish-actions.pod:1943
19157 " lgetxattrs path\n"
19162 #: ../fish/guestfish-actions.pod:1945
19164 "This is the same as C<getxattrs>, but if C<path> is a symbolic link, then it "
19165 "returns the extended attributes of the link itself."
19169 #: ../fish/guestfish-actions.pod:1949
19170 msgid "list-devices"
19174 #: ../fish/guestfish-actions.pod:1951
19182 #: ../fish/guestfish-actions.pod:1959
19183 msgid "list-filesystems"
19187 #: ../fish/guestfish-actions.pod:1961
19190 " list-filesystems\n"
19195 #: ../fish/guestfish-actions.pod:1980
19197 "This command runs other libguestfs commands, which might include C<mount> "
19198 "and C<umount>, and therefore you should use this soon after launch and only "
19199 "when nothing is mounted."
19203 #: ../fish/guestfish-actions.pod:1984
19205 "Not all of the filesystems returned will be mountable. In particular, swap "
19206 "partitions are returned in the list. Also this command does not check that "
19207 "each filesystem found is valid and mountable, and some filesystems might be "
19208 "mountable but require special options. Filesystems may not all belong to a "
19209 "single logical operating system (use C<inspect-os> to look for OSes)."
19213 #: ../fish/guestfish-actions.pod:1992
19214 msgid "list-partitions"
19218 #: ../fish/guestfish-actions.pod:1994
19221 " list-partitions\n"
19226 #: ../fish/guestfish-actions.pod:2000
19228 "This does not return logical volumes. For that you will need to call C<lvs>."
19232 #: ../fish/guestfish-actions.pod:2005
19237 #: ../fish/guestfish-actions.pod:2007
19245 #: ../fish/guestfish-actions.pod:2015
19250 #: ../fish/guestfish-actions.pod:2017
19253 " ln target linkname\n"
19258 #: ../fish/guestfish-actions.pod:2021
19263 #: ../fish/guestfish-actions.pod:2023
19266 " ln-f target linkname\n"
19271 #: ../fish/guestfish-actions.pod:2028
19276 #: ../fish/guestfish-actions.pod:2030
19279 " ln-s target linkname\n"
19284 #: ../fish/guestfish-actions.pod:2034
19289 #: ../fish/guestfish-actions.pod:2036
19292 " ln-sf target linkname\n"
19297 #: ../fish/guestfish-actions.pod:2041
19298 msgid "lremovexattr"
19302 #: ../fish/guestfish-actions.pod:2043
19305 " lremovexattr xattr path\n"
19310 #: ../fish/guestfish-actions.pod:2045
19312 "This is the same as C<removexattr>, but if C<path> is a symbolic link, then "
19313 "it removes an extended attribute of the link itself."
19317 #: ../fish/guestfish-actions.pod:2049
19322 #: ../fish/guestfish-actions.pod:2051
19330 #: ../fish/guestfish-actions.pod:2057
19332 "This command is mostly useful for interactive sessions. Programs should "
19333 "probably use C<readdir> instead."
19337 #: ../fish/guestfish-actions.pod:2060
19342 #: ../fish/guestfish-actions.pod:2062
19345 " lsetxattr xattr val vallen path\n"
19350 #: ../fish/guestfish-actions.pod:2064
19352 "This is the same as C<setxattr>, but if C<path> is a symbolic link, then it "
19353 "sets an extended attribute of the link itself."
19357 #: ../fish/guestfish-actions.pod:2068
19362 #: ../fish/guestfish-actions.pod:2070
19370 #: ../fish/guestfish-actions.pod:2074
19372 "This is the same as C<stat> except that if C<path> is a symbolic link, then "
19373 "the link is stat-ed, not the file it refers to."
19377 #: ../fish/guestfish-actions.pod:2080
19382 #: ../fish/guestfish-actions.pod:2082
19385 " lstatlist path 'names ...'\n"
19390 #: ../fish/guestfish-actions.pod:2084
19392 "This call allows you to perform the C<lstat> operation on multiple files, "
19393 "where all files are in the directory C<path>. C<names> is the list of files "
19394 "from this directory."
19398 #: ../fish/guestfish-actions.pod:2093
19400 "This call is intended for programs that want to efficiently list a directory "
19401 "contents without making many round-trips. See also C<lxattrlist> for a "
19402 "similarly efficient call for getting extended attributes. Very long "
19403 "directory listings might cause the protocol message size to be exceeded, "
19404 "causing this call to fail. The caller must split up such requests into "
19405 "smaller groups of names."
19409 #: ../fish/guestfish-actions.pod:2101
19410 msgid "luks-add-key"
19414 #: ../fish/guestfish-actions.pod:2103
19417 " luks-add-key device keyslot\n"
19422 #: ../fish/guestfish-actions.pod:2110
19424 "Note that if C<keyslot> already contains a key, then this command will "
19425 "fail. You have to use C<luks-kill-slot> first to remove that key."
19429 #: ../fish/guestfish-actions.pod:2114 ../fish/guestfish-actions.pod:2136
19430 #: ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2163
19431 #: ../fish/guestfish-actions.pod:2186 ../fish/guestfish-actions.pod:2196
19433 "This command has one or more key or passphrase parameters. Guestfish will "
19434 "prompt for these separately."
19438 #: ../fish/guestfish-actions.pod:2117
19443 #: ../fish/guestfish-actions.pod:2119
19446 " luks-close device\n"
19451 #: ../fish/guestfish-actions.pod:2121
19453 "This closes a LUKS device that was created earlier by C<luks-open> or C<luks-"
19454 "open-ro>. The C<device> parameter must be the name of the LUKS mapping "
19455 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
19460 #: ../fish/guestfish-actions.pod:2127
19461 msgid "luks-format"
19465 #: ../fish/guestfish-actions.pod:2129
19468 " luks-format device keyslot\n"
19473 #: ../fish/guestfish-actions.pod:2142
19474 msgid "luks-format-cipher"
19478 #: ../fish/guestfish-actions.pod:2144
19481 " luks-format-cipher device keyslot cipher\n"
19486 #: ../fish/guestfish-actions.pod:2146
19488 "This command is the same as C<luks-format> but it also allows you to set the "
19493 #: ../fish/guestfish-actions.pod:2155
19494 msgid "luks-kill-slot"
19498 #: ../fish/guestfish-actions.pod:2157
19501 " luks-kill-slot device keyslot\n"
19506 #: ../fish/guestfish-actions.pod:2166
19511 #: ../fish/guestfish-actions.pod:2168
19514 " luks-open device mapname\n"
19519 #: ../fish/guestfish-actions.pod:2182
19521 "If this block device contains LVM volume groups, then calling C<vgscan> "
19522 "followed by C<vg-activate-all> will make them visible."
19526 #: ../fish/guestfish-actions.pod:2189
19527 msgid "luks-open-ro"
19531 #: ../fish/guestfish-actions.pod:2191
19534 " luks-open-ro device mapname\n"
19539 #: ../fish/guestfish-actions.pod:2193
19541 "This is the same as C<luks-open> except that a read-only mapping is created."
19545 #: ../fish/guestfish-actions.pod:2199
19550 #: ../fish/guestfish-actions.pod:2201
19553 " lvcreate logvol volgroup mbytes\n"
19558 #: ../fish/guestfish-actions.pod:2206
19559 msgid "lvm-clear-filter"
19563 #: ../fish/guestfish-actions.pod:2208
19566 " lvm-clear-filter\n"
19571 #: ../fish/guestfish-actions.pod:2210
19573 "This undoes the effect of C<lvm-set-filter>. LVM will be able to see every "
19578 #: ../fish/guestfish-actions.pod:2216
19579 msgid "lvm-remove-all"
19583 #: ../fish/guestfish-actions.pod:2218
19586 " lvm-remove-all\n"
19591 #: ../fish/guestfish-actions.pod:2226
19592 msgid "lvm-set-filter"
19596 #: ../fish/guestfish-actions.pod:2228
19599 " lvm-set-filter 'devices ...'\n"
19604 #: ../fish/guestfish-actions.pod:2253
19609 #: ../fish/guestfish-actions.pod:2255
19612 " lvremove device\n"
19617 #: ../fish/guestfish-actions.pod:2263
19622 #: ../fish/guestfish-actions.pod:2265
19625 " lvrename logvol newlogvol\n"
19630 #: ../fish/guestfish-actions.pod:2269
19635 #: ../fish/guestfish-actions.pod:2271
19638 " lvresize device mbytes\n"
19643 #: ../fish/guestfish-actions.pod:2277
19644 msgid "lvresize-free"
19648 #: ../fish/guestfish-actions.pod:2279
19651 " lvresize-free lv percent\n"
19656 #: ../fish/guestfish-actions.pod:2287
19661 #: ../fish/guestfish-actions.pod:2289
19669 #: ../fish/guestfish-actions.pod:2297
19670 msgid "See also C<lvs-full>, C<list-filesystems>."
19674 #: ../fish/guestfish-actions.pod:2299
19679 #: ../fish/guestfish-actions.pod:2301
19687 #: ../fish/guestfish-actions.pod:2306
19692 #: ../fish/guestfish-actions.pod:2308
19700 #: ../fish/guestfish-actions.pod:2312
19705 #: ../fish/guestfish-actions.pod:2314
19708 " lxattrlist path 'names ...'\n"
19713 #: ../fish/guestfish-actions.pod:2330
19715 "This call is intended for programs that want to efficiently list a directory "
19716 "contents without making many round-trips. See also C<lstatlist> for a "
19717 "similarly efficient call for getting standard stats. Very long directory "
19718 "listings might cause the protocol message size to be exceeded, causing this "
19719 "call to fail. The caller must split up such requests into smaller groups of "
19724 #: ../fish/guestfish-actions.pod:2338
19729 #: ../fish/guestfish-actions.pod:2340
19737 #: ../fish/guestfish-actions.pod:2344
19742 #: ../fish/guestfish-actions.pod:2346
19745 " mkdir-mode path mode\n"
19750 #: ../fish/guestfish-actions.pod:2355
19751 msgid "See also C<mkdir>, C<umask>"
19755 #: ../fish/guestfish-actions.pod:2357
19760 #: ../fish/guestfish-actions.pod:2359
19768 #: ../fish/guestfish-actions.pod:2364
19773 #: ../fish/guestfish-actions.pod:2366
19776 " mkdtemp template\n"
19781 #: ../fish/guestfish-actions.pod:2387
19786 #: ../fish/guestfish-actions.pod:2389
19789 " mke2fs-J fstype blocksize device journal\n"
19794 #: ../fish/guestfish-actions.pod:2397
19795 msgid "See also C<mke2journal>."
19799 #: ../fish/guestfish-actions.pod:2399
19804 #: ../fish/guestfish-actions.pod:2401
19807 " mke2fs-JL fstype blocksize device label\n"
19812 #: ../fish/guestfish-actions.pod:2406
19813 msgid "See also C<mke2journal-L>."
19817 #: ../fish/guestfish-actions.pod:2408
19822 #: ../fish/guestfish-actions.pod:2410
19825 " mke2fs-JU fstype blocksize device uuid\n"
19830 #: ../fish/guestfish-actions.pod:2415
19831 msgid "See also C<mke2journal-U>."
19835 #: ../fish/guestfish-actions.pod:2417
19836 msgid "mke2journal"
19840 #: ../fish/guestfish-actions.pod:2419
19843 " mke2journal blocksize device\n"
19848 #: ../fish/guestfish-actions.pod:2426
19849 msgid "mke2journal-L"
19853 #: ../fish/guestfish-actions.pod:2428
19856 " mke2journal-L blocksize label device\n"
19861 #: ../fish/guestfish-actions.pod:2432
19862 msgid "mke2journal-U"
19866 #: ../fish/guestfish-actions.pod:2434
19869 " mke2journal-U blocksize uuid device\n"
19874 #: ../fish/guestfish-actions.pod:2438
19879 #: ../fish/guestfish-actions.pod:2440
19882 " mkfifo mode path\n"
19887 #: ../fish/guestfish-actions.pod:2442
19889 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
19890 "is just a convenient wrapper around C<mknod>."
19894 #: ../fish/guestfish-actions.pod:2448
19899 #: ../fish/guestfish-actions.pod:2450
19902 " mkfs fstype device\n"
19907 #: ../fish/guestfish-actions.pod:2456
19912 #: ../fish/guestfish-actions.pod:2458
19915 " mkfs-b fstype blocksize device\n"
19920 #: ../fish/guestfish-actions.pod:2460
19922 "This call is similar to C<mkfs>, but it allows you to control the block size "
19923 "of the resulting filesystem. Supported block sizes depend on the filesystem "
19924 "type, but typically they are C<1024>, C<2048> or C<4096> only."
19928 #: ../fish/guestfish-actions.pod:2468
19929 msgid "mkmountpoint"
19933 #: ../fish/guestfish-actions.pod:2470
19936 " mkmountpoint exemptpath\n"
19941 #: ../fish/guestfish-actions.pod:2472
19943 "C<mkmountpoint> and C<rmmountpoint> are specialized calls that can be used "
19944 "to create extra mountpoints before mounting the first filesystem."
19948 #: ../fish/guestfish-actions.pod:2496
19953 #: ../fish/guestfish-actions.pod:2498
19956 " mknod mode devmajor devminor path\n"
19961 #: ../fish/guestfish-actions.pod:2508
19963 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
19964 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
19965 "regular file). These constants are available in the standard Linux header "
19966 "files, or you can use C<mknod-b>, C<mknod-c> or C<mkfifo> which are wrappers "
19967 "around this command which bitwise OR in the appropriate constant for you."
19971 #: ../fish/guestfish-actions.pod:2518
19976 #: ../fish/guestfish-actions.pod:2520
19979 " mknod-b mode devmajor devminor path\n"
19984 #: ../fish/guestfish-actions.pod:2522
19986 "This call creates a block device node called C<path> with mode C<mode> and "
19987 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19988 "wrapper around C<mknod>."
19992 #: ../fish/guestfish-actions.pod:2528
19997 #: ../fish/guestfish-actions.pod:2530
20000 " mknod-c mode devmajor devminor path\n"
20005 #: ../fish/guestfish-actions.pod:2532
20007 "This call creates a char device node called C<path> with mode C<mode> and "
20008 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20009 "wrapper around C<mknod>."
20013 #: ../fish/guestfish-actions.pod:2538
20018 #: ../fish/guestfish-actions.pod:2540
20026 #: ../fish/guestfish-actions.pod:2544
20031 #: ../fish/guestfish-actions.pod:2546
20034 " mkswap-L label device\n"
20039 #: ../fish/guestfish-actions.pod:2554
20044 #: ../fish/guestfish-actions.pod:2556
20047 " mkswap-U uuid device\n"
20052 #: ../fish/guestfish-actions.pod:2560
20053 msgid "mkswap-file"
20057 #: ../fish/guestfish-actions.pod:2562
20060 " mkswap-file path\n"
20065 #: ../fish/guestfish-actions.pod:2566
20067 "This command just writes a swap file signature to an existing file. To "
20068 "create the file itself, use something like C<fallocate>."
20072 #: ../fish/guestfish-actions.pod:2569
20077 #: ../fish/guestfish-actions.pod:2571
20080 " modprobe modulename\n"
20085 #: ../fish/guestfish-actions.pod:2578
20090 #: ../fish/guestfish-actions.pod:2580
20093 " mount device mountpoint\n"
20098 #: ../fish/guestfish-actions.pod:2596
20100 "B<Important note:> When you use this call, the filesystem options C<sync> "
20101 "and C<noatime> are set implicitly. This was originally done because we "
20102 "thought it would improve reliability, but it turns out that I<-o sync> has a "
20103 "very large negative performance impact and negligible effect on "
20104 "reliability. Therefore we recommend that you avoid using C<mount> in any "
20105 "code that needs performance, and instead use C<mount-options> (use an empty "
20106 "string for the first parameter if you don't want any options)."
20110 #: ../fish/guestfish-actions.pod:2606
20115 #: ../fish/guestfish-actions.pod:2608
20118 " mount-loop file mountpoint\n"
20123 #: ../fish/guestfish-actions.pod:2614
20124 msgid "mount-options"
20128 #: ../fish/guestfish-actions.pod:2616
20131 " mount-options options device mountpoint\n"
20136 #: ../fish/guestfish-actions.pod:2618
20138 "This is the same as the C<mount> command, but it allows you to set the mount "
20139 "options as for the L<mount(8)> I<-o> flag."
20143 #: ../fish/guestfish-actions.pod:2626
20148 #: ../fish/guestfish-actions.pod:2628
20151 " mount-ro device mountpoint\n"
20156 #: ../fish/guestfish-actions.pod:2630
20158 "This is the same as the C<mount> command, but it mounts the filesystem with "
20159 "the read-only (I<-o ro>) flag."
20163 #: ../fish/guestfish-actions.pod:2633
20168 #: ../fish/guestfish-actions.pod:2635
20171 " mount-vfs options vfstype device mountpoint\n"
20176 #: ../fish/guestfish-actions.pod:2637
20178 "This is the same as the C<mount> command, but it allows you to set both the "
20179 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20183 #: ../fish/guestfish-actions.pod:2641
20184 msgid "mountpoints"
20188 #: ../fish/guestfish-actions.pod:2643
20196 #: ../fish/guestfish-actions.pod:2645
20198 "This call is similar to C<mounts>. That call returns a list of devices. "
20199 "This one returns a hash table (map) of device name to directory where the "
20200 "device is mounted."
20204 #: ../fish/guestfish-actions.pod:2649
20209 #: ../fish/guestfish-actions.pod:2651
20217 #: ../fish/guestfish-actions.pod:2658
20218 msgid "See also: C<mountpoints>"
20222 #: ../fish/guestfish-actions.pod:2660
20227 #: ../fish/guestfish-actions.pod:2662
20235 #: ../fish/guestfish-actions.pod:2667
20236 msgid "ntfs-3g-probe"
20240 #: ../fish/guestfish-actions.pod:2669
20243 " ntfs-3g-probe true|false device\n"
20248 #: ../fish/guestfish-actions.pod:2683
20253 #: ../fish/guestfish-actions.pod:2685
20256 " ntfsresize device\n"
20261 #: ../fish/guestfish-actions.pod:2691
20262 msgid "ntfsresize-size"
20266 #: ../fish/guestfish-actions.pod:2693
20269 " ntfsresize-size device size\n"
20274 #: ../fish/guestfish-actions.pod:2695
20276 "This command is the same as C<ntfsresize> except that it allows you to "
20277 "specify the new size (in bytes) explicitly."
20281 #: ../fish/guestfish-actions.pod:2698
20286 #: ../fish/guestfish-actions.pod:2700
20289 " part-add device prlogex startsect endsect\n"
20294 #: ../fish/guestfish-actions.pod:2702
20296 "This command adds a partition to C<device>. If there is no partition table "
20297 "on the device, call C<part-init> first."
20301 #: ../fish/guestfish-actions.pod:2714
20303 "Creating a partition which covers the whole disk is not so easy. Use C<part-"
20304 "disk> to do that."
20308 #: ../fish/guestfish-actions.pod:2717
20313 #: ../fish/guestfish-actions.pod:2719
20316 " part-del device partnum\n"
20321 #: ../fish/guestfish-actions.pod:2727
20326 #: ../fish/guestfish-actions.pod:2729
20329 " part-disk device parttype\n"
20334 #: ../fish/guestfish-actions.pod:2731
20336 "This command is simply a combination of C<part-init> followed by C<part-add> "
20337 "to create a single primary partition covering the whole disk."
20341 #: ../fish/guestfish-actions.pod:2735
20343 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
20344 "possible values are described in C<part-init>."
20348 #: ../fish/guestfish-actions.pod:2741
20349 msgid "part-get-bootable"
20353 #: ../fish/guestfish-actions.pod:2743
20356 " part-get-bootable device partnum\n"
20361 #: ../fish/guestfish-actions.pod:2748
20362 msgid "See also C<part-set-bootable>."
20366 #: ../fish/guestfish-actions.pod:2750
20367 msgid "part-get-mbr-id"
20371 #: ../fish/guestfish-actions.pod:2752
20374 " part-get-mbr-id device partnum\n"
20379 #: ../fish/guestfish-actions.pod:2757 ../fish/guestfish-actions.pod:2895
20381 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
20382 "undefined results for other partition table types (see C<part-get-parttype>)."
20386 #: ../fish/guestfish-actions.pod:2761
20387 msgid "part-get-parttype"
20391 #: ../fish/guestfish-actions.pod:2763
20394 " part-get-parttype device\n"
20399 #: ../fish/guestfish-actions.pod:2768
20401 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
20402 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
20403 "possible, although unusual. See C<part-init> for a full list."
20407 #: ../fish/guestfish-actions.pod:2773
20412 #: ../fish/guestfish-actions.pod:2775
20415 " part-init device parttype\n"
20420 #: ../fish/guestfish-actions.pod:2781
20422 "Initially there are no partitions. Following this, you should call C<part-"
20423 "add> for each partition required."
20427 #: ../fish/guestfish-actions.pod:2844
20432 #: ../fish/guestfish-actions.pod:2846
20435 " part-list device\n"
20440 #: ../fish/guestfish-actions.pod:2861
20442 "Start of the partition I<in bytes>. To get sectors you have to divide by "
20443 "the device's sector size, see C<blockdev-getss>."
20447 #: ../fish/guestfish-actions.pod:2874
20448 msgid "part-set-bootable"
20452 #: ../fish/guestfish-actions.pod:2876
20455 " part-set-bootable device partnum true|false\n"
20460 #: ../fish/guestfish-actions.pod:2885
20461 msgid "part-set-mbr-id"
20465 #: ../fish/guestfish-actions.pod:2887
20468 " part-set-mbr-id device partnum idbyte\n"
20473 #: ../fish/guestfish-actions.pod:2899
20474 msgid "part-set-name"
20478 #: ../fish/guestfish-actions.pod:2901
20481 " part-set-name device partnum name\n"
20486 #: ../fish/guestfish-actions.pod:2909
20487 msgid "part-to-dev"
20491 #: ../fish/guestfish-actions.pod:2911
20494 " part-to-dev partition\n"
20499 #: ../fish/guestfish-actions.pod:2917
20501 "The named partition must exist, for example as a string returned from C<list-"
20506 #: ../fish/guestfish-actions.pod:2920
20507 msgid "ping-daemon"
20511 #: ../fish/guestfish-actions.pod:2922
20519 #: ../fish/guestfish-actions.pod:2929
20524 #: ../fish/guestfish-actions.pod:2931
20527 " pread path count offset\n"
20532 #: ../fish/guestfish-actions.pod:2939
20533 msgid "See also C<pwrite>."
20537 #: ../fish/guestfish-actions.pod:2944
20542 #: ../fish/guestfish-actions.pod:2946
20545 " pvcreate device\n"
20550 #: ../fish/guestfish-actions.pod:2952
20555 #: ../fish/guestfish-actions.pod:2954
20558 " pvremove device\n"
20563 #: ../fish/guestfish-actions.pod:2963
20568 #: ../fish/guestfish-actions.pod:2965
20571 " pvresize device\n"
20576 #: ../fish/guestfish-actions.pod:2970
20577 msgid "pvresize-size"
20581 #: ../fish/guestfish-actions.pod:2972
20584 " pvresize-size device size\n"
20589 #: ../fish/guestfish-actions.pod:2974
20591 "This command is the same as C<pvresize> except that it allows you to specify "
20592 "the new size (in bytes) explicitly."
20596 #: ../fish/guestfish-actions.pod:2977
20601 #: ../fish/guestfish-actions.pod:2979
20609 #: ../fish/guestfish-actions.pod:2987
20610 msgid "See also C<pvs-full>."
20614 #: ../fish/guestfish-actions.pod:2989
20619 #: ../fish/guestfish-actions.pod:2991
20627 #: ../fish/guestfish-actions.pod:2996
20632 #: ../fish/guestfish-actions.pod:2998
20640 #: ../fish/guestfish-actions.pod:3002
20645 #: ../fish/guestfish-actions.pod:3004
20648 " pwrite path content offset\n"
20653 #: ../fish/guestfish-actions.pod:3015
20654 msgid "See also C<pread>."
20658 #: ../fish/guestfish-actions.pod:3020
20663 #: ../fish/guestfish-actions.pod:3022
20666 " read-file path\n"
20671 #: ../fish/guestfish-actions.pod:3027
20673 "Unlike C<cat>, this function can correctly handle files that contain "
20674 "embedded ASCII NUL characters. However unlike C<download>, this function is "
20675 "limited in the total size of file that can be handled."
20679 #: ../fish/guestfish-actions.pod:3035
20684 #: ../fish/guestfish-actions.pod:3037
20687 " read-lines path\n"
20692 #: ../fish/guestfish-actions.pod:3044
20694 "Note that this function cannot correctly handle binary files (specifically, "
20695 "files containing C<\\0> character which is treated as end of line). For "
20696 "those you need to use the C<read-file> function which has a more complex "
20701 #: ../fish/guestfish-actions.pod:3049
20706 #: ../fish/guestfish-actions.pod:3051
20714 #: ../fish/guestfish-actions.pod:3103
20716 "This function is primarily intended for use by programs. To get a simple "
20717 "list of names, use C<ls>. To get a printable directory for human "
20718 "consumption, use C<ll>."
20722 #: ../fish/guestfish-actions.pod:3107
20727 #: ../fish/guestfish-actions.pod:3109
20735 #: ../fish/guestfish-actions.pod:3113
20736 msgid "readlinklist"
20740 #: ../fish/guestfish-actions.pod:3115
20743 " readlinklist path 'names ...'\n"
20748 #: ../fish/guestfish-actions.pod:3139
20753 #: ../fish/guestfish-actions.pod:3141
20761 #: ../fish/guestfish-actions.pod:3146
20762 msgid "removexattr"
20766 #: ../fish/guestfish-actions.pod:3148
20769 " removexattr xattr path\n"
20774 #: ../fish/guestfish-actions.pod:3153
20775 msgid "See also: C<lremovexattr>, L<attr(5)>."
20779 #: ../fish/guestfish-actions.pod:3155
20784 #: ../fish/guestfish-actions.pod:3157
20787 " resize2fs device\n"
20792 #: ../fish/guestfish-actions.pod:3162
20794 "I<Note:> It is sometimes required that you run C<e2fsck-f> on the C<device> "
20795 "before calling this command. For unknown reasons C<resize2fs> sometimes "
20796 "gives an error about this and sometimes not. In any case, it is always safe "
20797 "to call C<e2fsck-f> before calling this function."
20801 #: ../fish/guestfish-actions.pod:3168
20802 msgid "resize2fs-size"
20806 #: ../fish/guestfish-actions.pod:3170
20809 " resize2fs-size device size\n"
20814 #: ../fish/guestfish-actions.pod:3172
20816 "This command is the same as C<resize2fs> except that it allows you to "
20817 "specify the new size (in bytes) explicitly."
20821 #: ../fish/guestfish-actions.pod:3175
20826 #: ../fish/guestfish-actions.pod:3177
20834 #: ../fish/guestfish-actions.pod:3181
20839 #: ../fish/guestfish-actions.pod:3183
20847 #: ../fish/guestfish-actions.pod:3189
20852 #: ../fish/guestfish-actions.pod:3191
20860 #: ../fish/guestfish-actions.pod:3195
20861 msgid "rmmountpoint"
20865 #: ../fish/guestfish-actions.pod:3197
20868 " rmmountpoint exemptpath\n"
20873 #: ../fish/guestfish-actions.pod:3199
20875 "This calls removes a mountpoint that was previously created with "
20876 "C<mkmountpoint>. See C<mkmountpoint> for full details."
20880 #: ../fish/guestfish-actions.pod:3203
20881 msgid "scrub-device"
20885 #: ../fish/guestfish-actions.pod:3205
20888 " scrub-device device\n"
20893 #: ../fish/guestfish-actions.pod:3216
20898 #: ../fish/guestfish-actions.pod:3218
20901 " scrub-file file\n"
20906 #: ../fish/guestfish-actions.pod:3228
20907 msgid "scrub-freespace"
20911 #: ../fish/guestfish-actions.pod:3230
20914 " scrub-freespace dir\n"
20919 #: ../fish/guestfish-actions.pod:3232
20921 "This command creates the directory C<dir> and then fills it with files until "
20922 "the filesystem is full, and scrubs the files as for C<scrub-file>, and "
20923 "deletes them. The intention is to scrub any free space on the partition "
20924 "containing C<dir>."
20928 #: ../fish/guestfish-actions.pod:3241
20929 msgid "set-append | append"
20933 #: ../fish/guestfish-actions.pod:3243
20936 " set-append append\n"
20941 #: ../fish/guestfish-actions.pod:3254
20942 msgid "set-autosync | autosync"
20946 #: ../fish/guestfish-actions.pod:3256
20949 " set-autosync true|false\n"
20954 #: ../fish/guestfish-actions.pod:3258
20956 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
20957 "effort attempt to run C<umount-all> followed by C<sync> when the handle is "
20958 "closed (also if the program exits without closing handles)."
20962 #: ../fish/guestfish-actions.pod:3266
20963 msgid "set-direct | direct"
20967 #: ../fish/guestfish-actions.pod:3268
20970 " set-direct true|false\n"
20975 #: ../fish/guestfish-actions.pod:3274
20977 "One consequence of this is that log messages aren't caught by the library "
20978 "and handled by C<set-log-message-callback>, but go straight to stdout."
20982 #: ../fish/guestfish-actions.pod:3283
20983 msgid "set-e2label"
20987 #: ../fish/guestfish-actions.pod:3285
20990 " set-e2label device label\n"
20995 #: ../fish/guestfish-actions.pod:3291
20997 "You can use either C<tune2fs-l> or C<get-e2label> to return the existing "
20998 "label on a filesystem."
21002 #: ../fish/guestfish-actions.pod:3294
21007 #: ../fish/guestfish-actions.pod:3296
21010 " set-e2uuid device uuid\n"
21015 #: ../fish/guestfish-actions.pod:3303
21017 "You can use either C<tune2fs-l> or C<get-e2uuid> to return the existing UUID "
21022 #: ../fish/guestfish-actions.pod:3306
21023 msgid "set-memsize | memsize"
21027 #: ../fish/guestfish-actions.pod:3308
21030 " set-memsize memsize\n"
21035 #: ../fish/guestfish-actions.pod:3310
21037 "This sets the memory size in megabytes allocated to the qemu subprocess. "
21038 "This only has any effect if called before C<launch>."
21042 #: ../fish/guestfish-actions.pod:3321
21043 msgid "set-network | network"
21047 #: ../fish/guestfish-actions.pod:3323
21050 " set-network true|false\n"
21055 #: ../fish/guestfish-actions.pod:3331
21057 "You must call this before calling C<launch>, otherwise it has no effect."
21061 #: ../fish/guestfish-actions.pod:3334
21062 msgid "set-path | path"
21066 #: ../fish/guestfish-actions.pod:3336
21069 " set-path searchpath\n"
21074 #: ../fish/guestfish-actions.pod:3345
21075 msgid "set-qemu | qemu"
21079 #: ../fish/guestfish-actions.pod:3347
21087 #: ../fish/guestfish-actions.pod:3367
21088 msgid "set-recovery-proc | recovery-proc"
21092 #: ../fish/guestfish-actions.pod:3369
21095 " set-recovery-proc true|false\n"
21100 #: ../fish/guestfish-actions.pod:3371
21102 "If this is called with the parameter C<false> then C<launch> does not create "
21103 "a recovery process. The purpose of the recovery process is to stop runaway "
21104 "qemu processes in the case where the main program aborts abruptly."
21108 #: ../fish/guestfish-actions.pod:3376
21110 "This only has any effect if called before C<launch>, and the default is true."
21114 #: ../fish/guestfish-actions.pod:3385
21115 msgid "set-selinux | selinux"
21119 #: ../fish/guestfish-actions.pod:3387
21122 " set-selinux true|false\n"
21127 #: ../fish/guestfish-actions.pod:3398
21128 msgid "set-trace | trace"
21132 #: ../fish/guestfish-actions.pod:3400
21135 " set-trace true|false\n"
21140 #: ../fish/guestfish-actions.pod:3416
21141 msgid "set-verbose | verbose"
21145 #: ../fish/guestfish-actions.pod:3418
21148 " set-verbose true|false\n"
21153 #: ../fish/guestfish-actions.pod:3425
21158 #: ../fish/guestfish-actions.pod:3427
21161 " setcon context\n"
21166 #: ../fish/guestfish-actions.pod:3434
21171 #: ../fish/guestfish-actions.pod:3436
21174 " setxattr xattr val vallen path\n"
21179 #: ../fish/guestfish-actions.pod:3442
21180 msgid "See also: C<lsetxattr>, L<attr(5)>."
21184 #: ../fish/guestfish-actions.pod:3444
21189 #: ../fish/guestfish-actions.pod:3446
21192 " sfdisk device cyls heads sectors 'lines ...'\n"
21197 #: ../fish/guestfish-actions.pod:3468
21198 msgid "See also: C<sfdisk-l>, C<sfdisk-N>, C<part-init>"
21202 #: ../fish/guestfish-actions.pod:3474
21207 #: ../fish/guestfish-actions.pod:3476
21210 " sfdiskM device 'lines ...'\n"
21215 #: ../fish/guestfish-actions.pod:3478
21217 "This is a simplified interface to the C<sfdisk> command, where partition "
21218 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
21219 "you don't need to specify the cyls, heads and sectors parameters which were "
21220 "rarely if ever used anyway."
21224 #: ../fish/guestfish-actions.pod:3484
21225 msgid "See also: C<sfdisk>, the L<sfdisk(8)> manpage and C<part-disk>"
21229 #: ../fish/guestfish-actions.pod:3490
21234 #: ../fish/guestfish-actions.pod:3492
21237 " sfdisk-N device partnum cyls heads sectors line\n"
21242 #: ../fish/guestfish-actions.pod:3497
21244 "For other parameters, see C<sfdisk>. You should usually pass C<0> for the "
21245 "cyls/heads/sectors parameters."
21249 #: ../fish/guestfish-actions.pod:3500
21250 msgid "See also: C<part-add>"
21254 #: ../fish/guestfish-actions.pod:3505
21255 msgid "sfdisk-disk-geometry"
21259 #: ../fish/guestfish-actions.pod:3507
21262 " sfdisk-disk-geometry device\n"
21267 #: ../fish/guestfish-actions.pod:3509
21269 "This displays the disk geometry of C<device> read from the partition table. "
21270 "Especially in the case where the underlying block device has been resized, "
21271 "this can be different from the kernel's idea of the geometry (see C<sfdisk-"
21272 "kernel-geometry>)."
21276 #: ../fish/guestfish-actions.pod:3517
21277 msgid "sfdisk-kernel-geometry"
21281 #: ../fish/guestfish-actions.pod:3519
21284 " sfdisk-kernel-geometry device\n"
21289 #: ../fish/guestfish-actions.pod:3526
21294 #: ../fish/guestfish-actions.pod:3528
21297 " sfdisk-l device\n"
21302 #: ../fish/guestfish-actions.pod:3534
21303 msgid "See also: C<part-list>"
21307 #: ../fish/guestfish-actions.pod:3536
21312 #: ../fish/guestfish-actions.pod:3538
21320 #: ../fish/guestfish-actions.pod:3543
21321 msgid "This is like C<command>, but passes the command to:"
21325 #: ../fish/guestfish-actions.pod:3551
21326 msgid "All the provisos about C<command> apply to this call."
21330 #: ../fish/guestfish-actions.pod:3553
21335 #: ../fish/guestfish-actions.pod:3555
21338 " sh-lines command\n"
21343 #: ../fish/guestfish-actions.pod:3557
21344 msgid "This is the same as C<sh>, but splits the result into a list of lines."
21348 #: ../fish/guestfish-actions.pod:3560
21349 msgid "See also: C<command-lines>"
21353 #: ../fish/guestfish-actions.pod:3562
21358 #: ../fish/guestfish-actions.pod:3564
21366 #: ../fish/guestfish-actions.pod:3568
21371 #: ../fish/guestfish-actions.pod:3570
21379 #: ../fish/guestfish-actions.pod:3576
21384 #: ../fish/guestfish-actions.pod:3578
21392 #: ../fish/guestfish-actions.pod:3586
21397 #: ../fish/guestfish-actions.pod:3588
21405 #: ../fish/guestfish-actions.pod:3596
21410 #: ../fish/guestfish-actions.pod:3598
21413 " strings-e encoding path\n"
21418 #: ../fish/guestfish-actions.pod:3600
21420 "This is like the C<strings> command, but allows you to specify the encoding "
21421 "of strings that are looked for in the source file C<path>."
21425 #: ../fish/guestfish-actions.pod:3610
21427 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
21428 "ISO-8859-X (this is what C<strings> uses)."
21432 #: ../fish/guestfish-actions.pod:3642
21433 msgid "swapoff-device"
21437 #: ../fish/guestfish-actions.pod:3644
21440 " swapoff-device device\n"
21445 #: ../fish/guestfish-actions.pod:3646
21447 "This command disables the libguestfs appliance swap device or partition "
21448 "named C<device>. See C<swapon-device>."
21452 #: ../fish/guestfish-actions.pod:3650
21453 msgid "swapoff-file"
21457 #: ../fish/guestfish-actions.pod:3652
21460 " swapoff-file file\n"
21465 #: ../fish/guestfish-actions.pod:3656
21466 msgid "swapoff-label"
21470 #: ../fish/guestfish-actions.pod:3658
21473 " swapoff-label label\n"
21478 #: ../fish/guestfish-actions.pod:3663
21479 msgid "swapoff-uuid"
21483 #: ../fish/guestfish-actions.pod:3665
21486 " swapoff-uuid uuid\n"
21491 #: ../fish/guestfish-actions.pod:3670
21492 msgid "swapon-device"
21496 #: ../fish/guestfish-actions.pod:3672
21499 " swapon-device device\n"
21504 #: ../fish/guestfish-actions.pod:3674
21506 "This command enables the libguestfs appliance to use the swap device or "
21507 "partition named C<device>. The increased memory is made available for all "
21508 "commands, for example those run using C<command> or C<sh>."
21512 #: ../fish/guestfish-actions.pod:3686
21513 msgid "swapon-file"
21517 #: ../fish/guestfish-actions.pod:3688
21520 " swapon-file file\n"
21525 #: ../fish/guestfish-actions.pod:3690
21527 "This command enables swap to a file. See C<swapon-device> for other notes."
21531 #: ../fish/guestfish-actions.pod:3693
21532 msgid "swapon-label"
21536 #: ../fish/guestfish-actions.pod:3695
21539 " swapon-label label\n"
21544 #: ../fish/guestfish-actions.pod:3697
21546 "This command enables swap to a labeled swap partition. See C<swapon-device> "
21551 #: ../fish/guestfish-actions.pod:3700
21552 msgid "swapon-uuid"
21556 #: ../fish/guestfish-actions.pod:3702
21559 " swapon-uuid uuid\n"
21564 #: ../fish/guestfish-actions.pod:3704
21566 "This command enables swap to a swap partition with the given UUID. See "
21567 "C<swapon-device> for other notes."
21571 #: ../fish/guestfish-actions.pod:3707
21576 #: ../fish/guestfish-actions.pod:3709
21584 #: ../fish/guestfish-actions.pod:3717
21589 #: ../fish/guestfish-actions.pod:3719
21597 #: ../fish/guestfish-actions.pod:3727
21602 #: ../fish/guestfish-actions.pod:3729
21605 " tail-n nrlines path\n"
21610 #: ../fish/guestfish-actions.pod:3742
21615 #: ../fish/guestfish-actions.pod:3744
21618 " tar-in (tarfile|-) directory\n"
21623 #: ../fish/guestfish-actions.pod:3749
21624 msgid "To upload a compressed tarball, use C<tgz-in> or C<txz-in>."
21628 #: ../fish/guestfish-actions.pod:3754
21633 #: ../fish/guestfish-actions.pod:3756
21636 " tar-out directory (tarfile|-)\n"
21641 #: ../fish/guestfish-actions.pod:3761
21642 msgid "To download a compressed tarball, use C<tgz-out> or C<txz-out>."
21646 #: ../fish/guestfish-actions.pod:3766
21651 #: ../fish/guestfish-actions.pod:3768
21654 " tgz-in (tarball|-) directory\n"
21659 #: ../fish/guestfish-actions.pod:3773
21660 msgid "To upload an uncompressed tarball, use C<tar-in>."
21664 #: ../fish/guestfish-actions.pod:3777
21669 #: ../fish/guestfish-actions.pod:3779
21672 " tgz-out directory (tarball|-)\n"
21677 #: ../fish/guestfish-actions.pod:3784
21678 msgid "To download an uncompressed tarball, use C<tar-out>."
21682 #: ../fish/guestfish-actions.pod:3788
21687 #: ../fish/guestfish-actions.pod:3790
21695 #: ../fish/guestfish-actions.pod:3799
21700 #: ../fish/guestfish-actions.pod:3801
21708 #: ../fish/guestfish-actions.pod:3806
21709 msgid "truncate-size"
21713 #: ../fish/guestfish-actions.pod:3808
21716 " truncate-size path size\n"
21721 #: ../fish/guestfish-actions.pod:3813
21723 "If the current file size is less than C<size> then the file is extended to "
21724 "the required size with zero bytes. This creates a sparse file (ie. disk "
21725 "blocks are not allocated for the file until you write to it). To create a "
21726 "non-sparse file of zeroes, use C<fallocate64> instead."
21730 #: ../fish/guestfish-actions.pod:3819
21735 #: ../fish/guestfish-actions.pod:3821
21738 " tune2fs-l device\n"
21743 #: ../fish/guestfish-actions.pod:3831
21748 #: ../fish/guestfish-actions.pod:3833
21751 " txz-in (tarball|-) directory\n"
21756 #: ../fish/guestfish-actions.pod:3840
21761 #: ../fish/guestfish-actions.pod:3842
21764 " txz-out directory (tarball|-)\n"
21769 #: ../fish/guestfish-actions.pod:3849
21774 #: ../fish/guestfish-actions.pod:3851
21782 #: ../fish/guestfish-actions.pod:3865
21783 msgid "See also C<get-umask>, L<umask(2)>, C<mknod>, C<mkdir>."
21787 #: ../fish/guestfish-actions.pod:3870
21788 msgid "umount | unmount"
21792 #: ../fish/guestfish-actions.pod:3872
21795 " umount pathordevice\n"
21800 #: ../fish/guestfish-actions.pod:3878
21801 msgid "umount-all | unmount-all"
21805 #: ../fish/guestfish-actions.pod:3880
21813 #: ../fish/guestfish-actions.pod:3886
21818 #: ../fish/guestfish-actions.pod:3888
21821 " upload (filename|-) remotefilename\n"
21826 #: ../fish/guestfish-actions.pod:3895
21827 msgid "See also C<download>."
21831 #: ../fish/guestfish-actions.pod:3899
21836 #: ../fish/guestfish-actions.pod:3901
21839 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
21844 #: ../fish/guestfish-actions.pod:3920
21849 #: ../fish/guestfish-actions.pod:3922
21857 #: ../fish/guestfish-actions.pod:3949
21859 "I<Note:> Don't use this call to test for availability of features. In "
21860 "enterprise distributions we backport features from later versions into "
21861 "earlier versions, making this an unreliable way to test for features. Use "
21862 "C<available> instead."
21866 #: ../fish/guestfish-actions.pod:3955
21871 #: ../fish/guestfish-actions.pod:3957
21874 " vfs-label device\n"
21879 #: ../fish/guestfish-actions.pod:3964
21880 msgid "To find a filesystem from the label, use C<findfs-label>."
21884 #: ../fish/guestfish-actions.pod:3966
21889 #: ../fish/guestfish-actions.pod:3968
21892 " vfs-type device\n"
21897 #: ../fish/guestfish-actions.pod:3978
21902 #: ../fish/guestfish-actions.pod:3980
21905 " vfs-uuid device\n"
21910 #: ../fish/guestfish-actions.pod:3987
21911 msgid "To find a filesystem from the UUID, use C<findfs-uuid>."
21915 #: ../fish/guestfish-actions.pod:3989
21916 msgid "vg-activate"
21920 #: ../fish/guestfish-actions.pod:3991
21923 " vg-activate true|false 'volgroups ...'\n"
21928 #: ../fish/guestfish-actions.pod:4004
21929 msgid "vg-activate-all"
21933 #: ../fish/guestfish-actions.pod:4006
21936 " vg-activate-all true|false\n"
21941 #: ../fish/guestfish-actions.pod:4016
21946 #: ../fish/guestfish-actions.pod:4018
21949 " vgcreate volgroup 'physvols ...'\n"
21954 #: ../fish/guestfish-actions.pod:4023
21959 #: ../fish/guestfish-actions.pod:4025
21962 " vglvuuids vgname\n"
21967 #: ../fish/guestfish-actions.pod:4030
21969 "You can use this along with C<lvs> and C<lvuuid> calls to associate logical "
21970 "volumes and volume groups."
21974 #: ../fish/guestfish-actions.pod:4033
21975 msgid "See also C<vgpvuuids>."
21979 #: ../fish/guestfish-actions.pod:4035
21984 #: ../fish/guestfish-actions.pod:4037
21987 " vgpvuuids vgname\n"
21992 #: ../fish/guestfish-actions.pod:4042
21994 "You can use this along with C<pvs> and C<pvuuid> calls to associate physical "
21995 "volumes and volume groups."
21999 #: ../fish/guestfish-actions.pod:4045
22000 msgid "See also C<vglvuuids>."
22004 #: ../fish/guestfish-actions.pod:4047
22009 #: ../fish/guestfish-actions.pod:4049
22012 " vgremove vgname\n"
22017 #: ../fish/guestfish-actions.pod:4056
22022 #: ../fish/guestfish-actions.pod:4058
22025 " vgrename volgroup newvolgroup\n"
22030 #: ../fish/guestfish-actions.pod:4062
22035 #: ../fish/guestfish-actions.pod:4064
22043 #: ../fish/guestfish-actions.pod:4072
22044 msgid "See also C<vgs-full>."
22048 #: ../fish/guestfish-actions.pod:4074
22053 #: ../fish/guestfish-actions.pod:4076
22061 #: ../fish/guestfish-actions.pod:4081
22066 #: ../fish/guestfish-actions.pod:4083
22074 #: ../fish/guestfish-actions.pod:4088
22079 #: ../fish/guestfish-actions.pod:4090
22087 #: ../fish/guestfish-actions.pod:4094
22092 #: ../fish/guestfish-actions.pod:4096
22100 #: ../fish/guestfish-actions.pod:4101
22105 #: ../fish/guestfish-actions.pod:4103
22113 #: ../fish/guestfish-actions.pod:4108
22118 #: ../fish/guestfish-actions.pod:4110
22126 #: ../fish/guestfish-actions.pod:4115
22131 #: ../fish/guestfish-actions.pod:4117
22134 " write path content\n"
22139 #: ../fish/guestfish-actions.pod:4125
22144 #: ../fish/guestfish-actions.pod:4127
22147 " write-file path content size\n"
22152 #: ../fish/guestfish-actions.pod:4150
22157 #: ../fish/guestfish-actions.pod:4152
22160 " zegrep regex path\n"
22165 #: ../fish/guestfish-actions.pod:4160
22170 #: ../fish/guestfish-actions.pod:4162
22173 " zegrepi regex path\n"
22178 #: ../fish/guestfish-actions.pod:4170
22183 #: ../fish/guestfish-actions.pod:4172
22191 #: ../fish/guestfish-actions.pod:4180
22192 msgid "See also: C<zero-device>, C<scrub-device>."
22196 #: ../fish/guestfish-actions.pod:4182
22197 msgid "zero-device"
22201 #: ../fish/guestfish-actions.pod:4184
22204 " zero-device device\n"
22209 #: ../fish/guestfish-actions.pod:4186
22211 "This command writes zeroes over the entire C<device>. Compare with C<zero> "
22212 "which just zeroes the first few blocks of a device."
22216 #: ../fish/guestfish-actions.pod:4193
22221 #: ../fish/guestfish-actions.pod:4195
22224 " zerofree device\n"
22229 #: ../fish/guestfish-actions.pod:4208
22234 #: ../fish/guestfish-actions.pod:4210
22237 " zfgrep pattern path\n"
22242 #: ../fish/guestfish-actions.pod:4218
22247 #: ../fish/guestfish-actions.pod:4220
22250 " zfgrepi pattern path\n"
22255 #: ../fish/guestfish-actions.pod:4228
22260 #: ../fish/guestfish-actions.pod:4230
22263 " zfile meth path\n"
22268 #: ../fish/guestfish-actions.pod:4237
22270 "Since 1.0.63, use C<file> instead which can now process compressed files."
22274 #: ../fish/guestfish-actions.pod:4247
22279 #: ../fish/guestfish-actions.pod:4249
22282 " zgrep regex path\n"
22287 #: ../fish/guestfish-actions.pod:4257
22292 #: ../fish/guestfish-actions.pod:4259
22295 " zgrepi regex path\n"
22300 #: ../test-tool/libguestfs-test-tool.pod:5
22301 msgid "libguestfs-test-tool - End user tests for libguestfs"
22305 #: ../test-tool/libguestfs-test-tool.pod:9
22308 " libguestfs-test-tool [--options]\n"
22313 #: ../test-tool/libguestfs-test-tool.pod:13
22315 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
22316 "and developers, to allow them to check basic libguestfs functionality is "
22317 "working. This is needed because libguestfs occasionally breaks for reasons "
22318 "beyond our control: usually because of changes in the underlying qemu or "
22319 "kernel packages, or the host environment."
22323 #: ../test-tool/libguestfs-test-tool.pod:20
22324 msgid "If you suspect a problem in libguestfs, then just run:"
22328 #: ../test-tool/libguestfs-test-tool.pod:22
22331 " libguestfs-test-tool\n"
22336 #: ../test-tool/libguestfs-test-tool.pod:24
22337 msgid "It will print lots of diagnostic messages."
22341 #: ../test-tool/libguestfs-test-tool.pod:26
22342 msgid "If it runs to completion successfully, you will see this near the end:"
22346 #: ../test-tool/libguestfs-test-tool.pod:28
22349 " ===== TEST FINISHED OK =====\n"
22354 #: ../test-tool/libguestfs-test-tool.pod:30
22355 msgid "and the test tool will exit with code 0."
22359 #: ../test-tool/libguestfs-test-tool.pod:32
22361 "If it fails (and/or exits with non-zero error code), please paste the "
22362 "B<complete, unedited> output of the test tool into a bug report. More "
22363 "information about reporting bugs can be found on the L<http://libguestfs.org/"
22368 #: ../test-tool/libguestfs-test-tool.pod:41
22373 #: ../test-tool/libguestfs-test-tool.pod:43
22374 msgid "Display short usage information and exit."
22378 #: ../test-tool/libguestfs-test-tool.pod:45
22379 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
22383 #: ../test-tool/libguestfs-test-tool.pod:47
22385 "Pass an alternate name for the helper program. libguestfs-test-tool will "
22386 "normally look in the C<$libexec> directory that was configured when the tool "
22391 #: ../test-tool/libguestfs-test-tool.pod:51
22392 msgid "I<--qemu qemu_binary>"
22396 #: ../test-tool/libguestfs-test-tool.pod:53
22398 "If you have downloaded another qemu binary, point this option at the full "
22399 "path of the binary to try it."
22403 #: ../test-tool/libguestfs-test-tool.pod:56
22404 msgid "I<--qemudir qemu_source_dir>"
22408 #: ../test-tool/libguestfs-test-tool.pod:58
22410 "If you have compiled qemu from source, point this option at the source "
22411 "directory to try it."
22415 #: ../test-tool/libguestfs-test-tool.pod:61
22416 msgid "I<--timeout N>"
22420 #: ../test-tool/libguestfs-test-tool.pod:63
22422 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
22423 "does not usually need to be adjusted unless your machine is very slow."
22427 #: ../test-tool/libguestfs-test-tool.pod:69
22428 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
22432 #: ../test-tool/libguestfs-test-tool.pod:71
22434 "If you have compiled another version of qemu from source and would like to "
22435 "try that, then you can use the I<--qemudir> option to point to the qemu "
22436 "source directory."
22440 #: ../test-tool/libguestfs-test-tool.pod:75
22442 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
22443 "option to point to the binary."
22447 #: ../test-tool/libguestfs-test-tool.pod:78
22449 "When using an alternate qemu with libguestfs, usually you would need to "
22450 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
22451 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
22452 "use either of the I<--qemudir> or I<--qemu> options."
22456 #: ../test-tool/libguestfs-test-tool.pod:85
22458 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
22459 "I<1> if there was an error."
22463 #: ../test-tool/libguestfs-test-tool.pod:92
22464 msgid "/usr/libexec/libguestfs-test-tool-helper"
22468 #: ../test-tool/libguestfs-test-tool.pod:94
22470 "This helper program is run inside the appliance and provides additional "
22475 #: ../test-tool/libguestfs-test-tool.pod:97
22476 msgid "/usr/bin/mkisofs"
22480 #: ../test-tool/libguestfs-test-tool.pod:99
22482 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
22483 "which is used as part of the tests."
22487 #: ../test-tool/libguestfs-test-tool.pod:106
22489 "For the full list of environment variables which may affect libguestfs, "
22490 "please see the L<guestfs(3)> manual page."
22494 #: ../test-tool/libguestfs-test-tool.pod:111
22495 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
22499 #: ../test-tool/libguestfs-test-tool.pod:121 ../fuse/guestmount.pod:195
22500 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
22504 #: ../fuse/guestmount.pod:5
22506 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
22510 #: ../fuse/guestmount.pod:9
22513 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
22518 #: ../fuse/guestmount.pod:13
22520 "You must I<not> use C<guestmount> in read-write mode on live virtual "
22521 "machines. If you do this, you risk disk corruption in the VM."
22525 #: ../fuse/guestmount.pod:18
22527 "The guestmount program can be used to mount virtual machine filesystems and "
22528 "other disk images on the host. It uses libguestfs for access to the guest "
22529 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
22530 "a mountable device."
22534 #: ../fuse/guestmount.pod:23
22536 "Along with other options, you have to give at least one device (I<-a> "
22537 "option) and at least one mountpoint (I<-m> option). How this works is "
22538 "better explained in the L<guestfish(1)> manual page, or you can use L<virt-"
22539 "inspector(1)> and/or the wrapper script C<guestmount-wrapper> to help you."
22543 #: ../fuse/guestmount.pod:29
22545 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
22546 "by you, and the filesystem will not be visible to any other users unless you "
22547 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
22548 "the filesystem, use the C<fusermount -u> command."
22552 #: ../fuse/guestmount.pod:37
22554 "For a typical Windows guest which has its main filesystem on the first "
22559 #: ../fuse/guestmount.pod:40
22562 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
22567 #: ../fuse/guestmount.pod:42
22569 "For a typical Linux guest which has a /boot filesystem on the first "
22570 "partition, and the root filesystem on a logical volume:"
22574 #: ../fuse/guestmount.pod:45
22577 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
22582 #: ../fuse/guestmount.pod:47
22584 "To get L<virt-inspector(1)> to do the hard work of detecting guest "
22585 "mountpoints for you:"
22589 #: ../fuse/guestmount.pod:50
22592 " guestmount $(virt-inspector --ro-fish MyGuest) /mnt\n"
22597 #: ../fuse/guestmount.pod:52
22599 "(or use --fish if you don't want it to be a read only mount). The option is "
22600 "called I<--ro-fish> or I<--fish> because these parameters are compatible "
22601 "with L<guestfish(1)>."
22605 #: ../fuse/guestmount.pod:56
22607 "If you don't know what filesystems are contained in a guest or disk image, "
22608 "use L<virt-list-filesystems(1)> first:"
22612 #: ../fuse/guestmount.pod:59
22615 " virt-list-filesystems MyGuest\n"
22620 #: ../fuse/guestmount.pod:61
22622 "If you want to trace the libguestfs calls but without excessive debugging, "
22627 #: ../fuse/guestmount.pod:64
22630 " guestmount [-a ... -m ...] --trace /mnt\n"
22635 #: ../fuse/guestmount.pod:66
22636 msgid "If you want to debug the program, we recommend:"
22640 #: ../fuse/guestmount.pod:68
22643 " guestmount [-a ... -m ...] --trace --verbose /mnt\n"
22648 #: ../fuse/guestmount.pod:76
22649 msgid "Add a block device or virtual machine image."
22653 #: ../fuse/guestmount.pod:78
22654 msgid "B<--dir-cache-timeout N>"
22658 #: ../fuse/guestmount.pod:80
22660 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22661 "seconds. The readdir cache [actually, there are several semi-independent "
22662 "caches] is populated after a readdir(2) call with the stat and extended "
22663 "attributes of the files in the directory, in anticipation that they will be "
22664 "requested soon after."
22668 #: ../fuse/guestmount.pod:86
22670 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22671 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22672 "requests, only cache existing ones."
22676 #: ../fuse/guestmount.pod:90
22677 msgid "B<--fuse-help>"
22681 #: ../fuse/guestmount.pod:92
22682 msgid "Display help on special FUSE options (see I<-o> below)."
22686 #: ../fuse/guestmount.pod:96
22687 msgid "Display brief help and exit."
22691 #: ../fuse/guestmount.pod:98
22692 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
22696 #: ../fuse/guestmount.pod:100
22698 "Mount the named partition or logical volume on the given mountpoint B<in the "
22699 "guest> (this has nothing to do with mountpoints in the host)."
22703 #: ../fuse/guestmount.pod:103
22705 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22706 "something on C</>."
22710 #: ../fuse/guestmount.pod:108
22712 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22713 "unmounted. If you specify this option, then we don't attempt to sync the "
22714 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22718 #: ../fuse/guestmount.pod:113
22719 msgid "B<-o option> | B<--option option>"
22723 #: ../fuse/guestmount.pod:115
22724 msgid "Pass extra options to FUSE."
22728 #: ../fuse/guestmount.pod:117
22730 "To get a list of all the extra options supported by FUSE, use the command "
22731 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22732 "of them are a good idea."
22736 #: ../fuse/guestmount.pod:121
22739 " guestmount --fuse-help\n"
22744 #: ../fuse/guestmount.pod:123
22745 msgid "Some potentially useful FUSE options:"
22749 #: ../fuse/guestmount.pod:127
22750 msgid "B<-o allow_other>"
22754 #: ../fuse/guestmount.pod:129
22755 msgid "Allow other users to see the filesystem."
22759 #: ../fuse/guestmount.pod:131
22760 msgid "B<-o attr_timeout=N>"
22764 #: ../fuse/guestmount.pod:133
22765 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22769 #: ../fuse/guestmount.pod:135
22770 msgid "B<-o kernel_cache>"
22774 #: ../fuse/guestmount.pod:137
22776 "Allow the kernel to cache files (reduces the number of reads that have to go "
22777 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22778 "afford the extra memory usage."
22782 #: ../fuse/guestmount.pod:141
22783 msgid "B<-o uid=N> B<-o gid=N>"
22787 #: ../fuse/guestmount.pod:143
22789 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22790 "the chosen values."
22794 #: ../fuse/guestmount.pod:150
22796 "Add devices and mount everything read-only. Also disallow writes and make "
22797 "the disk appear read-only to FUSE."
22801 #: ../fuse/guestmount.pod:153
22803 "This is highly recommended if you are not going to edit the guest disk. If "
22804 "the guest is running and this option is I<not> supplied, then there is a "
22805 "strong risk of disk corruption in the guest. We try to prevent this from "
22806 "happening, but it is not always possible."
22810 #: ../fuse/guestmount.pod:160
22811 msgid "Enable SELinux support for the guest."
22815 #: ../fuse/guestmount.pod:162
22820 #: ../fuse/guestmount.pod:164
22821 msgid "Trace libguestfs calls (to stderr)."
22825 #: ../fuse/guestmount.pod:166
22826 msgid "This also stops the daemon from forking into the background."
22830 #: ../fuse/guestmount.pod:170
22831 msgid "Enable verbose messages from underlying libguestfs."
22835 #: ../fuse/guestmount.pod:174
22836 msgid "Display the program version and exit."
22840 #: ../fuse/guestmount.pod:180
22842 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22843 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
22848 #: ../inspector/virt-inspector.pl:40
22850 "virt-inspector - Display OS version, kernel, drivers, mount points, "
22851 "applications, etc. in a virtual machine"
22855 #: ../inspector/virt-inspector.pl:44
22858 " virt-inspector [--connect URI] domname\n"
22863 #: ../inspector/virt-inspector.pl:46
22866 " virt-inspector guest.img [guest.img ...]\n"
22871 #: ../inspector/virt-inspector.pl:50
22873 "B<virt-inspector> examines a virtual machine and tries to determine the "
22874 "version of the OS, the kernel version, what drivers are installed, whether "
22875 "the virtual machine is fully virtualized (FV) or para-virtualized (PV), what "
22876 "applications are installed and more."
22880 #: ../inspector/virt-inspector.pl:55
22882 "Virt-inspector can produce output in several formats, including a readable "
22883 "text report, and XML for feeding into other programs."
22887 #: ../inspector/virt-inspector.pl:58
22889 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
22890 "libvirt domain (see: C<virsh list --all>)."
22894 #: ../inspector/virt-inspector.pl:61
22896 "You can also run virt-inspector directly on disk images from a single "
22897 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
22898 "has several block devices, in which case you should list them one after "
22899 "another, with the first corresponding to the guest's C</dev/sda>, the second "
22900 "to the guest's C</dev/sdb> and so on."
22904 #: ../inspector/virt-inspector.pl:67
22906 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22907 "inspect several virtual machines, you have to run virt-inspector several "
22908 "times (for example, from a shell script for-loop)."
22912 #: ../inspector/virt-inspector.pl:72
22914 "Because virt-inspector needs direct access to guest images, it won't "
22915 "normally work over remote libvirt connections."
22919 #: ../inspector/virt-inspector.pl:85 ../tools/virt-cat.pl:90
22920 #: ../tools/virt-df.pl:81 ../tools/virt-edit.pl:83
22921 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-list-partitions.pl:61
22922 #: ../tools/virt-ls.pl:89 ../tools/virt-make-fs.pl:163
22923 #: ../tools/virt-rescue.pl:113 ../tools/virt-tar.pl:109
22924 #: ../tools/virt-win-reg.pl:182
22925 msgid "Display brief help."
22929 #: ../inspector/virt-inspector.pl:91 ../tools/virt-cat.pl:96
22930 #: ../tools/virt-df.pl:87 ../tools/virt-edit.pl:89
22931 #: ../tools/virt-list-filesystems.pl:66 ../tools/virt-list-partitions.pl:67
22932 #: ../tools/virt-ls.pl:95 ../tools/virt-make-fs.pl:169
22933 #: ../tools/virt-rescue.pl:119 ../tools/virt-resize.pl:249
22934 #: ../tools/virt-tar.pl:115 ../tools/virt-win-reg.pl:188
22935 msgid "B<--version>"
22939 #: ../inspector/virt-inspector.pl:93 ../tools/virt-cat.pl:98
22940 #: ../tools/virt-df.pl:89 ../tools/virt-edit.pl:91
22941 #: ../tools/virt-list-filesystems.pl:68 ../tools/virt-list-partitions.pl:69
22942 #: ../tools/virt-ls.pl:97 ../tools/virt-make-fs.pl:171
22943 #: ../tools/virt-rescue.pl:121 ../tools/virt-resize.pl:251
22944 #: ../tools/virt-tar.pl:117 ../tools/virt-win-reg.pl:190
22945 msgid "Display version number and exit."
22949 #: ../inspector/virt-inspector.pl:99 ../tools/virt-cat.pl:104
22950 #: ../tools/virt-df.pl:95 ../tools/virt-edit.pl:113
22951 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-list-partitions.pl:75
22952 #: ../tools/virt-ls.pl:103 ../tools/virt-rescue.pl:135
22953 #: ../tools/virt-tar.pl:123 ../tools/virt-win-reg.pl:204
22954 msgid "B<--connect URI> | B<-c URI>"
22958 #: ../inspector/virt-inspector.pl:101 ../tools/virt-cat.pl:106
22959 #: ../tools/virt-df.pl:97 ../tools/virt-edit.pl:115
22960 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-list-partitions.pl:77
22961 #: ../tools/virt-ls.pl:105 ../tools/virt-rescue.pl:137
22962 #: ../tools/virt-tar.pl:125 ../tools/virt-win-reg.pl:206
22964 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
22965 "to the default libvirt hypervisor."
22969 #: ../inspector/virt-inspector.pl:104
22971 "Libvirt is only used if you specify a C<domname> on the command line. If "
22972 "you specify guest block devices directly, then libvirt is not used at all."
22976 #: ../inspector/virt-inspector.pl:114
22978 "The following options select the output format. Use only one of them. The "
22979 "default is a readable text report."
22983 #: ../inspector/virt-inspector.pl:119
22984 msgid "B<--text> (default)"
22988 #: ../inspector/virt-inspector.pl:121
22989 msgid "Plain text report."
22993 #: ../inspector/virt-inspector.pl:123
22998 #: ../inspector/virt-inspector.pl:125
22999 msgid "Produce no output at all."
23003 #: ../inspector/virt-inspector.pl:127
23008 #: ../inspector/virt-inspector.pl:129
23010 "If you select I<--xml> then you get XML output which can be fed to other "
23015 #: ../inspector/virt-inspector.pl:132
23020 #: ../inspector/virt-inspector.pl:134
23022 "If you select I<--yaml> then you get YAML output which can be fed to other "
23027 #: ../inspector/virt-inspector.pl:137
23032 #: ../inspector/virt-inspector.pl:139
23034 "If you select I<--perl> then you get Perl structures output which can be "
23035 "used directly in another Perl program."
23039 #: ../inspector/virt-inspector.pl:142
23044 #: ../inspector/virt-inspector.pl:144
23045 msgid "B<--ro-fish>"
23049 #: ../inspector/virt-inspector.pl:146
23051 "If you select I<--fish> then we print a L<guestfish(1)> command line which "
23052 "will automatically mount up the filesystems on the correct mount points. "
23053 "Try this for example:"
23057 #: ../inspector/virt-inspector.pl:150
23060 " guestfish $(virt-inspector --fish guest.img)\n"
23065 #: ../inspector/virt-inspector.pl:152
23067 "I<--ro-fish> is the same, but the I<--ro> option is passed to guestfish so "
23068 "that the filesystems are mounted read-only."
23072 #: ../inspector/virt-inspector.pl:155
23077 #: ../inspector/virt-inspector.pl:157
23079 "In \"query mode\" we answer common questions about the guest, such as "
23080 "whether it is fullvirt or needs a Xen hypervisor to run."
23084 #: ../inspector/virt-inspector.pl:160
23085 msgid "See section I<QUERY MODE> below."
23089 #: ../inspector/virt-inspector.pl:166
23090 msgid "B<--windows-registry>"
23094 #: ../inspector/virt-inspector.pl:168
23096 "This flag is ignored for compatibility with earlier releases of the software."
23100 #: ../inspector/virt-inspector.pl:171
23102 "In this version, if L<Win::Hivex(3)> is available, then we attempt to parse "
23103 "information out of the Registry for any Windows guest."
23107 #: ../inspector/virt-inspector.pl:218
23108 msgid "OUTPUT FORMAT"
23112 #: ../inspector/virt-inspector.pl:220
23115 " Operating system(s)\n"
23116 " -------------------\n"
23117 " Linux (distro + version)\n"
23118 " Windows (version)\n"
23121 " +--- Filesystems ---------- Installed apps --- Kernel & drivers\n"
23122 " ----------- -------------- ----------------\n"
23123 " mount point => device List of apps Extra information\n"
23124 " mount point => device and versions about kernel(s)\n"
23125 " ... and drivers\n"
23126 " swap => swap device\n"
23127 " (plus lots of extra information\n"
23128 " about each filesystem)\n"
23133 #: ../inspector/virt-inspector.pl:235
23134 msgid "The output of virt-inspector is a complex two-level data structure."
23138 #: ../inspector/virt-inspector.pl:237
23140 "At the top level is a list of the operating systems installed on the guest. "
23141 "(For the vast majority of guests, only a single OS is installed.) The data "
23142 "returned for the OS includes the name (Linux, Windows), the distribution and "
23147 #: ../inspector/virt-inspector.pl:242
23148 msgid "The diagram above shows what we return for each OS."
23152 #: ../inspector/virt-inspector.pl:244
23154 "With the I<--xml> option the output is mapped into an XML document. There "
23155 "is a RELAX-NG schema for this XML in the file I<virt-inspector.rng> which "
23156 "normally ships with virt-inspector, or can be found in the source."
23160 #: ../inspector/virt-inspector.pl:249
23162 "With the I<--fish> or I<--ro-fish> option the mount points are mapped to "
23163 "L<guestfish(1)> command line parameters, so that you can go in afterwards "
23164 "and inspect the guest with everything mounted in the right place. For "
23169 #: ../inspector/virt-inspector.pl:254
23172 " guestfish $(virt-inspector --ro-fish guest.img)\n"
23173 " ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot\n"
23178 #: ../inspector/virt-inspector.pl:589
23183 #: ../inspector/virt-inspector.pl:591
23185 "When you use C<virt-inspector --query>, the output is a series of lines of "
23190 #: ../inspector/virt-inspector.pl:594
23196 " xen_pv_drivers=no\n"
23201 #: ../inspector/virt-inspector.pl:599
23203 "(each answer is usually C<yes> or C<no>, or the line is completely missing "
23204 "if we could not determine the answer at all)."
23208 #: ../inspector/virt-inspector.pl:602
23210 "If the guest is multiboot, you can get apparently conflicting answers (eg. "
23211 "C<windows=yes> and C<linux=yes>, or a guest which is both fullvirt and has a "
23212 "Xen PV kernel). This is normal, and just means that the guest can do both "
23213 "things, although it might require operator intervention such as selecting a "
23214 "boot option when the guest is booting."
23218 #: ../inspector/virt-inspector.pl:609
23219 msgid "This section describes the full range of answers possible."
23223 #: ../inspector/virt-inspector.pl:630
23224 msgid "windows=(yes|no)"
23228 #: ../inspector/virt-inspector.pl:632
23229 msgid "Answer C<yes> if Microsoft Windows is installed in the guest."
23233 #: ../inspector/virt-inspector.pl:645
23234 msgid "linux=(yes|no)"
23238 #: ../inspector/virt-inspector.pl:647
23239 msgid "Answer C<yes> if a Linux kernel is installed in the guest."
23243 #: ../inspector/virt-inspector.pl:660
23244 msgid "rhel=(yes|no)"
23248 #: ../inspector/virt-inspector.pl:662
23249 msgid "Answer C<yes> if the guest contains Red Hat Enterprise Linux."
23253 #: ../inspector/virt-inspector.pl:676
23254 msgid "fedora=(yes|no)"
23258 #: ../inspector/virt-inspector.pl:678
23259 msgid "Answer C<yes> if the guest contains the Fedora Linux distribution."
23263 #: ../inspector/virt-inspector.pl:691
23264 msgid "debian=(yes|no)"
23268 #: ../inspector/virt-inspector.pl:693
23269 msgid "Answer C<yes> if the guest contains the Debian Linux distribution."
23273 #: ../inspector/virt-inspector.pl:706
23274 msgid "fullvirt=(yes|no)"
23278 #: ../inspector/virt-inspector.pl:708
23280 "Answer C<yes> if there is at least one operating system kernel installed in "
23281 "the guest which runs fully virtualized. Such a guest would require a "
23282 "hypervisor which supports full system virtualization."
23286 #: ../inspector/virt-inspector.pl:731
23287 msgid "xen_domU_kernel=(yes|no)"
23291 #: ../inspector/virt-inspector.pl:733
23293 "Answer C<yes> if there is at least one Linux kernel installed in the guest "
23294 "which is compiled as a Xen DomU (a Xen paravirtualized guest)."
23298 #: ../inspector/virt-inspector.pl:753
23299 msgid "xen_pv_drivers=(yes|no)"
23303 #: ../inspector/virt-inspector.pl:755
23305 "Answer C<yes> if the guest has Xen paravirtualized drivers installed "
23306 "(usually the kernel itself will be fully virtualized, but the PV drivers "
23307 "have been installed by the administrator for performance reasons)."
23311 #: ../inspector/virt-inspector.pl:777
23312 msgid "virtio_drivers=(yes|no)"
23316 #: ../inspector/virt-inspector.pl:779
23318 "Answer C<yes> if the guest has virtio paravirtualized drivers installed. "
23319 "Virtio drivers are commonly used to improve the performance of KVM."
23323 #: ../inspector/virt-inspector.pl:800
23324 msgid "userspace_arch=(x86_64|...)"
23328 #: ../inspector/virt-inspector.pl:802
23329 msgid "Print the architecture of userspace."
23333 #: ../inspector/virt-inspector.pl:804 ../inspector/virt-inspector.pl:825
23334 msgid "NB. For multi-boot VMs this can print several lines."
23338 #: ../inspector/virt-inspector.pl:821
23339 msgid "kernel_arch=(x86_64|...)"
23343 #: ../inspector/virt-inspector.pl:823
23344 msgid "Print the architecture of the kernel."
23348 #: ../inspector/virt-inspector.pl:848 ../tools/virt-df.pl:484
23350 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23351 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23355 #: ../inspector/virt-inspector.pl:857 ../tools/virt-cat.pl:175
23356 #: ../tools/virt-df.pl:493 ../tools/virt-edit.pl:339
23357 #: ../tools/virt-list-filesystems.pl:205 ../tools/virt-list-partitions.pl:242
23358 #: ../tools/virt-ls.pl:223 ../tools/virt-make-fs.pl:554
23359 #: ../tools/virt-rescue.pl:243 ../tools/virt-resize.pl:1409
23360 #: ../tools/virt-tar.pl:270 ../tools/virt-win-reg.pl:489
23361 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
23365 #: ../inspector/virt-inspector.pl:859
23366 msgid "Matthew Booth L<mbooth@redhat.com>"
23370 #: ../inspector/virt-inspector.pl:863 ../tools/virt-cat.pl:179
23371 #: ../tools/virt-list-filesystems.pl:209 ../tools/virt-ls.pl:227
23372 #: ../tools/virt-tar.pl:274
23373 msgid "Copyright (C) 2009 Red Hat Inc."
23377 #: ../tools/virt-cat.pl:34
23378 msgid "virt-cat - Display a file in a virtual machine"
23382 #: ../tools/virt-cat.pl:38
23385 " virt-cat [--options] domname file\n"
23390 #: ../tools/virt-cat.pl:40
23393 " virt-cat [--options] disk.img [disk.img ...] file\n"
23398 #: ../tools/virt-cat.pl:44
23400 "C<virt-cat> is a command line tool to display the contents of C<file> where "
23401 "C<file> exists in the named virtual machine (or disk image)."
23405 #: ../tools/virt-cat.pl:47
23407 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
23408 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
23413 #: ../tools/virt-cat.pl:53
23415 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
23419 #: ../tools/virt-cat.pl:56
23422 " virt-cat mydomain /etc/fstab\n"
23427 #: ../tools/virt-cat.pl:58
23428 msgid "List syslog messages from a VM:"
23432 #: ../tools/virt-cat.pl:60
23435 " virt-cat mydomain /var/log/messages | tail\n"
23440 #: ../tools/virt-cat.pl:62
23441 msgid "Find out what DHCP IP address a VM acquired:"
23445 #: ../tools/virt-cat.pl:64
23448 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
23453 #: ../tools/virt-cat.pl:66
23454 msgid "Find out what packages were recently installed:"
23458 #: ../tools/virt-cat.pl:68
23461 " virt-cat mydomain /var/log/yum.log | tail\n"
23466 #: ../tools/virt-cat.pl:70
23467 msgid "Find out who is logged on inside a virtual machine:"
23471 #: ../tools/virt-cat.pl:72
23474 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
23480 #: ../tools/virt-cat.pl:75
23481 msgid "or who was logged on:"
23485 #: ../tools/virt-cat.pl:77
23488 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
23489 " last -f /tmp/wtmp\n"
23494 #: ../tools/virt-cat.pl:109 ../tools/virt-df.pl:100 ../tools/virt-edit.pl:118
23495 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
23496 #: ../tools/virt-ls.pl:108 ../tools/virt-rescue.pl:140
23497 #: ../tools/virt-tar.pl:128 ../tools/virt-win-reg.pl:209
23499 "If you specify guest block devices directly, then libvirt is not used at all."
23503 #: ../tools/virt-cat.pl:165
23505 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, L<Sys::"
23506 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23510 #: ../tools/virt-cat.pl:173 ../tools/virt-df.pl:491 ../tools/virt-edit.pl:337
23511 #: ../tools/virt-list-filesystems.pl:203 ../tools/virt-list-partitions.pl:240
23512 #: ../tools/virt-ls.pl:221 ../tools/virt-make-fs.pl:552
23513 #: ../tools/virt-rescue.pl:241 ../tools/virt-resize.pl:1407
23514 #: ../tools/virt-tar.pl:268 ../tools/virt-win-reg.pl:487
23519 #: ../tools/virt-df.pl:36
23520 msgid "virt-df - Display free space on virtual filesystems"
23524 #: ../tools/virt-df.pl:40
23527 " virt-df [--options]\n"
23532 #: ../tools/virt-df.pl:42
23535 " virt-df [--options] domname\n"
23540 #: ../tools/virt-df.pl:44
23543 " virt-df [--options] disk.img [disk.img ...]\n"
23548 #: ../tools/virt-df.pl:48
23550 "C<virt-df> is a command line tool to display free space on virtual machine "
23551 "filesystems. Unlike other tools, it doesn't just display the amount of "
23552 "space allocated to a virtual machine, but can look inside the virtual "
23553 "machine to see how much space is really being used."
23557 #: ../tools/virt-df.pl:53
23559 "It is like the L<df(1)> command, but for virtual machines, except that it "
23560 "also works for Windows virtual machines."
23564 #: ../tools/virt-df.pl:56
23566 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
23567 "of all active and inactive guests, and performs a C<df>-type operation on "
23568 "each one in turn, printing out the results."
23572 #: ../tools/virt-df.pl:60
23574 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
23575 "either the single named libvirt domain, or on the disk image(s) listed on "
23576 "the command line (which must all belong to a single VM). In this mode (with "
23577 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
23578 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
23582 #: ../tools/virt-df.pl:67
23584 "Use the C<--csv> option to get a format which can be easily parsed by other "
23585 "programs. Other options are mostly similar to standard C<df> options. See "
23586 "below for the complete list."
23590 #: ../tools/virt-df.pl:107
23595 #: ../tools/virt-df.pl:109
23597 "Write out the results in CSV format (comma-separated values). This format "
23598 "can be imported easily into databases and spreadsheets, but read L</NOTE "
23599 "ABOUT CSV FORMAT> below."
23603 #: ../tools/virt-df.pl:117
23604 msgid "B<--human-readable> | B<-h>"
23608 #: ../tools/virt-df.pl:119
23609 msgid "Print sizes in human-readable format."
23613 #: ../tools/virt-df.pl:121
23614 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
23618 #: ../tools/virt-df.pl:127
23619 msgid "B<--inodes> | B<-i>"
23623 #: ../tools/virt-df.pl:129
23624 msgid "Print inodes instead of blocks."
23628 #: ../tools/virt-df.pl:458
23629 msgid "NOTE ABOUT CSV FORMAT"
23633 #: ../tools/virt-df.pl:460
23635 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
23636 "should be easy to parse, but it is definitely not easy to parse."
23640 #: ../tools/virt-df.pl:463
23642 "Myth: Just split fields at commas. Reality: This does I<not> work "
23643 "reliably. This example has two columns:"
23647 #: ../tools/virt-df.pl:466
23650 " \"foo,bar\",baz\n"
23655 #: ../tools/virt-df.pl:468
23657 "Myth: Read the file one line at a time. Reality: This does I<not> work "
23658 "reliably. This example has one row:"
23662 #: ../tools/virt-df.pl:471
23671 #: ../tools/virt-df.pl:474
23673 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
23674 "packaged in major Linux distributions)."
23678 #: ../tools/virt-df.pl:477
23680 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
23681 "or Python's built-in csv library)."
23685 #: ../tools/virt-df.pl:480
23686 msgid "Most spreadsheets and databases can import CSV directly."
23690 #: ../tools/virt-df.pl:497 ../tools/virt-edit.pl:343
23691 #: ../tools/virt-list-partitions.pl:246 ../tools/virt-rescue.pl:247
23692 msgid "Copyright (C) 2009-2010 Red Hat Inc."
23696 #: ../tools/virt-edit.pl:35
23697 msgid "virt-edit - Edit a file in a virtual machine"
23701 #: ../tools/virt-edit.pl:39
23704 " virt-edit [--options] domname file\n"
23709 #: ../tools/virt-edit.pl:41
23712 " virt-edit [--options] disk.img [disk.img ...] file\n"
23717 #: ../tools/virt-edit.pl:43
23720 " virt-edit [domname|disk.img] file -e 'expr'\n"
23725 #: ../tools/virt-edit.pl:47
23727 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
23728 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
23729 "doing this, but doesn't catch all cases."
23733 #: ../tools/virt-edit.pl:53
23735 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
23736 "the named virtual machine (or disk image)."
23740 #: ../tools/virt-edit.pl:56
23742 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
23743 "you should look at the L<guestfish(1)> tool."
23747 #: ../tools/virt-edit.pl:61
23748 msgid "Edit the named files interactively:"
23752 #: ../tools/virt-edit.pl:63
23755 " virt-edit mydomain /boot/grub/grub.conf\n"
23760 #: ../tools/virt-edit.pl:65
23763 " virt-edit mydomain /etc/passwd\n"
23768 #: ../tools/virt-edit.pl:67
23770 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
23771 "below). To change the init default level to 5:"
23775 #: ../tools/virt-edit.pl:71
23778 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
23783 #: ../tools/virt-edit.pl:97
23784 msgid "B<--backup extension> | B<-b extension>"
23788 #: ../tools/virt-edit.pl:99
23790 "Create a backup of the original file I<in the guest disk image>. The backup "
23791 "has the original filename with C<extension> added."
23795 #: ../tools/virt-edit.pl:102
23797 "Usually the first character of C<extension> would be a dot C<.> so you would "
23802 #: ../tools/virt-edit.pl:105
23805 " virt-edit -b .orig [etc]\n"
23810 #: ../tools/virt-edit.pl:107
23811 msgid "By default, no backup file is made."
23815 #: ../tools/virt-edit.pl:125
23816 msgid "B<--expr EXPR> | B<-e EXPR>"
23820 #: ../tools/virt-edit.pl:127
23822 "Instead of launching the external editor, non-interactively apply the Perl "
23823 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
23828 #: ../tools/virt-edit.pl:131
23830 "Be careful to properly quote the expression to prevent it from being altered "
23835 #: ../tools/virt-edit.pl:250
23836 msgid "NON-INTERACTIVE EDITING"
23840 #: ../tools/virt-edit.pl:252
23842 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
23843 "administrator can interactively edit the file."
23847 #: ../tools/virt-edit.pl:255
23849 "There are two ways also to use C<virt-edit> from scripts in order to make "
23850 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
23851 "like this, it's less error-prone to write scripts directly using the "
23852 "libguestfs API and Augeas for configuration file editing.)"
23856 #: ../tools/virt-edit.pl:261
23858 "The first method is to temporarily set C<$EDITOR> to any script or program "
23859 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
23860 "update C<tmpfile> in place however it likes."
23864 #: ../tools/virt-edit.pl:265
23866 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
23867 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
23868 "instances of C<foo> with C<bar> in a file:"
23872 #: ../tools/virt-edit.pl:269
23875 " virt-edit domname filename -e 's/foo/bar/'\n"
23880 #: ../tools/virt-edit.pl:271
23882 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
23883 "For example to delete root's password you could do:"
23887 #: ../tools/virt-edit.pl:274
23890 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
23895 #: ../tools/virt-edit.pl:276
23897 "What really happens is that the snippet is evaluated as a Perl expression "
23898 "for each line of the file. The line, including the final C<\\n>, is passed "
23899 "in C<$_> and the expression should update C<$_> or leave it unchanged."
23903 #: ../tools/virt-edit.pl:281
23905 "To delete a line, set C<$_> to the empty string. For example, to delete the "
23906 "C<apache> user account from the password file you can do:"
23910 #: ../tools/virt-edit.pl:284
23913 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
23918 #: ../tools/virt-edit.pl:286
23920 "To insert a line, prepend or append it to C<$_>. However appending lines to "
23921 "the end of the file is rather difficult this way since there is no concept "
23922 "of \"last line of the file\" - your expression just doesn't get called "
23923 "again. You might want to use the first method (setting C<$EDITOR>) if you "
23928 #: ../tools/virt-edit.pl:292
23930 "The variable C<$lineno> contains the current line number. As is "
23931 "traditional, the first line in the file is number C<1>."
23935 #: ../tools/virt-edit.pl:295
23937 "The return value from the expression is ignored, but the expression may call "
23938 "C<die> in order to abort the whole program, leaving the original file "
23943 #: ../tools/virt-edit.pl:299
23945 "Remember when matching the end of a line that C<$_> may contain the final C<"
23946 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
23947 "newline then neither of these. Thus to match or substitute some text at the "
23948 "end of a line, use this regular expression:"
23952 #: ../tools/virt-edit.pl:304
23955 " /some text(\\r?\\n)?$/\n"
23960 #: ../tools/virt-edit.pl:306
23962 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
23963 "$_> itself (since that would remove all newlines from the file):"
23967 #: ../tools/virt-edit.pl:310
23970 " my $m = $_; chomp $m; $m =~ /some text$/\n"
23975 #: ../tools/virt-edit.pl:316
23980 #: ../tools/virt-edit.pl:318
23982 "If set, this string is used as the editor. It may contain arguments, eg. C<"
23987 #: ../tools/virt-edit.pl:321
23988 msgid "If not set, C<vi> is used."
23992 #: ../tools/virt-edit.pl:327
23994 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
23995 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
24000 #: ../tools/virt-list-filesystems.pl:32
24002 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
24006 #: ../tools/virt-list-filesystems.pl:36
24009 " virt-list-filesystems [--options] domname\n"
24014 #: ../tools/virt-list-filesystems.pl:38
24017 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
24022 #: ../tools/virt-list-filesystems.pl:42
24024 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
24025 "are contained in a virtual machine or disk image."
24029 #: ../tools/virt-list-filesystems.pl:46
24031 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
24032 "functionality. For more complex cases you should look at the L<guestfish(1)"
24037 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-list-partitions.pl:95
24038 #: ../tools/virt-ls.pl:115
24039 msgid "B<-l> | B<--long>"
24043 #: ../tools/virt-list-filesystems.pl:88
24045 "With this option, C<virt-list-filesystems> displays the type of each "
24046 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
24050 #: ../tools/virt-list-filesystems.pl:95
24051 msgid "B<-a> | B<--all>"
24055 #: ../tools/virt-list-filesystems.pl:97
24057 "Normally we only show mountable filesystems. If this option is given then "
24058 "swap devices are shown too."
24062 #: ../tools/virt-list-filesystems.pl:193
24064 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
24065 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
24066 ">, L<http://libguestfs.org/>."
24070 #: ../tools/virt-list-partitions.pl:32
24072 "virt-list-partitions - List partitions in a virtual machine or disk image"
24076 #: ../tools/virt-list-partitions.pl:36
24079 " virt-list-partitions [--options] domname\n"
24084 #: ../tools/virt-list-partitions.pl:38
24087 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
24092 #: ../tools/virt-list-partitions.pl:42
24094 "C<virt-list-partitions> is a command line tool to list the partitions that "
24095 "are contained in a virtual machine or disk image. It is mainly useful as a "
24096 "first step to using L<virt-resize(1)>."
24100 #: ../tools/virt-list-partitions.pl:47
24102 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
24103 "functionality. For more complex cases you should look at the L<guestfish(1)"
24108 #: ../tools/virt-list-partitions.pl:87
24109 msgid "B<-h> | B<--human-readable>"
24113 #: ../tools/virt-list-partitions.pl:89
24114 msgid "Show sizes in human-readable form (eg. \"1G\")."
24118 #: ../tools/virt-list-partitions.pl:97
24120 "With this option, C<virt-list-partitions> displays the type and size of each "
24121 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
24125 #: ../tools/virt-list-partitions.pl:104
24126 msgid "B<-t> | B<--total>"
24130 #: ../tools/virt-list-partitions.pl:106
24132 "Display the total size of each block device (as a separate row or rows)."
24136 #: ../tools/virt-list-partitions.pl:231
24138 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
24139 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
24140 "libguestfs.org/>."
24144 #: ../tools/virt-ls.pl:35
24145 msgid "virt-ls - List files in a virtual machine"
24149 #: ../tools/virt-ls.pl:39
24152 " virt-ls [--options] domname directory\n"
24157 #: ../tools/virt-ls.pl:41
24160 " virt-ls [--options] disk.img [disk.img ...] directory\n"
24165 #: ../tools/virt-ls.pl:45
24167 "C<virt-ls> is a command line tool to list the names of files in a directory "
24168 "inside a virtual machine or disk image."
24172 #: ../tools/virt-ls.pl:48
24174 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
24175 "For more complex cases you should look at the L<guestfish(1)> tool."
24179 #: ../tools/virt-ls.pl:52
24181 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
24182 "simple listing is like the ordinary L<ls(1)> command:"
24186 #: ../tools/virt-ls.pl:55
24189 " $ virt-ls myguest /\n"
24197 #: ../tools/virt-ls.pl:60
24198 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
24202 #: ../tools/virt-ls.pl:62
24205 " $ virt-ls -l myguest /\n"
24207 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
24208 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
24214 #: ../tools/virt-ls.pl:68
24216 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
24217 "and directories recursively:"
24221 #: ../tools/virt-ls.pl:71
24224 " $ virt-ls -R myguest /tmp\n"
24232 #: ../tools/virt-ls.pl:76
24234 "You I<cannot> combine these options. To do more complicated things, use "
24239 #: ../tools/virt-ls.pl:117
24240 msgid "B<-R> | B<--recursive>"
24244 #: ../tools/virt-ls.pl:119
24246 "Select the mode. With neither of these options, C<virt-ls> produces a "
24247 "simple, flat list of the files in the named directory."
24251 #: ../tools/virt-ls.pl:122
24253 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
24254 "like the plain C<ls -l> command)."
24258 #: ../tools/virt-ls.pl:125
24260 "C<virt-ls -R> produces a recursive list of files starting at the named "
24261 "directory. See the documentation for the C<guestfs_find> command L<guestfs"
24262 "(3)> for precise details."
24266 #: ../tools/virt-ls.pl:129
24267 msgid "You cannot combine these options."
24271 #: ../tools/virt-ls.pl:212
24273 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
24274 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
24279 #: ../tools/virt-make-fs.pl:37
24280 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
24284 #: ../tools/virt-make-fs.pl:41
24287 " virt-make-fs [--options] input.tar output.img\n"
24292 #: ../tools/virt-make-fs.pl:43
24295 " virt-make-fs [--options] input.tar.gz output.img\n"
24300 #: ../tools/virt-make-fs.pl:45
24303 " virt-make-fs [--options] directory output.img\n"
24308 #: ../tools/virt-make-fs.pl:49
24310 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
24311 "archive or some files in a directory. It is similar to tools like L<mkisofs"
24312 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
24313 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
24314 "you want to attach these filesystems to existing virtual machines (eg. to "
24315 "import large amounts of read-only data to a VM)."
24319 #: ../tools/virt-make-fs.pl:57
24320 msgid "Basic usage is:"
24324 #: ../tools/virt-make-fs.pl:59
24327 " virt-make-fs input output\n"
24332 #: ../tools/virt-make-fs.pl:61
24334 "where C<input> is either a directory containing files that you want to add, "
24335 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
24336 "C<output> is a disk image. The input type is detected automatically. The "
24337 "output disk image defaults to a raw ext2 image unless you specify extra "
24338 "flags (see L</OPTIONS> below)."
24342 #: ../tools/virt-make-fs.pl:67
24343 msgid "EXTRA SPACE"
24347 #: ../tools/virt-make-fs.pl:69
24349 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
24350 "the files that it contains, but might have extra space. Depending on how "
24351 "you are going to use the output, you might think this extra space is wasted "
24352 "and want to minimize it, or you might want to leave space so that more files "
24353 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
24354 "but you can use the C<--size> flag to leave space in the filesystem if you "
24359 #: ../tools/virt-make-fs.pl:77
24361 "An alternative way to leave extra space but not make the output image any "
24362 "bigger is to use an alternative disk image format (instead of the default "
24363 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
24364 "image format (check your hypervisor supports this before using it). This "
24365 "allows you to choose a large C<--size> but the extra space won't actually be "
24366 "allocated in the image until you try to store something in it."
24370 #: ../tools/virt-make-fs.pl:85
24372 "Don't forget that you can also use local commands including L<resize2fs(8)> "
24373 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
24374 "resize to build another image from scratch."
24378 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
24379 #: ../tools/virt-make-fs.pl:142
24384 #: ../tools/virt-make-fs.pl:91
24387 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
24392 #: ../tools/virt-make-fs.pl:93
24393 msgid "FILESYSTEM TYPE"
24397 #: ../tools/virt-make-fs.pl:95
24399 "The default filesystem type is C<ext2>. Just about any filesystem type that "
24400 "libguestfs supports can be used (but I<not> read-only formats like "
24401 "ISO9660). Here are some of the more common choices:"
24405 #: ../tools/virt-make-fs.pl:101
24410 #: ../tools/virt-make-fs.pl:103
24412 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
24413 "you are not going to use the filesystem in a way that requires the journal, "
24414 "then this is just wasted overhead."
24418 #: ../tools/virt-make-fs.pl:107
24419 msgid "I<ntfs> or I<vfat>"
24423 #: ../tools/virt-make-fs.pl:109
24424 msgid "Useful if exporting data to a Windows guest."
24428 #: ../tools/virt-make-fs.pl:111
24430 "I<Note for vfat>: The tar archive or local directory must only contain files "
24431 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
24432 "program running within libguestfs is unable to change the ownership of non-"
24433 "root files, since vfat itself does not support this."
24437 #: ../tools/virt-make-fs.pl:116
24442 #: ../tools/virt-make-fs.pl:118
24444 "Lower overhead than C<ext2>, but certain limitations on filename length and "
24445 "total filesystem size."
24449 #: ../tools/virt-make-fs.pl:125
24452 " virt-make-fs --type=minix input minixfs.img\n"
24457 #: ../tools/virt-make-fs.pl:127
24458 msgid "TO PARTITION OR NOT TO PARTITION"
24462 #: ../tools/virt-make-fs.pl:129
24463 msgid "Optionally virt-make-fs can add a partition table to the output disk."
24467 #: ../tools/virt-make-fs.pl:131
24469 "Adding a partition can make the disk image more compatible with certain "
24470 "virtualized operating systems which don't expect to see a filesystem "
24471 "directly located on a block device (Linux doesn't care and will happily "
24472 "handle both types)."
24476 #: ../tools/virt-make-fs.pl:136
24478 "On the other hand, if you have a partition table then the output image is no "
24479 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
24480 "directly on a partitioned disk image. (However libguestfs tools such as "
24481 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
24485 #: ../tools/virt-make-fs.pl:144
24486 msgid "Add an MBR partition:"
24490 #: ../tools/virt-make-fs.pl:146
24493 " virt-make-fs --partition -- input disk.img\n"
24498 #: ../tools/virt-make-fs.pl:148
24500 "If the output disk image could be terabyte-sized or larger, it's better to "
24501 "use an EFI/GPT-compatible partition table:"
24505 #: ../tools/virt-make-fs.pl:151
24508 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
24513 #: ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:196
24518 #: ../tools/virt-make-fs.pl:179
24519 msgid "Enable debugging information."
24523 #: ../tools/virt-make-fs.pl:185
24524 msgid "B<--size=E<lt>NE<gt>>"
24528 #: ../tools/virt-make-fs.pl:187
24529 msgid "B<--size=+E<lt>NE<gt>>"
24533 #: ../tools/virt-make-fs.pl:189
24534 msgid "B<-s E<lt>NE<gt>>"
24538 #: ../tools/virt-make-fs.pl:191
24539 msgid "B<-s +E<lt>NE<gt>>"
24543 #: ../tools/virt-make-fs.pl:193
24545 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
24549 #: ../tools/virt-make-fs.pl:196
24551 "If this option is I<not> given, then the output image will be just large "
24552 "enough to contain all the files, with not much wasted space."
24556 #: ../tools/virt-make-fs.pl:199
24558 "To choose a fixed size output disk, specify an absolute number followed by b/"
24559 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24560 "Petabytes or Exabytes. This must be large enough to contain all the input "
24561 "files, else you will get an error."
24565 #: ../tools/virt-make-fs.pl:204
24567 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
24568 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24569 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
24570 "the input files, and (approximately) an extra 200 MB free space."
24574 #: ../tools/virt-make-fs.pl:210
24576 "Note that virt-make-fs estimates free space, and therefore will not produce "
24577 "filesystems containing precisely the free space requested. (It is much more "
24578 "expensive and time-consuming to produce a filesystem which has precisely the "
24579 "desired free space)."
24583 #: ../tools/virt-make-fs.pl:219
24584 msgid "B<--format=E<lt>fmtE<gt>>"
24588 #: ../tools/virt-make-fs.pl:221
24589 msgid "B<-F E<lt>fmtE<gt>>"
24593 #: ../tools/virt-make-fs.pl:223
24594 msgid "Choose the output disk image format."
24598 #: ../tools/virt-make-fs.pl:225
24599 msgid "The default is C<raw> (raw disk image)."
24603 #: ../tools/virt-make-fs.pl:227
24605 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
24606 "that would really make sense here is C<qcow2>."
24610 #: ../tools/virt-make-fs.pl:234
24611 msgid "B<--type=E<lt>fsE<gt>>"
24615 #: ../tools/virt-make-fs.pl:236
24616 msgid "B<-t E<lt>fsE<gt>>"
24620 #: ../tools/virt-make-fs.pl:238
24621 msgid "Choose the output filesystem type."
24625 #: ../tools/virt-make-fs.pl:240
24626 msgid "The default is C<ext2>."
24630 #: ../tools/virt-make-fs.pl:242
24632 "Any filesystem which is supported read-write by libguestfs can be used here."
24636 #: ../tools/virt-make-fs.pl:249
24637 msgid "B<--partition>"
24641 #: ../tools/virt-make-fs.pl:251
24642 msgid "B<--partition=E<lt>parttypeE<gt>>"
24646 #: ../tools/virt-make-fs.pl:253
24648 "If specified, this flag adds an MBR partition table to the output disk image."
24652 #: ../tools/virt-make-fs.pl:256
24654 "You can change the partition table type, eg. C<--partition=gpt> for large "
24659 #: ../tools/virt-make-fs.pl:259
24661 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
24662 "might consider the next parameter to be the partition type. For example:"
24666 #: ../tools/virt-make-fs.pl:263
24669 " virt-make-fs --partition input.tar ...\n"
24674 #: ../tools/virt-make-fs.pl:265
24676 "would cause virt-make-fs to think you wanted to use a partition type of "
24677 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
24678 "dash) between options and the input file argument:"
24682 #: ../tools/virt-make-fs.pl:269
24685 " virt-make-fs --partition -- input.tar ...\n"
24690 #: ../tools/virt-make-fs.pl:529
24692 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
24693 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
24694 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
24698 #: ../tools/virt-make-fs.pl:543 ../tools/virt-win-reg.pl:478
24700 "When reporting bugs, please enable debugging and capture the I<complete> "
24705 #: ../tools/virt-make-fs.pl:546
24708 " export LIBGUESTFS_DEBUG=1\n"
24709 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
24714 #: ../tools/virt-make-fs.pl:549
24716 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
24721 #: ../tools/virt-make-fs.pl:558 ../tools/virt-resize.pl:1413
24722 #: ../tools/virt-win-reg.pl:493
24723 msgid "Copyright (C) 2010 Red Hat Inc."
24727 #: ../tools/virt-rescue.pl:33
24728 msgid "virt-rescue - Run a rescue shell on a virtual machine"
24732 #: ../tools/virt-rescue.pl:37
24735 " virt-rescue [--options] domname\n"
24740 #: ../tools/virt-rescue.pl:39
24743 " virt-rescue [--options] disk.img [disk.img ...]\n"
24748 #: ../tools/virt-rescue.pl:43
24750 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
24751 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
24752 "you from doing this, but doesn't catch all cases."
24756 #: ../tools/virt-rescue.pl:47
24758 "However if you use the I<--ro> (read only) option, then you can attach a "
24759 "shell to a live virtual machine. The results might be strange or "
24760 "inconsistent at times but you won't get disk corruption."
24764 #: ../tools/virt-rescue.pl:53
24766 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
24767 "need for a CD. virt-rescue gives you a rescue shell and some simple "
24768 "recovery tools which you can use to examine or rescue a virtual machine or "
24773 #: ../tools/virt-rescue.pl:58
24775 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
24776 "on disk image(s):"
24780 #: ../tools/virt-rescue.pl:61
24783 " virt-rescue GuestName\n"
24788 #: ../tools/virt-rescue.pl:63
24791 " virt-rescue --ro /path/to/disk.img\n"
24796 #: ../tools/virt-rescue.pl:65
24799 " virt-rescue /dev/sdc\n"
24804 #: ../tools/virt-rescue.pl:67
24805 msgid "For live VMs you I<must> use the --ro option."
24809 #: ../tools/virt-rescue.pl:69
24811 "When you run virt-rescue on a virtual machine or disk image, you are placed "
24812 "in an interactive bash shell where you can use many ordinary Linux "
24813 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
24814 "appliance. You must mount the virtual machine's filesystems by hand. There "
24815 "is an empty directory called C</sysroot> where you can mount filesystems."
24819 #: ../tools/virt-rescue.pl:76
24821 "In the example below, we list logical volumes, then choose one to mount "
24822 "under C</sysroot>:"
24826 #: ../tools/virt-rescue.pl:79
24830 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
24831 " lv_root vg_f11x64 -wi-a- 8.83G\n"
24832 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
24833 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
24834 " ><rescue> ls /sysroot\n"
24839 #: ../tools/virt-rescue.pl:86
24841 "If you don't know what filesystems are available on the virtual machine then "
24842 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
24846 #: ../tools/virt-rescue.pl:90 ../tools/virt-resize.pl:1350
24851 #: ../tools/virt-rescue.pl:92
24853 "Virt-rescue can be used on I<any> disk image file or device, not just a "
24854 "virtual machine. For example you can use it on a blank file if you want to "
24855 "partition that file (although we would recommend using L<guestfish(1)> "
24856 "instead as it is more suitable for this purpose). You can even use virt-"
24857 "rescue on things like SD cards."
24861 #: ../tools/virt-rescue.pl:98
24863 "This tool is just designed for quick interactive hacking on a virtual "
24864 "machine. For more structured access to a virtual machine disk image, you "
24865 "should use L<guestfs(3)>. To get a structured shell that you can use to "
24866 "make scripted changes to guests, use L<guestfish(1)>."
24870 #: ../tools/virt-rescue.pl:127
24871 msgid "B<--append kernelopts>"
24875 #: ../tools/virt-rescue.pl:129
24876 msgid "Pass additional options to the rescue kernel."
24880 #: ../tools/virt-rescue.pl:147
24881 msgid "B<--memsize MB> | B<-m MB>"
24885 #: ../tools/virt-rescue.pl:149
24887 "Change the amount of memory allocated to the rescue system. The default is "
24888 "set by libguestfs and is small but adequate for running system tools. The "
24889 "occasional program might need more memory. The parameter is specified in "
24894 #: ../tools/virt-rescue.pl:158
24895 msgid "B<--ro> | B<-r>"
24899 #: ../tools/virt-rescue.pl:160
24900 msgid "Open the image read-only."
24904 #: ../tools/virt-rescue.pl:172
24906 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
24907 "SELINUX> before using this option."
24911 #: ../tools/virt-rescue.pl:228
24913 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
24914 "ENVIRONMENT VARIABLES> for the complete list."
24918 #: ../tools/virt-rescue.pl:233
24920 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24921 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24925 #: ../tools/virt-resize.pl:42
24926 msgid "virt-resize - Resize a virtual machine disk"
24930 #: ../tools/virt-resize.pl:46
24933 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24934 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24935 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24940 #: ../tools/virt-resize.pl:52
24942 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24943 "larger or smaller overall, and resizing or deleting any partitions contained "
24948 #: ../tools/virt-resize.pl:56
24950 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24951 "not> be used on live virtual machines - for consistent results, shut the "
24952 "virtual machine down before resizing it."
24956 #: ../tools/virt-resize.pl:60
24958 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
24959 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
24960 "read those manual pages first."
24964 #: ../tools/virt-resize.pl:68
24966 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
24967 "fill the extra 5GB of space."
24971 #: ../tools/virt-resize.pl:71
24974 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
24975 " virt-list-partitions -lht olddisk\n"
24976 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
24977 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
24982 #: ../tools/virt-resize.pl:76
24984 "As above, but make the /boot partition 200MB bigger, while giving the "
24985 "remaining space to /dev/sda2:"
24989 #: ../tools/virt-resize.pl:79
24992 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
24997 #: ../tools/virt-resize.pl:81
24998 msgid "DETAILED USAGE"
25002 #: ../tools/virt-resize.pl:83
25003 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25007 #: ../tools/virt-resize.pl:87
25008 msgid "1. Shut down the virtual machine"
25012 #: ../tools/virt-resize.pl:89
25013 msgid "2. Locate input disk image"
25017 #: ../tools/virt-resize.pl:91
25019 "Locate the input disk image (ie. the file or device on the host containing "
25020 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25021 "dumpxml> like this to find the disk image name:"
25025 #: ../tools/virt-resize.pl:95
25028 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25029 " Found 1 nodes:\n"
25031 " <source dev=\"/dev/vg/lv_guest\" />\n"
25036 #: ../tools/virt-resize.pl:100
25037 msgid "3. Look at current sizing"
25041 #: ../tools/virt-resize.pl:102
25043 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25047 #: ../tools/virt-resize.pl:105
25050 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25051 " /dev/sda1 ext3 101.9M\n"
25052 " /dev/sda2 pv 7.9G\n"
25053 " /dev/sda device 8.0G\n"
25058 #: ../tools/virt-resize.pl:110
25060 "(This example is a virtual machine with an 8 GB disk which we would like to "
25061 "expand up to 10 GB)."
25065 #: ../tools/virt-resize.pl:113
25066 msgid "4. Create output disk"
25070 #: ../tools/virt-resize.pl:115
25072 "Virt-resize cannot do in-place disk modifications. You have to have space "
25073 "to store the resized output disk."
25077 #: ../tools/virt-resize.pl:118
25079 "To store the resized disk image in a file, create a file of a suitable size:"
25083 #: ../tools/virt-resize.pl:121
25086 " # rm -f outdisk\n"
25087 " # truncate -s 10G outdisk\n"
25092 #: ../tools/virt-resize.pl:124
25093 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25097 #: ../tools/virt-resize.pl:126
25100 " # lvcreate -L 10G -n lv_name vg_name\n"
25105 #: ../tools/virt-resize.pl:128
25106 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25110 #: ../tools/virt-resize.pl:130
25113 " # virsh pool-list\n"
25114 " # virsh vol-create-as poolname newvol 10G\n"
25119 #: ../tools/virt-resize.pl:133
25124 #: ../tools/virt-resize.pl:135
25126 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25127 "file) and the output disk. The output disk is the one created in the "
25132 #: ../tools/virt-resize.pl:139
25135 " # virt-resize indisk outdisk\n"
25140 #: ../tools/virt-resize.pl:141
25142 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25143 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25144 "larger, then an extra, empty partition is created at the end of the disk "
25145 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25150 #: ../tools/virt-resize.pl:147
25152 "More realistically you'd want to expand existing partitions in the disk "
25153 "image by passing extra options (for the full list see the L</OPTIONS> "
25158 #: ../tools/virt-resize.pl:151
25160 "L</--expand> is the most useful option. It expands the named partition "
25161 "within the disk to fill any extra space:"
25165 #: ../tools/virt-resize.pl:154
25168 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25173 #: ../tools/virt-resize.pl:156
25175 "(In this case, an extra partition is I<not> created at the end of the disk, "
25176 "because there will be no unused space)."
25180 #: ../tools/virt-resize.pl:159
25182 "L</--resize> is the other commonly used option. The following would "
25183 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25184 "rest of the available space:"
25188 #: ../tools/virt-resize.pl:163
25191 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25192 " indisk outdisk\n"
25197 #: ../tools/virt-resize.pl:166
25199 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25200 "if virt-resize knows how, it will resize the contents, the equivalent of "
25201 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
25202 ">. However virt-resize does not know how to resize some filesystems, so you "
25203 "would have to online resize them after booting the guest. And virt-resize "
25204 "also does not resize anything inside an LVM PV, it just resizes the PV "
25205 "itself and leaves the user to resize any LVs inside that PV as desired."
25209 #: ../tools/virt-resize.pl:175
25210 msgid "Other options are covered below."
25214 #: ../tools/virt-resize.pl:177
25219 #: ../tools/virt-resize.pl:179
25220 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25224 #: ../tools/virt-resize.pl:181
25225 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25229 #: ../tools/virt-resize.pl:183
25232 " # virsh edit guestname\n"
25237 #: ../tools/virt-resize.pl:185
25239 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
25240 "html#elementsDisks>"
25244 #: ../tools/virt-resize.pl:188
25245 msgid "Then start up the domain with the new, resized disk:"
25249 #: ../tools/virt-resize.pl:190
25252 " # virsh start guestname\n"
25257 #: ../tools/virt-resize.pl:192
25259 "and check that it still works. See also the L</NOTES> section below for "
25260 "additional information."
25264 #: ../tools/virt-resize.pl:195
25265 msgid "7. Resize LVs etc inside the guest"
25269 #: ../tools/virt-resize.pl:197
25270 msgid "(This can also be done offline using L<guestfish(1)>)"
25274 #: ../tools/virt-resize.pl:199
25276 "Once the guest has booted you should see the new space available, at least "
25277 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25278 "may need to resize LVs inside PVs, and also resize filesystem types that "
25279 "virt-resize does not know how to expand."
25283 #: ../tools/virt-resize.pl:206
25284 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25288 #: ../tools/virt-resize.pl:208
25290 "Shrinking is somewhat more complex than expanding, and only an overview is "
25295 #: ../tools/virt-resize.pl:211
25297 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25298 "filesystems). The user has to shrink content before passing the disk image "
25299 "to virt-resize, and virt-resize will check that the content has been shrunk "
25304 #: ../tools/virt-resize.pl:216
25305 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25309 #: ../tools/virt-resize.pl:218
25311 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25312 "steps 3 and 4 above to allocate a new disk image."
25316 #: ../tools/virt-resize.pl:221
25318 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25322 #: ../tools/virt-resize.pl:224
25323 msgid "IGNORING OR DELETING PARTITIONS"
25327 #: ../tools/virt-resize.pl:226
25329 "virt-resize also gives a convenient way to ignore or delete partitions when "
25330 "copying from the input disk to the output disk. Ignoring a partition speeds "
25331 "up the copy where you don't care about the existing contents of a "
25332 "partition. Deleting a partition removes it completely, but note that it "
25333 "also renumbers any partitions after the one which is deleted, which can "
25334 "leave some guests unbootable."
25338 #: ../tools/virt-resize.pl:243
25339 msgid "Display help."
25343 #: ../tools/virt-resize.pl:257
25344 msgid "B<--resize part=size>"
25348 #: ../tools/virt-resize.pl:259
25350 "Resize the named partition (expanding or shrinking it) so that it has the "
25355 #: ../tools/virt-resize.pl:262
25357 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25358 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25359 "Exabytes; or as a percentage of the current size; or as a relative number or "
25360 "percentage. For example:"
25364 #: ../tools/virt-resize.pl:267
25367 " --resize /dev/sda2=10G\n"
25372 #: ../tools/virt-resize.pl:269
25375 " --resize /dev/sda4=90%\n"
25380 #: ../tools/virt-resize.pl:271
25383 " --resize /dev/sda2=+1G\n"
25388 #: ../tools/virt-resize.pl:273
25391 " --resize /dev/sda2=-200M\n"
25396 #: ../tools/virt-resize.pl:275
25399 " --resize /dev/sda1=+128K\n"
25404 #: ../tools/virt-resize.pl:277
25407 " --resize /dev/sda1=+10%\n"
25412 #: ../tools/virt-resize.pl:279
25415 " --resize /dev/sda1=-10%\n"
25420 #: ../tools/virt-resize.pl:281
25422 "You can increase the size of any partition. Virt-resize will expand the "
25423 "direct content of the partition if it knows how (see C<--expand> below)."
25427 #: ../tools/virt-resize.pl:285
25429 "You can only I<decrease> the size of partitions that contain filesystems or "
25430 "PVs which have already been shrunk. Virt-resize will check this has been "
25431 "done before proceeding, or else will print an error (see also C<--resize-"
25436 #: ../tools/virt-resize.pl:290 ../tools/virt-resize.pl:382
25437 #: ../tools/virt-resize.pl:399
25438 msgid "You can give this option multiple times."
25442 #: ../tools/virt-resize.pl:296
25443 msgid "B<--resize-force part=size>"
25447 #: ../tools/virt-resize.pl:298
25449 "This is the same as C<--resize> except that it will let you decrease the "
25450 "size of any partition. Generally this means you will lose any data which "
25451 "was at the end of the partition you shrink, but you may not care about that "
25452 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25453 "as a swap partition)."
25457 #: ../tools/virt-resize.pl:304
25458 msgid "See also the C<--ignore> option."
25462 #: ../tools/virt-resize.pl:310
25463 msgid "B<--expand part>"
25467 #: ../tools/virt-resize.pl:312
25469 "Expand the named partition so it uses up all extra space (space left over "
25470 "after any other resize changes that you request have been done)."
25474 #: ../tools/virt-resize.pl:315
25476 "If virt-resize knows how, it will expand the direct content of the "
25477 "partition. For example, if the partition is an LVM PV, it will expand the "
25478 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25479 "content it doesn't know about alone."
25483 #: ../tools/virt-resize.pl:320
25484 msgid "Currently virt-resize can resize:"
25488 #: ../tools/virt-resize.pl:326
25490 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25495 #: ../tools/virt-resize.pl:331
25497 "NTFS filesystems contained directly in a partition, if libguestfs was "
25498 "compiled with support for NTFS."
25502 #: ../tools/virt-resize.pl:334
25504 "The filesystem must have been shut down consistently last time it was used. "
25505 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25506 "consistency check, so at the first boot after resizing Windows will check "
25511 #: ../tools/virt-resize.pl:341
25513 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25514 "inside the PV. The user will have to resize LVs as desired."
25518 #: ../tools/virt-resize.pl:347 ../tools/virt-resize.pl:369
25519 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25523 #: ../tools/virt-resize.pl:353
25524 msgid "B<--shrink part>"
25528 #: ../tools/virt-resize.pl:355
25530 "Shrink the named partition until the overall disk image fits in the "
25531 "destination. The named partition B<must> contain a filesystem or PV which "
25532 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25533 "online tools). Virt-resize will check this and give an error if it has not "
25538 #: ../tools/virt-resize.pl:361
25540 "The amount by which the overall disk must be shrunk (after carrying out all "
25541 "other operations requested by the user) is called the \"deficit\". For "
25542 "example, a straight copy (assume no other operations) from a 5GB disk image "
25543 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25544 "would give an error unless the user specified a partition to shrink and that "
25545 "partition had more than a gigabyte of free space."
25549 #: ../tools/virt-resize.pl:375
25550 msgid "B<--ignore part>"
25554 #: ../tools/virt-resize.pl:377
25556 "Ignore the named partition. Effectively this means the partition is "
25557 "allocated on the destination disk, but the content is not copied across from "
25558 "the source disk. The content of the partition will be blank (all zero "
25563 #: ../tools/virt-resize.pl:388
25564 msgid "B<--delete part>"
25568 #: ../tools/virt-resize.pl:390
25570 "Delete the named partition. It would be more accurate to describe this as "
25571 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25572 "the original disk image is left intact."
25576 #: ../tools/virt-resize.pl:394
25578 "Note that when you delete a partition, then anything contained in the "
25579 "partition is also deleted. Furthermore, this causes any partitions that "
25580 "come after to be I<renumbered>, which can easily make your guest unbootable."
25584 #: ../tools/virt-resize.pl:405
25585 msgid "B<--LV-expand logvol>"
25589 #: ../tools/virt-resize.pl:407
25591 "This takes the logical volume and, as a final step, expands it to fill all "
25592 "the space available in its volume group. A typical usage, assuming a Linux "
25593 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
25594 "lv_root> would be:"
25598 #: ../tools/virt-resize.pl:412
25601 " virt-resize indisk outdisk \\\n"
25602 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25607 #: ../tools/virt-resize.pl:415
25609 "This would first expand the partition (and PV), and then expand the root "
25610 "device to fill the extra space in the PV."
25614 #: ../tools/virt-resize.pl:418
25616 "The contents of the LV are also resized if virt-resize knows how to do "
25617 "that. You can stop virt-resize from trying to expand the content by using "
25618 "the option C<--no-expand-content>."
25622 #: ../tools/virt-resize.pl:422
25623 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25627 #: ../tools/virt-resize.pl:425
25629 "You can give this option multiple times, I<but> it doesn't make sense to do "
25630 "this unless the logical volumes you specify are all in different volume "
25635 #: ../tools/virt-resize.pl:433
25636 msgid "B<--no-copy-boot-loader>"
25640 #: ../tools/virt-resize.pl:435
25642 "By default, virt-resize copies over some sectors at the start of the disk "
25643 "(up to the beginning of the first partition). Commonly these sectors "
25644 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25645 "in order for the guest to boot correctly."
25649 #: ../tools/virt-resize.pl:440
25651 "If you specify this flag, then this initial copy is not done. You may need "
25652 "to reinstall the boot loader in this case."
25656 #: ../tools/virt-resize.pl:448
25657 msgid "B<--no-extra-partition>"
25661 #: ../tools/virt-resize.pl:450
25663 "By default, virt-resize creates an extra partition if there is any extra, "
25664 "unused space after all resizing has happened. Use this option to prevent "
25665 "the extra partition from being created. If you do this then the extra space "
25666 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25667 "tool in the guest."
25671 #: ../tools/virt-resize.pl:456
25673 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25678 #: ../tools/virt-resize.pl:463
25679 msgid "B<--no-expand-content>"
25683 #: ../tools/virt-resize.pl:465
25685 "By default, virt-resize will try to expand the direct contents of "
25686 "partitions, if it knows how (see C<--expand> option above)."
25690 #: ../tools/virt-resize.pl:468
25692 "If you give the C<--no-expand-content> option then virt-resize will not "
25697 #: ../tools/virt-resize.pl:475
25698 msgid "B<-d> | B<--debug>"
25702 #: ../tools/virt-resize.pl:477 ../tools/virt-win-reg.pl:198
25703 msgid "Enable debugging messages."
25707 #: ../tools/virt-resize.pl:483
25708 msgid "B<-n> | B<--dryrun>"
25712 #: ../tools/virt-resize.pl:485
25713 msgid "Print a summary of what would be done, but don't do anything."
25717 #: ../tools/virt-resize.pl:491
25718 msgid "B<-q> | B<--quiet>"
25722 #: ../tools/virt-resize.pl:493
25723 msgid "Don't print the summary."
25727 #: ../tools/virt-resize.pl:1352
25728 msgid "\"Partition 1 does not end on cylinder boundary.\""
25732 #: ../tools/virt-resize.pl:1354
25734 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25735 "means the partitions will not be aligned to the ancient CHS geometry. "
25736 "However CHS geometry is meaningless for disks manufactured since the early "
25737 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25738 "cylinders is not required by any modern operating system."
25742 #: ../tools/virt-resize.pl:1361
25743 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25747 #: ../tools/virt-resize.pl:1363
25749 "In Windows Vista and later versions, Microsoft switched to using a separate "
25750 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25751 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
25752 "the boot partition. Doing so seems to break the guest completely. However "
25753 "expanding the second partition (ie. C: drive) should work."
25757 #: ../tools/virt-resize.pl:1370
25759 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25760 "NTFS partitions have been expanded. This is just a safety check and (unless "
25761 "it find errors) is nothing to worry about."
25765 #: ../tools/virt-resize.pl:1374
25766 msgid "ALTERNATIVE TOOLS"
25770 #: ../tools/virt-resize.pl:1376
25772 "There are several proprietary tools for resizing partitions. We won't "
25773 "mention any here."
25777 #: ../tools/virt-resize.pl:1379
25779 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25780 "operations on disk images. They can resize and move partitions, but I don't "
25781 "think they can do anything with the contents, and they certainly don't "
25786 #: ../tools/virt-resize.pl:1384
25788 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25789 "but at a much lower level. You will probably end up hand-calculating sector "
25790 "offsets, which is something that virt-resize was designed to avoid. If you "
25791 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25796 #: ../tools/virt-resize.pl:1392
25798 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
25799 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
25800 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<Sys::Guestfs"
25801 "(3)>, L<http://libguestfs.org/>."
25805 #: ../tools/virt-tar.pl:34
25806 msgid "virt-tar - Extract or upload files to a virtual machine"
25810 #: ../tools/virt-tar.pl:38
25813 " virt-tar [--options] -x domname directory tarball\n"
25818 #: ../tools/virt-tar.pl:40
25821 " virt-tar [--options] -u domname tarball directory\n"
25826 #: ../tools/virt-tar.pl:42
25829 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
25834 #: ../tools/virt-tar.pl:44
25837 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
25842 #: ../tools/virt-tar.pl:48
25843 msgid "Download C</home> from the VM into a local tarball:"
25847 #: ../tools/virt-tar.pl:50
25850 " virt-tar -x domname /home home.tar\n"
25855 #: ../tools/virt-tar.pl:52
25858 " virt-tar -zx domname /home home.tar.gz\n"
25863 #: ../tools/virt-tar.pl:54
25864 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
25868 #: ../tools/virt-tar.pl:56
25871 " virt-tar -u domname uploadstuff.tar /tmp\n"
25876 #: ../tools/virt-tar.pl:58
25879 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
25884 #: ../tools/virt-tar.pl:62
25886 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
25887 "virtual machines. If you do this, you risk disk corruption in the VM. "
25888 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
25892 #: ../tools/virt-tar.pl:67
25894 "You can use C<-x> (extract) on live virtual machines, but you might get "
25895 "inconsistent results or errors if there is filesystem activity inside the "
25896 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
25897 "work, but the only way to guarantee consistent results is if the virtual "
25898 "machine is shut down."
25902 #: ../tools/virt-tar.pl:75
25904 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
25905 "parts of a guest filesystem. There are many possibilities: making backups, "
25906 "uploading data files, snooping on guest activity, fixing or customizing "
25911 #: ../tools/virt-tar.pl:80
25913 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
25914 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
25915 "should look at the L<guestfish(1)> tool."
25919 #: ../tools/virt-tar.pl:84
25921 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
25922 "its contents (recursively) from the virtual machine into a local tarball. "
25923 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
25924 "virtual machine. You cannot use these two options together."
25928 #: ../tools/virt-tar.pl:90
25930 "In addition, you may need to use the C<-z> (gZip) option to enable "
25931 "compression. When uploading, you have to specify C<-z> if the upload file "
25932 "is compressed because virt-tar won't detect this on its own."
25936 #: ../tools/virt-tar.pl:94
25938 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
25939 "example it cannot do PKZip files or bzip2 compression. If you want that "
25940 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
25941 "the L<libguestfs(3)> API)."
25945 #: ../tools/virt-tar.pl:135
25946 msgid "B<-x> | B<--extract> | B<--download>"
25950 #: ../tools/virt-tar.pl:137
25951 msgid "B<-u> | B<--upload>"
25955 #: ../tools/virt-tar.pl:139
25957 "Use C<-x> to extract (download) a directory from a virtual machine to a "
25962 #: ../tools/virt-tar.pl:142
25964 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
25965 "Please read the L</WARNING> section above before using this option."
25969 #: ../tools/virt-tar.pl:146
25970 msgid "You must specify exactly one of these options."
25974 #: ../tools/virt-tar.pl:152
25975 msgid "B<-z> | B<--gzip>"
25979 #: ../tools/virt-tar.pl:154
25980 msgid "Specify that the input or output tarball is gzip-compressed."
25984 #: ../tools/virt-tar.pl:259
25986 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
25987 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
25992 #: ../tools/virt-win-reg.pl:38
25994 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
25998 #: ../tools/virt-win-reg.pl:42
26001 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26006 #: ../tools/virt-win-reg.pl:44
26009 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26014 #: ../tools/virt-win-reg.pl:46
26017 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26022 #: ../tools/virt-win-reg.pl:48
26025 " virt-win-reg --merge domname [input.reg ...]\n"
26030 #: ../tools/virt-win-reg.pl:50
26033 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26038 #: ../tools/virt-win-reg.pl:54
26040 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26041 "virtual machines. If you do this, you I<will> get irreversible disk "
26042 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26043 "but doesn't catch all cases."
26047 #: ../tools/virt-win-reg.pl:59
26049 "Modifying the Windows Registry is an inherently risky operation. The format "
26050 "is deliberately obscure and undocumented, and Registry changes can leave the "
26051 "system unbootable. Therefore when using the C<--merge> option, make sure "
26052 "you have a reliable backup first."
26056 #: ../tools/virt-win-reg.pl:66
26058 "This program can export and merge Windows Registry entries from a Windows "
26063 #: ../tools/virt-win-reg.pl:69
26065 "The first parameter is the libvirt guest name or the raw disk image of a "
26070 #: ../tools/virt-win-reg.pl:72
26072 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26073 "exported (recursively). For example:"
26077 #: ../tools/virt-win-reg.pl:75
26080 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26085 #: ../tools/virt-win-reg.pl:77
26087 "You can also display single values from within registry keys, for example:"
26091 #: ../tools/virt-win-reg.pl:80
26094 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26095 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26096 " Windows 7 Enterprise\n"
26101 #: ../tools/virt-win-reg.pl:84
26103 "With C<--merge>, you can merge a textual regedit file into the Windows "
26108 #: ../tools/virt-win-reg.pl:87
26111 " $ virt-win-reg --merge Windows7 changes.reg\n"
26116 #: ../tools/virt-win-reg.pl:89
26117 msgid "SUPPORTED SYSTEMS"
26121 #: ../tools/virt-win-reg.pl:91
26123 "The program currently supports Windows NT-derived guests starting with "
26124 "Windows XP through to at least Windows 7."
26128 #: ../tools/virt-win-reg.pl:94
26130 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26131 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26132 "and C<HKEY_USERS\\.DEFAULT>."
26136 #: ../tools/virt-win-reg.pl:98
26138 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26143 #: ../tools/virt-win-reg.pl:101
26145 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26150 #: ../tools/virt-win-reg.pl:104
26155 #: ../tools/virt-win-reg.pl:106
26157 "This program is only meant for simple access to the registry. If you want "
26158 "to do complicated things with the registry, we suggest you download the "
26159 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26160 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26161 "L<hivexregedit(1)>."
26165 #: ../tools/virt-win-reg.pl:112
26170 #: ../tools/virt-win-reg.pl:114
26172 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26173 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26174 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26175 "Windows-style line endings, you may need to reencode the whole file before "
26176 "or after processing."
26180 #: ../tools/virt-win-reg.pl:120
26182 "To reencode a file from Windows format to Linux (before processing it with "
26183 "the C<--merge> option), you would do something like this:"
26187 #: ../tools/virt-win-reg.pl:123
26190 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26195 #: ../tools/virt-win-reg.pl:125
26197 "To go in the opposite direction, after exporting and before sending the file "
26198 "to a Windows user, do something like this:"
26202 #: ../tools/virt-win-reg.pl:128
26205 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26210 #: ../tools/virt-win-reg.pl:130
26211 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26215 #: ../tools/virt-win-reg.pl:132
26217 "If you are unsure about the current encoding, use the L<file(1)> command. "
26218 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26219 "style (CRLF) line endings, like this:"
26223 #: ../tools/virt-win-reg.pl:136
26226 " $ file software.reg\n"
26227 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26228 " with CRLF line terminators\n"
26233 #: ../tools/virt-win-reg.pl:140
26234 msgid "This file would need conversion before you could C<--merge> it."
26238 #: ../tools/virt-win-reg.pl:142
26239 msgid "SHELL QUOTING"
26243 #: ../tools/virt-win-reg.pl:144
26245 "Be careful when passing parameters containing C<\\> (backslash) in the "
26246 "shell. Usually you will have to use 'single quotes' or double backslashes "
26247 "(but not both) to protect them from the shell."
26251 #: ../tools/virt-win-reg.pl:148
26252 msgid "Paths and value names are case-insensitive."
26256 #: ../tools/virt-win-reg.pl:150
26257 msgid "CurrentControlSet etc."
26261 #: ../tools/virt-win-reg.pl:152
26263 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26264 "Registry at the level of the hive file, and therefore you cannot modify "
26269 #: ../tools/virt-win-reg.pl:156
26271 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26272 "circumstances it might refer to another control set. The way to find out is "
26273 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26277 #: ../tools/virt-win-reg.pl:160
26280 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26281 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26282 " \"Current\"=dword:00000001\n"
26283 " \"Default\"=dword:00000001\n"
26284 " \"Failed\"=dword:00000000\n"
26285 " \"LastKnownGood\"=dword:00000002\n"
26290 #: ../tools/virt-win-reg.pl:167
26291 msgid "\"Default\" is the one which Windows will choose when it boots."
26295 #: ../tools/virt-win-reg.pl:169
26297 "Similarly, other C<Current...> keys in the path may need to be replaced."
26301 #: ../tools/virt-win-reg.pl:216
26306 #: ../tools/virt-win-reg.pl:218
26308 "In merge mode, this merges a textual regedit file into the Windows Registry "
26309 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26310 "displays or exports Registry entries instead."
26314 #: ../tools/virt-win-reg.pl:222
26316 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26317 "result in disk corruption. However exporting (without this flag) is always "
26322 #: ../tools/virt-win-reg.pl:230
26323 msgid "B<--encoding> UTF-16LE|ASCII"
26327 #: ../tools/virt-win-reg.pl:232
26329 "When merging (only), you may need to specify the encoding for strings to be "
26330 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26331 "(3)/ENCODING STRINGS>."
26335 #: ../tools/virt-win-reg.pl:236
26337 "The default is to use UTF-16LE, which should work with recent versions of "
26342 #: ../tools/virt-win-reg.pl:463
26344 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26345 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26346 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26350 #: ../tools/virt-win-reg.pl:481
26353 " export LIBGUESTFS_DEBUG=1\n"
26354 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26359 #: ../tools/virt-win-reg.pl:484
26361 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."