1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2010-11-02 16:25+0000\n"
11 "PO-Revision-Date: 2010-09-02 14:46+0100\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1
21 #: ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1
22 #: ../inspector/virt-inspector.pl:31 ../tools/virt-edit.pl:30
23 #: ../tools/virt-win-reg.pl:33 ../tools/virt-df.pl:32 ../tools/virt-ls.pl:30
24 #: ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28
25 #: ../tools/virt-cat.pl:29 ../tools/virt-tar.pl:29 ../tools/virt-rescue.pl:29
26 #: ../tools/virt-make-fs.pl:33 ../tools/virt-list-partitions.pl:28
31 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
32 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
33 #: ../inspector/virt-inspector.pl:33 ../tools/virt-edit.pl:32
34 #: ../tools/virt-win-reg.pl:35 ../tools/virt-df.pl:34 ../tools/virt-ls.pl:32
35 #: ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30
36 #: ../tools/virt-cat.pl:31 ../tools/virt-tar.pl:31 ../tools/virt-rescue.pl:31
37 #: ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
42 #: ../src/guestfs.pod:5
43 msgid "guestfs - Library for accessing and modifying virtual machine images"
47 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
48 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
49 #: ../inspector/virt-inspector.pl:37 ../tools/virt-edit.pl:36
50 #: ../tools/virt-win-reg.pl:39 ../tools/virt-df.pl:38 ../tools/virt-ls.pl:36
51 #: ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34
52 #: ../tools/virt-cat.pl:35 ../tools/virt-tar.pl:35 ../tools/virt-rescue.pl:35
53 #: ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
58 #: ../src/guestfs.pod:9
61 " #include <guestfs.h>\n"
66 #: ../src/guestfs.pod:11
69 " guestfs_h *g = guestfs_create ();\n"
70 " guestfs_add_drive (g, \"guest.img\");\n"
71 " guestfs_launch (g);\n"
72 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
73 " guestfs_touch (g, \"/hello\");\n"
74 " guestfs_umount (g, \"/\");\n"
75 " guestfs_sync (g);\n"
76 " guestfs_close (g);\n"
81 #: ../src/guestfs.pod:20
84 " cc prog.c -o prog -lguestfs\n"
86 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
91 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:30
92 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
93 #: ../inspector/virt-inspector.pl:43 ../tools/virt-edit.pl:50
94 #: ../tools/virt-win-reg.pl:63 ../tools/virt-df.pl:46 ../tools/virt-ls.pl:42
95 #: ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40
96 #: ../tools/virt-cat.pl:41 ../tools/virt-tar.pl:72 ../tools/virt-rescue.pl:51
97 #: ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
102 #: ../src/guestfs.pod:26
104 "Libguestfs is a library for accessing and modifying guest disk images. "
105 "Amongst the things this is good for: making batch configuration changes to "
106 "guests, getting disk used/free statistics (see also: virt-df), migrating "
107 "between virtualization systems (see also: virt-p2v), performing partial "
108 "backups, performing partial guest clones, cloning guests and changing "
109 "registry/UUID/hostname info, and much else besides."
113 #: ../src/guestfs.pod:34
115 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
116 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
117 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
122 #: ../src/guestfs.pod:39
124 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
125 "what filesystem is in each LV, etc.). It can also run commands in the "
126 "context of the guest. Also you can access filesystems over FUSE."
130 #: ../src/guestfs.pod:44
132 "Libguestfs is a library that can be linked with C and C++ management "
133 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
134 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
139 #: ../src/guestfs.pod:49
141 "You don't need to be root to use libguestfs, although obviously you do need "
142 "enough permissions to access the disk images."
146 #: ../src/guestfs.pod:52
148 "Libguestfs is a large API because it can do many things. For a gentle "
149 "introduction, please read the L</API OVERVIEW> section next."
153 #: ../src/guestfs.pod:55
158 #: ../src/guestfs.pod:57
160 "This section provides a gentler overview of the libguestfs API. We also try "
161 "to group API calls together, where that may not be obvious from reading "
162 "about the individual calls in the main section of this manual."
166 #: ../src/guestfs.pod:62
171 #: ../src/guestfs.pod:64
173 "Before you can use libguestfs calls, you have to create a handle. Then you "
174 "must add at least one disk image to the handle, followed by launching the "
175 "handle, then performing whatever operations you want, and finally closing "
176 "the handle. By convention we use the single letter C<g> for the name of the "
177 "handle variable, although of course you can use any name you want."
181 #: ../src/guestfs.pod:71
182 msgid "The general structure of all libguestfs-using programs looks like this:"
186 #: ../src/guestfs.pod:74
189 " guestfs_h *g = guestfs_create ();\n"
194 #: ../src/guestfs.pod:76
197 " /* Call guestfs_add_drive additional times if there are\n"
198 " * multiple disk images.\n"
200 " guestfs_add_drive (g, \"guest.img\");\n"
205 #: ../src/guestfs.pod:81
208 " /* Most manipulation calls won't work until you've launched\n"
209 " * the handle 'g'. You have to do this _after_ adding drives\n"
210 " * and _before_ other commands.\n"
212 " guestfs_launch (g);\n"
217 #: ../src/guestfs.pod:87
220 " /* Now you can examine what partitions, LVs etc are available.\n"
222 " char **partitions = guestfs_list_partitions (g);\n"
223 " char **logvols = guestfs_lvs (g);\n"
228 #: ../src/guestfs.pod:92
231 " /* To access a filesystem in the image, you must mount it.\n"
233 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
238 #: ../src/guestfs.pod:96
241 " /* Now you can perform filesystem actions on the guest\n"
244 " guestfs_touch (g, \"/hello\");\n"
249 #: ../src/guestfs.pod:101
252 " /* You only need to call guestfs_sync if you have made\n"
253 " * changes to the guest image. (But if you've made changes\n"
254 " * then you *must* sync). See also: guestfs_umount and\n"
255 " * guestfs_umount_all calls.\n"
257 " guestfs_sync (g);\n"
262 #: ../src/guestfs.pod:108
265 " /* Close the handle 'g'. */\n"
266 " guestfs_close (g);\n"
271 #: ../src/guestfs.pod:111
273 "The code above doesn't include any error checking. In real code you should "
274 "check return values carefully for errors. In general all functions that "
275 "return integers return C<-1> on error, and all functions that return "
276 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
277 "how to handle errors, and consult the documentation for each function call "
278 "below to see precisely how they return error indications."
282 #: ../src/guestfs.pod:119
287 #: ../src/guestfs.pod:121
289 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
290 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
291 "actual block device, or simply an empty file of zeroes that you have created "
292 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
297 #: ../src/guestfs.pod:127
299 "The call you should use in modern code for adding drives is L</"
300 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
301 "specifying that the format is raw, do:"
305 #: ../src/guestfs.pod:131
308 " guestfs_add_drive_opts (g, filename,\n"
309 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
315 #: ../src/guestfs.pod:135
316 msgid "You can add a disk read-only using:"
320 #: ../src/guestfs.pod:137
323 " guestfs_add_drive_opts (g, filename,\n"
324 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
325 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
331 #: ../src/guestfs.pod:142
333 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
334 "libguestfs won't modify the file."
338 #: ../src/guestfs.pod:145
340 "Be extremely cautious if the disk image is in use, eg. if it is being used "
341 "by a virtual machine. Adding it read-write will almost certainly cause disk "
342 "corruption, but adding it read-only is safe."
346 #: ../src/guestfs.pod:149
348 "You must add at least one disk image, and you may add multiple disk images. "
349 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
350 "first one you added), C</dev/sdb> (for the second one you added), etc."
354 #: ../src/guestfs.pod:154
356 "Once L</guestfs_launch> has been called you cannot add any more images. You "
357 "can call L</guestfs_list_devices> to get a list of the device names, in the "
358 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
362 #: ../src/guestfs.pod:159
367 #: ../src/guestfs.pod:161
369 "Before you can read or write files, create directories and so on in a disk "
370 "image that contains filesystems, you have to mount those filesystems using "
371 "L</guestfs_mount>. If you already know that a disk image contains (for "
372 "example) one partition with a filesystem on that partition, then you can "
377 #: ../src/guestfs.pod:167
380 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
385 #: ../src/guestfs.pod:169
387 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
388 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
389 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
393 #: ../src/guestfs.pod:173
395 "If you are given a disk image and you don't know what it contains then you "
396 "have to find out. Libguestfs can do that too: use L</"
397 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
398 "LVs, and either try mounting each to see what is mountable, or else examine "
399 "them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also has a "
400 "set of APIs for inspection of disk images (see L</INSPECTION> below). But "
401 "you might find it easier to look at higher level programs built on top of "
402 "libguestfs, in particular L<virt-inspector(1)>."
406 #: ../src/guestfs.pod:183
408 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
409 "several other variations of the C<guestfs_mount_*> call."
413 #: ../src/guestfs.pod:186
414 msgid "FILESYSTEM ACCESS AND MODIFICATION"
418 #: ../src/guestfs.pod:188
420 "The majority of the libguestfs API consists of fairly low-level calls for "
421 "accessing and modifying the files, directories, symlinks etc on mounted "
422 "filesystems. There are over a hundred such calls which you can find listed "
423 "in detail below in this man page, and we don't even pretend to cover them "
424 "all in this overview."
428 #: ../src/guestfs.pod:194
430 "Specify filenames as full paths, starting with C<\"/\"> and including the "
435 #: ../src/guestfs.pod:197
437 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
438 "the file called C<\"etc/passwd\"> then you could do:"
442 #: ../src/guestfs.pod:200
445 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
450 #: ../src/guestfs.pod:202
452 "This would return C<data> as a newly allocated buffer containing the full "
453 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
454 "or C<NULL> if there was an error."
458 #: ../src/guestfs.pod:206
460 "As another example, to create a top-level directory on that filesystem "
461 "called C<\"var\"> you would do:"
465 #: ../src/guestfs.pod:209
468 " guestfs_mkdir (g, \"/var\");\n"
473 #: ../src/guestfs.pod:211
474 msgid "To create a symlink you could do:"
478 #: ../src/guestfs.pod:213
481 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
482 " \"/etc/rc3.d/S30portmap\");\n"
487 #: ../src/guestfs.pod:216
489 "Libguestfs will reject attempts to use relative paths and there is no "
490 "concept of a current working directory."
494 #: ../src/guestfs.pod:219
496 "Libguestfs can return errors in many situations: for example if the "
497 "filesystem isn't writable, or if a file or directory that you requested "
498 "doesn't exist. If you are using the C API (documented here) you have to "
499 "check for those error conditions after each call. (Other language bindings "
500 "turn these errors into exceptions)."
504 #: ../src/guestfs.pod:225
506 "File writes are affected by the per-handle umask, set by calling L</"
507 "guestfs_umask> and defaulting to 022. See L</UMASK>."
511 #: ../src/guestfs.pod:228
516 #: ../src/guestfs.pod:230
518 "Libguestfs contains API calls to read, create and modify partition tables on "
523 #: ../src/guestfs.pod:233
525 "In the common case where you want to create a single partition covering the "
526 "whole disk, you should use the L</guestfs_part_disk> call:"
530 #: ../src/guestfs.pod:237
533 " const char *parttype = \"mbr\";\n"
534 " if (disk_is_larger_than_2TB)\n"
535 " parttype = \"gpt\";\n"
536 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
541 #: ../src/guestfs.pod:242
543 "Obviously this effectively wipes anything that was on that disk image before."
547 #: ../src/guestfs.pod:245
552 #: ../src/guestfs.pod:247
554 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
555 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
556 "you familiarize yourself with the concepts of physical volumes, volume "
557 "groups and logical volumes."
561 #: ../src/guestfs.pod:252
563 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
564 "tldp.org/HOWTO/LVM-HOWTO/>."
568 #: ../src/guestfs.pod:255
573 #: ../src/guestfs.pod:257
575 "Use L</guestfs_cat> to download small, text only files. This call is "
576 "limited to files which are less than 2 MB and which cannot contain any ASCII "
577 "NUL (C<\\0>) characters. However it has a very simple to use API."
581 #: ../src/guestfs.pod:262
583 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
584 "bit data, since it returns a (pointer, size) pair. However it is still "
585 "limited to \"small\" files, less than 2 MB."
589 #: ../src/guestfs.pod:266
591 "L</guestfs_download> can be used to download any file, with no limits on "
592 "content or size (even files larger than 4 GB)."
596 #: ../src/guestfs.pod:269
598 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
602 #: ../src/guestfs.pod:272
607 #: ../src/guestfs.pod:274
609 "It's often the case that you want to write a file or files to the disk image."
613 #: ../src/guestfs.pod:277
615 "To write a small file with fixed content, use L</guestfs_write>. To create "
616 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
617 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
618 "of other functions for creating test files, for example L</guestfs_fill> and "
619 "L</guestfs_fill_pattern>."
623 #: ../src/guestfs.pod:283
625 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
626 "file content or size (even files larger than 4 GB)."
630 #: ../src/guestfs.pod:286
632 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
636 #: ../src/guestfs.pod:288
638 "However the fastest way to upload I<large numbers of arbitrary files> is to "
639 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
640 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
641 "in a predictable way (eg. adding it last after all other drives) then you "
642 "can get the device name from L</guestfs_list_devices> and mount it directly "
643 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
644 "portable between kernel versions, and they don't support labels or UUIDs. "
645 "If you want to pre-build an image or you need to mount it using a label or "
646 "UUID, use an ISO image instead."
650 #: ../src/guestfs.pod:299
655 #: ../src/guestfs.pod:301
657 "There are various different commands for copying between files and devices "
658 "and in and out of the guest filesystem. These are summarised in the table "
663 #: ../src/guestfs.pod:307
664 msgid "B<file> to B<file>"
668 #: ../src/guestfs.pod:309
670 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
671 "directories recursively."
675 #: ../src/guestfs.pod:312
676 msgid "B<file or device> to B<file or device>"
680 #: ../src/guestfs.pod:314
682 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
683 "devices in the guest."
687 #: ../src/guestfs.pod:317
688 msgid "Example: duplicate the contents of an LV:"
692 #: ../src/guestfs.pod:319
695 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
700 #: ../src/guestfs.pod:321
702 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
703 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
704 "guestfs_copy_size>."
708 #: ../src/guestfs.pod:325
709 msgid "B<file on the host> to B<file or device>"
713 #: ../src/guestfs.pod:327
714 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
718 #: ../src/guestfs.pod:329
719 msgid "B<file or device> to B<file on the host>"
723 #: ../src/guestfs.pod:331
724 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
728 #: ../src/guestfs.pod:335
729 msgid "LISTING FILES"
733 #: ../src/guestfs.pod:337
735 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
736 "L<guestfish(1)>-equivalent command C<ll>)."
740 #: ../src/guestfs.pod:340
742 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
743 "programs, as a flat list of strings."
747 #: ../src/guestfs.pod:343
749 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
750 "directory, plus additional information about each one. It is more "
751 "equivalent to using the L<readdir(3)> call on a local filesystem."
755 #: ../src/guestfs.pod:347
757 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
761 #: ../src/guestfs.pod:350
762 msgid "RUNNING COMMANDS"
766 #: ../src/guestfs.pod:352
768 "Although libguestfs is primarily an API for manipulating files inside guest "
769 "images, we also provide some limited facilities for running commands inside "
774 #: ../src/guestfs.pod:356
775 msgid "There are many limitations to this:"
779 #: ../src/guestfs.pod:360 ../src/guestfs.pod:365 ../src/guestfs.pod:370
780 #: ../src/guestfs.pod:374 ../src/guestfs.pod:379 ../src/guestfs.pod:383
781 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:1159
782 #: ../src/guestfs.pod:1164 ../src/guestfs.pod:1168 ../src/guestfs.pod:1384
783 #: ../src/guestfs.pod:1389 ../src/guestfs.pod:1393 ../src/guestfs.pod:1495
784 #: ../src/guestfs.pod:1499 ../src/guestfs.pod:1503 ../src/guestfs.pod:1508
785 #: ../src/guestfs.pod:1516 ../src/guestfs.pod:1535 ../src/guestfs.pod:1543
786 #: ../src/guestfs.pod:1773 ../src/guestfs.pod:1779 ../src/guestfs.pod:1784
787 #: ../src/guestfs.pod:1790 ../src/guestfs.pod:1897 ../src/guestfs.pod:1901
788 #: ../src/guestfs.pod:1905 ../src/guestfs.pod:1909
789 #: ../src/guestfs-actions.pod:14 ../src/guestfs-actions.pod:21
790 #: ../src/guestfs-actions.pod:438 ../src/guestfs-actions.pod:446
791 #: ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:460
792 #: ../src/guestfs-actions.pod:1351 ../src/guestfs-actions.pod:1355
793 #: ../src/guestfs-actions.pod:1359 ../src/guestfs-actions.pod:1363
794 #: ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1375
795 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1389
796 #: ../src/guestfs-actions.pod:1393 ../src/guestfs-actions.pod:1397
797 #: ../src/guestfs-actions.pod:1520 ../src/guestfs-actions.pod:1524
798 #: ../src/guestfs-actions.pod:1529 ../src/guestfs-actions.pod:1534
799 #: ../src/guestfs-actions.pod:1586 ../src/guestfs-actions.pod:1590
800 #: ../src/guestfs-actions.pod:1595 ../fish/guestfish.pod:364
801 #: ../fish/guestfish.pod:368 ../fish/guestfish.pod:372
802 #: ../fish/guestfish.pod:376 ../fish/guestfish-actions.pod:13
803 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:339
804 #: ../fish/guestfish-actions.pod:347 ../fish/guestfish-actions.pod:354
805 #: ../fish/guestfish-actions.pod:361 ../fish/guestfish-actions.pod:1056
806 #: ../fish/guestfish-actions.pod:1060 ../fish/guestfish-actions.pod:1064
807 #: ../fish/guestfish-actions.pod:1068 ../fish/guestfish-actions.pod:1076
808 #: ../fish/guestfish-actions.pod:1080 ../fish/guestfish-actions.pod:1084
809 #: ../fish/guestfish-actions.pod:1094 ../fish/guestfish-actions.pod:1098
810 #: ../fish/guestfish-actions.pod:1102 ../fish/guestfish-actions.pod:1192
811 #: ../fish/guestfish-actions.pod:1196 ../fish/guestfish-actions.pod:1201
812 #: ../fish/guestfish-actions.pod:1206 ../fish/guestfish-actions.pod:1248
813 #: ../fish/guestfish-actions.pod:1252 ../fish/guestfish-actions.pod:1257
814 #: ../inspector/virt-inspector.pl:584 ../inspector/virt-inspector.pl:588
815 #: ../tools/virt-df.pl:161 ../tools/virt-df.pl:167 ../tools/virt-resize.pl:348
816 #: ../tools/virt-resize.pl:353 ../tools/virt-resize.pl:363
821 #: ../src/guestfs.pod:362
823 "The kernel version that the command runs under will be different from what "
828 #: ../src/guestfs.pod:367
830 "If the command needs to communicate with daemons, then most likely they "
835 #: ../src/guestfs.pod:372
836 msgid "The command will be running in limited memory."
840 #: ../src/guestfs.pod:376
842 "The network may not be available unless you enable it (see L</"
843 "guestfs_set_network>)."
847 #: ../src/guestfs.pod:381
848 msgid "Only supports Linux guests (not Windows, BSD, etc)."
852 #: ../src/guestfs.pod:385
854 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
858 #: ../src/guestfs.pod:390
860 "For SELinux guests, you may need to enable SELinux and load policy first. "
861 "See L</SELINUX> in this manpage."
865 #: ../src/guestfs.pod:395
867 "I<Security:> It is not safe to run commands from untrusted, possibly "
868 "malicious guests. These commands may attempt to exploit your program by "
869 "sending unexpected output. They could also try to exploit the Linux kernel "
870 "or qemu provided by the libguestfs appliance. They could use the network "
871 "provided by the libguestfs appliance to bypass ordinary network partitions "
872 "and firewalls. They could use the elevated privileges or different SELinux "
873 "context of your program to their advantage."
877 #: ../src/guestfs.pod:404
879 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
880 "(a script which runs when the guest next boots normally), and to have this "
881 "script run the commands you want in the normal context of the running guest, "
882 "network security and so on."
886 #: ../src/guestfs.pod:411
888 "The two main API calls to run commands are L</guestfs_command> and L</"
889 "guestfs_sh> (there are also variations)."
893 #: ../src/guestfs.pod:414
895 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
896 "shell globs, redirections, etc will work."
900 #: ../src/guestfs.pod:417
901 msgid "CONFIGURATION FILES"
905 #: ../src/guestfs.pod:419
907 "To read and write configuration files in Linux guest filesystems, we "
908 "strongly recommend using Augeas. For example, Augeas understands how to "
909 "read and write, say, a Linux shadow password file or X.org configuration "
910 "file, and so avoids you having to write that code."
914 #: ../src/guestfs.pod:424
916 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
917 "document Augeas itself here because there is excellent documentation on the "
918 "L<http://augeas.net/> website."
922 #: ../src/guestfs.pod:428
924 "If you don't want to use Augeas (you fool!) then try calling L</"
925 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
930 #: ../src/guestfs.pod:432
935 #: ../src/guestfs.pod:434
937 "We support SELinux guests. To ensure that labeling happens correctly in "
938 "SELinux guests, you need to enable SELinux and load the guest's policy:"
942 #: ../src/guestfs.pod:440
947 #: ../src/guestfs.pod:442
948 msgid "Before launching, do:"
952 #: ../src/guestfs.pod:444
955 " guestfs_set_selinux (g, 1);\n"
960 #: ../src/guestfs.pod:446
965 #: ../src/guestfs.pod:448
967 "After mounting the guest's filesystem(s), load the policy. This is best "
968 "done by running the L<load_policy(8)> command in the guest itself:"
972 #: ../src/guestfs.pod:452
975 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
980 #: ../src/guestfs.pod:454
982 "(Older versions of C<load_policy> require you to specify the name of the "
987 #: ../src/guestfs.pod:457
992 #: ../src/guestfs.pod:459
994 "Optionally, set the security context for the API. The correct security "
995 "context to use can only be known by inspecting the guest. As an example:"
999 #: ../src/guestfs.pod:463
1002 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1007 #: ../src/guestfs.pod:467
1008 msgid "This will work for running commands and editing existing files."
1012 #: ../src/guestfs.pod:469
1014 "When new files are created, you may need to label them explicitly, for "
1015 "example by running the external command C<restorecon pathname>."
1019 #: ../src/guestfs.pod:473
1024 #: ../src/guestfs.pod:475
1026 "Certain calls are affected by the current file mode creation mask (the "
1027 "\"umask\"). In particular ones which create files or directories, such as "
1028 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1029 "either the default mode that the file is created with or modifies the mode "
1034 #: ../src/guestfs.pod:481
1036 "The default umask is C<022>, so files are created with modes such as C<0644> "
1037 "and directories with C<0755>."
1041 #: ../src/guestfs.pod:484
1043 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1044 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1045 "guestfs_chmod> after creating each file or directory."
1049 #: ../src/guestfs.pod:488
1050 msgid "For more information about umask, see L<umask(2)>."
1054 #: ../src/guestfs.pod:490 ../fish/guestfish.pod:630
1055 msgid "ENCRYPTED DISKS"
1059 #: ../src/guestfs.pod:492
1061 "Libguestfs allows you to access Linux guests which have been encrypted using "
1062 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1063 "standard. This includes nearly all whole disk encryption systems used by "
1064 "modern Linux guests."
1068 #: ../src/guestfs.pod:498
1070 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1071 "returns the string C<crypto_LUKS>)."
1075 #: ../src/guestfs.pod:501
1077 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1078 "will require the passphrase!"
1082 #: ../src/guestfs.pod:504
1084 "Opening a LUKS device creates a new device mapper device called C</dev/"
1085 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1086 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1087 "from and encrypted to the underlying block device respectively."
1091 #: ../src/guestfs.pod:510
1093 "LVM volume groups on the device can be made visible by calling L</"
1094 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1095 "(s) can now be mounted in the usual way."
1099 #: ../src/guestfs.pod:514
1101 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1102 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1103 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1104 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1105 "underlying encrypted block device)."
1109 #: ../src/guestfs.pod:521
1114 #: ../src/guestfs.pod:523
1116 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1117 "contains operating systems. (These APIs used to be in a separate Perl-only "
1118 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1119 "frequently used part of this library has been rewritten in C and moved into "
1124 #: ../src/guestfs.pod:529
1126 "Add all disks belonging to the unknown virtual machine and call L</"
1127 "guestfs_launch> in the usual way."
1131 #: ../src/guestfs.pod:532
1133 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1134 "and certain heuristics, and returns a list of operating systems that were "
1135 "found. An empty list means none were found. A single element is the root "
1136 "filesystem of the operating system. For dual- or multi-boot guests, "
1137 "multiple roots can be returned, each one corresponding to a separate "
1138 "operating system. (Multi-boot virtual machines are extremely rare in the "
1139 "world of virtualization, but since this scenario can happen, we have built "
1140 "libguestfs to deal with it.)"
1144 #: ../src/guestfs.pod:541
1146 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1147 "to get additional details about that operating system. For example, call L</"
1148 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1149 "Windows and Linux-based operating systems respectively."
1153 #: ../src/guestfs.pod:547
1155 "Un*x-like and Linux-based operating systems usually consist of several "
1156 "filesystems which are mounted at boot time (for example, a separate boot "
1157 "partition mounted on C</boot>). The inspection rules are able to detect how "
1158 "filesystems correspond to mount points. Call "
1159 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1160 "hash table like this example:"
1164 #: ../src/guestfs.pod:554
1167 " /boot => /dev/sda1\n"
1168 " / => /dev/vg_guest/lv_root\n"
1169 " /usr => /dev/vg_guest/lv_usr\n"
1174 #: ../src/guestfs.pod:558
1176 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1177 "filesystems as suggested."
1181 #: ../src/guestfs.pod:561
1183 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1184 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1188 #: ../src/guestfs.pod:565
1190 "Inspection currently only works for some common operating systems. "
1191 "Contributors are welcome to send patches for other operating systems that we "
1192 "currently cannot detect."
1196 #: ../src/guestfs.pod:569
1198 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1199 "for more details. The L</guestfs_inspect_os> function just ignores any "
1200 "encrypted devices."
1204 #: ../src/guestfs.pod:573
1206 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1207 "inspection and caches the results in the guest handle. Subsequent calls to "
1208 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1209 "read the disks. If you change the content of the guest disks, you can redo "
1210 "inspection by calling L</guestfs_inspect_os> again."
1214 #: ../src/guestfs.pod:580
1215 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1219 #: ../src/guestfs.pod:582
1221 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1222 "ntfs-3g.org/> driver."
1226 #: ../src/guestfs.pod:585
1228 "DOS and Windows still use drive letters, and the filesystems are always "
1229 "treated as case insensitive by Windows itself, and therefore you might find "
1230 "a Windows configuration file referring to a path like C<c:\\windows"
1231 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1232 "might be referred to as C</WINDOWS/System32>."
1236 #: ../src/guestfs.pod:591
1238 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1239 "libguestfs to read the appropriate Windows Registry and configuration files, "
1240 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1245 #: ../src/guestfs.pod:596
1247 "Replacing backslash characters with forward slash characters is also outside "
1248 "the scope of libguestfs, but something that you can easily do."
1252 #: ../src/guestfs.pod:599
1254 "Where we can help is in resolving the case insensitivity of paths. For "
1255 "this, call L</guestfs_case_sensitive_path>."
1259 #: ../src/guestfs.pod:602
1261 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1262 "files, through the library C<hivex> which is part of the libguestfs project "
1263 "although ships as a separate tarball. You have to locate and download the "
1264 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1265 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1266 "reg(1)> for more help on this issue."
1270 #: ../src/guestfs.pod:610
1271 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1275 #: ../src/guestfs.pod:612
1277 "Although we don't want to discourage you from using the C API, we will "
1278 "mention here that the same API is also available in other languages."
1282 #: ../src/guestfs.pod:615
1284 "The API is broadly identical in all supported languages. This means that "
1285 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1286 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1287 "words, a straightforward, predictable isomorphism between each language."
1291 #: ../src/guestfs.pod:621
1293 "Error messages are automatically transformed into exceptions if the language "
1298 #: ../src/guestfs.pod:624
1300 "We don't try to \"object orientify\" parts of the API in OO languages, "
1301 "although contributors are welcome to write higher level APIs above what we "
1302 "provide in their favourite languages if they wish."
1306 #: ../src/guestfs.pod:630
1311 #: ../src/guestfs.pod:632
1313 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1314 "identical to the C API. C++ classes and exceptions are not used."
1318 #: ../src/guestfs.pod:636
1323 #: ../src/guestfs.pod:638
1325 "The C# bindings are highly experimental. Please read the warnings at the "
1326 "top of C<csharp/Libguestfs.cs>."
1330 #: ../src/guestfs.pod:641
1335 #: ../src/guestfs.pod:643
1337 "This is the only language binding that is working but incomplete. Only "
1338 "calls which return simple integers have been bound in Haskell, and we are "
1339 "looking for help to complete this binding."
1343 #: ../src/guestfs.pod:647
1348 #: ../src/guestfs.pod:649
1350 "Full documentation is contained in the Javadoc which is distributed with "
1355 #: ../src/guestfs.pod:652
1360 #: ../src/guestfs.pod:654
1361 msgid "For documentation see the file C<guestfs.mli>."
1365 #: ../src/guestfs.pod:656
1370 #: ../src/guestfs.pod:658
1371 msgid "For documentation see L<Sys::Guestfs(3)>."
1375 #: ../src/guestfs.pod:660
1380 #: ../src/guestfs.pod:662
1382 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1383 "the php-libguestfs package for your distribution."
1387 #: ../src/guestfs.pod:665
1388 msgid "The PHP binding only works correctly on 64 bit machines."
1392 #: ../src/guestfs.pod:667
1397 #: ../src/guestfs.pod:669
1398 msgid "For documentation do:"
1402 #: ../src/guestfs.pod:671
1406 " >>> import guestfs\n"
1407 " >>> help (guestfs)\n"
1412 #: ../src/guestfs.pod:675
1417 #: ../src/guestfs.pod:677
1419 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1420 "can find examples written in Ruby in the libguestfs source."
1424 #: ../src/guestfs.pod:680
1425 msgid "B<shell scripts>"
1429 #: ../src/guestfs.pod:682
1430 msgid "For documentation see L<guestfish(1)>."
1434 #: ../src/guestfs.pod:686
1435 msgid "LIBGUESTFS GOTCHAS"
1439 #: ../src/guestfs.pod:688
1441 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1442 "system [...] that works in the way it is documented but is counterintuitive "
1443 "and almost invites mistakes.\""
1447 #: ../src/guestfs.pod:692
1449 "Since we developed libguestfs and the associated tools, there are several "
1450 "things we would have designed differently, but are now stuck with for "
1451 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1452 "release, you can expect these to change. Beware of them."
1456 #: ../src/guestfs.pod:700
1457 msgid "Autosync / forgetting to sync."
1461 #: ../src/guestfs.pod:702
1463 "When modifying a filesystem from C or another language, you B<must> unmount "
1464 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1465 "libguestfs handle. You can also call:"
1469 #: ../src/guestfs.pod:706
1472 " guestfs_set_autosync (g, 1);\n"
1477 #: ../src/guestfs.pod:708
1479 "to have the unmount/sync done automatically for you when the handle 'g' is "
1480 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1484 #: ../src/guestfs.pod:712
1486 "If you forget to do this, then it is entirely possible that your changes "
1487 "won't be written out, or will be partially written, or (very rarely) that "
1488 "you'll get disk corruption."
1492 #: ../src/guestfs.pod:716
1494 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1495 "guestfish scripts that forget to sync will work just fine, which can make "
1496 "this very puzzling if you are trying to debug a problem."
1500 #: ../src/guestfs.pod:720
1502 "Update: Autosync is enabled by default for all API users starting from "
1503 "libguestfs 1.5.24."
1507 #: ../src/guestfs.pod:723
1508 msgid "Mount option C<-o sync> should not be the default."
1512 #: ../src/guestfs.pod:725
1514 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1515 "However C<-o sync> does not add any reliability benefit, but does have a "
1516 "very large performance impact."
1520 #: ../src/guestfs.pod:729
1522 "The work around is to use L</guestfs_mount_options> and set the mount "
1523 "options that you actually want to use."
1527 #: ../src/guestfs.pod:732
1528 msgid "Read-only should be the default."
1532 #: ../src/guestfs.pod:734
1534 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1535 "specify I<--rw> if you want to make changes to the image."
1539 #: ../src/guestfs.pod:737
1540 msgid "This would reduce the potential to corrupt live VM images."
1544 #: ../src/guestfs.pod:739
1546 "Note that many filesystems change the disk when you just mount and unmount, "
1547 "even if you didn't perform any writes. You need to use L</"
1548 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1552 #: ../src/guestfs.pod:743
1553 msgid "guestfish command line is hard to use."
1557 #: ../src/guestfs.pod:745
1559 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1560 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1561 "exist, so it fails. In earlier versions of guestfish the error message was "
1562 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1563 "we should have used C<guestfish -c command> to run commands."
1567 #: ../src/guestfs.pod:752
1568 msgid "guestfish megabyte modifiers don't work right on all commands"
1572 #: ../src/guestfs.pod:754
1574 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1575 "other modifiers). What guestfish actually does is to multiply the number "
1576 "part by the modifier part and pass the result to the C API. However this "
1577 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1578 "expecting some other unit (eg. megabytes)."
1582 #: ../src/guestfs.pod:761
1583 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1587 #: ../src/guestfs.pod:763
1590 " lvcreate LV VG 100M\n"
1595 #: ../src/guestfs.pod:765
1597 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1598 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1599 "megabytes * megabytes) logical volume. The error message you get from this "
1600 "is also a little obscure."
1604 #: ../src/guestfs.pod:770
1606 "This could be fixed in the generator by specially marking parameters and "
1607 "return values which take bytes or other units."
1611 #: ../src/guestfs.pod:773
1612 msgid "Library should return errno with error messages."
1616 #: ../src/guestfs.pod:775
1618 "It would be a nice-to-have to be able to get the original value of 'errno' "
1619 "from inside the appliance along error paths (where set). Currently "
1620 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1621 "string into an errno, see the function error() in fuse/guestmount.c."
1625 #: ../src/guestfs.pod:781
1627 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1628 "sent back from the daemon."
1632 #: ../src/guestfs.pod:784
1633 msgid "Ambiguity between devices and paths"
1637 #: ../src/guestfs.pod:786
1639 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1640 "sdb2>) and a similar pathname. A file might just happen to be called "
1641 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1645 #: ../src/guestfs.pod:791
1647 "In the current API we usually resolve this ambiguity by having two separate "
1648 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1649 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1650 "detecting if the path supplied begins with C</dev/>."
1654 #: ../src/guestfs.pod:797
1656 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1657 "make paths/devices into structured names. One way to do this would be to "
1658 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1659 "aspect of grub. Another way would be to use a structured type, equivalent "
1660 "to this OCaml type:"
1664 #: ../src/guestfs.pod:803
1667 " type path = Path of string | Device of int | Partition of int * int\n"
1672 #: ../src/guestfs.pod:805
1673 msgid "which would allow you to pass arguments like:"
1677 #: ../src/guestfs.pod:807
1680 " Path \"/foo/bar\"\n"
1681 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1682 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1683 " Path \"/dev/sdb2\" (* not a device *)\n"
1688 #: ../src/guestfs.pod:812
1690 "As you can see there are still problems to resolve even with this "
1691 "representation. Also consider how it might work in guestfish."
1695 #: ../src/guestfs.pod:817
1696 msgid "PROTOCOL LIMITS"
1700 #: ../src/guestfs.pod:819
1702 "Internally libguestfs uses a message-based protocol to pass API calls and "
1703 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1704 "plenty more detail about this). The maximum message size used by the "
1705 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1706 "aware of this limit. The API calls which may be affected are individually "
1707 "documented, with a link back to this section of the documentation."
1711 #: ../src/guestfs.pod:827
1713 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1714 "a simple string. Because this string is at some point internally encoded as "
1715 "a message, the maximum size that it can return is slightly under 4 MB. If "
1716 "the requested file is larger than this then you will get an error."
1720 #: ../src/guestfs.pod:833
1722 "In order to transfer large files into and out of the guest filesystem, you "
1723 "need to use particular calls that support this. The sections L</UPLOADING> "
1724 "and L</DOWNLOADING> document how to do this."
1728 #: ../src/guestfs.pod:837
1730 "You might also consider mounting the disk image using our FUSE filesystem "
1731 "support (L<guestmount(1)>)."
1735 #: ../src/guestfs.pod:840
1736 msgid "KEYS AND PASSPHRASES"
1740 #: ../src/guestfs.pod:842
1742 "Certain libguestfs calls take a parameter that contains sensitive key "
1743 "material, passed in as a C string."
1747 #: ../src/guestfs.pod:845
1749 "In the future we would hope to change the libguestfs implementation so that "
1750 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1751 "swap. However this is I<not> done at the moment, because of the complexity "
1752 "of such an implementation."
1756 #: ../src/guestfs.pod:850
1758 "Therefore you should be aware that any key parameter you pass to libguestfs "
1759 "might end up being written out to the swap partition. If this is a concern, "
1760 "scrub the swap partition or don't use libguestfs on encrypted devices."
1764 #: ../src/guestfs.pod:855
1765 msgid "CONNECTION MANAGEMENT"
1769 #: ../src/guestfs.pod:857
1774 #: ../src/guestfs.pod:859
1776 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1777 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1778 "handle and release all resources used."
1782 #: ../src/guestfs.pod:863
1784 "For information on using multiple handles and threads, see the section L</"
1785 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1789 #: ../src/guestfs.pod:866
1790 msgid "guestfs_create"
1794 #: ../src/guestfs.pod:868
1797 " guestfs_h *guestfs_create (void);\n"
1802 #: ../src/guestfs.pod:870
1803 msgid "Create a connection handle."
1807 #: ../src/guestfs.pod:872
1809 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
1810 "on the handle at least once."
1814 #: ../src/guestfs.pod:875
1816 "This function returns a non-NULL pointer to a handle on success or NULL on "
1821 #: ../src/guestfs.pod:878
1822 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1826 #: ../src/guestfs.pod:880
1828 "You may also want to configure error handling for the handle. See L</ERROR "
1829 "HANDLING> section below."
1833 #: ../src/guestfs.pod:883
1834 msgid "guestfs_close"
1838 #: ../src/guestfs.pod:885
1841 " void guestfs_close (guestfs_h *g);\n"
1846 #: ../src/guestfs.pod:887
1847 msgid "This closes the connection handle and frees up all resources used."
1851 #: ../src/guestfs.pod:889
1852 msgid "ERROR HANDLING"
1856 #: ../src/guestfs.pod:891
1858 "The convention in all functions that return C<int> is that they return C<-1> "
1859 "to indicate an error. You can get additional information on errors by "
1860 "calling L</guestfs_last_error> and/or by setting up an error handler with L</"
1861 "guestfs_set_error_handler>."
1865 #: ../src/guestfs.pod:896
1866 msgid "The default error handler prints the information string to C<stderr>."
1870 #: ../src/guestfs.pod:898
1872 "Out of memory errors are handled differently. The default action is to call "
1873 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
1874 "guestfs_set_out_of_memory_handler>."
1878 #: ../src/guestfs.pod:902
1879 msgid "guestfs_last_error"
1883 #: ../src/guestfs.pod:904
1886 " const char *guestfs_last_error (guestfs_h *g);\n"
1891 #: ../src/guestfs.pod:906
1893 "This returns the last error message that happened on C<g>. If there has not "
1894 "been an error since the handle was created, then this returns C<NULL>."
1898 #: ../src/guestfs.pod:910
1900 "The lifetime of the returned string is until the next error occurs, or L</"
1901 "guestfs_close> is called."
1905 #: ../src/guestfs.pod:913
1907 "The error string is not localized (ie. is always in English), because this "
1908 "makes searching for error messages in search engines give the largest number "
1913 #: ../src/guestfs.pod:917
1914 msgid "guestfs_set_error_handler"
1918 #: ../src/guestfs.pod:919
1921 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1923 " const char *msg);\n"
1924 " void guestfs_set_error_handler (guestfs_h *g,\n"
1925 " guestfs_error_handler_cb cb,\n"
1931 #: ../src/guestfs.pod:926
1933 "The callback C<cb> will be called if there is an error. The parameters "
1934 "passed to the callback are an opaque data pointer and the error message "
1939 #: ../src/guestfs.pod:930
1941 "Note that the message string C<msg> is freed as soon as the callback "
1942 "function returns, so if you want to stash it somewhere you must make your "
1947 #: ../src/guestfs.pod:934
1948 msgid "The default handler prints messages on C<stderr>."
1952 #: ../src/guestfs.pod:936
1953 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1957 #: ../src/guestfs.pod:938
1958 msgid "guestfs_get_error_handler"
1962 #: ../src/guestfs.pod:940
1965 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1966 " void **opaque_rtn);\n"
1971 #: ../src/guestfs.pod:943
1972 msgid "Returns the current error handler callback."
1976 #: ../src/guestfs.pod:945
1977 msgid "guestfs_set_out_of_memory_handler"
1981 #: ../src/guestfs.pod:947
1984 " typedef void (*guestfs_abort_cb) (void);\n"
1985 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1986 " guestfs_abort_cb);\n"
1991 #: ../src/guestfs.pod:951
1993 "The callback C<cb> will be called if there is an out of memory situation. "
1994 "I<Note this callback must not return>."
1998 #: ../src/guestfs.pod:954
1999 msgid "The default is to call L<abort(3)>."
2003 #: ../src/guestfs.pod:956
2005 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2009 #: ../src/guestfs.pod:959
2010 msgid "guestfs_get_out_of_memory_handler"
2014 #: ../src/guestfs.pod:961
2017 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2022 #: ../src/guestfs.pod:963
2023 msgid "This returns the current out of memory handler."
2027 #: ../src/guestfs.pod:965
2032 #: ../src/guestfs.pod:967
2034 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
2039 #: ../src/guestfs.pod:970
2041 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
2042 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
2046 #: ../src/guestfs.pod:973
2048 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
2049 "to change the directories that libguestfs will search in. The value is a "
2050 "colon-separated list of paths. The current directory is I<not> searched "
2051 "unless the path contains an empty element or C<.>. For example "
2052 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
2053 "then C</usr/lib/guestfs>."
2057 #: ../src/guestfs.pod:980
2058 msgid "HIGH-LEVEL API ACTIONS"
2062 #: ../src/guestfs.pod:982
2063 msgid "ABI GUARANTEE"
2067 #: ../src/guestfs.pod:984
2069 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2070 "actions as outlined in this section. Although we will deprecate some "
2071 "actions, for example if they get replaced by newer calls, we will keep the "
2072 "old actions forever. This allows you the developer to program in confidence "
2073 "against the libguestfs API."
2077 #: ../src/guestfs.pod:990 ../fish/guestfish.pod:860
2082 #: ../src/guestfs.pod:992
2087 #: ../src/guestfs.pod:994
2092 #: ../src/guestfs.pod:996
2093 msgid "AVAILABILITY"
2097 #: ../src/guestfs.pod:998
2098 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2102 #: ../src/guestfs.pod:1000
2104 "Using L</guestfs_available> you can test availability of the following "
2105 "groups of functions. This test queries the appliance to see if the "
2106 "appliance you are currently using supports the functionality."
2110 #: ../src/guestfs.pod:1005
2111 msgid "@AVAILABILITY@"
2115 #: ../src/guestfs.pod:1007
2116 msgid "GUESTFISH supported COMMAND"
2120 #: ../src/guestfs.pod:1009
2122 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2123 "prints out the available groups and whether they are supported by this build "
2124 "of libguestfs. Note however that you have to do C<run> first."
2128 #: ../src/guestfs.pod:1014
2129 msgid "SINGLE CALLS AT COMPILE TIME"
2133 #: ../src/guestfs.pod:1016
2135 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2136 "function, such as:"
2140 #: ../src/guestfs.pod:1019
2143 " #define LIBGUESTFS_HAVE_DD 1\n"
2148 #: ../src/guestfs.pod:1021
2149 msgid "if L</guestfs_dd> is available."
2153 #: ../src/guestfs.pod:1023
2155 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2156 "function is available at compile time, we recommended using build tools such "
2157 "as autoconf or cmake. For example in autotools you could use:"
2161 #: ../src/guestfs.pod:1028
2164 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2165 " AC_CHECK_FUNCS([guestfs_dd])\n"
2170 #: ../src/guestfs.pod:1031
2172 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2177 #: ../src/guestfs.pod:1034
2178 msgid "SINGLE CALLS AT RUN TIME"
2182 #: ../src/guestfs.pod:1036
2184 "Testing at compile time doesn't guarantee that a function really exists in "
2185 "the library. The reason is that you might be dynamically linked against a "
2186 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2187 "This situation unfortunately results in a segmentation fault, which is a "
2188 "shortcoming of the C dynamic linking system itself."
2192 #: ../src/guestfs.pod:1043
2194 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2195 "in this example program (note that you still need the compile time check as "
2200 #: ../src/guestfs.pod:1047
2203 " #include <stdio.h>\n"
2204 " #include <stdlib.h>\n"
2205 " #include <unistd.h>\n"
2206 " #include <dlfcn.h>\n"
2207 " #include <guestfs.h>\n"
2212 #: ../src/guestfs.pod:1053
2217 " #ifdef LIBGUESTFS_HAVE_DD\n"
2219 " int has_function;\n"
2224 #: ../src/guestfs.pod:1059
2227 " /* Test if the function guestfs_dd is really available. */\n"
2228 " dl = dlopen (NULL, RTLD_LAZY);\n"
2230 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2231 " exit (EXIT_FAILURE);\n"
2233 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2239 #: ../src/guestfs.pod:1068
2242 " if (!has_function)\n"
2243 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2245 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2246 " /* Now it's safe to call\n"
2247 " guestfs_dd (g, \"foo\", \"bar\");\n"
2251 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2258 #: ../src/guestfs.pod:1081
2260 "You may think the above is an awful lot of hassle, and it is. There are "
2261 "other ways outside of the C linking system to ensure that this kind of "
2262 "incompatibility never arises, such as using package versioning:"
2266 #: ../src/guestfs.pod:1086
2269 " Requires: libguestfs >= 1.0.80\n"
2274 #: ../src/guestfs.pod:1088
2275 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2279 #: ../src/guestfs.pod:1090
2281 "A recent feature of the API is the introduction of calls which take optional "
2282 "arguments. In C these are declared 3 ways. The main way is as a call which "
2283 "takes variable arguments (ie. C<...>), as in this example:"
2287 #: ../src/guestfs.pod:1095
2290 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2295 #: ../src/guestfs.pod:1097
2297 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2298 "call with no optional arguments specified:"
2302 #: ../src/guestfs.pod:1100
2305 " guestfs_add_drive_opts (g, filename, -1);\n"
2310 #: ../src/guestfs.pod:1102
2311 msgid "With a single optional argument:"
2315 #: ../src/guestfs.pod:1104
2318 " guestfs_add_drive_opts (g, filename,\n"
2319 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2325 #: ../src/guestfs.pod:1108
2330 #: ../src/guestfs.pod:1110
2333 " guestfs_add_drive_opts (g, filename,\n"
2334 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2335 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2341 #: ../src/guestfs.pod:1115
2343 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2348 #: ../src/guestfs.pod:1118
2349 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2353 #: ../src/guestfs.pod:1120
2355 "The second variant has the same name with the suffix C<_va>, which works the "
2356 "same way but takes a C<va_list>. See the C manual for details. For the "
2357 "example function, this is declared:"
2361 #: ../src/guestfs.pod:1124
2364 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2370 #: ../src/guestfs.pod:1127
2371 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2375 #: ../src/guestfs.pod:1129
2377 "The third variant is useful where you need to construct these calls. You "
2378 "pass in a structure where you fill in the optional fields. The structure "
2379 "has a bitmask as the first element which you must set to indicate which "
2380 "fields you have filled in. For our example function the structure and call "
2385 #: ../src/guestfs.pod:1135
2388 " struct guestfs_add_drive_opts_argv {\n"
2389 " uint64_t bitmask;\n"
2391 " const char *format;\n"
2394 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
2395 " const struct guestfs_add_drive_opts_argv *optargs);\n"
2400 #: ../src/guestfs.pod:1144
2401 msgid "You could call it like this:"
2405 #: ../src/guestfs.pod:1146
2408 " struct guestfs_add_drive_opts_argv optargs = {\n"
2409 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
2410 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
2412 " .format = \"qcow2\"\n"
2418 #: ../src/guestfs.pod:1153
2421 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
2426 #: ../src/guestfs.pod:1155 ../src/guestfs-actions.pod:10
2427 #: ../src/guestfs-actions.pod:1582 ../fish/guestfish-actions.pod:9
2428 #: ../fish/guestfish-actions.pod:1244
2433 #: ../src/guestfs.pod:1161
2434 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
2438 #: ../src/guestfs.pod:1166
2439 msgid "You do not need to fill in all fields of the structure."
2443 #: ../src/guestfs.pod:1170
2445 "There must be a one-to-one correspondence between fields of the structure "
2446 "that are filled in, and bits set in the bitmask."
2450 #: ../src/guestfs.pod:1175
2451 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
2455 #: ../src/guestfs.pod:1177
2457 "In other languages, optional arguments are expressed in the way that is "
2458 "natural for that language. We refer you to the language-specific "
2459 "documentation for more details on that."
2463 #: ../src/guestfs.pod:1181
2464 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
2468 #: ../src/guestfs.pod:1183 ../src/guestfs.pod:1188
2473 #: ../src/guestfs.pod:1185
2475 "<!-- old anchor for the next section --> <a name="
2476 "\"state_machine_and_low_level_event_api\"/>"
2480 #: ../src/guestfs.pod:1190
2481 msgid "ARCHITECTURE"
2485 #: ../src/guestfs.pod:1192
2487 "Internally, libguestfs is implemented by running an appliance (a special "
2488 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2489 "process of the main program."
2493 #: ../src/guestfs.pod:1196
2496 " ___________________\n"
2498 " | main program |\n"
2500 " | | child process / appliance\n"
2501 " | | __________________________\n"
2503 " +-------------------+ RPC | +-----------------+ |\n"
2504 " | libguestfs <--------------------> guestfsd | |\n"
2505 " | | | +-----------------+ |\n"
2506 " \\___________________/ | | Linux kernel | |\n"
2507 " | +--^--------------+ |\n"
2508 " \\_________|________________/\n"
2514 " \\______________/\n"
2519 #: ../src/guestfs.pod:1216
2521 "The library, linked to the main program, creates the child process and hence "
2522 "the appliance in the L</guestfs_launch> function."
2526 #: ../src/guestfs.pod:1219
2528 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2529 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2530 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2531 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2532 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2533 "attached to the qemu process which translates device access by the "
2534 "appliance's Linux kernel into accesses to the image."
2538 #: ../src/guestfs.pod:1228
2540 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2541 "Although the disk image you are attached to might also be used by some "
2542 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2543 "care if both libguestfs's qemu process and your virtual machine are trying "
2544 "to update the disk image at the same time, since these usually results in "
2545 "massive disk corruption)."
2549 #: ../src/guestfs.pod:1235
2550 msgid "STATE MACHINE"
2554 #: ../src/guestfs.pod:1237
2555 msgid "libguestfs uses a state machine to model the child process:"
2559 #: ../src/guestfs.pod:1239
2571 " / | \\ \\ guestfs_launch\n"
2572 " / | _\\__V______\n"
2574 " / | | LAUNCHING |\n"
2575 " / | \\___________/\n"
2577 " / | guestfs_launch\n"
2579 " ______ / __|____V\n"
2580 " / \\ ------> / \\\n"
2581 " | BUSY | | READY |\n"
2582 " \\______/ <------ \\________/\n"
2587 #: ../src/guestfs.pod:1261
2589 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2590 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2591 "(3) alternating between READY and BUSY as commands are issued to, and "
2592 "carried out by, the child process."
2596 #: ../src/guestfs.pod:1266
2598 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2599 "asynchronously at any time (eg. due to some internal error), and that causes "
2600 "the state to transition back to CONFIG."
2604 #: ../src/guestfs.pod:1270
2606 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2607 "issued when in the CONFIG state."
2611 #: ../src/guestfs.pod:1273
2613 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2614 "L</guestfs_launch> blocks until the child process is READY to accept "
2615 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2616 "moves the state from CONFIG to LAUNCHING while it is running."
2620 #: ../src/guestfs.pod:1279
2622 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2623 "state. These API calls block waiting for the command to be carried out (ie. "
2624 "the state to transition to BUSY and then back to READY). There are no non-"
2625 "blocking versions, and no way to issue more than one command per handle at "
2630 #: ../src/guestfs.pod:1285
2632 "Finally, the child process sends asynchronous messages back to the main "
2633 "program, such as kernel log messages. You can register a callback to "
2634 "receive these messages."
2638 #: ../src/guestfs.pod:1289
2639 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2643 #: ../src/guestfs.pod:1291
2645 "The child process generates events in some situations. Current events "
2646 "include: receiving a log message, the child process exits."
2650 #: ../src/guestfs.pod:1294
2652 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2657 #: ../src/guestfs.pod:1297
2659 "Only I<one callback of each type> can be registered for each handle. "
2660 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2661 "that type. Cancel all callbacks of this type by calling this function with "
2662 "C<cb> set to C<NULL>."
2666 #: ../src/guestfs.pod:1302
2667 msgid "guestfs_set_log_message_callback"
2671 #: ../src/guestfs.pod:1304
2674 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2675 " char *buf, int len);\n"
2676 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2677 " guestfs_log_message_cb cb,\n"
2683 #: ../src/guestfs.pod:1310
2685 "The callback function C<cb> will be called whenever qemu or the guest writes "
2686 "anything to the console."
2690 #: ../src/guestfs.pod:1313
2691 msgid "Use this function to capture kernel messages and similar."
2695 #: ../src/guestfs.pod:1315
2697 "Normally there is no log message handler, and log messages are just "
2702 #: ../src/guestfs.pod:1318
2703 msgid "guestfs_set_subprocess_quit_callback"
2707 #: ../src/guestfs.pod:1320
2710 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2711 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2712 " guestfs_subprocess_quit_cb cb,\n"
2718 #: ../src/guestfs.pod:1325
2720 "The callback function C<cb> will be called when the child process quits, "
2721 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2722 "corresponds to a transition from any state to the CONFIG state)."
2726 #: ../src/guestfs.pod:1330
2727 msgid "guestfs_set_launch_done_callback"
2731 #: ../src/guestfs.pod:1332
2734 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2735 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2736 " guestfs_launch_done_cb cb,\n"
2742 #: ../src/guestfs.pod:1337
2744 "The callback function C<cb> will be called when the child process becomes "
2745 "ready first time after it has been launched. (This corresponds to a "
2746 "transition from LAUNCHING to the READY state)."
2750 #: ../src/guestfs.pod:1341
2751 msgid "guestfs_set_close_callback"
2755 #: ../src/guestfs.pod:1343
2758 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2759 " void guestfs_set_close_callback (guestfs_h *g,\n"
2760 " guestfs_close_cb cb,\n"
2766 #: ../src/guestfs.pod:1348
2768 "The callback function C<cb> will be called while the handle is being closed "
2769 "(synchronously from L</guestfs_close>)."
2773 #: ../src/guestfs.pod:1351
2775 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2776 "handles that are open when the program exits. This means that this callback "
2777 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2778 "problems in higher-level languages (eg. if your HLL interpreter has already "
2779 "been cleaned up by the time this is called, and if your callback then jumps "
2780 "into some HLL function)."
2784 #: ../src/guestfs.pod:1359
2785 msgid "guestfs_set_progress_callback"
2789 #: ../src/guestfs.pod:1361
2792 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2793 " int proc_nr, int serial,\n"
2794 " uint64_t position, uint64_t total);\n"
2795 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2796 " guestfs_progress_cb cb,\n"
2802 #: ../src/guestfs.pod:1368
2804 "Some long-running operations can generate progress messages. If this "
2805 "callback is registered, then it will be called each time a progress message "
2806 "is generated (usually two seconds after the operation started, and three "
2807 "times per second thereafter until it completes, although the frequency may "
2808 "change in future versions)."
2812 #: ../src/guestfs.pod:1374
2814 "The callback receives two numbers: C<position> and C<total>. The units of "
2815 "C<total> are not defined, although for some operations C<total> may relate "
2816 "in some way to the amount of data to be transferred (eg. in bytes or "
2817 "megabytes), and C<position> may be the portion which has been transferred."
2821 #: ../src/guestfs.pod:1380
2822 msgid "The only defined and stable parts of the API are:"
2826 #: ../src/guestfs.pod:1386
2828 "The callback can display to the user some type of progress bar or indicator "
2829 "which shows the ratio of C<position>:C<total>."
2833 #: ../src/guestfs.pod:1391
2834 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2838 #: ../src/guestfs.pod:1395
2840 "If any progress notification is sent during a call, then a final progress "
2841 "notification is always sent when C<position> = C<total>."
2845 #: ../src/guestfs.pod:1398
2847 "This is to simplify caller code, so callers can easily set the progress "
2848 "indicator to \"100%\" at the end of the operation, without requiring special "
2849 "code to detect this case."
2853 #: ../src/guestfs.pod:1404
2855 "The callback also receives the procedure number and serial number of the "
2856 "call. These are only useful for debugging protocol issues, and the callback "
2857 "can normally ignore them. The callback may want to print these numbers in "
2858 "error messages or debugging messages."
2862 #: ../src/guestfs.pod:1409
2863 msgid "PRIVATE DATA AREA"
2867 #: ../src/guestfs.pod:1411
2869 "You can attach named pieces of private data to the libguestfs handle, and "
2870 "fetch them by name for the lifetime of the handle. This is called the "
2871 "private data area and is only available from the C API."
2875 #: ../src/guestfs.pod:1415
2876 msgid "To attach a named piece of data, use the following call:"
2880 #: ../src/guestfs.pod:1417
2883 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2888 #: ../src/guestfs.pod:1419
2890 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2891 "pointer (which can be C<NULL>). Any previous item with the same name is "
2896 #: ../src/guestfs.pod:1423
2898 "You can use any C<key> you want, but names beginning with an underscore "
2899 "character are reserved for internal libguestfs purposes (for implementing "
2900 "language bindings). It is recommended to prefix the name with some unique "
2901 "string to avoid collisions with other users."
2905 #: ../src/guestfs.pod:1428
2906 msgid "To retrieve the pointer, use:"
2910 #: ../src/guestfs.pod:1430
2913 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2918 #: ../src/guestfs.pod:1432
2920 "This function returns C<NULL> if either no data is found associated with "
2921 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2926 #: ../src/guestfs.pod:1436
2928 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2929 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2930 "all. In particular, libguestfs does I<not> try to free the data when the "
2931 "handle is closed. If the data must be freed, then the caller must either "
2932 "free it before calling L</guestfs_close> or must set up a close callback to "
2933 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2934 "can be registered for a handle)."
2938 #: ../src/guestfs.pod:1444
2940 "The private data area is implemented using a hash table, and should be "
2941 "reasonably efficient for moderate numbers of keys."
2945 #: ../src/guestfs.pod:1447
2946 msgid "BLOCK DEVICE NAMING"
2950 #: ../src/guestfs.pod:1449
2952 "In the kernel there is now quite a profusion of schemata for naming block "
2953 "devices (in this context, by I<block device> I mean a physical or virtual "
2954 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2955 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2956 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2957 "for the old IDE driver (particularly for SATA devices) those devices also "
2958 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2959 "paravirtualized drivers. This has created several different naming systems, "
2960 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2964 #: ../src/guestfs.pod:1461
2966 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2967 "Linux kernel to access block devices. We can run a variety of appliances "
2968 "based on a variety of Linux kernels."
2972 #: ../src/guestfs.pod:1465
2974 "This causes a problem for libguestfs because many API calls use device or "
2975 "partition names. Working scripts and the recipe (example) scripts that we "
2976 "make available over the internet could fail if the naming scheme changes."
2980 #: ../src/guestfs.pod:1470
2982 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2983 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2984 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2985 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2989 #: ../src/guestfs.pod:1476
2991 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2992 "L</guestfs_list_partitions> and similar calls return the true names of the "
2993 "devices and partitions as known to the appliance."
2997 #: ../src/guestfs.pod:1481
2998 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
3002 #: ../src/guestfs.pod:1483
3004 "Usually this translation is transparent. However in some (very rare) cases "
3005 "you may need to know the exact algorithm. Such cases include where you use "
3006 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
3007 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
3011 #: ../src/guestfs.pod:1489
3013 "The algorithm is applied only to I<parameters> which are known to be either "
3014 "device or partition names. Return values from functions such as L</"
3015 "guestfs_list_devices> are never changed."
3019 #: ../src/guestfs.pod:1497
3020 msgid "Is the string a parameter which is a device or partition name?"
3024 #: ../src/guestfs.pod:1501
3025 msgid "Does the string begin with C</dev/sd>?"
3029 #: ../src/guestfs.pod:1505
3031 "Does the named device exist? If so, we use that device. However if I<not> "
3032 "then we continue with this algorithm."
3036 #: ../src/guestfs.pod:1510
3037 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
3041 #: ../src/guestfs.pod:1512
3042 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
3046 #: ../src/guestfs.pod:1514
3047 msgid "If that named device exists, use it. If not, continue."
3051 #: ../src/guestfs.pod:1518
3052 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
3056 #: ../src/guestfs.pod:1520
3057 msgid "If that named device exists, use it. If not, return an error."
3061 #: ../src/guestfs.pod:1524
3062 msgid "PORTABILITY CONCERNS"
3066 #: ../src/guestfs.pod:1526
3068 "Although the standard naming scheme and automatic translation is useful for "
3069 "simple programs and guestfish scripts, for larger programs it is best not to "
3070 "rely on this mechanism."
3074 #: ../src/guestfs.pod:1530
3076 "Where possible for maximum future portability programs using libguestfs "
3077 "should use these future-proof techniques:"
3081 #: ../src/guestfs.pod:1537
3083 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
3084 "device names, and then use those names directly."
3088 #: ../src/guestfs.pod:1540
3090 "Since those device names exist by definition, they will never be translated."
3094 #: ../src/guestfs.pod:1545
3096 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
3097 "filesystem labels."
3101 #: ../src/guestfs.pod:1550
3106 #: ../src/guestfs.pod:1552
3107 msgid "COMMUNICATION PROTOCOL"
3111 #: ../src/guestfs.pod:1554
3113 "Don't rely on using this protocol directly. This section documents how it "
3114 "currently works, but it may change at any time."
3118 #: ../src/guestfs.pod:1557
3120 "The protocol used to talk between the library and the daemon running inside "
3121 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3122 "1014, RFC 1832, RFC 4506)."
3126 #: ../src/guestfs.pod:1561
3128 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3129 "this file is automatically generated)."
3133 #: ../src/guestfs.pod:1564
3135 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3136 "and C<FileOut> parameters, which are handled with very simple request/reply "
3137 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3138 "parameters, which use the same request and reply messages, but they may also "
3139 "be followed by files sent using a chunked encoding."
3143 #: ../src/guestfs.pod:1571
3144 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3148 #: ../src/guestfs.pod:1573
3149 msgid "For ordinary functions, the request message is:"
3153 #: ../src/guestfs.pod:1575
3156 " total length (header + arguments,\n"
3157 " but not including the length word itself)\n"
3158 " struct guestfs_message_header (encoded as XDR)\n"
3159 " struct guestfs_<foo>_args (encoded as XDR)\n"
3164 #: ../src/guestfs.pod:1580
3166 "The total length field allows the daemon to allocate a fixed size buffer "
3167 "into which it slurps the rest of the message. As a result, the total length "
3168 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3169 "effective size of any request is limited to somewhere under this size."
3173 #: ../src/guestfs.pod:1586
3175 "Note also that many functions don't take any arguments, in which case the "
3176 "C<guestfs_I<foo>_args> is completely omitted."
3180 #: ../src/guestfs.pod:1589
3182 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3183 "receiver knows what type of args structure to expect, or none at all."
3187 #: ../src/guestfs.pod:1593
3188 msgid "The reply message for ordinary functions is:"
3192 #: ../src/guestfs.pod:1595
3195 " total length (header + ret,\n"
3196 " but not including the length word itself)\n"
3197 " struct guestfs_message_header (encoded as XDR)\n"
3198 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3203 #: ../src/guestfs.pod:1600
3205 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3206 "functions that return no formal return values."
3210 #: ../src/guestfs.pod:1603
3212 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3216 #: ../src/guestfs.pod:1606
3218 "In the case of an error, a flag is set in the header, and the reply message "
3219 "is slightly changed:"
3223 #: ../src/guestfs.pod:1609
3226 " total length (header + error,\n"
3227 " but not including the length word itself)\n"
3228 " struct guestfs_message_header (encoded as XDR)\n"
3229 " struct guestfs_message_error (encoded as XDR)\n"
3234 #: ../src/guestfs.pod:1614
3236 "The C<guestfs_message_error> structure contains the error message as a "
3241 #: ../src/guestfs.pod:1617
3242 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3246 #: ../src/guestfs.pod:1619
3248 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3249 "The normal request message is sent (see above). However this is followed by "
3250 "a sequence of file chunks."
3254 #: ../src/guestfs.pod:1623
3257 " total length (header + arguments,\n"
3258 " but not including the length word itself,\n"
3259 " and not including the chunks)\n"
3260 " struct guestfs_message_header (encoded as XDR)\n"
3261 " struct guestfs_<foo>_args (encoded as XDR)\n"
3262 " sequence of chunks for FileIn param #0\n"
3263 " sequence of chunks for FileIn param #1 etc.\n"
3268 #: ../src/guestfs.pod:1631
3269 msgid "The \"sequence of chunks\" is:"
3273 #: ../src/guestfs.pod:1633
3276 " length of chunk (not including length word itself)\n"
3277 " struct guestfs_chunk (encoded as XDR)\n"
3278 " length of chunk\n"
3279 " struct guestfs_chunk (encoded as XDR)\n"
3281 " length of chunk\n"
3282 " struct guestfs_chunk (with data.data_len == 0)\n"
3287 #: ../src/guestfs.pod:1641
3289 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3290 "is set in the final chunk to indicate either successful completion or early "
3295 #: ../src/guestfs.pod:1645
3297 "At time of writing there are no functions that have more than one FileIn "
3298 "parameter. However this is (theoretically) supported, by sending the "
3299 "sequence of chunks for each FileIn parameter one after another (from left to "
3304 #: ../src/guestfs.pod:1650
3306 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3307 "transfer. The library does this by sending a chunk with a special flag set "
3308 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3309 "RPC, does I<not> send any reply, and goes back to reading the next request."
3313 #: ../src/guestfs.pod:1656
3315 "The daemon may also cancel. It does this by writing a special word "
3316 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3317 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3318 "cancel chunk). The special word is chosen so that even if cancellation "
3319 "happens right at the end of the transfer (after the library has finished "
3320 "writing and has started listening for the reply), the \"spurious\" cancel "
3321 "flag will not be confused with the reply message."
3325 #: ../src/guestfs.pod:1665
3327 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3328 "limit), and also files where the size is not known in advance (eg. from "
3329 "pipes or sockets). However the chunks are rather small "
3330 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3331 "to keep much in memory."
3335 #: ../src/guestfs.pod:1671
3336 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3340 #: ../src/guestfs.pod:1673
3342 "The protocol for FileOut parameters is exactly the same as for FileIn "
3343 "parameters, but with the roles of daemon and library reversed."
3347 #: ../src/guestfs.pod:1676
3350 " total length (header + ret,\n"
3351 " but not including the length word itself,\n"
3352 " and not including the chunks)\n"
3353 " struct guestfs_message_header (encoded as XDR)\n"
3354 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3355 " sequence of chunks for FileOut param #0\n"
3356 " sequence of chunks for FileOut param #1 etc.\n"
3361 #: ../src/guestfs.pod:1684
3362 msgid "INITIAL MESSAGE"
3366 #: ../src/guestfs.pod:1686
3368 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3369 "which indicates that the guest and daemon is alive. This is what L</"
3370 "guestfs_launch> waits for."
3374 #: ../src/guestfs.pod:1690
3375 msgid "PROGRESS NOTIFICATION MESSAGES"
3379 #: ../src/guestfs.pod:1692
3381 "The daemon may send progress notification messages at any time. These are "
3382 "distinguished by the normal length word being replaced by "
3383 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3387 #: ../src/guestfs.pod:1696
3389 "The library turns them into progress callbacks (see "
3390 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3391 "discards them if not."
3395 #: ../src/guestfs.pod:1700
3397 "The daemon self-limits the frequency of progress messages it sends (see "
3398 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3403 #: ../src/guestfs.pod:1704
3404 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3408 #: ../src/guestfs.pod:1706
3410 "All high-level libguestfs actions are synchronous. If you want to use "
3411 "libguestfs asynchronously then you must create a thread."
3415 #: ../src/guestfs.pod:1709
3417 "Only use the handle from a single thread. Either use the handle exclusively "
3418 "from one thread, or provide your own mutex so that two threads cannot issue "
3419 "calls on the same handle at the same time."
3423 #: ../src/guestfs.pod:1713
3425 "See the graphical program guestfs-browser for one possible architecture for "
3426 "multithreaded programs using libvirt and libguestfs."
3430 #: ../src/guestfs.pod:1716
3431 msgid "QEMU WRAPPERS"
3435 #: ../src/guestfs.pod:1718
3437 "If you want to compile your own qemu, run qemu from a non-standard location, "
3438 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3443 #: ../src/guestfs.pod:1722
3445 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3446 "last command in the shell script (so that qemu replaces the shell and "
3447 "becomes the direct child of the libguestfs-using program). If you don't do "
3448 "this, then the qemu process won't be cleaned up correctly."
3452 #: ../src/guestfs.pod:1727
3454 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3459 #: ../src/guestfs.pod:1730
3463 " qemudir=/home/rjones/d/qemu\n"
3464 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
3469 #: ../src/guestfs.pod:1734
3471 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3472 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3477 #: ../src/guestfs.pod:1738
3480 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3485 #: ../src/guestfs.pod:1740
3487 "Note that libguestfs also calls qemu with the -help and -version options in "
3488 "order to determine features."
3492 #: ../src/guestfs.pod:1743
3493 msgid "LIBGUESTFS VERSION NUMBERS"
3497 #: ../src/guestfs.pod:1745
3499 "Since April 2010, libguestfs has started to make separate development and "
3500 "stable releases, along with corresponding branches in our git repository. "
3501 "These separate releases can be identified by version number:"
3505 #: ../src/guestfs.pod:1750
3508 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3509 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3515 " | `-------- sub-version\n"
3517 " `------ always '1' because we don't change the ABI\n"
3522 #: ../src/guestfs.pod:1761
3523 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3527 #: ../src/guestfs.pod:1763
3529 "As time passes we cherry pick fixes from the development branch and backport "
3530 "those into the stable branch, the effect being that the stable branch should "
3531 "get more stable and less buggy over time. So the stable releases are ideal "
3532 "for people who don't need new features but would just like the software to "
3537 #: ../src/guestfs.pod:1769
3538 msgid "Our criteria for backporting changes are:"
3542 #: ../src/guestfs.pod:1775
3544 "Documentation changes which don't affect any code are backported unless the "
3545 "documentation refers to a future feature which is not in stable."
3549 #: ../src/guestfs.pod:1781
3551 "Bug fixes which are not controversial, fix obvious problems, and have been "
3552 "well tested are backported."
3556 #: ../src/guestfs.pod:1786
3558 "Simple rearrangements of code which shouldn't affect how it works get "
3559 "backported. This is so that the code in the two branches doesn't get too "
3560 "far out of step, allowing us to backport future fixes more easily."
3564 #: ../src/guestfs.pod:1792
3566 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3567 "exceptional case: the new feature is required in order to implement an "
3568 "important bug fix."
3572 #: ../src/guestfs.pod:1798
3574 "A new stable branch starts when we think the new features in development are "
3575 "substantial and compelling enough over the current stable branch to warrant "
3576 "it. When that happens we create new stable and development versions 1.N.0 "
3577 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3578 "stable at this point, but by backporting fixes from development, that branch "
3579 "will stabilize over time."
3583 #: ../src/guestfs.pod:1806 ../fish/guestfish.pod:867
3584 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3585 #: ../tools/virt-rescue.pl:255
3586 msgid "ENVIRONMENT VARIABLES"
3590 #: ../src/guestfs.pod:1810 ../fish/guestfish.pod:893
3591 msgid "LIBGUESTFS_APPEND"
3595 #: ../src/guestfs.pod:1812 ../fish/guestfish.pod:895
3596 msgid "Pass additional options to the guest kernel."
3600 #: ../src/guestfs.pod:1814 ../fish/guestfish.pod:897
3601 msgid "LIBGUESTFS_DEBUG"
3605 #: ../src/guestfs.pod:1816
3607 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3608 "effect as calling C<guestfs_set_verbose (g, 1)>."
3612 #: ../src/guestfs.pod:1819 ../fish/guestfish.pod:902
3613 msgid "LIBGUESTFS_MEMSIZE"
3617 #: ../src/guestfs.pod:1821 ../fish/guestfish.pod:904
3619 "Set the memory allocated to the qemu process, in megabytes. For example:"
3623 #: ../src/guestfs.pod:1824 ../fish/guestfish.pod:907
3626 " LIBGUESTFS_MEMSIZE=700\n"
3631 #: ../src/guestfs.pod:1826 ../fish/guestfish.pod:909
3632 msgid "LIBGUESTFS_PATH"
3636 #: ../src/guestfs.pod:1828
3638 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3639 "the discussion of paths in section PATH above."
3643 #: ../src/guestfs.pod:1831 ../fish/guestfish.pod:914
3644 msgid "LIBGUESTFS_QEMU"
3648 #: ../src/guestfs.pod:1833 ../fish/guestfish.pod:916
3650 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3651 "which was found at compile time by the configure script is used."
3655 #: ../src/guestfs.pod:1837
3656 msgid "See also L</QEMU WRAPPERS> above."
3660 #: ../src/guestfs.pod:1839 ../fish/guestfish.pod:920
3661 msgid "LIBGUESTFS_TRACE"
3665 #: ../src/guestfs.pod:1841
3667 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3668 "effect as calling C<guestfs_set_trace (g, 1)>."
3672 #: ../src/guestfs.pod:1844 ../fish/guestfish.pod:929
3677 #: ../src/guestfs.pod:1846 ../fish/guestfish.pod:931
3678 msgid "Location of temporary directory, defaults to C</tmp>."
3682 #: ../src/guestfs.pod:1848 ../fish/guestfish.pod:933
3684 "If libguestfs was compiled to use the supermin appliance then the real "
3685 "appliance is cached in this directory, shared between all handles belonging "
3686 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
3687 "use in case C</tmp> is not large enough."
3691 #: ../src/guestfs.pod:1856 ../fish/guestfish.pod:991
3692 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:214
3693 #: ../inspector/virt-inspector.pl:570 ../tools/virt-edit.pl:350
3694 #: ../tools/virt-win-reg.pl:484 ../tools/virt-df.pl:640
3695 #: ../tools/virt-ls.pl:232 ../tools/virt-resize.pl:1486
3696 #: ../tools/virt-list-filesystems.pl:186 ../tools/virt-cat.pl:185
3697 #: ../tools/virt-tar.pl:281 ../tools/virt-rescue.pl:267
3698 #: ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:254
3703 #: ../src/guestfs.pod:1858
3705 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-edit"
3706 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
3707 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
3708 "tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
3709 "L<http://libguestfs.org/>."
3713 #: ../src/guestfs.pod:1876
3715 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
3716 "(8)>, L<disktype(1)>."
3720 #: ../src/guestfs.pod:1883 ../tools/virt-win-reg.pl:499
3721 #: ../tools/virt-make-fs.pl:548
3726 #: ../src/guestfs.pod:1885
3727 msgid "To get a list of bugs against libguestfs use this link:"
3731 #: ../src/guestfs.pod:1887
3733 "L<https://bugzilla.redhat.com/buglist.cgi?"
3734 "component=libguestfs&product=Virtualization+Tools>"
3738 #: ../src/guestfs.pod:1889
3739 msgid "To report a new bug against libguestfs use this link:"
3743 #: ../src/guestfs.pod:1891
3745 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
3746 "component=libguestfs&product=Virtualization+Tools>"
3750 #: ../src/guestfs.pod:1893
3751 msgid "When reporting a bug, please check:"
3755 #: ../src/guestfs.pod:1899
3756 msgid "That the bug hasn't been reported already."
3760 #: ../src/guestfs.pod:1903
3761 msgid "That you are testing a recent version."
3765 #: ../src/guestfs.pod:1907
3766 msgid "Describe the bug accurately, and give a way to reproduce it."
3770 #: ../src/guestfs.pod:1911
3772 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3777 #: ../src/guestfs.pod:1916 ../fish/guestfish.pod:1008
3778 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:225
3779 #: ../inspector/virt-inspector.pl:580
3784 #: ../src/guestfs.pod:1918 ../fish/guestfish.pod:1010
3785 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:227
3786 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3790 #: ../src/guestfs.pod:1920 ../fish/guestfish.pod:1012
3791 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:229
3792 #: ../inspector/virt-inspector.pl:594 ../tools/virt-edit.pl:366
3793 #: ../tools/virt-win-reg.pl:514 ../tools/virt-df.pl:653
3794 #: ../tools/virt-ls.pl:247 ../tools/virt-resize.pl:1512
3795 #: ../tools/virt-list-filesystems.pl:202 ../tools/virt-cat.pl:199
3796 #: ../tools/virt-tar.pl:296 ../tools/virt-rescue.pl:281
3797 #: ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:269
3802 #: ../src/guestfs.pod:1922 ../fish/guestfish.pod:1014
3803 #: ../fuse/guestmount.pod:231
3804 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3808 #: ../src/guestfs.pod:1925
3810 "This library is free software; you can redistribute it and/or modify it "
3811 "under the terms of the GNU Lesser General Public License as published by the "
3812 "Free Software Foundation; either version 2 of the License, or (at your "
3813 "option) any later version."
3817 #: ../src/guestfs.pod:1930
3819 "This library is distributed in the hope that it will be useful, but WITHOUT "
3820 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3821 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3826 #: ../src/guestfs.pod:1935
3828 "You should have received a copy of the GNU Lesser General Public License "
3829 "along with this library; if not, write to the Free Software Foundation, "
3830 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3834 #: ../src/guestfs-actions.pod:1
3835 msgid "guestfs_add_cdrom"
3839 #: ../src/guestfs-actions.pod:3
3842 " int guestfs_add_cdrom (guestfs_h *g,\n"
3843 "\t\tconst char *filename);\n"
3848 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:5
3849 msgid "This function adds a virtual CD-ROM disk image to the guest."
3853 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:7
3854 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3858 #: ../src/guestfs-actions.pod:16
3860 "This call checks for the existence of C<filename>. This stops you from "
3861 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3862 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3867 #: ../src/guestfs-actions.pod:23
3869 "If you just want to add an ISO file (often you use this as an efficient way "
3870 "to transfer large files into the guest), then you should probably use "
3871 "C<guestfs_add_drive_ro> instead."
3875 #: ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:54
3876 #: ../src/guestfs-actions.pod:112 ../src/guestfs-actions.pod:144
3877 #: ../src/guestfs-actions.pod:155 ../src/guestfs-actions.pod:173
3878 #: ../src/guestfs-actions.pod:190 ../src/guestfs-actions.pod:201
3879 #: ../src/guestfs-actions.pod:304 ../src/guestfs-actions.pod:321
3880 #: ../src/guestfs-actions.pod:332 ../src/guestfs-actions.pod:368
3881 #: ../src/guestfs-actions.pod:390 ../src/guestfs-actions.pod:405
3882 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:496
3883 #: ../src/guestfs-actions.pod:507 ../src/guestfs-actions.pod:519
3884 #: ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:615
3885 #: ../src/guestfs-actions.pod:626 ../src/guestfs-actions.pod:637
3886 #: ../src/guestfs-actions.pod:783 ../src/guestfs-actions.pod:800
3887 #: ../src/guestfs-actions.pod:815 ../src/guestfs-actions.pod:890
3888 #: ../src/guestfs-actions.pod:905 ../src/guestfs-actions.pod:921
3889 #: ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:949
3890 #: ../src/guestfs-actions.pod:982 ../src/guestfs-actions.pod:1040
3891 #: ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1090
3892 #: ../src/guestfs-actions.pod:1121 ../src/guestfs-actions.pod:1209
3893 #: ../src/guestfs-actions.pod:1240 ../src/guestfs-actions.pod:1440
3894 #: ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1540
3895 #: ../src/guestfs-actions.pod:1888 ../src/guestfs-actions.pod:2011
3896 #: ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2096
3897 #: ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:2557
3898 #: ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:2682
3899 #: ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2703
3900 #: ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2726
3901 #: ../src/guestfs-actions.pod:2756 ../src/guestfs-actions.pod:2820
3902 #: ../src/guestfs-actions.pod:2837 ../src/guestfs-actions.pod:2851
3903 #: ../src/guestfs-actions.pod:2871 ../src/guestfs-actions.pod:2891
3904 #: ../src/guestfs-actions.pod:2920 ../src/guestfs-actions.pod:2936
3905 #: ../src/guestfs-actions.pod:2952 ../src/guestfs-actions.pod:2981
3906 #: ../src/guestfs-actions.pod:2990 ../src/guestfs-actions.pod:3023
3907 #: ../src/guestfs-actions.pod:3036 ../src/guestfs-actions.pod:3046
3908 #: ../src/guestfs-actions.pod:3058 ../src/guestfs-actions.pod:3072
3909 #: ../src/guestfs-actions.pod:3152 ../src/guestfs-actions.pod:3169
3910 #: ../src/guestfs-actions.pod:3179 ../src/guestfs-actions.pod:3224
3911 #: ../src/guestfs-actions.pod:3239 ../src/guestfs-actions.pod:3254
3912 #: ../src/guestfs-actions.pod:3267 ../src/guestfs-actions.pod:3278
3913 #: ../src/guestfs-actions.pod:3289 ../src/guestfs-actions.pod:3303
3914 #: ../src/guestfs-actions.pod:3315 ../src/guestfs-actions.pod:3332
3915 #: ../src/guestfs-actions.pod:3378 ../src/guestfs-actions.pod:3406
3916 #: ../src/guestfs-actions.pod:3422 ../src/guestfs-actions.pod:3438
3917 #: ../src/guestfs-actions.pod:3447 ../src/guestfs-actions.pod:3461
3918 #: ../src/guestfs-actions.pod:3471 ../src/guestfs-actions.pod:3483
3919 #: ../src/guestfs-actions.pod:3495 ../src/guestfs-actions.pod:3527
3920 #: ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3556
3921 #: ../src/guestfs-actions.pod:3567 ../src/guestfs-actions.pod:3581
3922 #: ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3652
3923 #: ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3688
3924 #: ../src/guestfs-actions.pod:3702 ../src/guestfs-actions.pod:3717
3925 #: ../src/guestfs-actions.pod:3839 ../src/guestfs-actions.pod:3891
3926 #: ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3925
3927 #: ../src/guestfs-actions.pod:3951 ../src/guestfs-actions.pod:4008
3928 #: ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:4032
3929 #: ../src/guestfs-actions.pod:4043 ../src/guestfs-actions.pod:4298
3930 #: ../src/guestfs-actions.pod:4314 ../src/guestfs-actions.pod:4325
3931 #: ../src/guestfs-actions.pod:4334 ../src/guestfs-actions.pod:4345
3932 #: ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:4365
3933 #: ../src/guestfs-actions.pod:4378 ../src/guestfs-actions.pod:4396
3934 #: ../src/guestfs-actions.pod:4412 ../src/guestfs-actions.pod:4428
3935 #: ../src/guestfs-actions.pod:4443 ../src/guestfs-actions.pod:4463
3936 #: ../src/guestfs-actions.pod:4478 ../src/guestfs-actions.pod:4494
3937 #: ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4528
3938 #: ../src/guestfs-actions.pod:4542 ../src/guestfs-actions.pod:4567
3939 #: ../src/guestfs-actions.pod:4588 ../src/guestfs-actions.pod:4604
3940 #: ../src/guestfs-actions.pod:4625 ../src/guestfs-actions.pod:4637
3941 #: ../src/guestfs-actions.pod:4649 ../src/guestfs-actions.pod:4665
3942 #: ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4719
3943 #: ../src/guestfs-actions.pod:4742 ../src/guestfs-actions.pod:4832
3944 #: ../src/guestfs-actions.pod:4938 ../src/guestfs-actions.pod:4947
3945 #: ../src/guestfs-actions.pod:4957 ../src/guestfs-actions.pod:4967
3946 #: ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:4996
3947 #: ../src/guestfs-actions.pod:5006 ../src/guestfs-actions.pod:5016
3948 #: ../src/guestfs-actions.pod:5028 ../src/guestfs-actions.pod:5078
3949 #: ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5105
3950 #: ../src/guestfs-actions.pod:5118 ../src/guestfs-actions.pod:5132
3951 #: ../src/guestfs-actions.pod:5142 ../src/guestfs-actions.pod:5159
3952 #: ../src/guestfs-actions.pod:5189 ../src/guestfs-actions.pod:5200
3953 #: ../src/guestfs-actions.pod:5235 ../src/guestfs-actions.pod:5245
3954 #: ../src/guestfs-actions.pod:5260 ../src/guestfs-actions.pod:5286
3955 #: ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5418
3956 #: ../src/guestfs-actions.pod:5433 ../src/guestfs-actions.pod:5444
3957 #: ../src/guestfs-actions.pod:5490 ../src/guestfs-actions.pod:5500
3958 #: ../src/guestfs-actions.pod:5537 ../src/guestfs-actions.pod:5564
3959 #: ../src/guestfs-actions.pod:5606 ../src/guestfs-actions.pod:5629
3960 #: ../src/guestfs-actions.pod:5686 ../src/guestfs-actions.pod:5702
3961 #: ../src/guestfs-actions.pod:5728
3962 msgid "This function returns 0 on success or -1 on error."
3966 #: ../src/guestfs-actions.pod:31 ../src/guestfs-actions.pod:157
3967 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:28
3968 #: ../fish/guestfish-actions.pod:117 ../fish/guestfish-actions.pod:131
3970 "This function is deprecated. In new code, use the C<add_drive_opts> call "
3975 #: ../src/guestfs-actions.pod:34 ../src/guestfs-actions.pod:160
3976 #: ../src/guestfs-actions.pod:178 ../src/guestfs-actions.pod:1214
3977 #: ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1667
3978 #: ../src/guestfs-actions.pod:5637 ../src/guestfs-actions.pod:5782
3979 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:120
3980 #: ../fish/guestfish-actions.pod:134 ../fish/guestfish-actions.pod:940
3981 #: ../fish/guestfish-actions.pod:1297 ../fish/guestfish-actions.pod:1311
3982 #: ../fish/guestfish-actions.pod:4353 ../fish/guestfish-actions.pod:4450
3984 "Deprecated functions will not be removed from the API, but the fact that "
3985 "they are deprecated indicates that there are problems with correct use of "
3990 #: ../src/guestfs-actions.pod:38
3991 msgid "guestfs_add_drive"
3995 #: ../src/guestfs-actions.pod:40
3998 " int guestfs_add_drive (guestfs_h *g,\n"
3999 "\t\tconst char *filename);\n"
4004 #: ../src/guestfs-actions.pod:43
4006 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4007 "optional parameters, so the disk is added writable, with the format being "
4008 "detected automatically."
4012 #: ../src/guestfs-actions.pod:47
4014 "Automatic detection of the format opens you up to a potential security hole "
4015 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4016 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4017 "you should think about replacing calls to this function with calls to "
4018 "C<guestfs_add_drive_opts>, and specifying the format."
4022 #: ../src/guestfs-actions.pod:56
4023 msgid "guestfs_add_drive_opts"
4027 #: ../src/guestfs-actions.pod:58
4030 " int guestfs_add_drive_opts (guestfs_h *g,\n"
4031 "\t\tconst char *filename,\n"
4037 #: ../src/guestfs-actions.pod:62
4039 "You may supply a list of optional arguments to this call. Use zero or more "
4040 "of the following pairs of parameters, and terminate the list with C<-1> on "
4041 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4045 #: ../src/guestfs-actions.pod:67
4048 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4049 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4050 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4055 #: ../src/guestfs-actions.pod:71 ../fish/guestfish-actions.pod:56
4057 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4058 "The first time you call this function, the disk appears as C</dev/sda>, the "
4059 "second time as C</dev/sdb>, and so on."
4063 #: ../src/guestfs-actions.pod:76 ../fish/guestfish-actions.pod:61
4065 "You don't necessarily need to be root when using libguestfs. However you "
4066 "obviously do need sufficient permissions to access the filename for whatever "
4067 "operations you want to perform (ie. read access if you just want to read the "
4068 "image or write access if you want to modify the image)."
4072 #: ../src/guestfs-actions.pod:82 ../fish/guestfish-actions.pod:67
4073 msgid "This call checks that C<filename> exists."
4077 #: ../src/guestfs-actions.pod:84 ../fish/guestfish-actions.pod:69
4078 msgid "The optional arguments are:"
4082 #: ../src/guestfs-actions.pod:88 ../fish/guestfish-actions.pod:73
4087 #: ../src/guestfs-actions.pod:90 ../fish/guestfish-actions.pod:75
4089 "If true then the image is treated as read-only. Writes are still allowed, "
4090 "but they are stored in a temporary snapshot overlay which is discarded at "
4091 "the end. The disk that you add is not modified."
4095 #: ../src/guestfs-actions.pod:94 ../fish/guestfish-actions.pod:79
4100 #: ../src/guestfs-actions.pod:96
4102 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4103 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4104 "Possible formats include C<raw> and C<qcow2>."
4108 #: ../src/guestfs-actions.pod:100 ../fish/guestfish-actions.pod:85
4110 "Automatic detection of the format opens you up to a potential security hole "
4111 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4112 "RHBZ#642934. Specifying the format closes this security hole."
4116 #: ../src/guestfs-actions.pod:105 ../fish/guestfish-actions.pod:90
4121 #: ../src/guestfs-actions.pod:107
4123 "This rarely-used option lets you emulate the behaviour of the deprecated "
4124 "C<guestfs_add_drive_with_if> call (q.v.)"
4128 #: ../src/guestfs-actions.pod:114
4129 msgid "guestfs_add_drive_opts_va"
4133 #: ../src/guestfs-actions.pod:116
4136 " int guestfs_add_drive_opts_va (guestfs_h *g,\n"
4137 "\t\tconst char *filename,\n"
4138 "\t\tva_list args);\n"
4143 #: ../src/guestfs-actions.pod:120
4144 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4148 #: ../src/guestfs-actions.pod:122 ../src/guestfs-actions.pod:132
4149 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4153 #: ../src/guestfs-actions.pod:124
4154 msgid "guestfs_add_drive_opts_argv"
4158 #: ../src/guestfs-actions.pod:126
4161 " int guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4162 "\t\tconst char *filename,\n"
4163 "\t\tconst struct guestfs_add_drive_opts_argv *optargs);\n"
4168 #: ../src/guestfs-actions.pod:130
4169 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4173 #: ../src/guestfs-actions.pod:134
4174 msgid "guestfs_add_drive_ro"
4178 #: ../src/guestfs-actions.pod:136
4181 " int guestfs_add_drive_ro (guestfs_h *g,\n"
4182 "\t\tconst char *filename);\n"
4187 #: ../src/guestfs-actions.pod:139
4189 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4190 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4191 "disk is added read-only, with the format being detected automatically."
4195 #: ../src/guestfs-actions.pod:146
4196 msgid "guestfs_add_drive_ro_with_if"
4200 #: ../src/guestfs-actions.pod:148
4203 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4204 "\t\tconst char *filename,\n"
4205 "\t\tconst char *iface);\n"
4210 #: ../src/guestfs-actions.pod:152
4212 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4213 "QEMU interface emulation to use at run time."
4217 #: ../src/guestfs-actions.pod:164
4218 msgid "guestfs_add_drive_with_if"
4222 #: ../src/guestfs-actions.pod:166
4225 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
4226 "\t\tconst char *filename,\n"
4227 "\t\tconst char *iface);\n"
4232 #: ../src/guestfs-actions.pod:170
4234 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4235 "QEMU interface emulation to use at run time."
4239 #: ../src/guestfs-actions.pod:182
4240 msgid "guestfs_aug_clear"
4244 #: ../src/guestfs-actions.pod:184
4247 " int guestfs_aug_clear (guestfs_h *g,\n"
4248 "\t\tconst char *augpath);\n"
4253 #: ../src/guestfs-actions.pod:187 ../fish/guestfish-actions.pod:142
4255 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4256 "L<augtool(1)> C<clear> command."
4260 #: ../src/guestfs-actions.pod:192
4261 msgid "guestfs_aug_close"
4265 #: ../src/guestfs-actions.pod:194
4268 " int guestfs_aug_close (guestfs_h *g);\n"
4273 #: ../src/guestfs-actions.pod:196
4275 "Close the current Augeas handle and free up any resources used by it. After "
4276 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4277 "any other Augeas functions."
4281 #: ../src/guestfs-actions.pod:203
4282 msgid "guestfs_aug_defnode"
4286 #: ../src/guestfs-actions.pod:205
4289 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
4290 "\t\tconst char *name,\n"
4291 "\t\tconst char *expr,\n"
4292 "\t\tconst char *val);\n"
4297 #: ../src/guestfs-actions.pod:210 ../fish/guestfish-actions.pod:158
4299 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4303 #: ../src/guestfs-actions.pod:213
4305 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4306 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4307 "containing that single node."
4311 #: ../src/guestfs-actions.pod:217 ../fish/guestfish-actions.pod:165
4313 "On success this returns a pair containing the number of nodes in the "
4314 "nodeset, and a boolean flag if a node was created."
4318 #: ../src/guestfs-actions.pod:221
4320 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4321 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4325 #: ../src/guestfs-actions.pod:225
4326 msgid "guestfs_aug_defvar"
4330 #: ../src/guestfs-actions.pod:227
4333 " int guestfs_aug_defvar (guestfs_h *g,\n"
4334 "\t\tconst char *name,\n"
4335 "\t\tconst char *expr);\n"
4340 #: ../src/guestfs-actions.pod:231 ../fish/guestfish-actions.pod:173
4342 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4343 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4347 #: ../src/guestfs-actions.pod:235 ../fish/guestfish-actions.pod:177
4349 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4350 "evaluates to something which is not a nodeset."
4354 #: ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:379
4355 #: ../src/guestfs-actions.pod:533 ../src/guestfs-actions.pod:558
4356 #: ../src/guestfs-actions.pod:573 ../src/guestfs-actions.pod:589
4357 #: ../src/guestfs-actions.pod:1107 ../src/guestfs-actions.pod:1422
4358 #: ../src/guestfs-actions.pod:1604 ../src/guestfs-actions.pod:1685
4359 #: ../src/guestfs-actions.pod:1716 ../src/guestfs-actions.pod:1759
4360 #: ../src/guestfs-actions.pod:1776 ../src/guestfs-actions.pod:2001
4361 #: ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:2251
4362 #: ../src/guestfs-actions.pod:3641 ../src/guestfs-actions.pod:3748
4363 #: ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:4125
4364 #: ../src/guestfs-actions.pod:5224 ../src/guestfs-actions.pod:5574
4365 #: ../src/guestfs-actions.pod:5584 ../src/guestfs-actions.pod:5594
4366 msgid "On error this function returns -1."
4370 #: ../src/guestfs-actions.pod:240
4371 msgid "guestfs_aug_get"
4375 #: ../src/guestfs-actions.pod:242
4378 " char *guestfs_aug_get (guestfs_h *g,\n"
4379 "\t\tconst char *augpath);\n"
4384 #: ../src/guestfs-actions.pod:245 ../fish/guestfish-actions.pod:184
4386 "Look up the value associated with C<path>. If C<path> matches exactly one "
4387 "node, the C<value> is returned."
4391 #: ../src/guestfs-actions.pod:248 ../src/guestfs-actions.pod:676
4392 #: ../src/guestfs-actions.pod:691 ../src/guestfs-actions.pod:748
4393 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:852
4394 #: ../src/guestfs-actions.pod:965 ../src/guestfs-actions.pod:994
4395 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1024
4396 #: ../src/guestfs-actions.pod:1135 ../src/guestfs-actions.pod:1299
4397 #: ../src/guestfs-actions.pod:1408 ../src/guestfs-actions.pod:1553
4398 #: ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:1643
4399 #: ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1795
4400 #: ../src/guestfs-actions.pod:1934 ../src/guestfs-actions.pod:2115
4401 #: ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:2301
4402 #: ../src/guestfs-actions.pod:2336 ../src/guestfs-actions.pod:2356
4403 #: ../src/guestfs-actions.pod:2671 ../src/guestfs-actions.pod:2968
4404 #: ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3205
4405 #: ../src/guestfs-actions.pod:3763 ../src/guestfs-actions.pod:3939
4406 #: ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4241
4407 #: ../src/guestfs-actions.pod:4284 ../src/guestfs-actions.pod:4760
4408 #: ../src/guestfs-actions.pod:4773 ../src/guestfs-actions.pod:4787
4409 #: ../src/guestfs-actions.pod:4808 ../src/guestfs-actions.pod:5367
4410 #: ../src/guestfs-actions.pod:5383 ../src/guestfs-actions.pod:5398
4411 #: ../src/guestfs-actions.pod:5546 ../src/guestfs-actions.pod:5776
4413 "This function returns a string, or NULL on error. I<The caller must free "
4414 "the returned string after use>."
4418 #: ../src/guestfs-actions.pod:251
4419 msgid "guestfs_aug_init"
4423 #: ../src/guestfs-actions.pod:253
4426 " int guestfs_aug_init (guestfs_h *g,\n"
4427 "\t\tconst char *root,\n"
4433 #: ../src/guestfs-actions.pod:257 ../fish/guestfish-actions.pod:191
4435 "Create a new Augeas handle for editing configuration files. If there was "
4436 "any previous Augeas handle associated with this guestfs session, then it is "
4441 #: ../src/guestfs-actions.pod:261
4442 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4446 #: ../src/guestfs-actions.pod:264 ../fish/guestfish-actions.pod:198
4448 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4452 #: ../src/guestfs-actions.pod:267 ../fish/guestfish-actions.pod:201
4454 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4455 "logical I<or> of the following integers:"
4459 #: ../src/guestfs-actions.pod:273 ../fish/guestfish-actions.pod:207
4460 msgid "C<AUG_SAVE_BACKUP> = 1"
4464 #: ../src/guestfs-actions.pod:275 ../fish/guestfish-actions.pod:209
4465 msgid "Keep the original file with a C<.augsave> extension."
4469 #: ../src/guestfs-actions.pod:277 ../fish/guestfish-actions.pod:211
4470 msgid "C<AUG_SAVE_NEWFILE> = 2"
4474 #: ../src/guestfs-actions.pod:279 ../fish/guestfish-actions.pod:213
4476 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4477 "original. Overrides C<AUG_SAVE_BACKUP>."
4481 #: ../src/guestfs-actions.pod:282 ../fish/guestfish-actions.pod:216
4482 msgid "C<AUG_TYPE_CHECK> = 4"
4486 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:218
4487 msgid "Typecheck lenses (can be expensive)."
4491 #: ../src/guestfs-actions.pod:286 ../fish/guestfish-actions.pod:220
4492 msgid "C<AUG_NO_STDINC> = 8"
4496 #: ../src/guestfs-actions.pod:288 ../fish/guestfish-actions.pod:222
4497 msgid "Do not use standard load path for modules."
4501 #: ../src/guestfs-actions.pod:290 ../fish/guestfish-actions.pod:224
4502 msgid "C<AUG_SAVE_NOOP> = 16"
4506 #: ../src/guestfs-actions.pod:292 ../fish/guestfish-actions.pod:226
4507 msgid "Make save a no-op, just record what would have been changed."
4511 #: ../src/guestfs-actions.pod:294 ../fish/guestfish-actions.pod:228
4512 msgid "C<AUG_NO_LOAD> = 32"
4516 #: ../src/guestfs-actions.pod:296
4517 msgid "Do not load the tree in C<guestfs_aug_init>."
4521 #: ../src/guestfs-actions.pod:300
4522 msgid "To close the handle, you can call C<guestfs_aug_close>."
4526 #: ../src/guestfs-actions.pod:302 ../fish/guestfish-actions.pod:236
4527 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4531 #: ../src/guestfs-actions.pod:306
4532 msgid "guestfs_aug_insert"
4536 #: ../src/guestfs-actions.pod:308
4539 " int guestfs_aug_insert (guestfs_h *g,\n"
4540 "\t\tconst char *augpath,\n"
4541 "\t\tconst char *label,\n"
4542 "\t\tint before);\n"
4547 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:242
4549 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4550 "or after C<path> (depending on the boolean flag C<before>)."
4554 #: ../src/guestfs-actions.pod:317 ../fish/guestfish-actions.pod:246
4556 "C<path> must match exactly one existing node in the tree, and C<label> must "
4557 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4561 #: ../src/guestfs-actions.pod:323
4562 msgid "guestfs_aug_load"
4566 #: ../src/guestfs-actions.pod:325
4569 " int guestfs_aug_load (guestfs_h *g);\n"
4574 #: ../src/guestfs-actions.pod:327 ../fish/guestfish-actions.pod:254
4575 msgid "Load files into the tree."
4579 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:256
4580 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4584 #: ../src/guestfs-actions.pod:334
4585 msgid "guestfs_aug_ls"
4589 #: ../src/guestfs-actions.pod:336
4592 " char **guestfs_aug_ls (guestfs_h *g,\n"
4593 "\t\tconst char *augpath);\n"
4598 #: ../src/guestfs-actions.pod:339
4600 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4601 "sorting the resulting nodes into alphabetical order."
4605 #: ../src/guestfs-actions.pod:342 ../src/guestfs-actions.pod:355
4606 #: ../src/guestfs-actions.pod:483 ../src/guestfs-actions.pod:868
4607 #: ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1163
4608 #: ../src/guestfs-actions.pod:1251 ../src/guestfs-actions.pod:1267
4609 #: ../src/guestfs-actions.pod:1498 ../src/guestfs-actions.pod:1832
4610 #: ../src/guestfs-actions.pod:1845 ../src/guestfs-actions.pod:1861
4611 #: ../src/guestfs-actions.pod:1898 ../src/guestfs-actions.pod:1919
4612 #: ../src/guestfs-actions.pod:1981 ../src/guestfs-actions.pod:2021
4613 #: ../src/guestfs-actions.pod:2207 ../src/guestfs-actions.pod:2395
4614 #: ../src/guestfs-actions.pod:2600 ../src/guestfs-actions.pod:2656
4615 #: ../src/guestfs-actions.pod:2740 ../src/guestfs-actions.pod:3086
4616 #: ../src/guestfs-actions.pod:3608 ../src/guestfs-actions.pod:4057
4617 #: ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4272
4618 #: ../src/guestfs-actions.pod:4821 ../src/guestfs-actions.pod:4870
4619 #: ../src/guestfs-actions.pod:4922 ../src/guestfs-actions.pod:5038
4620 #: ../src/guestfs-actions.pod:5059 ../src/guestfs-actions.pod:5459
4621 #: ../src/guestfs-actions.pod:5476 ../src/guestfs-actions.pod:5514
4622 #: ../src/guestfs-actions.pod:5650 ../src/guestfs-actions.pod:5666
4623 #: ../src/guestfs-actions.pod:5739 ../src/guestfs-actions.pod:5755
4624 #: ../src/guestfs-actions.pod:5795 ../src/guestfs-actions.pod:5811
4626 "This function returns a NULL-terminated array of strings (like L<environ(3)"
4627 ">), or NULL if there was an error. I<The caller must free the strings and "
4628 "the array after use>."
4632 #: ../src/guestfs-actions.pod:346
4633 msgid "guestfs_aug_match"
4637 #: ../src/guestfs-actions.pod:348
4640 " char **guestfs_aug_match (guestfs_h *g,\n"
4641 "\t\tconst char *augpath);\n"
4646 #: ../src/guestfs-actions.pod:351 ../fish/guestfish-actions.pod:270
4648 "Returns a list of paths which match the path expression C<path>. The "
4649 "returned paths are sufficiently qualified so that they match exactly one "
4650 "node in the current tree."
4654 #: ../src/guestfs-actions.pod:359
4655 msgid "guestfs_aug_mv"
4659 #: ../src/guestfs-actions.pod:361
4662 " int guestfs_aug_mv (guestfs_h *g,\n"
4663 "\t\tconst char *src,\n"
4664 "\t\tconst char *dest);\n"
4669 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:278
4671 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4672 "C<dest> is overwritten if it exists."
4676 #: ../src/guestfs-actions.pod:370
4677 msgid "guestfs_aug_rm"
4681 #: ../src/guestfs-actions.pod:372
4684 " int guestfs_aug_rm (guestfs_h *g,\n"
4685 "\t\tconst char *augpath);\n"
4690 #: ../src/guestfs-actions.pod:375 ../fish/guestfish-actions.pod:285
4691 msgid "Remove C<path> and all of its children."
4695 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:287
4696 msgid "On success this returns the number of entries which were removed."
4700 #: ../src/guestfs-actions.pod:381
4701 msgid "guestfs_aug_save"
4705 #: ../src/guestfs-actions.pod:383
4708 " int guestfs_aug_save (guestfs_h *g);\n"
4713 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:293
4714 msgid "This writes all pending changes to disk."
4718 #: ../src/guestfs-actions.pod:387
4720 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4725 #: ../src/guestfs-actions.pod:392
4726 msgid "guestfs_aug_set"
4730 #: ../src/guestfs-actions.pod:394
4733 " int guestfs_aug_set (guestfs_h *g,\n"
4734 "\t\tconst char *augpath,\n"
4735 "\t\tconst char *val);\n"
4740 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:302
4741 msgid "Set the value associated with C<path> to C<val>."
4745 #: ../src/guestfs-actions.pod:400
4747 "In the Augeas API, it is possible to clear a node by setting the value to "
4748 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4749 "this call. Instead you must use the C<guestfs_aug_clear> call."
4753 #: ../src/guestfs-actions.pod:407
4754 msgid "guestfs_available"
4758 #: ../src/guestfs-actions.pod:409
4761 " int guestfs_available (guestfs_h *g,\n"
4762 "\t\tchar *const *groups);\n"
4767 #: ../src/guestfs-actions.pod:412 ../fish/guestfish-actions.pod:313
4769 "This command is used to check the availability of some groups of "
4770 "functionality in the appliance, which not all builds of the libguestfs "
4771 "appliance will be able to provide."
4775 #: ../src/guestfs-actions.pod:416
4777 "The libguestfs groups, and the functions that those groups correspond to, "
4778 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4779 "runtime by calling C<guestfs_available_all_groups>."
4783 #: ../src/guestfs-actions.pod:421 ../fish/guestfish-actions.pod:322
4785 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
4786 "\"]> would check for the availability of the Linux inotify functions and "
4787 "Augeas (configuration file editing) functions."
4791 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:327
4792 msgid "The command returns no error if I<all> requested groups are available."
4796 #: ../src/guestfs-actions.pod:428 ../fish/guestfish-actions.pod:329
4798 "It fails with an error if one or more of the requested groups is unavailable "
4803 #: ../src/guestfs-actions.pod:431 ../fish/guestfish-actions.pod:332
4805 "If an unknown group name is included in the list of groups then an error is "
4810 #: ../src/guestfs-actions.pod:434 ../fish/guestfish-actions.pod:335
4815 #: ../src/guestfs-actions.pod:440
4816 msgid "You must call C<guestfs_launch> before calling this function."
4820 #: ../src/guestfs-actions.pod:442 ../fish/guestfish-actions.pod:343
4822 "The reason is because we don't know what groups are supported by the "
4823 "appliance/daemon until it is running and can be queried."
4827 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:349
4829 "If a group of functions is available, this does not necessarily mean that "
4830 "they will work. You still have to check for errors when calling individual "
4831 "API functions even if they are available."
4835 #: ../src/guestfs-actions.pod:455 ../fish/guestfish-actions.pod:356
4837 "It is usually the job of distro packagers to build complete functionality "
4838 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4839 "with all requirements satisfied, will support everything."
4843 #: ../src/guestfs-actions.pod:462
4845 "This call was added in version C<1.0.80>. In previous versions of "
4846 "libguestfs all you could do would be to speculatively execute a command to "
4847 "find out if the daemon implemented it. See also C<guestfs_version>."
4851 #: ../src/guestfs-actions.pod:471
4852 msgid "guestfs_available_all_groups"
4856 #: ../src/guestfs-actions.pod:473
4859 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4864 #: ../src/guestfs-actions.pod:475
4866 "This command returns a list of all optional groups that this daemon knows "
4867 "about. Note this returns both supported and unsupported groups. To find "
4868 "out which ones the daemon can actually support you have to call "
4869 "C<guestfs_available> on each member of the returned list."
4873 #: ../src/guestfs-actions.pod:481
4874 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4878 #: ../src/guestfs-actions.pod:487
4879 msgid "guestfs_base64_in"
4883 #: ../src/guestfs-actions.pod:489
4886 " int guestfs_base64_in (guestfs_h *g,\n"
4887 "\t\tconst char *base64file,\n"
4888 "\t\tconst char *filename);\n"
4893 #: ../src/guestfs-actions.pod:493 ../fish/guestfish-actions.pod:386
4895 "This command uploads base64-encoded data from C<base64file> to C<filename>."
4899 #: ../src/guestfs-actions.pod:498
4900 msgid "guestfs_base64_out"
4904 #: ../src/guestfs-actions.pod:500
4907 " int guestfs_base64_out (guestfs_h *g,\n"
4908 "\t\tconst char *filename,\n"
4909 "\t\tconst char *base64file);\n"
4914 #: ../src/guestfs-actions.pod:504 ../fish/guestfish-actions.pod:395
4916 "This command downloads the contents of C<filename>, writing it out to local "
4917 "file C<base64file> encoded as base64."
4921 #: ../src/guestfs-actions.pod:509
4922 msgid "guestfs_blockdev_flushbufs"
4926 #: ../src/guestfs-actions.pod:511
4929 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4930 "\t\tconst char *device);\n"
4935 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:404
4937 "This tells the kernel to flush internal buffers associated with C<device>."
4941 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:531
4942 #: ../src/guestfs-actions.pod:543 ../src/guestfs-actions.pod:556
4943 #: ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:587
4944 #: ../src/guestfs-actions.pod:598 ../src/guestfs-actions.pod:613
4945 #: ../src/guestfs-actions.pod:624 ../src/guestfs-actions.pod:635
4946 #: ../fish/guestfish-actions.pod:407 ../fish/guestfish-actions.pod:418
4947 #: ../fish/guestfish-actions.pod:427 ../fish/guestfish-actions.pod:437
4948 #: ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:462
4949 #: ../fish/guestfish-actions.pod:470 ../fish/guestfish-actions.pod:481
4950 #: ../fish/guestfish-actions.pod:489 ../fish/guestfish-actions.pod:497
4951 msgid "This uses the L<blockdev(8)> command."
4955 #: ../src/guestfs-actions.pod:521
4956 msgid "guestfs_blockdev_getbsz"
4960 #: ../src/guestfs-actions.pod:523
4963 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4964 "\t\tconst char *device);\n"
4969 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:413
4970 msgid "This returns the block size of a device."
4974 #: ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:610
4975 #: ../fish/guestfish-actions.pod:415 ../fish/guestfish-actions.pod:478
4977 "(Note this is different from both I<size in blocks> and I<filesystem block "
4982 #: ../src/guestfs-actions.pod:535
4983 msgid "guestfs_blockdev_getro"
4987 #: ../src/guestfs-actions.pod:537
4990 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4991 "\t\tconst char *device);\n"
4996 #: ../src/guestfs-actions.pod:540 ../fish/guestfish-actions.pod:424
4998 "Returns a boolean indicating if the block device is read-only (true if read-"
4999 "only, false if not)."
5003 #: ../src/guestfs-actions.pod:545 ../src/guestfs-actions.pod:1181
5004 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:1625
5005 #: ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1693
5006 #: ../src/guestfs-actions.pod:1736 ../src/guestfs-actions.pod:1748
5007 #: ../src/guestfs-actions.pod:1767 ../src/guestfs-actions.pod:1784
5008 #: ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2420
5009 #: ../src/guestfs-actions.pod:2432 ../src/guestfs-actions.pod:2443
5010 #: ../src/guestfs-actions.pod:2456 ../src/guestfs-actions.pod:2468
5011 #: ../src/guestfs-actions.pod:2481 ../src/guestfs-actions.pod:2492
5012 #: ../src/guestfs-actions.pod:2502 ../src/guestfs-actions.pod:2513
5013 #: ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:2537
5014 #: ../src/guestfs-actions.pod:3733
5015 msgid "This function returns a C truth value on success or -1 on error."
5019 #: ../src/guestfs-actions.pod:547
5020 msgid "guestfs_blockdev_getsize64"
5024 #: ../src/guestfs-actions.pod:549
5027 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5028 "\t\tconst char *device);\n"
5033 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:433
5034 msgid "This returns the size of the device in bytes."
5038 #: ../src/guestfs-actions.pod:554
5039 msgid "See also C<guestfs_blockdev_getsz>."
5043 #: ../src/guestfs-actions.pod:560
5044 msgid "guestfs_blockdev_getss"
5048 #: ../src/guestfs-actions.pod:562
5051 " int guestfs_blockdev_getss (guestfs_h *g,\n"
5052 "\t\tconst char *device);\n"
5057 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:443
5059 "This returns the size of sectors on a block device. Usually 512, but can be "
5060 "larger for modern devices."
5064 #: ../src/guestfs-actions.pod:568
5066 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5071 #: ../src/guestfs-actions.pod:575
5072 msgid "guestfs_blockdev_getsz"
5076 #: ../src/guestfs-actions.pod:577
5079 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
5080 "\t\tconst char *device);\n"
5085 #: ../src/guestfs-actions.pod:580 ../fish/guestfish-actions.pod:455
5087 "This returns the size of the device in units of 512-byte sectors (even if "
5088 "the sectorsize isn't 512 bytes ... weird)."
5092 #: ../src/guestfs-actions.pod:583
5094 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5095 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5099 #: ../src/guestfs-actions.pod:591
5100 msgid "guestfs_blockdev_rereadpt"
5104 #: ../src/guestfs-actions.pod:593
5107 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5108 "\t\tconst char *device);\n"
5113 #: ../src/guestfs-actions.pod:596 ../fish/guestfish-actions.pod:468
5114 msgid "Reread the partition table on C<device>."
5118 #: ../src/guestfs-actions.pod:602
5119 msgid "guestfs_blockdev_setbsz"
5123 #: ../src/guestfs-actions.pod:604
5126 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
5127 "\t\tconst char *device,\n"
5128 "\t\tint blocksize);\n"
5133 #: ../src/guestfs-actions.pod:608 ../fish/guestfish-actions.pod:476
5134 msgid "This sets the block size of a device."
5138 #: ../src/guestfs-actions.pod:617
5139 msgid "guestfs_blockdev_setro"
5143 #: ../src/guestfs-actions.pod:619
5146 " int guestfs_blockdev_setro (guestfs_h *g,\n"
5147 "\t\tconst char *device);\n"
5152 #: ../src/guestfs-actions.pod:622 ../fish/guestfish-actions.pod:487
5153 msgid "Sets the block device named C<device> to read-only."
5157 #: ../src/guestfs-actions.pod:628
5158 msgid "guestfs_blockdev_setrw"
5162 #: ../src/guestfs-actions.pod:630
5165 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
5166 "\t\tconst char *device);\n"
5171 #: ../src/guestfs-actions.pod:633 ../fish/guestfish-actions.pod:495
5172 msgid "Sets the block device named C<device> to read-write."
5176 #: ../src/guestfs-actions.pod:639
5177 msgid "guestfs_case_sensitive_path"
5181 #: ../src/guestfs-actions.pod:641
5184 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
5185 "\t\tconst char *path);\n"
5190 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:503
5192 "This can be used to resolve case insensitive paths on a filesystem which is "
5193 "case sensitive. The use case is to resolve paths which you have read from "
5194 "Windows configuration files or the Windows Registry, to the true path."
5198 #: ../src/guestfs-actions.pod:649 ../fish/guestfish-actions.pod:508
5200 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5201 "(and probably others), which is that although the underlying filesystem is "
5202 "case-insensitive, the driver exports the filesystem to Linux as case-"
5207 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:513
5209 "One consequence of this is that special directories such as C<c:\\windows> "
5210 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5211 "precise details of how they were created. In Windows itself this would not "
5216 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:519
5218 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5223 #: ../src/guestfs-actions.pod:663 ../fish/guestfish-actions.pod:522
5225 "This function resolves the true case of each element in the path and returns "
5226 "the case-sensitive path."
5230 #: ../src/guestfs-actions.pod:666
5232 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5233 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5234 "how the directories were originally created under Windows)."
5238 #: ../src/guestfs-actions.pod:671 ../fish/guestfish-actions.pod:530
5239 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5243 #: ../src/guestfs-actions.pod:674
5244 msgid "See also C<guestfs_realpath>."
5248 #: ../src/guestfs-actions.pod:679
5253 #: ../src/guestfs-actions.pod:681
5256 " char *guestfs_cat (guestfs_h *g,\n"
5257 "\t\tconst char *path);\n"
5262 #: ../src/guestfs-actions.pod:684 ../src/guestfs-actions.pod:4156
5263 #: ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:3197
5264 msgid "Return the contents of the file named C<path>."
5268 #: ../src/guestfs-actions.pod:686
5270 "Note that this function cannot correctly handle binary files (specifically, "
5271 "files containing C<\\0> character which is treated as end of string). For "
5272 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5273 "functions which have a more complex interface."
5277 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:855
5278 #: ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1151
5279 #: ../src/guestfs-actions.pod:1167 ../src/guestfs-actions.pod:1255
5280 #: ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:1502
5281 #: ../src/guestfs-actions.pod:1849 ../src/guestfs-actions.pod:1865
5282 #: ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1923
5283 #: ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:1963
5284 #: ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:3996
5285 #: ../src/guestfs-actions.pod:4104 ../src/guestfs-actions.pod:4127
5286 #: ../src/guestfs-actions.pod:4148 ../src/guestfs-actions.pod:4874
5287 #: ../src/guestfs-actions.pod:4926 ../src/guestfs-actions.pod:5042
5288 #: ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5608
5289 #: ../src/guestfs-actions.pod:5631 ../src/guestfs-actions.pod:5654
5290 #: ../src/guestfs-actions.pod:5670 ../src/guestfs-actions.pod:5743
5291 #: ../src/guestfs-actions.pod:5759 ../src/guestfs-actions.pod:5799
5292 #: ../src/guestfs-actions.pod:5815 ../fish/guestfish-actions.pod:546
5293 #: ../fish/guestfish-actions.pod:681 ../fish/guestfish-actions.pod:693
5294 #: ../fish/guestfish-actions.pod:894 ../fish/guestfish-actions.pod:904
5295 #: ../fish/guestfish-actions.pod:971 ../fish/guestfish-actions.pod:981
5296 #: ../fish/guestfish-actions.pod:1176 ../fish/guestfish-actions.pod:1451
5297 #: ../fish/guestfish-actions.pod:1461 ../fish/guestfish-actions.pod:1489
5298 #: ../fish/guestfish-actions.pod:1504 ../fish/guestfish-actions.pod:1514
5299 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:3067
5300 #: ../fish/guestfish-actions.pod:3082 ../fish/guestfish-actions.pod:3158
5301 #: ../fish/guestfish-actions.pod:3175 ../fish/guestfish-actions.pod:3190
5302 #: ../fish/guestfish-actions.pod:3773 ../fish/guestfish-actions.pod:3819
5303 #: ../fish/guestfish-actions.pod:3904 ../fish/guestfish-actions.pod:3919
5304 #: ../fish/guestfish-actions.pod:4329 ../fish/guestfish-actions.pod:4347
5305 #: ../fish/guestfish-actions.pod:4364 ../fish/guestfish-actions.pod:4374
5306 #: ../fish/guestfish-actions.pod:4422 ../fish/guestfish-actions.pod:4432
5307 #: ../fish/guestfish-actions.pod:4461 ../fish/guestfish-actions.pod:4471
5309 "Because of the message protocol, there is a transfer limit of somewhere "
5310 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5314 #: ../src/guestfs-actions.pod:697
5315 msgid "guestfs_checksum"
5319 #: ../src/guestfs-actions.pod:699
5322 " char *guestfs_checksum (guestfs_h *g,\n"
5323 "\t\tconst char *csumtype,\n"
5324 "\t\tconst char *path);\n"
5329 #: ../src/guestfs-actions.pod:703 ../fish/guestfish-actions.pod:553
5331 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5335 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:556
5337 "The type of checksum to compute is given by the C<csumtype> parameter which "
5338 "must have one of the following values:"
5342 #: ../src/guestfs-actions.pod:711 ../fish/guestfish-actions.pod:561
5347 #: ../src/guestfs-actions.pod:713 ../fish/guestfish-actions.pod:563
5349 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5354 #: ../src/guestfs-actions.pod:716 ../fish/guestfish-actions.pod:566
5359 #: ../src/guestfs-actions.pod:718 ../fish/guestfish-actions.pod:568
5360 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5364 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:570
5369 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:572
5370 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5374 #: ../src/guestfs-actions.pod:724 ../fish/guestfish-actions.pod:574
5379 #: ../src/guestfs-actions.pod:726 ../fish/guestfish-actions.pod:576
5380 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5384 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:578
5389 #: ../src/guestfs-actions.pod:730 ../fish/guestfish-actions.pod:580
5390 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5394 #: ../src/guestfs-actions.pod:732 ../fish/guestfish-actions.pod:582
5399 #: ../src/guestfs-actions.pod:734 ../fish/guestfish-actions.pod:584
5400 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5404 #: ../src/guestfs-actions.pod:736 ../fish/guestfish-actions.pod:586
5409 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:588
5410 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5414 #: ../src/guestfs-actions.pod:742 ../fish/guestfish-actions.pod:592
5415 msgid "The checksum is returned as a printable string."
5419 #: ../src/guestfs-actions.pod:744
5420 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
5424 #: ../src/guestfs-actions.pod:746
5425 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
5429 #: ../src/guestfs-actions.pod:751
5430 msgid "guestfs_checksum_device"
5434 #: ../src/guestfs-actions.pod:753
5437 " char *guestfs_checksum_device (guestfs_h *g,\n"
5438 "\t\tconst char *csumtype,\n"
5439 "\t\tconst char *device);\n"
5444 #: ../src/guestfs-actions.pod:757
5446 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5447 "device named C<device>. For the types of checksums supported see the "
5448 "C<guestfs_checksum> command."
5452 #: ../src/guestfs-actions.pod:764
5453 msgid "guestfs_checksums_out"
5457 #: ../src/guestfs-actions.pod:766
5460 " int guestfs_checksums_out (guestfs_h *g,\n"
5461 "\t\tconst char *csumtype,\n"
5462 "\t\tconst char *directory,\n"
5463 "\t\tconst char *sumsfile);\n"
5468 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:610
5470 "This command computes the checksums of all regular files in C<directory> and "
5471 "then emits a list of those checksums to the local output file C<sumsfile>."
5475 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:614
5477 "This can be used for verifying the integrity of a virtual machine. However "
5478 "to be properly secure you should pay attention to the output of the checksum "
5479 "command (it uses the ones from GNU coreutils). In particular when the "
5480 "filename is not printable, coreutils uses a special backslash syntax. For "
5481 "more information, see the GNU coreutils info file."
5485 #: ../src/guestfs-actions.pod:785
5486 msgid "guestfs_chmod"
5490 #: ../src/guestfs-actions.pod:787
5493 " int guestfs_chmod (guestfs_h *g,\n"
5495 "\t\tconst char *path);\n"
5500 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:628
5502 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5507 #: ../src/guestfs-actions.pod:794 ../fish/guestfish-actions.pod:631
5509 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5510 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5515 #: ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:3301
5516 #: ../src/guestfs-actions.pod:3404 ../src/guestfs-actions.pod:3420
5517 #: ../src/guestfs-actions.pod:3436 ../fish/guestfish-actions.pod:635
5518 #: ../fish/guestfish-actions.pod:2557 ../fish/guestfish-actions.pod:2642
5519 #: ../fish/guestfish-actions.pod:2652 ../fish/guestfish-actions.pod:2662
5520 msgid "The mode actually set is affected by the umask."
5524 #: ../src/guestfs-actions.pod:802
5525 msgid "guestfs_chown"
5529 #: ../src/guestfs-actions.pod:804
5532 " int guestfs_chown (guestfs_h *g,\n"
5535 "\t\tconst char *path);\n"
5540 #: ../src/guestfs-actions.pod:809 ../fish/guestfish-actions.pod:641
5541 msgid "Change the file owner to C<owner> and group to C<group>."
5545 #: ../src/guestfs-actions.pod:811 ../src/guestfs-actions.pod:2570
5546 #: ../fish/guestfish-actions.pod:643 ../fish/guestfish-actions.pod:2035
5548 "Only numeric uid and gid are supported. If you want to use names, you will "
5549 "need to locate and parse the password file yourself (Augeas support makes "
5550 "this relatively easy)."
5554 #: ../src/guestfs-actions.pod:817
5555 msgid "guestfs_command"
5559 #: ../src/guestfs-actions.pod:819
5562 " char *guestfs_command (guestfs_h *g,\n"
5563 "\t\tchar *const *arguments);\n"
5568 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:651
5570 "This call runs a command from the guest filesystem. The filesystem must be "
5571 "mounted, and must contain a compatible operating system (ie. something "
5572 "Linux, with the same or compatible processor architecture)."
5576 #: ../src/guestfs-actions.pod:827
5578 "The single parameter is an argv-style list of arguments. The first element "
5579 "is the name of the program to run. Subsequent elements are parameters. The "
5580 "list must be non-empty (ie. must contain a program name). Note that the "
5581 "command runs directly, and is I<not> invoked via the shell (see "
5586 #: ../src/guestfs-actions.pod:834 ../fish/guestfish-actions.pod:663
5587 msgid "The return value is anything printed to I<stdout> by the command."
5591 #: ../src/guestfs-actions.pod:837 ../fish/guestfish-actions.pod:666
5593 "If the command returns a non-zero exit status, then this function returns an "
5594 "error message. The error message string is the content of I<stderr> from "
5599 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:670
5601 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5602 "bin>. If you require a program from another location, you should provide "
5603 "the full path in the first parameter."
5607 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:675
5609 "Shared libraries and data files required by the program must be available on "
5610 "filesystems which are mounted in the correct places. It is the caller's "
5611 "responsibility to ensure all filesystems that are needed are mounted at the "
5616 #: ../src/guestfs-actions.pod:858
5617 msgid "guestfs_command_lines"
5621 #: ../src/guestfs-actions.pod:860
5624 " char **guestfs_command_lines (guestfs_h *g,\n"
5625 "\t\tchar *const *arguments);\n"
5630 #: ../src/guestfs-actions.pod:863
5632 "This is the same as C<guestfs_command>, but splits the result into a list of "
5637 #: ../src/guestfs-actions.pod:866
5638 msgid "See also: C<guestfs_sh_lines>"
5642 #: ../src/guestfs-actions.pod:875
5643 msgid "guestfs_config"
5647 #: ../src/guestfs-actions.pod:877
5650 " int guestfs_config (guestfs_h *g,\n"
5651 "\t\tconst char *qemuparam,\n"
5652 "\t\tconst char *qemuvalue);\n"
5657 #: ../src/guestfs-actions.pod:881 ../fish/guestfish-actions.pod:700
5659 "This can be used to add arbitrary qemu command line parameters of the form "
5660 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
5661 "setting some parameters which would interfere with parameters that we use."
5665 #: ../src/guestfs-actions.pod:886 ../fish/guestfish-actions.pod:705
5666 msgid "The first character of C<param> string must be a C<-> (dash)."
5670 #: ../src/guestfs-actions.pod:888 ../fish/guestfish-actions.pod:707
5671 msgid "C<value> can be NULL."
5675 #: ../src/guestfs-actions.pod:892
5676 msgid "guestfs_copy_size"
5680 #: ../src/guestfs-actions.pod:894
5683 " int guestfs_copy_size (guestfs_h *g,\n"
5684 "\t\tconst char *src,\n"
5685 "\t\tconst char *dest,\n"
5686 "\t\tint64_t size);\n"
5691 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:713
5693 "This command copies exactly C<size> bytes from one source device or file "
5694 "C<src> to another destination device or file C<dest>."
5698 #: ../src/guestfs-actions.pod:902 ../fish/guestfish-actions.pod:716
5700 "Note this will fail if the source is too short or if the destination is not "
5705 #: ../src/guestfs-actions.pod:907 ../src/guestfs-actions.pod:1042
5706 #: ../src/guestfs-actions.pod:1070 ../src/guestfs-actions.pod:1442
5707 #: ../src/guestfs-actions.pod:1461 ../src/guestfs-actions.pod:5688
5708 #: ../src/guestfs-actions.pod:5704
5710 "This long-running command can generate progress notification messages so "
5711 "that the caller can display a progress bar or indicator. To receive these "
5712 "messages, the caller must register a progress callback. See L<guestfs(3)/"
5713 "guestfs_set_progress_callback>."
5717 #: ../src/guestfs-actions.pod:912
5722 #: ../src/guestfs-actions.pod:914
5725 " int guestfs_cp (guestfs_h *g,\n"
5726 "\t\tconst char *src,\n"
5727 "\t\tconst char *dest);\n"
5732 #: ../src/guestfs-actions.pod:918 ../fish/guestfish-actions.pod:723
5734 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5735 "destination filename or destination directory."
5739 #: ../src/guestfs-actions.pod:923
5740 msgid "guestfs_cp_a"
5744 #: ../src/guestfs-actions.pod:925
5747 " int guestfs_cp_a (guestfs_h *g,\n"
5748 "\t\tconst char *src,\n"
5749 "\t\tconst char *dest);\n"
5754 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:730
5756 "This copies a file or directory from C<src> to C<dest> recursively using the "
5761 #: ../src/guestfs-actions.pod:934
5766 #: ../src/guestfs-actions.pod:936
5769 " int guestfs_dd (guestfs_h *g,\n"
5770 "\t\tconst char *src,\n"
5771 "\t\tconst char *dest);\n"
5776 #: ../src/guestfs-actions.pod:940 ../fish/guestfish-actions.pod:737
5778 "This command copies from one source device or file C<src> to another "
5779 "destination device or file C<dest>. Normally you would use this to copy to "
5780 "or from a device or partition, for example to duplicate a filesystem."
5784 #: ../src/guestfs-actions.pod:945
5786 "If the destination is a device, it must be as large or larger than the "
5787 "source file or device, otherwise the copy will fail. This command cannot do "
5788 "partial copies (see C<guestfs_copy_size>)."
5792 #: ../src/guestfs-actions.pod:951
5793 msgid "guestfs_debug"
5797 #: ../src/guestfs-actions.pod:953
5800 " char *guestfs_debug (guestfs_h *g,\n"
5801 "\t\tconst char *subcmd,\n"
5802 "\t\tchar *const *extraargs);\n"
5807 #: ../src/guestfs-actions.pod:957
5809 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5810 "guestfs daemon) that runs inside the qemu subprocess."
5814 #: ../src/guestfs-actions.pod:961 ../fish/guestfish-actions.pod:754
5816 "There is no comprehensive help for this command. You have to look at the "
5817 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5821 #: ../src/guestfs-actions.pod:968
5822 msgid "guestfs_debug_upload"
5826 #: ../src/guestfs-actions.pod:970
5829 " int guestfs_debug_upload (guestfs_h *g,\n"
5830 "\t\tconst char *filename,\n"
5831 "\t\tconst char *tmpname,\n"
5837 #: ../src/guestfs-actions.pod:975
5839 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5844 #: ../src/guestfs-actions.pod:978 ../fish/guestfish-actions.pod:765
5846 "There is no comprehensive help for this command. You have to look at the "
5847 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5851 #: ../src/guestfs-actions.pod:984
5856 #: ../src/guestfs-actions.pod:986
5859 " char *guestfs_df (guestfs_h *g);\n"
5864 #: ../src/guestfs-actions.pod:988 ../fish/guestfish-actions.pod:775
5865 msgid "This command runs the C<df> command to report disk space used."
5869 #: ../src/guestfs-actions.pod:990 ../src/guestfs-actions.pod:1004
5870 #: ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:788
5872 "This command is mostly useful for interactive sessions. It is I<not> "
5873 "intended that you try to parse the output string. Use C<statvfs> from "
5878 #: ../src/guestfs-actions.pod:997
5879 msgid "guestfs_df_h"
5883 #: ../src/guestfs-actions.pod:999
5886 " char *guestfs_df_h (guestfs_h *g);\n"
5891 #: ../src/guestfs-actions.pod:1001 ../fish/guestfish-actions.pod:785
5893 "This command runs the C<df -h> command to report disk space used in human-"
5898 #: ../src/guestfs-actions.pod:1011
5899 msgid "guestfs_dmesg"
5903 #: ../src/guestfs-actions.pod:1013
5906 " char *guestfs_dmesg (guestfs_h *g);\n"
5911 #: ../src/guestfs-actions.pod:1015 ../fish/guestfish-actions.pod:796
5913 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5914 "This is sometimes useful for extended debugging of problems."
5918 #: ../src/guestfs-actions.pod:1019
5920 "Another way to get the same information is to enable verbose messages with "
5921 "C<guestfs_set_verbose> or by setting the environment variable "
5922 "C<LIBGUESTFS_DEBUG=1> before running the program."
5926 #: ../src/guestfs-actions.pod:1027
5927 msgid "guestfs_download"
5931 #: ../src/guestfs-actions.pod:1029
5934 " int guestfs_download (guestfs_h *g,\n"
5935 "\t\tconst char *remotefilename,\n"
5936 "\t\tconst char *filename);\n"
5941 #: ../src/guestfs-actions.pod:1033 ../src/guestfs-actions.pod:1055
5942 #: ../fish/guestfish-actions.pod:809 ../fish/guestfish-actions.pod:822
5944 "Download file C<remotefilename> and save it as C<filename> on the local "
5949 #: ../src/guestfs-actions.pod:1036 ../src/guestfs-actions.pod:5256
5950 #: ../fish/guestfish-actions.pod:812 ../fish/guestfish-actions.pod:4077
5951 msgid "C<filename> can also be a named pipe."
5955 #: ../src/guestfs-actions.pod:1038
5956 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5960 #: ../src/guestfs-actions.pod:1047
5961 msgid "guestfs_download_offset"
5965 #: ../src/guestfs-actions.pod:1049
5968 " int guestfs_download_offset (guestfs_h *g,\n"
5969 "\t\tconst char *remotefilename,\n"
5970 "\t\tconst char *filename,\n"
5971 "\t\tint64_t offset,\n"
5972 "\t\tint64_t size);\n"
5977 #: ../src/guestfs-actions.pod:1058 ../fish/guestfish-actions.pod:825
5979 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5980 "region must be within the file or device)."
5984 #: ../src/guestfs-actions.pod:1061
5986 "Note that there is no limit on the amount of data that can be downloaded "
5987 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
5988 "full amount unless an error occurs."
5992 #: ../src/guestfs-actions.pod:1066
5993 msgid "See also C<guestfs_download>, C<guestfs_pread>."
5997 #: ../src/guestfs-actions.pod:1075
5998 msgid "guestfs_drop_caches"
6002 #: ../src/guestfs-actions.pod:1077
6005 " int guestfs_drop_caches (guestfs_h *g,\n"
6006 "\t\tint whattodrop);\n"
6011 #: ../src/guestfs-actions.pod:1080 ../fish/guestfish-actions.pod:841
6013 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6014 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6015 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6019 #: ../src/guestfs-actions.pod:1085 ../fish/guestfish-actions.pod:846
6020 msgid "Setting C<whattodrop> to 3 should drop everything."
6024 #: ../src/guestfs-actions.pod:1087 ../fish/guestfish-actions.pod:848
6026 "This automatically calls L<sync(2)> before the operation, so that the "
6027 "maximum guest memory is freed."
6031 #: ../src/guestfs-actions.pod:1092
6036 #: ../src/guestfs-actions.pod:1094
6039 " int64_t guestfs_du (guestfs_h *g,\n"
6040 "\t\tconst char *path);\n"
6045 #: ../src/guestfs-actions.pod:1097 ../fish/guestfish-actions.pod:855
6047 "This command runs the C<du -s> command to estimate file space usage for "
6052 #: ../src/guestfs-actions.pod:1100 ../fish/guestfish-actions.pod:858
6054 "C<path> can be a file or a directory. If C<path> is a directory then the "
6055 "estimate includes the contents of the directory and all subdirectories "
6060 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:862
6062 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6066 #: ../src/guestfs-actions.pod:1109
6067 msgid "guestfs_e2fsck_f"
6071 #: ../src/guestfs-actions.pod:1111
6074 " int guestfs_e2fsck_f (guestfs_h *g,\n"
6075 "\t\tconst char *device);\n"
6080 #: ../src/guestfs-actions.pod:1114 ../fish/guestfish-actions.pod:869
6082 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6083 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6088 #: ../src/guestfs-actions.pod:1118
6090 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6091 "Normally you should use C<guestfs_fsck>."
6095 #: ../src/guestfs-actions.pod:1123
6096 msgid "guestfs_echo_daemon"
6100 #: ../src/guestfs-actions.pod:1125
6103 " char *guestfs_echo_daemon (guestfs_h *g,\n"
6104 "\t\tchar *const *words);\n"
6109 #: ../src/guestfs-actions.pod:1128 ../fish/guestfish-actions.pod:880
6111 "This command concatenates the list of C<words> passed with single spaces "
6112 "between them and returns the resulting string."
6116 #: ../src/guestfs-actions.pod:1131 ../fish/guestfish-actions.pod:883
6117 msgid "You can use this command to test the connection through to the daemon."
6121 #: ../src/guestfs-actions.pod:1133
6122 msgid "See also C<guestfs_ping_daemon>."
6126 #: ../src/guestfs-actions.pod:1138
6127 msgid "guestfs_egrep"
6131 #: ../src/guestfs-actions.pod:1140
6134 " char **guestfs_egrep (guestfs_h *g,\n"
6135 "\t\tconst char *regex,\n"
6136 "\t\tconst char *path);\n"
6141 #: ../src/guestfs-actions.pod:1144 ../fish/guestfish-actions.pod:891
6143 "This calls the external C<egrep> program and returns the matching lines."
6147 #: ../src/guestfs-actions.pod:1154
6148 msgid "guestfs_egrepi"
6152 #: ../src/guestfs-actions.pod:1156
6155 " char **guestfs_egrepi (guestfs_h *g,\n"
6156 "\t\tconst char *regex,\n"
6157 "\t\tconst char *path);\n"
6162 #: ../src/guestfs-actions.pod:1160 ../fish/guestfish-actions.pod:901
6164 "This calls the external C<egrep -i> program and returns the matching lines."
6168 #: ../src/guestfs-actions.pod:1170
6169 msgid "guestfs_equal"
6173 #: ../src/guestfs-actions.pod:1172
6176 " int guestfs_equal (guestfs_h *g,\n"
6177 "\t\tconst char *file1,\n"
6178 "\t\tconst char *file2);\n"
6183 #: ../src/guestfs-actions.pod:1176 ../fish/guestfish-actions.pod:911
6185 "This compares the two files C<file1> and C<file2> and returns true if their "
6186 "content is exactly equal, or false otherwise."
6190 #: ../src/guestfs-actions.pod:1179 ../fish/guestfish-actions.pod:914
6191 msgid "The external L<cmp(1)> program is used for the comparison."
6195 #: ../src/guestfs-actions.pod:1183
6196 msgid "guestfs_exists"
6200 #: ../src/guestfs-actions.pod:1185
6203 " int guestfs_exists (guestfs_h *g,\n"
6204 "\t\tconst char *path);\n"
6209 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:920
6211 "This returns C<true> if and only if there is a file, directory (or anything) "
6212 "with the given C<path> name."
6216 #: ../src/guestfs-actions.pod:1191
6217 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6221 #: ../src/guestfs-actions.pod:1195
6222 msgid "guestfs_fallocate"
6226 #: ../src/guestfs-actions.pod:1197
6229 " int guestfs_fallocate (guestfs_h *g,\n"
6230 "\t\tconst char *path,\n"
6236 #: ../src/guestfs-actions.pod:1201 ../src/guestfs-actions.pod:1224
6237 #: ../fish/guestfish-actions.pod:929 ../fish/guestfish-actions.pod:948
6239 "This command preallocates a file (containing zero bytes) named C<path> of "
6240 "size C<len> bytes. If the file exists already, it is overwritten."
6244 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:933
6246 "Do not confuse this with the guestfish-specific C<alloc> command which "
6247 "allocates a file in the host and attaches it as a device."
6251 #: ../src/guestfs-actions.pod:1211 ../fish/guestfish-actions.pod:937
6253 "This function is deprecated. In new code, use the C<fallocate64> call "
6258 #: ../src/guestfs-actions.pod:1218
6259 msgid "guestfs_fallocate64"
6263 #: ../src/guestfs-actions.pod:1220
6266 " int guestfs_fallocate64 (guestfs_h *g,\n"
6267 "\t\tconst char *path,\n"
6268 "\t\tint64_t len);\n"
6273 #: ../src/guestfs-actions.pod:1228
6275 "Note that this call allocates disk blocks for the file. To create a sparse "
6276 "file use C<guestfs_truncate_size> instead."
6280 #: ../src/guestfs-actions.pod:1231
6282 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6283 "oversight it only allowed 30 bit lengths to be specified, effectively "
6284 "limiting the maximum size of files created through that call to 1GB."
6288 #: ../src/guestfs-actions.pod:1236 ../fish/guestfish-actions.pod:960
6290 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6291 "commands which create a file in the host and attach it as a device."
6295 #: ../src/guestfs-actions.pod:1242
6296 msgid "guestfs_fgrep"
6300 #: ../src/guestfs-actions.pod:1244
6303 " char **guestfs_fgrep (guestfs_h *g,\n"
6304 "\t\tconst char *pattern,\n"
6305 "\t\tconst char *path);\n"
6310 #: ../src/guestfs-actions.pod:1248 ../fish/guestfish-actions.pod:968
6312 "This calls the external C<fgrep> program and returns the matching lines."
6316 #: ../src/guestfs-actions.pod:1258
6317 msgid "guestfs_fgrepi"
6321 #: ../src/guestfs-actions.pod:1260
6324 " char **guestfs_fgrepi (guestfs_h *g,\n"
6325 "\t\tconst char *pattern,\n"
6326 "\t\tconst char *path);\n"
6331 #: ../src/guestfs-actions.pod:1264 ../fish/guestfish-actions.pod:978
6333 "This calls the external C<fgrep -i> program and returns the matching lines."
6337 #: ../src/guestfs-actions.pod:1274
6338 msgid "guestfs_file"
6342 #: ../src/guestfs-actions.pod:1276
6345 " char *guestfs_file (guestfs_h *g,\n"
6346 "\t\tconst char *path);\n"
6351 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:988
6353 "This call uses the standard L<file(1)> command to determine the type or "
6354 "contents of the file."
6358 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:991
6360 "This call will also transparently look inside various types of compressed "
6365 #: ../src/guestfs-actions.pod:1285 ../fish/guestfish-actions.pod:994
6367 "The exact command which runs is C<file -zb path>. Note in particular that "
6368 "the filename is not prepended to the output (the C<-b> option)."
6372 #: ../src/guestfs-actions.pod:1289
6374 "This command can also be used on C</dev/> devices (and partitions, LV "
6375 "names). You can for example use this to determine if a device contains a "
6376 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
6380 #: ../src/guestfs-actions.pod:1294 ../fish/guestfish-actions.pod:1003
6382 "If the C<path> does not begin with C</dev/> then this command only works for "
6383 "the content of regular files. For other file types (directory, symbolic "
6384 "link etc) it will just return the string C<directory> etc."
6388 #: ../src/guestfs-actions.pod:1302
6389 msgid "guestfs_file_architecture"
6393 #: ../src/guestfs-actions.pod:1304
6396 " char *guestfs_file_architecture (guestfs_h *g,\n"
6397 "\t\tconst char *filename);\n"
6402 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1012
6404 "This detects the architecture of the binary C<filename>, and returns it if "
6409 #: ../src/guestfs-actions.pod:1310 ../fish/guestfish-actions.pod:1015
6410 msgid "Currently defined architectures are:"
6414 #: ../src/guestfs-actions.pod:1314 ../fish/guestfish-actions.pod:1019
6419 #: ../src/guestfs-actions.pod:1316 ../fish/guestfish-actions.pod:1021
6421 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6422 "irrespective of the precise processor requirements of the binary."
6426 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:1024
6431 #: ../src/guestfs-actions.pod:1321 ../fish/guestfish-actions.pod:1026
6432 msgid "64 bit x86-64."
6436 #: ../src/guestfs-actions.pod:1323 ../fish/guestfish-actions.pod:1028
6441 #: ../src/guestfs-actions.pod:1325 ../fish/guestfish-actions.pod:1030
6442 msgid "32 bit SPARC."
6446 #: ../src/guestfs-actions.pod:1327 ../fish/guestfish-actions.pod:1032
6451 #: ../src/guestfs-actions.pod:1329 ../fish/guestfish-actions.pod:1034
6452 msgid "64 bit SPARC V9 and above."
6456 #: ../src/guestfs-actions.pod:1331 ../fish/guestfish-actions.pod:1036
6461 #: ../src/guestfs-actions.pod:1333 ../fish/guestfish-actions.pod:1038
6462 msgid "Intel Itanium."
6466 #: ../src/guestfs-actions.pod:1335 ../fish/guestfish-actions.pod:1040
6471 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:1042
6472 msgid "32 bit Power PC."
6476 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:1044
6481 #: ../src/guestfs-actions.pod:1341 ../fish/guestfish-actions.pod:1046
6482 msgid "64 bit Power PC."
6486 #: ../src/guestfs-actions.pod:1345 ../fish/guestfish-actions.pod:1050
6487 msgid "Libguestfs may return other architecture strings in future."
6491 #: ../src/guestfs-actions.pod:1347 ../fish/guestfish-actions.pod:1052
6492 msgid "The function works on at least the following types of files:"
6496 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:1058
6497 msgid "many types of Un*x and Linux binary"
6501 #: ../src/guestfs-actions.pod:1357 ../fish/guestfish-actions.pod:1062
6502 msgid "many types of Un*x and Linux shared library"
6506 #: ../src/guestfs-actions.pod:1361 ../fish/guestfish-actions.pod:1066
6507 msgid "Windows Win32 and Win64 binaries"
6511 #: ../src/guestfs-actions.pod:1365 ../fish/guestfish-actions.pod:1070
6512 msgid "Windows Win32 and Win64 DLLs"
6516 #: ../src/guestfs-actions.pod:1367 ../fish/guestfish-actions.pod:1072
6517 msgid "Win32 binaries and DLLs return C<i386>."
6521 #: ../src/guestfs-actions.pod:1369 ../fish/guestfish-actions.pod:1074
6522 msgid "Win64 binaries and DLLs return C<x86_64>."
6526 #: ../src/guestfs-actions.pod:1373 ../fish/guestfish-actions.pod:1078
6527 msgid "Linux kernel modules"
6531 #: ../src/guestfs-actions.pod:1377 ../fish/guestfish-actions.pod:1082
6532 msgid "Linux new-style initrd images"
6536 #: ../src/guestfs-actions.pod:1381 ../fish/guestfish-actions.pod:1086
6537 msgid "some non-x86 Linux vmlinuz kernels"
6541 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:1090
6542 msgid "What it can't do currently:"
6546 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:1096
6547 msgid "static libraries (libfoo.a)"
6551 #: ../src/guestfs-actions.pod:1395 ../fish/guestfish-actions.pod:1100
6552 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6556 #: ../src/guestfs-actions.pod:1399 ../fish/guestfish-actions.pod:1104
6557 msgid "x86 Linux vmlinuz kernels"
6561 #: ../src/guestfs-actions.pod:1401 ../fish/guestfish-actions.pod:1106
6563 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6564 "compressed code, and are horribly hard to unpack. If you want to find the "
6565 "architecture of a kernel, use the architecture of the associated initrd or "
6566 "kernel module(s) instead."
6570 #: ../src/guestfs-actions.pod:1411
6571 msgid "guestfs_filesize"
6575 #: ../src/guestfs-actions.pod:1413
6578 " int64_t guestfs_filesize (guestfs_h *g,\n"
6579 "\t\tconst char *file);\n"
6584 #: ../src/guestfs-actions.pod:1416 ../fish/guestfish-actions.pod:1117
6585 msgid "This command returns the size of C<file> in bytes."
6589 #: ../src/guestfs-actions.pod:1418
6591 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6592 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6593 "devices, use C<guestfs_blockdev_getsize64>."
6597 #: ../src/guestfs-actions.pod:1424
6598 msgid "guestfs_fill"
6602 #: ../src/guestfs-actions.pod:1426
6605 " int guestfs_fill (guestfs_h *g,\n"
6608 "\t\tconst char *path);\n"
6613 #: ../src/guestfs-actions.pod:1431 ../fish/guestfish-actions.pod:1127
6615 "This command creates a new file called C<path>. The initial content of the "
6616 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6621 #: ../src/guestfs-actions.pod:1435
6623 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6624 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6625 "bytes use C<guestfs_fill_pattern>."
6629 #: ../src/guestfs-actions.pod:1447
6630 msgid "guestfs_fill_pattern"
6634 #: ../src/guestfs-actions.pod:1449
6637 " int guestfs_fill_pattern (guestfs_h *g,\n"
6638 "\t\tconst char *pattern,\n"
6640 "\t\tconst char *path);\n"
6645 #: ../src/guestfs-actions.pod:1454
6647 "This function is like C<guestfs_fill> except that it creates a new file of "
6648 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
6649 "pattern is truncated if necessary to ensure the length of the file is "
6650 "exactly C<len> bytes."
6654 #: ../src/guestfs-actions.pod:1466
6655 msgid "guestfs_find"
6659 #: ../src/guestfs-actions.pod:1468
6662 " char **guestfs_find (guestfs_h *g,\n"
6663 "\t\tconst char *directory);\n"
6668 #: ../src/guestfs-actions.pod:1471 ../fish/guestfish-actions.pod:1149
6670 "This command lists out all files and directories, recursively, starting at "
6671 "C<directory>. It is essentially equivalent to running the shell command "
6672 "C<find directory -print> but some post-processing happens on the output, "
6677 #: ../src/guestfs-actions.pod:1476 ../fish/guestfish-actions.pod:1154
6679 "This returns a list of strings I<without any prefix>. Thus if the directory "
6684 #: ../src/guestfs-actions.pod:1479 ../fish/guestfish-actions.pod:1157
6694 #: ../src/guestfs-actions.pod:1483
6696 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
6700 #: ../src/guestfs-actions.pod:1486 ../fish/guestfish-actions.pod:1164
6711 #: ../src/guestfs-actions.pod:1491 ../fish/guestfish-actions.pod:1169
6712 msgid "If C<directory> is not a directory, then this command returns an error."
6716 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:1172
6717 msgid "The returned list is sorted."
6721 #: ../src/guestfs-actions.pod:1496
6722 msgid "See also C<guestfs_find0>."
6726 #: ../src/guestfs-actions.pod:1505
6727 msgid "guestfs_find0"
6731 #: ../src/guestfs-actions.pod:1507
6734 " int guestfs_find0 (guestfs_h *g,\n"
6735 "\t\tconst char *directory,\n"
6736 "\t\tconst char *files);\n"
6741 #: ../src/guestfs-actions.pod:1511 ../fish/guestfish-actions.pod:1183
6743 "This command lists out all files and directories, recursively, starting at "
6744 "C<directory>, placing the resulting list in the external file called "
6749 #: ../src/guestfs-actions.pod:1515
6751 "This command works the same way as C<guestfs_find> with the following "
6756 #: ../src/guestfs-actions.pod:1522 ../fish/guestfish-actions.pod:1194
6757 msgid "The resulting list is written to an external file."
6761 #: ../src/guestfs-actions.pod:1526 ../fish/guestfish-actions.pod:1198
6763 "Items (filenames) in the result are separated by C<\\0> characters. See "
6764 "L<find(1)> option I<-print0>."
6768 #: ../src/guestfs-actions.pod:1531 ../fish/guestfish-actions.pod:1203
6769 msgid "This command is not limited in the number of names that it can return."
6773 #: ../src/guestfs-actions.pod:1536 ../fish/guestfish-actions.pod:1208
6774 msgid "The result list is not sorted."
6778 #: ../src/guestfs-actions.pod:1542
6779 msgid "guestfs_findfs_label"
6783 #: ../src/guestfs-actions.pod:1544
6786 " char *guestfs_findfs_label (guestfs_h *g,\n"
6787 "\t\tconst char *label);\n"
6792 #: ../src/guestfs-actions.pod:1547 ../fish/guestfish-actions.pod:1218
6794 "This command searches the filesystems and returns the one which has the "
6795 "given label. An error is returned if no such filesystem can be found."
6799 #: ../src/guestfs-actions.pod:1551
6800 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6804 #: ../src/guestfs-actions.pod:1556
6805 msgid "guestfs_findfs_uuid"
6809 #: ../src/guestfs-actions.pod:1558
6812 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6813 "\t\tconst char *uuid);\n"
6818 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1228
6820 "This command searches the filesystems and returns the one which has the "
6821 "given UUID. An error is returned if no such filesystem can be found."
6825 #: ../src/guestfs-actions.pod:1565
6826 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6830 #: ../src/guestfs-actions.pod:1570
6831 msgid "guestfs_fsck"
6835 #: ../src/guestfs-actions.pod:1572
6838 " int guestfs_fsck (guestfs_h *g,\n"
6839 "\t\tconst char *fstype,\n"
6840 "\t\tconst char *device);\n"
6845 #: ../src/guestfs-actions.pod:1576 ../fish/guestfish-actions.pod:1238
6847 "This runs the filesystem checker (fsck) on C<device> which should have "
6848 "filesystem type C<fstype>."
6852 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1241
6854 "The returned integer is the status. See L<fsck(8)> for the list of status "
6855 "codes from C<fsck>."
6859 #: ../src/guestfs-actions.pod:1588 ../fish/guestfish-actions.pod:1250
6860 msgid "Multiple status codes can be summed together."
6864 #: ../src/guestfs-actions.pod:1592 ../fish/guestfish-actions.pod:1254
6866 "A non-zero return code can mean \"success\", for example if errors have been "
6867 "corrected on the filesystem."
6871 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1259
6872 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6876 #: ../src/guestfs-actions.pod:1602 ../fish/guestfish-actions.pod:1264
6878 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6882 #: ../src/guestfs-actions.pod:1606
6883 msgid "guestfs_get_append"
6887 #: ../src/guestfs-actions.pod:1608
6890 " const char *guestfs_get_append (guestfs_h *g);\n"
6895 #: ../src/guestfs-actions.pod:1610 ../fish/guestfish-actions.pod:1270
6897 "Return the additional kernel options which are added to the guest kernel "
6902 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1273
6903 msgid "If C<NULL> then no options are added."
6907 #: ../src/guestfs-actions.pod:1615
6909 "This function returns a string which may be NULL. There is no way to return "
6910 "an error from this function. The string is owned by the guest handle and "
6911 "must I<not> be freed."
6915 #: ../src/guestfs-actions.pod:1619
6916 msgid "guestfs_get_autosync"
6920 #: ../src/guestfs-actions.pod:1621
6923 " int guestfs_get_autosync (guestfs_h *g);\n"
6928 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1279
6929 msgid "Get the autosync flag."
6933 #: ../src/guestfs-actions.pod:1627
6934 msgid "guestfs_get_direct"
6938 #: ../src/guestfs-actions.pod:1629
6941 " int guestfs_get_direct (guestfs_h *g);\n"
6946 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1285
6947 msgid "Return the direct appliance mode flag."
6951 #: ../src/guestfs-actions.pod:1635
6952 msgid "guestfs_get_e2label"
6956 #: ../src/guestfs-actions.pod:1637
6959 " char *guestfs_get_e2label (guestfs_h *g,\n"
6960 "\t\tconst char *device);\n"
6965 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1291
6967 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6971 #: ../src/guestfs-actions.pod:1646 ../fish/guestfish-actions.pod:1294
6973 "This function is deprecated. In new code, use the C<vfs_label> call instead."
6977 #: ../src/guestfs-actions.pod:1653
6978 msgid "guestfs_get_e2uuid"
6982 #: ../src/guestfs-actions.pod:1655
6985 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6986 "\t\tconst char *device);\n"
6991 #: ../src/guestfs-actions.pod:1658 ../fish/guestfish-actions.pod:1305
6993 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6997 #: ../src/guestfs-actions.pod:1664 ../fish/guestfish-actions.pod:1308
6999 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7003 #: ../src/guestfs-actions.pod:1671
7004 msgid "guestfs_get_memsize"
7008 #: ../src/guestfs-actions.pod:1673
7011 " int guestfs_get_memsize (guestfs_h *g);\n"
7016 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1319
7018 "This gets the memory size in megabytes allocated to the qemu subprocess."
7022 #: ../src/guestfs-actions.pod:1678
7024 "If C<guestfs_set_memsize> was not called on this handle, and if "
7025 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7026 "value for memsize."
7030 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1745
7031 #: ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4601
7032 #: ../fish/guestfish-actions.pod:1326 ../fish/guestfish-actions.pod:1377
7033 #: ../fish/guestfish-actions.pod:3484 ../fish/guestfish-actions.pod:3571
7035 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7039 #: ../src/guestfs-actions.pod:1687
7040 msgid "guestfs_get_network"
7044 #: ../src/guestfs-actions.pod:1689
7047 " int guestfs_get_network (guestfs_h *g);\n"
7052 #: ../src/guestfs-actions.pod:1691 ../fish/guestfish-actions.pod:1333
7053 msgid "This returns the enable network flag."
7057 #: ../src/guestfs-actions.pod:1695
7058 msgid "guestfs_get_path"
7062 #: ../src/guestfs-actions.pod:1697
7065 " const char *guestfs_get_path (guestfs_h *g);\n"
7070 #: ../src/guestfs-actions.pod:1699 ../fish/guestfish-actions.pod:1339
7071 msgid "Return the current search path."
7075 #: ../src/guestfs-actions.pod:1701 ../fish/guestfish-actions.pod:1341
7077 "This is always non-NULL. If it wasn't set already, then this will return "
7082 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1727
7084 "This function returns a string, or NULL on error. The string is owned by "
7085 "the guest handle and must I<not> be freed."
7089 #: ../src/guestfs-actions.pod:1707
7090 msgid "guestfs_get_pid"
7094 #: ../src/guestfs-actions.pod:1709
7097 " int guestfs_get_pid (guestfs_h *g);\n"
7102 #: ../src/guestfs-actions.pod:1711 ../fish/guestfish-actions.pod:1350
7104 "Return the process ID of the qemu subprocess. If there is no qemu "
7105 "subprocess, then this will return an error."
7109 #: ../src/guestfs-actions.pod:1714 ../fish/guestfish-actions.pod:1353
7110 msgid "This is an internal call used for debugging and testing."
7114 #: ../src/guestfs-actions.pod:1718
7115 msgid "guestfs_get_qemu"
7119 #: ../src/guestfs-actions.pod:1720
7122 " const char *guestfs_get_qemu (guestfs_h *g);\n"
7127 #: ../src/guestfs-actions.pod:1722 ../fish/guestfish-actions.pod:1359
7128 msgid "Return the current qemu binary."
7132 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1361
7134 "This is always non-NULL. If it wasn't set already, then this will return "
7135 "the default qemu binary name."
7139 #: ../src/guestfs-actions.pod:1730
7140 msgid "guestfs_get_recovery_proc"
7144 #: ../src/guestfs-actions.pod:1732
7147 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
7152 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1368
7153 msgid "Return the recovery process enabled flag."
7157 #: ../src/guestfs-actions.pod:1738
7158 msgid "guestfs_get_selinux"
7162 #: ../src/guestfs-actions.pod:1740
7165 " int guestfs_get_selinux (guestfs_h *g);\n"
7170 #: ../src/guestfs-actions.pod:1742
7172 "This returns the current setting of the selinux flag which is passed to the "
7173 "appliance at boot time. See C<guestfs_set_selinux>."
7177 #: ../src/guestfs-actions.pod:1750
7178 msgid "guestfs_get_state"
7182 #: ../src/guestfs-actions.pod:1752
7185 " int guestfs_get_state (guestfs_h *g);\n"
7190 #: ../src/guestfs-actions.pod:1754 ../fish/guestfish-actions.pod:1384
7192 "This returns the current state as an opaque integer. This is only useful "
7193 "for printing debug and internal error messages."
7197 #: ../src/guestfs-actions.pod:1757 ../src/guestfs-actions.pod:2418
7198 #: ../src/guestfs-actions.pod:2441 ../src/guestfs-actions.pod:2490
7199 #: ../src/guestfs-actions.pod:2511 ../fish/guestfish-actions.pod:1387
7200 #: ../fish/guestfish-actions.pod:1917 ../fish/guestfish-actions.pod:1935
7201 #: ../fish/guestfish-actions.pod:1973 ../fish/guestfish-actions.pod:1989
7202 msgid "For more information on states, see L<guestfs(3)>."
7206 #: ../src/guestfs-actions.pod:1761
7207 msgid "guestfs_get_trace"
7211 #: ../src/guestfs-actions.pod:1763
7214 " int guestfs_get_trace (guestfs_h *g);\n"
7219 #: ../src/guestfs-actions.pod:1765 ../fish/guestfish-actions.pod:1393
7220 msgid "Return the command trace flag."
7224 #: ../src/guestfs-actions.pod:1769
7225 msgid "guestfs_get_umask"
7229 #: ../src/guestfs-actions.pod:1771
7232 " int guestfs_get_umask (guestfs_h *g);\n"
7237 #: ../src/guestfs-actions.pod:1773
7239 "Return the current umask. By default the umask is C<022> unless it has been "
7240 "set by calling C<guestfs_umask>."
7244 #: ../src/guestfs-actions.pod:1778
7245 msgid "guestfs_get_verbose"
7249 #: ../src/guestfs-actions.pod:1780
7252 " int guestfs_get_verbose (guestfs_h *g);\n"
7257 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1406
7258 msgid "This returns the verbose messages flag."
7262 #: ../src/guestfs-actions.pod:1786
7263 msgid "guestfs_getcon"
7267 #: ../src/guestfs-actions.pod:1788
7270 " char *guestfs_getcon (guestfs_h *g);\n"
7275 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1412
7276 msgid "This gets the SELinux security context of the daemon."
7280 #: ../src/guestfs-actions.pod:1792
7282 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
7286 #: ../src/guestfs-actions.pod:1798
7287 msgid "guestfs_getxattrs"
7291 #: ../src/guestfs-actions.pod:1800
7294 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
7295 "\t\tconst char *path);\n"
7300 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1421
7302 "This call lists the extended attributes of the file or directory C<path>."
7306 #: ../src/guestfs-actions.pod:1806 ../fish/guestfish-actions.pod:1424
7308 "At the system call level, this is a combination of the L<listxattr(2)> and "
7309 "L<getxattr(2)> calls."
7313 #: ../src/guestfs-actions.pod:1809
7314 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
7318 #: ../src/guestfs-actions.pod:1811 ../src/guestfs-actions.pod:2585
7319 #: ../src/guestfs-actions.pod:3140
7321 "This function returns a C<struct guestfs_xattr_list *> (see E<lt>guestfs-"
7322 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
7323 "C<guestfs_free_xattr_list> after use>."
7327 #: ../src/guestfs-actions.pod:1816
7328 msgid "guestfs_glob_expand"
7332 #: ../src/guestfs-actions.pod:1818
7335 " char **guestfs_glob_expand (guestfs_h *g,\n"
7336 "\t\tconst char *pattern);\n"
7341 #: ../src/guestfs-actions.pod:1821 ../fish/guestfish-actions.pod:1433
7343 "This command searches for all the pathnames matching C<pattern> according to "
7344 "the wildcard expansion rules used by the shell."
7348 #: ../src/guestfs-actions.pod:1825 ../fish/guestfish-actions.pod:1437
7350 "If no paths match, then this returns an empty list (note: not an error)."
7354 #: ../src/guestfs-actions.pod:1828 ../fish/guestfish-actions.pod:1440
7356 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
7357 "GLOB_BRACE>. See that manual page for more details."
7361 #: ../src/guestfs-actions.pod:1836
7362 msgid "guestfs_grep"
7366 #: ../src/guestfs-actions.pod:1838
7369 " char **guestfs_grep (guestfs_h *g,\n"
7370 "\t\tconst char *regex,\n"
7371 "\t\tconst char *path);\n"
7376 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:1448
7377 msgid "This calls the external C<grep> program and returns the matching lines."
7381 #: ../src/guestfs-actions.pod:1852
7382 msgid "guestfs_grepi"
7386 #: ../src/guestfs-actions.pod:1854
7389 " char **guestfs_grepi (guestfs_h *g,\n"
7390 "\t\tconst char *regex,\n"
7391 "\t\tconst char *path);\n"
7396 #: ../src/guestfs-actions.pod:1858 ../fish/guestfish-actions.pod:1458
7398 "This calls the external C<grep -i> program and returns the matching lines."
7402 #: ../src/guestfs-actions.pod:1868
7403 msgid "guestfs_grub_install"
7407 #: ../src/guestfs-actions.pod:1870
7410 " int guestfs_grub_install (guestfs_h *g,\n"
7411 "\t\tconst char *root,\n"
7412 "\t\tconst char *device);\n"
7417 #: ../src/guestfs-actions.pod:1874 ../fish/guestfish-actions.pod:1468
7419 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7420 "the root directory being C<root>."
7424 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1471
7426 "Note: If grub-install reports the error \"No suitable drive was found in the "
7427 "generated device map.\" it may be that you need to create a C</boot/grub/"
7428 "device.map> file first that contains the mapping between grub device names "
7429 "and Linux device names. It is usually sufficient to create a file "
7434 #: ../src/guestfs-actions.pod:1884 ../fish/guestfish-actions.pod:1478
7442 #: ../src/guestfs-actions.pod:1886 ../fish/guestfish-actions.pod:1480
7443 msgid "replacing C</dev/vda> with the name of the installation device."
7447 #: ../src/guestfs-actions.pod:1890
7448 msgid "guestfs_head"
7452 #: ../src/guestfs-actions.pod:1892
7455 " char **guestfs_head (guestfs_h *g,\n"
7456 "\t\tconst char *path);\n"
7461 #: ../src/guestfs-actions.pod:1895 ../fish/guestfish-actions.pod:1486
7463 "This command returns up to the first 10 lines of a file as a list of strings."
7467 #: ../src/guestfs-actions.pod:1905
7468 msgid "guestfs_head_n"
7472 #: ../src/guestfs-actions.pod:1907
7475 " char **guestfs_head_n (guestfs_h *g,\n"
7476 "\t\tint nrlines,\n"
7477 "\t\tconst char *path);\n"
7482 #: ../src/guestfs-actions.pod:1911 ../fish/guestfish-actions.pod:1496
7484 "If the parameter C<nrlines> is a positive number, this returns the first "
7485 "C<nrlines> lines of the file C<path>."
7489 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1499
7491 "If the parameter C<nrlines> is a negative number, this returns lines from "
7492 "the file C<path>, excluding the last C<nrlines> lines."
7496 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:5057
7497 #: ../fish/guestfish-actions.pod:1502 ../fish/guestfish-actions.pod:3917
7498 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7502 #: ../src/guestfs-actions.pod:1926
7503 msgid "guestfs_hexdump"
7507 #: ../src/guestfs-actions.pod:1928
7510 " char *guestfs_hexdump (guestfs_h *g,\n"
7511 "\t\tconst char *path);\n"
7516 #: ../src/guestfs-actions.pod:1931 ../fish/guestfish-actions.pod:1511
7518 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7519 "readable, canonical hex dump of the file."
7523 #: ../src/guestfs-actions.pod:1940
7524 msgid "guestfs_initrd_cat"
7528 #: ../src/guestfs-actions.pod:1942
7531 " char *guestfs_initrd_cat (guestfs_h *g,\n"
7532 "\t\tconst char *initrdpath,\n"
7533 "\t\tconst char *filename,\n"
7534 "\t\tsize_t *size_r);\n"
7539 #: ../src/guestfs-actions.pod:1947 ../fish/guestfish-actions.pod:1521
7541 "This command unpacks the file C<filename> from the initrd file called "
7542 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7547 #: ../src/guestfs-actions.pod:1951 ../fish/guestfish-actions.pod:1525
7549 "For example, in guestfish you could use the following command to examine the "
7550 "boot script (usually called C</init>) contained in a Linux initrd or "
7555 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1529
7558 " initrd-cat /boot/initrd-<version>.img init\n"
7563 #: ../src/guestfs-actions.pod:1957
7564 msgid "See also C<guestfs_initrd_list>."
7568 #: ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:3969
7569 #: ../src/guestfs-actions.pod:3992 ../src/guestfs-actions.pod:4144
7571 "This function returns a buffer, or NULL on error. The size of the returned "
7572 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
7577 #: ../src/guestfs-actions.pod:1966
7578 msgid "guestfs_initrd_list"
7582 #: ../src/guestfs-actions.pod:1968
7585 " char **guestfs_initrd_list (guestfs_h *g,\n"
7586 "\t\tconst char *path);\n"
7591 #: ../src/guestfs-actions.pod:1971 ../fish/guestfish-actions.pod:1540
7592 msgid "This command lists out files contained in an initrd."
7596 #: ../src/guestfs-actions.pod:1973 ../fish/guestfish-actions.pod:1542
7598 "The files are listed without any initial C</> character. The files are "
7599 "listed in the order they appear (not necessarily alphabetical). Directory "
7600 "names are listed as separate items."
7604 #: ../src/guestfs-actions.pod:1977 ../fish/guestfish-actions.pod:1546
7606 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7607 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7612 #: ../src/guestfs-actions.pod:1985
7613 msgid "guestfs_inotify_add_watch"
7617 #: ../src/guestfs-actions.pod:1987
7620 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
7621 "\t\tconst char *path,\n"
7627 #: ../src/guestfs-actions.pod:1991 ../fish/guestfish-actions.pod:1554
7628 msgid "Watch C<path> for the events listed in C<mask>."
7632 #: ../src/guestfs-actions.pod:1993 ../fish/guestfish-actions.pod:1556
7634 "Note that if C<path> is a directory then events within that directory are "
7635 "watched, but this does I<not> happen recursively (in subdirectories)."
7639 #: ../src/guestfs-actions.pod:1997 ../fish/guestfish-actions.pod:1560
7641 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7642 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7646 #: ../src/guestfs-actions.pod:2003
7647 msgid "guestfs_inotify_close"
7651 #: ../src/guestfs-actions.pod:2005
7654 " int guestfs_inotify_close (guestfs_h *g);\n"
7659 #: ../src/guestfs-actions.pod:2007 ../fish/guestfish-actions.pod:1568
7661 "This closes the inotify handle which was previously opened by inotify_init. "
7662 "It removes all watches, throws away any pending events, and deallocates all "
7667 #: ../src/guestfs-actions.pod:2013
7668 msgid "guestfs_inotify_files"
7672 #: ../src/guestfs-actions.pod:2015
7675 " char **guestfs_inotify_files (guestfs_h *g);\n"
7680 #: ../src/guestfs-actions.pod:2017
7682 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
7683 "returns a list of pathnames of objects that were touched. The returned "
7684 "pathnames are sorted and deduplicated."
7688 #: ../src/guestfs-actions.pod:2025
7689 msgid "guestfs_inotify_init"
7693 #: ../src/guestfs-actions.pod:2027
7696 " int guestfs_inotify_init (guestfs_h *g,\n"
7697 "\t\tint maxevents);\n"
7702 #: ../src/guestfs-actions.pod:2030 ../fish/guestfish-actions.pod:1584
7704 "This command creates a new inotify handle. The inotify subsystem can be "
7705 "used to notify events which happen to objects in the guest filesystem."
7709 #: ../src/guestfs-actions.pod:2034
7711 "C<maxevents> is the maximum number of events which will be queued up between "
7712 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
7713 "passed as C<0>, then the kernel (or previously set) default is used. For "
7714 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
7715 "throws away events, but records the fact that it threw them away by setting "
7716 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
7717 "C<guestfs_inotify_read>)."
7721 #: ../src/guestfs-actions.pod:2044
7723 "Before any events are generated, you have to add some watches to the "
7724 "internal watch list. See: C<guestfs_inotify_add_watch>, "
7725 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
7729 #: ../src/guestfs-actions.pod:2050
7731 "Queued up events should be read periodically by calling "
7732 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
7733 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
7734 "often enough then you risk the internal queue overflowing."
7738 #: ../src/guestfs-actions.pod:2057
7740 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
7741 "This also removes any watches automatically."
7745 #: ../src/guestfs-actions.pod:2061 ../fish/guestfish-actions.pod:1615
7747 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7748 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7749 "that there is one global inotify handle per libguestfs instance."
7753 #: ../src/guestfs-actions.pod:2068
7754 msgid "guestfs_inotify_read"
7758 #: ../src/guestfs-actions.pod:2070
7761 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
7766 #: ../src/guestfs-actions.pod:2072 ../fish/guestfish-actions.pod:1624
7768 "Return the complete queue of events that have happened since the previous "
7773 #: ../src/guestfs-actions.pod:2075 ../fish/guestfish-actions.pod:1627
7774 msgid "If no events have happened, this returns an empty list."
7778 #: ../src/guestfs-actions.pod:2077 ../fish/guestfish-actions.pod:1629
7780 "I<Note>: In order to make sure that all events have been read, you must call "
7781 "this function repeatedly until it returns an empty list. The reason is that "
7782 "the call will read events up to the maximum appliance-to-host message size "
7783 "and leave remaining events in the queue."
7787 #: ../src/guestfs-actions.pod:2083
7789 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7790 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7791 "must call C<guestfs_free_inotify_event_list> after use>."
7795 #: ../src/guestfs-actions.pod:2088
7796 msgid "guestfs_inotify_rm_watch"
7800 #: ../src/guestfs-actions.pod:2090
7803 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7809 #: ../src/guestfs-actions.pod:2093
7811 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
7815 #: ../src/guestfs-actions.pod:2098
7816 msgid "guestfs_inspect_get_arch"
7820 #: ../src/guestfs-actions.pod:2100
7823 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7824 "\t\tconst char *root);\n"
7829 #: ../src/guestfs-actions.pod:2103 ../src/guestfs-actions.pod:2123
7830 #: ../src/guestfs-actions.pod:2193 ../src/guestfs-actions.pod:2216
7831 #: ../src/guestfs-actions.pod:2240 ../src/guestfs-actions.pod:2258
7832 #: ../src/guestfs-actions.pod:2288 ../src/guestfs-actions.pod:2309
7833 #: ../src/guestfs-actions.pod:2344
7835 "This function should only be called with a root device string as returned by "
7836 "C<guestfs_inspect_os>."
7840 #: ../src/guestfs-actions.pod:2106
7842 "This returns the architecture of the inspected operating system. The "
7843 "possible return values are listed under C<guestfs_file_architecture>."
7847 #: ../src/guestfs-actions.pod:2110 ../fish/guestfish-actions.pod:1653
7849 "If the architecture could not be determined, then the string C<unknown> is "
7854 #: ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:2183
7855 #: ../src/guestfs-actions.pod:2231 ../src/guestfs-actions.pod:2299
7856 #: ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:2354
7857 #: ../src/guestfs-actions.pod:2391 ../fish/guestfish-actions.pod:1656
7858 #: ../fish/guestfish-actions.pod:1722 ../fish/guestfish-actions.pod:1761
7859 #: ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1847
7860 #: ../fish/guestfish-actions.pod:1863 ../fish/guestfish-actions.pod:1897
7861 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7865 #: ../src/guestfs-actions.pod:2118
7866 msgid "guestfs_inspect_get_distro"
7870 #: ../src/guestfs-actions.pod:2120
7873 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7874 "\t\tconst char *root);\n"
7879 #: ../src/guestfs-actions.pod:2126 ../fish/guestfish-actions.pod:1665
7881 "This returns the distro (distribution) of the inspected operating system."
7885 #: ../src/guestfs-actions.pod:2129 ../fish/guestfish-actions.pod:1668
7886 msgid "Currently defined distros are:"
7890 #: ../src/guestfs-actions.pod:2133 ../fish/guestfish-actions.pod:1672
7891 msgid "\"archlinux\""
7895 #: ../src/guestfs-actions.pod:2135 ../fish/guestfish-actions.pod:1674
7900 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1676
7905 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1678
7906 msgid "Debian or a Debian-derived distro such as Ubuntu."
7910 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1680
7915 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1682
7920 #: ../src/guestfs-actions.pod:2145 ../fish/guestfish-actions.pod:1684
7925 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1686
7930 #: ../src/guestfs-actions.pod:2149 ../fish/guestfish-actions.pod:1688
7935 #: ../src/guestfs-actions.pod:2151 ../fish/guestfish-actions.pod:1690
7940 #: ../src/guestfs-actions.pod:2153 ../fish/guestfish-actions.pod:1692
7945 #: ../src/guestfs-actions.pod:2155 ../fish/guestfish-actions.pod:1694
7950 #: ../src/guestfs-actions.pod:2157 ../fish/guestfish-actions.pod:1696
7951 msgid "\"redhat-based\""
7955 #: ../src/guestfs-actions.pod:2159 ../fish/guestfish-actions.pod:1698
7956 msgid "Some Red Hat-derived distro."
7960 #: ../src/guestfs-actions.pod:2161 ../fish/guestfish-actions.pod:1700
7965 #: ../src/guestfs-actions.pod:2163 ../fish/guestfish-actions.pod:1702
7966 msgid "Red Hat Enterprise Linux and some derivatives."
7970 #: ../src/guestfs-actions.pod:2165 ../src/guestfs-actions.pod:2321
7971 #: ../fish/guestfish-actions.pod:1704 ../fish/guestfish-actions.pod:1834
7976 #: ../src/guestfs-actions.pod:2167 ../fish/guestfish-actions.pod:1706
7978 "Windows does not have distributions. This string is returned if the OS type "
7983 #: ../src/guestfs-actions.pod:2170 ../fish/guestfish-actions.pod:1709
7988 #: ../src/guestfs-actions.pod:2172 ../fish/guestfish-actions.pod:1711
7993 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:2325
7994 #: ../fish/guestfish-actions.pod:1713 ../fish/guestfish-actions.pod:1838
7999 #: ../src/guestfs-actions.pod:2176 ../fish/guestfish-actions.pod:1715
8000 msgid "The distro could not be determined."
8004 #: ../src/guestfs-actions.pod:2180 ../src/guestfs-actions.pod:2331
8005 #: ../fish/guestfish-actions.pod:1719 ../fish/guestfish-actions.pod:1844
8007 "Future versions of libguestfs may return other strings here. The caller "
8008 "should be prepared to handle any string."
8012 #: ../src/guestfs-actions.pod:2188
8013 msgid "guestfs_inspect_get_filesystems"
8017 #: ../src/guestfs-actions.pod:2190
8020 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8021 "\t\tconst char *root);\n"
8026 #: ../src/guestfs-actions.pod:2196 ../fish/guestfish-actions.pod:1731
8028 "This returns a list of all the filesystems that we think are associated with "
8029 "this operating system. This includes the root filesystem, other ordinary "
8030 "filesystems, and non-mounted devices like swap partitions."
8034 #: ../src/guestfs-actions.pod:2201 ../fish/guestfish-actions.pod:1736
8036 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8037 "to be shared between operating systems."
8041 #: ../src/guestfs-actions.pod:2204
8043 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8044 "C<guestfs_inspect_get_mountpoints>."
8048 #: ../src/guestfs-actions.pod:2211
8049 msgid "guestfs_inspect_get_major_version"
8053 #: ../src/guestfs-actions.pod:2213
8056 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
8057 "\t\tconst char *root);\n"
8062 #: ../src/guestfs-actions.pod:2219 ../fish/guestfish-actions.pod:1749
8064 "This returns the major version number of the inspected operating system."
8068 #: ../src/guestfs-actions.pod:2222 ../fish/guestfish-actions.pod:1752
8070 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8071 "popular public names used by the operating system. Notably the operating "
8072 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8073 "1). You can find out the real versions corresponding to releases of Windows "
8074 "by consulting Wikipedia or MSDN."
8078 #: ../src/guestfs-actions.pod:2229 ../src/guestfs-actions.pod:2246
8079 #: ../fish/guestfish-actions.pod:1759 ../fish/guestfish-actions.pod:1773
8080 msgid "If the version could not be determined, then C<0> is returned."
8084 #: ../src/guestfs-actions.pod:2235
8085 msgid "guestfs_inspect_get_minor_version"
8089 #: ../src/guestfs-actions.pod:2237
8092 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8093 "\t\tconst char *root);\n"
8098 #: ../src/guestfs-actions.pod:2243 ../fish/guestfish-actions.pod:1770
8100 "This returns the minor version number of the inspected operating system."
8104 #: ../src/guestfs-actions.pod:2248
8106 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8107 "C<guestfs_inspect_get_major_version>."
8111 #: ../src/guestfs-actions.pod:2253
8112 msgid "guestfs_inspect_get_mountpoints"
8116 #: ../src/guestfs-actions.pod:2255
8119 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
8120 "\t\tconst char *root);\n"
8125 #: ../src/guestfs-actions.pod:2261 ../fish/guestfish-actions.pod:1785
8127 "This returns a hash of where we think the filesystems associated with this "
8128 "operating system should be mounted. Callers should note that this is at "
8129 "best an educated guess made by reading configuration files such as C</etc/"
8134 #: ../src/guestfs-actions.pod:2266 ../fish/guestfish-actions.pod:1790
8136 "Each element in the returned hashtable has a key which is the path of the "
8137 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8138 "mounted there (eg. C</dev/sda1>)."
8142 #: ../src/guestfs-actions.pod:2271 ../fish/guestfish-actions.pod:1795
8144 "Non-mounted devices such as swap devices are I<not> returned in this list."
8148 #: ../src/guestfs-actions.pod:2274
8150 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8151 "C<guestfs_inspect_get_filesystems>."
8155 #: ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:2637
8156 #: ../src/guestfs-actions.pod:3591 ../src/guestfs-actions.pod:5174
8158 "This function returns a NULL-terminated array of strings, or NULL if there "
8159 "was an error. The array of strings will always have length C<2n+1>, where "
8160 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
8161 "caller must free the strings and the array after use>."
8165 #: ../src/guestfs-actions.pod:2283
8166 msgid "guestfs_inspect_get_product_name"
8170 #: ../src/guestfs-actions.pod:2285
8173 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
8174 "\t\tconst char *root);\n"
8179 #: ../src/guestfs-actions.pod:2291 ../fish/guestfish-actions.pod:1808
8181 "This returns the product name of the inspected operating system. The "
8182 "product name is generally some freeform string which can be displayed to the "
8183 "user, but should not be parsed by programs."
8187 #: ../src/guestfs-actions.pod:2296 ../fish/guestfish-actions.pod:1813
8189 "If the product name could not be determined, then the string C<unknown> is "
8194 #: ../src/guestfs-actions.pod:2304
8195 msgid "guestfs_inspect_get_type"
8199 #: ../src/guestfs-actions.pod:2306
8202 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
8203 "\t\tconst char *root);\n"
8208 #: ../src/guestfs-actions.pod:2312 ../fish/guestfish-actions.pod:1825
8210 "This returns the type of the inspected operating system. Currently defined "
8215 #: ../src/guestfs-actions.pod:2317 ../fish/guestfish-actions.pod:1830
8220 #: ../src/guestfs-actions.pod:2319 ../fish/guestfish-actions.pod:1832
8221 msgid "Any Linux-based operating system."
8225 #: ../src/guestfs-actions.pod:2323 ../fish/guestfish-actions.pod:1836
8226 msgid "Any Microsoft Windows operating system."
8230 #: ../src/guestfs-actions.pod:2327 ../fish/guestfish-actions.pod:1840
8231 msgid "The operating system type could not be determined."
8235 #: ../src/guestfs-actions.pod:2339
8236 msgid "guestfs_inspect_get_windows_systemroot"
8240 #: ../src/guestfs-actions.pod:2341
8243 " char *guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
8244 "\t\tconst char *root);\n"
8249 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1856
8251 "This returns the Windows systemroot of the inspected guest. The systemroot "
8252 "is a directory path such as C</WINDOWS>."
8256 #: ../src/guestfs-actions.pod:2350 ../fish/guestfish-actions.pod:1859
8258 "This call assumes that the guest is Windows and that the systemroot could be "
8259 "determined by inspection. If this is not the case then an error is returned."
8263 #: ../src/guestfs-actions.pod:2359
8264 msgid "guestfs_inspect_os"
8268 #: ../src/guestfs-actions.pod:2361
8271 " char **guestfs_inspect_os (guestfs_h *g);\n"
8276 #: ../src/guestfs-actions.pod:2363 ../fish/guestfish-actions.pod:1869
8278 "This function uses other libguestfs functions and certain heuristics to "
8279 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8280 "for operating systems."
8284 #: ../src/guestfs-actions.pod:2367 ../fish/guestfish-actions.pod:1873
8285 msgid "The list returned is empty if no operating systems were found."
8289 #: ../src/guestfs-actions.pod:2369 ../fish/guestfish-actions.pod:1875
8291 "If one operating system was found, then this returns a list with a single "
8292 "element, which is the name of the root filesystem of this operating system. "
8293 "It is also possible for this function to return a list containing more than "
8294 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8295 "element being the root filesystem of one of the operating systems."
8299 #: ../src/guestfs-actions.pod:2376
8301 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
8302 "functions in order to query further information about each operating system, "
8303 "such as the name and version."
8307 #: ../src/guestfs-actions.pod:2381
8309 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
8310 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
8311 "the contents. This should be called with no disks currently mounted. The "
8312 "function may also use Augeas, so any existing Augeas handle will be closed."
8316 #: ../src/guestfs-actions.pod:2387 ../fish/guestfish-actions.pod:1893
8318 "This function cannot decrypt encrypted disks. The caller must do that first "
8319 "(supplying the necessary keys) if the disk is encrypted."
8323 #: ../src/guestfs-actions.pod:2393 ../src/guestfs-actions.pod:2598
8324 #: ../src/guestfs-actions.pod:2654
8325 msgid "See also C<guestfs_list_filesystems>."
8329 #: ../src/guestfs-actions.pod:2399
8330 msgid "guestfs_is_blockdev"
8334 #: ../src/guestfs-actions.pod:2401
8337 " int guestfs_is_blockdev (guestfs_h *g,\n"
8338 "\t\tconst char *path);\n"
8343 #: ../src/guestfs-actions.pod:2404 ../fish/guestfish-actions.pod:1905
8345 "This returns C<true> if and only if there is a block device with the given "
8350 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:2430
8351 #: ../src/guestfs-actions.pod:2454 ../src/guestfs-actions.pod:2466
8352 #: ../src/guestfs-actions.pod:2479 ../src/guestfs-actions.pod:2523
8353 #: ../src/guestfs-actions.pod:2535
8354 msgid "See also C<guestfs_stat>."
8358 #: ../src/guestfs-actions.pod:2411
8359 msgid "guestfs_is_busy"
8363 #: ../src/guestfs-actions.pod:2413
8366 " int guestfs_is_busy (guestfs_h *g);\n"
8371 #: ../src/guestfs-actions.pod:2415 ../fish/guestfish-actions.pod:1914
8373 "This returns true iff this handle is busy processing a command (in the "
8378 #: ../src/guestfs-actions.pod:2422
8379 msgid "guestfs_is_chardev"
8383 #: ../src/guestfs-actions.pod:2424
8386 " int guestfs_is_chardev (guestfs_h *g,\n"
8387 "\t\tconst char *path);\n"
8392 #: ../src/guestfs-actions.pod:2427 ../fish/guestfish-actions.pod:1923
8394 "This returns C<true> if and only if there is a character device with the "
8395 "given C<path> name."
8399 #: ../src/guestfs-actions.pod:2434
8400 msgid "guestfs_is_config"
8404 #: ../src/guestfs-actions.pod:2436
8407 " int guestfs_is_config (guestfs_h *g);\n"
8412 #: ../src/guestfs-actions.pod:2438 ../fish/guestfish-actions.pod:1932
8414 "This returns true iff this handle is being configured (in the C<CONFIG> "
8419 #: ../src/guestfs-actions.pod:2445
8420 msgid "guestfs_is_dir"
8424 #: ../src/guestfs-actions.pod:2447
8427 " int guestfs_is_dir (guestfs_h *g,\n"
8428 "\t\tconst char *path);\n"
8433 #: ../src/guestfs-actions.pod:2450 ../fish/guestfish-actions.pod:1941
8435 "This returns C<true> if and only if there is a directory with the given "
8436 "C<path> name. Note that it returns false for other objects like files."
8440 #: ../src/guestfs-actions.pod:2458
8441 msgid "guestfs_is_fifo"
8445 #: ../src/guestfs-actions.pod:2460
8448 " int guestfs_is_fifo (guestfs_h *g,\n"
8449 "\t\tconst char *path);\n"
8454 #: ../src/guestfs-actions.pod:2463 ../fish/guestfish-actions.pod:1951
8456 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8457 "given C<path> name."
8461 #: ../src/guestfs-actions.pod:2470
8462 msgid "guestfs_is_file"
8466 #: ../src/guestfs-actions.pod:2472
8469 " int guestfs_is_file (guestfs_h *g,\n"
8470 "\t\tconst char *path);\n"
8475 #: ../src/guestfs-actions.pod:2475 ../fish/guestfish-actions.pod:1960
8477 "This returns C<true> if and only if there is a regular file with the given "
8478 "C<path> name. Note that it returns false for other objects like directories."
8482 #: ../src/guestfs-actions.pod:2483
8483 msgid "guestfs_is_launching"
8487 #: ../src/guestfs-actions.pod:2485
8490 " int guestfs_is_launching (guestfs_h *g);\n"
8495 #: ../src/guestfs-actions.pod:2487 ../fish/guestfish-actions.pod:1970
8497 "This returns true iff this handle is launching the subprocess (in the "
8498 "C<LAUNCHING> state)."
8502 #: ../src/guestfs-actions.pod:2494
8503 msgid "guestfs_is_lv"
8507 #: ../src/guestfs-actions.pod:2496
8510 " int guestfs_is_lv (guestfs_h *g,\n"
8511 "\t\tconst char *device);\n"
8516 #: ../src/guestfs-actions.pod:2499 ../fish/guestfish-actions.pod:1979
8518 "This command tests whether C<device> is a logical volume, and returns true "
8519 "iff this is the case."
8523 #: ../src/guestfs-actions.pod:2504
8524 msgid "guestfs_is_ready"
8528 #: ../src/guestfs-actions.pod:2506
8531 " int guestfs_is_ready (guestfs_h *g);\n"
8536 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1986
8538 "This returns true iff this handle is ready to accept commands (in the "
8543 #: ../src/guestfs-actions.pod:2515
8544 msgid "guestfs_is_socket"
8548 #: ../src/guestfs-actions.pod:2517
8551 " int guestfs_is_socket (guestfs_h *g,\n"
8552 "\t\tconst char *path);\n"
8557 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1995
8559 "This returns C<true> if and only if there is a Unix domain socket with the "
8560 "given C<path> name."
8564 #: ../src/guestfs-actions.pod:2527
8565 msgid "guestfs_is_symlink"
8569 #: ../src/guestfs-actions.pod:2529
8572 " int guestfs_is_symlink (guestfs_h *g,\n"
8573 "\t\tconst char *path);\n"
8578 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:2004
8580 "This returns C<true> if and only if there is a symbolic link with the given "
8585 #: ../src/guestfs-actions.pod:2539
8586 msgid "guestfs_kill_subprocess"
8590 #: ../src/guestfs-actions.pod:2541
8593 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8598 #: ../src/guestfs-actions.pod:2543 ../fish/guestfish-actions.pod:2013
8599 msgid "This kills the qemu subprocess. You should never need to call this."
8603 #: ../src/guestfs-actions.pod:2547
8604 msgid "guestfs_launch"
8608 #: ../src/guestfs-actions.pod:2549
8611 " int guestfs_launch (guestfs_h *g);\n"
8616 #: ../src/guestfs-actions.pod:2551 ../fish/guestfish-actions.pod:2021
8618 "Internally libguestfs is implemented by running a virtual machine using "
8623 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:2024
8625 "You should call this after configuring the handle (eg. adding drives) but "
8626 "before performing any actions."
8630 #: ../src/guestfs-actions.pod:2559
8631 msgid "guestfs_lchown"
8635 #: ../src/guestfs-actions.pod:2561
8638 " int guestfs_lchown (guestfs_h *g,\n"
8641 "\t\tconst char *path);\n"
8646 #: ../src/guestfs-actions.pod:2566
8648 "Change the file owner to C<owner> and group to C<group>. This is like "
8649 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8650 "changed, not the target."
8654 #: ../src/guestfs-actions.pod:2576
8655 msgid "guestfs_lgetxattrs"
8659 #: ../src/guestfs-actions.pod:2578
8662 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8663 "\t\tconst char *path);\n"
8668 #: ../src/guestfs-actions.pod:2581
8670 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8671 "then it returns the extended attributes of the link itself."
8675 #: ../src/guestfs-actions.pod:2590
8676 msgid "guestfs_list_devices"
8680 #: ../src/guestfs-actions.pod:2592
8683 " char **guestfs_list_devices (guestfs_h *g);\n"
8688 #: ../src/guestfs-actions.pod:2594 ../fish/guestfish-actions.pod:2051
8689 msgid "List all the block devices."
8693 #: ../src/guestfs-actions.pod:2596 ../fish/guestfish-actions.pod:2053
8694 msgid "The full block device names are returned, eg. C</dev/sda>."
8698 #: ../src/guestfs-actions.pod:2604
8699 msgid "guestfs_list_filesystems"
8703 #: ../src/guestfs-actions.pod:2606
8706 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8711 #: ../src/guestfs-actions.pod:2608 ../fish/guestfish-actions.pod:2061
8713 "This inspection command looks for filesystems on partitions, block devices "
8714 "and logical volumes, returning a list of devices containing filesystems and "
8719 #: ../src/guestfs-actions.pod:2612 ../fish/guestfish-actions.pod:2065
8721 "The return value is a hash, where the keys are the devices containing "
8722 "filesystems, and the values are the filesystem types. For example:"
8726 #: ../src/guestfs-actions.pod:2616 ../fish/guestfish-actions.pod:2069
8729 " \"/dev/sda1\" => \"ntfs\"\n"
8730 " \"/dev/sda2\" => \"ext2\"\n"
8731 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8732 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8737 #: ../src/guestfs-actions.pod:2621 ../fish/guestfish-actions.pod:2074
8739 "The value can have the special value \"unknown\", meaning the content of the "
8740 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8744 #: ../src/guestfs-actions.pod:2625
8746 "This command runs other libguestfs commands, which might include "
8747 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8748 "soon after launch and only when nothing is mounted."
8752 #: ../src/guestfs-actions.pod:2629
8754 "Not all of the filesystems returned will be mountable. In particular, swap "
8755 "partitions are returned in the list. Also this command does not check that "
8756 "each filesystem found is valid and mountable, and some filesystems might be "
8757 "mountable but require special options. Filesystems may not all belong to a "
8758 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
8762 #: ../src/guestfs-actions.pod:2643
8763 msgid "guestfs_list_partitions"
8767 #: ../src/guestfs-actions.pod:2645
8770 " char **guestfs_list_partitions (guestfs_h *g);\n"
8775 #: ../src/guestfs-actions.pod:2647 ../fish/guestfish-actions.pod:2094
8776 msgid "List all the partitions detected on all block devices."
8780 #: ../src/guestfs-actions.pod:2649 ../fish/guestfish-actions.pod:2096
8781 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8785 #: ../src/guestfs-actions.pod:2651
8787 "This does not return logical volumes. For that you will need to call "
8792 #: ../src/guestfs-actions.pod:2660
8797 #: ../src/guestfs-actions.pod:2662
8800 " char *guestfs_ll (guestfs_h *g,\n"
8801 "\t\tconst char *directory);\n"
8806 #: ../src/guestfs-actions.pod:2665 ../fish/guestfish-actions.pod:2107
8808 "List the files in C<directory> (relative to the root directory, there is no "
8809 "cwd) in the format of 'ls -la'."
8813 #: ../src/guestfs-actions.pod:2668 ../fish/guestfish-actions.pod:2110
8815 "This command is mostly useful for interactive sessions. It is I<not> "
8816 "intended that you try to parse the output string."
8820 #: ../src/guestfs-actions.pod:2674
8825 #: ../src/guestfs-actions.pod:2676
8828 " int guestfs_ln (guestfs_h *g,\n"
8829 "\t\tconst char *target,\n"
8830 "\t\tconst char *linkname);\n"
8835 #: ../src/guestfs-actions.pod:2680 ../fish/guestfish-actions.pod:2117
8836 msgid "This command creates a hard link using the C<ln> command."
8840 #: ../src/guestfs-actions.pod:2684
8841 msgid "guestfs_ln_f"
8845 #: ../src/guestfs-actions.pod:2686
8848 " int guestfs_ln_f (guestfs_h *g,\n"
8849 "\t\tconst char *target,\n"
8850 "\t\tconst char *linkname);\n"
8855 #: ../src/guestfs-actions.pod:2690 ../fish/guestfish-actions.pod:2123
8857 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8858 "option removes the link (C<linkname>) if it exists already."
8862 #: ../src/guestfs-actions.pod:2695
8863 msgid "guestfs_ln_s"
8867 #: ../src/guestfs-actions.pod:2697
8870 " int guestfs_ln_s (guestfs_h *g,\n"
8871 "\t\tconst char *target,\n"
8872 "\t\tconst char *linkname);\n"
8877 #: ../src/guestfs-actions.pod:2701 ../fish/guestfish-actions.pod:2130
8878 msgid "This command creates a symbolic link using the C<ln -s> command."
8882 #: ../src/guestfs-actions.pod:2705
8883 msgid "guestfs_ln_sf"
8887 #: ../src/guestfs-actions.pod:2707
8890 " int guestfs_ln_sf (guestfs_h *g,\n"
8891 "\t\tconst char *target,\n"
8892 "\t\tconst char *linkname);\n"
8897 #: ../src/guestfs-actions.pod:2711 ../fish/guestfish-actions.pod:2136
8899 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8900 "option removes the link (C<linkname>) if it exists already."
8904 #: ../src/guestfs-actions.pod:2716
8905 msgid "guestfs_lremovexattr"
8909 #: ../src/guestfs-actions.pod:2718
8912 " int guestfs_lremovexattr (guestfs_h *g,\n"
8913 "\t\tconst char *xattr,\n"
8914 "\t\tconst char *path);\n"
8919 #: ../src/guestfs-actions.pod:2722
8921 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8922 "link, then it removes an extended attribute of the link itself."
8926 #: ../src/guestfs-actions.pod:2728
8931 #: ../src/guestfs-actions.pod:2730
8934 " char **guestfs_ls (guestfs_h *g,\n"
8935 "\t\tconst char *directory);\n"
8940 #: ../src/guestfs-actions.pod:2733 ../fish/guestfish-actions.pod:2151
8942 "List the files in C<directory> (relative to the root directory, there is no "
8943 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
8947 #: ../src/guestfs-actions.pod:2737
8949 "This command is mostly useful for interactive sessions. Programs should "
8950 "probably use C<guestfs_readdir> instead."
8954 #: ../src/guestfs-actions.pod:2744
8955 msgid "guestfs_lsetxattr"
8959 #: ../src/guestfs-actions.pod:2746
8962 " int guestfs_lsetxattr (guestfs_h *g,\n"
8963 "\t\tconst char *xattr,\n"
8964 "\t\tconst char *val,\n"
8966 "\t\tconst char *path);\n"
8971 #: ../src/guestfs-actions.pod:2752
8973 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8974 "then it sets an extended attribute of the link itself."
8978 #: ../src/guestfs-actions.pod:2758
8979 msgid "guestfs_lstat"
8983 #: ../src/guestfs-actions.pod:2760
8986 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8987 "\t\tconst char *path);\n"
8992 #: ../src/guestfs-actions.pod:2763 ../src/guestfs-actions.pod:4839
8993 #: ../fish/guestfish-actions.pod:2170 ../fish/guestfish-actions.pod:3752
8994 msgid "Returns file information for the given C<path>."
8998 #: ../src/guestfs-actions.pod:2765
9000 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
9001 "link, then the link is stat-ed, not the file it refers to."
9005 #: ../src/guestfs-actions.pod:2769 ../fish/guestfish-actions.pod:2176
9006 msgid "This is the same as the C<lstat(2)> system call."
9010 #: ../src/guestfs-actions.pod:2771 ../src/guestfs-actions.pod:4843
9012 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
9013 "error. I<The caller must call C<guestfs_free_stat> after use>."
9017 #: ../src/guestfs-actions.pod:2775
9018 msgid "guestfs_lstatlist"
9022 #: ../src/guestfs-actions.pod:2777
9025 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
9026 "\t\tconst char *path,\n"
9027 "\t\tchar *const *names);\n"
9032 #: ../src/guestfs-actions.pod:2781
9034 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
9035 "files, where all files are in the directory C<path>. C<names> is the list "
9036 "of files from this directory."
9040 #: ../src/guestfs-actions.pod:2785 ../fish/guestfish-actions.pod:2186
9042 "On return you get a list of stat structs, with a one-to-one correspondence "
9043 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9044 "then the C<ino> field of that structure is set to C<-1>."
9048 #: ../src/guestfs-actions.pod:2790
9050 "This call is intended for programs that want to efficiently list a directory "
9051 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
9052 "for a similarly efficient call for getting extended attributes. Very long "
9053 "directory listings might cause the protocol message size to be exceeded, "
9054 "causing this call to fail. The caller must split up such requests into "
9055 "smaller groups of names."
9059 #: ../src/guestfs-actions.pod:2798
9061 "This function returns a C<struct guestfs_stat_list *> (see E<lt>guestfs-"
9062 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9063 "C<guestfs_free_stat_list> after use>."
9067 #: ../src/guestfs-actions.pod:2803
9068 msgid "guestfs_luks_add_key"
9072 #: ../src/guestfs-actions.pod:2805
9075 " int guestfs_luks_add_key (guestfs_h *g,\n"
9076 "\t\tconst char *device,\n"
9077 "\t\tconst char *key,\n"
9078 "\t\tconst char *newkey,\n"
9079 "\t\tint keyslot);\n"
9084 #: ../src/guestfs-actions.pod:2811 ../fish/guestfish-actions.pod:2203
9086 "This command adds a new key on LUKS device C<device>. C<key> is any "
9087 "existing key, and is used to access the device. C<newkey> is the new key to "
9088 "add. C<keyslot> is the key slot that will be replaced."
9092 #: ../src/guestfs-actions.pod:2816
9094 "Note that if C<keyslot> already contains a key, then this command will "
9095 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
9099 #: ../src/guestfs-actions.pod:2822 ../src/guestfs-actions.pod:2856
9100 #: ../src/guestfs-actions.pod:2876 ../src/guestfs-actions.pod:2893
9101 #: ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:2938
9103 "This function takes a key or passphrase parameter which could contain "
9104 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
9109 #: ../src/guestfs-actions.pod:2826
9110 msgid "guestfs_luks_close"
9114 #: ../src/guestfs-actions.pod:2828
9117 " int guestfs_luks_close (guestfs_h *g,\n"
9118 "\t\tconst char *device);\n"
9123 #: ../src/guestfs-actions.pod:2831
9125 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
9126 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
9127 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9128 "underlying block device."
9132 #: ../src/guestfs-actions.pod:2839
9133 msgid "guestfs_luks_format"
9137 #: ../src/guestfs-actions.pod:2841
9140 " int guestfs_luks_format (guestfs_h *g,\n"
9141 "\t\tconst char *device,\n"
9142 "\t\tconst char *key,\n"
9143 "\t\tint keyslot);\n"
9148 #: ../src/guestfs-actions.pod:2846 ../fish/guestfish-actions.pod:2229
9150 "This command erases existing data on C<device> and formats the device as a "
9151 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9152 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9156 #: ../src/guestfs-actions.pod:2853 ../src/guestfs-actions.pod:2873
9157 #: ../src/guestfs-actions.pod:2992 ../src/guestfs-actions.pod:3719
9158 #: ../src/guestfs-actions.pod:4380 ../src/guestfs-actions.pod:4701
9159 #: ../src/guestfs-actions.pod:4721 ../src/guestfs-actions.pod:4744
9160 #: ../src/guestfs-actions.pod:5709 ../fish/guestfish-actions.pod:2237
9161 #: ../fish/guestfish-actions.pod:2250 ../fish/guestfish-actions.pod:2334
9162 #: ../fish/guestfish-actions.pod:2864 ../fish/guestfish-actions.pod:3371
9163 #: ../fish/guestfish-actions.pod:3651 ../fish/guestfish-actions.pod:3667
9164 #: ../fish/guestfish-actions.pod:3682 ../fish/guestfish-actions.pod:4397
9166 "B<This command is dangerous. Without careful use you can easily destroy all "
9171 #: ../src/guestfs-actions.pod:2860
9172 msgid "guestfs_luks_format_cipher"
9176 #: ../src/guestfs-actions.pod:2862
9179 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
9180 "\t\tconst char *device,\n"
9181 "\t\tconst char *key,\n"
9182 "\t\tint keyslot,\n"
9183 "\t\tconst char *cipher);\n"
9188 #: ../src/guestfs-actions.pod:2868
9190 "This command is the same as C<guestfs_luks_format> but it also allows you to "
9191 "set the C<cipher> used."
9195 #: ../src/guestfs-actions.pod:2880
9196 msgid "guestfs_luks_kill_slot"
9200 #: ../src/guestfs-actions.pod:2882
9203 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
9204 "\t\tconst char *device,\n"
9205 "\t\tconst char *key,\n"
9206 "\t\tint keyslot);\n"
9211 #: ../src/guestfs-actions.pod:2887 ../fish/guestfish-actions.pod:2257
9213 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9214 "device C<device>. C<key> must be one of the I<other> keys."
9218 #: ../src/guestfs-actions.pod:2897
9219 msgid "guestfs_luks_open"
9223 #: ../src/guestfs-actions.pod:2899
9226 " int guestfs_luks_open (guestfs_h *g,\n"
9227 "\t\tconst char *device,\n"
9228 "\t\tconst char *key,\n"
9229 "\t\tconst char *mapname);\n"
9234 #: ../src/guestfs-actions.pod:2904 ../fish/guestfish-actions.pod:2268
9236 "This command opens a block device which has been encrypted according to the "
9237 "Linux Unified Key Setup (LUKS) standard."
9241 #: ../src/guestfs-actions.pod:2907 ../fish/guestfish-actions.pod:2271
9242 msgid "C<device> is the encrypted block device or partition."
9246 #: ../src/guestfs-actions.pod:2909 ../fish/guestfish-actions.pod:2273
9248 "The caller must supply one of the keys associated with the LUKS block "
9249 "device, in the C<key> parameter."
9253 #: ../src/guestfs-actions.pod:2912 ../fish/guestfish-actions.pod:2276
9255 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9256 "writes to this block device are decrypted from and encrypted to the "
9257 "underlying C<device> respectively."
9261 #: ../src/guestfs-actions.pod:2916
9263 "If this block device contains LVM volume groups, then calling "
9264 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
9269 #: ../src/guestfs-actions.pod:2926
9270 msgid "guestfs_luks_open_ro"
9274 #: ../src/guestfs-actions.pod:2928
9277 " int guestfs_luks_open_ro (guestfs_h *g,\n"
9278 "\t\tconst char *device,\n"
9279 "\t\tconst char *key,\n"
9280 "\t\tconst char *mapname);\n"
9285 #: ../src/guestfs-actions.pod:2933
9287 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
9292 #: ../src/guestfs-actions.pod:2942
9293 msgid "guestfs_lvcreate"
9297 #: ../src/guestfs-actions.pod:2944
9300 " int guestfs_lvcreate (guestfs_h *g,\n"
9301 "\t\tconst char *logvol,\n"
9302 "\t\tconst char *volgroup,\n"
9303 "\t\tint mbytes);\n"
9308 #: ../src/guestfs-actions.pod:2949 ../fish/guestfish-actions.pod:2301
9310 "This creates an LVM logical volume called C<logvol> on the volume group "
9311 "C<volgroup>, with C<size> megabytes."
9315 #: ../src/guestfs-actions.pod:2954
9316 msgid "guestfs_lvm_canonical_lv_name"
9320 #: ../src/guestfs-actions.pod:2956
9323 " char *guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
9324 "\t\tconst char *lvname);\n"
9329 #: ../src/guestfs-actions.pod:2959 ../fish/guestfish-actions.pod:2308
9331 "This converts alternative naming schemes for LVs that you might find to the "
9332 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
9337 #: ../src/guestfs-actions.pod:2963 ../fish/guestfish-actions.pod:2312
9339 "This command returns an error if the C<lvname> parameter does not refer to a "
9344 #: ../src/guestfs-actions.pod:2966
9345 msgid "See also C<guestfs_is_lv>."
9349 #: ../src/guestfs-actions.pod:2971
9350 msgid "guestfs_lvm_clear_filter"
9354 #: ../src/guestfs-actions.pod:2973
9357 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
9362 #: ../src/guestfs-actions.pod:2975
9364 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
9365 "see every block device."
9369 #: ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:3014
9370 #: ../fish/guestfish-actions.pod:2324 ../fish/guestfish-actions.pod:2355
9372 "This command also clears the LVM cache and performs a volume group scan."
9376 #: ../src/guestfs-actions.pod:2983
9377 msgid "guestfs_lvm_remove_all"
9381 #: ../src/guestfs-actions.pod:2985
9384 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
9389 #: ../src/guestfs-actions.pod:2987 ../fish/guestfish-actions.pod:2331
9391 "This command removes all LVM logical volumes, volume groups and physical "
9396 #: ../src/guestfs-actions.pod:2995
9397 msgid "guestfs_lvm_set_filter"
9401 #: ../src/guestfs-actions.pod:2997
9404 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
9405 "\t\tchar *const *devices);\n"
9410 #: ../src/guestfs-actions.pod:3000 ../fish/guestfish-actions.pod:2341
9412 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9413 "block devices in the list C<devices>, and will ignore all other attached "
9418 #: ../src/guestfs-actions.pod:3004 ../fish/guestfish-actions.pod:2345
9420 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9421 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9422 "there are two types of duplication possible: either cloned PVs/VGs which "
9423 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9424 "same name. In normal operation you cannot create this situation, but you "
9425 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9426 "inside the LVM metadata."
9430 #: ../src/guestfs-actions.pod:3017 ../fish/guestfish-actions.pod:2358
9431 msgid "You can filter whole block devices or individual partitions."
9435 #: ../src/guestfs-actions.pod:3019 ../fish/guestfish-actions.pod:2360
9437 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9438 "filesystem), even if you are not filtering out that VG."
9442 #: ../src/guestfs-actions.pod:3025
9443 msgid "guestfs_lvremove"
9447 #: ../src/guestfs-actions.pod:3027
9450 " int guestfs_lvremove (guestfs_h *g,\n"
9451 "\t\tconst char *device);\n"
9456 #: ../src/guestfs-actions.pod:3030 ../fish/guestfish-actions.pod:2368
9458 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9459 "LV, such as C</dev/VG/LV>."
9463 #: ../src/guestfs-actions.pod:3033 ../fish/guestfish-actions.pod:2371
9465 "You can also remove all LVs in a volume group by specifying the VG name, C</"
9470 #: ../src/guestfs-actions.pod:3038
9471 msgid "guestfs_lvrename"
9475 #: ../src/guestfs-actions.pod:3040
9478 " int guestfs_lvrename (guestfs_h *g,\n"
9479 "\t\tconst char *logvol,\n"
9480 "\t\tconst char *newlogvol);\n"
9485 #: ../src/guestfs-actions.pod:3044 ../fish/guestfish-actions.pod:2378
9486 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9490 #: ../src/guestfs-actions.pod:3048
9491 msgid "guestfs_lvresize"
9495 #: ../src/guestfs-actions.pod:3050
9498 " int guestfs_lvresize (guestfs_h *g,\n"
9499 "\t\tconst char *device,\n"
9500 "\t\tint mbytes);\n"
9505 #: ../src/guestfs-actions.pod:3054 ../fish/guestfish-actions.pod:2384
9507 "This resizes (expands or shrinks) an existing LVM logical volume to "
9508 "C<mbytes>. When reducing, data in the reduced part is lost."
9512 #: ../src/guestfs-actions.pod:3060
9513 msgid "guestfs_lvresize_free"
9517 #: ../src/guestfs-actions.pod:3062
9520 " int guestfs_lvresize_free (guestfs_h *g,\n"
9521 "\t\tconst char *lv,\n"
9522 "\t\tint percent);\n"
9527 #: ../src/guestfs-actions.pod:3066 ../fish/guestfish-actions.pod:2392
9529 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9530 "remaining free space in the volume group. Commonly you would call this with "
9531 "pc = 100 which expands the logical volume as much as possible, using all "
9532 "remaining free space in the volume group."
9536 #: ../src/guestfs-actions.pod:3074
9541 #: ../src/guestfs-actions.pod:3076
9544 " char **guestfs_lvs (guestfs_h *g);\n"
9549 #: ../src/guestfs-actions.pod:3078 ../fish/guestfish-actions.pod:2402
9551 "List all the logical volumes detected. This is the equivalent of the L<lvs"
9556 #: ../src/guestfs-actions.pod:3081 ../fish/guestfish-actions.pod:2405
9558 "This returns a list of the logical volume device names (eg. C</dev/"
9559 "VolGroup00/LogVol00>)."
9563 #: ../src/guestfs-actions.pod:3084
9564 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
9568 #: ../src/guestfs-actions.pod:3090
9569 msgid "guestfs_lvs_full"
9573 #: ../src/guestfs-actions.pod:3092
9576 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
9581 #: ../src/guestfs-actions.pod:3094 ../fish/guestfish-actions.pod:2414
9583 "List all the logical volumes detected. This is the equivalent of the L<lvs"
9584 "(8)> command. The \"full\" version includes all fields."
9588 #: ../src/guestfs-actions.pod:3097
9590 "This function returns a C<struct guestfs_lvm_lv_list *> (see E<lt>guestfs-"
9591 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9592 "C<guestfs_free_lvm_lv_list> after use>."
9596 #: ../src/guestfs-actions.pod:3102
9597 msgid "guestfs_lvuuid"
9601 #: ../src/guestfs-actions.pod:3104
9604 " char *guestfs_lvuuid (guestfs_h *g,\n"
9605 "\t\tconst char *device);\n"
9610 #: ../src/guestfs-actions.pod:3107 ../fish/guestfish-actions.pod:2421
9611 msgid "This command returns the UUID of the LVM LV C<device>."
9615 #: ../src/guestfs-actions.pod:3112
9616 msgid "guestfs_lxattrlist"
9620 #: ../src/guestfs-actions.pod:3114
9623 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9624 "\t\tconst char *path,\n"
9625 "\t\tchar *const *names);\n"
9630 #: ../src/guestfs-actions.pod:3118 ../fish/guestfish-actions.pod:2427
9632 "This call allows you to get the extended attributes of multiple files, where "
9633 "all files are in the directory C<path>. C<names> is the list of files from "
9638 #: ../src/guestfs-actions.pod:3122 ../fish/guestfish-actions.pod:2431
9640 "On return you get a flat list of xattr structs which must be interpreted "
9641 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9642 "C<attrval> in this struct is zero-length to indicate there was an error "
9643 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9644 "number (the number of following attributes for this file, which could be C<"
9645 "\"0\">). Then after the first xattr struct are the zero or more attributes "
9646 "for the first named file. This repeats for the second and subsequent files."
9650 #: ../src/guestfs-actions.pod:3132
9652 "This call is intended for programs that want to efficiently list a directory "
9653 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9654 "a similarly efficient call for getting standard stats. Very long directory "
9655 "listings might cause the protocol message size to be exceeded, causing this "
9656 "call to fail. The caller must split up such requests into smaller groups of "
9661 #: ../src/guestfs-actions.pod:3145
9662 msgid "guestfs_mkdir"
9666 #: ../src/guestfs-actions.pod:3147
9669 " int guestfs_mkdir (guestfs_h *g,\n"
9670 "\t\tconst char *path);\n"
9675 #: ../src/guestfs-actions.pod:3150 ../fish/guestfish-actions.pod:2453
9676 msgid "Create a directory named C<path>."
9680 #: ../src/guestfs-actions.pod:3154
9681 msgid "guestfs_mkdir_mode"
9685 #: ../src/guestfs-actions.pod:3156
9688 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9689 "\t\tconst char *path,\n"
9695 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2459
9697 "This command creates a directory, setting the initial permissions of the "
9698 "directory to C<mode>."
9702 #: ../src/guestfs-actions.pod:3163 ../fish/guestfish-actions.pod:2462
9704 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9705 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9710 #: ../src/guestfs-actions.pod:3167
9711 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9715 #: ../src/guestfs-actions.pod:3171
9716 msgid "guestfs_mkdir_p"
9720 #: ../src/guestfs-actions.pod:3173
9723 " int guestfs_mkdir_p (guestfs_h *g,\n"
9724 "\t\tconst char *path);\n"
9729 #: ../src/guestfs-actions.pod:3176 ../fish/guestfish-actions.pod:2472
9731 "Create a directory named C<path>, creating any parent directories as "
9732 "necessary. This is like the C<mkdir -p> shell command."
9736 #: ../src/guestfs-actions.pod:3181
9737 msgid "guestfs_mkdtemp"
9741 #: ../src/guestfs-actions.pod:3183
9744 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9745 "\t\tconst char *template);\n"
9750 #: ../src/guestfs-actions.pod:3186 ../fish/guestfish-actions.pod:2479
9752 "This command creates a temporary directory. The C<template> parameter "
9753 "should be a full pathname for the temporary directory name with the final "
9754 "six characters being \"XXXXXX\"."
9758 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2484
9760 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9761 "being suitable for Windows filesystems."
9765 #: ../src/guestfs-actions.pod:3194 ../fish/guestfish-actions.pod:2487
9766 msgid "The name of the temporary directory that was created is returned."
9770 #: ../src/guestfs-actions.pod:3197 ../fish/guestfish-actions.pod:2490
9771 msgid "The temporary directory is created with mode 0700 and is owned by root."
9775 #: ../src/guestfs-actions.pod:3200 ../fish/guestfish-actions.pod:2493
9777 "The caller is responsible for deleting the temporary directory and its "
9778 "contents after use."
9782 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2496
9783 msgid "See also: L<mkdtemp(3)>"
9787 #: ../src/guestfs-actions.pod:3208
9788 msgid "guestfs_mke2fs_J"
9792 #: ../src/guestfs-actions.pod:3210
9795 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9796 "\t\tconst char *fstype,\n"
9797 "\t\tint blocksize,\n"
9798 "\t\tconst char *device,\n"
9799 "\t\tconst char *journal);\n"
9804 #: ../src/guestfs-actions.pod:3216 ../fish/guestfish-actions.pod:2502
9806 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9807 "C<journal>. It is equivalent to the command:"
9811 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2506
9814 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9819 #: ../src/guestfs-actions.pod:3222
9820 msgid "See also C<guestfs_mke2journal>."
9824 #: ../src/guestfs-actions.pod:3226
9825 msgid "guestfs_mke2fs_JL"
9829 #: ../src/guestfs-actions.pod:3228
9832 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9833 "\t\tconst char *fstype,\n"
9834 "\t\tint blocksize,\n"
9835 "\t\tconst char *device,\n"
9836 "\t\tconst char *label);\n"
9841 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2514
9843 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9844 "the journal labeled C<label>."
9848 #: ../src/guestfs-actions.pod:3237
9849 msgid "See also C<guestfs_mke2journal_L>."
9853 #: ../src/guestfs-actions.pod:3241
9854 msgid "guestfs_mke2fs_JU"
9858 #: ../src/guestfs-actions.pod:3243
9861 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9862 "\t\tconst char *fstype,\n"
9863 "\t\tint blocksize,\n"
9864 "\t\tconst char *device,\n"
9865 "\t\tconst char *uuid);\n"
9870 #: ../src/guestfs-actions.pod:3249 ../fish/guestfish-actions.pod:2523
9872 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9873 "the journal with UUID C<uuid>."
9877 #: ../src/guestfs-actions.pod:3252
9878 msgid "See also C<guestfs_mke2journal_U>."
9882 #: ../src/guestfs-actions.pod:3256
9883 msgid "guestfs_mke2journal"
9887 #: ../src/guestfs-actions.pod:3258
9890 " int guestfs_mke2journal (guestfs_h *g,\n"
9891 "\t\tint blocksize,\n"
9892 "\t\tconst char *device);\n"
9897 #: ../src/guestfs-actions.pod:3262 ../fish/guestfish-actions.pod:2532
9899 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9904 #: ../src/guestfs-actions.pod:3265 ../fish/guestfish-actions.pod:2535
9907 " mke2fs -O journal_dev -b blocksize device\n"
9912 #: ../src/guestfs-actions.pod:3269
9913 msgid "guestfs_mke2journal_L"
9917 #: ../src/guestfs-actions.pod:3271
9920 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9921 "\t\tint blocksize,\n"
9922 "\t\tconst char *label,\n"
9923 "\t\tconst char *device);\n"
9928 #: ../src/guestfs-actions.pod:3276 ../fish/guestfish-actions.pod:2541
9929 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9933 #: ../src/guestfs-actions.pod:3280
9934 msgid "guestfs_mke2journal_U"
9938 #: ../src/guestfs-actions.pod:3282
9941 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9942 "\t\tint blocksize,\n"
9943 "\t\tconst char *uuid,\n"
9944 "\t\tconst char *device);\n"
9949 #: ../src/guestfs-actions.pod:3287 ../fish/guestfish-actions.pod:2547
9950 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9954 #: ../src/guestfs-actions.pod:3291
9955 msgid "guestfs_mkfifo"
9959 #: ../src/guestfs-actions.pod:3293
9962 " int guestfs_mkfifo (guestfs_h *g,\n"
9964 "\t\tconst char *path);\n"
9969 #: ../src/guestfs-actions.pod:3297
9971 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9972 "is just a convenient wrapper around C<guestfs_mknod>."
9976 #: ../src/guestfs-actions.pod:3305
9977 msgid "guestfs_mkfs"
9981 #: ../src/guestfs-actions.pod:3307
9984 " int guestfs_mkfs (guestfs_h *g,\n"
9985 "\t\tconst char *fstype,\n"
9986 "\t\tconst char *device);\n"
9991 #: ../src/guestfs-actions.pod:3311 ../fish/guestfish-actions.pod:2563
9993 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9994 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9998 #: ../src/guestfs-actions.pod:3317
9999 msgid "guestfs_mkfs_b"
10003 #: ../src/guestfs-actions.pod:3319
10006 " int guestfs_mkfs_b (guestfs_h *g,\n"
10007 "\t\tconst char *fstype,\n"
10008 "\t\tint blocksize,\n"
10009 "\t\tconst char *device);\n"
10014 #: ../src/guestfs-actions.pod:3324
10016 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
10017 "block size of the resulting filesystem. Supported block sizes depend on the "
10018 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10022 #: ../src/guestfs-actions.pod:3329 ../fish/guestfish-actions.pod:2576
10024 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10029 #: ../src/guestfs-actions.pod:3334
10030 msgid "guestfs_mkmountpoint"
10034 #: ../src/guestfs-actions.pod:3336
10037 " int guestfs_mkmountpoint (guestfs_h *g,\n"
10038 "\t\tconst char *exemptpath);\n"
10043 #: ../src/guestfs-actions.pod:3339
10045 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
10046 "that can be used to create extra mountpoints before mounting the first "
10051 #: ../src/guestfs-actions.pod:3343 ../fish/guestfish-actions.pod:2587
10053 "These calls are I<only> necessary in some very limited circumstances, mainly "
10054 "the case where you want to mount a mix of unrelated and/or read-only "
10055 "filesystems together."
10059 #: ../src/guestfs-actions.pod:3347 ../fish/guestfish-actions.pod:2591
10061 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10062 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10063 "inside that. You can unpack this as follows in guestfish:"
10067 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2596
10070 " add-ro Fedora-11-i686-Live.iso\n"
10072 " mkmountpoint /cd\n"
10073 " mkmountpoint /sqsh\n"
10074 " mkmountpoint /ext3fs\n"
10075 " mount /dev/sda /cd\n"
10076 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10077 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10082 #: ../src/guestfs-actions.pod:3361 ../fish/guestfish-actions.pod:2605
10083 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10087 #: ../src/guestfs-actions.pod:3363
10089 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
10090 "may get unexpected errors if you try to mix these calls. It is safest to "
10091 "manually unmount filesystems and remove mountpoints after use."
10095 #: ../src/guestfs-actions.pod:3367
10097 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
10098 "first, so for this to work for manual mountpoints, you must ensure that the "
10099 "innermost mountpoints have the longest pathnames, as in the example code "
10104 #: ../src/guestfs-actions.pod:3372 ../fish/guestfish-actions.pod:2616
10106 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10110 #: ../src/guestfs-actions.pod:3374
10112 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
10113 "means that C<guestfs_umount_all> is called when the handle is closed which "
10114 "can also trigger these issues."
10118 #: ../src/guestfs-actions.pod:3380
10119 msgid "guestfs_mknod"
10123 #: ../src/guestfs-actions.pod:3382
10126 " int guestfs_mknod (guestfs_h *g,\n"
10128 "\t\tint devmajor,\n"
10129 "\t\tint devminor,\n"
10130 "\t\tconst char *path);\n"
10135 #: ../src/guestfs-actions.pod:3388 ../fish/guestfish-actions.pod:2626
10137 "This call creates block or character special devices, or named pipes (FIFOs)."
10141 #: ../src/guestfs-actions.pod:3391 ../fish/guestfish-actions.pod:2629
10143 "The C<mode> parameter should be the mode, using the standard constants. "
10144 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10145 "used when creating block and character special devices."
10149 #: ../src/guestfs-actions.pod:3396
10151 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10152 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10153 "regular file). These constants are available in the standard Linux header "
10154 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
10155 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
10156 "the appropriate constant for you."
10160 #: ../src/guestfs-actions.pod:3408
10161 msgid "guestfs_mknod_b"
10165 #: ../src/guestfs-actions.pod:3410
10168 " int guestfs_mknod_b (guestfs_h *g,\n"
10170 "\t\tint devmajor,\n"
10171 "\t\tint devminor,\n"
10172 "\t\tconst char *path);\n"
10177 #: ../src/guestfs-actions.pod:3416
10179 "This call creates a block device node called C<path> with mode C<mode> and "
10180 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10181 "wrapper around C<guestfs_mknod>."
10185 #: ../src/guestfs-actions.pod:3424
10186 msgid "guestfs_mknod_c"
10190 #: ../src/guestfs-actions.pod:3426
10193 " int guestfs_mknod_c (guestfs_h *g,\n"
10195 "\t\tint devmajor,\n"
10196 "\t\tint devminor,\n"
10197 "\t\tconst char *path);\n"
10202 #: ../src/guestfs-actions.pod:3432
10204 "This call creates a char device node called C<path> with mode C<mode> and "
10205 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10206 "wrapper around C<guestfs_mknod>."
10210 #: ../src/guestfs-actions.pod:3440
10211 msgid "guestfs_mkswap"
10215 #: ../src/guestfs-actions.pod:3442
10218 " int guestfs_mkswap (guestfs_h *g,\n"
10219 "\t\tconst char *device);\n"
10224 #: ../src/guestfs-actions.pod:3445 ../fish/guestfish-actions.pod:2668
10225 msgid "Create a swap partition on C<device>."
10229 #: ../src/guestfs-actions.pod:3449
10230 msgid "guestfs_mkswap_L"
10234 #: ../src/guestfs-actions.pod:3451
10237 " int guestfs_mkswap_L (guestfs_h *g,\n"
10238 "\t\tconst char *label,\n"
10239 "\t\tconst char *device);\n"
10244 #: ../src/guestfs-actions.pod:3455 ../fish/guestfish-actions.pod:2674
10245 msgid "Create a swap partition on C<device> with label C<label>."
10249 #: ../src/guestfs-actions.pod:3457 ../fish/guestfish-actions.pod:2676
10251 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
10252 "sda>), just to a partition. This appears to be a limitation of the kernel "
10257 #: ../src/guestfs-actions.pod:3463
10258 msgid "guestfs_mkswap_U"
10262 #: ../src/guestfs-actions.pod:3465
10265 " int guestfs_mkswap_U (guestfs_h *g,\n"
10266 "\t\tconst char *uuid,\n"
10267 "\t\tconst char *device);\n"
10272 #: ../src/guestfs-actions.pod:3469 ../fish/guestfish-actions.pod:2684
10273 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10277 #: ../src/guestfs-actions.pod:3473
10278 msgid "guestfs_mkswap_file"
10282 #: ../src/guestfs-actions.pod:3475
10285 " int guestfs_mkswap_file (guestfs_h *g,\n"
10286 "\t\tconst char *path);\n"
10291 #: ../src/guestfs-actions.pod:3478 ../fish/guestfish-actions.pod:2690
10292 msgid "Create a swap file."
10296 #: ../src/guestfs-actions.pod:3480
10298 "This command just writes a swap file signature to an existing file. To "
10299 "create the file itself, use something like C<guestfs_fallocate>."
10303 #: ../src/guestfs-actions.pod:3485
10304 msgid "guestfs_modprobe"
10308 #: ../src/guestfs-actions.pod:3487
10311 " int guestfs_modprobe (guestfs_h *g,\n"
10312 "\t\tconst char *modulename);\n"
10317 #: ../src/guestfs-actions.pod:3490 ../fish/guestfish-actions.pod:2699
10318 msgid "This loads a kernel module in the appliance."
10322 #: ../src/guestfs-actions.pod:3492 ../fish/guestfish-actions.pod:2701
10324 "The kernel module must have been whitelisted when libguestfs was built (see "
10325 "C<appliance/kmod.whitelist.in> in the source)."
10329 #: ../src/guestfs-actions.pod:3497
10330 msgid "guestfs_mount"
10334 #: ../src/guestfs-actions.pod:3499
10337 " int guestfs_mount (guestfs_h *g,\n"
10338 "\t\tconst char *device,\n"
10339 "\t\tconst char *mountpoint);\n"
10344 #: ../src/guestfs-actions.pod:3503 ../fish/guestfish-actions.pod:2708
10346 "Mount a guest disk at a position in the filesystem. Block devices are named "
10347 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10348 "those block devices contain partitions, they will have the usual names (eg. "
10349 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10353 #: ../src/guestfs-actions.pod:3509 ../fish/guestfish-actions.pod:2714
10355 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10356 "mounted on C</> before others can be mounted. Other filesystems can only be "
10357 "mounted on directories which already exist."
10361 #: ../src/guestfs-actions.pod:3514 ../fish/guestfish-actions.pod:2719
10363 "The mounted filesystem is writable, if we have sufficient permissions on the "
10364 "underlying device."
10368 #: ../src/guestfs-actions.pod:3517
10370 "B<Important note:> When you use this call, the filesystem options C<sync> "
10371 "and C<noatime> are set implicitly. This was originally done because we "
10372 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10373 "very large negative performance impact and negligible effect on "
10374 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
10375 "in any code that needs performance, and instead use C<guestfs_mount_options> "
10376 "(use an empty string for the first parameter if you don't want any options)."
10380 #: ../src/guestfs-actions.pod:3529
10381 msgid "guestfs_mount_loop"
10385 #: ../src/guestfs-actions.pod:3531
10388 " int guestfs_mount_loop (guestfs_h *g,\n"
10389 "\t\tconst char *file,\n"
10390 "\t\tconst char *mountpoint);\n"
10395 #: ../src/guestfs-actions.pod:3535 ../fish/guestfish-actions.pod:2736
10397 "This command lets you mount C<file> (a filesystem image in a file) on a "
10398 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10403 #: ../src/guestfs-actions.pod:3541
10404 msgid "guestfs_mount_options"
10408 #: ../src/guestfs-actions.pod:3543
10411 " int guestfs_mount_options (guestfs_h *g,\n"
10412 "\t\tconst char *options,\n"
10413 "\t\tconst char *device,\n"
10414 "\t\tconst char *mountpoint);\n"
10419 #: ../src/guestfs-actions.pod:3548
10421 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10422 "the mount options as for the L<mount(8)> I<-o> flag."
10426 #: ../src/guestfs-actions.pod:3552 ../fish/guestfish-actions.pod:2748
10428 "If the C<options> parameter is an empty string, then no options are passed "
10429 "(all options default to whatever the filesystem uses)."
10433 #: ../src/guestfs-actions.pod:3558
10434 msgid "guestfs_mount_ro"
10438 #: ../src/guestfs-actions.pod:3560
10441 " int guestfs_mount_ro (guestfs_h *g,\n"
10442 "\t\tconst char *device,\n"
10443 "\t\tconst char *mountpoint);\n"
10448 #: ../src/guestfs-actions.pod:3564
10450 "This is the same as the C<guestfs_mount> command, but it mounts the "
10451 "filesystem with the read-only (I<-o ro>) flag."
10455 #: ../src/guestfs-actions.pod:3569
10456 msgid "guestfs_mount_vfs"
10460 #: ../src/guestfs-actions.pod:3571
10463 " int guestfs_mount_vfs (guestfs_h *g,\n"
10464 "\t\tconst char *options,\n"
10465 "\t\tconst char *vfstype,\n"
10466 "\t\tconst char *device,\n"
10467 "\t\tconst char *mountpoint);\n"
10472 #: ../src/guestfs-actions.pod:3577
10474 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10475 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
10480 #: ../src/guestfs-actions.pod:3583
10481 msgid "guestfs_mountpoints"
10485 #: ../src/guestfs-actions.pod:3585
10488 " char **guestfs_mountpoints (guestfs_h *g);\n"
10493 #: ../src/guestfs-actions.pod:3587
10495 "This call is similar to C<guestfs_mounts>. That call returns a list of "
10496 "devices. This one returns a hash table (map) of device name to directory "
10497 "where the device is mounted."
10501 #: ../src/guestfs-actions.pod:3597
10502 msgid "guestfs_mounts"
10506 #: ../src/guestfs-actions.pod:3599
10509 " char **guestfs_mounts (guestfs_h *g);\n"
10514 #: ../src/guestfs-actions.pod:3601 ../fish/guestfish-actions.pod:2779
10516 "This returns the list of currently mounted filesystems. It returns the list "
10517 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10521 #: ../src/guestfs-actions.pod:3604 ../fish/guestfish-actions.pod:2782
10522 msgid "Some internal mounts are not shown."
10526 #: ../src/guestfs-actions.pod:3606
10527 msgid "See also: C<guestfs_mountpoints>"
10531 #: ../src/guestfs-actions.pod:3612
10536 #: ../src/guestfs-actions.pod:3614
10539 " int guestfs_mv (guestfs_h *g,\n"
10540 "\t\tconst char *src,\n"
10541 "\t\tconst char *dest);\n"
10546 #: ../src/guestfs-actions.pod:3618 ../fish/guestfish-actions.pod:2790
10548 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10549 "destination filename or destination directory."
10553 #: ../src/guestfs-actions.pod:3623
10554 msgid "guestfs_ntfs_3g_probe"
10558 #: ../src/guestfs-actions.pod:3625
10561 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
10563 "\t\tconst char *device);\n"
10568 #: ../src/guestfs-actions.pod:3629 ../fish/guestfish-actions.pod:2797
10570 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10571 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
10572 "write, and some cannot be mounted at all)."
10576 #: ../src/guestfs-actions.pod:3633 ../fish/guestfish-actions.pod:2801
10578 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10579 "can be mounted read-write. Set it to false if you want to test if the "
10580 "volume can be mounted read-only."
10584 #: ../src/guestfs-actions.pod:3637 ../fish/guestfish-actions.pod:2805
10586 "The return value is an integer which C<0> if the operation would succeed, or "
10587 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10591 #: ../src/guestfs-actions.pod:3643
10592 msgid "guestfs_ntfsresize"
10596 #: ../src/guestfs-actions.pod:3645
10599 " int guestfs_ntfsresize (guestfs_h *g,\n"
10600 "\t\tconst char *device);\n"
10605 #: ../src/guestfs-actions.pod:3648 ../fish/guestfish-actions.pod:2813
10607 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10608 "size of the underlying device. See also L<ntfsresize(8)>."
10612 #: ../src/guestfs-actions.pod:3654
10613 msgid "guestfs_ntfsresize_size"
10617 #: ../src/guestfs-actions.pod:3656
10620 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
10621 "\t\tconst char *device,\n"
10622 "\t\tint64_t size);\n"
10627 #: ../src/guestfs-actions.pod:3660
10629 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10630 "to specify the new size (in bytes) explicitly."
10634 #: ../src/guestfs-actions.pod:3665
10635 msgid "guestfs_part_add"
10639 #: ../src/guestfs-actions.pod:3667
10642 " int guestfs_part_add (guestfs_h *g,\n"
10643 "\t\tconst char *device,\n"
10644 "\t\tconst char *prlogex,\n"
10645 "\t\tint64_t startsect,\n"
10646 "\t\tint64_t endsect);\n"
10651 #: ../src/guestfs-actions.pod:3673
10653 "This command adds a partition to C<device>. If there is no partition table "
10654 "on the device, call C<guestfs_part_init> first."
10658 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2831
10660 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10661 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10662 "C<logical>) and C<e> (or C<extended>) partition types."
10666 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2836
10668 "C<startsect> and C<endsect> are the start and end of the partition in "
10669 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10670 "from the end of the disk (C<-1> is the last sector)."
10674 #: ../src/guestfs-actions.pod:3685
10676 "Creating a partition which covers the whole disk is not so easy. Use "
10677 "C<guestfs_part_disk> to do that."
10681 #: ../src/guestfs-actions.pod:3690
10682 msgid "guestfs_part_del"
10686 #: ../src/guestfs-actions.pod:3692
10689 " int guestfs_part_del (guestfs_h *g,\n"
10690 "\t\tconst char *device,\n"
10691 "\t\tint partnum);\n"
10696 #: ../src/guestfs-actions.pod:3696 ../fish/guestfish-actions.pod:2847
10697 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10701 #: ../src/guestfs-actions.pod:3698 ../fish/guestfish-actions.pod:2849
10703 "Note that in the case of MBR partitioning, deleting an extended partition "
10704 "also deletes any logical partitions it contains."
10708 #: ../src/guestfs-actions.pod:3704
10709 msgid "guestfs_part_disk"
10713 #: ../src/guestfs-actions.pod:3706
10716 " int guestfs_part_disk (guestfs_h *g,\n"
10717 "\t\tconst char *device,\n"
10718 "\t\tconst char *parttype);\n"
10723 #: ../src/guestfs-actions.pod:3710
10725 "This command is simply a combination of C<guestfs_part_init> followed by "
10726 "C<guestfs_part_add> to create a single primary partition covering the whole "
10731 #: ../src/guestfs-actions.pod:3714
10733 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10734 "possible values are described in C<guestfs_part_init>."
10738 #: ../src/guestfs-actions.pod:3722
10739 msgid "guestfs_part_get_bootable"
10743 #: ../src/guestfs-actions.pod:3724
10746 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10747 "\t\tconst char *device,\n"
10748 "\t\tint partnum);\n"
10753 #: ../src/guestfs-actions.pod:3728 ../fish/guestfish-actions.pod:2871
10755 "This command returns true if the partition C<partnum> on C<device> has the "
10756 "bootable flag set."
10760 #: ../src/guestfs-actions.pod:3731
10761 msgid "See also C<guestfs_part_set_bootable>."
10765 #: ../src/guestfs-actions.pod:3735
10766 msgid "guestfs_part_get_mbr_id"
10770 #: ../src/guestfs-actions.pod:3737
10773 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10774 "\t\tconst char *device,\n"
10775 "\t\tint partnum);\n"
10780 #: ../src/guestfs-actions.pod:3741 ../fish/guestfish-actions.pod:2880
10782 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10783 "partition C<partnum>."
10787 #: ../src/guestfs-actions.pod:3744 ../src/guestfs-actions.pod:3906
10789 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10790 "undefined results for other partition table types (see "
10791 "C<guestfs_part_get_parttype>)."
10795 #: ../src/guestfs-actions.pod:3750
10796 msgid "guestfs_part_get_parttype"
10800 #: ../src/guestfs-actions.pod:3752
10803 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10804 "\t\tconst char *device);\n"
10809 #: ../src/guestfs-actions.pod:3755 ../fish/guestfish-actions.pod:2891
10811 "This command examines the partition table on C<device> and returns the "
10812 "partition table type (format) being used."
10816 #: ../src/guestfs-actions.pod:3758
10818 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10819 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10820 "possible, although unusual. See C<guestfs_part_init> for a full list."
10824 #: ../src/guestfs-actions.pod:3766
10825 msgid "guestfs_part_init"
10829 #: ../src/guestfs-actions.pod:3768
10832 " int guestfs_part_init (guestfs_h *g,\n"
10833 "\t\tconst char *device,\n"
10834 "\t\tconst char *parttype);\n"
10839 #: ../src/guestfs-actions.pod:3772 ../fish/guestfish-actions.pod:2903
10841 "This creates an empty partition table on C<device> of one of the partition "
10842 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10843 "(for large disks)."
10847 #: ../src/guestfs-actions.pod:3776
10849 "Initially there are no partitions. Following this, you should call "
10850 "C<guestfs_part_add> for each partition required."
10854 #: ../src/guestfs-actions.pod:3779 ../fish/guestfish-actions.pod:2910
10855 msgid "Possible values for C<parttype> are:"
10859 #: ../src/guestfs-actions.pod:3783 ../fish/guestfish-actions.pod:2914
10860 msgid "B<efi> | B<gpt>"
10864 #: ../src/guestfs-actions.pod:3785 ../fish/guestfish-actions.pod:2916
10865 msgid "Intel EFI / GPT partition table."
10869 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2918
10871 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10872 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10873 "the C<mbr> format."
10877 #: ../src/guestfs-actions.pod:3791 ../fish/guestfish-actions.pod:2922
10878 msgid "B<mbr> | B<msdos>"
10882 #: ../src/guestfs-actions.pod:3793 ../fish/guestfish-actions.pod:2924
10884 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10885 "Windows. This partition type will B<only> work for device sizes up to 2 "
10886 "TB. For large disks we recommend using C<gpt>."
10890 #: ../src/guestfs-actions.pod:3800 ../fish/guestfish-actions.pod:2931
10892 "Other partition table types that may work but are not supported include:"
10896 #: ../src/guestfs-actions.pod:3805 ../fish/guestfish-actions.pod:2936
10901 #: ../src/guestfs-actions.pod:3807 ../fish/guestfish-actions.pod:2938
10902 msgid "AIX disk labels."
10906 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2940
10907 msgid "B<amiga> | B<rdb>"
10911 #: ../src/guestfs-actions.pod:3811 ../fish/guestfish-actions.pod:2942
10912 msgid "Amiga \"Rigid Disk Block\" format."
10916 #: ../src/guestfs-actions.pod:3813 ../fish/guestfish-actions.pod:2944
10921 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2946
10922 msgid "BSD disk labels."
10926 #: ../src/guestfs-actions.pod:3817 ../fish/guestfish-actions.pod:2948
10931 #: ../src/guestfs-actions.pod:3819 ../fish/guestfish-actions.pod:2950
10932 msgid "DASD, used on IBM mainframes."
10936 #: ../src/guestfs-actions.pod:3821 ../fish/guestfish-actions.pod:2952
10941 #: ../src/guestfs-actions.pod:3823 ../fish/guestfish-actions.pod:2954
10942 msgid "MIPS/SGI volumes."
10946 #: ../src/guestfs-actions.pod:3825 ../fish/guestfish-actions.pod:2956
10951 #: ../src/guestfs-actions.pod:3827 ../fish/guestfish-actions.pod:2958
10952 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10956 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2960
10961 #: ../src/guestfs-actions.pod:3831 ../fish/guestfish-actions.pod:2962
10962 msgid "NEC PC-98 format, common in Japan apparently."
10966 #: ../src/guestfs-actions.pod:3833 ../fish/guestfish-actions.pod:2964
10971 #: ../src/guestfs-actions.pod:3835 ../fish/guestfish-actions.pod:2966
10972 msgid "Sun disk labels."
10976 #: ../src/guestfs-actions.pod:3841
10977 msgid "guestfs_part_list"
10981 #: ../src/guestfs-actions.pod:3843
10984 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10985 "\t\tconst char *device);\n"
10990 #: ../src/guestfs-actions.pod:3846 ../fish/guestfish-actions.pod:2974
10992 "This command parses the partition table on C<device> and returns the list of "
10993 "partitions found."
10997 #: ../src/guestfs-actions.pod:3849 ../fish/guestfish-actions.pod:2977
10998 msgid "The fields in the returned structure are:"
11002 #: ../src/guestfs-actions.pod:3853 ../fish/guestfish-actions.pod:2981
11003 msgid "B<part_num>"
11007 #: ../src/guestfs-actions.pod:3855 ../fish/guestfish-actions.pod:2983
11008 msgid "Partition number, counting from 1."
11012 #: ../src/guestfs-actions.pod:3857 ../fish/guestfish-actions.pod:2985
11013 msgid "B<part_start>"
11017 #: ../src/guestfs-actions.pod:3859
11019 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11020 "the device's sector size, see C<guestfs_blockdev_getss>."
11024 #: ../src/guestfs-actions.pod:3862 ../fish/guestfish-actions.pod:2990
11025 msgid "B<part_end>"
11029 #: ../src/guestfs-actions.pod:3864 ../fish/guestfish-actions.pod:2992
11030 msgid "End of the partition in bytes."
11034 #: ../src/guestfs-actions.pod:3866 ../fish/guestfish-actions.pod:2994
11035 msgid "B<part_size>"
11039 #: ../src/guestfs-actions.pod:3868 ../fish/guestfish-actions.pod:2996
11040 msgid "Size of the partition in bytes."
11044 #: ../src/guestfs-actions.pod:3872
11046 "This function returns a C<struct guestfs_partition_list *> (see E<lt>guestfs-"
11047 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11048 "C<guestfs_free_partition_list> after use>."
11052 #: ../src/guestfs-actions.pod:3877
11053 msgid "guestfs_part_set_bootable"
11057 #: ../src/guestfs-actions.pod:3879
11060 " int guestfs_part_set_bootable (guestfs_h *g,\n"
11061 "\t\tconst char *device,\n"
11062 "\t\tint partnum,\n"
11063 "\t\tint bootable);\n"
11068 #: ../src/guestfs-actions.pod:3884 ../fish/guestfish-actions.pod:3004
11070 "This sets the bootable flag on partition numbered C<partnum> on device "
11071 "C<device>. Note that partitions are numbered from 1."
11075 #: ../src/guestfs-actions.pod:3887 ../fish/guestfish-actions.pod:3007
11077 "The bootable flag is used by some operating systems (notably Windows) to "
11078 "determine which partition to boot from. It is by no means universally "
11083 #: ../src/guestfs-actions.pod:3893
11084 msgid "guestfs_part_set_mbr_id"
11088 #: ../src/guestfs-actions.pod:3895
11091 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
11092 "\t\tconst char *device,\n"
11093 "\t\tint partnum,\n"
11094 "\t\tint idbyte);\n"
11099 #: ../src/guestfs-actions.pod:3900 ../fish/guestfish-actions.pod:3015
11101 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11102 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11103 "documentation are in fact hexadecimal numbers, but usually documented "
11104 "without any leading \"0x\" which might be confusing."
11108 #: ../src/guestfs-actions.pod:3912
11109 msgid "guestfs_part_set_name"
11113 #: ../src/guestfs-actions.pod:3914
11116 " int guestfs_part_set_name (guestfs_h *g,\n"
11117 "\t\tconst char *device,\n"
11118 "\t\tint partnum,\n"
11119 "\t\tconst char *name);\n"
11124 #: ../src/guestfs-actions.pod:3919 ../fish/guestfish-actions.pod:3029
11126 "This sets the partition name on partition numbered C<partnum> on device "
11127 "C<device>. Note that partitions are numbered from 1."
11131 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:3032
11133 "The partition name can only be set on certain types of partition table. "
11134 "This works on C<gpt> but not on C<mbr> partitions."
11138 #: ../src/guestfs-actions.pod:3927
11139 msgid "guestfs_part_to_dev"
11143 #: ../src/guestfs-actions.pod:3929
11146 " char *guestfs_part_to_dev (guestfs_h *g,\n"
11147 "\t\tconst char *partition);\n"
11152 #: ../src/guestfs-actions.pod:3932 ../fish/guestfish-actions.pod:3039
11154 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11155 "partition number, returning the device name (eg. \"/dev/sdb\")."
11159 #: ../src/guestfs-actions.pod:3936
11161 "The named partition must exist, for example as a string returned from "
11162 "C<guestfs_list_partitions>."
11166 #: ../src/guestfs-actions.pod:3942
11167 msgid "guestfs_ping_daemon"
11171 #: ../src/guestfs-actions.pod:3944
11174 " int guestfs_ping_daemon (guestfs_h *g);\n"
11179 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:3050
11181 "This is a test probe into the guestfs daemon running inside the qemu "
11182 "subprocess. Calling this function checks that the daemon responds to the "
11183 "ping message, without affecting the daemon or attached block device(s) in "
11188 #: ../src/guestfs-actions.pod:3953
11189 msgid "guestfs_pread"
11193 #: ../src/guestfs-actions.pod:3955
11196 " char *guestfs_pread (guestfs_h *g,\n"
11197 "\t\tconst char *path,\n"
11199 "\t\tint64_t offset,\n"
11200 "\t\tsize_t *size_r);\n"
11205 #: ../src/guestfs-actions.pod:3961 ../fish/guestfish-actions.pod:3059
11207 "This command lets you read part of a file. It reads C<count> bytes of the "
11208 "file, starting at C<offset>, from file C<path>."
11212 #: ../src/guestfs-actions.pod:3964 ../src/guestfs-actions.pod:3987
11213 #: ../fish/guestfish-actions.pod:3062 ../fish/guestfish-actions.pod:3077
11215 "This may read fewer bytes than requested. For further details see the "
11216 "L<pread(2)> system call."
11220 #: ../src/guestfs-actions.pod:3967
11221 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
11225 #: ../src/guestfs-actions.pod:3976
11226 msgid "guestfs_pread_device"
11230 #: ../src/guestfs-actions.pod:3978
11233 " char *guestfs_pread_device (guestfs_h *g,\n"
11234 "\t\tconst char *device,\n"
11236 "\t\tint64_t offset,\n"
11237 "\t\tsize_t *size_r);\n"
11242 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:3074
11244 "This command lets you read part of a file. It reads C<count> bytes of "
11245 "C<device>, starting at C<offset>."
11249 #: ../src/guestfs-actions.pod:3990
11250 msgid "See also C<guestfs_pread>."
11254 #: ../src/guestfs-actions.pod:3999
11255 msgid "guestfs_pvcreate"
11259 #: ../src/guestfs-actions.pod:4001
11262 " int guestfs_pvcreate (guestfs_h *g,\n"
11263 "\t\tconst char *device);\n"
11268 #: ../src/guestfs-actions.pod:4004 ../fish/guestfish-actions.pod:3089
11270 "This creates an LVM physical volume on the named C<device>, where C<device> "
11271 "should usually be a partition name such as C</dev/sda1>."
11275 #: ../src/guestfs-actions.pod:4010
11276 msgid "guestfs_pvremove"
11280 #: ../src/guestfs-actions.pod:4012
11283 " int guestfs_pvremove (guestfs_h *g,\n"
11284 "\t\tconst char *device);\n"
11289 #: ../src/guestfs-actions.pod:4015 ../fish/guestfish-actions.pod:3097
11291 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11296 #: ../src/guestfs-actions.pod:4018 ../fish/guestfish-actions.pod:3100
11298 "The implementation uses the C<pvremove> command which refuses to wipe "
11299 "physical volumes that contain any volume groups, so you have to remove those "
11304 #: ../src/guestfs-actions.pod:4024
11305 msgid "guestfs_pvresize"
11309 #: ../src/guestfs-actions.pod:4026
11312 " int guestfs_pvresize (guestfs_h *g,\n"
11313 "\t\tconst char *device);\n"
11318 #: ../src/guestfs-actions.pod:4029 ../fish/guestfish-actions.pod:3108
11320 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11321 "the new size of the underlying device."
11325 #: ../src/guestfs-actions.pod:4034
11326 msgid "guestfs_pvresize_size"
11330 #: ../src/guestfs-actions.pod:4036
11333 " int guestfs_pvresize_size (guestfs_h *g,\n"
11334 "\t\tconst char *device,\n"
11335 "\t\tint64_t size);\n"
11340 #: ../src/guestfs-actions.pod:4040
11342 "This command is the same as C<guestfs_pvresize> except that it allows you to "
11343 "specify the new size (in bytes) explicitly."
11347 #: ../src/guestfs-actions.pod:4045
11348 msgid "guestfs_pvs"
11352 #: ../src/guestfs-actions.pod:4047
11355 " char **guestfs_pvs (guestfs_h *g);\n"
11360 #: ../src/guestfs-actions.pod:4049 ../fish/guestfish-actions.pod:3122
11362 "List all the physical volumes detected. This is the equivalent of the L<pvs"
11367 #: ../src/guestfs-actions.pod:4052 ../fish/guestfish-actions.pod:3125
11369 "This returns a list of just the device names that contain PVs (eg. C</dev/"
11374 #: ../src/guestfs-actions.pod:4055
11375 msgid "See also C<guestfs_pvs_full>."
11379 #: ../src/guestfs-actions.pod:4061
11380 msgid "guestfs_pvs_full"
11384 #: ../src/guestfs-actions.pod:4063
11387 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
11392 #: ../src/guestfs-actions.pod:4065 ../fish/guestfish-actions.pod:3134
11394 "List all the physical volumes detected. This is the equivalent of the L<pvs"
11395 "(8)> command. The \"full\" version includes all fields."
11399 #: ../src/guestfs-actions.pod:4068
11401 "This function returns a C<struct guestfs_lvm_pv_list *> (see E<lt>guestfs-"
11402 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11403 "C<guestfs_free_lvm_pv_list> after use>."
11407 #: ../src/guestfs-actions.pod:4073
11408 msgid "guestfs_pvuuid"
11412 #: ../src/guestfs-actions.pod:4075
11415 " char *guestfs_pvuuid (guestfs_h *g,\n"
11416 "\t\tconst char *device);\n"
11421 #: ../src/guestfs-actions.pod:4078 ../fish/guestfish-actions.pod:3141
11422 msgid "This command returns the UUID of the LVM PV C<device>."
11426 #: ../src/guestfs-actions.pod:4083
11427 msgid "guestfs_pwrite"
11431 #: ../src/guestfs-actions.pod:4085
11434 " int guestfs_pwrite (guestfs_h *g,\n"
11435 "\t\tconst char *path,\n"
11436 "\t\tconst char *content,\n"
11437 "\t\tsize_t content_size,\n"
11438 "\t\tint64_t offset);\n"
11443 #: ../src/guestfs-actions.pod:4091 ../fish/guestfish-actions.pod:3147
11445 "This command writes to part of a file. It writes the data buffer C<content> "
11446 "to the file C<path> starting at offset C<offset>."
11450 #: ../src/guestfs-actions.pod:4094 ../fish/guestfish-actions.pod:3150
11452 "This command implements the L<pwrite(2)> system call, and like that system "
11453 "call it may not write the full data requested. The return value is the "
11454 "number of bytes that were actually written to the file. This could even be "
11455 "0, although short writes are unlikely for regular files in ordinary "
11460 #: ../src/guestfs-actions.pod:4100
11461 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
11465 #: ../src/guestfs-actions.pod:4107
11466 msgid "guestfs_pwrite_device"
11470 #: ../src/guestfs-actions.pod:4109
11473 " int guestfs_pwrite_device (guestfs_h *g,\n"
11474 "\t\tconst char *device,\n"
11475 "\t\tconst char *content,\n"
11476 "\t\tsize_t content_size,\n"
11477 "\t\tint64_t offset);\n"
11482 #: ../src/guestfs-actions.pod:4115 ../fish/guestfish-actions.pod:3165
11484 "This command writes to part of a device. It writes the data buffer "
11485 "C<content> to C<device> starting at offset C<offset>."
11489 #: ../src/guestfs-actions.pod:4118 ../fish/guestfish-actions.pod:3168
11491 "This command implements the L<pwrite(2)> system call, and like that system "
11492 "call it may not write the full data requested (although short writes to disk "
11493 "devices and partitions are probably impossible with standard Linux kernels)."
11497 #: ../src/guestfs-actions.pod:4123
11498 msgid "See also C<guestfs_pwrite>."
11502 #: ../src/guestfs-actions.pod:4130
11503 msgid "guestfs_read_file"
11507 #: ../src/guestfs-actions.pod:4132
11510 " char *guestfs_read_file (guestfs_h *g,\n"
11511 "\t\tconst char *path,\n"
11512 "\t\tsize_t *size_r);\n"
11517 #: ../src/guestfs-actions.pod:4136 ../fish/guestfish-actions.pod:3182
11518 msgid "This calls returns the contents of the file C<path> as a buffer."
11522 #: ../src/guestfs-actions.pod:4139
11524 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
11525 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
11526 "function is limited in the total size of file that can be handled."
11530 #: ../src/guestfs-actions.pod:4151
11531 msgid "guestfs_read_lines"
11535 #: ../src/guestfs-actions.pod:4153
11538 " char **guestfs_read_lines (guestfs_h *g,\n"
11539 "\t\tconst char *path);\n"
11544 #: ../src/guestfs-actions.pod:4158 ../fish/guestfish-actions.pod:3199
11546 "The file contents are returned as a list of lines. Trailing C<LF> and "
11547 "C<CRLF> character sequences are I<not> returned."
11551 #: ../src/guestfs-actions.pod:4161
11553 "Note that this function cannot correctly handle binary files (specifically, "
11554 "files containing C<\\0> character which is treated as end of line). For "
11555 "those you need to use the C<guestfs_read_file> function which has a more "
11556 "complex interface."
11560 #: ../src/guestfs-actions.pod:4170
11561 msgid "guestfs_readdir"
11565 #: ../src/guestfs-actions.pod:4172
11568 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
11569 "\t\tconst char *dir);\n"
11574 #: ../src/guestfs-actions.pod:4175 ../fish/guestfish-actions.pod:3211
11575 msgid "This returns the list of directory entries in directory C<dir>."
11579 #: ../src/guestfs-actions.pod:4177 ../fish/guestfish-actions.pod:3213
11581 "All entries in the directory are returned, including C<.> and C<..>. The "
11582 "entries are I<not> sorted, but returned in the same order as the underlying "
11587 #: ../src/guestfs-actions.pod:4181 ../fish/guestfish-actions.pod:3217
11589 "Also this call returns basic file type information about each file. The "
11590 "C<ftyp> field will contain one of the following characters:"
11594 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:3222
11599 #: ../src/guestfs-actions.pod:4188 ../fish/guestfish-actions.pod:3224
11600 msgid "Block special"
11604 #: ../src/guestfs-actions.pod:4190 ../fish/guestfish-actions.pod:3226
11609 #: ../src/guestfs-actions.pod:4192 ../fish/guestfish-actions.pod:3228
11610 msgid "Char special"
11614 #: ../src/guestfs-actions.pod:4194 ../fish/guestfish-actions.pod:3230
11619 #: ../src/guestfs-actions.pod:4196 ../fish/guestfish-actions.pod:3232
11624 #: ../src/guestfs-actions.pod:4198 ../fish/guestfish-actions.pod:3234
11629 #: ../src/guestfs-actions.pod:4200 ../fish/guestfish-actions.pod:3236
11630 msgid "FIFO (named pipe)"
11634 #: ../src/guestfs-actions.pod:4202 ../fish/guestfish-actions.pod:3238
11639 #: ../src/guestfs-actions.pod:4204 ../fish/guestfish-actions.pod:3240
11640 msgid "Symbolic link"
11644 #: ../src/guestfs-actions.pod:4206 ../fish/guestfish-actions.pod:3242
11649 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:3244
11650 msgid "Regular file"
11654 #: ../src/guestfs-actions.pod:4210 ../fish/guestfish-actions.pod:3246
11659 #: ../src/guestfs-actions.pod:4212 ../fish/guestfish-actions.pod:3248
11664 #: ../src/guestfs-actions.pod:4214 ../fish/guestfish-actions.pod:3250
11669 #: ../src/guestfs-actions.pod:4216 ../fish/guestfish-actions.pod:3252
11670 msgid "Unknown file type"
11674 #: ../src/guestfs-actions.pod:4218 ../fish/guestfish-actions.pod:3254
11679 #: ../src/guestfs-actions.pod:4220 ../fish/guestfish-actions.pod:3256
11681 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11685 #: ../src/guestfs-actions.pod:4225
11687 "This function is primarily intended for use by programs. To get a simple "
11688 "list of names, use C<guestfs_ls>. To get a printable directory for human "
11689 "consumption, use C<guestfs_ll>."
11693 #: ../src/guestfs-actions.pod:4229
11695 "This function returns a C<struct guestfs_dirent_list *> (see E<lt>guestfs-"
11696 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11697 "C<guestfs_free_dirent_list> after use>."
11701 #: ../src/guestfs-actions.pod:4234
11702 msgid "guestfs_readlink"
11706 #: ../src/guestfs-actions.pod:4236
11709 " char *guestfs_readlink (guestfs_h *g,\n"
11710 "\t\tconst char *path);\n"
11715 #: ../src/guestfs-actions.pod:4239 ../fish/guestfish-actions.pod:3269
11716 msgid "This command reads the target of a symbolic link."
11720 #: ../src/guestfs-actions.pod:4244
11721 msgid "guestfs_readlinklist"
11725 #: ../src/guestfs-actions.pod:4246
11728 " char **guestfs_readlinklist (guestfs_h *g,\n"
11729 "\t\tconst char *path,\n"
11730 "\t\tchar *const *names);\n"
11735 #: ../src/guestfs-actions.pod:4250 ../fish/guestfish-actions.pod:3275
11737 "This call allows you to do a C<readlink> operation on multiple files, where "
11738 "all files are in the directory C<path>. C<names> is the list of files from "
11743 #: ../src/guestfs-actions.pod:4254 ../fish/guestfish-actions.pod:3279
11745 "On return you get a list of strings, with a one-to-one correspondence to the "
11746 "C<names> list. Each string is the value of the symbolic link."
11750 #: ../src/guestfs-actions.pod:4258 ../fish/guestfish-actions.pod:3283
11752 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11753 "result string is the empty string C<\"\">. However the whole operation is "
11754 "completed even if there were C<readlink(2)> errors, and so you can call this "
11755 "function with names where you don't know if they are symbolic links already "
11756 "(albeit slightly less efficient)."
11760 #: ../src/guestfs-actions.pod:4265 ../fish/guestfish-actions.pod:3290
11762 "This call is intended for programs that want to efficiently list a directory "
11763 "contents without making many round-trips. Very long directory listings "
11764 "might cause the protocol message size to be exceeded, causing this call to "
11765 "fail. The caller must split up such requests into smaller groups of names."
11769 #: ../src/guestfs-actions.pod:4276
11770 msgid "guestfs_realpath"
11774 #: ../src/guestfs-actions.pod:4278
11777 " char *guestfs_realpath (guestfs_h *g,\n"
11778 "\t\tconst char *path);\n"
11783 #: ../src/guestfs-actions.pod:4281 ../fish/guestfish-actions.pod:3301
11785 "Return the canonicalized absolute pathname of C<path>. The returned path "
11786 "has no C<.>, C<..> or symbolic link path elements."
11790 #: ../src/guestfs-actions.pod:4287
11791 msgid "guestfs_removexattr"
11795 #: ../src/guestfs-actions.pod:4289
11798 " int guestfs_removexattr (guestfs_h *g,\n"
11799 "\t\tconst char *xattr,\n"
11800 "\t\tconst char *path);\n"
11805 #: ../src/guestfs-actions.pod:4293 ../fish/guestfish-actions.pod:3308
11807 "This call removes the extended attribute named C<xattr> of the file C<path>."
11811 #: ../src/guestfs-actions.pod:4296
11812 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11816 #: ../src/guestfs-actions.pod:4300
11817 msgid "guestfs_resize2fs"
11821 #: ../src/guestfs-actions.pod:4302
11824 " int guestfs_resize2fs (guestfs_h *g,\n"
11825 "\t\tconst char *device);\n"
11830 #: ../src/guestfs-actions.pod:4305 ../fish/guestfish-actions.pod:3317
11832 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11833 "underlying device."
11837 #: ../src/guestfs-actions.pod:4308
11839 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11840 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11841 "sometimes gives an error about this and sometimes not. In any case, it is "
11842 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11846 #: ../src/guestfs-actions.pod:4316
11847 msgid "guestfs_resize2fs_size"
11851 #: ../src/guestfs-actions.pod:4318
11854 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11855 "\t\tconst char *device,\n"
11856 "\t\tint64_t size);\n"
11861 #: ../src/guestfs-actions.pod:4322
11863 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11864 "to specify the new size (in bytes) explicitly."
11868 #: ../src/guestfs-actions.pod:4327
11873 #: ../src/guestfs-actions.pod:4329
11876 " int guestfs_rm (guestfs_h *g,\n"
11877 "\t\tconst char *path);\n"
11882 #: ../src/guestfs-actions.pod:4332 ../fish/guestfish-actions.pod:3337
11883 msgid "Remove the single file C<path>."
11887 #: ../src/guestfs-actions.pod:4336
11888 msgid "guestfs_rm_rf"
11892 #: ../src/guestfs-actions.pod:4338
11895 " int guestfs_rm_rf (guestfs_h *g,\n"
11896 "\t\tconst char *path);\n"
11901 #: ../src/guestfs-actions.pod:4341 ../fish/guestfish-actions.pod:3343
11903 "Remove the file or directory C<path>, recursively removing the contents if "
11904 "its a directory. This is like the C<rm -rf> shell command."
11908 #: ../src/guestfs-actions.pod:4347
11909 msgid "guestfs_rmdir"
11913 #: ../src/guestfs-actions.pod:4349
11916 " int guestfs_rmdir (guestfs_h *g,\n"
11917 "\t\tconst char *path);\n"
11922 #: ../src/guestfs-actions.pod:4352 ../fish/guestfish-actions.pod:3351
11923 msgid "Remove the single directory C<path>."
11927 #: ../src/guestfs-actions.pod:4356
11928 msgid "guestfs_rmmountpoint"
11932 #: ../src/guestfs-actions.pod:4358
11935 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11936 "\t\tconst char *exemptpath);\n"
11941 #: ../src/guestfs-actions.pod:4361
11943 "This calls removes a mountpoint that was previously created with "
11944 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11948 #: ../src/guestfs-actions.pod:4367
11949 msgid "guestfs_scrub_device"
11953 #: ../src/guestfs-actions.pod:4369
11956 " int guestfs_scrub_device (guestfs_h *g,\n"
11957 "\t\tconst char *device);\n"
11962 #: ../src/guestfs-actions.pod:4372 ../fish/guestfish-actions.pod:3365
11964 "This command writes patterns over C<device> to make data retrieval more "
11969 #: ../src/guestfs-actions.pod:4375 ../src/guestfs-actions.pod:4393
11970 #: ../src/guestfs-actions.pod:4409 ../fish/guestfish-actions.pod:3368
11971 #: ../fish/guestfish-actions.pod:3383 ../fish/guestfish-actions.pod:3396
11973 "It is an interface to the L<scrub(1)> program. See that manual page for "
11978 #: ../src/guestfs-actions.pod:4383
11979 msgid "guestfs_scrub_file"
11983 #: ../src/guestfs-actions.pod:4385
11986 " int guestfs_scrub_file (guestfs_h *g,\n"
11987 "\t\tconst char *file);\n"
11992 #: ../src/guestfs-actions.pod:4388 ../fish/guestfish-actions.pod:3378
11994 "This command writes patterns over a file to make data retrieval more "
11999 #: ../src/guestfs-actions.pod:4391 ../fish/guestfish-actions.pod:3381
12000 msgid "The file is I<removed> after scrubbing."
12004 #: ../src/guestfs-actions.pod:4398
12005 msgid "guestfs_scrub_freespace"
12009 #: ../src/guestfs-actions.pod:4400
12012 " int guestfs_scrub_freespace (guestfs_h *g,\n"
12013 "\t\tconst char *dir);\n"
12018 #: ../src/guestfs-actions.pod:4403
12020 "This command creates the directory C<dir> and then fills it with files until "
12021 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
12022 "and deletes them. The intention is to scrub any free space on the partition "
12023 "containing C<dir>."
12027 #: ../src/guestfs-actions.pod:4414
12028 msgid "guestfs_set_append"
12032 #: ../src/guestfs-actions.pod:4416
12035 " int guestfs_set_append (guestfs_h *g,\n"
12036 "\t\tconst char *append);\n"
12041 #: ../src/guestfs-actions.pod:4419 ../fish/guestfish-actions.pod:3405
12043 "This function is used to add additional options to the guest kernel command "
12048 #: ../src/guestfs-actions.pod:4422 ../fish/guestfish-actions.pod:3408
12050 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12051 "environment variable."
12055 #: ../src/guestfs-actions.pod:4425 ../fish/guestfish-actions.pod:3411
12057 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12058 "(libguestfs always adds a few of its own)."
12062 #: ../src/guestfs-actions.pod:4430
12063 msgid "guestfs_set_autosync"
12067 #: ../src/guestfs-actions.pod:4432
12070 " int guestfs_set_autosync (guestfs_h *g,\n"
12071 "\t\tint autosync);\n"
12076 #: ../src/guestfs-actions.pod:4435
12078 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12079 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
12080 "the handle is closed (also if the program exits without closing handles)."
12084 #: ../src/guestfs-actions.pod:4440 ../fish/guestfish-actions.pod:3425
12086 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12087 "disabled by default)."
12091 #: ../src/guestfs-actions.pod:4445
12092 msgid "guestfs_set_direct"
12096 #: ../src/guestfs-actions.pod:4447
12099 " int guestfs_set_direct (guestfs_h *g,\n"
12100 "\t\tint direct);\n"
12105 #: ../src/guestfs-actions.pod:4450 ../fish/guestfish-actions.pod:3434
12107 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12108 "passed directly through to the appliance once it is launched."
12112 #: ../src/guestfs-actions.pod:4454
12114 "One consequence of this is that log messages aren't caught by the library "
12115 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
12120 #: ../src/guestfs-actions.pod:4458 ../fish/guestfish-actions.pod:3442
12121 msgid "You probably don't want to use this unless you know what you are doing."
12125 #: ../src/guestfs-actions.pod:4461 ../fish/guestfish-actions.pod:3445
12126 msgid "The default is disabled."
12130 #: ../src/guestfs-actions.pod:4465
12131 msgid "guestfs_set_e2label"
12135 #: ../src/guestfs-actions.pod:4467
12138 " int guestfs_set_e2label (guestfs_h *g,\n"
12139 "\t\tconst char *device,\n"
12140 "\t\tconst char *label);\n"
12145 #: ../src/guestfs-actions.pod:4471 ../fish/guestfish-actions.pod:3451
12147 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12148 "C<label>. Filesystem labels are limited to 16 characters."
12152 #: ../src/guestfs-actions.pod:4475
12154 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
12155 "the existing label on a filesystem."
12159 #: ../src/guestfs-actions.pod:4480
12160 msgid "guestfs_set_e2uuid"
12164 #: ../src/guestfs-actions.pod:4482
12167 " int guestfs_set_e2uuid (guestfs_h *g,\n"
12168 "\t\tconst char *device,\n"
12169 "\t\tconst char *uuid);\n"
12174 #: ../src/guestfs-actions.pod:4486 ../fish/guestfish-actions.pod:3462
12176 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12177 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12178 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12182 #: ../src/guestfs-actions.pod:4491
12184 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
12185 "the existing UUID of a filesystem."
12189 #: ../src/guestfs-actions.pod:4496
12190 msgid "guestfs_set_memsize"
12194 #: ../src/guestfs-actions.pod:4498
12197 " int guestfs_set_memsize (guestfs_h *g,\n"
12198 "\t\tint memsize);\n"
12203 #: ../src/guestfs-actions.pod:4501
12205 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12206 "This only has any effect if called before C<guestfs_launch>."
12210 #: ../src/guestfs-actions.pod:4505 ../fish/guestfish-actions.pod:3480
12212 "You can also change this by setting the environment variable "
12213 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12217 #: ../src/guestfs-actions.pod:4514
12218 msgid "guestfs_set_network"
12222 #: ../src/guestfs-actions.pod:4516
12225 " int guestfs_set_network (guestfs_h *g,\n"
12226 "\t\tint network);\n"
12231 #: ../src/guestfs-actions.pod:4519 ../fish/guestfish-actions.pod:3493
12233 "If C<network> is true, then the network is enabled in the libguestfs "
12234 "appliance. The default is false."
12238 #: ../src/guestfs-actions.pod:4522 ../fish/guestfish-actions.pod:3496
12240 "This affects whether commands are able to access the network (see L<guestfs"
12241 "(3)/RUNNING COMMANDS>)."
12245 #: ../src/guestfs-actions.pod:4525
12247 "You must call this before calling C<guestfs_launch>, otherwise it has no "
12252 #: ../src/guestfs-actions.pod:4530
12253 msgid "guestfs_set_path"
12257 #: ../src/guestfs-actions.pod:4532
12260 " int guestfs_set_path (guestfs_h *g,\n"
12261 "\t\tconst char *searchpath);\n"
12266 #: ../src/guestfs-actions.pod:4535 ../fish/guestfish-actions.pod:3508
12267 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12271 #: ../src/guestfs-actions.pod:4537 ../fish/guestfish-actions.pod:3510
12273 "The default is C<$libdir/guestfs> unless overridden by setting "
12274 "C<LIBGUESTFS_PATH> environment variable."
12278 #: ../src/guestfs-actions.pod:4540 ../fish/guestfish-actions.pod:3513
12279 msgid "Setting C<path> to C<NULL> restores the default path."
12283 #: ../src/guestfs-actions.pod:4544
12284 msgid "guestfs_set_qemu"
12288 #: ../src/guestfs-actions.pod:4546
12291 " int guestfs_set_qemu (guestfs_h *g,\n"
12292 "\t\tconst char *qemu);\n"
12297 #: ../src/guestfs-actions.pod:4549 ../fish/guestfish-actions.pod:3521
12298 msgid "Set the qemu binary that we will use."
12302 #: ../src/guestfs-actions.pod:4551 ../fish/guestfish-actions.pod:3523
12304 "The default is chosen when the library was compiled by the configure script."
12308 #: ../src/guestfs-actions.pod:4554 ../fish/guestfish-actions.pod:3526
12310 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12315 #: ../src/guestfs-actions.pod:4557 ../fish/guestfish-actions.pod:3529
12316 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12320 #: ../src/guestfs-actions.pod:4559 ../fish/guestfish-actions.pod:3531
12322 "Note that you should call this function as early as possible after creating "
12323 "the handle. This is because some pre-launch operations depend on testing "
12324 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12325 "don't retest features, and so you might see inconsistent results. Using the "
12326 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12327 "the qemu binary at the same time as the handle is created."
12331 #: ../src/guestfs-actions.pod:4569
12332 msgid "guestfs_set_recovery_proc"
12336 #: ../src/guestfs-actions.pod:4571
12339 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
12340 "\t\tint recoveryproc);\n"
12345 #: ../src/guestfs-actions.pod:4574
12347 "If this is called with the parameter C<false> then C<guestfs_launch> does "
12348 "not create a recovery process. The purpose of the recovery process is to "
12349 "stop runaway qemu processes in the case where the main program aborts "
12354 #: ../src/guestfs-actions.pod:4579
12356 "This only has any effect if called before C<guestfs_launch>, and the default "
12361 #: ../src/guestfs-actions.pod:4582 ../fish/guestfish-actions.pod:3553
12363 "About the only time when you would want to disable this is if the main "
12364 "process will fork itself into the background (\"daemonize\" itself). In "
12365 "this case the recovery process thinks that the main program has disappeared "
12366 "and so kills qemu, which is not very helpful."
12370 #: ../src/guestfs-actions.pod:4590
12371 msgid "guestfs_set_selinux"
12375 #: ../src/guestfs-actions.pod:4592
12378 " int guestfs_set_selinux (guestfs_h *g,\n"
12379 "\t\tint selinux);\n"
12384 #: ../src/guestfs-actions.pod:4595 ../fish/guestfish-actions.pod:3565
12386 "This sets the selinux flag that is passed to the appliance at boot time. "
12387 "The default is C<selinux=0> (disabled)."
12391 #: ../src/guestfs-actions.pod:4598 ../fish/guestfish-actions.pod:3568
12393 "Note that if SELinux is enabled, it is always in Permissive mode "
12394 "(C<enforcing=0>)."
12398 #: ../src/guestfs-actions.pod:4606
12399 msgid "guestfs_set_trace"
12403 #: ../src/guestfs-actions.pod:4608
12406 " int guestfs_set_trace (guestfs_h *g,\n"
12407 "\t\tint trace);\n"
12412 #: ../src/guestfs-actions.pod:4611 ../fish/guestfish-actions.pod:3580
12414 "If the command trace flag is set to 1, then commands are printed on stderr "
12415 "before they are executed in a format which is very similar to the one used "
12416 "by guestfish. In other words, you can run a program with this enabled, and "
12417 "you will get out a script which you can feed to guestfish to perform the "
12418 "same set of actions."
12422 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3587
12424 "If you want to trace C API calls into libguestfs (and other libraries) then "
12425 "possibly a better way is to use the external ltrace(1) command."
12429 #: ../src/guestfs-actions.pod:4622 ../fish/guestfish-actions.pod:3591
12431 "Command traces are disabled unless the environment variable "
12432 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12436 #: ../src/guestfs-actions.pod:4627
12437 msgid "guestfs_set_verbose"
12441 #: ../src/guestfs-actions.pod:4629
12444 " int guestfs_set_verbose (guestfs_h *g,\n"
12445 "\t\tint verbose);\n"
12450 #: ../src/guestfs-actions.pod:4632 ../fish/guestfish-actions.pod:3600
12451 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
12455 #: ../src/guestfs-actions.pod:4634 ../fish/guestfish-actions.pod:3602
12457 "Verbose messages are disabled unless the environment variable "
12458 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12462 #: ../src/guestfs-actions.pod:4639
12463 msgid "guestfs_setcon"
12467 #: ../src/guestfs-actions.pod:4641
12470 " int guestfs_setcon (guestfs_h *g,\n"
12471 "\t\tconst char *context);\n"
12476 #: ../src/guestfs-actions.pod:4644 ../fish/guestfish-actions.pod:3609
12478 "This sets the SELinux security context of the daemon to the string "
12483 #: ../src/guestfs-actions.pod:4647 ../fish/guestfish-actions.pod:3612
12484 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12488 #: ../src/guestfs-actions.pod:4651
12489 msgid "guestfs_setxattr"
12493 #: ../src/guestfs-actions.pod:4653
12496 " int guestfs_setxattr (guestfs_h *g,\n"
12497 "\t\tconst char *xattr,\n"
12498 "\t\tconst char *val,\n"
12499 "\t\tint vallen,\n"
12500 "\t\tconst char *path);\n"
12505 #: ../src/guestfs-actions.pod:4659 ../fish/guestfish-actions.pod:3618
12507 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12508 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12512 #: ../src/guestfs-actions.pod:4663
12513 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
12517 #: ../src/guestfs-actions.pod:4667
12518 msgid "guestfs_sfdisk"
12522 #: ../src/guestfs-actions.pod:4669
12525 " int guestfs_sfdisk (guestfs_h *g,\n"
12526 "\t\tconst char *device,\n"
12529 "\t\tint sectors,\n"
12530 "\t\tchar *const *lines);\n"
12535 #: ../src/guestfs-actions.pod:4676 ../fish/guestfish-actions.pod:3628
12537 "This is a direct interface to the L<sfdisk(8)> program for creating "
12538 "partitions on block devices."
12542 #: ../src/guestfs-actions.pod:4679 ../fish/guestfish-actions.pod:3631
12543 msgid "C<device> should be a block device, for example C</dev/sda>."
12547 #: ../src/guestfs-actions.pod:4681 ../fish/guestfish-actions.pod:3633
12549 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12550 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
12551 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12552 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12553 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12554 "the kernel) cannot work out the right geometry and you will need to tell it."
12558 #: ../src/guestfs-actions.pod:4689 ../fish/guestfish-actions.pod:3641
12560 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12561 "refer to the L<sfdisk(8)> manpage."
12565 #: ../src/guestfs-actions.pod:4692 ../fish/guestfish-actions.pod:3644
12567 "To create a single partition occupying the whole disk, you would pass "
12568 "C<lines> as a single element list, when the single element being the string "
12573 #: ../src/guestfs-actions.pod:4696
12575 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
12579 #: ../src/guestfs-actions.pod:4704
12580 msgid "guestfs_sfdiskM"
12584 #: ../src/guestfs-actions.pod:4706
12587 " int guestfs_sfdiskM (guestfs_h *g,\n"
12588 "\t\tconst char *device,\n"
12589 "\t\tchar *const *lines);\n"
12594 #: ../src/guestfs-actions.pod:4710
12596 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
12597 "partition sizes are specified in megabytes only (rounded to the nearest "
12598 "cylinder) and you don't need to specify the cyls, heads and sectors "
12599 "parameters which were rarely if ever used anyway."
12603 #: ../src/guestfs-actions.pod:4716
12605 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
12606 "C<guestfs_part_disk>"
12610 #: ../src/guestfs-actions.pod:4724
12611 msgid "guestfs_sfdisk_N"
12615 #: ../src/guestfs-actions.pod:4726
12618 " int guestfs_sfdisk_N (guestfs_h *g,\n"
12619 "\t\tconst char *device,\n"
12620 "\t\tint partnum,\n"
12623 "\t\tint sectors,\n"
12624 "\t\tconst char *line);\n"
12629 #: ../src/guestfs-actions.pod:4734 ../fish/guestfish-actions.pod:3674
12631 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
12632 "(note: C<n> counts from 1)."
12636 #: ../src/guestfs-actions.pod:4737
12638 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
12639 "for the cyls/heads/sectors parameters."
12643 #: ../src/guestfs-actions.pod:4740
12644 msgid "See also: C<guestfs_part_add>"
12648 #: ../src/guestfs-actions.pod:4747
12649 msgid "guestfs_sfdisk_disk_geometry"
12653 #: ../src/guestfs-actions.pod:4749
12656 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
12657 "\t\tconst char *device);\n"
12662 #: ../src/guestfs-actions.pod:4752
12664 "This displays the disk geometry of C<device> read from the partition table. "
12665 "Especially in the case where the underlying block device has been resized, "
12666 "this can be different from the kernel's idea of the geometry (see "
12667 "C<guestfs_sfdisk_kernel_geometry>)."
12671 #: ../src/guestfs-actions.pod:4757 ../src/guestfs-actions.pod:4770
12672 #: ../fish/guestfish-actions.pod:3694 ../fish/guestfish-actions.pod:3703
12673 msgid "The result is in human-readable format, and not designed to be parsed."
12677 #: ../src/guestfs-actions.pod:4763
12678 msgid "guestfs_sfdisk_kernel_geometry"
12682 #: ../src/guestfs-actions.pod:4765
12685 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
12686 "\t\tconst char *device);\n"
12691 #: ../src/guestfs-actions.pod:4768 ../fish/guestfish-actions.pod:3701
12692 msgid "This displays the kernel's idea of the geometry of C<device>."
12696 #: ../src/guestfs-actions.pod:4776
12697 msgid "guestfs_sfdisk_l"
12701 #: ../src/guestfs-actions.pod:4778
12704 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12705 "\t\tconst char *device);\n"
12710 #: ../src/guestfs-actions.pod:4781 ../fish/guestfish-actions.pod:3710
12712 "This displays the partition table on C<device>, in the human-readable output "
12713 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12717 #: ../src/guestfs-actions.pod:4785
12718 msgid "See also: C<guestfs_part_list>"
12722 #: ../src/guestfs-actions.pod:4790
12727 #: ../src/guestfs-actions.pod:4792
12730 " char *guestfs_sh (guestfs_h *g,\n"
12731 "\t\tconst char *command);\n"
12736 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3720
12738 "This call runs a command from the guest filesystem via the guest's C</bin/"
12743 #: ../src/guestfs-actions.pod:4798
12744 msgid "This is like C<guestfs_command>, but passes the command to:"
12748 #: ../src/guestfs-actions.pod:4800 ../fish/guestfish-actions.pod:3725
12751 " /bin/sh -c \"command\"\n"
12756 #: ../src/guestfs-actions.pod:4802 ../fish/guestfish-actions.pod:3727
12758 "Depending on the guest's shell, this usually results in wildcards being "
12759 "expanded, shell expressions being interpolated and so on."
12763 #: ../src/guestfs-actions.pod:4806
12764 msgid "All the provisos about C<guestfs_command> apply to this call."
12768 #: ../src/guestfs-actions.pod:4811
12769 msgid "guestfs_sh_lines"
12773 #: ../src/guestfs-actions.pod:4813
12776 " char **guestfs_sh_lines (guestfs_h *g,\n"
12777 "\t\tconst char *command);\n"
12782 #: ../src/guestfs-actions.pod:4816
12784 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12789 #: ../src/guestfs-actions.pod:4819
12790 msgid "See also: C<guestfs_command_lines>"
12794 #: ../src/guestfs-actions.pod:4825
12795 msgid "guestfs_sleep"
12799 #: ../src/guestfs-actions.pod:4827
12802 " int guestfs_sleep (guestfs_h *g,\n"
12808 #: ../src/guestfs-actions.pod:4830 ../fish/guestfish-actions.pod:3746
12809 msgid "Sleep for C<secs> seconds."
12813 #: ../src/guestfs-actions.pod:4834 ../src/guestfs-structs.pod:109
12814 msgid "guestfs_stat"
12818 #: ../src/guestfs-actions.pod:4836
12821 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12822 "\t\tconst char *path);\n"
12827 #: ../src/guestfs-actions.pod:4841 ../fish/guestfish-actions.pod:3754
12828 msgid "This is the same as the C<stat(2)> system call."
12832 #: ../src/guestfs-actions.pod:4847 ../src/guestfs-structs.pod:135
12833 msgid "guestfs_statvfs"
12837 #: ../src/guestfs-actions.pod:4849
12840 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12841 "\t\tconst char *path);\n"
12846 #: ../src/guestfs-actions.pod:4852 ../fish/guestfish-actions.pod:3760
12848 "Returns file system statistics for any mounted file system. C<path> should "
12849 "be a file or directory in the mounted file system (typically it is the mount "
12850 "point itself, but it doesn't need to be)."
12854 #: ../src/guestfs-actions.pod:4856 ../fish/guestfish-actions.pod:3764
12855 msgid "This is the same as the C<statvfs(2)> system call."
12859 #: ../src/guestfs-actions.pod:4858
12861 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12862 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12866 #: ../src/guestfs-actions.pod:4862
12867 msgid "guestfs_strings"
12871 #: ../src/guestfs-actions.pod:4864
12874 " char **guestfs_strings (guestfs_h *g,\n"
12875 "\t\tconst char *path);\n"
12880 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3770
12882 "This runs the L<strings(1)> command on a file and returns the list of "
12883 "printable strings found."
12887 #: ../src/guestfs-actions.pod:4877
12888 msgid "guestfs_strings_e"
12892 #: ../src/guestfs-actions.pod:4879
12895 " char **guestfs_strings_e (guestfs_h *g,\n"
12896 "\t\tconst char *encoding,\n"
12897 "\t\tconst char *path);\n"
12902 #: ../src/guestfs-actions.pod:4883
12904 "This is like the C<guestfs_strings> command, but allows you to specify the "
12905 "encoding of strings that are looked for in the source file C<path>."
12909 #: ../src/guestfs-actions.pod:4887 ../fish/guestfish-actions.pod:3784
12910 msgid "Allowed encodings are:"
12914 #: ../src/guestfs-actions.pod:4891 ../fish/guestfish-actions.pod:3788
12919 #: ../src/guestfs-actions.pod:4893
12921 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12922 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12926 #: ../src/guestfs-actions.pod:4896 ../fish/guestfish-actions.pod:3793
12931 #: ../src/guestfs-actions.pod:4898 ../fish/guestfish-actions.pod:3795
12932 msgid "Single 8-bit-byte characters."
12936 #: ../src/guestfs-actions.pod:4900 ../fish/guestfish-actions.pod:3797
12941 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3799
12942 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12946 #: ../src/guestfs-actions.pod:4905 ../fish/guestfish-actions.pod:3802
12947 msgid "l (lower case letter L)"
12951 #: ../src/guestfs-actions.pod:4907 ../fish/guestfish-actions.pod:3804
12953 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12954 "examining binaries in Windows guests."
12958 #: ../src/guestfs-actions.pod:4910 ../fish/guestfish-actions.pod:3807
12963 #: ../src/guestfs-actions.pod:4912 ../fish/guestfish-actions.pod:3809
12964 msgid "32-bit big endian such as UCS-4BE."
12968 #: ../src/guestfs-actions.pod:4914 ../fish/guestfish-actions.pod:3811
12973 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3813
12974 msgid "32-bit little endian such as UCS-4LE."
12978 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3817
12979 msgid "The returned strings are transcoded to UTF-8."
12983 #: ../src/guestfs-actions.pod:4929
12984 msgid "guestfs_swapoff_device"
12988 #: ../src/guestfs-actions.pod:4931
12991 " int guestfs_swapoff_device (guestfs_h *g,\n"
12992 "\t\tconst char *device);\n"
12997 #: ../src/guestfs-actions.pod:4934
12999 "This command disables the libguestfs appliance swap device or partition "
13000 "named C<device>. See C<guestfs_swapon_device>."
13004 #: ../src/guestfs-actions.pod:4940
13005 msgid "guestfs_swapoff_file"
13009 #: ../src/guestfs-actions.pod:4942
13012 " int guestfs_swapoff_file (guestfs_h *g,\n"
13013 "\t\tconst char *file);\n"
13018 #: ../src/guestfs-actions.pod:4945 ../fish/guestfish-actions.pod:3834
13019 msgid "This command disables the libguestfs appliance swap on file."
13023 #: ../src/guestfs-actions.pod:4949
13024 msgid "guestfs_swapoff_label"
13028 #: ../src/guestfs-actions.pod:4951
13031 " int guestfs_swapoff_label (guestfs_h *g,\n"
13032 "\t\tconst char *label);\n"
13037 #: ../src/guestfs-actions.pod:4954 ../fish/guestfish-actions.pod:3840
13039 "This command disables the libguestfs appliance swap on labeled swap "
13044 #: ../src/guestfs-actions.pod:4959
13045 msgid "guestfs_swapoff_uuid"
13049 #: ../src/guestfs-actions.pod:4961
13052 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
13053 "\t\tconst char *uuid);\n"
13058 #: ../src/guestfs-actions.pod:4964 ../fish/guestfish-actions.pod:3847
13060 "This command disables the libguestfs appliance swap partition with the given "
13065 #: ../src/guestfs-actions.pod:4969
13066 msgid "guestfs_swapon_device"
13070 #: ../src/guestfs-actions.pod:4971
13073 " int guestfs_swapon_device (guestfs_h *g,\n"
13074 "\t\tconst char *device);\n"
13079 #: ../src/guestfs-actions.pod:4974
13081 "This command enables the libguestfs appliance to use the swap device or "
13082 "partition named C<device>. The increased memory is made available for all "
13083 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
13087 #: ../src/guestfs-actions.pod:4979 ../fish/guestfish-actions.pod:3859
13089 "Note that you should not swap to existing guest swap partitions unless you "
13090 "know what you are doing. They may contain hibernation information, or other "
13091 "information that the guest doesn't want you to trash. You also risk leaking "
13092 "information about the host to the guest this way. Instead, attach a new "
13093 "host device to the guest and swap on that."
13097 #: ../src/guestfs-actions.pod:4988
13098 msgid "guestfs_swapon_file"
13102 #: ../src/guestfs-actions.pod:4990
13105 " int guestfs_swapon_file (guestfs_h *g,\n"
13106 "\t\tconst char *file);\n"
13111 #: ../src/guestfs-actions.pod:4993
13113 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
13118 #: ../src/guestfs-actions.pod:4998
13119 msgid "guestfs_swapon_label"
13123 #: ../src/guestfs-actions.pod:5000
13126 " int guestfs_swapon_label (guestfs_h *g,\n"
13127 "\t\tconst char *label);\n"
13132 #: ../src/guestfs-actions.pod:5003
13134 "This command enables swap to a labeled swap partition. See "
13135 "C<guestfs_swapon_device> for other notes."
13139 #: ../src/guestfs-actions.pod:5008
13140 msgid "guestfs_swapon_uuid"
13144 #: ../src/guestfs-actions.pod:5010
13147 " int guestfs_swapon_uuid (guestfs_h *g,\n"
13148 "\t\tconst char *uuid);\n"
13153 #: ../src/guestfs-actions.pod:5013
13155 "This command enables swap to a swap partition with the given UUID. See "
13156 "C<guestfs_swapon_device> for other notes."
13160 #: ../src/guestfs-actions.pod:5018
13161 msgid "guestfs_sync"
13165 #: ../src/guestfs-actions.pod:5020
13168 " int guestfs_sync (guestfs_h *g);\n"
13173 #: ../src/guestfs-actions.pod:5022 ../fish/guestfish-actions.pod:3891
13175 "This syncs the disk, so that any writes are flushed through to the "
13176 "underlying disk image."
13180 #: ../src/guestfs-actions.pod:5025 ../fish/guestfish-actions.pod:3894
13182 "You should always call this if you have modified a disk image, before "
13183 "closing the handle."
13187 #: ../src/guestfs-actions.pod:5030
13188 msgid "guestfs_tail"
13192 #: ../src/guestfs-actions.pod:5032
13195 " char **guestfs_tail (guestfs_h *g,\n"
13196 "\t\tconst char *path);\n"
13201 #: ../src/guestfs-actions.pod:5035 ../fish/guestfish-actions.pod:3901
13203 "This command returns up to the last 10 lines of a file as a list of strings."
13207 #: ../src/guestfs-actions.pod:5045
13208 msgid "guestfs_tail_n"
13212 #: ../src/guestfs-actions.pod:5047
13215 " char **guestfs_tail_n (guestfs_h *g,\n"
13216 "\t\tint nrlines,\n"
13217 "\t\tconst char *path);\n"
13222 #: ../src/guestfs-actions.pod:5051 ../fish/guestfish-actions.pod:3911
13224 "If the parameter C<nrlines> is a positive number, this returns the last "
13225 "C<nrlines> lines of the file C<path>."
13229 #: ../src/guestfs-actions.pod:5054 ../fish/guestfish-actions.pod:3914
13231 "If the parameter C<nrlines> is a negative number, this returns lines from "
13232 "the file C<path>, starting with the C<-nrlines>th line."
13236 #: ../src/guestfs-actions.pod:5066
13237 msgid "guestfs_tar_in"
13241 #: ../src/guestfs-actions.pod:5068
13244 " int guestfs_tar_in (guestfs_h *g,\n"
13245 "\t\tconst char *tarfile,\n"
13246 "\t\tconst char *directory);\n"
13251 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3926
13253 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13254 "tar file) into C<directory>."
13258 #: ../src/guestfs-actions.pod:5075
13260 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
13264 #: ../src/guestfs-actions.pod:5080
13265 msgid "guestfs_tar_out"
13269 #: ../src/guestfs-actions.pod:5082
13272 " int guestfs_tar_out (guestfs_h *g,\n"
13273 "\t\tconst char *directory,\n"
13274 "\t\tconst char *tarfile);\n"
13279 #: ../src/guestfs-actions.pod:5086 ../fish/guestfish-actions.pod:3938
13281 "This command packs the contents of C<directory> and downloads it to local "
13286 #: ../src/guestfs-actions.pod:5089
13288 "To download a compressed tarball, use C<guestfs_tgz_out> or "
13289 "C<guestfs_txz_out>."
13293 #: ../src/guestfs-actions.pod:5094
13294 msgid "guestfs_tgz_in"
13298 #: ../src/guestfs-actions.pod:5096
13301 " int guestfs_tgz_in (guestfs_h *g,\n"
13302 "\t\tconst char *tarball,\n"
13303 "\t\tconst char *directory);\n"
13308 #: ../src/guestfs-actions.pod:5100 ../fish/guestfish-actions.pod:3950
13310 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13311 "tar file) into C<directory>."
13315 #: ../src/guestfs-actions.pod:5103
13316 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
13320 #: ../src/guestfs-actions.pod:5107
13321 msgid "guestfs_tgz_out"
13325 #: ../src/guestfs-actions.pod:5109
13328 " int guestfs_tgz_out (guestfs_h *g,\n"
13329 "\t\tconst char *directory,\n"
13330 "\t\tconst char *tarball);\n"
13335 #: ../src/guestfs-actions.pod:5113 ../fish/guestfish-actions.pod:3961
13337 "This command packs the contents of C<directory> and downloads it to local "
13342 #: ../src/guestfs-actions.pod:5116
13343 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
13347 #: ../src/guestfs-actions.pod:5120
13348 msgid "guestfs_touch"
13352 #: ../src/guestfs-actions.pod:5122
13355 " int guestfs_touch (guestfs_h *g,\n"
13356 "\t\tconst char *path);\n"
13361 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3972
13363 "Touch acts like the L<touch(1)> command. It can be used to update the "
13364 "timestamps on a file, or, if the file does not exist, to create a new zero-"
13369 #: ../src/guestfs-actions.pod:5129 ../fish/guestfish-actions.pod:3976
13371 "This command only works on regular files, and will fail on other file types "
13372 "such as directories, symbolic links, block special etc."
13376 #: ../src/guestfs-actions.pod:5134
13377 msgid "guestfs_truncate"
13381 #: ../src/guestfs-actions.pod:5136
13384 " int guestfs_truncate (guestfs_h *g,\n"
13385 "\t\tconst char *path);\n"
13390 #: ../src/guestfs-actions.pod:5139 ../fish/guestfish-actions.pod:3983
13392 "This command truncates C<path> to a zero-length file. The file must exist "
13397 #: ../src/guestfs-actions.pod:5144
13398 msgid "guestfs_truncate_size"
13402 #: ../src/guestfs-actions.pod:5146
13405 " int guestfs_truncate_size (guestfs_h *g,\n"
13406 "\t\tconst char *path,\n"
13407 "\t\tint64_t size);\n"
13412 #: ../src/guestfs-actions.pod:5150 ../fish/guestfish-actions.pod:3990
13414 "This command truncates C<path> to size C<size> bytes. The file must exist "
13419 #: ../src/guestfs-actions.pod:5153
13421 "If the current file size is less than C<size> then the file is extended to "
13422 "the required size with zero bytes. This creates a sparse file (ie. disk "
13423 "blocks are not allocated for the file until you write to it). To create a "
13424 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
13428 #: ../src/guestfs-actions.pod:5161
13429 msgid "guestfs_tune2fs_l"
13433 #: ../src/guestfs-actions.pod:5163
13436 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
13437 "\t\tconst char *device);\n"
13442 #: ../src/guestfs-actions.pod:5166 ../fish/guestfish-actions.pod:4003
13444 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13449 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:4006
13451 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13452 "for more details. The list of fields returned isn't clearly defined, and "
13453 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13454 "and the filesystem itself."
13458 #: ../src/guestfs-actions.pod:5180
13459 msgid "guestfs_txz_in"
13463 #: ../src/guestfs-actions.pod:5182
13466 " int guestfs_txz_in (guestfs_h *g,\n"
13467 "\t\tconst char *tarball,\n"
13468 "\t\tconst char *directory);\n"
13473 #: ../src/guestfs-actions.pod:5186 ../fish/guestfish-actions.pod:4015
13475 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13476 "tar file) into C<directory>."
13480 #: ../src/guestfs-actions.pod:5191
13481 msgid "guestfs_txz_out"
13485 #: ../src/guestfs-actions.pod:5193
13488 " int guestfs_txz_out (guestfs_h *g,\n"
13489 "\t\tconst char *directory,\n"
13490 "\t\tconst char *tarball);\n"
13495 #: ../src/guestfs-actions.pod:5197 ../fish/guestfish-actions.pod:4024
13497 "This command packs the contents of C<directory> and downloads it to local "
13498 "file C<tarball> (as an xz compressed tar archive)."
13502 #: ../src/guestfs-actions.pod:5202
13503 msgid "guestfs_umask"
13507 #: ../src/guestfs-actions.pod:5204
13510 " int guestfs_umask (guestfs_h *g,\n"
13516 #: ../src/guestfs-actions.pod:5207 ../fish/guestfish-actions.pod:4033
13518 "This function sets the mask used for creating new files and device nodes to "
13523 #: ../src/guestfs-actions.pod:5210 ../fish/guestfish-actions.pod:4036
13525 "Typical umask values would be C<022> which creates new files with "
13526 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13527 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13531 #: ../src/guestfs-actions.pod:5215 ../fish/guestfish-actions.pod:4041
13533 "The default umask is C<022>. This is important because it means that "
13534 "directories and device nodes will be created with C<0644> or C<0755> mode "
13535 "even if you specify C<0777>."
13539 #: ../src/guestfs-actions.pod:5219
13541 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
13542 "C<guestfs_mkdir>."
13546 #: ../src/guestfs-actions.pod:5222 ../fish/guestfish-actions.pod:4048
13547 msgid "This call returns the previous umask."
13551 #: ../src/guestfs-actions.pod:5226
13552 msgid "guestfs_umount"
13556 #: ../src/guestfs-actions.pod:5228
13559 " int guestfs_umount (guestfs_h *g,\n"
13560 "\t\tconst char *pathordevice);\n"
13565 #: ../src/guestfs-actions.pod:5231 ../fish/guestfish-actions.pod:4056
13567 "This unmounts the given filesystem. The filesystem may be specified either "
13568 "by its mountpoint (path) or the device which contains the filesystem."
13572 #: ../src/guestfs-actions.pod:5237
13573 msgid "guestfs_umount_all"
13577 #: ../src/guestfs-actions.pod:5239
13580 " int guestfs_umount_all (guestfs_h *g);\n"
13585 #: ../src/guestfs-actions.pod:5241 ../fish/guestfish-actions.pod:4066
13586 msgid "This unmounts all mounted filesystems."
13590 #: ../src/guestfs-actions.pod:5243 ../fish/guestfish-actions.pod:4068
13591 msgid "Some internal mounts are not unmounted by this call."
13595 #: ../src/guestfs-actions.pod:5247
13596 msgid "guestfs_upload"
13600 #: ../src/guestfs-actions.pod:5249
13603 " int guestfs_upload (guestfs_h *g,\n"
13604 "\t\tconst char *filename,\n"
13605 "\t\tconst char *remotefilename);\n"
13610 #: ../src/guestfs-actions.pod:5253 ../src/guestfs-actions.pod:5269
13611 #: ../fish/guestfish-actions.pod:4074 ../fish/guestfish-actions.pod:4087
13612 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13616 #: ../src/guestfs-actions.pod:5258
13617 msgid "See also C<guestfs_download>."
13621 #: ../src/guestfs-actions.pod:5262
13622 msgid "guestfs_upload_offset"
13626 #: ../src/guestfs-actions.pod:5264
13629 " int guestfs_upload_offset (guestfs_h *g,\n"
13630 "\t\tconst char *filename,\n"
13631 "\t\tconst char *remotefilename,\n"
13632 "\t\tint64_t offset);\n"
13637 #: ../src/guestfs-actions.pod:5272 ../fish/guestfish-actions.pod:4090
13639 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
13640 "The intention is to overwrite parts of existing files or devices, although "
13641 "if a non-existant file is specified then it is created with a \"hole\" "
13642 "before C<offset>. The size of the data written is implicit in the size of "
13643 "the source C<filename>."
13647 #: ../src/guestfs-actions.pod:5279
13649 "Note that there is no limit on the amount of data that can be uploaded with "
13650 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
13651 "full amount unless an error occurs."
13655 #: ../src/guestfs-actions.pod:5284
13656 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
13660 #: ../src/guestfs-actions.pod:5288
13661 msgid "guestfs_utimens"
13665 #: ../src/guestfs-actions.pod:5290
13668 " int guestfs_utimens (guestfs_h *g,\n"
13669 "\t\tconst char *path,\n"
13670 "\t\tint64_t atsecs,\n"
13671 "\t\tint64_t atnsecs,\n"
13672 "\t\tint64_t mtsecs,\n"
13673 "\t\tint64_t mtnsecs);\n"
13678 #: ../src/guestfs-actions.pod:5297 ../fish/guestfish-actions.pod:4110
13679 msgid "This command sets the timestamps of a file with nanosecond precision."
13683 #: ../src/guestfs-actions.pod:5300 ../fish/guestfish-actions.pod:4113
13685 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
13690 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:4116
13692 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
13693 "nanoseconds from the epoch."
13697 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:4119
13699 "If the C<*nsecs> field contains the special value C<-1> then the "
13700 "corresponding timestamp is set to the current time. (The C<*secs> field is "
13701 "ignored in this case)."
13705 #: ../src/guestfs-actions.pod:5310 ../fish/guestfish-actions.pod:4123
13707 "If the C<*nsecs> field contains the special value C<-2> then the "
13708 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
13713 #: ../src/guestfs-actions.pod:5316 ../src/guestfs-structs.pod:175
13714 msgid "guestfs_version"
13718 #: ../src/guestfs-actions.pod:5318
13721 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
13726 #: ../src/guestfs-actions.pod:5320 ../fish/guestfish-actions.pod:4131
13728 "Return the libguestfs version number that the program is linked against."
13732 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:4134
13734 "Note that because of dynamic linking this is not necessarily the version of "
13735 "libguestfs that you compiled against. You can compile the program, and then "
13736 "at runtime dynamically link against a completely different C<libguestfs.so> "
13741 #: ../src/guestfs-actions.pod:5328 ../fish/guestfish-actions.pod:4139
13743 "This call was added in version C<1.0.58>. In previous versions of "
13744 "libguestfs there was no way to get the version number. From C code you can "
13745 "use dynamic linker functions to find out if this symbol exists (if it "
13746 "doesn't, then it's an earlier version)."
13750 #: ../src/guestfs-actions.pod:5334 ../fish/guestfish-actions.pod:4145
13752 "The call returns a structure with four elements. The first three (C<major>, "
13753 "C<minor> and C<release>) are numbers and correspond to the usual version "
13754 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13755 "but may be used for distro-specific information."
13759 #: ../src/guestfs-actions.pod:5340 ../fish/guestfish-actions.pod:4151
13761 "To construct the original version string: C<$major.$minor.$release$extra>"
13765 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4154
13766 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13770 #: ../src/guestfs-actions.pod:5345
13772 "I<Note:> Don't use this call to test for availability of features. In "
13773 "enterprise distributions we backport features from later versions into "
13774 "earlier versions, making this an unreliable way to test for features. Use "
13775 "C<guestfs_available> instead."
13779 #: ../src/guestfs-actions.pod:5351
13781 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13782 "error. I<The caller must call C<guestfs_free_version> after use>."
13786 #: ../src/guestfs-actions.pod:5355
13787 msgid "guestfs_vfs_label"
13791 #: ../src/guestfs-actions.pod:5357
13794 " char *guestfs_vfs_label (guestfs_h *g,\n"
13795 "\t\tconst char *device);\n"
13800 #: ../src/guestfs-actions.pod:5360 ../fish/guestfish-actions.pod:4166
13801 msgid "This returns the filesystem label of the filesystem on C<device>."
13805 #: ../src/guestfs-actions.pod:5363 ../fish/guestfish-actions.pod:4169
13806 msgid "If the filesystem is unlabeled, this returns the empty string."
13810 #: ../src/guestfs-actions.pod:5365
13811 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13815 #: ../src/guestfs-actions.pod:5370
13816 msgid "guestfs_vfs_type"
13820 #: ../src/guestfs-actions.pod:5372
13823 " char *guestfs_vfs_type (guestfs_h *g,\n"
13824 "\t\tconst char *device);\n"
13829 #: ../src/guestfs-actions.pod:5375 ../fish/guestfish-actions.pod:4177
13831 "This command gets the filesystem type corresponding to the filesystem on "
13836 #: ../src/guestfs-actions.pod:5378 ../fish/guestfish-actions.pod:4180
13838 "For most filesystems, the result is the name of the Linux VFS module which "
13839 "would be used to mount this filesystem if you mounted it without specifying "
13840 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13844 #: ../src/guestfs-actions.pod:5386
13845 msgid "guestfs_vfs_uuid"
13849 #: ../src/guestfs-actions.pod:5388
13852 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13853 "\t\tconst char *device);\n"
13858 #: ../src/guestfs-actions.pod:5391 ../fish/guestfish-actions.pod:4189
13859 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13863 #: ../src/guestfs-actions.pod:5394 ../fish/guestfish-actions.pod:4192
13864 msgid "If the filesystem does not have a UUID, this returns the empty string."
13868 #: ../src/guestfs-actions.pod:5396
13869 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13873 #: ../src/guestfs-actions.pod:5401
13874 msgid "guestfs_vg_activate"
13878 #: ../src/guestfs-actions.pod:5403
13881 " int guestfs_vg_activate (guestfs_h *g,\n"
13882 "\t\tint activate,\n"
13883 "\t\tchar *const *volgroups);\n"
13888 #: ../src/guestfs-actions.pod:5407 ../fish/guestfish-actions.pod:4200
13890 "This command activates or (if C<activate> is false) deactivates all logical "
13891 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13892 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13893 "deactivated, then those devices disappear."
13897 #: ../src/guestfs-actions.pod:5413 ../fish/guestfish-actions.pod:4206
13898 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13902 #: ../src/guestfs-actions.pod:5415 ../fish/guestfish-actions.pod:4208
13904 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13905 "activated or deactivated."
13909 #: ../src/guestfs-actions.pod:5420
13910 msgid "guestfs_vg_activate_all"
13914 #: ../src/guestfs-actions.pod:5422
13917 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13918 "\t\tint activate);\n"
13923 #: ../src/guestfs-actions.pod:5425 ../fish/guestfish-actions.pod:4215
13925 "This command activates or (if C<activate> is false) deactivates all logical "
13926 "volumes in all volume groups. If activated, then they are made known to the "
13927 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13928 "those devices disappear."
13932 #: ../src/guestfs-actions.pod:5431 ../fish/guestfish-actions.pod:4221
13933 msgid "This command is the same as running C<vgchange -a y|n>"
13937 #: ../src/guestfs-actions.pod:5435
13938 msgid "guestfs_vgcreate"
13942 #: ../src/guestfs-actions.pod:5437
13945 " int guestfs_vgcreate (guestfs_h *g,\n"
13946 "\t\tconst char *volgroup,\n"
13947 "\t\tchar *const *physvols);\n"
13952 #: ../src/guestfs-actions.pod:5441 ../fish/guestfish-actions.pod:4227
13954 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13955 "of physical volumes C<physvols>."
13959 #: ../src/guestfs-actions.pod:5446
13960 msgid "guestfs_vglvuuids"
13964 #: ../src/guestfs-actions.pod:5448
13967 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13968 "\t\tconst char *vgname);\n"
13973 #: ../src/guestfs-actions.pod:5451 ../fish/guestfish-actions.pod:4234
13975 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13976 "volumes created in this volume group."
13980 #: ../src/guestfs-actions.pod:5454
13982 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13983 "associate logical volumes and volume groups."
13987 #: ../src/guestfs-actions.pod:5457
13988 msgid "See also C<guestfs_vgpvuuids>."
13992 #: ../src/guestfs-actions.pod:5463
13993 msgid "guestfs_vgpvuuids"
13997 #: ../src/guestfs-actions.pod:5465
14000 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
14001 "\t\tconst char *vgname);\n"
14006 #: ../src/guestfs-actions.pod:5468 ../fish/guestfish-actions.pod:4246
14008 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14009 "volumes that this volume group resides on."
14013 #: ../src/guestfs-actions.pod:5471
14015 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
14016 "associate physical volumes and volume groups."
14020 #: ../src/guestfs-actions.pod:5474
14021 msgid "See also C<guestfs_vglvuuids>."
14025 #: ../src/guestfs-actions.pod:5480
14026 msgid "guestfs_vgremove"
14030 #: ../src/guestfs-actions.pod:5482
14033 " int guestfs_vgremove (guestfs_h *g,\n"
14034 "\t\tconst char *vgname);\n"
14039 #: ../src/guestfs-actions.pod:5485 ../fish/guestfish-actions.pod:4258
14040 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14044 #: ../src/guestfs-actions.pod:5487 ../fish/guestfish-actions.pod:4260
14046 "This also forcibly removes all logical volumes in the volume group (if any)."
14050 #: ../src/guestfs-actions.pod:5492
14051 msgid "guestfs_vgrename"
14055 #: ../src/guestfs-actions.pod:5494
14058 " int guestfs_vgrename (guestfs_h *g,\n"
14059 "\t\tconst char *volgroup,\n"
14060 "\t\tconst char *newvolgroup);\n"
14065 #: ../src/guestfs-actions.pod:5498 ../fish/guestfish-actions.pod:4267
14066 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14070 #: ../src/guestfs-actions.pod:5502
14071 msgid "guestfs_vgs"
14075 #: ../src/guestfs-actions.pod:5504
14078 " char **guestfs_vgs (guestfs_h *g);\n"
14083 #: ../src/guestfs-actions.pod:5506 ../fish/guestfish-actions.pod:4273
14085 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14090 #: ../src/guestfs-actions.pod:5509 ../fish/guestfish-actions.pod:4276
14092 "This returns a list of just the volume group names that were detected (eg. "
14097 #: ../src/guestfs-actions.pod:5512
14098 msgid "See also C<guestfs_vgs_full>."
14102 #: ../src/guestfs-actions.pod:5518
14103 msgid "guestfs_vgs_full"
14107 #: ../src/guestfs-actions.pod:5520
14110 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
14115 #: ../src/guestfs-actions.pod:5522 ../fish/guestfish-actions.pod:4285
14117 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14118 "> command. The \"full\" version includes all fields."
14122 #: ../src/guestfs-actions.pod:5525
14124 "This function returns a C<struct guestfs_lvm_vg_list *> (see E<lt>guestfs-"
14125 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
14126 "C<guestfs_free_lvm_vg_list> after use>."
14130 #: ../src/guestfs-actions.pod:5530
14131 msgid "guestfs_vgscan"
14135 #: ../src/guestfs-actions.pod:5532
14138 " int guestfs_vgscan (guestfs_h *g);\n"
14143 #: ../src/guestfs-actions.pod:5534 ../fish/guestfish-actions.pod:4292
14145 "This rescans all block devices and rebuilds the list of LVM physical "
14146 "volumes, volume groups and logical volumes."
14150 #: ../src/guestfs-actions.pod:5539
14151 msgid "guestfs_vguuid"
14155 #: ../src/guestfs-actions.pod:5541
14158 " char *guestfs_vguuid (guestfs_h *g,\n"
14159 "\t\tconst char *vgname);\n"
14164 #: ../src/guestfs-actions.pod:5544 ../fish/guestfish-actions.pod:4299
14165 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14169 #: ../src/guestfs-actions.pod:5549
14170 msgid "guestfs_wait_ready"
14174 #: ../src/guestfs-actions.pod:5551
14177 " int guestfs_wait_ready (guestfs_h *g);\n"
14182 #: ../src/guestfs-actions.pod:5553
14183 msgid "This function is a no op."
14187 #: ../src/guestfs-actions.pod:5555
14189 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
14190 "calling C<guestfs_launch> to wait for the launch to complete. However this "
14191 "is no longer necessary because C<guestfs_launch> now does the waiting."
14195 #: ../src/guestfs-actions.pod:5560
14197 "If you see any calls to this function in code then you can just remove them, "
14198 "unless you want to retain compatibility with older versions of the API."
14202 #: ../src/guestfs-actions.pod:5566
14203 msgid "guestfs_wc_c"
14207 #: ../src/guestfs-actions.pod:5568
14210 " int guestfs_wc_c (guestfs_h *g,\n"
14211 "\t\tconst char *path);\n"
14216 #: ../src/guestfs-actions.pod:5571 ../fish/guestfish-actions.pod:4305
14218 "This command counts the characters in a file, using the C<wc -c> external "
14223 #: ../src/guestfs-actions.pod:5576
14224 msgid "guestfs_wc_l"
14228 #: ../src/guestfs-actions.pod:5578
14231 " int guestfs_wc_l (guestfs_h *g,\n"
14232 "\t\tconst char *path);\n"
14237 #: ../src/guestfs-actions.pod:5581 ../fish/guestfish-actions.pod:4312
14239 "This command counts the lines in a file, using the C<wc -l> external command."
14243 #: ../src/guestfs-actions.pod:5586
14244 msgid "guestfs_wc_w"
14248 #: ../src/guestfs-actions.pod:5588
14251 " int guestfs_wc_w (guestfs_h *g,\n"
14252 "\t\tconst char *path);\n"
14257 #: ../src/guestfs-actions.pod:5591 ../fish/guestfish-actions.pod:4319
14259 "This command counts the words in a file, using the C<wc -w> external command."
14263 #: ../src/guestfs-actions.pod:5596
14264 msgid "guestfs_write"
14268 #: ../src/guestfs-actions.pod:5598
14271 " int guestfs_write (guestfs_h *g,\n"
14272 "\t\tconst char *path,\n"
14273 "\t\tconst char *content,\n"
14274 "\t\tsize_t content_size);\n"
14279 #: ../src/guestfs-actions.pod:5603 ../fish/guestfish-actions.pod:4326
14281 "This call creates a file called C<path>. The content of the file is the "
14282 "string C<content> (which can contain any 8 bit data)."
14286 #: ../src/guestfs-actions.pod:5611
14287 msgid "guestfs_write_file"
14291 #: ../src/guestfs-actions.pod:5613
14294 " int guestfs_write_file (guestfs_h *g,\n"
14295 "\t\tconst char *path,\n"
14296 "\t\tconst char *content,\n"
14302 #: ../src/guestfs-actions.pod:5618 ../fish/guestfish-actions.pod:4336
14304 "This call creates a file called C<path>. The contents of the file is the "
14305 "string C<content> (which can contain any 8 bit data), with length C<size>."
14309 #: ../src/guestfs-actions.pod:5622 ../fish/guestfish-actions.pod:4340
14311 "As a special case, if C<size> is C<0> then the length is calculated using "
14312 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14316 #: ../src/guestfs-actions.pod:5626 ../fish/guestfish-actions.pod:4344
14318 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14319 "I<not> work, even if the length is specified."
14323 #: ../src/guestfs-actions.pod:5634 ../fish/guestfish-actions.pod:4350
14325 "This function is deprecated. In new code, use the C<write> call instead."
14329 #: ../src/guestfs-actions.pod:5641
14330 msgid "guestfs_zegrep"
14334 #: ../src/guestfs-actions.pod:5643
14337 " char **guestfs_zegrep (guestfs_h *g,\n"
14338 "\t\tconst char *regex,\n"
14339 "\t\tconst char *path);\n"
14344 #: ../src/guestfs-actions.pod:5647 ../fish/guestfish-actions.pod:4361
14346 "This calls the external C<zegrep> program and returns the matching lines."
14350 #: ../src/guestfs-actions.pod:5657
14351 msgid "guestfs_zegrepi"
14355 #: ../src/guestfs-actions.pod:5659
14358 " char **guestfs_zegrepi (guestfs_h *g,\n"
14359 "\t\tconst char *regex,\n"
14360 "\t\tconst char *path);\n"
14365 #: ../src/guestfs-actions.pod:5663 ../fish/guestfish-actions.pod:4371
14367 "This calls the external C<zegrep -i> program and returns the matching lines."
14371 #: ../src/guestfs-actions.pod:5673
14372 msgid "guestfs_zero"
14376 #: ../src/guestfs-actions.pod:5675
14379 " int guestfs_zero (guestfs_h *g,\n"
14380 "\t\tconst char *device);\n"
14385 #: ../src/guestfs-actions.pod:5678 ../fish/guestfish-actions.pod:4381
14386 msgid "This command writes zeroes over the first few blocks of C<device>."
14390 #: ../src/guestfs-actions.pod:5680 ../fish/guestfish-actions.pod:4383
14392 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14393 "securely wipe the device). It should be sufficient to remove any partition "
14394 "tables, filesystem superblocks and so on."
14398 #: ../src/guestfs-actions.pod:5684
14399 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
14403 #: ../src/guestfs-actions.pod:5693
14404 msgid "guestfs_zero_device"
14408 #: ../src/guestfs-actions.pod:5695
14411 " int guestfs_zero_device (guestfs_h *g,\n"
14412 "\t\tconst char *device);\n"
14417 #: ../src/guestfs-actions.pod:5698
14419 "This command writes zeroes over the entire C<device>. Compare with "
14420 "C<guestfs_zero> which just zeroes the first few blocks of a device."
14424 #: ../src/guestfs-actions.pod:5712
14425 msgid "guestfs_zerofree"
14429 #: ../src/guestfs-actions.pod:5714
14432 " int guestfs_zerofree (guestfs_h *g,\n"
14433 "\t\tconst char *device);\n"
14438 #: ../src/guestfs-actions.pod:5717 ../fish/guestfish-actions.pod:4404
14440 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14441 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14442 "possible to compress the filesystem more effectively."
14446 #: ../src/guestfs-actions.pod:5722 ../fish/guestfish-actions.pod:4409
14447 msgid "You should B<not> run this program if the filesystem is mounted."
14451 #: ../src/guestfs-actions.pod:5725 ../fish/guestfish-actions.pod:4412
14453 "It is possible that using this program can damage the filesystem or data on "
14458 #: ../src/guestfs-actions.pod:5730
14459 msgid "guestfs_zfgrep"
14463 #: ../src/guestfs-actions.pod:5732
14466 " char **guestfs_zfgrep (guestfs_h *g,\n"
14467 "\t\tconst char *pattern,\n"
14468 "\t\tconst char *path);\n"
14473 #: ../src/guestfs-actions.pod:5736 ../fish/guestfish-actions.pod:4419
14475 "This calls the external C<zfgrep> program and returns the matching lines."
14479 #: ../src/guestfs-actions.pod:5746
14480 msgid "guestfs_zfgrepi"
14484 #: ../src/guestfs-actions.pod:5748
14487 " char **guestfs_zfgrepi (guestfs_h *g,\n"
14488 "\t\tconst char *pattern,\n"
14489 "\t\tconst char *path);\n"
14494 #: ../src/guestfs-actions.pod:5752 ../fish/guestfish-actions.pod:4429
14496 "This calls the external C<zfgrep -i> program and returns the matching lines."
14500 #: ../src/guestfs-actions.pod:5762
14501 msgid "guestfs_zfile"
14505 #: ../src/guestfs-actions.pod:5764
14508 " char *guestfs_zfile (guestfs_h *g,\n"
14509 "\t\tconst char *meth,\n"
14510 "\t\tconst char *path);\n"
14515 #: ../src/guestfs-actions.pod:5768 ../fish/guestfish-actions.pod:4439
14517 "This command runs C<file> after first decompressing C<path> using C<method>."
14521 #: ../src/guestfs-actions.pod:5771 ../fish/guestfish-actions.pod:4442
14522 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14526 #: ../src/guestfs-actions.pod:5773
14528 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
14533 #: ../src/guestfs-actions.pod:5779 ../fish/guestfish-actions.pod:4447
14535 "This function is deprecated. In new code, use the C<file> call instead."
14539 #: ../src/guestfs-actions.pod:5786
14540 msgid "guestfs_zgrep"
14544 #: ../src/guestfs-actions.pod:5788
14547 " char **guestfs_zgrep (guestfs_h *g,\n"
14548 "\t\tconst char *regex,\n"
14549 "\t\tconst char *path);\n"
14554 #: ../src/guestfs-actions.pod:5792 ../fish/guestfish-actions.pod:4458
14556 "This calls the external C<zgrep> program and returns the matching lines."
14560 #: ../src/guestfs-actions.pod:5802
14561 msgid "guestfs_zgrepi"
14565 #: ../src/guestfs-actions.pod:5804
14568 " char **guestfs_zgrepi (guestfs_h *g,\n"
14569 "\t\tconst char *regex,\n"
14570 "\t\tconst char *path);\n"
14575 #: ../src/guestfs-actions.pod:5808 ../fish/guestfish-actions.pod:4468
14577 "This calls the external C<zgrep -i> program and returns the matching lines."
14581 #: ../src/guestfs-availability.pod:3
14586 #: ../src/guestfs-availability.pod:5
14588 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
14589 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
14590 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
14591 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
14592 "L</guestfs_aug_save> L</guestfs_aug_set>"
14596 #: ../src/guestfs-availability.pod:21
14601 #: ../src/guestfs-availability.pod:23
14603 "The following functions: L</guestfs_inotify_add_watch> L</"
14604 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
14605 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
14609 #: ../src/guestfs-availability.pod:31
14610 msgid "B<linuxfsuuid>"
14614 #: ../src/guestfs-availability.pod:33
14616 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
14617 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
14621 #: ../src/guestfs-availability.pod:40
14622 msgid "B<linuxmodules>"
14626 #: ../src/guestfs-availability.pod:42
14627 msgid "The following functions: L</guestfs_modprobe>"
14631 #: ../src/guestfs-availability.pod:45
14632 msgid "B<linuxxattrs>"
14636 #: ../src/guestfs-availability.pod:47
14638 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
14639 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
14640 "guestfs_removexattr> L</guestfs_setxattr>"
14644 #: ../src/guestfs-availability.pod:56
14649 #: ../src/guestfs-availability.pod:58
14651 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
14652 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
14653 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
14657 #: ../src/guestfs-availability.pod:67
14662 #: ../src/guestfs-availability.pod:69
14664 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
14665 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
14666 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
14667 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
14668 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
14669 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
14670 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
14674 #: ../src/guestfs-availability.pod:92
14679 #: ../src/guestfs-availability.pod:94
14681 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
14682 "guestfs_mknod_b> L</guestfs_mknod_c>"
14686 #: ../src/guestfs-availability.pod:100
14691 #: ../src/guestfs-availability.pod:102
14692 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
14696 #: ../src/guestfs-availability.pod:105
14697 msgid "B<ntfsprogs>"
14701 #: ../src/guestfs-availability.pod:107
14703 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
14707 #: ../src/guestfs-availability.pod:111
14708 msgid "B<realpath>"
14712 #: ../src/guestfs-availability.pod:113
14713 msgid "The following functions: L</guestfs_realpath>"
14717 #: ../src/guestfs-availability.pod:116
14722 #: ../src/guestfs-availability.pod:118
14724 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
14725 "guestfs_scrub_freespace>"
14729 #: ../src/guestfs-availability.pod:123
14734 #: ../src/guestfs-availability.pod:125
14735 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14739 #: ../src/guestfs-availability.pod:129
14744 #: ../src/guestfs-availability.pod:131
14745 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14749 #: ../src/guestfs-availability.pod:135
14750 msgid "B<zerofree>"
14754 #: ../src/guestfs-availability.pod:137
14755 msgid "The following functions: L</guestfs_zerofree>"
14759 #: ../src/guestfs-structs.pod:1
14760 msgid "guestfs_int_bool"
14764 #: ../src/guestfs-structs.pod:3
14767 " struct guestfs_int_bool {\n"
14775 #: ../src/guestfs-structs.pod:8
14778 " struct guestfs_int_bool_list {\n"
14779 " uint32_t len; /* Number of elements in list. */\n"
14780 " struct guestfs_int_bool *val; /* Elements. */\n"
14786 #: ../src/guestfs-structs.pod:13
14789 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14790 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14795 #: ../src/guestfs-structs.pod:16
14796 msgid "guestfs_lvm_pv"
14800 #: ../src/guestfs-structs.pod:18
14803 " struct guestfs_lvm_pv {\n"
14804 " char *pv_name;\n"
14805 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14806 " char pv_uuid[32];\n"
14808 " uint64_t pv_size;\n"
14809 " uint64_t dev_size;\n"
14810 " uint64_t pv_free;\n"
14811 " uint64_t pv_used;\n"
14812 " char *pv_attr;\n"
14813 " int64_t pv_pe_count;\n"
14814 " int64_t pv_pe_alloc_count;\n"
14815 " char *pv_tags;\n"
14816 " uint64_t pe_start;\n"
14817 " int64_t pv_mda_count;\n"
14818 " uint64_t pv_mda_free;\n"
14824 #: ../src/guestfs-structs.pod:36
14827 " struct guestfs_lvm_pv_list {\n"
14828 " uint32_t len; /* Number of elements in list. */\n"
14829 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14835 #: ../src/guestfs-structs.pod:41
14838 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14839 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14844 #: ../src/guestfs-structs.pod:44
14845 msgid "guestfs_lvm_vg"
14849 #: ../src/guestfs-structs.pod:46
14852 " struct guestfs_lvm_vg {\n"
14853 " char *vg_name;\n"
14854 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14855 " char vg_uuid[32];\n"
14857 " char *vg_attr;\n"
14858 " uint64_t vg_size;\n"
14859 " uint64_t vg_free;\n"
14860 " char *vg_sysid;\n"
14861 " uint64_t vg_extent_size;\n"
14862 " int64_t vg_extent_count;\n"
14863 " int64_t vg_free_count;\n"
14864 " int64_t max_lv;\n"
14865 " int64_t max_pv;\n"
14866 " int64_t pv_count;\n"
14867 " int64_t lv_count;\n"
14868 " int64_t snap_count;\n"
14869 " int64_t vg_seqno;\n"
14870 " char *vg_tags;\n"
14871 " int64_t vg_mda_count;\n"
14872 " uint64_t vg_mda_free;\n"
14878 #: ../src/guestfs-structs.pod:69
14881 " struct guestfs_lvm_vg_list {\n"
14882 " uint32_t len; /* Number of elements in list. */\n"
14883 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14889 #: ../src/guestfs-structs.pod:74
14892 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14893 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14898 #: ../src/guestfs-structs.pod:77
14899 msgid "guestfs_lvm_lv"
14903 #: ../src/guestfs-structs.pod:79
14906 " struct guestfs_lvm_lv {\n"
14907 " char *lv_name;\n"
14908 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14909 " char lv_uuid[32];\n"
14910 " char *lv_attr;\n"
14911 " int64_t lv_major;\n"
14912 " int64_t lv_minor;\n"
14913 " int64_t lv_kernel_major;\n"
14914 " int64_t lv_kernel_minor;\n"
14915 " uint64_t lv_size;\n"
14916 " int64_t seg_count;\n"
14918 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14919 " float snap_percent;\n"
14920 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14921 " float copy_percent;\n"
14922 " char *move_pv;\n"
14923 " char *lv_tags;\n"
14924 " char *mirror_log;\n"
14925 " char *modules;\n"
14931 #: ../src/guestfs-structs.pod:101
14934 " struct guestfs_lvm_lv_list {\n"
14935 " uint32_t len; /* Number of elements in list. */\n"
14936 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14942 #: ../src/guestfs-structs.pod:106
14945 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14946 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14951 #: ../src/guestfs-structs.pod:111
14954 " struct guestfs_stat {\n"
14958 " int64_t nlink;\n"
14963 " int64_t blksize;\n"
14964 " int64_t blocks;\n"
14965 " int64_t atime;\n"
14966 " int64_t mtime;\n"
14967 " int64_t ctime;\n"
14973 #: ../src/guestfs-structs.pod:127
14976 " struct guestfs_stat_list {\n"
14977 " uint32_t len; /* Number of elements in list. */\n"
14978 " struct guestfs_stat *val; /* Elements. */\n"
14984 #: ../src/guestfs-structs.pod:132
14987 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14988 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14993 #: ../src/guestfs-structs.pod:137
14996 " struct guestfs_statvfs {\n"
14997 " int64_t bsize;\n"
14998 " int64_t frsize;\n"
14999 " int64_t blocks;\n"
15000 " int64_t bfree;\n"
15001 " int64_t bavail;\n"
15002 " int64_t files;\n"
15003 " int64_t ffree;\n"
15004 " int64_t favail;\n"
15007 " int64_t namemax;\n"
15013 #: ../src/guestfs-structs.pod:151
15016 " struct guestfs_statvfs_list {\n"
15017 " uint32_t len; /* Number of elements in list. */\n"
15018 " struct guestfs_statvfs *val; /* Elements. */\n"
15024 #: ../src/guestfs-structs.pod:156
15027 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
15028 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
15033 #: ../src/guestfs-structs.pod:159
15034 msgid "guestfs_dirent"
15038 #: ../src/guestfs-structs.pod:161
15041 " struct guestfs_dirent {\n"
15050 #: ../src/guestfs-structs.pod:167
15053 " struct guestfs_dirent_list {\n"
15054 " uint32_t len; /* Number of elements in list. */\n"
15055 " struct guestfs_dirent *val; /* Elements. */\n"
15061 #: ../src/guestfs-structs.pod:172
15064 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
15065 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
15070 #: ../src/guestfs-structs.pod:177
15073 " struct guestfs_version {\n"
15074 " int64_t major;\n"
15075 " int64_t minor;\n"
15076 " int64_t release;\n"
15083 #: ../src/guestfs-structs.pod:184
15086 " struct guestfs_version_list {\n"
15087 " uint32_t len; /* Number of elements in list. */\n"
15088 " struct guestfs_version *val; /* Elements. */\n"
15094 #: ../src/guestfs-structs.pod:189
15097 " void guestfs_free_version (struct guestfs_free_version *);\n"
15098 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
15103 #: ../src/guestfs-structs.pod:192
15104 msgid "guestfs_xattr"
15108 #: ../src/guestfs-structs.pod:194
15111 " struct guestfs_xattr {\n"
15112 " char *attrname;\n"
15113 " /* The next two fields describe a byte array. */\n"
15114 " uint32_t attrval_len;\n"
15115 " char *attrval;\n"
15121 #: ../src/guestfs-structs.pod:201
15124 " struct guestfs_xattr_list {\n"
15125 " uint32_t len; /* Number of elements in list. */\n"
15126 " struct guestfs_xattr *val; /* Elements. */\n"
15132 #: ../src/guestfs-structs.pod:206
15135 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
15136 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
15141 #: ../src/guestfs-structs.pod:209
15142 msgid "guestfs_inotify_event"
15146 #: ../src/guestfs-structs.pod:211
15149 " struct guestfs_inotify_event {\n"
15150 " int64_t in_wd;\n"
15151 " uint32_t in_mask;\n"
15152 " uint32_t in_cookie;\n"
15153 " char *in_name;\n"
15159 #: ../src/guestfs-structs.pod:218
15162 " struct guestfs_inotify_event_list {\n"
15163 " uint32_t len; /* Number of elements in list. */\n"
15164 " struct guestfs_inotify_event *val; /* Elements. */\n"
15170 #: ../src/guestfs-structs.pod:223
15173 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
15174 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
15179 #: ../src/guestfs-structs.pod:226
15180 msgid "guestfs_partition"
15184 #: ../src/guestfs-structs.pod:228
15187 " struct guestfs_partition {\n"
15188 " int32_t part_num;\n"
15189 " uint64_t part_start;\n"
15190 " uint64_t part_end;\n"
15191 " uint64_t part_size;\n"
15197 #: ../src/guestfs-structs.pod:235
15200 " struct guestfs_partition_list {\n"
15201 " uint32_t len; /* Number of elements in list. */\n"
15202 " struct guestfs_partition *val; /* Elements. */\n"
15208 #: ../src/guestfs-structs.pod:240
15211 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
15212 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
15217 #: ../fish/guestfish.pod:5
15218 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15222 #: ../fish/guestfish.pod:9
15225 " guestfish [--options] [commands]\n"
15230 #: ../fish/guestfish.pod:11
15238 #: ../fish/guestfish.pod:13
15241 " guestfish -a disk.img\n"
15246 #: ../fish/guestfish.pod:15
15249 " guestfish -a disk.img -m dev[:mountpoint]\n"
15254 #: ../fish/guestfish.pod:17
15257 " guestfish -d libvirt-domain\n"
15262 #: ../fish/guestfish.pod:19
15265 " guestfish -a disk.img -i\n"
15270 #: ../fish/guestfish.pod:21
15273 " guestfish -d libvirt-domain -i\n"
15278 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
15279 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
15280 #: ../tools/virt-rescue.pl:41
15285 #: ../fish/guestfish.pod:25
15287 "Using guestfish in read/write mode on live virtual machines can be "
15288 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15289 "option to use guestfish safely if the disk image or virtual machine might be "
15294 #: ../fish/guestfish.pod:32
15296 "Guestfish is a shell and command-line tool for examining and modifying "
15297 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15298 "functionality of the guestfs API, see L<guestfs(3)>."
15302 #: ../fish/guestfish.pod:36
15304 "Guestfish gives you structured access to the libguestfs API, from shell "
15305 "scripts or the command line or interactively. If you want to rescue a "
15306 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15311 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:800
15312 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
15313 #: ../tools/virt-resize.pl:66 ../tools/virt-cat.pl:50 ../tools/virt-tar.pl:45
15318 #: ../fish/guestfish.pod:43
15319 msgid "As an interactive shell"
15323 #: ../fish/guestfish.pod:45
15331 #: ../fish/guestfish.pod:47
15334 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15335 " editing virtual machine filesystems.\n"
15340 #: ../fish/guestfish.pod:50
15343 " Type: 'help' for a list of commands\n"
15344 " 'man' to read the manual\n"
15345 " 'quit' to quit the shell\n"
15350 #: ../fish/guestfish.pod:54
15353 " ><fs> add-ro disk.img\n"
15355 " ><fs> list-filesystems\n"
15356 " /dev/sda1: ext4\n"
15357 " /dev/vg_guest/lv_root: ext4\n"
15358 " /dev/vg_guest/lv_swap: swap\n"
15359 " ><fs> mount /dev/vg_guest/lv_root /\n"
15360 " ><fs> cat /etc/fstab\n"
15362 " # Created by anaconda\n"
15369 #: ../fish/guestfish.pod:67
15370 msgid "From shell scripts"
15374 #: ../fish/guestfish.pod:69
15375 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15379 #: ../fish/guestfish.pod:71
15382 " guestfish <<_EOF_\n"
15385 " mount /dev/vg_guest/lv_root /\n"
15386 " write /etc/motd \"Welcome, new users\"\n"
15392 #: ../fish/guestfish.pod:78
15393 msgid "List the LVM logical volumes in a disk image:"
15397 #: ../fish/guestfish.pod:80
15400 " guestfish -a disk.img --ro <<_EOF_\n"
15408 #: ../fish/guestfish.pod:85
15409 msgid "List all the filesystems in a disk image:"
15413 #: ../fish/guestfish.pod:87
15416 " guestfish -a disk.img --ro <<_EOF_\n"
15418 " list-filesystems\n"
15424 #: ../fish/guestfish.pod:92
15425 msgid "On one command line"
15429 #: ../fish/guestfish.pod:94
15430 msgid "Update C</etc/resolv.conf> in a guest:"
15434 #: ../fish/guestfish.pod:96
15438 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15439 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15444 #: ../fish/guestfish.pod:100
15445 msgid "Edit C</boot/grub/grub.conf> interactively:"
15449 #: ../fish/guestfish.pod:102
15452 " guestfish --add disk.img \\\n"
15453 " --mount /dev/vg_guest/lv_root \\\n"
15454 " --mount /dev/sda1:/boot \\\n"
15455 " edit /boot/grub/grub.conf\n"
15460 #: ../fish/guestfish.pod:107
15461 msgid "Mount disks automatically"
15465 #: ../fish/guestfish.pod:109
15467 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
15471 #: ../fish/guestfish.pod:112
15474 " guestfish --ro -a disk.img -i cat /etc/group\n"
15479 #: ../fish/guestfish.pod:114
15482 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15487 #: ../fish/guestfish.pod:116
15488 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15492 #: ../fish/guestfish.pod:118
15495 " guestfish -a disk.img -i edit /boot/grub/grub.conf\n"
15500 #: ../fish/guestfish.pod:120
15501 msgid "As a script interpreter"
15505 #: ../fish/guestfish.pod:122
15506 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15510 #: ../fish/guestfish.pod:124
15513 " #!/usr/bin/guestfish -f\n"
15514 " sparse test1.img 100M\n"
15516 " part-disk /dev/sda mbr\n"
15517 " mkfs ext2 /dev/sda1\n"
15522 #: ../fish/guestfish.pod:130
15523 msgid "Start with a prepared disk"
15527 #: ../fish/guestfish.pod:132
15529 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15530 "single ext2-formatted partition:"
15534 #: ../fish/guestfish.pod:135
15537 " guestfish -N fs\n"
15542 #: ../fish/guestfish.pod:137
15543 msgid "To list what is available do:"
15547 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:791
15550 " guestfish -N help | less\n"
15555 #: ../fish/guestfish.pod:141
15556 msgid "Remote control"
15560 #: ../fish/guestfish.pod:143
15563 " eval `guestfish --listen`\n"
15564 " guestfish --remote add-ro disk.img\n"
15565 " guestfish --remote run\n"
15566 " guestfish --remote lvs\n"
15571 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
15572 #: ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68
15573 #: ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171
15574 #: ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257
15575 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-cat.pl:79
15576 #: ../tools/virt-tar.pl:98 ../tools/virt-rescue.pl:103
15577 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
15582 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:124
15583 #: ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80
15584 #: ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86
15585 #: ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58
15586 #: ../tools/virt-cat.pl:87 ../tools/virt-tar.pl:106
15587 #: ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161
15588 #: ../tools/virt-list-partitions.pl:59
15593 #: ../fish/guestfish.pod:154
15594 msgid "Displays general help on options."
15598 #: ../fish/guestfish.pod:156
15599 msgid "B<-h> | B<--cmd-help>"
15603 #: ../fish/guestfish.pod:158
15604 msgid "Lists all available guestfish commands."
15608 #: ../fish/guestfish.pod:160
15609 msgid "B<-h cmd> | B<--cmd-help cmd>"
15613 #: ../fish/guestfish.pod:162
15614 msgid "Displays detailed help on a single command C<cmd>."
15618 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
15619 msgid "B<-a image> | B<--add image>"
15623 #: ../fish/guestfish.pod:166
15624 msgid "Add a block device or virtual machine image to the shell."
15628 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
15630 "The format of the disk image is auto-detected. To override this and force a "
15631 "particular format use the I<--format=..> option."
15635 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
15636 msgid "B<-c URI> | B<--connect URI>"
15640 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
15642 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15643 "URI to use. The default is to use the default libvirt connection."
15647 #: ../fish/guestfish.pod:177 ../fuse/guestmount.pod:90
15648 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
15652 #: ../fish/guestfish.pod:179 ../fuse/guestmount.pod:92
15654 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15655 "used, then any libvirt domain can be used. However in write mode, only "
15656 "libvirt domains which are shut down can be named here."
15660 #: ../fish/guestfish.pod:183
15661 msgid "B<-D> | B<--no-dest-paths>"
15665 #: ../fish/guestfish.pod:185
15667 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15668 "to hit the tab key to complete paths on the guest filesystem, but this "
15669 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15670 "allow this feature to be disabled."
15674 #: ../fish/guestfish.pod:190
15675 msgid "B<--echo-keys>"
15679 #: ../fish/guestfish.pod:192
15681 "When prompting for keys and passphrases, guestfish normally turns echoing "
15682 "off so you cannot see what you are typing. If you are not worried about "
15683 "Tempest attacks and there is no one else in the room you can specify this "
15684 "flag to see what you are typing."
15688 #: ../fish/guestfish.pod:197
15689 msgid "B<-f file> | B<--file file>"
15693 #: ../fish/guestfish.pod:199
15694 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15698 #: ../fish/guestfish.pod:202
15701 " #!/usr/bin/guestfish -f\n"
15706 #: ../fish/guestfish.pod:204 ../fuse/guestmount.pod:108
15707 msgid "B<--format=raw|qcow2|..> | B<--format>"
15711 #: ../fish/guestfish.pod:206 ../fuse/guestmount.pod:110
15713 "The default for the I<-a> option is to auto-detect the format of the disk "
15714 "image. Using this forces the disk format for I<-a> options which follow on "
15715 "the command line. Using I<--format> with no argument switches back to auto-"
15716 "detection for subsequent I<-a> options."
15720 #: ../fish/guestfish.pod:211 ../fish/guestfish.pod:504
15721 #: ../inspector/virt-inspector.pl:549
15722 msgid "For example:"
15726 #: ../fish/guestfish.pod:213
15729 " guestfish --format=raw -a disk.img\n"
15734 #: ../fish/guestfish.pod:215
15735 msgid "forces raw format (no auto-detection) for C<disk.img>."
15739 #: ../fish/guestfish.pod:217
15742 " guestfish --format=raw -a disk.img --format -a another.img\n"
15747 #: ../fish/guestfish.pod:219
15749 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
15750 "detection for C<another.img>."
15754 #: ../fish/guestfish.pod:222
15756 "If you have untrusted raw-format guest disk images, you should use this "
15757 "option to specify the disk format. This avoids a possible security problem "
15758 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15762 #: ../fish/guestfish.pod:227 ../fuse/guestmount.pod:128
15763 msgid "B<-i> | B<--inspector>"
15767 #: ../fish/guestfish.pod:229 ../fuse/guestmount.pod:130
15769 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15770 "system and mount filesystems as they would be mounted on the real virtual "
15775 #: ../fish/guestfish.pod:233
15776 msgid "Typical usage is either:"
15780 #: ../fish/guestfish.pod:235
15783 " guestfish -d myguest -i\n"
15788 #: ../fish/guestfish.pod:237
15789 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15793 #: ../fish/guestfish.pod:239
15796 " guestfish --ro -d myguest -i\n"
15801 #: ../fish/guestfish.pod:241
15802 msgid "(for active domains, readonly), or specify the block device directly:"
15806 #: ../fish/guestfish.pod:243
15809 " guestfish -a /dev/Guests/MyGuest -i\n"
15814 #: ../fish/guestfish.pod:245
15816 "Note that the command line syntax changed slightly over older versions of "
15817 "guestfish. You can still use the old syntax:"
15821 #: ../fish/guestfish.pod:248
15824 " guestfish [--ro] -i disk.img\n"
15829 #: ../fish/guestfish.pod:250
15832 " guestfish [--ro] -i libvirt-domain\n"
15837 #: ../fish/guestfish.pod:252
15838 msgid "B<--keys-from-stdin>"
15842 #: ../fish/guestfish.pod:254
15844 "Read key or passphrase parameters from stdin. The default is to try to read "
15845 "passphrases from the user by opening C</dev/tty>."
15849 #: ../fish/guestfish.pod:257
15850 msgid "B<--listen>"
15854 #: ../fish/guestfish.pod:259
15856 "Fork into the background and listen for remote commands. See section L</"
15857 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15861 #: ../fish/guestfish.pod:262
15862 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15866 #: ../fish/guestfish.pod:264
15867 msgid "Mount the named partition or logical volume on the given mountpoint."
15871 #: ../fish/guestfish.pod:266
15872 msgid "If the mountpoint is omitted, it defaults to C</>."
15876 #: ../fish/guestfish.pod:268
15877 msgid "You have to mount something on C</> before most commands will work."
15881 #: ../fish/guestfish.pod:270
15883 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15888 #: ../fish/guestfish.pod:273
15890 "If you don't know what filesystems a disk image contains, you can either run "
15891 "guestfish without this option, then list the partitions and LVs available "
15892 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
15893 "list-filesystems(1)> program."
15897 #: ../fish/guestfish.pod:278 ../fuse/guestmount.pod:142
15898 msgid "B<-n> | B<--no-sync>"
15902 #: ../fish/guestfish.pod:280
15904 "Disable autosync. This is enabled by default. See the discussion of "
15905 "autosync in the L<guestfs(3)> manpage."
15909 #: ../fish/guestfish.pod:283
15910 msgid "B<-N type> | B<--new type> | B<-N help>"
15914 #: ../fish/guestfish.pod:285
15916 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15917 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15918 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15923 #: ../fish/guestfish.pod:290
15924 msgid "B<--progress-bars>"
15928 #: ../fish/guestfish.pod:292
15929 msgid "Enable progress bars, even when guestfish is used non-interactively."
15933 #: ../fish/guestfish.pod:294
15935 "Progress bars are enabled by default when guestfish is used as an "
15936 "interactive shell."
15940 #: ../fish/guestfish.pod:297
15941 msgid "B<--no-progress-bars>"
15945 #: ../fish/guestfish.pod:299
15946 msgid "Disable progress bars."
15950 #: ../fish/guestfish.pod:301
15951 msgid "B<--remote[=pid]>"
15955 #: ../fish/guestfish.pod:303
15957 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15958 "CONTROL GUESTFISH OVER A SOCKET> below."
15962 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
15963 msgid "B<-r> | B<--ro>"
15967 #: ../fish/guestfish.pod:308
15969 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15970 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15974 #: ../fish/guestfish.pod:311 ../tools/virt-rescue.pl:187
15976 "The option must always be used if the disk image or virtual machine might be "
15977 "running, and is generally recommended in cases where you don't need write "
15978 "access to the disk."
15982 #: ../fish/guestfish.pod:315
15984 "Note that prepared disk images created with I<-N> are not affected by the "
15989 #: ../fish/guestfish.pod:318 ../fuse/guestmount.pod:194
15990 #: ../tools/virt-rescue.pl:195
15991 msgid "B<--selinux>"
15995 #: ../fish/guestfish.pod:320
15996 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16000 #: ../fish/guestfish.pod:322 ../fuse/guestmount.pod:198
16001 msgid "B<-v> | B<--verbose>"
16005 #: ../fish/guestfish.pod:324
16007 "Enable very verbose messages. This is particularly useful if you find a bug."
16011 #: ../fish/guestfish.pod:327 ../fuse/guestmount.pod:202
16012 msgid "B<-V> | B<--version>"
16016 #: ../fish/guestfish.pod:329
16017 msgid "Display the guestfish / libguestfs version number and exit."
16021 #: ../fish/guestfish.pod:331
16026 #: ../fish/guestfish.pod:333
16027 msgid "Echo each command before executing it."
16031 #: ../fish/guestfish.pod:337
16032 msgid "COMMANDS ON COMMAND LINE"
16036 #: ../fish/guestfish.pod:339
16038 "Any additional (non-option) arguments are treated as commands to execute."
16042 #: ../fish/guestfish.pod:342
16044 "Commands to execute should be separated by a colon (C<:>), where the colon "
16045 "is a separate parameter. Thus:"
16049 #: ../fish/guestfish.pod:345
16052 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16057 #: ../fish/guestfish.pod:347
16059 "If there are no additional arguments, then we enter a shell, either an "
16060 "interactive shell with a prompt (if the input is a terminal) or a non-"
16061 "interactive shell."
16065 #: ../fish/guestfish.pod:351
16067 "In either command line mode or non-interactive shell, the first command that "
16068 "gives an error causes the whole shell to exit. In interactive mode (with a "
16069 "prompt) if a command fails, you can continue to enter commands."
16073 #: ../fish/guestfish.pod:356
16074 msgid "USING launch (OR run)"
16078 #: ../fish/guestfish.pod:358
16080 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16081 "then launch it, then mount any disks you need, and finally issue actions/"
16082 "commands. So the general order of the day is:"
16086 #: ../fish/guestfish.pod:366
16087 msgid "add or -a/--add"
16091 #: ../fish/guestfish.pod:370
16092 msgid "launch (aka run)"
16096 #: ../fish/guestfish.pod:374
16097 msgid "mount or -m/--mount"
16101 #: ../fish/guestfish.pod:378
16102 msgid "any other commands"
16106 #: ../fish/guestfish.pod:382
16108 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16109 "guest before mounting or performing any other commands."
16113 #: ../fish/guestfish.pod:385
16115 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16116 "I<--new> options were given then C<run> is done automatically, simply "
16117 "because guestfish can't perform the action you asked for without doing this."
16121 #: ../fish/guestfish.pod:390
16126 #: ../fish/guestfish.pod:392
16128 "You can quote ordinary parameters using either single or double quotes. For "
16133 #: ../fish/guestfish.pod:395
16136 " add \"file with a space.img\"\n"
16141 #: ../fish/guestfish.pod:397
16144 " rm '/file name'\n"
16149 #: ../fish/guestfish.pod:399
16157 #: ../fish/guestfish.pod:401
16159 "A few commands require a list of strings to be passed. For these, use a "
16160 "whitespace-separated list, enclosed in quotes. Strings containing "
16161 "whitespace to be passed through must be enclosed in single quotes. A "
16162 "literal single quote must be escaped with a backslash."
16166 #: ../fish/guestfish.pod:406
16169 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16170 " command \"/bin/echo 'foo bar'\"\n"
16171 " command \"/bin/echo \\'foo\\'\"\n"
16176 #: ../fish/guestfish.pod:410
16177 msgid "OPTIONAL ARGUMENTS"
16181 #: ../fish/guestfish.pod:412
16183 "Some commands take optional arguments. These arguments appear in this "
16184 "documentation as C<[argname:..]>. You can use them as in these examples:"
16188 #: ../fish/guestfish.pod:416
16191 " add-drive-opts filename\n"
16196 #: ../fish/guestfish.pod:418
16199 " add-drive-opts filename readonly:true\n"
16204 #: ../fish/guestfish.pod:420
16207 " add-drive-opts filename format:qcow2 readonly:false\n"
16212 #: ../fish/guestfish.pod:422
16214 "Each optional argument can appear at most once. All optional arguments must "
16215 "appear after the required ones."
16219 #: ../fish/guestfish.pod:425
16224 #: ../fish/guestfish.pod:427
16226 "This section applies to all commands which can take integers as parameters."
16230 #: ../fish/guestfish.pod:430
16231 msgid "SIZE SUFFIX"
16235 #: ../fish/guestfish.pod:432
16237 "When the command takes a parameter measured in bytes, you can use one of the "
16238 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16242 #: ../fish/guestfish.pod:438
16243 msgid "B<k> or B<K> or B<KiB>"
16247 #: ../fish/guestfish.pod:440
16248 msgid "The size in kilobytes (multiplied by 1024)."
16252 #: ../fish/guestfish.pod:442
16257 #: ../fish/guestfish.pod:444
16258 msgid "The size in SI 1000 byte units."
16262 #: ../fish/guestfish.pod:446
16263 msgid "B<M> or B<MiB>"
16267 #: ../fish/guestfish.pod:448
16268 msgid "The size in megabytes (multiplied by 1048576)."
16272 #: ../fish/guestfish.pod:450
16277 #: ../fish/guestfish.pod:452
16278 msgid "The size in SI 1000000 byte units."
16282 #: ../fish/guestfish.pod:454
16283 msgid "B<G> or B<GiB>"
16287 #: ../fish/guestfish.pod:456
16288 msgid "The size in gigabytes (multiplied by 2**30)."
16292 #: ../fish/guestfish.pod:458
16297 #: ../fish/guestfish.pod:460
16298 msgid "The size in SI 10**9 byte units."
16302 #: ../fish/guestfish.pod:462
16303 msgid "B<T> or B<TiB>"
16307 #: ../fish/guestfish.pod:464
16308 msgid "The size in terabytes (multiplied by 2**40)."
16312 #: ../fish/guestfish.pod:466
16317 #: ../fish/guestfish.pod:468
16318 msgid "The size in SI 10**12 byte units."
16322 #: ../fish/guestfish.pod:470
16323 msgid "B<P> or B<PiB>"
16327 #: ../fish/guestfish.pod:472
16328 msgid "The size in petabytes (multiplied by 2**50)."
16332 #: ../fish/guestfish.pod:474
16337 #: ../fish/guestfish.pod:476
16338 msgid "The size in SI 10**15 byte units."
16342 #: ../fish/guestfish.pod:478
16343 msgid "B<E> or B<EiB>"
16347 #: ../fish/guestfish.pod:480
16348 msgid "The size in exabytes (multiplied by 2**60)."
16352 #: ../fish/guestfish.pod:482
16357 #: ../fish/guestfish.pod:484
16358 msgid "The size in SI 10**18 byte units."
16362 #: ../fish/guestfish.pod:486
16363 msgid "B<Z> or B<ZiB>"
16367 #: ../fish/guestfish.pod:488
16368 msgid "The size in zettabytes (multiplied by 2**70)."
16372 #: ../fish/guestfish.pod:490
16377 #: ../fish/guestfish.pod:492
16378 msgid "The size in SI 10**21 byte units."
16382 #: ../fish/guestfish.pod:494
16383 msgid "B<Y> or B<YiB>"
16387 #: ../fish/guestfish.pod:496
16388 msgid "The size in yottabytes (multiplied by 2**80)."
16392 #: ../fish/guestfish.pod:498
16397 #: ../fish/guestfish.pod:500
16398 msgid "The size in SI 10**24 byte units."
16402 #: ../fish/guestfish.pod:506
16405 " truncate-size /file 1G\n"
16410 #: ../fish/guestfish.pod:508
16411 msgid "would truncate the file to 1 gigabyte."
16415 #: ../fish/guestfish.pod:510
16417 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
16418 "the parameter to L</memsize> is specified in megabytes already). Adding a "
16419 "suffix will probably not do what you expect."
16423 #: ../fish/guestfish.pod:514
16424 msgid "OCTAL AND HEXADECIMAL NUMBERS"
16428 #: ../fish/guestfish.pod:516
16430 "For specifying the radix (base) use the C convention: C<0> to prefix an "
16431 "octal number or C<0x> to prefix a hexadecimal number. For example:"
16435 #: ../fish/guestfish.pod:519
16438 " 1234 decimal number 1234\n"
16439 " 02322 octal number, equivalent to decimal 1234\n"
16440 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16445 #: ../fish/guestfish.pod:523
16447 "When using the C<chmod> command, you almost always want to specify an octal "
16448 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16449 "L<chmod(1)> program):"
16453 #: ../fish/guestfish.pod:527
16456 " chmod 0777 /public # OK\n"
16457 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16462 #: ../fish/guestfish.pod:530
16464 "Commands that return numbers usually print them in decimal, but some "
16465 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16466 "octal, preceeded by C<0>)."
16470 #: ../fish/guestfish.pod:534
16471 msgid "WILDCARDS AND GLOBBING"
16475 #: ../fish/guestfish.pod:536
16477 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16478 "(globbing) by default. So for example the following will not do what you "
16483 #: ../fish/guestfish.pod:540
16491 #: ../fish/guestfish.pod:542
16493 "Assuming you don't have a directory called literally C</home/*> then the "
16494 "above command will return an error."
16498 #: ../fish/guestfish.pod:545
16499 msgid "To perform wildcard expansion, use the C<glob> command."
16503 #: ../fish/guestfish.pod:547
16506 " glob rm-rf /home/*\n"
16511 #: ../fish/guestfish.pod:549
16513 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16514 "many times), equivalent to:"
16518 #: ../fish/guestfish.pod:552
16521 " rm-rf /home/jim\n"
16522 " rm-rf /home/joe\n"
16523 " rm-rf /home/mary\n"
16528 #: ../fish/guestfish.pod:556
16529 msgid "C<glob> only works on simple guest paths and not on device names."
16533 #: ../fish/guestfish.pod:558
16535 "If you have several parameters, each containing a wildcard, then glob will "
16536 "perform a Cartesian product."
16540 #: ../fish/guestfish.pod:561
16545 #: ../fish/guestfish.pod:563
16547 "Any line which starts with a I<#> character is treated as a comment and "
16548 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16549 "a command. For example:"
16553 #: ../fish/guestfish.pod:567
16556 " # this is a comment\n"
16557 " # this is a comment\n"
16558 " foo # NOT a comment\n"
16563 #: ../fish/guestfish.pod:571
16564 msgid "Blank lines are also ignored."
16568 #: ../fish/guestfish.pod:573
16569 msgid "RUNNING COMMANDS LOCALLY"
16573 #: ../fish/guestfish.pod:575
16575 "Any line which starts with a I<!> character is treated as a command sent to "
16576 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
16580 #: ../fish/guestfish.pod:579
16584 " tgz-out /remote local/remote-data.tar.gz\n"
16589 #: ../fish/guestfish.pod:582
16591 "will create a directory C<local> on the host, and then export the contents "
16592 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
16593 "(See C<tgz-out>)."
16597 #: ../fish/guestfish.pod:586
16599 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
16600 "effect, due to the way that subprocesses work in Unix."
16604 #: ../fish/guestfish.pod:589
16609 #: ../fish/guestfish.pod:591
16611 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
16612 "command (a guestfish command) to the second command (any host command). For "
16617 #: ../fish/guestfish.pod:595
16620 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
16625 #: ../fish/guestfish.pod:597
16627 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
16628 "program). The above command would list all accounts in the guest filesystem "
16629 "which have UID 0, ie. root accounts including backdoors. Other examples:"
16633 #: ../fish/guestfish.pod:602
16636 " hexdump /bin/ls | head\n"
16637 " list-devices | tail -1\n"
16638 " tgz-out / - | tar ztf -\n"
16643 #: ../fish/guestfish.pod:606
16645 "The space before the pipe symbol is required, any space after the pipe "
16646 "symbol is optional. Everything after the pipe symbol is just passed "
16647 "straight to the host shell, so it can contain redirections, globs and "
16648 "anything else that makes sense on the host side."
16652 #: ../fish/guestfish.pod:611
16654 "To use a literal argument which begins with a pipe symbol, you have to quote "
16659 #: ../fish/guestfish.pod:614
16667 #: ../fish/guestfish.pod:616
16668 msgid "HOME DIRECTORIES"
16672 #: ../fish/guestfish.pod:618
16674 "If a parameter starts with the character C<~> then the tilde may be expanded "
16675 "as a home directory path (either C<~> for the current user's home directory, "
16676 "or C<~user> for another user)."
16680 #: ../fish/guestfish.pod:622
16682 "Note that home directory expansion happens for users known I<on the host>, "
16683 "not in the guest filesystem."
16687 #: ../fish/guestfish.pod:625
16689 "To use a literal argument which begins with a tilde, you have to quote it, "
16694 #: ../fish/guestfish.pod:628
16702 #: ../fish/guestfish.pod:632
16704 "Libguestfs has some support for Linux guests encrypted according to the "
16705 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
16706 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
16707 "LUKS is supported."
16711 #: ../fish/guestfish.pod:637
16712 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
16716 #: ../fish/guestfish.pod:639
16719 " ><fs> vfs-type /dev/sda2\n"
16725 #: ../fish/guestfish.pod:642
16727 "Then open those devices using L</luks-open>. This creates a device-mapper "
16728 "device called C</dev/mapper/luksdev>."
16732 #: ../fish/guestfish.pod:645
16735 " ><fs> luks-open /dev/sda2 luksdev\n"
16736 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
16741 #: ../fish/guestfish.pod:648
16743 "Finally you have to tell LVM to scan for volume groups on the newly created "
16748 #: ../fish/guestfish.pod:651
16752 " vg-activate-all true\n"
16757 #: ../fish/guestfish.pod:654
16758 msgid "The logical volume(s) can now be mounted in the usual way."
16762 #: ../fish/guestfish.pod:656
16764 "Before closing a LUKS device you must unmount any logical volumes on it and "
16765 "deactivate the volume groups by calling C<vg-activate false VG> on each "
16766 "one. Then you can close the mapper device:"
16770 #: ../fish/guestfish.pod:660
16773 " vg-activate false /dev/VG\n"
16774 " luks-close /dev/mapper/luksdev\n"
16779 #: ../fish/guestfish.pod:663
16780 msgid "WINDOWS PATHS"
16784 #: ../fish/guestfish.pod:665
16786 "If a path is prefixed with C<win:> then you can use Windows-style paths "
16787 "(with some limitations). The following commands are equivalent:"
16791 #: ../fish/guestfish.pod:668
16794 " file /WINDOWS/system32/config/system.LOG\n"
16799 #: ../fish/guestfish.pod:670
16802 " file win:/windows/system32/config/system.log\n"
16807 #: ../fish/guestfish.pod:672
16810 " file win:\\windows\\system32\\config\\system.log\n"
16815 #: ../fish/guestfish.pod:674
16818 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
16823 #: ../fish/guestfish.pod:676
16825 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
16826 "handles case insensitivity like Windows would. This only works in argument "
16827 "positions that expect a path."
16831 #: ../fish/guestfish.pod:680
16832 msgid "UPLOADING AND DOWNLOADING FILES"
16836 #: ../fish/guestfish.pod:682
16838 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
16839 "others which upload from or download to a local file, you can use the "
16840 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
16844 #: ../fish/guestfish.pod:686
16852 #: ../fish/guestfish.pod:688
16854 "reads stdin and creates from that a file C</foo> in the disk image, and:"
16858 #: ../fish/guestfish.pod:691
16861 " tar-out /etc - | tar tf -\n"
16866 #: ../fish/guestfish.pod:693
16868 "writes the tarball to stdout and then pipes that into the external \"tar\" "
16869 "command (see L</PIPES>)."
16873 #: ../fish/guestfish.pod:696
16875 "When using C<-> to read from stdin, the input is read up to the end of "
16876 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
16877 "some arbitrary end marker:"
16881 #: ../fish/guestfish.pod:700
16884 " upload -<<END /foo\n"
16893 #: ../fish/guestfish.pod:706
16895 "Any string of characters can be used instead of C<END>. The end marker must "
16896 "appear on a line of its own, without any preceeding or following characters "
16897 "(not even spaces)."
16901 #: ../fish/guestfish.pod:710
16903 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16904 "upload local files (so-called \"FileIn\" parameters in the generator)."
16908 #: ../fish/guestfish.pod:713
16909 msgid "EXIT ON ERROR BEHAVIOUR"
16913 #: ../fish/guestfish.pod:715
16915 "By default, guestfish will ignore any errors when in interactive mode (ie. "
16916 "taking commands from a human over a tty), and will exit on the first error "
16917 "in non-interactive mode (scripts, commands given on the command line)."
16921 #: ../fish/guestfish.pod:720
16923 "If you prefix a command with a I<-> character, then that command will not "
16924 "cause guestfish to exit, even if that (one) command returns an error."
16928 #: ../fish/guestfish.pod:724
16929 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16933 #: ../fish/guestfish.pod:726
16935 "Guestfish can be remote-controlled over a socket. This is useful "
16936 "particularly in shell scripts where you want to make several different "
16937 "changes to a filesystem, but you don't want the overhead of starting up a "
16938 "guestfish process each time."
16942 #: ../fish/guestfish.pod:731
16943 msgid "Start a guestfish server process using:"
16947 #: ../fish/guestfish.pod:733
16950 " eval `guestfish --listen`\n"
16955 #: ../fish/guestfish.pod:735
16956 msgid "and then send it commands by doing:"
16960 #: ../fish/guestfish.pod:737
16963 " guestfish --remote cmd [...]\n"
16968 #: ../fish/guestfish.pod:739
16969 msgid "To cause the server to exit, send it the exit command:"
16973 #: ../fish/guestfish.pod:741
16976 " guestfish --remote exit\n"
16981 #: ../fish/guestfish.pod:743
16983 "Note that the server will normally exit if there is an error in a command. "
16984 "You can change this in the usual way. See section L</EXIT ON ERROR "
16989 #: ../fish/guestfish.pod:747
16990 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16994 #: ../fish/guestfish.pod:749
16996 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16997 "is how the I<--remote> option knows where to send the commands. You can "
16998 "have several guestfish listener processes running using:"
17002 #: ../fish/guestfish.pod:753
17005 " eval `guestfish --listen`\n"
17006 " pid1=$GUESTFISH_PID\n"
17007 " eval `guestfish --listen`\n"
17008 " pid2=$GUESTFISH_PID\n"
17010 " guestfish --remote=$pid1 cmd\n"
17011 " guestfish --remote=$pid2 cmd\n"
17016 #: ../fish/guestfish.pod:761
17017 msgid "REMOTE CONTROL DETAILS"
17021 #: ../fish/guestfish.pod:763
17023 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
17024 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
17025 "and C<$PID> is the process ID of the server."
17029 #: ../fish/guestfish.pod:767
17030 msgid "Guestfish client and server versions must match exactly."
17034 #: ../fish/guestfish.pod:769
17035 msgid "PREPARED DISK IMAGES"
17039 #: ../fish/guestfish.pod:771
17041 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17042 "preformatted disk images that guestfish can make for you to save typing. "
17043 "This is particularly useful for testing purposes. This option is used "
17044 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17045 "can be mixed with I<-a>)."
17049 #: ../fish/guestfish.pod:777
17051 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17052 "the second and so on. Existing files in the current directory are "
17057 #: ../fish/guestfish.pod:781
17059 "The type briefly describes how the disk should be sized, partitioned, how "
17060 "filesystem(s) should be created, and how content should be added. "
17061 "Optionally the type can be followed by extra parameters, separated by C<:> "
17062 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
17063 "allocated disk, containing a single partition, with the partition formatted "
17064 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
17069 #: ../fish/guestfish.pod:789
17070 msgid "To list the available types and any extra parameters they take, run:"
17074 #: ../fish/guestfish.pod:793
17076 "Note that the prepared filesystem is not mounted. You would usually have to "
17077 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17081 #: ../fish/guestfish.pod:797
17083 "If any I<-N> or I<--new> options are given, the guest is automatically "
17088 #: ../fish/guestfish.pod:802
17089 msgid "Create a 100MB disk with an ext4-formatted partition:"
17093 #: ../fish/guestfish.pod:804
17096 " guestfish -N fs:ext4\n"
17101 #: ../fish/guestfish.pod:806
17102 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17106 #: ../fish/guestfish.pod:808
17109 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17114 #: ../fish/guestfish.pod:810
17115 msgid "Create a blank 200MB disk:"
17119 #: ../fish/guestfish.pod:812
17122 " guestfish -N disk:200M\n"
17127 #: ../fish/guestfish.pod:814
17128 msgid "PROGRESS BARS"
17132 #: ../fish/guestfish.pod:816
17134 "Some (not all) long-running commands send progress notification messages as "
17135 "they are running. Guestfish turns these messages into progress bars."
17139 #: ../fish/guestfish.pod:820
17141 "When a command that supports progress bars takes longer than two seconds to "
17142 "run, and if progress bars are enabled, then you will see one appearing below "
17147 #: ../fish/guestfish.pod:824
17150 " ><fs> copy-size /large-file /another-file 2048M\n"
17151 " / 10% [#####-----------------------------------------] 00:30\n"
17156 #: ../fish/guestfish.pod:827
17158 "The spinner on the left hand side moves round once for every progress "
17159 "notification received from the backend. This is a (reasonably) golden "
17160 "assurance that the command is \"doing something\" even if the progress bar "
17161 "is not moving, because the command is able to send the progress "
17162 "notifications. When the bar reaches 100% and the command finishes, the "
17163 "spinner disappears."
17167 #: ../fish/guestfish.pod:834
17169 "Progress bars are enabled by default when guestfish is used interactively. "
17170 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17171 "and you can disable them completely using I<--no-progress-bars>."
17175 #: ../fish/guestfish.pod:839
17176 msgid "GUESTFISH COMMANDS"
17180 #: ../fish/guestfish.pod:841
17182 "The commands in this section are guestfish convenience commands, in other "
17183 "words, they are not part of the L<guestfs(3)> API."
17187 #: ../fish/guestfish.pod:844
17192 #: ../fish/guestfish.pod:846
17201 #: ../fish/guestfish.pod:849
17203 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
17204 "this displays detailed help for a command."
17208 #: ../fish/guestfish.pod:852
17209 msgid "quit | exit"
17213 #: ../fish/guestfish.pod:854
17214 msgid "This exits guestfish. You can also use C<^D> key."
17218 #: ../fish/guestfish.pod:856
17219 msgid "@FISH_COMMANDS@"
17223 #: ../fish/guestfish.pod:858
17228 #: ../fish/guestfish.pod:862 ../test-tool/libguestfs-test-tool.pod:83
17233 #: ../fish/guestfish.pod:864
17235 "guestfish returns 0 if the commands completed without error, or 1 if there "
17240 #: ../fish/guestfish.pod:871
17245 #: ../fish/guestfish.pod:873
17247 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17252 #: ../fish/guestfish.pod:876
17253 msgid "GUESTFISH_PID"
17257 #: ../fish/guestfish.pod:878
17259 "Used with the I<--remote> option to specify the remote guestfish process to "
17260 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17264 #: ../fish/guestfish.pod:882
17269 #: ../fish/guestfish.pod:884
17271 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17272 "not specified, the external L<hexedit(1)> program is used."
17276 #: ../fish/guestfish.pod:888
17281 #: ../fish/guestfish.pod:890
17283 "If compiled with GNU readline support, various files in the home directory "
17284 "can be used. See L</FILES>."
17288 #: ../fish/guestfish.pod:899
17290 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17291 "effect as using the B<-v> option."
17295 #: ../fish/guestfish.pod:911
17297 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17298 "the discussion of paths in L<guestfs(3)>."
17302 #: ../fish/guestfish.pod:922
17303 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17307 #: ../fish/guestfish.pod:924
17312 #: ../fish/guestfish.pod:926
17314 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17319 #: ../fish/guestfish.pod:941 ../test-tool/libguestfs-test-tool.pod:88
17324 #: ../fish/guestfish.pod:945
17325 msgid "$HOME/.guestfish"
17329 #: ../fish/guestfish.pod:947
17331 "If compiled with GNU readline support, then the command history is saved in "
17336 #: ../fish/guestfish.pod:950
17337 msgid "$HOME/.inputrc"
17341 #: ../fish/guestfish.pod:952
17342 msgid "/etc/inputrc"
17346 #: ../fish/guestfish.pod:954
17348 "If compiled with GNU readline support, then these files can be used to "
17349 "configure readline. For further information, please see L<readline(3)/"
17350 "INITIALIZATION FILE>."
17354 #: ../fish/guestfish.pod:958
17355 msgid "To write rules which only apply to guestfish, use:"
17359 #: ../fish/guestfish.pod:960
17369 #: ../fish/guestfish.pod:964
17371 "Variables that you can set in inputrc that change the behaviour of guestfish "
17372 "in useful ways include:"
17376 #: ../fish/guestfish.pod:969
17377 msgid "completion-ignore-case (default: on)"
17381 #: ../fish/guestfish.pod:971
17383 "By default, guestfish will ignore case when tab-completing paths on the "
17388 #: ../fish/guestfish.pod:974
17391 " set completion-ignore-case off\n"
17396 #: ../fish/guestfish.pod:976
17397 msgid "to make guestfish case sensitive."
17401 #: ../fish/guestfish.pod:980
17406 #: ../fish/guestfish.pod:982
17407 msgid "test2.img (etc)"
17411 #: ../fish/guestfish.pod:984
17413 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
17414 "will be created in the file C<test1.img> in the current directory. The "
17415 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
17416 "the same name will be overwritten."
17420 #: ../fish/guestfish.pod:993
17422 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
17423 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
17424 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
17425 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
17429 #: ../fish/guestfish.pod:1017 ../test-tool/libguestfs-test-tool.pod:124
17430 #: ../fuse/guestmount.pod:234 ../inspector/virt-inspector.pl:598
17431 #: ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518
17432 #: ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251
17433 #: ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206
17434 #: ../tools/virt-cat.pl:203 ../tools/virt-tar.pl:300
17435 #: ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:567
17436 #: ../tools/virt-list-partitions.pl:273
17438 "This program is free software; you can redistribute it and/or modify it "
17439 "under the terms of the GNU General Public License as published by the Free "
17440 "Software Foundation; either version 2 of the License, or (at your option) "
17441 "any later version."
17445 #: ../fish/guestfish.pod:1022 ../test-tool/libguestfs-test-tool.pod:129
17446 #: ../fuse/guestmount.pod:239 ../inspector/virt-inspector.pl:603
17447 #: ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523
17448 #: ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256
17449 #: ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211
17450 #: ../tools/virt-cat.pl:208 ../tools/virt-tar.pl:305
17451 #: ../tools/virt-rescue.pl:290 ../tools/virt-make-fs.pl:572
17452 #: ../tools/virt-list-partitions.pl:278
17454 "This program is distributed in the hope that it will be useful, but WITHOUT "
17455 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
17456 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
17461 #: ../fish/guestfish.pod:1027 ../test-tool/libguestfs-test-tool.pod:134
17462 #: ../fuse/guestmount.pod:244 ../inspector/virt-inspector.pl:608
17463 #: ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528
17464 #: ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261
17465 #: ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216
17466 #: ../tools/virt-cat.pl:213 ../tools/virt-tar.pl:310
17467 #: ../tools/virt-rescue.pl:295 ../tools/virt-make-fs.pl:577
17468 #: ../tools/virt-list-partitions.pl:283
17470 "You should have received a copy of the GNU General Public License along with "
17471 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
17472 "Ave, Cambridge, MA 02139, USA."
17476 #: ../fish/guestfish-actions.pod:1
17481 #: ../fish/guestfish-actions.pod:3
17484 " add-cdrom filename\n"
17489 #: ../fish/guestfish-actions.pod:15
17491 "This call checks for the existence of C<filename>. This stops you from "
17492 "specifying other types of drive which are supported by qemu such as C<nbd:> "
17493 "and C<http:> URLs. To specify those, use the general L</config> call "
17498 #: ../fish/guestfish-actions.pod:22
17500 "If you just want to add an ISO file (often you use this as an efficient way "
17501 "to transfer large files into the guest), then you should probably use L</add-"
17502 "drive-ro> instead."
17506 #: ../fish/guestfish-actions.pod:35
17511 #: ../fish/guestfish-actions.pod:37
17514 " add-drive filename\n"
17519 #: ../fish/guestfish-actions.pod:39
17521 "This function is the equivalent of calling L</add-drive-opts> with no "
17522 "optional parameters, so the disk is added writable, with the format being "
17523 "detected automatically."
17527 #: ../fish/guestfish-actions.pod:43
17529 "Automatic detection of the format opens you up to a potential security hole "
17530 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
17531 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
17532 "you should think about replacing calls to this function with calls to L</add-"
17533 "drive-opts>, and specifying the format."
17537 #: ../fish/guestfish-actions.pod:50
17538 msgid "add-drive-opts"
17542 #: ../fish/guestfish-actions.pod:52
17547 #: ../fish/guestfish-actions.pod:54
17550 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
17555 #: ../fish/guestfish-actions.pod:81
17557 "This forces the image format. If you omit this (or use L</add-drive> or L</"
17558 "add-drive-ro>) then the format is automatically detected. Possible formats "
17559 "include C<raw> and C<qcow2>."
17563 #: ../fish/guestfish-actions.pod:92
17565 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
17566 "add-drive-with-if> call (q.v.)"
17570 #: ../fish/guestfish-actions.pod:97
17572 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
17576 #: ../fish/guestfish-actions.pod:99
17577 msgid "add-drive-ro"
17581 #: ../fish/guestfish-actions.pod:101
17586 #: ../fish/guestfish-actions.pod:103
17589 " add-drive-ro filename\n"
17594 #: ../fish/guestfish-actions.pod:105
17596 "This function is the equivalent of calling L</add-drive-opts> with the "
17597 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
17598 "is added read-only, with the format being detected automatically."
17602 #: ../fish/guestfish-actions.pod:110
17603 msgid "add-drive-ro-with-if"
17607 #: ../fish/guestfish-actions.pod:112
17610 " add-drive-ro-with-if filename iface\n"
17615 #: ../fish/guestfish-actions.pod:114
17617 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
17618 "interface emulation to use at run time."
17622 #: ../fish/guestfish-actions.pod:124
17623 msgid "add-drive-with-if"
17627 #: ../fish/guestfish-actions.pod:126
17630 " add-drive-with-if filename iface\n"
17635 #: ../fish/guestfish-actions.pod:128
17637 "This is the same as L</add-drive> but it allows you to specify the QEMU "
17638 "interface emulation to use at run time."
17642 #: ../fish/guestfish-actions.pod:138
17647 #: ../fish/guestfish-actions.pod:140
17650 " aug-clear augpath\n"
17655 #: ../fish/guestfish-actions.pod:145
17660 #: ../fish/guestfish-actions.pod:147
17668 #: ../fish/guestfish-actions.pod:149
17670 "Close the current Augeas handle and free up any resources used by it. After "
17671 "calling this, you have to call L</aug-init> again before you can use any "
17672 "other Augeas functions."
17676 #: ../fish/guestfish-actions.pod:154
17677 msgid "aug-defnode"
17681 #: ../fish/guestfish-actions.pod:156
17684 " aug-defnode name expr val\n"
17689 #: ../fish/guestfish-actions.pod:161
17691 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
17692 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
17693 "containing that single node."
17697 #: ../fish/guestfish-actions.pod:169
17702 #: ../fish/guestfish-actions.pod:171
17705 " aug-defvar name expr\n"
17710 #: ../fish/guestfish-actions.pod:180
17715 #: ../fish/guestfish-actions.pod:182
17718 " aug-get augpath\n"
17723 #: ../fish/guestfish-actions.pod:187
17728 #: ../fish/guestfish-actions.pod:189
17731 " aug-init root flags\n"
17736 #: ../fish/guestfish-actions.pod:195
17737 msgid "You must call this before using any other L</aug-*> commands."
17741 #: ../fish/guestfish-actions.pod:230
17742 msgid "Do not load the tree in L</aug-init>."
17746 #: ../fish/guestfish-actions.pod:234
17747 msgid "To close the handle, you can call L</aug-close>."
17751 #: ../fish/guestfish-actions.pod:238
17756 #: ../fish/guestfish-actions.pod:240
17759 " aug-insert augpath label true|false\n"
17764 #: ../fish/guestfish-actions.pod:250
17769 #: ../fish/guestfish-actions.pod:252
17777 #: ../fish/guestfish-actions.pod:259
17782 #: ../fish/guestfish-actions.pod:261
17785 " aug-ls augpath\n"
17790 #: ../fish/guestfish-actions.pod:263
17792 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
17793 "resulting nodes into alphabetical order."
17797 #: ../fish/guestfish-actions.pod:266
17802 #: ../fish/guestfish-actions.pod:268
17805 " aug-match augpath\n"
17810 #: ../fish/guestfish-actions.pod:274
17815 #: ../fish/guestfish-actions.pod:276
17818 " aug-mv src dest\n"
17823 #: ../fish/guestfish-actions.pod:281
17828 #: ../fish/guestfish-actions.pod:283
17831 " aug-rm augpath\n"
17836 #: ../fish/guestfish-actions.pod:289
17841 #: ../fish/guestfish-actions.pod:291
17849 #: ../fish/guestfish-actions.pod:295
17851 "The flags which were passed to L</aug-init> affect exactly how files are "
17856 #: ../fish/guestfish-actions.pod:298
17861 #: ../fish/guestfish-actions.pod:300
17864 " aug-set augpath val\n"
17869 #: ../fish/guestfish-actions.pod:304
17871 "In the Augeas API, it is possible to clear a node by setting the value to "
17872 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17873 "this call. Instead you must use the L</aug-clear> call."
17877 #: ../fish/guestfish-actions.pod:309
17882 #: ../fish/guestfish-actions.pod:311
17885 " available 'groups ...'\n"
17890 #: ../fish/guestfish-actions.pod:317
17892 "The libguestfs groups, and the functions that those groups correspond to, "
17893 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17894 "runtime by calling L</available-all-groups>."
17898 #: ../fish/guestfish-actions.pod:341
17899 msgid "You must call L</launch> before calling this function."
17903 #: ../fish/guestfish-actions.pod:363
17905 "This call was added in version C<1.0.80>. In previous versions of "
17906 "libguestfs all you could do would be to speculatively execute a command to "
17907 "find out if the daemon implemented it. See also L</version>."
17911 #: ../fish/guestfish-actions.pod:370
17912 msgid "available-all-groups"
17916 #: ../fish/guestfish-actions.pod:372
17919 " available-all-groups\n"
17924 #: ../fish/guestfish-actions.pod:374
17926 "This command returns a list of all optional groups that this daemon knows "
17927 "about. Note this returns both supported and unsupported groups. To find "
17928 "out which ones the daemon can actually support you have to call L</"
17929 "available> on each member of the returned list."
17933 #: ../fish/guestfish-actions.pod:380
17934 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
17938 #: ../fish/guestfish-actions.pod:382
17943 #: ../fish/guestfish-actions.pod:384
17946 " base64-in (base64file|-) filename\n"
17951 #: ../fish/guestfish-actions.pod:389 ../fish/guestfish-actions.pod:398
17952 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:769
17953 #: ../fish/guestfish-actions.pod:816 ../fish/guestfish-actions.pod:835
17954 #: ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:3932
17955 #: ../fish/guestfish-actions.pod:3944 ../fish/guestfish-actions.pod:3955
17956 #: ../fish/guestfish-actions.pod:3966 ../fish/guestfish-actions.pod:4018
17957 #: ../fish/guestfish-actions.pod:4027 ../fish/guestfish-actions.pod:4081
17958 #: ../fish/guestfish-actions.pod:4104
17959 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17963 #: ../fish/guestfish-actions.pod:391
17968 #: ../fish/guestfish-actions.pod:393
17971 " base64-out filename (base64file|-)\n"
17976 #: ../fish/guestfish-actions.pod:400
17977 msgid "blockdev-flushbufs"
17981 #: ../fish/guestfish-actions.pod:402
17984 " blockdev-flushbufs device\n"
17989 #: ../fish/guestfish-actions.pod:409
17990 msgid "blockdev-getbsz"
17994 #: ../fish/guestfish-actions.pod:411
17997 " blockdev-getbsz device\n"
18002 #: ../fish/guestfish-actions.pod:420
18003 msgid "blockdev-getro"
18007 #: ../fish/guestfish-actions.pod:422
18010 " blockdev-getro device\n"
18015 #: ../fish/guestfish-actions.pod:429
18016 msgid "blockdev-getsize64"
18020 #: ../fish/guestfish-actions.pod:431
18023 " blockdev-getsize64 device\n"
18028 #: ../fish/guestfish-actions.pod:435
18029 msgid "See also L</blockdev-getsz>."
18033 #: ../fish/guestfish-actions.pod:439
18034 msgid "blockdev-getss"
18038 #: ../fish/guestfish-actions.pod:441
18041 " blockdev-getss device\n"
18046 #: ../fish/guestfish-actions.pod:446
18048 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
18052 #: ../fish/guestfish-actions.pod:451
18053 msgid "blockdev-getsz"
18057 #: ../fish/guestfish-actions.pod:453
18060 " blockdev-getsz device\n"
18065 #: ../fish/guestfish-actions.pod:458
18067 "See also L</blockdev-getss> for the real sector size of the device, and L</"
18068 "blockdev-getsize64> for the more useful I<size in bytes>."
18072 #: ../fish/guestfish-actions.pod:464
18073 msgid "blockdev-rereadpt"
18077 #: ../fish/guestfish-actions.pod:466
18080 " blockdev-rereadpt device\n"
18085 #: ../fish/guestfish-actions.pod:472
18086 msgid "blockdev-setbsz"
18090 #: ../fish/guestfish-actions.pod:474
18093 " blockdev-setbsz device blocksize\n"
18098 #: ../fish/guestfish-actions.pod:483
18099 msgid "blockdev-setro"
18103 #: ../fish/guestfish-actions.pod:485
18106 " blockdev-setro device\n"
18111 #: ../fish/guestfish-actions.pod:491
18112 msgid "blockdev-setrw"
18116 #: ../fish/guestfish-actions.pod:493
18119 " blockdev-setrw device\n"
18124 #: ../fish/guestfish-actions.pod:499
18125 msgid "case-sensitive-path"
18129 #: ../fish/guestfish-actions.pod:501
18132 " case-sensitive-path path\n"
18137 #: ../fish/guestfish-actions.pod:525
18139 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
18140 "WINDOWS/system32\"> (the exact return value would depend on details of how "
18141 "the directories were originally created under Windows)."
18145 #: ../fish/guestfish-actions.pod:533
18146 msgid "See also L</realpath>."
18150 #: ../fish/guestfish-actions.pod:535
18155 #: ../fish/guestfish-actions.pod:537
18163 #: ../fish/guestfish-actions.pod:541
18165 "Note that this function cannot correctly handle binary files (specifically, "
18166 "files containing C<\\0> character which is treated as end of string). For "
18167 "those you need to use the L</read-file> or L</download> functions which have "
18168 "a more complex interface."
18172 #: ../fish/guestfish-actions.pod:549
18177 #: ../fish/guestfish-actions.pod:551
18180 " checksum csumtype path\n"
18185 #: ../fish/guestfish-actions.pod:594
18186 msgid "To get the checksum for a device, use L</checksum-device>."
18190 #: ../fish/guestfish-actions.pod:596
18191 msgid "To get the checksums for many files, use L</checksums-out>."
18195 #: ../fish/guestfish-actions.pod:598
18196 msgid "checksum-device"
18200 #: ../fish/guestfish-actions.pod:600
18203 " checksum-device csumtype device\n"
18208 #: ../fish/guestfish-actions.pod:602
18210 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
18211 "device named C<device>. For the types of checksums supported see the L</"
18212 "checksum> command."
18216 #: ../fish/guestfish-actions.pod:606
18217 msgid "checksums-out"
18221 #: ../fish/guestfish-actions.pod:608
18224 " checksums-out csumtype directory (sumsfile|-)\n"
18229 #: ../fish/guestfish-actions.pod:624
18234 #: ../fish/guestfish-actions.pod:626
18237 " chmod mode path\n"
18242 #: ../fish/guestfish-actions.pod:637
18247 #: ../fish/guestfish-actions.pod:639
18250 " chown owner group path\n"
18255 #: ../fish/guestfish-actions.pod:647
18260 #: ../fish/guestfish-actions.pod:649
18263 " command 'arguments ...'\n"
18268 #: ../fish/guestfish-actions.pod:656
18270 "The single parameter is an argv-style list of arguments. The first element "
18271 "is the name of the program to run. Subsequent elements are parameters. The "
18272 "list must be non-empty (ie. must contain a program name). Note that the "
18273 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
18277 #: ../fish/guestfish-actions.pod:684
18278 msgid "command-lines"
18282 #: ../fish/guestfish-actions.pod:686
18285 " command-lines 'arguments ...'\n"
18290 #: ../fish/guestfish-actions.pod:688
18292 "This is the same as L</command>, but splits the result into a list of lines."
18296 #: ../fish/guestfish-actions.pod:691
18297 msgid "See also: L</sh-lines>"
18301 #: ../fish/guestfish-actions.pod:696
18306 #: ../fish/guestfish-actions.pod:698
18309 " config qemuparam qemuvalue\n"
18314 #: ../fish/guestfish-actions.pod:709
18319 #: ../fish/guestfish-actions.pod:711
18322 " copy-size src dest size\n"
18327 #: ../fish/guestfish-actions.pod:719
18332 #: ../fish/guestfish-actions.pod:721
18340 #: ../fish/guestfish-actions.pod:726
18345 #: ../fish/guestfish-actions.pod:728
18353 #: ../fish/guestfish-actions.pod:733
18358 #: ../fish/guestfish-actions.pod:735
18366 #: ../fish/guestfish-actions.pod:742
18368 "If the destination is a device, it must be as large or larger than the "
18369 "source file or device, otherwise the copy will fail. This command cannot do "
18370 "partial copies (see L</copy-size>)."
18374 #: ../fish/guestfish-actions.pod:746
18379 #: ../fish/guestfish-actions.pod:748
18382 " debug subcmd 'extraargs ...'\n"
18387 #: ../fish/guestfish-actions.pod:750
18389 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
18390 "daemon) that runs inside the qemu subprocess."
18394 #: ../fish/guestfish-actions.pod:758
18395 msgid "debug-upload"
18399 #: ../fish/guestfish-actions.pod:760
18402 " debug-upload (filename|-) tmpname mode\n"
18407 #: ../fish/guestfish-actions.pod:762
18409 "The L</debug-upload> command uploads a file to the libguestfs appliance."
18413 #: ../fish/guestfish-actions.pod:771
18418 #: ../fish/guestfish-actions.pod:773
18426 #: ../fish/guestfish-actions.pod:781
18431 #: ../fish/guestfish-actions.pod:783
18439 #: ../fish/guestfish-actions.pod:792
18444 #: ../fish/guestfish-actions.pod:794
18452 #: ../fish/guestfish-actions.pod:800
18454 "Another way to get the same information is to enable verbose messages with "
18455 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
18456 "before running the program."
18460 #: ../fish/guestfish-actions.pod:805
18465 #: ../fish/guestfish-actions.pod:807
18468 " download remotefilename (filename|-)\n"
18473 #: ../fish/guestfish-actions.pod:814
18474 msgid "See also L</upload>, L</cat>."
18478 #: ../fish/guestfish-actions.pod:818
18479 msgid "download-offset"
18483 #: ../fish/guestfish-actions.pod:820
18486 " download-offset remotefilename (filename|-) offset size\n"
18491 #: ../fish/guestfish-actions.pod:828
18493 "Note that there is no limit on the amount of data that can be downloaded "
18494 "with this call, unlike with L</pread>, and this call always reads the full "
18495 "amount unless an error occurs."
18499 #: ../fish/guestfish-actions.pod:833
18500 msgid "See also L</download>, L</pread>."
18504 #: ../fish/guestfish-actions.pod:837
18505 msgid "drop-caches"
18509 #: ../fish/guestfish-actions.pod:839
18512 " drop-caches whattodrop\n"
18517 #: ../fish/guestfish-actions.pod:851
18522 #: ../fish/guestfish-actions.pod:853
18530 #: ../fish/guestfish-actions.pod:865
18535 #: ../fish/guestfish-actions.pod:867
18538 " e2fsck-f device\n"
18543 #: ../fish/guestfish-actions.pod:873
18545 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
18546 "should use L</fsck>."
18550 #: ../fish/guestfish-actions.pod:876
18551 msgid "echo-daemon"
18555 #: ../fish/guestfish-actions.pod:878
18558 " echo-daemon 'words ...'\n"
18563 #: ../fish/guestfish-actions.pod:885
18564 msgid "See also L</ping-daemon>."
18568 #: ../fish/guestfish-actions.pod:887
18573 #: ../fish/guestfish-actions.pod:889
18576 " egrep regex path\n"
18581 #: ../fish/guestfish-actions.pod:897
18586 #: ../fish/guestfish-actions.pod:899
18589 " egrepi regex path\n"
18594 #: ../fish/guestfish-actions.pod:907
18599 #: ../fish/guestfish-actions.pod:909
18602 " equal file1 file2\n"
18607 #: ../fish/guestfish-actions.pod:916
18612 #: ../fish/guestfish-actions.pod:918
18620 #: ../fish/guestfish-actions.pod:923
18621 msgid "See also L</is-file>, L</is-dir>, L</stat>."
18625 #: ../fish/guestfish-actions.pod:925
18630 #: ../fish/guestfish-actions.pod:927
18633 " fallocate path len\n"
18638 #: ../fish/guestfish-actions.pod:944
18639 msgid "fallocate64"
18643 #: ../fish/guestfish-actions.pod:946
18646 " fallocate64 path len\n"
18651 #: ../fish/guestfish-actions.pod:952
18653 "Note that this call allocates disk blocks for the file. To create a sparse "
18654 "file use L</truncate-size> instead."
18658 #: ../fish/guestfish-actions.pod:955
18660 "The deprecated call L</fallocate> does the same, but owing to an oversight "
18661 "it only allowed 30 bit lengths to be specified, effectively limiting the "
18662 "maximum size of files created through that call to 1GB."
18666 #: ../fish/guestfish-actions.pod:964
18671 #: ../fish/guestfish-actions.pod:966
18674 " fgrep pattern path\n"
18679 #: ../fish/guestfish-actions.pod:974
18684 #: ../fish/guestfish-actions.pod:976
18687 " fgrepi pattern path\n"
18692 #: ../fish/guestfish-actions.pod:984
18697 #: ../fish/guestfish-actions.pod:986
18705 #: ../fish/guestfish-actions.pod:998
18707 "This command can also be used on C</dev/> devices (and partitions, LV "
18708 "names). You can for example use this to determine if a device contains a "
18709 "filesystem, although it's usually better to use L</vfs-type>."
18713 #: ../fish/guestfish-actions.pod:1008
18714 msgid "file-architecture"
18718 #: ../fish/guestfish-actions.pod:1010
18721 " file-architecture filename\n"
18726 #: ../fish/guestfish-actions.pod:1113
18731 #: ../fish/guestfish-actions.pod:1115
18739 #: ../fish/guestfish-actions.pod:1119
18741 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
18742 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
18746 #: ../fish/guestfish-actions.pod:1123
18751 #: ../fish/guestfish-actions.pod:1125
18754 " fill c len path\n"
18759 #: ../fish/guestfish-actions.pod:1131
18761 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18762 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
18763 "L</fill-pattern>."
18767 #: ../fish/guestfish-actions.pod:1136
18768 msgid "fill-pattern"
18772 #: ../fish/guestfish-actions.pod:1138
18775 " fill-pattern pattern len path\n"
18780 #: ../fish/guestfish-actions.pod:1140
18782 "This function is like L</fill> except that it creates a new file of length "
18783 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18784 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18789 #: ../fish/guestfish-actions.pod:1145
18794 #: ../fish/guestfish-actions.pod:1147
18797 " find directory\n"
18802 #: ../fish/guestfish-actions.pod:1161
18803 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
18807 #: ../fish/guestfish-actions.pod:1174
18808 msgid "See also L</find0>."
18812 #: ../fish/guestfish-actions.pod:1179
18817 #: ../fish/guestfish-actions.pod:1181
18820 " find0 directory (files|-)\n"
18825 #: ../fish/guestfish-actions.pod:1187
18827 "This command works the same way as L</find> with the following exceptions:"
18831 #: ../fish/guestfish-actions.pod:1214
18832 msgid "findfs-label"
18836 #: ../fish/guestfish-actions.pod:1216
18839 " findfs-label label\n"
18844 #: ../fish/guestfish-actions.pod:1222
18845 msgid "To find the label of a filesystem, use L</vfs-label>."
18849 #: ../fish/guestfish-actions.pod:1224
18850 msgid "findfs-uuid"
18854 #: ../fish/guestfish-actions.pod:1226
18857 " findfs-uuid uuid\n"
18862 #: ../fish/guestfish-actions.pod:1232
18863 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
18867 #: ../fish/guestfish-actions.pod:1234
18872 #: ../fish/guestfish-actions.pod:1236
18875 " fsck fstype device\n"
18880 #: ../fish/guestfish-actions.pod:1266
18885 #: ../fish/guestfish-actions.pod:1268
18893 #: ../fish/guestfish-actions.pod:1275
18894 msgid "get-autosync"
18898 #: ../fish/guestfish-actions.pod:1277
18906 #: ../fish/guestfish-actions.pod:1281
18911 #: ../fish/guestfish-actions.pod:1283
18919 #: ../fish/guestfish-actions.pod:1287
18920 msgid "get-e2label"
18924 #: ../fish/guestfish-actions.pod:1289
18927 " get-e2label device\n"
18932 #: ../fish/guestfish-actions.pod:1301
18937 #: ../fish/guestfish-actions.pod:1303
18940 " get-e2uuid device\n"
18945 #: ../fish/guestfish-actions.pod:1315
18946 msgid "get-memsize"
18950 #: ../fish/guestfish-actions.pod:1317
18958 #: ../fish/guestfish-actions.pod:1322
18960 "If L</set-memsize> was not called on this handle, and if "
18961 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18962 "value for memsize."
18966 #: ../fish/guestfish-actions.pod:1329
18967 msgid "get-network"
18971 #: ../fish/guestfish-actions.pod:1331
18979 #: ../fish/guestfish-actions.pod:1335
18984 #: ../fish/guestfish-actions.pod:1337
18992 #: ../fish/guestfish-actions.pod:1344
18997 #: ../fish/guestfish-actions.pod:1346
19002 #: ../fish/guestfish-actions.pod:1348
19010 #: ../fish/guestfish-actions.pod:1355
19015 #: ../fish/guestfish-actions.pod:1357
19023 #: ../fish/guestfish-actions.pod:1364
19024 msgid "get-recovery-proc"
19028 #: ../fish/guestfish-actions.pod:1366
19031 " get-recovery-proc\n"
19036 #: ../fish/guestfish-actions.pod:1370
19037 msgid "get-selinux"
19041 #: ../fish/guestfish-actions.pod:1372
19049 #: ../fish/guestfish-actions.pod:1374
19051 "This returns the current setting of the selinux flag which is passed to the "
19052 "appliance at boot time. See L</set-selinux>."
19056 #: ../fish/guestfish-actions.pod:1380
19061 #: ../fish/guestfish-actions.pod:1382
19069 #: ../fish/guestfish-actions.pod:1389
19074 #: ../fish/guestfish-actions.pod:1391
19082 #: ../fish/guestfish-actions.pod:1395
19087 #: ../fish/guestfish-actions.pod:1397
19095 #: ../fish/guestfish-actions.pod:1399
19097 "Return the current umask. By default the umask is C<022> unless it has been "
19098 "set by calling L</umask>."
19102 #: ../fish/guestfish-actions.pod:1402
19103 msgid "get-verbose"
19107 #: ../fish/guestfish-actions.pod:1404
19115 #: ../fish/guestfish-actions.pod:1408
19120 #: ../fish/guestfish-actions.pod:1410
19128 #: ../fish/guestfish-actions.pod:1414
19129 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
19133 #: ../fish/guestfish-actions.pod:1417
19138 #: ../fish/guestfish-actions.pod:1419
19141 " getxattrs path\n"
19146 #: ../fish/guestfish-actions.pod:1427
19147 msgid "See also: L</lgetxattrs>, L<attr(5)>."
19151 #: ../fish/guestfish-actions.pod:1429
19152 msgid "glob-expand"
19156 #: ../fish/guestfish-actions.pod:1431
19159 " glob-expand pattern\n"
19164 #: ../fish/guestfish-actions.pod:1444
19169 #: ../fish/guestfish-actions.pod:1446
19172 " grep regex path\n"
19177 #: ../fish/guestfish-actions.pod:1454
19182 #: ../fish/guestfish-actions.pod:1456
19185 " grepi regex path\n"
19190 #: ../fish/guestfish-actions.pod:1464
19191 msgid "grub-install"
19195 #: ../fish/guestfish-actions.pod:1466
19198 " grub-install root device\n"
19203 #: ../fish/guestfish-actions.pod:1482
19208 #: ../fish/guestfish-actions.pod:1484
19216 #: ../fish/guestfish-actions.pod:1492
19221 #: ../fish/guestfish-actions.pod:1494
19224 " head-n nrlines path\n"
19229 #: ../fish/guestfish-actions.pod:1507
19234 #: ../fish/guestfish-actions.pod:1509
19242 #: ../fish/guestfish-actions.pod:1517
19247 #: ../fish/guestfish-actions.pod:1519
19250 " initrd-cat initrdpath filename\n"
19255 #: ../fish/guestfish-actions.pod:1531
19256 msgid "See also L</initrd-list>."
19260 #: ../fish/guestfish-actions.pod:1536
19261 msgid "initrd-list"
19265 #: ../fish/guestfish-actions.pod:1538
19268 " initrd-list path\n"
19273 #: ../fish/guestfish-actions.pod:1550
19274 msgid "inotify-add-watch"
19278 #: ../fish/guestfish-actions.pod:1552
19281 " inotify-add-watch path mask\n"
19286 #: ../fish/guestfish-actions.pod:1564
19287 msgid "inotify-close"
19291 #: ../fish/guestfish-actions.pod:1566
19299 #: ../fish/guestfish-actions.pod:1572
19300 msgid "inotify-files"
19304 #: ../fish/guestfish-actions.pod:1574
19312 #: ../fish/guestfish-actions.pod:1576
19314 "This function is a helpful wrapper around L</inotify-read> which just "
19315 "returns a list of pathnames of objects that were touched. The returned "
19316 "pathnames are sorted and deduplicated."
19320 #: ../fish/guestfish-actions.pod:1580
19321 msgid "inotify-init"
19325 #: ../fish/guestfish-actions.pod:1582
19328 " inotify-init maxevents\n"
19333 #: ../fish/guestfish-actions.pod:1588
19335 "C<maxevents> is the maximum number of events which will be queued up between "
19336 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
19337 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
19338 "default was 16384 events. Beyond this limit, the kernel throws away events, "
19339 "but records the fact that it threw them away by setting a flag "
19340 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
19344 #: ../fish/guestfish-actions.pod:1598
19346 "Before any events are generated, you have to add some watches to the "
19347 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
19348 "L</inotify-watch-all>."
19352 #: ../fish/guestfish-actions.pod:1604
19354 "Queued up events should be read periodically by calling L</inotify-read> (or "
19355 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
19356 "If you don't read the events out often enough then you risk the internal "
19357 "queue overflowing."
19361 #: ../fish/guestfish-actions.pod:1611
19363 "The handle should be closed after use by calling L</inotify-close>. This "
19364 "also removes any watches automatically."
19368 #: ../fish/guestfish-actions.pod:1620
19369 msgid "inotify-read"
19373 #: ../fish/guestfish-actions.pod:1622
19381 #: ../fish/guestfish-actions.pod:1635
19382 msgid "inotify-rm-watch"
19386 #: ../fish/guestfish-actions.pod:1637
19389 " inotify-rm-watch wd\n"
19394 #: ../fish/guestfish-actions.pod:1639
19395 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
19399 #: ../fish/guestfish-actions.pod:1642
19400 msgid "inspect-get-arch"
19404 #: ../fish/guestfish-actions.pod:1644
19407 " inspect-get-arch root\n"
19412 #: ../fish/guestfish-actions.pod:1646 ../fish/guestfish-actions.pod:1662
19413 #: ../fish/guestfish-actions.pod:1728 ../fish/guestfish-actions.pod:1746
19414 #: ../fish/guestfish-actions.pod:1767 ../fish/guestfish-actions.pod:1782
19415 #: ../fish/guestfish-actions.pod:1805 ../fish/guestfish-actions.pod:1822
19416 #: ../fish/guestfish-actions.pod:1853
19418 "This function should only be called with a root device string as returned by "
19423 #: ../fish/guestfish-actions.pod:1649
19425 "This returns the architecture of the inspected operating system. The "
19426 "possible return values are listed under L</file-architecture>."
19430 #: ../fish/guestfish-actions.pod:1658
19431 msgid "inspect-get-distro"
19435 #: ../fish/guestfish-actions.pod:1660
19438 " inspect-get-distro root\n"
19443 #: ../fish/guestfish-actions.pod:1724
19444 msgid "inspect-get-filesystems"
19448 #: ../fish/guestfish-actions.pod:1726
19451 " inspect-get-filesystems root\n"
19456 #: ../fish/guestfish-actions.pod:1739
19458 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19459 "get-mountpoints>."
19463 #: ../fish/guestfish-actions.pod:1742
19464 msgid "inspect-get-major-version"
19468 #: ../fish/guestfish-actions.pod:1744
19471 " inspect-get-major-version root\n"
19476 #: ../fish/guestfish-actions.pod:1763
19477 msgid "inspect-get-minor-version"
19481 #: ../fish/guestfish-actions.pod:1765
19484 " inspect-get-minor-version root\n"
19489 #: ../fish/guestfish-actions.pod:1775
19491 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19492 "get-major-version>."
19496 #: ../fish/guestfish-actions.pod:1778
19497 msgid "inspect-get-mountpoints"
19501 #: ../fish/guestfish-actions.pod:1780
19504 " inspect-get-mountpoints root\n"
19509 #: ../fish/guestfish-actions.pod:1798
19511 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19512 "get-filesystems>."
19516 #: ../fish/guestfish-actions.pod:1801
19517 msgid "inspect-get-product-name"
19521 #: ../fish/guestfish-actions.pod:1803
19524 " inspect-get-product-name root\n"
19529 #: ../fish/guestfish-actions.pod:1818
19530 msgid "inspect-get-type"
19534 #: ../fish/guestfish-actions.pod:1820
19537 " inspect-get-type root\n"
19542 #: ../fish/guestfish-actions.pod:1849
19543 msgid "inspect-get-windows-systemroot"
19547 #: ../fish/guestfish-actions.pod:1851
19550 " inspect-get-windows-systemroot root\n"
19555 #: ../fish/guestfish-actions.pod:1865
19560 #: ../fish/guestfish-actions.pod:1867
19568 #: ../fish/guestfish-actions.pod:1882
19570 "You can pass the root string(s) returned to other L</inspect-get-*> "
19571 "functions in order to query further information about each operating system, "
19572 "such as the name and version."
19576 #: ../fish/guestfish-actions.pod:1887
19578 "This function uses other libguestfs features such as L</mount-ro> and L</"
19579 "umount-all> in order to mount and unmount filesystems and look at the "
19580 "contents. This should be called with no disks currently mounted. The "
19581 "function may also use Augeas, so any existing Augeas handle will be closed."
19585 #: ../fish/guestfish-actions.pod:1899 ../fish/guestfish-actions.pod:2055
19586 #: ../fish/guestfish-actions.pod:2101
19587 msgid "See also L</list-filesystems>."
19591 #: ../fish/guestfish-actions.pod:1901
19592 msgid "is-blockdev"
19596 #: ../fish/guestfish-actions.pod:1903
19599 " is-blockdev path\n"
19604 #: ../fish/guestfish-actions.pod:1908 ../fish/guestfish-actions.pod:1926
19605 #: ../fish/guestfish-actions.pod:1945 ../fish/guestfish-actions.pod:1954
19606 #: ../fish/guestfish-actions.pod:1964 ../fish/guestfish-actions.pod:1998
19607 #: ../fish/guestfish-actions.pod:2007
19608 msgid "See also L</stat>."
19612 #: ../fish/guestfish-actions.pod:1910
19617 #: ../fish/guestfish-actions.pod:1912
19625 #: ../fish/guestfish-actions.pod:1919
19630 #: ../fish/guestfish-actions.pod:1921
19633 " is-chardev path\n"
19638 #: ../fish/guestfish-actions.pod:1928
19643 #: ../fish/guestfish-actions.pod:1930
19651 #: ../fish/guestfish-actions.pod:1937
19656 #: ../fish/guestfish-actions.pod:1939
19664 #: ../fish/guestfish-actions.pod:1947
19669 #: ../fish/guestfish-actions.pod:1949
19677 #: ../fish/guestfish-actions.pod:1956
19682 #: ../fish/guestfish-actions.pod:1958
19690 #: ../fish/guestfish-actions.pod:1966
19691 msgid "is-launching"
19695 #: ../fish/guestfish-actions.pod:1968
19703 #: ../fish/guestfish-actions.pod:1975
19708 #: ../fish/guestfish-actions.pod:1977
19716 #: ../fish/guestfish-actions.pod:1982
19721 #: ../fish/guestfish-actions.pod:1984
19729 #: ../fish/guestfish-actions.pod:1991
19734 #: ../fish/guestfish-actions.pod:1993
19737 " is-socket path\n"
19742 #: ../fish/guestfish-actions.pod:2000
19747 #: ../fish/guestfish-actions.pod:2002
19750 " is-symlink path\n"
19755 #: ../fish/guestfish-actions.pod:2009
19756 msgid "kill-subprocess"
19760 #: ../fish/guestfish-actions.pod:2011
19763 " kill-subprocess\n"
19768 #: ../fish/guestfish-actions.pod:2015
19773 #: ../fish/guestfish-actions.pod:2017
19778 #: ../fish/guestfish-actions.pod:2019
19786 #: ../fish/guestfish-actions.pod:2027
19791 #: ../fish/guestfish-actions.pod:2029
19794 " lchown owner group path\n"
19799 #: ../fish/guestfish-actions.pod:2031
19801 "Change the file owner to C<owner> and group to C<group>. This is like L</"
19802 "chown> but if C<path> is a symlink then the link itself is changed, not the "
19807 #: ../fish/guestfish-actions.pod:2039
19812 #: ../fish/guestfish-actions.pod:2041
19815 " lgetxattrs path\n"
19820 #: ../fish/guestfish-actions.pod:2043
19822 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
19823 "it returns the extended attributes of the link itself."
19827 #: ../fish/guestfish-actions.pod:2047
19828 msgid "list-devices"
19832 #: ../fish/guestfish-actions.pod:2049
19840 #: ../fish/guestfish-actions.pod:2057
19841 msgid "list-filesystems"
19845 #: ../fish/guestfish-actions.pod:2059
19848 " list-filesystems\n"
19853 #: ../fish/guestfish-actions.pod:2078
19855 "This command runs other libguestfs commands, which might include L</mount> "
19856 "and L</umount>, and therefore you should use this soon after launch and only "
19857 "when nothing is mounted."
19861 #: ../fish/guestfish-actions.pod:2082
19863 "Not all of the filesystems returned will be mountable. In particular, swap "
19864 "partitions are returned in the list. Also this command does not check that "
19865 "each filesystem found is valid and mountable, and some filesystems might be "
19866 "mountable but require special options. Filesystems may not all belong to a "
19867 "single logical operating system (use L</inspect-os> to look for OSes)."
19871 #: ../fish/guestfish-actions.pod:2090
19872 msgid "list-partitions"
19876 #: ../fish/guestfish-actions.pod:2092
19879 " list-partitions\n"
19884 #: ../fish/guestfish-actions.pod:2098
19886 "This does not return logical volumes. For that you will need to call L</"
19891 #: ../fish/guestfish-actions.pod:2103
19896 #: ../fish/guestfish-actions.pod:2105
19904 #: ../fish/guestfish-actions.pod:2113
19909 #: ../fish/guestfish-actions.pod:2115
19912 " ln target linkname\n"
19917 #: ../fish/guestfish-actions.pod:2119
19922 #: ../fish/guestfish-actions.pod:2121
19925 " ln-f target linkname\n"
19930 #: ../fish/guestfish-actions.pod:2126
19935 #: ../fish/guestfish-actions.pod:2128
19938 " ln-s target linkname\n"
19943 #: ../fish/guestfish-actions.pod:2132
19948 #: ../fish/guestfish-actions.pod:2134
19951 " ln-sf target linkname\n"
19956 #: ../fish/guestfish-actions.pod:2139
19957 msgid "lremovexattr"
19961 #: ../fish/guestfish-actions.pod:2141
19964 " lremovexattr xattr path\n"
19969 #: ../fish/guestfish-actions.pod:2143
19971 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
19972 "it removes an extended attribute of the link itself."
19976 #: ../fish/guestfish-actions.pod:2147
19981 #: ../fish/guestfish-actions.pod:2149
19989 #: ../fish/guestfish-actions.pod:2155
19991 "This command is mostly useful for interactive sessions. Programs should "
19992 "probably use L</readdir> instead."
19996 #: ../fish/guestfish-actions.pod:2158
20001 #: ../fish/guestfish-actions.pod:2160
20004 " lsetxattr xattr val vallen path\n"
20009 #: ../fish/guestfish-actions.pod:2162
20011 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
20012 "sets an extended attribute of the link itself."
20016 #: ../fish/guestfish-actions.pod:2166
20021 #: ../fish/guestfish-actions.pod:2168
20029 #: ../fish/guestfish-actions.pod:2172
20031 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
20032 "the link is stat-ed, not the file it refers to."
20036 #: ../fish/guestfish-actions.pod:2178
20041 #: ../fish/guestfish-actions.pod:2180
20044 " lstatlist path 'names ...'\n"
20049 #: ../fish/guestfish-actions.pod:2182
20051 "This call allows you to perform the L</lstat> operation on multiple files, "
20052 "where all files are in the directory C<path>. C<names> is the list of files "
20053 "from this directory."
20057 #: ../fish/guestfish-actions.pod:2191
20059 "This call is intended for programs that want to efficiently list a directory "
20060 "contents without making many round-trips. See also L</lxattrlist> for a "
20061 "similarly efficient call for getting extended attributes. Very long "
20062 "directory listings might cause the protocol message size to be exceeded, "
20063 "causing this call to fail. The caller must split up such requests into "
20064 "smaller groups of names."
20068 #: ../fish/guestfish-actions.pod:2199
20069 msgid "luks-add-key"
20073 #: ../fish/guestfish-actions.pod:2201
20076 " luks-add-key device keyslot\n"
20081 #: ../fish/guestfish-actions.pod:2208
20083 "Note that if C<keyslot> already contains a key, then this command will "
20084 "fail. You have to use L</luks-kill-slot> first to remove that key."
20088 #: ../fish/guestfish-actions.pod:2212 ../fish/guestfish-actions.pod:2234
20089 #: ../fish/guestfish-actions.pod:2247 ../fish/guestfish-actions.pod:2261
20090 #: ../fish/guestfish-actions.pod:2284 ../fish/guestfish-actions.pod:2294
20092 "This command has one or more key or passphrase parameters. Guestfish will "
20093 "prompt for these separately."
20097 #: ../fish/guestfish-actions.pod:2215
20102 #: ../fish/guestfish-actions.pod:2217
20105 " luks-close device\n"
20110 #: ../fish/guestfish-actions.pod:2219
20112 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
20113 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
20114 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
20119 #: ../fish/guestfish-actions.pod:2225
20120 msgid "luks-format"
20124 #: ../fish/guestfish-actions.pod:2227
20127 " luks-format device keyslot\n"
20132 #: ../fish/guestfish-actions.pod:2240
20133 msgid "luks-format-cipher"
20137 #: ../fish/guestfish-actions.pod:2242
20140 " luks-format-cipher device keyslot cipher\n"
20145 #: ../fish/guestfish-actions.pod:2244
20147 "This command is the same as L</luks-format> but it also allows you to set "
20148 "the C<cipher> used."
20152 #: ../fish/guestfish-actions.pod:2253
20153 msgid "luks-kill-slot"
20157 #: ../fish/guestfish-actions.pod:2255
20160 " luks-kill-slot device keyslot\n"
20165 #: ../fish/guestfish-actions.pod:2264
20170 #: ../fish/guestfish-actions.pod:2266
20173 " luks-open device mapname\n"
20178 #: ../fish/guestfish-actions.pod:2280
20180 "If this block device contains LVM volume groups, then calling L</vgscan> "
20181 "followed by L</vg-activate-all> will make them visible."
20185 #: ../fish/guestfish-actions.pod:2287
20186 msgid "luks-open-ro"
20190 #: ../fish/guestfish-actions.pod:2289
20193 " luks-open-ro device mapname\n"
20198 #: ../fish/guestfish-actions.pod:2291
20200 "This is the same as L</luks-open> except that a read-only mapping is created."
20204 #: ../fish/guestfish-actions.pod:2297
20209 #: ../fish/guestfish-actions.pod:2299
20212 " lvcreate logvol volgroup mbytes\n"
20217 #: ../fish/guestfish-actions.pod:2304
20218 msgid "lvm-canonical-lv-name"
20222 #: ../fish/guestfish-actions.pod:2306
20225 " lvm-canonical-lv-name lvname\n"
20230 #: ../fish/guestfish-actions.pod:2315
20231 msgid "See also L</is-lv>."
20235 #: ../fish/guestfish-actions.pod:2317
20236 msgid "lvm-clear-filter"
20240 #: ../fish/guestfish-actions.pod:2319
20243 " lvm-clear-filter\n"
20248 #: ../fish/guestfish-actions.pod:2321
20250 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
20255 #: ../fish/guestfish-actions.pod:2327
20256 msgid "lvm-remove-all"
20260 #: ../fish/guestfish-actions.pod:2329
20263 " lvm-remove-all\n"
20268 #: ../fish/guestfish-actions.pod:2337
20269 msgid "lvm-set-filter"
20273 #: ../fish/guestfish-actions.pod:2339
20276 " lvm-set-filter 'devices ...'\n"
20281 #: ../fish/guestfish-actions.pod:2364
20286 #: ../fish/guestfish-actions.pod:2366
20289 " lvremove device\n"
20294 #: ../fish/guestfish-actions.pod:2374
20299 #: ../fish/guestfish-actions.pod:2376
20302 " lvrename logvol newlogvol\n"
20307 #: ../fish/guestfish-actions.pod:2380
20312 #: ../fish/guestfish-actions.pod:2382
20315 " lvresize device mbytes\n"
20320 #: ../fish/guestfish-actions.pod:2388
20321 msgid "lvresize-free"
20325 #: ../fish/guestfish-actions.pod:2390
20328 " lvresize-free lv percent\n"
20333 #: ../fish/guestfish-actions.pod:2398
20338 #: ../fish/guestfish-actions.pod:2400
20346 #: ../fish/guestfish-actions.pod:2408
20347 msgid "See also L</lvs-full>, L</list-filesystems>."
20351 #: ../fish/guestfish-actions.pod:2410
20356 #: ../fish/guestfish-actions.pod:2412
20364 #: ../fish/guestfish-actions.pod:2417
20369 #: ../fish/guestfish-actions.pod:2419
20377 #: ../fish/guestfish-actions.pod:2423
20382 #: ../fish/guestfish-actions.pod:2425
20385 " lxattrlist path 'names ...'\n"
20390 #: ../fish/guestfish-actions.pod:2441
20392 "This call is intended for programs that want to efficiently list a directory "
20393 "contents without making many round-trips. See also L</lstatlist> for a "
20394 "similarly efficient call for getting standard stats. Very long directory "
20395 "listings might cause the protocol message size to be exceeded, causing this "
20396 "call to fail. The caller must split up such requests into smaller groups of "
20401 #: ../fish/guestfish-actions.pod:2449
20406 #: ../fish/guestfish-actions.pod:2451
20414 #: ../fish/guestfish-actions.pod:2455
20419 #: ../fish/guestfish-actions.pod:2457
20422 " mkdir-mode path mode\n"
20427 #: ../fish/guestfish-actions.pod:2466
20428 msgid "See also L</mkdir>, L</umask>"
20432 #: ../fish/guestfish-actions.pod:2468
20437 #: ../fish/guestfish-actions.pod:2470
20445 #: ../fish/guestfish-actions.pod:2475
20450 #: ../fish/guestfish-actions.pod:2477
20453 " mkdtemp template\n"
20458 #: ../fish/guestfish-actions.pod:2498
20463 #: ../fish/guestfish-actions.pod:2500
20466 " mke2fs-J fstype blocksize device journal\n"
20471 #: ../fish/guestfish-actions.pod:2508
20472 msgid "See also L</mke2journal>."
20476 #: ../fish/guestfish-actions.pod:2510
20481 #: ../fish/guestfish-actions.pod:2512
20484 " mke2fs-JL fstype blocksize device label\n"
20489 #: ../fish/guestfish-actions.pod:2517
20490 msgid "See also L</mke2journal-L>."
20494 #: ../fish/guestfish-actions.pod:2519
20499 #: ../fish/guestfish-actions.pod:2521
20502 " mke2fs-JU fstype blocksize device uuid\n"
20507 #: ../fish/guestfish-actions.pod:2526
20508 msgid "See also L</mke2journal-U>."
20512 #: ../fish/guestfish-actions.pod:2528
20513 msgid "mke2journal"
20517 #: ../fish/guestfish-actions.pod:2530
20520 " mke2journal blocksize device\n"
20525 #: ../fish/guestfish-actions.pod:2537
20526 msgid "mke2journal-L"
20530 #: ../fish/guestfish-actions.pod:2539
20533 " mke2journal-L blocksize label device\n"
20538 #: ../fish/guestfish-actions.pod:2543
20539 msgid "mke2journal-U"
20543 #: ../fish/guestfish-actions.pod:2545
20546 " mke2journal-U blocksize uuid device\n"
20551 #: ../fish/guestfish-actions.pod:2549
20556 #: ../fish/guestfish-actions.pod:2551
20559 " mkfifo mode path\n"
20564 #: ../fish/guestfish-actions.pod:2553
20566 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
20567 "is just a convenient wrapper around L</mknod>."
20571 #: ../fish/guestfish-actions.pod:2559
20576 #: ../fish/guestfish-actions.pod:2561
20579 " mkfs fstype device\n"
20584 #: ../fish/guestfish-actions.pod:2567
20589 #: ../fish/guestfish-actions.pod:2569
20592 " mkfs-b fstype blocksize device\n"
20597 #: ../fish/guestfish-actions.pod:2571
20599 "This call is similar to L</mkfs>, but it allows you to control the block "
20600 "size of the resulting filesystem. Supported block sizes depend on the "
20601 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
20605 #: ../fish/guestfish-actions.pod:2579
20606 msgid "mkmountpoint"
20610 #: ../fish/guestfish-actions.pod:2581
20613 " mkmountpoint exemptpath\n"
20618 #: ../fish/guestfish-actions.pod:2583
20620 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
20621 "to create extra mountpoints before mounting the first filesystem."
20625 #: ../fish/guestfish-actions.pod:2607
20627 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
20628 "unexpected errors if you try to mix these calls. It is safest to manually "
20629 "unmount filesystems and remove mountpoints after use."
20633 #: ../fish/guestfish-actions.pod:2611
20635 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
20636 "for this to work for manual mountpoints, you must ensure that the innermost "
20637 "mountpoints have the longest pathnames, as in the example code above."
20641 #: ../fish/guestfish-actions.pod:2618
20643 "Autosync [see L</set-autosync>, this is set by default on handles] means "
20644 "that L</umount-all> is called when the handle is closed which can also "
20645 "trigger these issues."
20649 #: ../fish/guestfish-actions.pod:2622
20654 #: ../fish/guestfish-actions.pod:2624
20657 " mknod mode devmajor devminor path\n"
20662 #: ../fish/guestfish-actions.pod:2634
20664 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
20665 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
20666 "regular file). These constants are available in the standard Linux header "
20667 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
20668 "wrappers around this command which bitwise OR in the appropriate constant "
20673 #: ../fish/guestfish-actions.pod:2644
20678 #: ../fish/guestfish-actions.pod:2646
20681 " mknod-b mode devmajor devminor path\n"
20686 #: ../fish/guestfish-actions.pod:2648
20688 "This call creates a block device node called C<path> with mode C<mode> and "
20689 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20690 "wrapper around L</mknod>."
20694 #: ../fish/guestfish-actions.pod:2654
20699 #: ../fish/guestfish-actions.pod:2656
20702 " mknod-c mode devmajor devminor path\n"
20707 #: ../fish/guestfish-actions.pod:2658
20709 "This call creates a char device node called C<path> with mode C<mode> and "
20710 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20711 "wrapper around L</mknod>."
20715 #: ../fish/guestfish-actions.pod:2664
20720 #: ../fish/guestfish-actions.pod:2666
20728 #: ../fish/guestfish-actions.pod:2670
20733 #: ../fish/guestfish-actions.pod:2672
20736 " mkswap-L label device\n"
20741 #: ../fish/guestfish-actions.pod:2680
20746 #: ../fish/guestfish-actions.pod:2682
20749 " mkswap-U uuid device\n"
20754 #: ../fish/guestfish-actions.pod:2686
20755 msgid "mkswap-file"
20759 #: ../fish/guestfish-actions.pod:2688
20762 " mkswap-file path\n"
20767 #: ../fish/guestfish-actions.pod:2692
20769 "This command just writes a swap file signature to an existing file. To "
20770 "create the file itself, use something like L</fallocate>."
20774 #: ../fish/guestfish-actions.pod:2695
20779 #: ../fish/guestfish-actions.pod:2697
20782 " modprobe modulename\n"
20787 #: ../fish/guestfish-actions.pod:2704
20792 #: ../fish/guestfish-actions.pod:2706
20795 " mount device mountpoint\n"
20800 #: ../fish/guestfish-actions.pod:2722
20802 "B<Important note:> When you use this call, the filesystem options C<sync> "
20803 "and C<noatime> are set implicitly. This was originally done because we "
20804 "thought it would improve reliability, but it turns out that I<-o sync> has a "
20805 "very large negative performance impact and negligible effect on "
20806 "reliability. Therefore we recommend that you avoid using L</mount> in any "
20807 "code that needs performance, and instead use L</mount-options> (use an empty "
20808 "string for the first parameter if you don't want any options)."
20812 #: ../fish/guestfish-actions.pod:2732
20817 #: ../fish/guestfish-actions.pod:2734
20820 " mount-loop file mountpoint\n"
20825 #: ../fish/guestfish-actions.pod:2740
20826 msgid "mount-options"
20830 #: ../fish/guestfish-actions.pod:2742
20833 " mount-options options device mountpoint\n"
20838 #: ../fish/guestfish-actions.pod:2744
20840 "This is the same as the L</mount> command, but it allows you to set the "
20841 "mount options as for the L<mount(8)> I<-o> flag."
20845 #: ../fish/guestfish-actions.pod:2752
20850 #: ../fish/guestfish-actions.pod:2754
20853 " mount-ro device mountpoint\n"
20858 #: ../fish/guestfish-actions.pod:2756
20860 "This is the same as the L</mount> command, but it mounts the filesystem with "
20861 "the read-only (I<-o ro>) flag."
20865 #: ../fish/guestfish-actions.pod:2759
20870 #: ../fish/guestfish-actions.pod:2761
20873 " mount-vfs options vfstype device mountpoint\n"
20878 #: ../fish/guestfish-actions.pod:2763
20880 "This is the same as the L</mount> command, but it allows you to set both the "
20881 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20885 #: ../fish/guestfish-actions.pod:2767
20886 msgid "mountpoints"
20890 #: ../fish/guestfish-actions.pod:2769
20898 #: ../fish/guestfish-actions.pod:2771
20900 "This call is similar to L</mounts>. That call returns a list of devices. "
20901 "This one returns a hash table (map) of device name to directory where the "
20902 "device is mounted."
20906 #: ../fish/guestfish-actions.pod:2775
20911 #: ../fish/guestfish-actions.pod:2777
20919 #: ../fish/guestfish-actions.pod:2784
20920 msgid "See also: L</mountpoints>"
20924 #: ../fish/guestfish-actions.pod:2786
20929 #: ../fish/guestfish-actions.pod:2788
20937 #: ../fish/guestfish-actions.pod:2793
20938 msgid "ntfs-3g-probe"
20942 #: ../fish/guestfish-actions.pod:2795
20945 " ntfs-3g-probe true|false device\n"
20950 #: ../fish/guestfish-actions.pod:2809
20955 #: ../fish/guestfish-actions.pod:2811
20958 " ntfsresize device\n"
20963 #: ../fish/guestfish-actions.pod:2817
20964 msgid "ntfsresize-size"
20968 #: ../fish/guestfish-actions.pod:2819
20971 " ntfsresize-size device size\n"
20976 #: ../fish/guestfish-actions.pod:2821
20978 "This command is the same as L</ntfsresize> except that it allows you to "
20979 "specify the new size (in bytes) explicitly."
20983 #: ../fish/guestfish-actions.pod:2824
20988 #: ../fish/guestfish-actions.pod:2826
20991 " part-add device prlogex startsect endsect\n"
20996 #: ../fish/guestfish-actions.pod:2828
20998 "This command adds a partition to C<device>. If there is no partition table "
20999 "on the device, call L</part-init> first."
21003 #: ../fish/guestfish-actions.pod:2840
21005 "Creating a partition which covers the whole disk is not so easy. Use L</"
21006 "part-disk> to do that."
21010 #: ../fish/guestfish-actions.pod:2843
21015 #: ../fish/guestfish-actions.pod:2845
21018 " part-del device partnum\n"
21023 #: ../fish/guestfish-actions.pod:2853
21028 #: ../fish/guestfish-actions.pod:2855
21031 " part-disk device parttype\n"
21036 #: ../fish/guestfish-actions.pod:2857
21038 "This command is simply a combination of L</part-init> followed by L</part-"
21039 "add> to create a single primary partition covering the whole disk."
21043 #: ../fish/guestfish-actions.pod:2861
21045 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
21046 "possible values are described in L</part-init>."
21050 #: ../fish/guestfish-actions.pod:2867
21051 msgid "part-get-bootable"
21055 #: ../fish/guestfish-actions.pod:2869
21058 " part-get-bootable device partnum\n"
21063 #: ../fish/guestfish-actions.pod:2874
21064 msgid "See also L</part-set-bootable>."
21068 #: ../fish/guestfish-actions.pod:2876
21069 msgid "part-get-mbr-id"
21073 #: ../fish/guestfish-actions.pod:2878
21076 " part-get-mbr-id device partnum\n"
21081 #: ../fish/guestfish-actions.pod:2883 ../fish/guestfish-actions.pod:3021
21083 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
21084 "undefined results for other partition table types (see L</part-get-"
21089 #: ../fish/guestfish-actions.pod:2887
21090 msgid "part-get-parttype"
21094 #: ../fish/guestfish-actions.pod:2889
21097 " part-get-parttype device\n"
21102 #: ../fish/guestfish-actions.pod:2894
21104 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
21105 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
21106 "possible, although unusual. See L</part-init> for a full list."
21110 #: ../fish/guestfish-actions.pod:2899
21115 #: ../fish/guestfish-actions.pod:2901
21118 " part-init device parttype\n"
21123 #: ../fish/guestfish-actions.pod:2907
21125 "Initially there are no partitions. Following this, you should call L</part-"
21126 "add> for each partition required."
21130 #: ../fish/guestfish-actions.pod:2970
21135 #: ../fish/guestfish-actions.pod:2972
21138 " part-list device\n"
21143 #: ../fish/guestfish-actions.pod:2987
21145 "Start of the partition I<in bytes>. To get sectors you have to divide by "
21146 "the device's sector size, see L</blockdev-getss>."
21150 #: ../fish/guestfish-actions.pod:3000
21151 msgid "part-set-bootable"
21155 #: ../fish/guestfish-actions.pod:3002
21158 " part-set-bootable device partnum true|false\n"
21163 #: ../fish/guestfish-actions.pod:3011
21164 msgid "part-set-mbr-id"
21168 #: ../fish/guestfish-actions.pod:3013
21171 " part-set-mbr-id device partnum idbyte\n"
21176 #: ../fish/guestfish-actions.pod:3025
21177 msgid "part-set-name"
21181 #: ../fish/guestfish-actions.pod:3027
21184 " part-set-name device partnum name\n"
21189 #: ../fish/guestfish-actions.pod:3035
21190 msgid "part-to-dev"
21194 #: ../fish/guestfish-actions.pod:3037
21197 " part-to-dev partition\n"
21202 #: ../fish/guestfish-actions.pod:3043
21204 "The named partition must exist, for example as a string returned from L</"
21205 "list-partitions>."
21209 #: ../fish/guestfish-actions.pod:3046
21210 msgid "ping-daemon"
21214 #: ../fish/guestfish-actions.pod:3048
21222 #: ../fish/guestfish-actions.pod:3055
21227 #: ../fish/guestfish-actions.pod:3057
21230 " pread path count offset\n"
21235 #: ../fish/guestfish-actions.pod:3065
21236 msgid "See also L</pwrite>, L</pread-device>."
21240 #: ../fish/guestfish-actions.pod:3070
21241 msgid "pread-device"
21245 #: ../fish/guestfish-actions.pod:3072
21248 " pread-device device count offset\n"
21253 #: ../fish/guestfish-actions.pod:3080
21254 msgid "See also L</pread>."
21258 #: ../fish/guestfish-actions.pod:3085
21263 #: ../fish/guestfish-actions.pod:3087
21266 " pvcreate device\n"
21271 #: ../fish/guestfish-actions.pod:3093
21276 #: ../fish/guestfish-actions.pod:3095
21279 " pvremove device\n"
21284 #: ../fish/guestfish-actions.pod:3104
21289 #: ../fish/guestfish-actions.pod:3106
21292 " pvresize device\n"
21297 #: ../fish/guestfish-actions.pod:3111
21298 msgid "pvresize-size"
21302 #: ../fish/guestfish-actions.pod:3113
21305 " pvresize-size device size\n"
21310 #: ../fish/guestfish-actions.pod:3115
21312 "This command is the same as L</pvresize> except that it allows you to "
21313 "specify the new size (in bytes) explicitly."
21317 #: ../fish/guestfish-actions.pod:3118
21322 #: ../fish/guestfish-actions.pod:3120
21330 #: ../fish/guestfish-actions.pod:3128
21331 msgid "See also L</pvs-full>."
21335 #: ../fish/guestfish-actions.pod:3130
21340 #: ../fish/guestfish-actions.pod:3132
21348 #: ../fish/guestfish-actions.pod:3137
21353 #: ../fish/guestfish-actions.pod:3139
21361 #: ../fish/guestfish-actions.pod:3143
21366 #: ../fish/guestfish-actions.pod:3145
21369 " pwrite path content offset\n"
21374 #: ../fish/guestfish-actions.pod:3156
21375 msgid "See also L</pread>, L</pwrite-device>."
21379 #: ../fish/guestfish-actions.pod:3161
21380 msgid "pwrite-device"
21384 #: ../fish/guestfish-actions.pod:3163
21387 " pwrite-device device content offset\n"
21392 #: ../fish/guestfish-actions.pod:3173
21393 msgid "See also L</pwrite>."
21397 #: ../fish/guestfish-actions.pod:3178
21402 #: ../fish/guestfish-actions.pod:3180
21405 " read-file path\n"
21410 #: ../fish/guestfish-actions.pod:3185
21412 "Unlike L</cat>, this function can correctly handle files that contain "
21413 "embedded ASCII NUL characters. However unlike L</download>, this function "
21414 "is limited in the total size of file that can be handled."
21418 #: ../fish/guestfish-actions.pod:3193
21423 #: ../fish/guestfish-actions.pod:3195
21426 " read-lines path\n"
21431 #: ../fish/guestfish-actions.pod:3202
21433 "Note that this function cannot correctly handle binary files (specifically, "
21434 "files containing C<\\0> character which is treated as end of line). For "
21435 "those you need to use the L</read-file> function which has a more complex "
21440 #: ../fish/guestfish-actions.pod:3207
21445 #: ../fish/guestfish-actions.pod:3209
21453 #: ../fish/guestfish-actions.pod:3261
21455 "This function is primarily intended for use by programs. To get a simple "
21456 "list of names, use L</ls>. To get a printable directory for human "
21457 "consumption, use L</ll>."
21461 #: ../fish/guestfish-actions.pod:3265
21466 #: ../fish/guestfish-actions.pod:3267
21474 #: ../fish/guestfish-actions.pod:3271
21475 msgid "readlinklist"
21479 #: ../fish/guestfish-actions.pod:3273
21482 " readlinklist path 'names ...'\n"
21487 #: ../fish/guestfish-actions.pod:3297
21492 #: ../fish/guestfish-actions.pod:3299
21500 #: ../fish/guestfish-actions.pod:3304
21501 msgid "removexattr"
21505 #: ../fish/guestfish-actions.pod:3306
21508 " removexattr xattr path\n"
21513 #: ../fish/guestfish-actions.pod:3311
21514 msgid "See also: L</lremovexattr>, L<attr(5)>."
21518 #: ../fish/guestfish-actions.pod:3313
21523 #: ../fish/guestfish-actions.pod:3315
21526 " resize2fs device\n"
21531 #: ../fish/guestfish-actions.pod:3320
21533 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
21534 "before calling this command. For unknown reasons C<resize2fs> sometimes "
21535 "gives an error about this and sometimes not. In any case, it is always safe "
21536 "to call L</e2fsck-f> before calling this function."
21540 #: ../fish/guestfish-actions.pod:3326
21541 msgid "resize2fs-size"
21545 #: ../fish/guestfish-actions.pod:3328
21548 " resize2fs-size device size\n"
21553 #: ../fish/guestfish-actions.pod:3330
21555 "This command is the same as L</resize2fs> except that it allows you to "
21556 "specify the new size (in bytes) explicitly."
21560 #: ../fish/guestfish-actions.pod:3333
21565 #: ../fish/guestfish-actions.pod:3335
21573 #: ../fish/guestfish-actions.pod:3339
21578 #: ../fish/guestfish-actions.pod:3341
21586 #: ../fish/guestfish-actions.pod:3347
21591 #: ../fish/guestfish-actions.pod:3349
21599 #: ../fish/guestfish-actions.pod:3353
21600 msgid "rmmountpoint"
21604 #: ../fish/guestfish-actions.pod:3355
21607 " rmmountpoint exemptpath\n"
21612 #: ../fish/guestfish-actions.pod:3357
21614 "This calls removes a mountpoint that was previously created with L</"
21615 "mkmountpoint>. See L</mkmountpoint> for full details."
21619 #: ../fish/guestfish-actions.pod:3361
21620 msgid "scrub-device"
21624 #: ../fish/guestfish-actions.pod:3363
21627 " scrub-device device\n"
21632 #: ../fish/guestfish-actions.pod:3374
21637 #: ../fish/guestfish-actions.pod:3376
21640 " scrub-file file\n"
21645 #: ../fish/guestfish-actions.pod:3386
21646 msgid "scrub-freespace"
21650 #: ../fish/guestfish-actions.pod:3388
21653 " scrub-freespace dir\n"
21658 #: ../fish/guestfish-actions.pod:3390
21660 "This command creates the directory C<dir> and then fills it with files until "
21661 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
21662 "deletes them. The intention is to scrub any free space on the partition "
21663 "containing C<dir>."
21667 #: ../fish/guestfish-actions.pod:3399
21672 #: ../fish/guestfish-actions.pod:3401
21677 #: ../fish/guestfish-actions.pod:3403
21680 " set-append append\n"
21685 #: ../fish/guestfish-actions.pod:3414
21686 msgid "set-autosync"
21690 #: ../fish/guestfish-actions.pod:3416
21695 #: ../fish/guestfish-actions.pod:3418
21698 " set-autosync true|false\n"
21703 #: ../fish/guestfish-actions.pod:3420
21705 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
21706 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
21707 "closed (also if the program exits without closing handles)."
21711 #: ../fish/guestfish-actions.pod:3428
21716 #: ../fish/guestfish-actions.pod:3430
21721 #: ../fish/guestfish-actions.pod:3432
21724 " set-direct true|false\n"
21729 #: ../fish/guestfish-actions.pod:3438
21731 "One consequence of this is that log messages aren't caught by the library "
21732 "and handled by L</set-log-message-callback>, but go straight to stdout."
21736 #: ../fish/guestfish-actions.pod:3447
21737 msgid "set-e2label"
21741 #: ../fish/guestfish-actions.pod:3449
21744 " set-e2label device label\n"
21749 #: ../fish/guestfish-actions.pod:3455
21751 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
21752 "label on a filesystem."
21756 #: ../fish/guestfish-actions.pod:3458
21761 #: ../fish/guestfish-actions.pod:3460
21764 " set-e2uuid device uuid\n"
21769 #: ../fish/guestfish-actions.pod:3467
21771 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
21772 "UUID of a filesystem."
21776 #: ../fish/guestfish-actions.pod:3470
21777 msgid "set-memsize"
21781 #: ../fish/guestfish-actions.pod:3472
21786 #: ../fish/guestfish-actions.pod:3474
21789 " set-memsize memsize\n"
21794 #: ../fish/guestfish-actions.pod:3476
21796 "This sets the memory size in megabytes allocated to the qemu subprocess. "
21797 "This only has any effect if called before L</launch>."
21801 #: ../fish/guestfish-actions.pod:3487
21802 msgid "set-network"
21806 #: ../fish/guestfish-actions.pod:3489
21811 #: ../fish/guestfish-actions.pod:3491
21814 " set-network true|false\n"
21819 #: ../fish/guestfish-actions.pod:3499
21821 "You must call this before calling L</launch>, otherwise it has no effect."
21825 #: ../fish/guestfish-actions.pod:3502
21830 #: ../fish/guestfish-actions.pod:3504
21835 #: ../fish/guestfish-actions.pod:3506
21838 " set-path searchpath\n"
21843 #: ../fish/guestfish-actions.pod:3515
21848 #: ../fish/guestfish-actions.pod:3517
21853 #: ../fish/guestfish-actions.pod:3519
21861 #: ../fish/guestfish-actions.pod:3539
21862 msgid "set-recovery-proc"
21866 #: ../fish/guestfish-actions.pod:3541
21867 msgid "recovery-proc"
21871 #: ../fish/guestfish-actions.pod:3543
21874 " set-recovery-proc true|false\n"
21879 #: ../fish/guestfish-actions.pod:3545
21881 "If this is called with the parameter C<false> then L</launch> does not "
21882 "create a recovery process. The purpose of the recovery process is to stop "
21883 "runaway qemu processes in the case where the main program aborts abruptly."
21887 #: ../fish/guestfish-actions.pod:3550
21889 "This only has any effect if called before L</launch>, and the default is "
21894 #: ../fish/guestfish-actions.pod:3559
21895 msgid "set-selinux"
21899 #: ../fish/guestfish-actions.pod:3561
21904 #: ../fish/guestfish-actions.pod:3563
21907 " set-selinux true|false\n"
21912 #: ../fish/guestfish-actions.pod:3574
21917 #: ../fish/guestfish-actions.pod:3576
21922 #: ../fish/guestfish-actions.pod:3578
21925 " set-trace true|false\n"
21930 #: ../fish/guestfish-actions.pod:3594
21931 msgid "set-verbose"
21935 #: ../fish/guestfish-actions.pod:3596
21940 #: ../fish/guestfish-actions.pod:3598
21943 " set-verbose true|false\n"
21948 #: ../fish/guestfish-actions.pod:3605
21953 #: ../fish/guestfish-actions.pod:3607
21956 " setcon context\n"
21961 #: ../fish/guestfish-actions.pod:3614
21966 #: ../fish/guestfish-actions.pod:3616
21969 " setxattr xattr val vallen path\n"
21974 #: ../fish/guestfish-actions.pod:3622
21975 msgid "See also: L</lsetxattr>, L<attr(5)>."
21979 #: ../fish/guestfish-actions.pod:3624
21984 #: ../fish/guestfish-actions.pod:3626
21987 " sfdisk device cyls heads sectors 'lines ...'\n"
21992 #: ../fish/guestfish-actions.pod:3648
21993 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
21997 #: ../fish/guestfish-actions.pod:3654
22002 #: ../fish/guestfish-actions.pod:3656
22005 " sfdiskM device 'lines ...'\n"
22010 #: ../fish/guestfish-actions.pod:3658
22012 "This is a simplified interface to the L</sfdisk> command, where partition "
22013 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
22014 "you don't need to specify the cyls, heads and sectors parameters which were "
22015 "rarely if ever used anyway."
22019 #: ../fish/guestfish-actions.pod:3664
22020 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
22024 #: ../fish/guestfish-actions.pod:3670
22029 #: ../fish/guestfish-actions.pod:3672
22032 " sfdisk-N device partnum cyls heads sectors line\n"
22037 #: ../fish/guestfish-actions.pod:3677
22039 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
22040 "cyls/heads/sectors parameters."
22044 #: ../fish/guestfish-actions.pod:3680
22045 msgid "See also: L</part-add>"
22049 #: ../fish/guestfish-actions.pod:3685
22050 msgid "sfdisk-disk-geometry"
22054 #: ../fish/guestfish-actions.pod:3687
22057 " sfdisk-disk-geometry device\n"
22062 #: ../fish/guestfish-actions.pod:3689
22064 "This displays the disk geometry of C<device> read from the partition table. "
22065 "Especially in the case where the underlying block device has been resized, "
22066 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
22067 "kernel-geometry>)."
22071 #: ../fish/guestfish-actions.pod:3697
22072 msgid "sfdisk-kernel-geometry"
22076 #: ../fish/guestfish-actions.pod:3699
22079 " sfdisk-kernel-geometry device\n"
22084 #: ../fish/guestfish-actions.pod:3706
22089 #: ../fish/guestfish-actions.pod:3708
22092 " sfdisk-l device\n"
22097 #: ../fish/guestfish-actions.pod:3714
22098 msgid "See also: L</part-list>"
22102 #: ../fish/guestfish-actions.pod:3716
22107 #: ../fish/guestfish-actions.pod:3718
22115 #: ../fish/guestfish-actions.pod:3723
22116 msgid "This is like L</command>, but passes the command to:"
22120 #: ../fish/guestfish-actions.pod:3731
22121 msgid "All the provisos about L</command> apply to this call."
22125 #: ../fish/guestfish-actions.pod:3733
22130 #: ../fish/guestfish-actions.pod:3735
22133 " sh-lines command\n"
22138 #: ../fish/guestfish-actions.pod:3737
22139 msgid "This is the same as L</sh>, but splits the result into a list of lines."
22143 #: ../fish/guestfish-actions.pod:3740
22144 msgid "See also: L</command-lines>"
22148 #: ../fish/guestfish-actions.pod:3742
22153 #: ../fish/guestfish-actions.pod:3744
22161 #: ../fish/guestfish-actions.pod:3748
22166 #: ../fish/guestfish-actions.pod:3750
22174 #: ../fish/guestfish-actions.pod:3756
22179 #: ../fish/guestfish-actions.pod:3758
22187 #: ../fish/guestfish-actions.pod:3766
22192 #: ../fish/guestfish-actions.pod:3768
22200 #: ../fish/guestfish-actions.pod:3776
22205 #: ../fish/guestfish-actions.pod:3778
22208 " strings-e encoding path\n"
22213 #: ../fish/guestfish-actions.pod:3780
22215 "This is like the L</strings> command, but allows you to specify the encoding "
22216 "of strings that are looked for in the source file C<path>."
22220 #: ../fish/guestfish-actions.pod:3790
22222 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
22223 "ISO-8859-X (this is what L</strings> uses)."
22227 #: ../fish/guestfish-actions.pod:3822
22228 msgid "swapoff-device"
22232 #: ../fish/guestfish-actions.pod:3824
22235 " swapoff-device device\n"
22240 #: ../fish/guestfish-actions.pod:3826
22242 "This command disables the libguestfs appliance swap device or partition "
22243 "named C<device>. See L</swapon-device>."
22247 #: ../fish/guestfish-actions.pod:3830
22248 msgid "swapoff-file"
22252 #: ../fish/guestfish-actions.pod:3832
22255 " swapoff-file file\n"
22260 #: ../fish/guestfish-actions.pod:3836
22261 msgid "swapoff-label"
22265 #: ../fish/guestfish-actions.pod:3838
22268 " swapoff-label label\n"
22273 #: ../fish/guestfish-actions.pod:3843
22274 msgid "swapoff-uuid"
22278 #: ../fish/guestfish-actions.pod:3845
22281 " swapoff-uuid uuid\n"
22286 #: ../fish/guestfish-actions.pod:3850
22287 msgid "swapon-device"
22291 #: ../fish/guestfish-actions.pod:3852
22294 " swapon-device device\n"
22299 #: ../fish/guestfish-actions.pod:3854
22301 "This command enables the libguestfs appliance to use the swap device or "
22302 "partition named C<device>. The increased memory is made available for all "
22303 "commands, for example those run using L</command> or L</sh>."
22307 #: ../fish/guestfish-actions.pod:3866
22308 msgid "swapon-file"
22312 #: ../fish/guestfish-actions.pod:3868
22315 " swapon-file file\n"
22320 #: ../fish/guestfish-actions.pod:3870
22322 "This command enables swap to a file. See L</swapon-device> for other notes."
22326 #: ../fish/guestfish-actions.pod:3873
22327 msgid "swapon-label"
22331 #: ../fish/guestfish-actions.pod:3875
22334 " swapon-label label\n"
22339 #: ../fish/guestfish-actions.pod:3877
22341 "This command enables swap to a labeled swap partition. See L</swapon-"
22342 "device> for other notes."
22346 #: ../fish/guestfish-actions.pod:3880
22347 msgid "swapon-uuid"
22351 #: ../fish/guestfish-actions.pod:3882
22354 " swapon-uuid uuid\n"
22359 #: ../fish/guestfish-actions.pod:3884
22361 "This command enables swap to a swap partition with the given UUID. See L</"
22362 "swapon-device> for other notes."
22366 #: ../fish/guestfish-actions.pod:3887
22371 #: ../fish/guestfish-actions.pod:3889
22379 #: ../fish/guestfish-actions.pod:3897
22384 #: ../fish/guestfish-actions.pod:3899
22392 #: ../fish/guestfish-actions.pod:3907
22397 #: ../fish/guestfish-actions.pod:3909
22400 " tail-n nrlines path\n"
22405 #: ../fish/guestfish-actions.pod:3922
22410 #: ../fish/guestfish-actions.pod:3924
22413 " tar-in (tarfile|-) directory\n"
22418 #: ../fish/guestfish-actions.pod:3929
22419 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
22423 #: ../fish/guestfish-actions.pod:3934
22428 #: ../fish/guestfish-actions.pod:3936
22431 " tar-out directory (tarfile|-)\n"
22436 #: ../fish/guestfish-actions.pod:3941
22437 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
22441 #: ../fish/guestfish-actions.pod:3946
22446 #: ../fish/guestfish-actions.pod:3948
22449 " tgz-in (tarball|-) directory\n"
22454 #: ../fish/guestfish-actions.pod:3953
22455 msgid "To upload an uncompressed tarball, use L</tar-in>."
22459 #: ../fish/guestfish-actions.pod:3957
22464 #: ../fish/guestfish-actions.pod:3959
22467 " tgz-out directory (tarball|-)\n"
22472 #: ../fish/guestfish-actions.pod:3964
22473 msgid "To download an uncompressed tarball, use L</tar-out>."
22477 #: ../fish/guestfish-actions.pod:3968
22482 #: ../fish/guestfish-actions.pod:3970
22490 #: ../fish/guestfish-actions.pod:3979
22495 #: ../fish/guestfish-actions.pod:3981
22503 #: ../fish/guestfish-actions.pod:3986
22504 msgid "truncate-size"
22508 #: ../fish/guestfish-actions.pod:3988
22511 " truncate-size path size\n"
22516 #: ../fish/guestfish-actions.pod:3993
22518 "If the current file size is less than C<size> then the file is extended to "
22519 "the required size with zero bytes. This creates a sparse file (ie. disk "
22520 "blocks are not allocated for the file until you write to it). To create a "
22521 "non-sparse file of zeroes, use L</fallocate64> instead."
22525 #: ../fish/guestfish-actions.pod:3999
22530 #: ../fish/guestfish-actions.pod:4001
22533 " tune2fs-l device\n"
22538 #: ../fish/guestfish-actions.pod:4011
22543 #: ../fish/guestfish-actions.pod:4013
22546 " txz-in (tarball|-) directory\n"
22551 #: ../fish/guestfish-actions.pod:4020
22556 #: ../fish/guestfish-actions.pod:4022
22559 " txz-out directory (tarball|-)\n"
22564 #: ../fish/guestfish-actions.pod:4029
22569 #: ../fish/guestfish-actions.pod:4031
22577 #: ../fish/guestfish-actions.pod:4045
22578 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
22582 #: ../fish/guestfish-actions.pod:4050
22587 #: ../fish/guestfish-actions.pod:4052
22592 #: ../fish/guestfish-actions.pod:4054
22595 " umount pathordevice\n"
22600 #: ../fish/guestfish-actions.pod:4060
22605 #: ../fish/guestfish-actions.pod:4062
22606 msgid "unmount-all"
22610 #: ../fish/guestfish-actions.pod:4064
22618 #: ../fish/guestfish-actions.pod:4070
22623 #: ../fish/guestfish-actions.pod:4072
22626 " upload (filename|-) remotefilename\n"
22631 #: ../fish/guestfish-actions.pod:4079
22632 msgid "See also L</download>."
22636 #: ../fish/guestfish-actions.pod:4083
22637 msgid "upload-offset"
22641 #: ../fish/guestfish-actions.pod:4085
22644 " upload-offset (filename|-) remotefilename offset\n"
22649 #: ../fish/guestfish-actions.pod:4097
22651 "Note that there is no limit on the amount of data that can be uploaded with "
22652 "this call, unlike with L</pwrite>, and this call always writes the full "
22653 "amount unless an error occurs."
22657 #: ../fish/guestfish-actions.pod:4102
22658 msgid "See also L</upload>, L</pwrite>."
22662 #: ../fish/guestfish-actions.pod:4106
22667 #: ../fish/guestfish-actions.pod:4108
22670 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
22675 #: ../fish/guestfish-actions.pod:4127
22680 #: ../fish/guestfish-actions.pod:4129
22688 #: ../fish/guestfish-actions.pod:4156
22690 "I<Note:> Don't use this call to test for availability of features. In "
22691 "enterprise distributions we backport features from later versions into "
22692 "earlier versions, making this an unreliable way to test for features. Use "
22693 "L</available> instead."
22697 #: ../fish/guestfish-actions.pod:4162
22702 #: ../fish/guestfish-actions.pod:4164
22705 " vfs-label device\n"
22710 #: ../fish/guestfish-actions.pod:4171
22711 msgid "To find a filesystem from the label, use L</findfs-label>."
22715 #: ../fish/guestfish-actions.pod:4173
22720 #: ../fish/guestfish-actions.pod:4175
22723 " vfs-type device\n"
22728 #: ../fish/guestfish-actions.pod:4185
22733 #: ../fish/guestfish-actions.pod:4187
22736 " vfs-uuid device\n"
22741 #: ../fish/guestfish-actions.pod:4194
22742 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
22746 #: ../fish/guestfish-actions.pod:4196
22747 msgid "vg-activate"
22751 #: ../fish/guestfish-actions.pod:4198
22754 " vg-activate true|false 'volgroups ...'\n"
22759 #: ../fish/guestfish-actions.pod:4211
22760 msgid "vg-activate-all"
22764 #: ../fish/guestfish-actions.pod:4213
22767 " vg-activate-all true|false\n"
22772 #: ../fish/guestfish-actions.pod:4223
22777 #: ../fish/guestfish-actions.pod:4225
22780 " vgcreate volgroup 'physvols ...'\n"
22785 #: ../fish/guestfish-actions.pod:4230
22790 #: ../fish/guestfish-actions.pod:4232
22793 " vglvuuids vgname\n"
22798 #: ../fish/guestfish-actions.pod:4237
22800 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
22801 "logical volumes and volume groups."
22805 #: ../fish/guestfish-actions.pod:4240
22806 msgid "See also L</vgpvuuids>."
22810 #: ../fish/guestfish-actions.pod:4242
22815 #: ../fish/guestfish-actions.pod:4244
22818 " vgpvuuids vgname\n"
22823 #: ../fish/guestfish-actions.pod:4249
22825 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
22826 "physical volumes and volume groups."
22830 #: ../fish/guestfish-actions.pod:4252
22831 msgid "See also L</vglvuuids>."
22835 #: ../fish/guestfish-actions.pod:4254
22840 #: ../fish/guestfish-actions.pod:4256
22843 " vgremove vgname\n"
22848 #: ../fish/guestfish-actions.pod:4263
22853 #: ../fish/guestfish-actions.pod:4265
22856 " vgrename volgroup newvolgroup\n"
22861 #: ../fish/guestfish-actions.pod:4269
22866 #: ../fish/guestfish-actions.pod:4271
22874 #: ../fish/guestfish-actions.pod:4279
22875 msgid "See also L</vgs-full>."
22879 #: ../fish/guestfish-actions.pod:4281
22884 #: ../fish/guestfish-actions.pod:4283
22892 #: ../fish/guestfish-actions.pod:4288
22897 #: ../fish/guestfish-actions.pod:4290
22905 #: ../fish/guestfish-actions.pod:4295
22910 #: ../fish/guestfish-actions.pod:4297
22918 #: ../fish/guestfish-actions.pod:4301
22923 #: ../fish/guestfish-actions.pod:4303
22931 #: ../fish/guestfish-actions.pod:4308
22936 #: ../fish/guestfish-actions.pod:4310
22944 #: ../fish/guestfish-actions.pod:4315
22949 #: ../fish/guestfish-actions.pod:4317
22957 #: ../fish/guestfish-actions.pod:4322
22962 #: ../fish/guestfish-actions.pod:4324
22965 " write path content\n"
22970 #: ../fish/guestfish-actions.pod:4332
22975 #: ../fish/guestfish-actions.pod:4334
22978 " write-file path content size\n"
22983 #: ../fish/guestfish-actions.pod:4357
22988 #: ../fish/guestfish-actions.pod:4359
22991 " zegrep regex path\n"
22996 #: ../fish/guestfish-actions.pod:4367
23001 #: ../fish/guestfish-actions.pod:4369
23004 " zegrepi regex path\n"
23009 #: ../fish/guestfish-actions.pod:4377
23014 #: ../fish/guestfish-actions.pod:4379
23022 #: ../fish/guestfish-actions.pod:4387
23023 msgid "See also: L</zero-device>, L</scrub-device>."
23027 #: ../fish/guestfish-actions.pod:4389
23028 msgid "zero-device"
23032 #: ../fish/guestfish-actions.pod:4391
23035 " zero-device device\n"
23040 #: ../fish/guestfish-actions.pod:4393
23042 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
23043 "which just zeroes the first few blocks of a device."
23047 #: ../fish/guestfish-actions.pod:4400
23052 #: ../fish/guestfish-actions.pod:4402
23055 " zerofree device\n"
23060 #: ../fish/guestfish-actions.pod:4415
23065 #: ../fish/guestfish-actions.pod:4417
23068 " zfgrep pattern path\n"
23073 #: ../fish/guestfish-actions.pod:4425
23078 #: ../fish/guestfish-actions.pod:4427
23081 " zfgrepi pattern path\n"
23086 #: ../fish/guestfish-actions.pod:4435
23091 #: ../fish/guestfish-actions.pod:4437
23094 " zfile meth path\n"
23099 #: ../fish/guestfish-actions.pod:4444
23101 "Since 1.0.63, use L</file> instead which can now process compressed files."
23105 #: ../fish/guestfish-actions.pod:4454
23110 #: ../fish/guestfish-actions.pod:4456
23113 " zgrep regex path\n"
23118 #: ../fish/guestfish-actions.pod:4464
23123 #: ../fish/guestfish-actions.pod:4466
23126 " zgrepi regex path\n"
23131 #: ../fish/guestfish-commands.pod:1
23136 #: ../fish/guestfish-commands.pod:3
23141 #: ../fish/guestfish-commands.pod:5
23144 " alloc filename size\n"
23149 #: ../fish/guestfish-commands.pod:7
23151 "This creates an empty (zeroed) file of the given size, and then adds so it "
23152 "can be further examined."
23156 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
23157 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
23161 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
23162 msgid "Size can be specified using standard suffixes, eg. C<1M>."
23166 #: ../fish/guestfish-commands.pod:14
23168 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
23169 "image, see L</PREPARED DISK IMAGES>."
23173 #: ../fish/guestfish-commands.pod:17
23178 #: ../fish/guestfish-commands.pod:19
23181 " copy-in local [local ...] /remotedir\n"
23186 #: ../fish/guestfish-commands.pod:21
23188 "C<copy-in> copies local files or directories recursively into the disk "
23189 "image, placing them in the directory called C</remotedir> (which must "
23190 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
23191 "other commands as necessary."
23195 #: ../fish/guestfish-commands.pod:26
23197 "Multiple local files and directories can be specified, but the last "
23198 "parameter must always be a remote directory. Wildcards cannot be used."
23202 #: ../fish/guestfish-commands.pod:30
23207 #: ../fish/guestfish-commands.pod:32
23210 " copy-out remote [remote ...] localdir\n"
23215 #: ../fish/guestfish-commands.pod:34
23217 "C<copy-out> copies remote files or directories recursively out of the disk "
23218 "image, placing them on the host disk in a local directory called C<localdir> "
23219 "(which must exist). This guestfish meta-command turns into a sequence of L</"
23220 "download>, L</tar-out> and other commands as necessary."
23224 #: ../fish/guestfish-commands.pod:40
23226 "Multiple remote files and directories can be specified, but the last "
23227 "parameter must always be a local directory. To download to the current "
23228 "directory, use C<.> as in:"
23232 #: ../fish/guestfish-commands.pod:44
23235 " copy-out /home .\n"
23240 #: ../fish/guestfish-commands.pod:46
23242 "Wildcards cannot be used in the ordinary command, but you can use them with "
23243 "the help of L</glob> like this:"
23247 #: ../fish/guestfish-commands.pod:49
23250 " glob copy-out /home/* .\n"
23255 #: ../fish/guestfish-commands.pod:51
23260 #: ../fish/guestfish-commands.pod:53
23263 " echo [params ...]\n"
23268 #: ../fish/guestfish-commands.pod:55
23269 msgid "This echos the parameters to the terminal."
23273 #: ../fish/guestfish-commands.pod:57
23278 #: ../fish/guestfish-commands.pod:59
23283 #: ../fish/guestfish-commands.pod:61
23288 #: ../fish/guestfish-commands.pod:63
23296 #: ../fish/guestfish-commands.pod:65
23298 "This is used to edit a file. It downloads the file, edits it locally using "
23299 "your editor, then uploads the result."
23303 #: ../fish/guestfish-commands.pod:68
23305 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
23306 "or C<emacs> you will get those corresponding editors."
23310 #: ../fish/guestfish-commands.pod:72
23315 #: ../fish/guestfish-commands.pod:74
23318 " glob command args...\n"
23323 #: ../fish/guestfish-commands.pod:76
23325 "Expand wildcards in any paths in the args list, and run C<command> "
23326 "repeatedly on each matching path."
23330 #: ../fish/guestfish-commands.pod:79
23331 msgid "See L</WILDCARDS AND GLOBBING>."
23335 #: ../fish/guestfish-commands.pod:81
23340 #: ../fish/guestfish-commands.pod:83
23343 " hexedit <filename|device>\n"
23344 " hexedit <filename|device> <max>\n"
23345 " hexedit <filename|device> <start> <max>\n"
23350 #: ../fish/guestfish-commands.pod:87
23352 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
23357 #: ../fish/guestfish-commands.pod:90
23359 "This command works by downloading potentially the whole file or device, "
23360 "editing it locally, then uploading it. If the file or device is large, you "
23361 "have to specify which part you wish to edit by using C<max> and/or C<start> "
23362 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
23363 "usual modifiers allowed such as C<1M> (1 megabyte)."
23367 #: ../fish/guestfish-commands.pod:97
23368 msgid "For example to edit the first few sectors of a disk you might do:"
23372 #: ../fish/guestfish-commands.pod:100
23375 " hexedit /dev/sda 1M\n"
23380 #: ../fish/guestfish-commands.pod:102
23382 "which would allow you to edit anywhere within the first megabyte of the disk."
23386 #: ../fish/guestfish-commands.pod:105
23387 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
23391 #: ../fish/guestfish-commands.pod:107
23394 " hexedit /dev/sda1 0x400 0x400\n"
23399 #: ../fish/guestfish-commands.pod:109
23400 msgid "(assuming the superblock is in the standard location)."
23404 #: ../fish/guestfish-commands.pod:111
23406 "This command requires the external L<hexedit(1)> program. You can specify "
23407 "another program to use by setting the C<HEXEDITOR> environment variable."
23411 #: ../fish/guestfish-commands.pod:115
23412 msgid "See also L</hexdump>."
23416 #: ../fish/guestfish-commands.pod:117
23421 #: ../fish/guestfish-commands.pod:119
23429 #: ../fish/guestfish-commands.pod:121
23431 "Change the local directory, ie. the current directory of guestfish itself."
23435 #: ../fish/guestfish-commands.pod:124
23436 msgid "Note that C<!cd> won't do what you might expect."
23440 #: ../fish/guestfish-commands.pod:126
23445 #: ../fish/guestfish-commands.pod:128
23450 #: ../fish/guestfish-commands.pod:130
23458 #: ../fish/guestfish-commands.pod:132
23459 msgid "Opens the manual page for guestfish."
23463 #: ../fish/guestfish-commands.pod:134
23468 #: ../fish/guestfish-commands.pod:136
23473 #: ../fish/guestfish-commands.pod:138
23481 #: ../fish/guestfish-commands.pod:140
23489 #: ../fish/guestfish-commands.pod:142
23490 msgid "This is used to view a file."
23494 #: ../fish/guestfish-commands.pod:144
23496 "The default viewer is C<$PAGER>. However if you use the alternate command "
23497 "C<less> you will get the C<less> command specifically."
23501 #: ../fish/guestfish-commands.pod:147
23506 #: ../fish/guestfish-commands.pod:149
23514 #: ../fish/guestfish-commands.pod:151
23516 "Close and reopen the libguestfs handle. It is not necessary to use this "
23517 "normally, because the handle is closed properly when guestfish exits. "
23518 "However this is occasionally useful for testing."
23522 #: ../fish/guestfish-commands.pod:155
23527 #: ../fish/guestfish-commands.pod:157
23530 " sparse filename size\n"
23535 #: ../fish/guestfish-commands.pod:159
23537 "This creates an empty sparse file of the given size, and then adds so it can "
23538 "be further examined."
23542 #: ../fish/guestfish-commands.pod:162
23544 "In all respects it works the same as the L</alloc> command, except that the "
23545 "image file is allocated sparsely, which means that disk blocks are not "
23546 "assigned to the file until they are needed. Sparse disk files only use "
23547 "space when written to, but they are slower and there is a danger you could "
23548 "run out of real disk space during a write operation."
23552 #: ../fish/guestfish-commands.pod:172
23557 #: ../fish/guestfish-commands.pod:174
23565 #: ../fish/guestfish-commands.pod:176
23567 "This command returns a list of the optional groups known to the daemon, and "
23568 "indicates which ones are supported by this build of the libguestfs appliance."
23572 #: ../fish/guestfish-commands.pod:180
23573 msgid "See also L<guestfs(3)/AVAILABILITY>."
23577 #: ../fish/guestfish-commands.pod:182
23582 #: ../fish/guestfish-commands.pod:184
23585 " time command args...\n"
23590 #: ../fish/guestfish-commands.pod:186
23592 "Run the command as usual, but print the elapsed time afterwards. This can "
23593 "be useful for benchmarking operations."
23597 #: ../test-tool/libguestfs-test-tool.pod:5
23598 msgid "libguestfs-test-tool - End user tests for libguestfs"
23602 #: ../test-tool/libguestfs-test-tool.pod:9
23605 " libguestfs-test-tool [--options]\n"
23610 #: ../test-tool/libguestfs-test-tool.pod:13
23612 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
23613 "and developers, to allow them to check basic libguestfs functionality is "
23614 "working. This is needed because libguestfs occasionally breaks for reasons "
23615 "beyond our control: usually because of changes in the underlying qemu or "
23616 "kernel packages, or the host environment."
23620 #: ../test-tool/libguestfs-test-tool.pod:20
23621 msgid "If you suspect a problem in libguestfs, then just run:"
23625 #: ../test-tool/libguestfs-test-tool.pod:22
23628 " libguestfs-test-tool\n"
23633 #: ../test-tool/libguestfs-test-tool.pod:24
23634 msgid "It will print lots of diagnostic messages."
23638 #: ../test-tool/libguestfs-test-tool.pod:26
23639 msgid "If it runs to completion successfully, you will see this near the end:"
23643 #: ../test-tool/libguestfs-test-tool.pod:28
23646 " ===== TEST FINISHED OK =====\n"
23651 #: ../test-tool/libguestfs-test-tool.pod:30
23652 msgid "and the test tool will exit with code 0."
23656 #: ../test-tool/libguestfs-test-tool.pod:32
23658 "If it fails (and/or exits with non-zero error code), please paste the "
23659 "B<complete, unedited> output of the test tool into a bug report. More "
23660 "information about reporting bugs can be found on the L<http://libguestfs.org/"
23665 #: ../test-tool/libguestfs-test-tool.pod:41
23670 #: ../test-tool/libguestfs-test-tool.pod:43
23671 msgid "Display short usage information and exit."
23675 #: ../test-tool/libguestfs-test-tool.pod:45
23676 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
23680 #: ../test-tool/libguestfs-test-tool.pod:47
23682 "Pass an alternate name for the helper program. libguestfs-test-tool will "
23683 "normally look in the C<$libexec> directory that was configured when the tool "
23688 #: ../test-tool/libguestfs-test-tool.pod:51
23689 msgid "I<--qemu qemu_binary>"
23693 #: ../test-tool/libguestfs-test-tool.pod:53
23695 "If you have downloaded another qemu binary, point this option at the full "
23696 "path of the binary to try it."
23700 #: ../test-tool/libguestfs-test-tool.pod:56
23701 msgid "I<--qemudir qemu_source_dir>"
23705 #: ../test-tool/libguestfs-test-tool.pod:58
23707 "If you have compiled qemu from source, point this option at the source "
23708 "directory to try it."
23712 #: ../test-tool/libguestfs-test-tool.pod:61
23713 msgid "I<--timeout N>"
23717 #: ../test-tool/libguestfs-test-tool.pod:63
23719 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
23720 "does not usually need to be adjusted unless your machine is very slow."
23724 #: ../test-tool/libguestfs-test-tool.pod:69
23725 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
23729 #: ../test-tool/libguestfs-test-tool.pod:71
23731 "If you have compiled another version of qemu from source and would like to "
23732 "try that, then you can use the I<--qemudir> option to point to the qemu "
23733 "source directory."
23737 #: ../test-tool/libguestfs-test-tool.pod:75
23739 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
23740 "option to point to the binary."
23744 #: ../test-tool/libguestfs-test-tool.pod:78
23746 "When using an alternate qemu with libguestfs, usually you would need to "
23747 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
23748 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
23749 "use either of the I<--qemudir> or I<--qemu> options."
23753 #: ../test-tool/libguestfs-test-tool.pod:85
23755 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
23756 "I<1> if there was an error."
23760 #: ../test-tool/libguestfs-test-tool.pod:92
23761 msgid "/usr/libexec/libguestfs-test-tool-helper"
23765 #: ../test-tool/libguestfs-test-tool.pod:94
23767 "This helper program is run inside the appliance and provides additional "
23772 #: ../test-tool/libguestfs-test-tool.pod:97
23773 msgid "/usr/bin/mkisofs"
23777 #: ../test-tool/libguestfs-test-tool.pod:99
23779 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
23780 "which is used as part of the tests."
23784 #: ../test-tool/libguestfs-test-tool.pod:106
23786 "For the full list of environment variables which may affect libguestfs, "
23787 "please see the L<guestfs(3)> manual page."
23791 #: ../test-tool/libguestfs-test-tool.pod:111
23792 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
23796 #: ../test-tool/libguestfs-test-tool.pod:121
23797 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
23801 #: ../fuse/guestmount.pod:5
23803 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
23807 #: ../fuse/guestmount.pod:9
23810 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
23815 #: ../fuse/guestmount.pod:11
23818 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
23823 #: ../fuse/guestmount.pod:13
23826 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
23831 #: ../fuse/guestmount.pod:17
23833 "You must I<not> use C<guestmount> in read-write mode on live virtual "
23834 "machines. If you do this, you risk disk corruption in the VM."
23838 #: ../fuse/guestmount.pod:22
23840 "The guestmount program can be used to mount virtual machine filesystems and "
23841 "other disk images on the host. It uses libguestfs for access to the guest "
23842 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
23843 "a mountable device."
23847 #: ../fuse/guestmount.pod:27
23849 "Along with other options, you have to give at least one device (I<-a> "
23850 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
23851 "option) or use the I<-i> inspection option. How this works is better "
23852 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
23857 #: ../fuse/guestmount.pod:33
23859 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
23860 "by you, and the filesystem will not be visible to any other users unless you "
23861 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
23862 "the filesystem, use the C<fusermount -u> command."
23866 #: ../fuse/guestmount.pod:41
23868 "For a typical Windows guest which has its main filesystem on the first "
23873 #: ../fuse/guestmount.pod:44
23876 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
23881 #: ../fuse/guestmount.pod:46
23883 "For a typical Linux guest which has a /boot filesystem on the first "
23884 "partition, and the root filesystem on a logical volume:"
23888 #: ../fuse/guestmount.pod:49
23891 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
23896 #: ../fuse/guestmount.pod:51
23897 msgid "To get libguestfs to detect guest mountpoints for you:"
23901 #: ../fuse/guestmount.pod:53
23904 " guestmount -a guest.img -i --ro /mnt\n"
23909 #: ../fuse/guestmount.pod:55
23910 msgid "For a libvirt guest called \"Guest\" you could do:"
23914 #: ../fuse/guestmount.pod:57
23917 " guestmount -d Guest -i --ro /mnt\n"
23922 #: ../fuse/guestmount.pod:59
23924 "If you don't know what filesystems are contained in a guest or disk image, "
23925 "use L<virt-list-filesystems(1)> first:"
23929 #: ../fuse/guestmount.pod:62
23932 " virt-list-filesystems MyGuest\n"
23937 #: ../fuse/guestmount.pod:64
23939 "If you want to trace the libguestfs calls but without excessive debugging "
23940 "information, we recommend:"
23944 #: ../fuse/guestmount.pod:67
23947 " guestmount [...] --trace /mnt\n"
23952 #: ../fuse/guestmount.pod:69
23953 msgid "If you want to debug the program, we recommend:"
23957 #: ../fuse/guestmount.pod:71
23960 " guestmount [...] --trace --verbose /mnt\n"
23965 #: ../fuse/guestmount.pod:79
23966 msgid "Add a block device or virtual machine image."
23970 #: ../fuse/guestmount.pod:96
23971 msgid "B<--dir-cache-timeout N>"
23975 #: ../fuse/guestmount.pod:98
23977 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
23978 "seconds. The readdir cache [actually, there are several semi-independent "
23979 "caches] is populated after a readdir(2) call with the stat and extended "
23980 "attributes of the files in the directory, in anticipation that they will be "
23981 "requested soon after."
23985 #: ../fuse/guestmount.pod:104
23987 "There is also a different attribute cache implemented by FUSE (see the FUSE "
23988 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
23989 "requests, only cache existing ones."
23993 #: ../fuse/guestmount.pod:115
23995 "If you have untrusted raw-format guest disk images, you should use this "
23996 "option to specify the disk format. This avoids a possible security problem "
23997 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
23998 "guestfs_add_drive_opts>."
24002 #: ../fuse/guestmount.pod:120
24003 msgid "B<--fuse-help>"
24007 #: ../fuse/guestmount.pod:122
24008 msgid "Display help on special FUSE options (see I<-o> below)."
24012 #: ../fuse/guestmount.pod:126
24013 msgid "Display brief help and exit."
24017 #: ../fuse/guestmount.pod:134
24018 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
24022 #: ../fuse/guestmount.pod:136
24024 "Mount the named partition or logical volume on the given mountpoint B<in the "
24025 "guest> (this has nothing to do with mountpoints in the host)."
24029 #: ../fuse/guestmount.pod:139
24031 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
24032 "something on C</>."
24036 #: ../fuse/guestmount.pod:144
24038 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
24039 "unmounted. If you specify this option, then we don't attempt to sync the "
24040 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
24044 #: ../fuse/guestmount.pod:149
24045 msgid "B<-o option> | B<--option option>"
24049 #: ../fuse/guestmount.pod:151
24050 msgid "Pass extra options to FUSE."
24054 #: ../fuse/guestmount.pod:153
24056 "To get a list of all the extra options supported by FUSE, use the command "
24057 "below. Note that only the FUSE I<-o> options can be passed, and only some "
24058 "of them are a good idea."
24062 #: ../fuse/guestmount.pod:157
24065 " guestmount --fuse-help\n"
24070 #: ../fuse/guestmount.pod:159
24071 msgid "Some potentially useful FUSE options:"
24075 #: ../fuse/guestmount.pod:163
24076 msgid "B<-o allow_other>"
24080 #: ../fuse/guestmount.pod:165
24081 msgid "Allow other users to see the filesystem."
24085 #: ../fuse/guestmount.pod:167
24086 msgid "B<-o attr_timeout=N>"
24090 #: ../fuse/guestmount.pod:169
24091 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
24095 #: ../fuse/guestmount.pod:171
24096 msgid "B<-o kernel_cache>"
24100 #: ../fuse/guestmount.pod:173
24102 "Allow the kernel to cache files (reduces the number of reads that have to go "
24103 "through the L<guestfs(3)> API). This is generally a good idea if you can "
24104 "afford the extra memory usage."
24108 #: ../fuse/guestmount.pod:177
24109 msgid "B<-o uid=N> B<-o gid=N>"
24113 #: ../fuse/guestmount.pod:179
24115 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
24116 "the chosen values."
24120 #: ../fuse/guestmount.pod:186
24122 "Add devices and mount everything read-only. Also disallow writes and make "
24123 "the disk appear read-only to FUSE."
24127 #: ../fuse/guestmount.pod:189
24129 "This is highly recommended if you are not going to edit the guest disk. If "
24130 "the guest is running and this option is I<not> supplied, then there is a "
24131 "strong risk of disk corruption in the guest. We try to prevent this from "
24132 "happening, but it is not always possible."
24136 #: ../fuse/guestmount.pod:196
24137 msgid "Enable SELinux support for the guest."
24141 #: ../fuse/guestmount.pod:200
24142 msgid "Enable verbose messages from underlying libguestfs."
24146 #: ../fuse/guestmount.pod:204
24147 msgid "Display the program version and exit."
24151 #: ../fuse/guestmount.pod:206
24152 msgid "B<-x> | B<--trace>"
24156 #: ../fuse/guestmount.pod:208
24157 msgid "Trace libguestfs calls."
24161 #: ../fuse/guestmount.pod:210
24162 msgid "This also stops the daemon from forking into the background."
24166 #: ../fuse/guestmount.pod:216
24168 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
24169 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
24174 #: ../inspector/virt-inspector.pl:35
24176 "virt-inspector - Display operating system version and other information "
24177 "about a virtual machine"
24181 #: ../inspector/virt-inspector.pl:39
24184 " virt-inspector [--connect URI] domname\n"
24189 #: ../inspector/virt-inspector.pl:41
24192 " virt-inspector guest.img [guest.img ...]\n"
24197 #: ../inspector/virt-inspector.pl:45
24199 "B<virt-inspector> examines a virtual machine or disk image and tries to "
24200 "determine the version of the operating system and other information about "
24201 "the virtual machine."
24205 #: ../inspector/virt-inspector.pl:49
24206 msgid "Virt-inspector produces XML output for feeding into other programs."
24210 #: ../inspector/virt-inspector.pl:51
24212 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
24213 "libvirt domain (see: C<virsh list --all>)."
24217 #: ../inspector/virt-inspector.pl:54
24219 "You can also run virt-inspector directly on disk images from a single "
24220 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
24221 "has several block devices, in which case you should list them one after "
24222 "another, with the first corresponding to the guest's C</dev/sda>, the second "
24223 "to the guest's C</dev/sdb> and so on."
24227 #: ../inspector/virt-inspector.pl:60
24229 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
24230 "inspect several virtual machines, you have to run virt-inspector several "
24231 "times (for example, from a shell script for-loop)."
24235 #: ../inspector/virt-inspector.pl:65
24237 "Because virt-inspector needs direct access to guest images, it won't "
24238 "normally work over remote libvirt connections."
24242 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82
24243 #: ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88
24244 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-cat.pl:89
24245 #: ../tools/virt-tar.pl:108 ../tools/virt-rescue.pl:113
24246 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:61
24247 msgid "Display brief help."
24251 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88
24252 #: ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94
24253 #: ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66
24254 #: ../tools/virt-cat.pl:95 ../tools/virt-tar.pl:114
24255 #: ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169
24256 #: ../tools/virt-list-partitions.pl:67
24257 msgid "B<--version>"
24261 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90
24262 #: ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96
24263 #: ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68
24264 #: ../tools/virt-cat.pl:97 ../tools/virt-tar.pl:116
24265 #: ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171
24266 #: ../tools/virt-list-partitions.pl:69
24267 msgid "Display version number and exit."
24271 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112
24272 #: ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102
24273 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-cat.pl:103
24274 #: ../tools/virt-tar.pl:122 ../tools/virt-rescue.pl:135
24275 #: ../tools/virt-list-partitions.pl:75
24276 msgid "B<--connect URI> | B<-c URI>"
24280 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114
24281 #: ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104
24282 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-cat.pl:105
24283 #: ../tools/virt-tar.pl:124 ../tools/virt-rescue.pl:137
24284 #: ../tools/virt-list-partitions.pl:77
24286 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
24287 "to the default libvirt hypervisor."
24291 #: ../inspector/virt-inspector.pl:97
24293 "Libvirt is only used if you specify a C<domname> on the command line. If "
24294 "you specify guest block devices directly, then libvirt is not used at all."
24298 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124
24299 #: ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117
24300 #: ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523
24301 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-cat.pl:115
24302 #: ../tools/virt-tar.pl:134 ../tools/virt-rescue.pl:147
24303 #: ../tools/virt-list-partitions.pl:87
24304 msgid "B<--format> raw"
24308 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126
24309 #: ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119
24310 #: ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88
24311 #: ../tools/virt-cat.pl:117 ../tools/virt-tar.pl:136
24312 #: ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
24314 "Specify the format of disk images given on the command line. If this is "
24315 "omitted then the format is autodetected from the content of the disk image."
24319 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130
24320 #: ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123
24321 #: ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92
24322 #: ../tools/virt-cat.pl:121 ../tools/virt-tar.pl:140
24323 #: ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
24325 "If disk images are requested from libvirt, then this program asks libvirt "
24326 "for this information. In this case, the value of the format parameter is "
24331 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134
24332 #: ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127
24333 #: ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528
24334 #: ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96
24335 #: ../tools/virt-cat.pl:125 ../tools/virt-tar.pl:144
24336 #: ../tools/virt-rescue.pl:157 ../tools/virt-list-partitions.pl:97
24338 "If working with untrusted raw-format guest disk images, you should ensure "
24339 "the format is always specified."
24343 #: ../inspector/virt-inspector.pl:149
24348 #: ../inspector/virt-inspector.pl:151
24350 "The virt-inspector XML is described precisely in a RELAX NG schema which is "
24351 "supplied with libguestfs. This section is just an overview."
24355 #: ../inspector/virt-inspector.pl:154
24357 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
24358 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
24359 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
24360 "which is vanishingly rare in real world VMs."
24364 #: ../inspector/virt-inspector.pl:159
24365 msgid "E<lt>operatingsystemE<gt>"
24369 #: ../inspector/virt-inspector.pl:161
24371 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
24372 "describe the operating system, its architecture, the descriptive \"product "
24373 "name\" string, the type of OS and so on, as in this example:"
24377 #: ../inspector/virt-inspector.pl:165
24380 " <operatingsystems>\n"
24381 " <operatingsystem>\n"
24382 " <root>/dev/sda2</root>\n"
24383 " <name>windows</name>\n"
24384 " <arch>i386</arch>\n"
24385 " <distro>windows</distro>\n"
24386 " <product_name>Windows 7 Enterprise</product_name>\n"
24387 " <major_version>6</major_version>\n"
24388 " <minor_version>1</minor_version>\n"
24389 " <windows_systemroot>/Windows</windows_systemroot>\n"
24394 #: ../inspector/virt-inspector.pl:176
24396 "These fields are derived from the libguestfs inspection API, and you can "
24397 "find more details in L<guestfs(3)/INSPECTION>."
24401 #: ../inspector/virt-inspector.pl:179
24403 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
24404 "of view of libguestfs (block devices may have completely different names "
24405 "inside the VM itself)."
24409 #: ../inspector/virt-inspector.pl:240
24410 msgid "E<lt>mountpointsE<gt>"
24414 #: ../inspector/virt-inspector.pl:242
24416 "Un*x-like guests typically have multiple filesystems which are mounted at "
24417 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
24418 "element which looks like this:"
24422 #: ../inspector/virt-inspector.pl:246
24425 " <operatingsystems>\n"
24426 " <operatingsystem>\n"
24429 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
24430 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
24431 " </mountpoints>\n"
24436 #: ../inspector/virt-inspector.pl:254
24438 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
24439 "and may have completely different names inside the guest. Only mountable "
24440 "filesystems appear in this list, not things like swap devices."
24444 #: ../inspector/virt-inspector.pl:276
24445 msgid "E<lt>filesystemsE<gt>"
24449 #: ../inspector/virt-inspector.pl:278
24451 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
24452 "filesystems belonging to the guest, including swap and empty partitions. "
24453 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
24454 "this OS or shared by this OS and other OSes)."
24458 #: ../inspector/virt-inspector.pl:283
24459 msgid "You might see something like this:"
24463 #: ../inspector/virt-inspector.pl:285
24466 " <operatingsystems>\n"
24467 " <operatingsystem>\n"
24470 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
24471 " <type>ext4</type>\n"
24472 " <label>Fedora-13-x86_64</label>\n"
24473 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
24479 #: ../inspector/virt-inspector.pl:295
24481 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
24482 "the label, and the UUID."
24486 #: ../inspector/virt-inspector.pl:337
24487 msgid "E<lt>applicationsE<gt>"
24491 #: ../inspector/virt-inspector.pl:339
24493 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
24494 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
24495 "machine. At the moment we are only able to list RPMs and Debian packages "
24496 "installed, but in future we will support other Linux distros and Windows."
24500 #: ../inspector/virt-inspector.pl:345
24502 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
24503 "Typical values would be C<rpm> and C<deb>."
24507 #: ../inspector/virt-inspector.pl:348
24509 "E<lt>package_managementE<gt>, if present, describes the package manager. "
24510 "Typical values include C<yum>, C<up2date> and C<apt>"
24514 #: ../inspector/virt-inspector.pl:351
24515 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
24519 #: ../inspector/virt-inspector.pl:354
24522 " <operatingsystems>\n"
24523 " <operatingsystem>\n"
24525 " <applications>\n"
24527 " <name>coreutils</name>\n"
24528 " <version>8.5</version>\n"
24529 " <release>1</release>\n"
24530 " </application>\n"
24535 #: ../inspector/virt-inspector.pl:364
24537 "(The version and release fields may not be available for some package types)."
24541 #: ../inspector/virt-inspector.pl:544
24542 msgid "USING XPATH"
24546 #: ../inspector/virt-inspector.pl:546
24548 "You can use the XPath query language, and/or the xpath tool, in order to "
24549 "select parts of the XML."
24553 #: ../inspector/virt-inspector.pl:551
24556 " $ virt-inspector Guest | xpath //filesystems\n"
24557 " Found 1 nodes:\n"
24560 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
24561 " <type>ext4</type>\n"
24567 #: ../inspector/virt-inspector.pl:559
24570 " $ virt-inspector Guest | \\\n"
24571 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
24572 " Query didn't return a nodeset. Value: ext4\n"
24577 #: ../inspector/virt-inspector.pl:563 ../tools/virt-edit.pl:343
24578 #: ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477
24579 #: ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225
24580 #: ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179
24581 #: ../tools/virt-cat.pl:178 ../tools/virt-tar.pl:274
24582 #: ../tools/virt-rescue.pl:260 ../tools/virt-make-fs.pl:527
24583 #: ../tools/virt-list-partitions.pl:247
24584 msgid "SHELL QUOTING"
24588 #: ../inspector/virt-inspector.pl:565 ../tools/virt-edit.pl:345
24589 #: ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635
24590 #: ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481
24591 #: ../tools/virt-list-filesystems.pl:181 ../tools/virt-cat.pl:180
24592 #: ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:262
24593 #: ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
24595 "Libvirt guest names can contain arbitrary characters, some of which have "
24596 "meaning to the shell such as C<#> and space. You may need to quote or "
24597 "escape these characters on the command line. See the shell manual page L<sh"
24598 "(1)> for details."
24602 #: ../inspector/virt-inspector.pl:572
24604 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
24605 "L<Sys::Virt(3)>, L<http://www.w3.org/TR/xpath/>, L<http://libguestfs.org/>."
24609 #: ../inspector/virt-inspector.pl:586 ../tools/virt-edit.pl:364
24610 #: ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651
24611 #: ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510
24612 #: ../tools/virt-list-filesystems.pl:200 ../tools/virt-cat.pl:197
24613 #: ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:279
24614 #: ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
24615 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
24619 #: ../inspector/virt-inspector.pl:590
24620 msgid "Matthew Booth L<mbooth@redhat.com>"
24624 #: ../inspector/virt-inspector.pl:596 ../tools/virt-win-reg.pl:516
24625 #: ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
24626 msgid "Copyright (C) 2010 Red Hat Inc."
24630 #: ../tools/virt-edit.pl:34
24631 msgid "virt-edit - Edit a file in a virtual machine"
24635 #: ../tools/virt-edit.pl:38
24638 " virt-edit [--options] domname file\n"
24643 #: ../tools/virt-edit.pl:40
24646 " virt-edit [--options] disk.img [disk.img ...] file\n"
24651 #: ../tools/virt-edit.pl:42
24654 " virt-edit [domname|disk.img] file -e 'expr'\n"
24659 #: ../tools/virt-edit.pl:46
24661 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
24662 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
24663 "doing this, but doesn't catch all cases."
24667 #: ../tools/virt-edit.pl:52
24669 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
24670 "the named virtual machine (or disk image)."
24674 #: ../tools/virt-edit.pl:55
24676 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
24677 "you should look at the L<guestfish(1)> tool."
24681 #: ../tools/virt-edit.pl:60
24682 msgid "Edit the named files interactively:"
24686 #: ../tools/virt-edit.pl:62
24689 " virt-edit mydomain /boot/grub/grub.conf\n"
24694 #: ../tools/virt-edit.pl:64
24697 " virt-edit mydomain /etc/passwd\n"
24702 #: ../tools/virt-edit.pl:66
24704 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
24705 "below). To change the init default level to 5:"
24709 #: ../tools/virt-edit.pl:70
24712 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
24717 #: ../tools/virt-edit.pl:96
24718 msgid "B<--backup extension> | B<-b extension>"
24722 #: ../tools/virt-edit.pl:98
24724 "Create a backup of the original file I<in the guest disk image>. The backup "
24725 "has the original filename with C<extension> added."
24729 #: ../tools/virt-edit.pl:101
24731 "Usually the first character of C<extension> would be a dot C<.> so you would "
24736 #: ../tools/virt-edit.pl:104
24739 " virt-edit -b .orig [etc]\n"
24744 #: ../tools/virt-edit.pl:106
24745 msgid "By default, no backup file is made."
24749 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
24750 #: ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107
24751 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-cat.pl:108
24752 #: ../tools/virt-tar.pl:127 ../tools/virt-rescue.pl:140
24753 #: ../tools/virt-list-partitions.pl:80
24755 "If you specify guest block devices directly, then libvirt is not used at all."
24759 #: ../tools/virt-edit.pl:141
24760 msgid "B<--expr EXPR> | B<-e EXPR>"
24764 #: ../tools/virt-edit.pl:143
24766 "Instead of launching the external editor, non-interactively apply the Perl "
24767 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
24772 #: ../tools/virt-edit.pl:147
24774 "Be careful to properly quote the expression to prevent it from being altered "
24779 #: ../tools/virt-edit.pl:268
24780 msgid "NON-INTERACTIVE EDITING"
24784 #: ../tools/virt-edit.pl:270
24786 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
24787 "administrator can interactively edit the file."
24791 #: ../tools/virt-edit.pl:273
24793 "There are two ways also to use C<virt-edit> from scripts in order to make "
24794 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
24795 "like this, it's less error-prone to write scripts directly using the "
24796 "libguestfs API and Augeas for configuration file editing.)"
24800 #: ../tools/virt-edit.pl:279
24802 "The first method is to temporarily set C<$EDITOR> to any script or program "
24803 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
24804 "update C<tmpfile> in place however it likes."
24808 #: ../tools/virt-edit.pl:283
24810 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
24811 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
24812 "instances of C<foo> with C<bar> in a file:"
24816 #: ../tools/virt-edit.pl:287
24819 " virt-edit domname filename -e 's/foo/bar/'\n"
24824 #: ../tools/virt-edit.pl:289
24826 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
24827 "For example to delete root's password you could do:"
24831 #: ../tools/virt-edit.pl:292
24834 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
24839 #: ../tools/virt-edit.pl:294
24841 "What really happens is that the snippet is evaluated as a Perl expression "
24842 "for each line of the file. The line, including the final C<\\n>, is passed "
24843 "in C<$_> and the expression should update C<$_> or leave it unchanged."
24847 #: ../tools/virt-edit.pl:299
24849 "To delete a line, set C<$_> to the empty string. For example, to delete the "
24850 "C<apache> user account from the password file you can do:"
24854 #: ../tools/virt-edit.pl:302
24857 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
24862 #: ../tools/virt-edit.pl:304
24864 "To insert a line, prepend or append it to C<$_>. However appending lines to "
24865 "the end of the file is rather difficult this way since there is no concept "
24866 "of \"last line of the file\" - your expression just doesn't get called "
24867 "again. You might want to use the first method (setting C<$EDITOR>) if you "
24872 #: ../tools/virt-edit.pl:310
24874 "The variable C<$lineno> contains the current line number. As is "
24875 "traditional, the first line in the file is number C<1>."
24879 #: ../tools/virt-edit.pl:313
24881 "The return value from the expression is ignored, but the expression may call "
24882 "C<die> in order to abort the whole program, leaving the original file "
24887 #: ../tools/virt-edit.pl:317
24889 "Remember when matching the end of a line that C<$_> may contain the final C<"
24890 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
24891 "newline then neither of these. Thus to match or substitute some text at the "
24892 "end of a line, use this regular expression:"
24896 #: ../tools/virt-edit.pl:322
24899 " /some text(\\r?\\n)?$/\n"
24904 #: ../tools/virt-edit.pl:324
24906 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
24907 "$_> itself (since that would remove all newlines from the file):"
24911 #: ../tools/virt-edit.pl:328
24914 " my $m = $_; chomp $m; $m =~ /some text$/\n"
24919 #: ../tools/virt-edit.pl:334
24924 #: ../tools/virt-edit.pl:336
24926 "If set, this string is used as the editor. It may contain arguments, eg. C<"
24931 #: ../tools/virt-edit.pl:339
24932 msgid "If not set, C<vi> is used."
24936 #: ../tools/virt-edit.pl:352
24938 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24939 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
24944 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
24945 #: ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243
24946 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198
24947 #: ../tools/virt-cat.pl:195 ../tools/virt-tar.pl:292
24948 #: ../tools/virt-rescue.pl:277 ../tools/virt-make-fs.pl:559
24949 #: ../tools/virt-list-partitions.pl:265
24954 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655
24955 #: ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
24956 msgid "Copyright (C) 2009-2010 Red Hat Inc."
24960 #: ../tools/virt-win-reg.pl:37
24962 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
24966 #: ../tools/virt-win-reg.pl:41
24969 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
24974 #: ../tools/virt-win-reg.pl:43
24977 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
24982 #: ../tools/virt-win-reg.pl:45
24985 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
24990 #: ../tools/virt-win-reg.pl:47
24993 " virt-win-reg --merge domname [input.reg ...]\n"
24998 #: ../tools/virt-win-reg.pl:49
25001 " virt-win-reg [--options] disk.img ... # instead of domname\n"
25006 #: ../tools/virt-win-reg.pl:53
25008 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
25009 "virtual machines. If you do this, you I<will> get irreversible disk "
25010 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
25011 "but doesn't catch all cases."
25015 #: ../tools/virt-win-reg.pl:58
25017 "Modifying the Windows Registry is an inherently risky operation. The format "
25018 "is deliberately obscure and undocumented, and Registry changes can leave the "
25019 "system unbootable. Therefore when using the C<--merge> option, make sure "
25020 "you have a reliable backup first."
25024 #: ../tools/virt-win-reg.pl:65
25026 "This program can export and merge Windows Registry entries from a Windows "
25031 #: ../tools/virt-win-reg.pl:68
25033 "The first parameter is the libvirt guest name or the raw disk image of a "
25038 #: ../tools/virt-win-reg.pl:71
25040 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
25041 "exported (recursively). For example:"
25045 #: ../tools/virt-win-reg.pl:74
25048 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
25053 #: ../tools/virt-win-reg.pl:76
25055 "You can also display single values from within registry keys, for example:"
25059 #: ../tools/virt-win-reg.pl:79
25062 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
25063 " $ virt-win-reg Windows7 $cvkey ProductName\n"
25064 " Windows 7 Enterprise\n"
25069 #: ../tools/virt-win-reg.pl:83
25071 "With C<--merge>, you can merge a textual regedit file into the Windows "
25076 #: ../tools/virt-win-reg.pl:86
25079 " $ virt-win-reg --merge Windows7 changes.reg\n"
25084 #: ../tools/virt-win-reg.pl:88
25085 msgid "SUPPORTED SYSTEMS"
25089 #: ../tools/virt-win-reg.pl:90
25091 "The program currently supports Windows NT-derived guests starting with "
25092 "Windows XP through to at least Windows 7."
25096 #: ../tools/virt-win-reg.pl:93
25098 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
25099 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
25100 "and C<HKEY_USERS\\.DEFAULT>."
25104 #: ../tools/virt-win-reg.pl:97
25106 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
25111 #: ../tools/virt-win-reg.pl:100
25113 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
25118 #: ../tools/virt-win-reg.pl:103
25123 #: ../tools/virt-win-reg.pl:105
25125 "This program is only meant for simple access to the registry. If you want "
25126 "to do complicated things with the registry, we suggest you download the "
25127 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
25128 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
25129 "L<hivexregedit(1)>."
25133 #: ../tools/virt-win-reg.pl:111
25138 #: ../tools/virt-win-reg.pl:113
25140 "C<virt-win-reg> expects that regedit files have already been reencoded in "
25141 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
25142 "style line endings. Since Windows regedit files are often in UTF-16LE with "
25143 "Windows-style line endings, you may need to reencode the whole file before "
25144 "or after processing."
25148 #: ../tools/virt-win-reg.pl:119
25150 "To reencode a file from Windows format to Linux (before processing it with "
25151 "the C<--merge> option), you would do something like this:"
25155 #: ../tools/virt-win-reg.pl:122
25158 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
25163 #: ../tools/virt-win-reg.pl:124
25165 "To go in the opposite direction, after exporting and before sending the file "
25166 "to a Windows user, do something like this:"
25170 #: ../tools/virt-win-reg.pl:127
25173 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
25178 #: ../tools/virt-win-reg.pl:129
25179 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
25183 #: ../tools/virt-win-reg.pl:131
25185 "If you are unsure about the current encoding, use the L<file(1)> command. "
25186 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
25187 "style (CRLF) line endings, like this:"
25191 #: ../tools/virt-win-reg.pl:135
25194 " $ file software.reg\n"
25195 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
25196 " with CRLF line terminators\n"
25201 #: ../tools/virt-win-reg.pl:139
25202 msgid "This file would need conversion before you could C<--merge> it."
25206 #: ../tools/virt-win-reg.pl:143
25208 "Be careful when passing parameters containing C<\\> (backslash) in the "
25209 "shell. Usually you will have to use 'single quotes' or double backslashes "
25210 "(but not both) to protect them from the shell."
25214 #: ../tools/virt-win-reg.pl:147
25215 msgid "Paths and value names are case-insensitive."
25219 #: ../tools/virt-win-reg.pl:149
25220 msgid "CurrentControlSet etc."
25224 #: ../tools/virt-win-reg.pl:151
25226 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
25227 "Registry at the level of the hive file, and therefore you cannot modify "
25232 #: ../tools/virt-win-reg.pl:155
25234 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
25235 "circumstances it might refer to another control set. The way to find out is "
25236 "to look at the C<HKLM\\SYSTEM\\Select> key:"
25240 #: ../tools/virt-win-reg.pl:159
25243 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
25244 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
25245 " \"Current\"=dword:00000001\n"
25246 " \"Default\"=dword:00000001\n"
25247 " \"Failed\"=dword:00000000\n"
25248 " \"LastKnownGood\"=dword:00000002\n"
25253 #: ../tools/virt-win-reg.pl:166
25254 msgid "\"Default\" is the one which Windows will choose when it boots."
25258 #: ../tools/virt-win-reg.pl:168
25260 "Similarly, other C<Current...> keys in the path may need to be replaced."
25264 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
25269 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
25270 msgid "Enable debugging messages."
25274 #: ../tools/virt-win-reg.pl:232
25279 #: ../tools/virt-win-reg.pl:234
25281 "In merge mode, this merges a textual regedit file into the Windows Registry "
25282 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
25283 "displays or exports Registry entries instead."
25287 #: ../tools/virt-win-reg.pl:238
25289 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
25290 "result in disk corruption. However exporting (without this flag) is always "
25295 #: ../tools/virt-win-reg.pl:246
25296 msgid "B<--encoding> UTF-16LE|ASCII"
25300 #: ../tools/virt-win-reg.pl:248
25302 "When merging (only), you may need to specify the encoding for strings to be "
25303 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
25304 "(3)/ENCODING STRINGS>."
25308 #: ../tools/virt-win-reg.pl:252
25310 "The default is to use UTF-16LE, which should work with recent versions of "
25315 #: ../tools/virt-win-reg.pl:486
25317 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
25318 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
25319 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25323 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
25325 "When reporting bugs, please enable debugging and capture the I<complete> "
25330 #: ../tools/virt-win-reg.pl:504
25333 " export LIBGUESTFS_DEBUG=1\n"
25334 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
25339 #: ../tools/virt-win-reg.pl:507
25341 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
25346 #: ../tools/virt-df.pl:36
25347 msgid "virt-df - Display free space on virtual filesystems"
25351 #: ../tools/virt-df.pl:40
25354 " virt-df [--options]\n"
25359 #: ../tools/virt-df.pl:42
25362 " virt-df [--options] domname\n"
25367 #: ../tools/virt-df.pl:44
25370 " virt-df [--options] disk.img [disk.img ...]\n"
25375 #: ../tools/virt-df.pl:48
25377 "C<virt-df> is a command line tool to display free space on virtual machine "
25378 "filesystems. Unlike other tools, it doesn't just display the amount of "
25379 "space allocated to a virtual machine, but can look inside the virtual "
25380 "machine to see how much space is really being used."
25384 #: ../tools/virt-df.pl:53
25386 "It is like the L<df(1)> command, but for virtual machines, except that it "
25387 "also works for Windows virtual machines."
25391 #: ../tools/virt-df.pl:56
25393 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
25394 "of all active and inactive guests, and performs a C<df>-type operation on "
25395 "each one in turn, printing out the results."
25399 #: ../tools/virt-df.pl:60
25401 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
25402 "either the single named libvirt domain, or on the disk image(s) listed on "
25403 "the command line (which must all belong to a single VM). In this mode (with "
25404 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
25405 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
25409 #: ../tools/virt-df.pl:67
25411 "Use the C<--csv> option to get a format which can be easily parsed by other "
25412 "programs. Other options are mostly similar to standard C<df> options. See "
25413 "below for the complete list."
25417 #: ../tools/virt-df.pl:107
25422 #: ../tools/virt-df.pl:109
25424 "Write out the results in CSV format (comma-separated values). This format "
25425 "can be imported easily into databases and spreadsheets, but read L</NOTE "
25426 "ABOUT CSV FORMAT> below."
25430 #: ../tools/virt-df.pl:134
25431 msgid "B<--human-readable> | B<-h>"
25435 #: ../tools/virt-df.pl:136
25436 msgid "Print sizes in human-readable format."
25440 #: ../tools/virt-df.pl:138
25441 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
25445 #: ../tools/virt-df.pl:144
25446 msgid "B<--inodes> | B<-i>"
25450 #: ../tools/virt-df.pl:146
25451 msgid "Print inodes instead of blocks."
25455 #: ../tools/virt-df.pl:152
25456 msgid "B<--one-per-guest>"
25460 #: ../tools/virt-df.pl:154
25462 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
25463 "disks from several guests to a single libguestfs appliance."
25467 #: ../tools/virt-df.pl:157
25468 msgid "You might use this option in the following circumstances:"
25472 #: ../tools/virt-df.pl:163
25474 "If you think an untrusted guest might actively try to exploit the libguestfs "
25475 "appliance kernel, then this prevents one guest from interfering with the "
25476 "stats printed for another guest."
25480 #: ../tools/virt-df.pl:169
25482 "If the kernel has a bug which stops it from accessing a filesystem in one "
25483 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
25484 "and report stats for further guests."
25488 #: ../tools/virt-df.pl:180
25493 #: ../tools/virt-df.pl:182
25495 "Print UUIDs instead of names. This is useful for following a guest even "
25496 "when the guest is migrated or renamed, or when two guests happen to have the "
25501 #: ../tools/virt-df.pl:186
25503 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
25504 "images, we still print the disk image name even when this option is "
25509 #: ../tools/virt-df.pl:609
25510 msgid "NOTE ABOUT CSV FORMAT"
25514 #: ../tools/virt-df.pl:611
25516 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
25517 "should be easy to parse, but it is definitely not easy to parse."
25521 #: ../tools/virt-df.pl:614
25523 "Myth: Just split fields at commas. Reality: This does I<not> work "
25524 "reliably. This example has two columns:"
25528 #: ../tools/virt-df.pl:617
25531 " \"foo,bar\",baz\n"
25536 #: ../tools/virt-df.pl:619
25538 "Myth: Read the file one line at a time. Reality: This does I<not> work "
25539 "reliably. This example has one row:"
25543 #: ../tools/virt-df.pl:622
25552 #: ../tools/virt-df.pl:625
25554 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
25555 "packaged in major Linux distributions)."
25559 #: ../tools/virt-df.pl:628
25561 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
25562 "or Python's built-in csv library)."
25566 #: ../tools/virt-df.pl:631
25567 msgid "Most spreadsheets and databases can import CSV directly."
25571 #: ../tools/virt-df.pl:642
25573 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
25574 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25578 #: ../tools/virt-ls.pl:34
25579 msgid "virt-ls - List files in a virtual machine"
25583 #: ../tools/virt-ls.pl:38
25586 " virt-ls [--options] domname directory\n"
25591 #: ../tools/virt-ls.pl:40
25594 " virt-ls [--options] disk.img [disk.img ...] directory\n"
25599 #: ../tools/virt-ls.pl:44
25601 "C<virt-ls> is a command line tool to list the names of files in a directory "
25602 "inside a virtual machine or disk image."
25606 #: ../tools/virt-ls.pl:47
25608 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
25609 "For more complex cases you should look at the L<guestfish(1)> tool."
25613 #: ../tools/virt-ls.pl:51
25615 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
25616 "simple listing is like the ordinary L<ls(1)> command:"
25620 #: ../tools/virt-ls.pl:54
25623 " $ virt-ls myguest /\n"
25631 #: ../tools/virt-ls.pl:59
25632 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
25636 #: ../tools/virt-ls.pl:61
25639 " $ virt-ls -l myguest /\n"
25641 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
25642 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
25648 #: ../tools/virt-ls.pl:67
25650 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
25651 "and directories recursively:"
25655 #: ../tools/virt-ls.pl:70
25658 " $ virt-ls -R myguest /tmp\n"
25666 #: ../tools/virt-ls.pl:75
25668 "You I<cannot> combine these options. To do more complicated things, use "
25673 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103
25674 #: ../tools/virt-list-partitions.pl:112
25675 msgid "B<-l> | B<--long>"
25679 #: ../tools/virt-ls.pl:133
25680 msgid "B<-R> | B<--recursive>"
25684 #: ../tools/virt-ls.pl:135
25686 "Select the mode. With neither of these options, C<virt-ls> produces a "
25687 "simple, flat list of the files in the named directory."
25691 #: ../tools/virt-ls.pl:138
25693 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
25694 "like the plain C<ls -l> command)."
25698 #: ../tools/virt-ls.pl:141
25700 "C<virt-ls -R> produces a recursive list of files starting at the named "
25701 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
25706 #: ../tools/virt-ls.pl:145
25707 msgid "You cannot combine these options."
25711 #: ../tools/virt-ls.pl:234
25713 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
25714 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
25719 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204
25720 #: ../tools/virt-cat.pl:201 ../tools/virt-tar.pl:298
25721 msgid "Copyright (C) 2009 Red Hat Inc."
25725 #: ../tools/virt-resize.pl:42
25726 msgid "virt-resize - Resize a virtual machine disk"
25730 #: ../tools/virt-resize.pl:46
25733 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
25734 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
25735 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
25740 #: ../tools/virt-resize.pl:52
25742 "Virt-resize is a tool which can resize a virtual machine disk, making it "
25743 "larger or smaller overall, and resizing or deleting any partitions contained "
25748 #: ../tools/virt-resize.pl:56
25750 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
25751 "not> be used on live virtual machines - for consistent results, shut the "
25752 "virtual machine down before resizing it."
25756 #: ../tools/virt-resize.pl:60
25758 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
25759 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
25760 "read those manual pages first."
25764 #: ../tools/virt-resize.pl:68
25766 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
25767 "fill the extra 5GB of space."
25771 #: ../tools/virt-resize.pl:71
25774 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
25775 " virt-list-partitions -lht olddisk\n"
25776 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
25777 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
25782 #: ../tools/virt-resize.pl:76
25784 "As above, but make the /boot partition 200MB bigger, while giving the "
25785 "remaining space to /dev/sda2:"
25789 #: ../tools/virt-resize.pl:79
25792 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
25797 #: ../tools/virt-resize.pl:81
25798 msgid "As above, but the output format will be uncompressed qcow2:"
25802 #: ../tools/virt-resize.pl:83
25805 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
25806 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
25811 #: ../tools/virt-resize.pl:86
25812 msgid "DETAILED USAGE"
25816 #: ../tools/virt-resize.pl:88
25817 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25821 #: ../tools/virt-resize.pl:92
25822 msgid "1. Shut down the virtual machine"
25826 #: ../tools/virt-resize.pl:94
25827 msgid "2. Locate input disk image"
25831 #: ../tools/virt-resize.pl:96
25833 "Locate the input disk image (ie. the file or device on the host containing "
25834 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25835 "dumpxml> like this to find the disk image name:"
25839 #: ../tools/virt-resize.pl:100
25842 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25843 " Found 1 nodes:\n"
25845 " <source dev=\"/dev/vg/lv_guest\" />\n"
25850 #: ../tools/virt-resize.pl:105
25851 msgid "3. Look at current sizing"
25855 #: ../tools/virt-resize.pl:107
25857 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25861 #: ../tools/virt-resize.pl:110
25864 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25865 " /dev/sda1 ext3 101.9M\n"
25866 " /dev/sda2 pv 7.9G\n"
25867 " /dev/sda device 8.0G\n"
25872 #: ../tools/virt-resize.pl:115
25874 "(This example is a virtual machine with an 8 GB disk which we would like to "
25875 "expand up to 10 GB)."
25879 #: ../tools/virt-resize.pl:118
25880 msgid "4. Create output disk"
25884 #: ../tools/virt-resize.pl:120
25886 "Virt-resize cannot do in-place disk modifications. You have to have space "
25887 "to store the resized output disk."
25891 #: ../tools/virt-resize.pl:123
25893 "To store the resized disk image in a file, create a file of a suitable size:"
25897 #: ../tools/virt-resize.pl:126
25900 " # rm -f outdisk\n"
25901 " # truncate -s 10G outdisk\n"
25906 #: ../tools/virt-resize.pl:129
25907 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25911 #: ../tools/virt-resize.pl:131
25914 " # lvcreate -L 10G -n lv_name vg_name\n"
25919 #: ../tools/virt-resize.pl:133
25920 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25924 #: ../tools/virt-resize.pl:135
25927 " # virsh pool-list\n"
25928 " # virsh vol-create-as poolname newvol 10G\n"
25933 #: ../tools/virt-resize.pl:138
25938 #: ../tools/virt-resize.pl:140
25940 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25941 "file) and the output disk. The output disk is the one created in the "
25946 #: ../tools/virt-resize.pl:144
25949 " # virt-resize indisk outdisk\n"
25954 #: ../tools/virt-resize.pl:146
25956 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25957 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25958 "larger, then an extra, empty partition is created at the end of the disk "
25959 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25964 #: ../tools/virt-resize.pl:152
25966 "More realistically you'd want to expand existing partitions in the disk "
25967 "image by passing extra options (for the full list see the L</OPTIONS> "
25972 #: ../tools/virt-resize.pl:156
25974 "L</--expand> is the most useful option. It expands the named partition "
25975 "within the disk to fill any extra space:"
25979 #: ../tools/virt-resize.pl:159
25982 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25987 #: ../tools/virt-resize.pl:161
25989 "(In this case, an extra partition is I<not> created at the end of the disk, "
25990 "because there will be no unused space)."
25994 #: ../tools/virt-resize.pl:164
25996 "L</--resize> is the other commonly used option. The following would "
25997 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25998 "rest of the available space:"
26002 #: ../tools/virt-resize.pl:168
26005 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
26006 " indisk outdisk\n"
26011 #: ../tools/virt-resize.pl:171
26013 "If the expanded partition in the image contains a filesystem or LVM PV, then "
26014 "if virt-resize knows how, it will resize the contents, the equivalent of "
26015 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
26016 ">. However virt-resize does not know how to resize some filesystems, so you "
26017 "would have to online resize them after booting the guest. And virt-resize "
26018 "also does not resize anything inside an LVM PV, it just resizes the PV "
26019 "itself and leaves the user to resize any LVs inside that PV as desired."
26023 #: ../tools/virt-resize.pl:180
26024 msgid "Other options are covered below."
26028 #: ../tools/virt-resize.pl:182
26033 #: ../tools/virt-resize.pl:184
26034 msgid "Thoroughly test the new disk image I<before> discarding the old one."
26038 #: ../tools/virt-resize.pl:186
26039 msgid "If you are using libvirt, edit the XML to point at the new disk:"
26043 #: ../tools/virt-resize.pl:188
26046 " # virsh edit guestname\n"
26051 #: ../tools/virt-resize.pl:190
26053 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
26054 "html#elementsDisks>"
26058 #: ../tools/virt-resize.pl:193
26059 msgid "Then start up the domain with the new, resized disk:"
26063 #: ../tools/virt-resize.pl:195
26066 " # virsh start guestname\n"
26071 #: ../tools/virt-resize.pl:197
26073 "and check that it still works. See also the L</NOTES> section below for "
26074 "additional information."
26078 #: ../tools/virt-resize.pl:200
26079 msgid "7. Resize LVs etc inside the guest"
26083 #: ../tools/virt-resize.pl:202
26084 msgid "(This can also be done offline using L<guestfish(1)>)"
26088 #: ../tools/virt-resize.pl:204
26090 "Once the guest has booted you should see the new space available, at least "
26091 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
26092 "may need to resize LVs inside PVs, and also resize filesystem types that "
26093 "virt-resize does not know how to expand."
26097 #: ../tools/virt-resize.pl:211
26098 msgid "SHRINKING A VIRTUAL MACHINE DISK"
26102 #: ../tools/virt-resize.pl:213
26104 "Shrinking is somewhat more complex than expanding, and only an overview is "
26109 #: ../tools/virt-resize.pl:216
26111 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
26112 "filesystems). The user has to shrink content before passing the disk image "
26113 "to virt-resize, and virt-resize will check that the content has been shrunk "
26118 #: ../tools/virt-resize.pl:221
26119 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
26123 #: ../tools/virt-resize.pl:223
26125 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
26126 "steps 3 and 4 above to allocate a new disk image."
26130 #: ../tools/virt-resize.pl:226
26132 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
26136 #: ../tools/virt-resize.pl:229
26137 msgid "IGNORING OR DELETING PARTITIONS"
26141 #: ../tools/virt-resize.pl:231
26143 "virt-resize also gives a convenient way to ignore or delete partitions when "
26144 "copying from the input disk to the output disk. Ignoring a partition speeds "
26145 "up the copy where you don't care about the existing contents of a "
26146 "partition. Deleting a partition removes it completely, but note that it "
26147 "also renumbers any partitions after the one which is deleted, which can "
26148 "leave some guests unbootable."
26152 #: ../tools/virt-resize.pl:238
26153 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
26157 #: ../tools/virt-resize.pl:240
26159 "If the input disk is in qcow2 format, then you may prefer that the output is "
26160 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
26161 "the fly. The output format is simply determined by the format of the empty "
26162 "output container that you provide. Thus to create qcow2 output, use:"
26166 #: ../tools/virt-resize.pl:246
26169 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
26174 #: ../tools/virt-resize.pl:248
26175 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
26179 #: ../tools/virt-resize.pl:250
26180 msgid "Similarly, to get non-sparse raw output use:"
26184 #: ../tools/virt-resize.pl:252
26187 " fallocate -l size outdisk\n"
26192 #: ../tools/virt-resize.pl:254
26194 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
26195 "dev/zero of=outdisk bs=1M count=..>)"
26199 #: ../tools/virt-resize.pl:267
26200 msgid "Display help."
26204 #: ../tools/virt-resize.pl:281
26205 msgid "B<--resize part=size>"
26209 #: ../tools/virt-resize.pl:283
26211 "Resize the named partition (expanding or shrinking it) so that it has the "
26216 #: ../tools/virt-resize.pl:286
26218 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
26219 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
26220 "Exabytes; or as a percentage of the current size; or as a relative number or "
26221 "percentage. For example:"
26225 #: ../tools/virt-resize.pl:291
26228 " --resize /dev/sda2=10G\n"
26233 #: ../tools/virt-resize.pl:293
26236 " --resize /dev/sda4=90%\n"
26241 #: ../tools/virt-resize.pl:295
26244 " --resize /dev/sda2=+1G\n"
26249 #: ../tools/virt-resize.pl:297
26252 " --resize /dev/sda2=-200M\n"
26257 #: ../tools/virt-resize.pl:299
26260 " --resize /dev/sda1=+128K\n"
26265 #: ../tools/virt-resize.pl:301
26268 " --resize /dev/sda1=+10%\n"
26273 #: ../tools/virt-resize.pl:303
26276 " --resize /dev/sda1=-10%\n"
26281 #: ../tools/virt-resize.pl:305
26283 "You can increase the size of any partition. Virt-resize will expand the "
26284 "direct content of the partition if it knows how (see C<--expand> below)."
26288 #: ../tools/virt-resize.pl:309
26290 "You can only I<decrease> the size of partitions that contain filesystems or "
26291 "PVs which have already been shrunk. Virt-resize will check this has been "
26292 "done before proceeding, or else will print an error (see also C<--resize-"
26297 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406
26298 #: ../tools/virt-resize.pl:423
26299 msgid "You can give this option multiple times."
26303 #: ../tools/virt-resize.pl:320
26304 msgid "B<--resize-force part=size>"
26308 #: ../tools/virt-resize.pl:322
26310 "This is the same as C<--resize> except that it will let you decrease the "
26311 "size of any partition. Generally this means you will lose any data which "
26312 "was at the end of the partition you shrink, but you may not care about that "
26313 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
26314 "as a swap partition)."
26318 #: ../tools/virt-resize.pl:328
26319 msgid "See also the C<--ignore> option."
26323 #: ../tools/virt-resize.pl:334
26324 msgid "B<--expand part>"
26328 #: ../tools/virt-resize.pl:336
26330 "Expand the named partition so it uses up all extra space (space left over "
26331 "after any other resize changes that you request have been done)."
26335 #: ../tools/virt-resize.pl:339
26337 "If virt-resize knows how, it will expand the direct content of the "
26338 "partition. For example, if the partition is an LVM PV, it will expand the "
26339 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
26340 "content it doesn't know about alone."
26344 #: ../tools/virt-resize.pl:344
26345 msgid "Currently virt-resize can resize:"
26349 #: ../tools/virt-resize.pl:350
26351 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
26356 #: ../tools/virt-resize.pl:355
26358 "NTFS filesystems contained directly in a partition, if libguestfs was "
26359 "compiled with support for NTFS."
26363 #: ../tools/virt-resize.pl:358
26365 "The filesystem must have been shut down consistently last time it was used. "
26366 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
26367 "consistency check, so at the first boot after resizing Windows will check "
26372 #: ../tools/virt-resize.pl:365
26374 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
26375 "inside the PV. The user will have to resize LVs as desired."
26379 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
26380 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
26384 #: ../tools/virt-resize.pl:377
26385 msgid "B<--shrink part>"
26389 #: ../tools/virt-resize.pl:379
26391 "Shrink the named partition until the overall disk image fits in the "
26392 "destination. The named partition B<must> contain a filesystem or PV which "
26393 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
26394 "online tools). Virt-resize will check this and give an error if it has not "
26399 #: ../tools/virt-resize.pl:385
26401 "The amount by which the overall disk must be shrunk (after carrying out all "
26402 "other operations requested by the user) is called the \"deficit\". For "
26403 "example, a straight copy (assume no other operations) from a 5GB disk image "
26404 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
26405 "would give an error unless the user specified a partition to shrink and that "
26406 "partition had more than a gigabyte of free space."
26410 #: ../tools/virt-resize.pl:399
26411 msgid "B<--ignore part>"
26415 #: ../tools/virt-resize.pl:401
26417 "Ignore the named partition. Effectively this means the partition is "
26418 "allocated on the destination disk, but the content is not copied across from "
26419 "the source disk. The content of the partition will be blank (all zero "
26424 #: ../tools/virt-resize.pl:412
26425 msgid "B<--delete part>"
26429 #: ../tools/virt-resize.pl:414
26431 "Delete the named partition. It would be more accurate to describe this as "
26432 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
26433 "the original disk image is left intact."
26437 #: ../tools/virt-resize.pl:418
26439 "Note that when you delete a partition, then anything contained in the "
26440 "partition is also deleted. Furthermore, this causes any partitions that "
26441 "come after to be I<renumbered>, which can easily make your guest unbootable."
26445 #: ../tools/virt-resize.pl:429
26446 msgid "B<--LV-expand logvol>"
26450 #: ../tools/virt-resize.pl:431
26452 "This takes the logical volume and, as a final step, expands it to fill all "
26453 "the space available in its volume group. A typical usage, assuming a Linux "
26454 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
26455 "lv_root> would be:"
26459 #: ../tools/virt-resize.pl:436
26462 " virt-resize indisk outdisk \\\n"
26463 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
26468 #: ../tools/virt-resize.pl:439
26470 "This would first expand the partition (and PV), and then expand the root "
26471 "device to fill the extra space in the PV."
26475 #: ../tools/virt-resize.pl:442
26477 "The contents of the LV are also resized if virt-resize knows how to do "
26478 "that. You can stop virt-resize from trying to expand the content by using "
26479 "the option C<--no-expand-content>."
26483 #: ../tools/virt-resize.pl:446
26484 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
26488 #: ../tools/virt-resize.pl:449
26490 "You can give this option multiple times, I<but> it doesn't make sense to do "
26491 "this unless the logical volumes you specify are all in different volume "
26496 #: ../tools/virt-resize.pl:457
26497 msgid "B<--no-copy-boot-loader>"
26501 #: ../tools/virt-resize.pl:459
26503 "By default, virt-resize copies over some sectors at the start of the disk "
26504 "(up to the beginning of the first partition). Commonly these sectors "
26505 "contain the Master Boot Record (MBR) and the boot loader, and are required "
26506 "in order for the guest to boot correctly."
26510 #: ../tools/virt-resize.pl:464
26512 "If you specify this flag, then this initial copy is not done. You may need "
26513 "to reinstall the boot loader in this case."
26517 #: ../tools/virt-resize.pl:472
26518 msgid "B<--no-extra-partition>"
26522 #: ../tools/virt-resize.pl:474
26524 "By default, virt-resize creates an extra partition if there is any extra, "
26525 "unused space after all resizing has happened. Use this option to prevent "
26526 "the extra partition from being created. If you do this then the extra space "
26527 "will be inaccessible until you run fdisk, parted, or some other partitioning "
26528 "tool in the guest."
26532 #: ../tools/virt-resize.pl:480
26534 "Note that if the surplus space is smaller than 10 MB, no extra partition "
26539 #: ../tools/virt-resize.pl:487
26540 msgid "B<--no-expand-content>"
26544 #: ../tools/virt-resize.pl:489
26546 "By default, virt-resize will try to expand the direct contents of "
26547 "partitions, if it knows how (see C<--expand> option above)."
26551 #: ../tools/virt-resize.pl:492
26553 "If you give the C<--no-expand-content> option then virt-resize will not "
26558 #: ../tools/virt-resize.pl:499
26559 msgid "B<-d> | B<--debug>"
26563 #: ../tools/virt-resize.pl:507
26564 msgid "B<-n> | B<--dryrun>"
26568 #: ../tools/virt-resize.pl:509
26569 msgid "Print a summary of what would be done, but don't do anything."
26573 #: ../tools/virt-resize.pl:515
26574 msgid "B<-q> | B<--quiet>"
26578 #: ../tools/virt-resize.pl:517
26579 msgid "Don't print the summary."
26583 #: ../tools/virt-resize.pl:525
26585 "Specify the format of the input disk image. If this flag is not given then "
26586 "it is auto-detected from the image itself."
26590 #: ../tools/virt-resize.pl:531
26592 "Note that this option I<does not> affect the output format. See L</QCOW2 "
26593 "AND NON-SPARSE RAW FORMATS>."
26597 #: ../tools/virt-resize.pl:538
26598 msgid "B<--output-format> raw"
26602 #: ../tools/virt-resize.pl:540
26604 "Specify the format of the output disk image. If this flag is not given then "
26605 "it is auto-detected from the image itself."
26609 #: ../tools/virt-resize.pl:546
26611 "Note that you still need to create the output disk with the right format. "
26612 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
26616 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
26621 #: ../tools/virt-resize.pl:1424
26622 msgid "\"Partition 1 does not end on cylinder boundary.\""
26626 #: ../tools/virt-resize.pl:1426
26628 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
26629 "means the partitions will not be aligned to the ancient CHS geometry. "
26630 "However CHS geometry is meaningless for disks manufactured since the early "
26631 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
26632 "cylinders is not required by any modern operating system."
26636 #: ../tools/virt-resize.pl:1433
26637 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
26641 #: ../tools/virt-resize.pl:1435
26643 "In Windows Vista and later versions, Microsoft switched to using a separate "
26644 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
26645 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
26646 "the boot partition. Doing so seems to break the guest completely. However "
26647 "expanding the second partition (ie. C: drive) should work."
26651 #: ../tools/virt-resize.pl:1442
26653 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
26654 "NTFS partitions have been expanded. This is just a safety check and (unless "
26655 "it find errors) is nothing to worry about."
26659 #: ../tools/virt-resize.pl:1446
26660 msgid "GUEST BOOT STUCK AT \"GRUB\""
26664 #: ../tools/virt-resize.pl:1448
26666 "If a Linux guest does not boot after resizing, and the boot is stuck after "
26667 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
26668 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
26669 "although we think is to do with partition alignment."
26673 #: ../tools/virt-resize.pl:1453
26676 " guestfish -i -a newdisk\n"
26677 " ><fs> cat /boot/grub/device.map\n"
26678 " # check the contents of this file are sensible or\n"
26679 " # edit the file if necessary\n"
26680 " ><fs> grub-install / /dev/vda\n"
26686 #: ../tools/virt-resize.pl:1460
26688 "For more flexible guest reconfiguration, including if you need to specify "
26689 "other parameters to grub-install, use L<virt-rescue(1)>."
26693 #: ../tools/virt-resize.pl:1463
26694 msgid "ALTERNATIVE TOOLS"
26698 #: ../tools/virt-resize.pl:1465
26700 "There are several proprietary tools for resizing partitions. We won't "
26701 "mention any here."
26705 #: ../tools/virt-resize.pl:1468
26707 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
26708 "operations on disk images. They can resize and move partitions, but I don't "
26709 "think they can do anything with the contents, and they certainly don't "
26714 #: ../tools/virt-resize.pl:1473
26716 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
26717 "but at a much lower level. You will probably end up hand-calculating sector "
26718 "offsets, which is something that virt-resize was designed to avoid. If you "
26719 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
26724 #: ../tools/virt-resize.pl:1488
26726 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
26727 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
26728 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)"
26729 ">, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
26730 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
26734 #: ../tools/virt-list-filesystems.pl:32
26736 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
26740 #: ../tools/virt-list-filesystems.pl:36
26743 " virt-list-filesystems [--options] domname\n"
26748 #: ../tools/virt-list-filesystems.pl:38
26751 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
26756 #: ../tools/virt-list-filesystems.pl:42
26758 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
26759 "are contained in a virtual machine or disk image."
26763 #: ../tools/virt-list-filesystems.pl:46
26765 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
26766 "functionality. For more complex cases you should look at the L<guestfish(1)"
26771 #: ../tools/virt-list-filesystems.pl:105
26773 "With this option, C<virt-list-filesystems> displays the type of each "
26774 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
26778 #: ../tools/virt-list-filesystems.pl:112
26779 msgid "B<-a> | B<--all>"
26783 #: ../tools/virt-list-filesystems.pl:114
26785 "Normally we only show mountable filesystems. If this option is given then "
26786 "swap devices are shown too."
26790 #: ../tools/virt-list-filesystems.pl:188
26792 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
26793 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
26794 ">, L<http://libguestfs.org/>."
26798 #: ../tools/virt-cat.pl:33
26799 msgid "virt-cat - Display a file in a virtual machine"
26803 #: ../tools/virt-cat.pl:37
26806 " virt-cat [--options] domname file\n"
26811 #: ../tools/virt-cat.pl:39
26814 " virt-cat [--options] disk.img [disk.img ...] file\n"
26819 #: ../tools/virt-cat.pl:43
26821 "C<virt-cat> is a command line tool to display the contents of C<file> where "
26822 "C<file> exists in the named virtual machine (or disk image)."
26826 #: ../tools/virt-cat.pl:46
26828 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
26829 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
26834 #: ../tools/virt-cat.pl:52
26836 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
26840 #: ../tools/virt-cat.pl:55
26843 " virt-cat mydomain /etc/fstab\n"
26848 #: ../tools/virt-cat.pl:57
26849 msgid "List syslog messages from a VM:"
26853 #: ../tools/virt-cat.pl:59
26856 " virt-cat mydomain /var/log/messages | tail\n"
26861 #: ../tools/virt-cat.pl:61
26862 msgid "Find out what DHCP IP address a VM acquired:"
26866 #: ../tools/virt-cat.pl:63
26869 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
26874 #: ../tools/virt-cat.pl:65
26875 msgid "Find out what packages were recently installed:"
26879 #: ../tools/virt-cat.pl:67
26882 " virt-cat mydomain /var/log/yum.log | tail\n"
26887 #: ../tools/virt-cat.pl:69
26888 msgid "Find out who is logged on inside a virtual machine:"
26892 #: ../tools/virt-cat.pl:71
26895 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
26901 #: ../tools/virt-cat.pl:74
26902 msgid "or who was logged on:"
26906 #: ../tools/virt-cat.pl:76
26909 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
26910 " last -f /tmp/wtmp\n"
26915 #: ../tools/virt-cat.pl:187
26917 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26918 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26922 #: ../tools/virt-tar.pl:33
26923 msgid "virt-tar - Extract or upload files to a virtual machine"
26927 #: ../tools/virt-tar.pl:37
26930 " virt-tar [--options] -x domname directory tarball\n"
26935 #: ../tools/virt-tar.pl:39
26938 " virt-tar [--options] -u domname tarball directory\n"
26943 #: ../tools/virt-tar.pl:41
26946 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
26951 #: ../tools/virt-tar.pl:43
26954 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
26959 #: ../tools/virt-tar.pl:47
26960 msgid "Download C</home> from the VM into a local tarball:"
26964 #: ../tools/virt-tar.pl:49
26967 " virt-tar -x domname /home home.tar\n"
26972 #: ../tools/virt-tar.pl:51
26975 " virt-tar -zx domname /home home.tar.gz\n"
26980 #: ../tools/virt-tar.pl:53
26981 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
26985 #: ../tools/virt-tar.pl:55
26988 " virt-tar -u domname uploadstuff.tar /tmp\n"
26993 #: ../tools/virt-tar.pl:57
26996 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
27001 #: ../tools/virt-tar.pl:61
27003 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
27004 "virtual machines. If you do this, you risk disk corruption in the VM. "
27005 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
27009 #: ../tools/virt-tar.pl:66
27011 "You can use C<-x> (extract) on live virtual machines, but you might get "
27012 "inconsistent results or errors if there is filesystem activity inside the "
27013 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
27014 "work, but the only way to guarantee consistent results is if the virtual "
27015 "machine is shut down."
27019 #: ../tools/virt-tar.pl:74
27021 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
27022 "parts of a guest filesystem. There are many possibilities: making backups, "
27023 "uploading data files, snooping on guest activity, fixing or customizing "
27028 #: ../tools/virt-tar.pl:79
27030 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
27031 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
27032 "should look at the L<guestfish(1)> tool."
27036 #: ../tools/virt-tar.pl:83
27038 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
27039 "its contents (recursively) from the virtual machine into a local tarball. "
27040 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
27041 "virtual machine. You cannot use these two options together."
27045 #: ../tools/virt-tar.pl:89
27047 "In addition, you may need to use the C<-z> (gZip) option to enable "
27048 "compression. When uploading, you have to specify C<-z> if the upload file "
27049 "is compressed because virt-tar won't detect this on its own."
27053 #: ../tools/virt-tar.pl:93
27055 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
27056 "example it cannot do PKZip files or bzip2 compression. If you want that "
27057 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
27058 "the L<libguestfs(3)> API)."
27062 #: ../tools/virt-tar.pl:151
27063 msgid "B<-x> | B<--extract> | B<--download>"
27067 #: ../tools/virt-tar.pl:153
27068 msgid "B<-u> | B<--upload>"
27072 #: ../tools/virt-tar.pl:155
27074 "Use C<-x> to extract (download) a directory from a virtual machine to a "
27079 #: ../tools/virt-tar.pl:158
27081 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
27082 "Please read the L</WARNING> section above before using this option."
27086 #: ../tools/virt-tar.pl:162
27087 msgid "You must specify exactly one of these options."
27091 #: ../tools/virt-tar.pl:168
27092 msgid "B<-z> | B<--gzip>"
27096 #: ../tools/virt-tar.pl:170
27097 msgid "Specify that the input or output tarball is gzip-compressed."
27101 #: ../tools/virt-tar.pl:283
27103 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
27104 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
27109 #: ../tools/virt-rescue.pl:33
27110 msgid "virt-rescue - Run a rescue shell on a virtual machine"
27114 #: ../tools/virt-rescue.pl:37
27117 " virt-rescue [--options] domname\n"
27122 #: ../tools/virt-rescue.pl:39
27125 " virt-rescue [--options] disk.img [disk.img ...]\n"
27130 #: ../tools/virt-rescue.pl:43
27132 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
27133 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
27134 "you from doing this, but doesn't catch all cases."
27138 #: ../tools/virt-rescue.pl:47
27140 "However if you use the I<--ro> (read only) option, then you can attach a "
27141 "shell to a live virtual machine. The results might be strange or "
27142 "inconsistent at times but you won't get disk corruption."
27146 #: ../tools/virt-rescue.pl:53
27148 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
27149 "need for a CD. virt-rescue gives you a rescue shell and some simple "
27150 "recovery tools which you can use to examine or rescue a virtual machine or "
27155 #: ../tools/virt-rescue.pl:58
27157 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
27158 "on disk image(s):"
27162 #: ../tools/virt-rescue.pl:61
27165 " virt-rescue GuestName\n"
27170 #: ../tools/virt-rescue.pl:63
27173 " virt-rescue --ro /path/to/disk.img\n"
27178 #: ../tools/virt-rescue.pl:65
27181 " virt-rescue /dev/sdc\n"
27186 #: ../tools/virt-rescue.pl:67
27187 msgid "For live VMs you I<must> use the --ro option."
27191 #: ../tools/virt-rescue.pl:69
27193 "When you run virt-rescue on a virtual machine or disk image, you are placed "
27194 "in an interactive bash shell where you can use many ordinary Linux "
27195 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
27196 "appliance. You must mount the virtual machine's filesystems by hand. There "
27197 "is an empty directory called C</sysroot> where you can mount filesystems."
27201 #: ../tools/virt-rescue.pl:76
27203 "In the example below, we list logical volumes, then choose one to mount "
27204 "under C</sysroot>:"
27208 #: ../tools/virt-rescue.pl:79
27212 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
27213 " lv_root vg_f11x64 -wi-a- 8.83G\n"
27214 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
27215 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
27216 " ><rescue> ls /sysroot\n"
27221 #: ../tools/virt-rescue.pl:86
27223 "If you don't know what filesystems are available on the virtual machine then "
27224 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
27228 #: ../tools/virt-rescue.pl:92
27230 "Virt-rescue can be used on I<any> disk image file or device, not just a "
27231 "virtual machine. For example you can use it on a blank file if you want to "
27232 "partition that file (although we would recommend using L<guestfish(1)> "
27233 "instead as it is more suitable for this purpose). You can even use virt-"
27234 "rescue on things like SD cards."
27238 #: ../tools/virt-rescue.pl:98
27240 "This tool is just designed for quick interactive hacking on a virtual "
27241 "machine. For more structured access to a virtual machine disk image, you "
27242 "should use L<guestfs(3)>. To get a structured shell that you can use to "
27243 "make scripted changes to guests, use L<guestfish(1)>."
27247 #: ../tools/virt-rescue.pl:127
27248 msgid "B<--append kernelopts>"
27252 #: ../tools/virt-rescue.pl:129
27253 msgid "Pass additional options to the rescue kernel."
27257 #: ../tools/virt-rescue.pl:164
27258 msgid "B<--memsize MB> | B<-m MB>"
27262 #: ../tools/virt-rescue.pl:166
27264 "Change the amount of memory allocated to the rescue system. The default is "
27265 "set by libguestfs and is small but adequate for running system tools. The "
27266 "occasional program might need more memory. The parameter is specified in "
27271 #: ../tools/virt-rescue.pl:175
27272 msgid "B<--network MB>"
27276 #: ../tools/virt-rescue.pl:177
27277 msgid "Enable QEMU user networking in the guest."
27281 #: ../tools/virt-rescue.pl:183
27282 msgid "B<--ro> | B<-r>"
27286 #: ../tools/virt-rescue.pl:185
27287 msgid "Open the image read-only."
27291 #: ../tools/virt-rescue.pl:197
27293 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
27294 "SELINUX> before using this option."
27298 #: ../tools/virt-rescue.pl:257
27300 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
27301 "ENVIRONMENT VARIABLES> for the complete list."
27305 #: ../tools/virt-rescue.pl:269
27307 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
27308 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27312 #: ../tools/virt-make-fs.pl:37
27313 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
27317 #: ../tools/virt-make-fs.pl:41
27320 " virt-make-fs [--options] input.tar output.img\n"
27325 #: ../tools/virt-make-fs.pl:43
27328 " virt-make-fs [--options] input.tar.gz output.img\n"
27333 #: ../tools/virt-make-fs.pl:45
27336 " virt-make-fs [--options] directory output.img\n"
27341 #: ../tools/virt-make-fs.pl:49
27343 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
27344 "archive or some files in a directory. It is similar to tools like L<mkisofs"
27345 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
27346 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
27347 "you want to attach these filesystems to existing virtual machines (eg. to "
27348 "import large amounts of read-only data to a VM)."
27352 #: ../tools/virt-make-fs.pl:57
27353 msgid "Basic usage is:"
27357 #: ../tools/virt-make-fs.pl:59
27360 " virt-make-fs input output\n"
27365 #: ../tools/virt-make-fs.pl:61
27367 "where C<input> is either a directory containing files that you want to add, "
27368 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
27369 "C<output> is a disk image. The input type is detected automatically. The "
27370 "output disk image defaults to a raw ext2 image unless you specify extra "
27371 "flags (see L</OPTIONS> below)."
27375 #: ../tools/virt-make-fs.pl:67
27376 msgid "EXTRA SPACE"
27380 #: ../tools/virt-make-fs.pl:69
27382 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
27383 "the files that it contains, but might have extra space. Depending on how "
27384 "you are going to use the output, you might think this extra space is wasted "
27385 "and want to minimize it, or you might want to leave space so that more files "
27386 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
27387 "but you can use the C<--size> flag to leave space in the filesystem if you "
27392 #: ../tools/virt-make-fs.pl:77
27394 "An alternative way to leave extra space but not make the output image any "
27395 "bigger is to use an alternative disk image format (instead of the default "
27396 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
27397 "image format (check your hypervisor supports this before using it). This "
27398 "allows you to choose a large C<--size> but the extra space won't actually be "
27399 "allocated in the image until you try to store something in it."
27403 #: ../tools/virt-make-fs.pl:85
27405 "Don't forget that you can also use local commands including L<resize2fs(8)> "
27406 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
27407 "resize to build another image from scratch."
27411 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
27412 #: ../tools/virt-make-fs.pl:142
27417 #: ../tools/virt-make-fs.pl:91
27420 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
27425 #: ../tools/virt-make-fs.pl:93
27426 msgid "FILESYSTEM TYPE"
27430 #: ../tools/virt-make-fs.pl:95
27432 "The default filesystem type is C<ext2>. Just about any filesystem type that "
27433 "libguestfs supports can be used (but I<not> read-only formats like "
27434 "ISO9660). Here are some of the more common choices:"
27438 #: ../tools/virt-make-fs.pl:101
27443 #: ../tools/virt-make-fs.pl:103
27445 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
27446 "you are not going to use the filesystem in a way that requires the journal, "
27447 "then this is just wasted overhead."
27451 #: ../tools/virt-make-fs.pl:107
27452 msgid "I<ntfs> or I<vfat>"
27456 #: ../tools/virt-make-fs.pl:109
27457 msgid "Useful if exporting data to a Windows guest."
27461 #: ../tools/virt-make-fs.pl:111
27463 "I<Note for vfat>: The tar archive or local directory must only contain files "
27464 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
27465 "program running within libguestfs is unable to change the ownership of non-"
27466 "root files, since vfat itself does not support this."
27470 #: ../tools/virt-make-fs.pl:116
27475 #: ../tools/virt-make-fs.pl:118
27477 "Lower overhead than C<ext2>, but certain limitations on filename length and "
27478 "total filesystem size."
27482 #: ../tools/virt-make-fs.pl:125
27485 " virt-make-fs --type=minix input minixfs.img\n"
27490 #: ../tools/virt-make-fs.pl:127
27491 msgid "TO PARTITION OR NOT TO PARTITION"
27495 #: ../tools/virt-make-fs.pl:129
27496 msgid "Optionally virt-make-fs can add a partition table to the output disk."
27500 #: ../tools/virt-make-fs.pl:131
27502 "Adding a partition can make the disk image more compatible with certain "
27503 "virtualized operating systems which don't expect to see a filesystem "
27504 "directly located on a block device (Linux doesn't care and will happily "
27505 "handle both types)."
27509 #: ../tools/virt-make-fs.pl:136
27511 "On the other hand, if you have a partition table then the output image is no "
27512 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
27513 "directly on a partitioned disk image. (However libguestfs tools such as "
27514 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
27518 #: ../tools/virt-make-fs.pl:144
27519 msgid "Add an MBR partition:"
27523 #: ../tools/virt-make-fs.pl:146
27526 " virt-make-fs --partition -- input disk.img\n"
27531 #: ../tools/virt-make-fs.pl:148
27533 "If the output disk image could be terabyte-sized or larger, it's better to "
27534 "use an EFI/GPT-compatible partition table:"
27538 #: ../tools/virt-make-fs.pl:151
27541 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
27546 #: ../tools/virt-make-fs.pl:179
27547 msgid "Enable debugging information."
27551 #: ../tools/virt-make-fs.pl:185
27552 msgid "B<--size=E<lt>NE<gt>>"
27556 #: ../tools/virt-make-fs.pl:187
27557 msgid "B<--size=+E<lt>NE<gt>>"
27561 #: ../tools/virt-make-fs.pl:189
27562 msgid "B<-s E<lt>NE<gt>>"
27566 #: ../tools/virt-make-fs.pl:191
27567 msgid "B<-s +E<lt>NE<gt>>"
27571 #: ../tools/virt-make-fs.pl:193
27573 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
27577 #: ../tools/virt-make-fs.pl:196
27579 "If this option is I<not> given, then the output image will be just large "
27580 "enough to contain all the files, with not much wasted space."
27584 #: ../tools/virt-make-fs.pl:199
27586 "To choose a fixed size output disk, specify an absolute number followed by b/"
27587 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27588 "Petabytes or Exabytes. This must be large enough to contain all the input "
27589 "files, else you will get an error."
27593 #: ../tools/virt-make-fs.pl:204
27595 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
27596 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27597 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
27598 "the input files, and (approximately) an extra 200 MB free space."
27602 #: ../tools/virt-make-fs.pl:210
27604 "Note that virt-make-fs estimates free space, and therefore will not produce "
27605 "filesystems containing precisely the free space requested. (It is much more "
27606 "expensive and time-consuming to produce a filesystem which has precisely the "
27607 "desired free space)."
27611 #: ../tools/virt-make-fs.pl:219
27612 msgid "B<--format=E<lt>fmtE<gt>>"
27616 #: ../tools/virt-make-fs.pl:221
27617 msgid "B<-F E<lt>fmtE<gt>>"
27621 #: ../tools/virt-make-fs.pl:223
27622 msgid "Choose the output disk image format."
27626 #: ../tools/virt-make-fs.pl:225
27627 msgid "The default is C<raw> (raw disk image)."
27631 #: ../tools/virt-make-fs.pl:227
27633 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
27634 "that would really make sense here is C<qcow2>."
27638 #: ../tools/virt-make-fs.pl:234
27639 msgid "B<--type=E<lt>fsE<gt>>"
27643 #: ../tools/virt-make-fs.pl:236
27644 msgid "B<-t E<lt>fsE<gt>>"
27648 #: ../tools/virt-make-fs.pl:238
27649 msgid "Choose the output filesystem type."
27653 #: ../tools/virt-make-fs.pl:240
27654 msgid "The default is C<ext2>."
27658 #: ../tools/virt-make-fs.pl:242
27660 "Any filesystem which is supported read-write by libguestfs can be used here."
27664 #: ../tools/virt-make-fs.pl:249
27665 msgid "B<--partition>"
27669 #: ../tools/virt-make-fs.pl:251
27670 msgid "B<--partition=E<lt>parttypeE<gt>>"
27674 #: ../tools/virt-make-fs.pl:253
27676 "If specified, this flag adds an MBR partition table to the output disk image."
27680 #: ../tools/virt-make-fs.pl:256
27682 "You can change the partition table type, eg. C<--partition=gpt> for large "
27687 #: ../tools/virt-make-fs.pl:259
27689 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
27690 "might consider the next parameter to be the partition type. For example:"
27694 #: ../tools/virt-make-fs.pl:263
27697 " virt-make-fs --partition input.tar ...\n"
27702 #: ../tools/virt-make-fs.pl:265
27704 "would cause virt-make-fs to think you wanted to use a partition type of "
27705 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
27706 "dash) between options and the input file argument:"
27710 #: ../tools/virt-make-fs.pl:269
27713 " virt-make-fs --partition -- input.tar ...\n"
27718 #: ../tools/virt-make-fs.pl:536
27720 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
27721 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
27722 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
27726 #: ../tools/virt-make-fs.pl:553
27729 " export LIBGUESTFS_DEBUG=1\n"
27730 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
27735 #: ../tools/virt-make-fs.pl:556
27737 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
27742 #: ../tools/virt-list-partitions.pl:32
27744 "virt-list-partitions - List partitions in a virtual machine or disk image"
27748 #: ../tools/virt-list-partitions.pl:36
27751 " virt-list-partitions [--options] domname\n"
27756 #: ../tools/virt-list-partitions.pl:38
27759 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
27764 #: ../tools/virt-list-partitions.pl:42
27766 "C<virt-list-partitions> is a command line tool to list the partitions that "
27767 "are contained in a virtual machine or disk image. It is mainly useful as a "
27768 "first step to using L<virt-resize(1)>."
27772 #: ../tools/virt-list-partitions.pl:47
27774 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
27775 "functionality. For more complex cases you should look at the L<guestfish(1)"
27780 #: ../tools/virt-list-partitions.pl:104
27781 msgid "B<-h> | B<--human-readable>"
27785 #: ../tools/virt-list-partitions.pl:106
27786 msgid "Show sizes in human-readable form (eg. \"1G\")."
27790 #: ../tools/virt-list-partitions.pl:114
27792 "With this option, C<virt-list-partitions> displays the type and size of each "
27793 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
27797 #: ../tools/virt-list-partitions.pl:121
27798 msgid "B<-t> | B<--total>"
27802 #: ../tools/virt-list-partitions.pl:123
27804 "Display the total size of each block device (as a separate row or rows)."
27808 #: ../tools/virt-list-partitions.pl:256
27810 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
27811 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
27812 "libguestfs.org/>."