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-10-29 15:47+0200\n"
11 "PO-Revision-Date: 2010-09-02 14:46+0100\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1
21 #: ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1
22 #: ../inspector/virt-inspector.pl: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:2541 ../src/guestfs-actions.pod:2553
3898 #: ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2678
3899 #: ../src/guestfs-actions.pod:2689 ../src/guestfs-actions.pod:2699
3900 #: ../src/guestfs-actions.pod:2710 ../src/guestfs-actions.pod:2722
3901 #: ../src/guestfs-actions.pod:2752 ../src/guestfs-actions.pod:2816
3902 #: ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2847
3903 #: ../src/guestfs-actions.pod:2867 ../src/guestfs-actions.pod:2887
3904 #: ../src/guestfs-actions.pod:2916 ../src/guestfs-actions.pod:2932
3905 #: ../src/guestfs-actions.pod:2948 ../src/guestfs-actions.pod:2977
3906 #: ../src/guestfs-actions.pod:2986 ../src/guestfs-actions.pod:3019
3907 #: ../src/guestfs-actions.pod:3032 ../src/guestfs-actions.pod:3042
3908 #: ../src/guestfs-actions.pod:3054 ../src/guestfs-actions.pod:3068
3909 #: ../src/guestfs-actions.pod:3148 ../src/guestfs-actions.pod:3165
3910 #: ../src/guestfs-actions.pod:3175 ../src/guestfs-actions.pod:3220
3911 #: ../src/guestfs-actions.pod:3235 ../src/guestfs-actions.pod:3250
3912 #: ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:3274
3913 #: ../src/guestfs-actions.pod:3285 ../src/guestfs-actions.pod:3299
3914 #: ../src/guestfs-actions.pod:3311 ../src/guestfs-actions.pod:3328
3915 #: ../src/guestfs-actions.pod:3374 ../src/guestfs-actions.pod:3402
3916 #: ../src/guestfs-actions.pod:3418 ../src/guestfs-actions.pod:3434
3917 #: ../src/guestfs-actions.pod:3443 ../src/guestfs-actions.pod:3457
3918 #: ../src/guestfs-actions.pod:3467 ../src/guestfs-actions.pod:3479
3919 #: ../src/guestfs-actions.pod:3491 ../src/guestfs-actions.pod:3523
3920 #: ../src/guestfs-actions.pod:3535 ../src/guestfs-actions.pod:3552
3921 #: ../src/guestfs-actions.pod:3563 ../src/guestfs-actions.pod:3577
3922 #: ../src/guestfs-actions.pod:3617 ../src/guestfs-actions.pod:3648
3923 #: ../src/guestfs-actions.pod:3659 ../src/guestfs-actions.pod:3684
3924 #: ../src/guestfs-actions.pod:3698 ../src/guestfs-actions.pod:3713
3925 #: ../src/guestfs-actions.pod:3835 ../src/guestfs-actions.pod:3887
3926 #: ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3921
3927 #: ../src/guestfs-actions.pod:3947 ../src/guestfs-actions.pod:4004
3928 #: ../src/guestfs-actions.pod:4018 ../src/guestfs-actions.pod:4028
3929 #: ../src/guestfs-actions.pod:4039 ../src/guestfs-actions.pod:4294
3930 #: ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4321
3931 #: ../src/guestfs-actions.pod:4330 ../src/guestfs-actions.pod:4341
3932 #: ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4361
3933 #: ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4392
3934 #: ../src/guestfs-actions.pod:4408 ../src/guestfs-actions.pod:4424
3935 #: ../src/guestfs-actions.pod:4439 ../src/guestfs-actions.pod:4459
3936 #: ../src/guestfs-actions.pod:4474 ../src/guestfs-actions.pod:4490
3937 #: ../src/guestfs-actions.pod:4508 ../src/guestfs-actions.pod:4524
3938 #: ../src/guestfs-actions.pod:4538 ../src/guestfs-actions.pod:4563
3939 #: ../src/guestfs-actions.pod:4584 ../src/guestfs-actions.pod:4600
3940 #: ../src/guestfs-actions.pod:4621 ../src/guestfs-actions.pod:4633
3941 #: ../src/guestfs-actions.pod:4645 ../src/guestfs-actions.pod:4661
3942 #: ../src/guestfs-actions.pod:4695 ../src/guestfs-actions.pod:4715
3943 #: ../src/guestfs-actions.pod:4738 ../src/guestfs-actions.pod:4828
3944 #: ../src/guestfs-actions.pod:4934 ../src/guestfs-actions.pod:4943
3945 #: ../src/guestfs-actions.pod:4953 ../src/guestfs-actions.pod:4963
3946 #: ../src/guestfs-actions.pod:4982 ../src/guestfs-actions.pod:4992
3947 #: ../src/guestfs-actions.pod:5002 ../src/guestfs-actions.pod:5012
3948 #: ../src/guestfs-actions.pod:5024 ../src/guestfs-actions.pod:5074
3949 #: ../src/guestfs-actions.pod:5088 ../src/guestfs-actions.pod:5101
3950 #: ../src/guestfs-actions.pod:5114 ../src/guestfs-actions.pod:5128
3951 #: ../src/guestfs-actions.pod:5138 ../src/guestfs-actions.pod:5155
3952 #: ../src/guestfs-actions.pod:5185 ../src/guestfs-actions.pod:5196
3953 #: ../src/guestfs-actions.pod:5231 ../src/guestfs-actions.pod:5241
3954 #: ../src/guestfs-actions.pod:5256 ../src/guestfs-actions.pod:5282
3955 #: ../src/guestfs-actions.pod:5310 ../src/guestfs-actions.pod:5414
3956 #: ../src/guestfs-actions.pod:5429 ../src/guestfs-actions.pod:5440
3957 #: ../src/guestfs-actions.pod:5486 ../src/guestfs-actions.pod:5496
3958 #: ../src/guestfs-actions.pod:5533 ../src/guestfs-actions.pod:5560
3959 #: ../src/guestfs-actions.pod:5602 ../src/guestfs-actions.pod:5625
3960 #: ../src/guestfs-actions.pod:5682 ../src/guestfs-actions.pod:5698
3961 #: ../src/guestfs-actions.pod:5724
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:5633 ../src/guestfs-actions.pod:5778
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:4349 ../fish/guestfish-actions.pod:4446
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:2229 ../src/guestfs-actions.pod:2247
4362 #: ../src/guestfs-actions.pod:3637 ../src/guestfs-actions.pod:3744
4363 #: ../src/guestfs-actions.pod:4098 ../src/guestfs-actions.pod:4121
4364 #: ../src/guestfs-actions.pod:5220 ../src/guestfs-actions.pod:5570
4365 #: ../src/guestfs-actions.pod:5580 ../src/guestfs-actions.pod:5590
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:2181 ../src/guestfs-actions.pod:2297
4402 #: ../src/guestfs-actions.pod:2332 ../src/guestfs-actions.pod:2352
4403 #: ../src/guestfs-actions.pod:2667 ../src/guestfs-actions.pod:2964
4404 #: ../src/guestfs-actions.pod:3105 ../src/guestfs-actions.pod:3201
4405 #: ../src/guestfs-actions.pod:3759 ../src/guestfs-actions.pod:3935
4406 #: ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4237
4407 #: ../src/guestfs-actions.pod:4280 ../src/guestfs-actions.pod:4756
4408 #: ../src/guestfs-actions.pod:4769 ../src/guestfs-actions.pod:4783
4409 #: ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:5363
4410 #: ../src/guestfs-actions.pod:5379 ../src/guestfs-actions.pod:5394
4411 #: ../src/guestfs-actions.pod:5542 ../src/guestfs-actions.pod:5772
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:2203 ../src/guestfs-actions.pod:2391
4614 #: ../src/guestfs-actions.pod:2596 ../src/guestfs-actions.pod:2652
4615 #: ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:3082
4616 #: ../src/guestfs-actions.pod:3604 ../src/guestfs-actions.pod:4053
4617 #: ../src/guestfs-actions.pod:4162 ../src/guestfs-actions.pod:4268
4618 #: ../src/guestfs-actions.pod:4817 ../src/guestfs-actions.pod:4866
4619 #: ../src/guestfs-actions.pod:4918 ../src/guestfs-actions.pod:5034
4620 #: ../src/guestfs-actions.pod:5055 ../src/guestfs-actions.pod:5455
4621 #: ../src/guestfs-actions.pod:5472 ../src/guestfs-actions.pod:5510
4622 #: ../src/guestfs-actions.pod:5646 ../src/guestfs-actions.pod:5662
4623 #: ../src/guestfs-actions.pod:5735 ../src/guestfs-actions.pod:5751
4624 #: ../src/guestfs-actions.pod:5791 ../src/guestfs-actions.pod:5807
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:2405 ../src/guestfs-actions.pod:2416
5009 #: ../src/guestfs-actions.pod:2428 ../src/guestfs-actions.pod:2439
5010 #: ../src/guestfs-actions.pod:2452 ../src/guestfs-actions.pod:2464
5011 #: ../src/guestfs-actions.pod:2477 ../src/guestfs-actions.pod:2488
5012 #: ../src/guestfs-actions.pod:2498 ../src/guestfs-actions.pod:2509
5013 #: ../src/guestfs-actions.pod:2521 ../src/guestfs-actions.pod:2533
5014 #: ../src/guestfs-actions.pod:3729
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:4152
5263 #: ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:3193
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:3969 ../src/guestfs-actions.pod:3992
5285 #: ../src/guestfs-actions.pod:4100 ../src/guestfs-actions.pod:4123
5286 #: ../src/guestfs-actions.pod:4144 ../src/guestfs-actions.pod:4870
5287 #: ../src/guestfs-actions.pod:4922 ../src/guestfs-actions.pod:5038
5288 #: ../src/guestfs-actions.pod:5059 ../src/guestfs-actions.pod:5604
5289 #: ../src/guestfs-actions.pod:5627 ../src/guestfs-actions.pod:5650
5290 #: ../src/guestfs-actions.pod:5666 ../src/guestfs-actions.pod:5739
5291 #: ../src/guestfs-actions.pod:5755 ../src/guestfs-actions.pod:5795
5292 #: ../src/guestfs-actions.pod:5811 ../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:3063
5300 #: ../fish/guestfish-actions.pod:3078 ../fish/guestfish-actions.pod:3154
5301 #: ../fish/guestfish-actions.pod:3171 ../fish/guestfish-actions.pod:3186
5302 #: ../fish/guestfish-actions.pod:3769 ../fish/guestfish-actions.pod:3815
5303 #: ../fish/guestfish-actions.pod:3900 ../fish/guestfish-actions.pod:3915
5304 #: ../fish/guestfish-actions.pod:4325 ../fish/guestfish-actions.pod:4343
5305 #: ../fish/guestfish-actions.pod:4360 ../fish/guestfish-actions.pod:4370
5306 #: ../fish/guestfish-actions.pod:4418 ../fish/guestfish-actions.pod:4428
5307 #: ../fish/guestfish-actions.pod:4457 ../fish/guestfish-actions.pod:4467
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:3297
5516 #: ../src/guestfs-actions.pod:3400 ../src/guestfs-actions.pod:3416
5517 #: ../src/guestfs-actions.pod:3432 ../fish/guestfish-actions.pod:635
5518 #: ../fish/guestfish-actions.pod:2553 ../fish/guestfish-actions.pod:2638
5519 #: ../fish/guestfish-actions.pod:2648 ../fish/guestfish-actions.pod:2658
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:2566
5546 #: ../fish/guestfish-actions.pod:643 ../fish/guestfish-actions.pod:2031
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:5684
5708 #: ../src/guestfs-actions.pod:5700
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:5252
5950 #: ../fish/guestfish-actions.pod:812 ../fish/guestfish-actions.pod:4073
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:4505 ../src/guestfs-actions.pod:4597
7032 #: ../fish/guestfish-actions.pod:1326 ../fish/guestfish-actions.pod:1377
7033 #: ../fish/guestfish-actions.pod:3480 ../fish/guestfish-actions.pod:3567
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:2414
7198 #: ../src/guestfs-actions.pod:2437 ../src/guestfs-actions.pod:2486
7199 #: ../src/guestfs-actions.pod:2507 ../fish/guestfish-actions.pod:1387
7200 #: ../fish/guestfish-actions.pod:1913 ../fish/guestfish-actions.pod:1931
7201 #: ../fish/guestfish-actions.pod:1969 ../fish/guestfish-actions.pod:1985
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:2581
7319 #: ../src/guestfs-actions.pod:3136
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:5053
7497 #: ../fish/guestfish-actions.pod:1502 ../fish/guestfish-actions.pod:3913
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:3965
7569 #: ../src/guestfs-actions.pod:3988 ../src/guestfs-actions.pod:4140
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:2189 ../src/guestfs-actions.pod:2212
7831 #: ../src/guestfs-actions.pod:2236 ../src/guestfs-actions.pod:2254
7832 #: ../src/guestfs-actions.pod:2284 ../src/guestfs-actions.pod:2305
7833 #: ../src/guestfs-actions.pod:2340
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:2179
7855 #: ../src/guestfs-actions.pod:2227 ../src/guestfs-actions.pod:2295
7856 #: ../src/guestfs-actions.pod:2330 ../src/guestfs-actions.pod:2350
7857 #: ../src/guestfs-actions.pod:2387 ../fish/guestfish-actions.pod:1656
7858 #: ../fish/guestfish-actions.pod:1718 ../fish/guestfish-actions.pod:1757
7859 #: ../fish/guestfish-actions.pod:1812 ../fish/guestfish-actions.pod:1843
7860 #: ../fish/guestfish-actions.pod:1859 ../fish/guestfish-actions.pod:1893
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
7941 msgid "\"redhat-based\""
7945 #: ../src/guestfs-actions.pod:2155 ../fish/guestfish-actions.pod:1694
7946 msgid "Some Red Hat-derived distro."
7950 #: ../src/guestfs-actions.pod:2157 ../fish/guestfish-actions.pod:1696
7955 #: ../src/guestfs-actions.pod:2159 ../fish/guestfish-actions.pod:1698
7956 msgid "Red Hat Enterprise Linux and some derivatives."
7960 #: ../src/guestfs-actions.pod:2161 ../src/guestfs-actions.pod:2317
7961 #: ../fish/guestfish-actions.pod:1700 ../fish/guestfish-actions.pod:1830
7966 #: ../src/guestfs-actions.pod:2163 ../fish/guestfish-actions.pod:1702
7968 "Windows does not have distributions. This string is returned if the OS type "
7973 #: ../src/guestfs-actions.pod:2166 ../fish/guestfish-actions.pod:1705
7978 #: ../src/guestfs-actions.pod:2168 ../fish/guestfish-actions.pod:1707
7983 #: ../src/guestfs-actions.pod:2170 ../src/guestfs-actions.pod:2321
7984 #: ../fish/guestfish-actions.pod:1709 ../fish/guestfish-actions.pod:1834
7989 #: ../src/guestfs-actions.pod:2172 ../fish/guestfish-actions.pod:1711
7990 msgid "The distro could not be determined."
7994 #: ../src/guestfs-actions.pod:2176 ../src/guestfs-actions.pod:2327
7995 #: ../fish/guestfish-actions.pod:1715 ../fish/guestfish-actions.pod:1840
7997 "Future versions of libguestfs may return other strings here. The caller "
7998 "should be prepared to handle any string."
8002 #: ../src/guestfs-actions.pod:2184
8003 msgid "guestfs_inspect_get_filesystems"
8007 #: ../src/guestfs-actions.pod:2186
8010 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8011 "\t\tconst char *root);\n"
8016 #: ../src/guestfs-actions.pod:2192 ../fish/guestfish-actions.pod:1727
8018 "This returns a list of all the filesystems that we think are associated with "
8019 "this operating system. This includes the root filesystem, other ordinary "
8020 "filesystems, and non-mounted devices like swap partitions."
8024 #: ../src/guestfs-actions.pod:2197 ../fish/guestfish-actions.pod:1732
8026 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8027 "to be shared between operating systems."
8031 #: ../src/guestfs-actions.pod:2200
8033 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8034 "C<guestfs_inspect_get_mountpoints>."
8038 #: ../src/guestfs-actions.pod:2207
8039 msgid "guestfs_inspect_get_major_version"
8043 #: ../src/guestfs-actions.pod:2209
8046 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
8047 "\t\tconst char *root);\n"
8052 #: ../src/guestfs-actions.pod:2215 ../fish/guestfish-actions.pod:1745
8054 "This returns the major version number of the inspected operating system."
8058 #: ../src/guestfs-actions.pod:2218 ../fish/guestfish-actions.pod:1748
8060 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8061 "popular public names used by the operating system. Notably the operating "
8062 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8063 "1). You can find out the real versions corresponding to releases of Windows "
8064 "by consulting Wikipedia or MSDN."
8068 #: ../src/guestfs-actions.pod:2225 ../src/guestfs-actions.pod:2242
8069 #: ../fish/guestfish-actions.pod:1755 ../fish/guestfish-actions.pod:1769
8070 msgid "If the version could not be determined, then C<0> is returned."
8074 #: ../src/guestfs-actions.pod:2231
8075 msgid "guestfs_inspect_get_minor_version"
8079 #: ../src/guestfs-actions.pod:2233
8082 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8083 "\t\tconst char *root);\n"
8088 #: ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1766
8090 "This returns the minor version number of the inspected operating system."
8094 #: ../src/guestfs-actions.pod:2244
8096 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8097 "C<guestfs_inspect_get_major_version>."
8101 #: ../src/guestfs-actions.pod:2249
8102 msgid "guestfs_inspect_get_mountpoints"
8106 #: ../src/guestfs-actions.pod:2251
8109 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
8110 "\t\tconst char *root);\n"
8115 #: ../src/guestfs-actions.pod:2257 ../fish/guestfish-actions.pod:1781
8117 "This returns a hash of where we think the filesystems associated with this "
8118 "operating system should be mounted. Callers should note that this is at "
8119 "best an educated guess made by reading configuration files such as C</etc/"
8124 #: ../src/guestfs-actions.pod:2262 ../fish/guestfish-actions.pod:1786
8126 "Each element in the returned hashtable has a key which is the path of the "
8127 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8128 "mounted there (eg. C</dev/sda1>)."
8132 #: ../src/guestfs-actions.pod:2267 ../fish/guestfish-actions.pod:1791
8134 "Non-mounted devices such as swap devices are I<not> returned in this list."
8138 #: ../src/guestfs-actions.pod:2270
8140 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8141 "C<guestfs_inspect_get_filesystems>."
8145 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2633
8146 #: ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:5170
8148 "This function returns a NULL-terminated array of strings, or NULL if there "
8149 "was an error. The array of strings will always have length C<2n+1>, where "
8150 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
8151 "caller must free the strings and the array after use>."
8155 #: ../src/guestfs-actions.pod:2279
8156 msgid "guestfs_inspect_get_product_name"
8160 #: ../src/guestfs-actions.pod:2281
8163 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
8164 "\t\tconst char *root);\n"
8169 #: ../src/guestfs-actions.pod:2287 ../fish/guestfish-actions.pod:1804
8171 "This returns the product name of the inspected operating system. The "
8172 "product name is generally some freeform string which can be displayed to the "
8173 "user, but should not be parsed by programs."
8177 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1809
8179 "If the product name could not be determined, then the string C<unknown> is "
8184 #: ../src/guestfs-actions.pod:2300
8185 msgid "guestfs_inspect_get_type"
8189 #: ../src/guestfs-actions.pod:2302
8192 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
8193 "\t\tconst char *root);\n"
8198 #: ../src/guestfs-actions.pod:2308 ../fish/guestfish-actions.pod:1821
8200 "This returns the type of the inspected operating system. Currently defined "
8205 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1826
8210 #: ../src/guestfs-actions.pod:2315 ../fish/guestfish-actions.pod:1828
8211 msgid "Any Linux-based operating system."
8215 #: ../src/guestfs-actions.pod:2319 ../fish/guestfish-actions.pod:1832
8216 msgid "Any Microsoft Windows operating system."
8220 #: ../src/guestfs-actions.pod:2323 ../fish/guestfish-actions.pod:1836
8221 msgid "The operating system type could not be determined."
8225 #: ../src/guestfs-actions.pod:2335
8226 msgid "guestfs_inspect_get_windows_systemroot"
8230 #: ../src/guestfs-actions.pod:2337
8233 " char *guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
8234 "\t\tconst char *root);\n"
8239 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1852
8241 "This returns the Windows systemroot of the inspected guest. The systemroot "
8242 "is a directory path such as C</WINDOWS>."
8246 #: ../src/guestfs-actions.pod:2346 ../fish/guestfish-actions.pod:1855
8248 "This call assumes that the guest is Windows and that the systemroot could be "
8249 "determined by inspection. If this is not the case then an error is returned."
8253 #: ../src/guestfs-actions.pod:2355
8254 msgid "guestfs_inspect_os"
8258 #: ../src/guestfs-actions.pod:2357
8261 " char **guestfs_inspect_os (guestfs_h *g);\n"
8266 #: ../src/guestfs-actions.pod:2359 ../fish/guestfish-actions.pod:1865
8268 "This function uses other libguestfs functions and certain heuristics to "
8269 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8270 "for operating systems."
8274 #: ../src/guestfs-actions.pod:2363 ../fish/guestfish-actions.pod:1869
8275 msgid "The list returned is empty if no operating systems were found."
8279 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1871
8281 "If one operating system was found, then this returns a list with a single "
8282 "element, which is the name of the root filesystem of this operating system. "
8283 "It is also possible for this function to return a list containing more than "
8284 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8285 "element being the root filesystem of one of the operating systems."
8289 #: ../src/guestfs-actions.pod:2372
8291 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
8292 "functions in order to query further information about each operating system, "
8293 "such as the name and version."
8297 #: ../src/guestfs-actions.pod:2377
8299 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
8300 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
8301 "the contents. This should be called with no disks currently mounted. The "
8302 "function may also use Augeas, so any existing Augeas handle will be closed."
8306 #: ../src/guestfs-actions.pod:2383 ../fish/guestfish-actions.pod:1889
8308 "This function cannot decrypt encrypted disks. The caller must do that first "
8309 "(supplying the necessary keys) if the disk is encrypted."
8313 #: ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2594
8314 #: ../src/guestfs-actions.pod:2650
8315 msgid "See also C<guestfs_list_filesystems>."
8319 #: ../src/guestfs-actions.pod:2395
8320 msgid "guestfs_is_blockdev"
8324 #: ../src/guestfs-actions.pod:2397
8327 " int guestfs_is_blockdev (guestfs_h *g,\n"
8328 "\t\tconst char *path);\n"
8333 #: ../src/guestfs-actions.pod:2400 ../fish/guestfish-actions.pod:1901
8335 "This returns C<true> if and only if there is a block device with the given "
8340 #: ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:2426
8341 #: ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:2462
8342 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2519
8343 #: ../src/guestfs-actions.pod:2531
8344 msgid "See also C<guestfs_stat>."
8348 #: ../src/guestfs-actions.pod:2407
8349 msgid "guestfs_is_busy"
8353 #: ../src/guestfs-actions.pod:2409
8356 " int guestfs_is_busy (guestfs_h *g);\n"
8361 #: ../src/guestfs-actions.pod:2411 ../fish/guestfish-actions.pod:1910
8363 "This returns true iff this handle is busy processing a command (in the "
8368 #: ../src/guestfs-actions.pod:2418
8369 msgid "guestfs_is_chardev"
8373 #: ../src/guestfs-actions.pod:2420
8376 " int guestfs_is_chardev (guestfs_h *g,\n"
8377 "\t\tconst char *path);\n"
8382 #: ../src/guestfs-actions.pod:2423 ../fish/guestfish-actions.pod:1919
8384 "This returns C<true> if and only if there is a character device with the "
8385 "given C<path> name."
8389 #: ../src/guestfs-actions.pod:2430
8390 msgid "guestfs_is_config"
8394 #: ../src/guestfs-actions.pod:2432
8397 " int guestfs_is_config (guestfs_h *g);\n"
8402 #: ../src/guestfs-actions.pod:2434 ../fish/guestfish-actions.pod:1928
8404 "This returns true iff this handle is being configured (in the C<CONFIG> "
8409 #: ../src/guestfs-actions.pod:2441
8410 msgid "guestfs_is_dir"
8414 #: ../src/guestfs-actions.pod:2443
8417 " int guestfs_is_dir (guestfs_h *g,\n"
8418 "\t\tconst char *path);\n"
8423 #: ../src/guestfs-actions.pod:2446 ../fish/guestfish-actions.pod:1937
8425 "This returns C<true> if and only if there is a directory with the given "
8426 "C<path> name. Note that it returns false for other objects like files."
8430 #: ../src/guestfs-actions.pod:2454
8431 msgid "guestfs_is_fifo"
8435 #: ../src/guestfs-actions.pod:2456
8438 " int guestfs_is_fifo (guestfs_h *g,\n"
8439 "\t\tconst char *path);\n"
8444 #: ../src/guestfs-actions.pod:2459 ../fish/guestfish-actions.pod:1947
8446 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8447 "given C<path> name."
8451 #: ../src/guestfs-actions.pod:2466
8452 msgid "guestfs_is_file"
8456 #: ../src/guestfs-actions.pod:2468
8459 " int guestfs_is_file (guestfs_h *g,\n"
8460 "\t\tconst char *path);\n"
8465 #: ../src/guestfs-actions.pod:2471 ../fish/guestfish-actions.pod:1956
8467 "This returns C<true> if and only if there is a regular file with the given "
8468 "C<path> name. Note that it returns false for other objects like directories."
8472 #: ../src/guestfs-actions.pod:2479
8473 msgid "guestfs_is_launching"
8477 #: ../src/guestfs-actions.pod:2481
8480 " int guestfs_is_launching (guestfs_h *g);\n"
8485 #: ../src/guestfs-actions.pod:2483 ../fish/guestfish-actions.pod:1966
8487 "This returns true iff this handle is launching the subprocess (in the "
8488 "C<LAUNCHING> state)."
8492 #: ../src/guestfs-actions.pod:2490
8493 msgid "guestfs_is_lv"
8497 #: ../src/guestfs-actions.pod:2492
8500 " int guestfs_is_lv (guestfs_h *g,\n"
8501 "\t\tconst char *device);\n"
8506 #: ../src/guestfs-actions.pod:2495 ../fish/guestfish-actions.pod:1975
8508 "This command tests whether C<device> is a logical volume, and returns true "
8509 "iff this is the case."
8513 #: ../src/guestfs-actions.pod:2500
8514 msgid "guestfs_is_ready"
8518 #: ../src/guestfs-actions.pod:2502
8521 " int guestfs_is_ready (guestfs_h *g);\n"
8526 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1982
8528 "This returns true iff this handle is ready to accept commands (in the "
8533 #: ../src/guestfs-actions.pod:2511
8534 msgid "guestfs_is_socket"
8538 #: ../src/guestfs-actions.pod:2513
8541 " int guestfs_is_socket (guestfs_h *g,\n"
8542 "\t\tconst char *path);\n"
8547 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1991
8549 "This returns C<true> if and only if there is a Unix domain socket with the "
8550 "given C<path> name."
8554 #: ../src/guestfs-actions.pod:2523
8555 msgid "guestfs_is_symlink"
8559 #: ../src/guestfs-actions.pod:2525
8562 " int guestfs_is_symlink (guestfs_h *g,\n"
8563 "\t\tconst char *path);\n"
8568 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:2000
8570 "This returns C<true> if and only if there is a symbolic link with the given "
8575 #: ../src/guestfs-actions.pod:2535
8576 msgid "guestfs_kill_subprocess"
8580 #: ../src/guestfs-actions.pod:2537
8583 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8588 #: ../src/guestfs-actions.pod:2539 ../fish/guestfish-actions.pod:2009
8589 msgid "This kills the qemu subprocess. You should never need to call this."
8593 #: ../src/guestfs-actions.pod:2543
8594 msgid "guestfs_launch"
8598 #: ../src/guestfs-actions.pod:2545
8601 " int guestfs_launch (guestfs_h *g);\n"
8606 #: ../src/guestfs-actions.pod:2547 ../fish/guestfish-actions.pod:2017
8608 "Internally libguestfs is implemented by running a virtual machine using "
8613 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:2020
8615 "You should call this after configuring the handle (eg. adding drives) but "
8616 "before performing any actions."
8620 #: ../src/guestfs-actions.pod:2555
8621 msgid "guestfs_lchown"
8625 #: ../src/guestfs-actions.pod:2557
8628 " int guestfs_lchown (guestfs_h *g,\n"
8631 "\t\tconst char *path);\n"
8636 #: ../src/guestfs-actions.pod:2562
8638 "Change the file owner to C<owner> and group to C<group>. This is like "
8639 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8640 "changed, not the target."
8644 #: ../src/guestfs-actions.pod:2572
8645 msgid "guestfs_lgetxattrs"
8649 #: ../src/guestfs-actions.pod:2574
8652 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8653 "\t\tconst char *path);\n"
8658 #: ../src/guestfs-actions.pod:2577
8660 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8661 "then it returns the extended attributes of the link itself."
8665 #: ../src/guestfs-actions.pod:2586
8666 msgid "guestfs_list_devices"
8670 #: ../src/guestfs-actions.pod:2588
8673 " char **guestfs_list_devices (guestfs_h *g);\n"
8678 #: ../src/guestfs-actions.pod:2590 ../fish/guestfish-actions.pod:2047
8679 msgid "List all the block devices."
8683 #: ../src/guestfs-actions.pod:2592 ../fish/guestfish-actions.pod:2049
8684 msgid "The full block device names are returned, eg. C</dev/sda>."
8688 #: ../src/guestfs-actions.pod:2600
8689 msgid "guestfs_list_filesystems"
8693 #: ../src/guestfs-actions.pod:2602
8696 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8701 #: ../src/guestfs-actions.pod:2604 ../fish/guestfish-actions.pod:2057
8703 "This inspection command looks for filesystems on partitions, block devices "
8704 "and logical volumes, returning a list of devices containing filesystems and "
8709 #: ../src/guestfs-actions.pod:2608 ../fish/guestfish-actions.pod:2061
8711 "The return value is a hash, where the keys are the devices containing "
8712 "filesystems, and the values are the filesystem types. For example:"
8716 #: ../src/guestfs-actions.pod:2612 ../fish/guestfish-actions.pod:2065
8719 " \"/dev/sda1\" => \"ntfs\"\n"
8720 " \"/dev/sda2\" => \"ext2\"\n"
8721 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8722 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8727 #: ../src/guestfs-actions.pod:2617 ../fish/guestfish-actions.pod:2070
8729 "The value can have the special value \"unknown\", meaning the content of the "
8730 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8734 #: ../src/guestfs-actions.pod:2621
8736 "This command runs other libguestfs commands, which might include "
8737 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8738 "soon after launch and only when nothing is mounted."
8742 #: ../src/guestfs-actions.pod:2625
8744 "Not all of the filesystems returned will be mountable. In particular, swap "
8745 "partitions are returned in the list. Also this command does not check that "
8746 "each filesystem found is valid and mountable, and some filesystems might be "
8747 "mountable but require special options. Filesystems may not all belong to a "
8748 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
8752 #: ../src/guestfs-actions.pod:2639
8753 msgid "guestfs_list_partitions"
8757 #: ../src/guestfs-actions.pod:2641
8760 " char **guestfs_list_partitions (guestfs_h *g);\n"
8765 #: ../src/guestfs-actions.pod:2643 ../fish/guestfish-actions.pod:2090
8766 msgid "List all the partitions detected on all block devices."
8770 #: ../src/guestfs-actions.pod:2645 ../fish/guestfish-actions.pod:2092
8771 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8775 #: ../src/guestfs-actions.pod:2647
8777 "This does not return logical volumes. For that you will need to call "
8782 #: ../src/guestfs-actions.pod:2656
8787 #: ../src/guestfs-actions.pod:2658
8790 " char *guestfs_ll (guestfs_h *g,\n"
8791 "\t\tconst char *directory);\n"
8796 #: ../src/guestfs-actions.pod:2661 ../fish/guestfish-actions.pod:2103
8798 "List the files in C<directory> (relative to the root directory, there is no "
8799 "cwd) in the format of 'ls -la'."
8803 #: ../src/guestfs-actions.pod:2664 ../fish/guestfish-actions.pod:2106
8805 "This command is mostly useful for interactive sessions. It is I<not> "
8806 "intended that you try to parse the output string."
8810 #: ../src/guestfs-actions.pod:2670
8815 #: ../src/guestfs-actions.pod:2672
8818 " int guestfs_ln (guestfs_h *g,\n"
8819 "\t\tconst char *target,\n"
8820 "\t\tconst char *linkname);\n"
8825 #: ../src/guestfs-actions.pod:2676 ../fish/guestfish-actions.pod:2113
8826 msgid "This command creates a hard link using the C<ln> command."
8830 #: ../src/guestfs-actions.pod:2680
8831 msgid "guestfs_ln_f"
8835 #: ../src/guestfs-actions.pod:2682
8838 " int guestfs_ln_f (guestfs_h *g,\n"
8839 "\t\tconst char *target,\n"
8840 "\t\tconst char *linkname);\n"
8845 #: ../src/guestfs-actions.pod:2686 ../fish/guestfish-actions.pod:2119
8847 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8848 "option removes the link (C<linkname>) if it exists already."
8852 #: ../src/guestfs-actions.pod:2691
8853 msgid "guestfs_ln_s"
8857 #: ../src/guestfs-actions.pod:2693
8860 " int guestfs_ln_s (guestfs_h *g,\n"
8861 "\t\tconst char *target,\n"
8862 "\t\tconst char *linkname);\n"
8867 #: ../src/guestfs-actions.pod:2697 ../fish/guestfish-actions.pod:2126
8868 msgid "This command creates a symbolic link using the C<ln -s> command."
8872 #: ../src/guestfs-actions.pod:2701
8873 msgid "guestfs_ln_sf"
8877 #: ../src/guestfs-actions.pod:2703
8880 " int guestfs_ln_sf (guestfs_h *g,\n"
8881 "\t\tconst char *target,\n"
8882 "\t\tconst char *linkname);\n"
8887 #: ../src/guestfs-actions.pod:2707 ../fish/guestfish-actions.pod:2132
8889 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8890 "option removes the link (C<linkname>) if it exists already."
8894 #: ../src/guestfs-actions.pod:2712
8895 msgid "guestfs_lremovexattr"
8899 #: ../src/guestfs-actions.pod:2714
8902 " int guestfs_lremovexattr (guestfs_h *g,\n"
8903 "\t\tconst char *xattr,\n"
8904 "\t\tconst char *path);\n"
8909 #: ../src/guestfs-actions.pod:2718
8911 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8912 "link, then it removes an extended attribute of the link itself."
8916 #: ../src/guestfs-actions.pod:2724
8921 #: ../src/guestfs-actions.pod:2726
8924 " char **guestfs_ls (guestfs_h *g,\n"
8925 "\t\tconst char *directory);\n"
8930 #: ../src/guestfs-actions.pod:2729 ../fish/guestfish-actions.pod:2147
8932 "List the files in C<directory> (relative to the root directory, there is no "
8933 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
8937 #: ../src/guestfs-actions.pod:2733
8939 "This command is mostly useful for interactive sessions. Programs should "
8940 "probably use C<guestfs_readdir> instead."
8944 #: ../src/guestfs-actions.pod:2740
8945 msgid "guestfs_lsetxattr"
8949 #: ../src/guestfs-actions.pod:2742
8952 " int guestfs_lsetxattr (guestfs_h *g,\n"
8953 "\t\tconst char *xattr,\n"
8954 "\t\tconst char *val,\n"
8956 "\t\tconst char *path);\n"
8961 #: ../src/guestfs-actions.pod:2748
8963 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8964 "then it sets an extended attribute of the link itself."
8968 #: ../src/guestfs-actions.pod:2754
8969 msgid "guestfs_lstat"
8973 #: ../src/guestfs-actions.pod:2756
8976 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8977 "\t\tconst char *path);\n"
8982 #: ../src/guestfs-actions.pod:2759 ../src/guestfs-actions.pod:4835
8983 #: ../fish/guestfish-actions.pod:2166 ../fish/guestfish-actions.pod:3748
8984 msgid "Returns file information for the given C<path>."
8988 #: ../src/guestfs-actions.pod:2761
8990 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8991 "link, then the link is stat-ed, not the file it refers to."
8995 #: ../src/guestfs-actions.pod:2765 ../fish/guestfish-actions.pod:2172
8996 msgid "This is the same as the C<lstat(2)> system call."
9000 #: ../src/guestfs-actions.pod:2767 ../src/guestfs-actions.pod:4839
9002 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
9003 "error. I<The caller must call C<guestfs_free_stat> after use>."
9007 #: ../src/guestfs-actions.pod:2771
9008 msgid "guestfs_lstatlist"
9012 #: ../src/guestfs-actions.pod:2773
9015 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
9016 "\t\tconst char *path,\n"
9017 "\t\tchar *const *names);\n"
9022 #: ../src/guestfs-actions.pod:2777
9024 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
9025 "files, where all files are in the directory C<path>. C<names> is the list "
9026 "of files from this directory."
9030 #: ../src/guestfs-actions.pod:2781 ../fish/guestfish-actions.pod:2182
9032 "On return you get a list of stat structs, with a one-to-one correspondence "
9033 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9034 "then the C<ino> field of that structure is set to C<-1>."
9038 #: ../src/guestfs-actions.pod:2786
9040 "This call is intended for programs that want to efficiently list a directory "
9041 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
9042 "for a similarly efficient call for getting extended attributes. Very long "
9043 "directory listings might cause the protocol message size to be exceeded, "
9044 "causing this call to fail. The caller must split up such requests into "
9045 "smaller groups of names."
9049 #: ../src/guestfs-actions.pod:2794
9051 "This function returns a C<struct guestfs_stat_list *> (see E<lt>guestfs-"
9052 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9053 "C<guestfs_free_stat_list> after use>."
9057 #: ../src/guestfs-actions.pod:2799
9058 msgid "guestfs_luks_add_key"
9062 #: ../src/guestfs-actions.pod:2801
9065 " int guestfs_luks_add_key (guestfs_h *g,\n"
9066 "\t\tconst char *device,\n"
9067 "\t\tconst char *key,\n"
9068 "\t\tconst char *newkey,\n"
9069 "\t\tint keyslot);\n"
9074 #: ../src/guestfs-actions.pod:2807 ../fish/guestfish-actions.pod:2199
9076 "This command adds a new key on LUKS device C<device>. C<key> is any "
9077 "existing key, and is used to access the device. C<newkey> is the new key to "
9078 "add. C<keyslot> is the key slot that will be replaced."
9082 #: ../src/guestfs-actions.pod:2812
9084 "Note that if C<keyslot> already contains a key, then this command will "
9085 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
9089 #: ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:2852
9090 #: ../src/guestfs-actions.pod:2872 ../src/guestfs-actions.pod:2889
9091 #: ../src/guestfs-actions.pod:2918 ../src/guestfs-actions.pod:2934
9093 "This function takes a key or passphrase parameter which could contain "
9094 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
9099 #: ../src/guestfs-actions.pod:2822
9100 msgid "guestfs_luks_close"
9104 #: ../src/guestfs-actions.pod:2824
9107 " int guestfs_luks_close (guestfs_h *g,\n"
9108 "\t\tconst char *device);\n"
9113 #: ../src/guestfs-actions.pod:2827
9115 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
9116 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
9117 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9118 "underlying block device."
9122 #: ../src/guestfs-actions.pod:2835
9123 msgid "guestfs_luks_format"
9127 #: ../src/guestfs-actions.pod:2837
9130 " int guestfs_luks_format (guestfs_h *g,\n"
9131 "\t\tconst char *device,\n"
9132 "\t\tconst char *key,\n"
9133 "\t\tint keyslot);\n"
9138 #: ../src/guestfs-actions.pod:2842 ../fish/guestfish-actions.pod:2225
9140 "This command erases existing data on C<device> and formats the device as a "
9141 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9142 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9146 #: ../src/guestfs-actions.pod:2849 ../src/guestfs-actions.pod:2869
9147 #: ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3715
9148 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4697
9149 #: ../src/guestfs-actions.pod:4717 ../src/guestfs-actions.pod:4740
9150 #: ../src/guestfs-actions.pod:5705 ../fish/guestfish-actions.pod:2233
9151 #: ../fish/guestfish-actions.pod:2246 ../fish/guestfish-actions.pod:2330
9152 #: ../fish/guestfish-actions.pod:2860 ../fish/guestfish-actions.pod:3367
9153 #: ../fish/guestfish-actions.pod:3647 ../fish/guestfish-actions.pod:3663
9154 #: ../fish/guestfish-actions.pod:3678 ../fish/guestfish-actions.pod:4393
9156 "B<This command is dangerous. Without careful use you can easily destroy all "
9161 #: ../src/guestfs-actions.pod:2856
9162 msgid "guestfs_luks_format_cipher"
9166 #: ../src/guestfs-actions.pod:2858
9169 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
9170 "\t\tconst char *device,\n"
9171 "\t\tconst char *key,\n"
9172 "\t\tint keyslot,\n"
9173 "\t\tconst char *cipher);\n"
9178 #: ../src/guestfs-actions.pod:2864
9180 "This command is the same as C<guestfs_luks_format> but it also allows you to "
9181 "set the C<cipher> used."
9185 #: ../src/guestfs-actions.pod:2876
9186 msgid "guestfs_luks_kill_slot"
9190 #: ../src/guestfs-actions.pod:2878
9193 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
9194 "\t\tconst char *device,\n"
9195 "\t\tconst char *key,\n"
9196 "\t\tint keyslot);\n"
9201 #: ../src/guestfs-actions.pod:2883 ../fish/guestfish-actions.pod:2253
9203 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9204 "device C<device>. C<key> must be one of the I<other> keys."
9208 #: ../src/guestfs-actions.pod:2893
9209 msgid "guestfs_luks_open"
9213 #: ../src/guestfs-actions.pod:2895
9216 " int guestfs_luks_open (guestfs_h *g,\n"
9217 "\t\tconst char *device,\n"
9218 "\t\tconst char *key,\n"
9219 "\t\tconst char *mapname);\n"
9224 #: ../src/guestfs-actions.pod:2900 ../fish/guestfish-actions.pod:2264
9226 "This command opens a block device which has been encrypted according to the "
9227 "Linux Unified Key Setup (LUKS) standard."
9231 #: ../src/guestfs-actions.pod:2903 ../fish/guestfish-actions.pod:2267
9232 msgid "C<device> is the encrypted block device or partition."
9236 #: ../src/guestfs-actions.pod:2905 ../fish/guestfish-actions.pod:2269
9238 "The caller must supply one of the keys associated with the LUKS block "
9239 "device, in the C<key> parameter."
9243 #: ../src/guestfs-actions.pod:2908 ../fish/guestfish-actions.pod:2272
9245 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9246 "writes to this block device are decrypted from and encrypted to the "
9247 "underlying C<device> respectively."
9251 #: ../src/guestfs-actions.pod:2912
9253 "If this block device contains LVM volume groups, then calling "
9254 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
9259 #: ../src/guestfs-actions.pod:2922
9260 msgid "guestfs_luks_open_ro"
9264 #: ../src/guestfs-actions.pod:2924
9267 " int guestfs_luks_open_ro (guestfs_h *g,\n"
9268 "\t\tconst char *device,\n"
9269 "\t\tconst char *key,\n"
9270 "\t\tconst char *mapname);\n"
9275 #: ../src/guestfs-actions.pod:2929
9277 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
9282 #: ../src/guestfs-actions.pod:2938
9283 msgid "guestfs_lvcreate"
9287 #: ../src/guestfs-actions.pod:2940
9290 " int guestfs_lvcreate (guestfs_h *g,\n"
9291 "\t\tconst char *logvol,\n"
9292 "\t\tconst char *volgroup,\n"
9293 "\t\tint mbytes);\n"
9298 #: ../src/guestfs-actions.pod:2945 ../fish/guestfish-actions.pod:2297
9300 "This creates an LVM logical volume called C<logvol> on the volume group "
9301 "C<volgroup>, with C<size> megabytes."
9305 #: ../src/guestfs-actions.pod:2950
9306 msgid "guestfs_lvm_canonical_lv_name"
9310 #: ../src/guestfs-actions.pod:2952
9313 " char *guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
9314 "\t\tconst char *lvname);\n"
9319 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2304
9321 "This converts alternative naming schemes for LVs that you might find to the "
9322 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
9327 #: ../src/guestfs-actions.pod:2959 ../fish/guestfish-actions.pod:2308
9329 "This command returns an error if the C<lvname> parameter does not refer to a "
9334 #: ../src/guestfs-actions.pod:2962
9335 msgid "See also C<guestfs_is_lv>."
9339 #: ../src/guestfs-actions.pod:2967
9340 msgid "guestfs_lvm_clear_filter"
9344 #: ../src/guestfs-actions.pod:2969
9347 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
9352 #: ../src/guestfs-actions.pod:2971
9354 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
9355 "see every block device."
9359 #: ../src/guestfs-actions.pod:2974 ../src/guestfs-actions.pod:3010
9360 #: ../fish/guestfish-actions.pod:2320 ../fish/guestfish-actions.pod:2351
9362 "This command also clears the LVM cache and performs a volume group scan."
9366 #: ../src/guestfs-actions.pod:2979
9367 msgid "guestfs_lvm_remove_all"
9371 #: ../src/guestfs-actions.pod:2981
9374 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
9379 #: ../src/guestfs-actions.pod:2983 ../fish/guestfish-actions.pod:2327
9381 "This command removes all LVM logical volumes, volume groups and physical "
9386 #: ../src/guestfs-actions.pod:2991
9387 msgid "guestfs_lvm_set_filter"
9391 #: ../src/guestfs-actions.pod:2993
9394 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
9395 "\t\tchar *const *devices);\n"
9400 #: ../src/guestfs-actions.pod:2996 ../fish/guestfish-actions.pod:2337
9402 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9403 "block devices in the list C<devices>, and will ignore all other attached "
9408 #: ../src/guestfs-actions.pod:3000 ../fish/guestfish-actions.pod:2341
9410 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9411 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9412 "there are two types of duplication possible: either cloned PVs/VGs which "
9413 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9414 "same name. In normal operation you cannot create this situation, but you "
9415 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9416 "inside the LVM metadata."
9420 #: ../src/guestfs-actions.pod:3013 ../fish/guestfish-actions.pod:2354
9421 msgid "You can filter whole block devices or individual partitions."
9425 #: ../src/guestfs-actions.pod:3015 ../fish/guestfish-actions.pod:2356
9427 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9428 "filesystem), even if you are not filtering out that VG."
9432 #: ../src/guestfs-actions.pod:3021
9433 msgid "guestfs_lvremove"
9437 #: ../src/guestfs-actions.pod:3023
9440 " int guestfs_lvremove (guestfs_h *g,\n"
9441 "\t\tconst char *device);\n"
9446 #: ../src/guestfs-actions.pod:3026 ../fish/guestfish-actions.pod:2364
9448 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9449 "LV, such as C</dev/VG/LV>."
9453 #: ../src/guestfs-actions.pod:3029 ../fish/guestfish-actions.pod:2367
9455 "You can also remove all LVs in a volume group by specifying the VG name, C</"
9460 #: ../src/guestfs-actions.pod:3034
9461 msgid "guestfs_lvrename"
9465 #: ../src/guestfs-actions.pod:3036
9468 " int guestfs_lvrename (guestfs_h *g,\n"
9469 "\t\tconst char *logvol,\n"
9470 "\t\tconst char *newlogvol);\n"
9475 #: ../src/guestfs-actions.pod:3040 ../fish/guestfish-actions.pod:2374
9476 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9480 #: ../src/guestfs-actions.pod:3044
9481 msgid "guestfs_lvresize"
9485 #: ../src/guestfs-actions.pod:3046
9488 " int guestfs_lvresize (guestfs_h *g,\n"
9489 "\t\tconst char *device,\n"
9490 "\t\tint mbytes);\n"
9495 #: ../src/guestfs-actions.pod:3050 ../fish/guestfish-actions.pod:2380
9497 "This resizes (expands or shrinks) an existing LVM logical volume to "
9498 "C<mbytes>. When reducing, data in the reduced part is lost."
9502 #: ../src/guestfs-actions.pod:3056
9503 msgid "guestfs_lvresize_free"
9507 #: ../src/guestfs-actions.pod:3058
9510 " int guestfs_lvresize_free (guestfs_h *g,\n"
9511 "\t\tconst char *lv,\n"
9512 "\t\tint percent);\n"
9517 #: ../src/guestfs-actions.pod:3062 ../fish/guestfish-actions.pod:2388
9519 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9520 "remaining free space in the volume group. Commonly you would call this with "
9521 "pc = 100 which expands the logical volume as much as possible, using all "
9522 "remaining free space in the volume group."
9526 #: ../src/guestfs-actions.pod:3070
9531 #: ../src/guestfs-actions.pod:3072
9534 " char **guestfs_lvs (guestfs_h *g);\n"
9539 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2398
9541 "List all the logical volumes detected. This is the equivalent of the L<lvs"
9546 #: ../src/guestfs-actions.pod:3077 ../fish/guestfish-actions.pod:2401
9548 "This returns a list of the logical volume device names (eg. C</dev/"
9549 "VolGroup00/LogVol00>)."
9553 #: ../src/guestfs-actions.pod:3080
9554 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
9558 #: ../src/guestfs-actions.pod:3086
9559 msgid "guestfs_lvs_full"
9563 #: ../src/guestfs-actions.pod:3088
9566 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
9571 #: ../src/guestfs-actions.pod:3090 ../fish/guestfish-actions.pod:2410
9573 "List all the logical volumes detected. This is the equivalent of the L<lvs"
9574 "(8)> command. The \"full\" version includes all fields."
9578 #: ../src/guestfs-actions.pod:3093
9580 "This function returns a C<struct guestfs_lvm_lv_list *> (see E<lt>guestfs-"
9581 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9582 "C<guestfs_free_lvm_lv_list> after use>."
9586 #: ../src/guestfs-actions.pod:3098
9587 msgid "guestfs_lvuuid"
9591 #: ../src/guestfs-actions.pod:3100
9594 " char *guestfs_lvuuid (guestfs_h *g,\n"
9595 "\t\tconst char *device);\n"
9600 #: ../src/guestfs-actions.pod:3103 ../fish/guestfish-actions.pod:2417
9601 msgid "This command returns the UUID of the LVM LV C<device>."
9605 #: ../src/guestfs-actions.pod:3108
9606 msgid "guestfs_lxattrlist"
9610 #: ../src/guestfs-actions.pod:3110
9613 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9614 "\t\tconst char *path,\n"
9615 "\t\tchar *const *names);\n"
9620 #: ../src/guestfs-actions.pod:3114 ../fish/guestfish-actions.pod:2423
9622 "This call allows you to get the extended attributes of multiple files, where "
9623 "all files are in the directory C<path>. C<names> is the list of files from "
9628 #: ../src/guestfs-actions.pod:3118 ../fish/guestfish-actions.pod:2427
9630 "On return you get a flat list of xattr structs which must be interpreted "
9631 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9632 "C<attrval> in this struct is zero-length to indicate there was an error "
9633 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9634 "number (the number of following attributes for this file, which could be C<"
9635 "\"0\">). Then after the first xattr struct are the zero or more attributes "
9636 "for the first named file. This repeats for the second and subsequent files."
9640 #: ../src/guestfs-actions.pod:3128
9642 "This call is intended for programs that want to efficiently list a directory "
9643 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9644 "a similarly efficient call for getting standard stats. Very long directory "
9645 "listings might cause the protocol message size to be exceeded, causing this "
9646 "call to fail. The caller must split up such requests into smaller groups of "
9651 #: ../src/guestfs-actions.pod:3141
9652 msgid "guestfs_mkdir"
9656 #: ../src/guestfs-actions.pod:3143
9659 " int guestfs_mkdir (guestfs_h *g,\n"
9660 "\t\tconst char *path);\n"
9665 #: ../src/guestfs-actions.pod:3146 ../fish/guestfish-actions.pod:2449
9666 msgid "Create a directory named C<path>."
9670 #: ../src/guestfs-actions.pod:3150
9671 msgid "guestfs_mkdir_mode"
9675 #: ../src/guestfs-actions.pod:3152
9678 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9679 "\t\tconst char *path,\n"
9685 #: ../src/guestfs-actions.pod:3156 ../fish/guestfish-actions.pod:2455
9687 "This command creates a directory, setting the initial permissions of the "
9688 "directory to C<mode>."
9692 #: ../src/guestfs-actions.pod:3159 ../fish/guestfish-actions.pod:2458
9694 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9695 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9700 #: ../src/guestfs-actions.pod:3163
9701 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9705 #: ../src/guestfs-actions.pod:3167
9706 msgid "guestfs_mkdir_p"
9710 #: ../src/guestfs-actions.pod:3169
9713 " int guestfs_mkdir_p (guestfs_h *g,\n"
9714 "\t\tconst char *path);\n"
9719 #: ../src/guestfs-actions.pod:3172 ../fish/guestfish-actions.pod:2468
9721 "Create a directory named C<path>, creating any parent directories as "
9722 "necessary. This is like the C<mkdir -p> shell command."
9726 #: ../src/guestfs-actions.pod:3177
9727 msgid "guestfs_mkdtemp"
9731 #: ../src/guestfs-actions.pod:3179
9734 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9735 "\t\tconst char *template);\n"
9740 #: ../src/guestfs-actions.pod:3182 ../fish/guestfish-actions.pod:2475
9742 "This command creates a temporary directory. The C<template> parameter "
9743 "should be a full pathname for the temporary directory name with the final "
9744 "six characters being \"XXXXXX\"."
9748 #: ../src/guestfs-actions.pod:3187 ../fish/guestfish-actions.pod:2480
9750 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9751 "being suitable for Windows filesystems."
9755 #: ../src/guestfs-actions.pod:3190 ../fish/guestfish-actions.pod:2483
9756 msgid "The name of the temporary directory that was created is returned."
9760 #: ../src/guestfs-actions.pod:3193 ../fish/guestfish-actions.pod:2486
9761 msgid "The temporary directory is created with mode 0700 and is owned by root."
9765 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2489
9767 "The caller is responsible for deleting the temporary directory and its "
9768 "contents after use."
9772 #: ../src/guestfs-actions.pod:3199 ../fish/guestfish-actions.pod:2492
9773 msgid "See also: L<mkdtemp(3)>"
9777 #: ../src/guestfs-actions.pod:3204
9778 msgid "guestfs_mke2fs_J"
9782 #: ../src/guestfs-actions.pod:3206
9785 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9786 "\t\tconst char *fstype,\n"
9787 "\t\tint blocksize,\n"
9788 "\t\tconst char *device,\n"
9789 "\t\tconst char *journal);\n"
9794 #: ../src/guestfs-actions.pod:3212 ../fish/guestfish-actions.pod:2498
9796 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9797 "C<journal>. It is equivalent to the command:"
9801 #: ../src/guestfs-actions.pod:3216 ../fish/guestfish-actions.pod:2502
9804 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9809 #: ../src/guestfs-actions.pod:3218
9810 msgid "See also C<guestfs_mke2journal>."
9814 #: ../src/guestfs-actions.pod:3222
9815 msgid "guestfs_mke2fs_JL"
9819 #: ../src/guestfs-actions.pod:3224
9822 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9823 "\t\tconst char *fstype,\n"
9824 "\t\tint blocksize,\n"
9825 "\t\tconst char *device,\n"
9826 "\t\tconst char *label);\n"
9831 #: ../src/guestfs-actions.pod:3230 ../fish/guestfish-actions.pod:2510
9833 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9834 "the journal labeled C<label>."
9838 #: ../src/guestfs-actions.pod:3233
9839 msgid "See also C<guestfs_mke2journal_L>."
9843 #: ../src/guestfs-actions.pod:3237
9844 msgid "guestfs_mke2fs_JU"
9848 #: ../src/guestfs-actions.pod:3239
9851 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9852 "\t\tconst char *fstype,\n"
9853 "\t\tint blocksize,\n"
9854 "\t\tconst char *device,\n"
9855 "\t\tconst char *uuid);\n"
9860 #: ../src/guestfs-actions.pod:3245 ../fish/guestfish-actions.pod:2519
9862 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9863 "the journal with UUID C<uuid>."
9867 #: ../src/guestfs-actions.pod:3248
9868 msgid "See also C<guestfs_mke2journal_U>."
9872 #: ../src/guestfs-actions.pod:3252
9873 msgid "guestfs_mke2journal"
9877 #: ../src/guestfs-actions.pod:3254
9880 " int guestfs_mke2journal (guestfs_h *g,\n"
9881 "\t\tint blocksize,\n"
9882 "\t\tconst char *device);\n"
9887 #: ../src/guestfs-actions.pod:3258 ../fish/guestfish-actions.pod:2528
9889 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9894 #: ../src/guestfs-actions.pod:3261 ../fish/guestfish-actions.pod:2531
9897 " mke2fs -O journal_dev -b blocksize device\n"
9902 #: ../src/guestfs-actions.pod:3265
9903 msgid "guestfs_mke2journal_L"
9907 #: ../src/guestfs-actions.pod:3267
9910 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9911 "\t\tint blocksize,\n"
9912 "\t\tconst char *label,\n"
9913 "\t\tconst char *device);\n"
9918 #: ../src/guestfs-actions.pod:3272 ../fish/guestfish-actions.pod:2537
9919 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9923 #: ../src/guestfs-actions.pod:3276
9924 msgid "guestfs_mke2journal_U"
9928 #: ../src/guestfs-actions.pod:3278
9931 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9932 "\t\tint blocksize,\n"
9933 "\t\tconst char *uuid,\n"
9934 "\t\tconst char *device);\n"
9939 #: ../src/guestfs-actions.pod:3283 ../fish/guestfish-actions.pod:2543
9940 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9944 #: ../src/guestfs-actions.pod:3287
9945 msgid "guestfs_mkfifo"
9949 #: ../src/guestfs-actions.pod:3289
9952 " int guestfs_mkfifo (guestfs_h *g,\n"
9954 "\t\tconst char *path);\n"
9959 #: ../src/guestfs-actions.pod:3293
9961 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9962 "is just a convenient wrapper around C<guestfs_mknod>."
9966 #: ../src/guestfs-actions.pod:3301
9967 msgid "guestfs_mkfs"
9971 #: ../src/guestfs-actions.pod:3303
9974 " int guestfs_mkfs (guestfs_h *g,\n"
9975 "\t\tconst char *fstype,\n"
9976 "\t\tconst char *device);\n"
9981 #: ../src/guestfs-actions.pod:3307 ../fish/guestfish-actions.pod:2559
9983 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9984 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9988 #: ../src/guestfs-actions.pod:3313
9989 msgid "guestfs_mkfs_b"
9993 #: ../src/guestfs-actions.pod:3315
9996 " int guestfs_mkfs_b (guestfs_h *g,\n"
9997 "\t\tconst char *fstype,\n"
9998 "\t\tint blocksize,\n"
9999 "\t\tconst char *device);\n"
10004 #: ../src/guestfs-actions.pod:3320
10006 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
10007 "block size of the resulting filesystem. Supported block sizes depend on the "
10008 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10012 #: ../src/guestfs-actions.pod:3325 ../fish/guestfish-actions.pod:2572
10014 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10019 #: ../src/guestfs-actions.pod:3330
10020 msgid "guestfs_mkmountpoint"
10024 #: ../src/guestfs-actions.pod:3332
10027 " int guestfs_mkmountpoint (guestfs_h *g,\n"
10028 "\t\tconst char *exemptpath);\n"
10033 #: ../src/guestfs-actions.pod:3335
10035 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
10036 "that can be used to create extra mountpoints before mounting the first "
10041 #: ../src/guestfs-actions.pod:3339 ../fish/guestfish-actions.pod:2583
10043 "These calls are I<only> necessary in some very limited circumstances, mainly "
10044 "the case where you want to mount a mix of unrelated and/or read-only "
10045 "filesystems together."
10049 #: ../src/guestfs-actions.pod:3343 ../fish/guestfish-actions.pod:2587
10051 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10052 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10053 "inside that. You can unpack this as follows in guestfish:"
10057 #: ../src/guestfs-actions.pod:3348 ../fish/guestfish-actions.pod:2592
10060 " add-ro Fedora-11-i686-Live.iso\n"
10062 " mkmountpoint /cd\n"
10063 " mkmountpoint /sqsh\n"
10064 " mkmountpoint /ext3fs\n"
10065 " mount /dev/sda /cd\n"
10066 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10067 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10072 #: ../src/guestfs-actions.pod:3357 ../fish/guestfish-actions.pod:2601
10073 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10077 #: ../src/guestfs-actions.pod:3359
10079 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
10080 "may get unexpected errors if you try to mix these calls. It is safest to "
10081 "manually unmount filesystems and remove mountpoints after use."
10085 #: ../src/guestfs-actions.pod:3363
10087 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
10088 "first, so for this to work for manual mountpoints, you must ensure that the "
10089 "innermost mountpoints have the longest pathnames, as in the example code "
10094 #: ../src/guestfs-actions.pod:3368 ../fish/guestfish-actions.pod:2612
10096 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10100 #: ../src/guestfs-actions.pod:3370
10102 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
10103 "means that C<guestfs_umount_all> is called when the handle is closed which "
10104 "can also trigger these issues."
10108 #: ../src/guestfs-actions.pod:3376
10109 msgid "guestfs_mknod"
10113 #: ../src/guestfs-actions.pod:3378
10116 " int guestfs_mknod (guestfs_h *g,\n"
10118 "\t\tint devmajor,\n"
10119 "\t\tint devminor,\n"
10120 "\t\tconst char *path);\n"
10125 #: ../src/guestfs-actions.pod:3384 ../fish/guestfish-actions.pod:2622
10127 "This call creates block or character special devices, or named pipes (FIFOs)."
10131 #: ../src/guestfs-actions.pod:3387 ../fish/guestfish-actions.pod:2625
10133 "The C<mode> parameter should be the mode, using the standard constants. "
10134 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10135 "used when creating block and character special devices."
10139 #: ../src/guestfs-actions.pod:3392
10141 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10142 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10143 "regular file). These constants are available in the standard Linux header "
10144 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
10145 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
10146 "the appropriate constant for you."
10150 #: ../src/guestfs-actions.pod:3404
10151 msgid "guestfs_mknod_b"
10155 #: ../src/guestfs-actions.pod:3406
10158 " int guestfs_mknod_b (guestfs_h *g,\n"
10160 "\t\tint devmajor,\n"
10161 "\t\tint devminor,\n"
10162 "\t\tconst char *path);\n"
10167 #: ../src/guestfs-actions.pod:3412
10169 "This call creates a block device node called C<path> with mode C<mode> and "
10170 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10171 "wrapper around C<guestfs_mknod>."
10175 #: ../src/guestfs-actions.pod:3420
10176 msgid "guestfs_mknod_c"
10180 #: ../src/guestfs-actions.pod:3422
10183 " int guestfs_mknod_c (guestfs_h *g,\n"
10185 "\t\tint devmajor,\n"
10186 "\t\tint devminor,\n"
10187 "\t\tconst char *path);\n"
10192 #: ../src/guestfs-actions.pod:3428
10194 "This call creates a char device node called C<path> with mode C<mode> and "
10195 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10196 "wrapper around C<guestfs_mknod>."
10200 #: ../src/guestfs-actions.pod:3436
10201 msgid "guestfs_mkswap"
10205 #: ../src/guestfs-actions.pod:3438
10208 " int guestfs_mkswap (guestfs_h *g,\n"
10209 "\t\tconst char *device);\n"
10214 #: ../src/guestfs-actions.pod:3441 ../fish/guestfish-actions.pod:2664
10215 msgid "Create a swap partition on C<device>."
10219 #: ../src/guestfs-actions.pod:3445
10220 msgid "guestfs_mkswap_L"
10224 #: ../src/guestfs-actions.pod:3447
10227 " int guestfs_mkswap_L (guestfs_h *g,\n"
10228 "\t\tconst char *label,\n"
10229 "\t\tconst char *device);\n"
10234 #: ../src/guestfs-actions.pod:3451 ../fish/guestfish-actions.pod:2670
10235 msgid "Create a swap partition on C<device> with label C<label>."
10239 #: ../src/guestfs-actions.pod:3453 ../fish/guestfish-actions.pod:2672
10241 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
10242 "sda>), just to a partition. This appears to be a limitation of the kernel "
10247 #: ../src/guestfs-actions.pod:3459
10248 msgid "guestfs_mkswap_U"
10252 #: ../src/guestfs-actions.pod:3461
10255 " int guestfs_mkswap_U (guestfs_h *g,\n"
10256 "\t\tconst char *uuid,\n"
10257 "\t\tconst char *device);\n"
10262 #: ../src/guestfs-actions.pod:3465 ../fish/guestfish-actions.pod:2680
10263 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10267 #: ../src/guestfs-actions.pod:3469
10268 msgid "guestfs_mkswap_file"
10272 #: ../src/guestfs-actions.pod:3471
10275 " int guestfs_mkswap_file (guestfs_h *g,\n"
10276 "\t\tconst char *path);\n"
10281 #: ../src/guestfs-actions.pod:3474 ../fish/guestfish-actions.pod:2686
10282 msgid "Create a swap file."
10286 #: ../src/guestfs-actions.pod:3476
10288 "This command just writes a swap file signature to an existing file. To "
10289 "create the file itself, use something like C<guestfs_fallocate>."
10293 #: ../src/guestfs-actions.pod:3481
10294 msgid "guestfs_modprobe"
10298 #: ../src/guestfs-actions.pod:3483
10301 " int guestfs_modprobe (guestfs_h *g,\n"
10302 "\t\tconst char *modulename);\n"
10307 #: ../src/guestfs-actions.pod:3486 ../fish/guestfish-actions.pod:2695
10308 msgid "This loads a kernel module in the appliance."
10312 #: ../src/guestfs-actions.pod:3488 ../fish/guestfish-actions.pod:2697
10314 "The kernel module must have been whitelisted when libguestfs was built (see "
10315 "C<appliance/kmod.whitelist.in> in the source)."
10319 #: ../src/guestfs-actions.pod:3493
10320 msgid "guestfs_mount"
10324 #: ../src/guestfs-actions.pod:3495
10327 " int guestfs_mount (guestfs_h *g,\n"
10328 "\t\tconst char *device,\n"
10329 "\t\tconst char *mountpoint);\n"
10334 #: ../src/guestfs-actions.pod:3499 ../fish/guestfish-actions.pod:2704
10336 "Mount a guest disk at a position in the filesystem. Block devices are named "
10337 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10338 "those block devices contain partitions, they will have the usual names (eg. "
10339 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10343 #: ../src/guestfs-actions.pod:3505 ../fish/guestfish-actions.pod:2710
10345 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10346 "mounted on C</> before others can be mounted. Other filesystems can only be "
10347 "mounted on directories which already exist."
10351 #: ../src/guestfs-actions.pod:3510 ../fish/guestfish-actions.pod:2715
10353 "The mounted filesystem is writable, if we have sufficient permissions on the "
10354 "underlying device."
10358 #: ../src/guestfs-actions.pod:3513
10360 "B<Important note:> When you use this call, the filesystem options C<sync> "
10361 "and C<noatime> are set implicitly. This was originally done because we "
10362 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10363 "very large negative performance impact and negligible effect on "
10364 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
10365 "in any code that needs performance, and instead use C<guestfs_mount_options> "
10366 "(use an empty string for the first parameter if you don't want any options)."
10370 #: ../src/guestfs-actions.pod:3525
10371 msgid "guestfs_mount_loop"
10375 #: ../src/guestfs-actions.pod:3527
10378 " int guestfs_mount_loop (guestfs_h *g,\n"
10379 "\t\tconst char *file,\n"
10380 "\t\tconst char *mountpoint);\n"
10385 #: ../src/guestfs-actions.pod:3531 ../fish/guestfish-actions.pod:2732
10387 "This command lets you mount C<file> (a filesystem image in a file) on a "
10388 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10393 #: ../src/guestfs-actions.pod:3537
10394 msgid "guestfs_mount_options"
10398 #: ../src/guestfs-actions.pod:3539
10401 " int guestfs_mount_options (guestfs_h *g,\n"
10402 "\t\tconst char *options,\n"
10403 "\t\tconst char *device,\n"
10404 "\t\tconst char *mountpoint);\n"
10409 #: ../src/guestfs-actions.pod:3544
10411 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10412 "the mount options as for the L<mount(8)> I<-o> flag."
10416 #: ../src/guestfs-actions.pod:3548 ../fish/guestfish-actions.pod:2744
10418 "If the C<options> parameter is an empty string, then no options are passed "
10419 "(all options default to whatever the filesystem uses)."
10423 #: ../src/guestfs-actions.pod:3554
10424 msgid "guestfs_mount_ro"
10428 #: ../src/guestfs-actions.pod:3556
10431 " int guestfs_mount_ro (guestfs_h *g,\n"
10432 "\t\tconst char *device,\n"
10433 "\t\tconst char *mountpoint);\n"
10438 #: ../src/guestfs-actions.pod:3560
10440 "This is the same as the C<guestfs_mount> command, but it mounts the "
10441 "filesystem with the read-only (I<-o ro>) flag."
10445 #: ../src/guestfs-actions.pod:3565
10446 msgid "guestfs_mount_vfs"
10450 #: ../src/guestfs-actions.pod:3567
10453 " int guestfs_mount_vfs (guestfs_h *g,\n"
10454 "\t\tconst char *options,\n"
10455 "\t\tconst char *vfstype,\n"
10456 "\t\tconst char *device,\n"
10457 "\t\tconst char *mountpoint);\n"
10462 #: ../src/guestfs-actions.pod:3573
10464 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10465 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
10470 #: ../src/guestfs-actions.pod:3579
10471 msgid "guestfs_mountpoints"
10475 #: ../src/guestfs-actions.pod:3581
10478 " char **guestfs_mountpoints (guestfs_h *g);\n"
10483 #: ../src/guestfs-actions.pod:3583
10485 "This call is similar to C<guestfs_mounts>. That call returns a list of "
10486 "devices. This one returns a hash table (map) of device name to directory "
10487 "where the device is mounted."
10491 #: ../src/guestfs-actions.pod:3593
10492 msgid "guestfs_mounts"
10496 #: ../src/guestfs-actions.pod:3595
10499 " char **guestfs_mounts (guestfs_h *g);\n"
10504 #: ../src/guestfs-actions.pod:3597 ../fish/guestfish-actions.pod:2775
10506 "This returns the list of currently mounted filesystems. It returns the list "
10507 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10511 #: ../src/guestfs-actions.pod:3600 ../fish/guestfish-actions.pod:2778
10512 msgid "Some internal mounts are not shown."
10516 #: ../src/guestfs-actions.pod:3602
10517 msgid "See also: C<guestfs_mountpoints>"
10521 #: ../src/guestfs-actions.pod:3608
10526 #: ../src/guestfs-actions.pod:3610
10529 " int guestfs_mv (guestfs_h *g,\n"
10530 "\t\tconst char *src,\n"
10531 "\t\tconst char *dest);\n"
10536 #: ../src/guestfs-actions.pod:3614 ../fish/guestfish-actions.pod:2786
10538 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10539 "destination filename or destination directory."
10543 #: ../src/guestfs-actions.pod:3619
10544 msgid "guestfs_ntfs_3g_probe"
10548 #: ../src/guestfs-actions.pod:3621
10551 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
10553 "\t\tconst char *device);\n"
10558 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2793
10560 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10561 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
10562 "write, and some cannot be mounted at all)."
10566 #: ../src/guestfs-actions.pod:3629 ../fish/guestfish-actions.pod:2797
10568 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10569 "can be mounted read-write. Set it to false if you want to test if the "
10570 "volume can be mounted read-only."
10574 #: ../src/guestfs-actions.pod:3633 ../fish/guestfish-actions.pod:2801
10576 "The return value is an integer which C<0> if the operation would succeed, or "
10577 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10581 #: ../src/guestfs-actions.pod:3639
10582 msgid "guestfs_ntfsresize"
10586 #: ../src/guestfs-actions.pod:3641
10589 " int guestfs_ntfsresize (guestfs_h *g,\n"
10590 "\t\tconst char *device);\n"
10595 #: ../src/guestfs-actions.pod:3644 ../fish/guestfish-actions.pod:2809
10597 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10598 "size of the underlying device. See also L<ntfsresize(8)>."
10602 #: ../src/guestfs-actions.pod:3650
10603 msgid "guestfs_ntfsresize_size"
10607 #: ../src/guestfs-actions.pod:3652
10610 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
10611 "\t\tconst char *device,\n"
10612 "\t\tint64_t size);\n"
10617 #: ../src/guestfs-actions.pod:3656
10619 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10620 "to specify the new size (in bytes) explicitly."
10624 #: ../src/guestfs-actions.pod:3661
10625 msgid "guestfs_part_add"
10629 #: ../src/guestfs-actions.pod:3663
10632 " int guestfs_part_add (guestfs_h *g,\n"
10633 "\t\tconst char *device,\n"
10634 "\t\tconst char *prlogex,\n"
10635 "\t\tint64_t startsect,\n"
10636 "\t\tint64_t endsect);\n"
10641 #: ../src/guestfs-actions.pod:3669
10643 "This command adds a partition to C<device>. If there is no partition table "
10644 "on the device, call C<guestfs_part_init> first."
10648 #: ../src/guestfs-actions.pod:3672 ../fish/guestfish-actions.pod:2827
10650 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10651 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10652 "C<logical>) and C<e> (or C<extended>) partition types."
10656 #: ../src/guestfs-actions.pod:3677 ../fish/guestfish-actions.pod:2832
10658 "C<startsect> and C<endsect> are the start and end of the partition in "
10659 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10660 "from the end of the disk (C<-1> is the last sector)."
10664 #: ../src/guestfs-actions.pod:3681
10666 "Creating a partition which covers the whole disk is not so easy. Use "
10667 "C<guestfs_part_disk> to do that."
10671 #: ../src/guestfs-actions.pod:3686
10672 msgid "guestfs_part_del"
10676 #: ../src/guestfs-actions.pod:3688
10679 " int guestfs_part_del (guestfs_h *g,\n"
10680 "\t\tconst char *device,\n"
10681 "\t\tint partnum);\n"
10686 #: ../src/guestfs-actions.pod:3692 ../fish/guestfish-actions.pod:2843
10687 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10691 #: ../src/guestfs-actions.pod:3694 ../fish/guestfish-actions.pod:2845
10693 "Note that in the case of MBR partitioning, deleting an extended partition "
10694 "also deletes any logical partitions it contains."
10698 #: ../src/guestfs-actions.pod:3700
10699 msgid "guestfs_part_disk"
10703 #: ../src/guestfs-actions.pod:3702
10706 " int guestfs_part_disk (guestfs_h *g,\n"
10707 "\t\tconst char *device,\n"
10708 "\t\tconst char *parttype);\n"
10713 #: ../src/guestfs-actions.pod:3706
10715 "This command is simply a combination of C<guestfs_part_init> followed by "
10716 "C<guestfs_part_add> to create a single primary partition covering the whole "
10721 #: ../src/guestfs-actions.pod:3710
10723 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10724 "possible values are described in C<guestfs_part_init>."
10728 #: ../src/guestfs-actions.pod:3718
10729 msgid "guestfs_part_get_bootable"
10733 #: ../src/guestfs-actions.pod:3720
10736 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10737 "\t\tconst char *device,\n"
10738 "\t\tint partnum);\n"
10743 #: ../src/guestfs-actions.pod:3724 ../fish/guestfish-actions.pod:2867
10745 "This command returns true if the partition C<partnum> on C<device> has the "
10746 "bootable flag set."
10750 #: ../src/guestfs-actions.pod:3727
10751 msgid "See also C<guestfs_part_set_bootable>."
10755 #: ../src/guestfs-actions.pod:3731
10756 msgid "guestfs_part_get_mbr_id"
10760 #: ../src/guestfs-actions.pod:3733
10763 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10764 "\t\tconst char *device,\n"
10765 "\t\tint partnum);\n"
10770 #: ../src/guestfs-actions.pod:3737 ../fish/guestfish-actions.pod:2876
10772 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10773 "partition C<partnum>."
10777 #: ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:3902
10779 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10780 "undefined results for other partition table types (see "
10781 "C<guestfs_part_get_parttype>)."
10785 #: ../src/guestfs-actions.pod:3746
10786 msgid "guestfs_part_get_parttype"
10790 #: ../src/guestfs-actions.pod:3748
10793 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10794 "\t\tconst char *device);\n"
10799 #: ../src/guestfs-actions.pod:3751 ../fish/guestfish-actions.pod:2887
10801 "This command examines the partition table on C<device> and returns the "
10802 "partition table type (format) being used."
10806 #: ../src/guestfs-actions.pod:3754
10808 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10809 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10810 "possible, although unusual. See C<guestfs_part_init> for a full list."
10814 #: ../src/guestfs-actions.pod:3762
10815 msgid "guestfs_part_init"
10819 #: ../src/guestfs-actions.pod:3764
10822 " int guestfs_part_init (guestfs_h *g,\n"
10823 "\t\tconst char *device,\n"
10824 "\t\tconst char *parttype);\n"
10829 #: ../src/guestfs-actions.pod:3768 ../fish/guestfish-actions.pod:2899
10831 "This creates an empty partition table on C<device> of one of the partition "
10832 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10833 "(for large disks)."
10837 #: ../src/guestfs-actions.pod:3772
10839 "Initially there are no partitions. Following this, you should call "
10840 "C<guestfs_part_add> for each partition required."
10844 #: ../src/guestfs-actions.pod:3775 ../fish/guestfish-actions.pod:2906
10845 msgid "Possible values for C<parttype> are:"
10849 #: ../src/guestfs-actions.pod:3779 ../fish/guestfish-actions.pod:2910
10850 msgid "B<efi> | B<gpt>"
10854 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2912
10855 msgid "Intel EFI / GPT partition table."
10859 #: ../src/guestfs-actions.pod:3783 ../fish/guestfish-actions.pod:2914
10861 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10862 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10863 "the C<mbr> format."
10867 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2918
10868 msgid "B<mbr> | B<msdos>"
10872 #: ../src/guestfs-actions.pod:3789 ../fish/guestfish-actions.pod:2920
10874 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10875 "Windows. This partition type will B<only> work for device sizes up to 2 "
10876 "TB. For large disks we recommend using C<gpt>."
10880 #: ../src/guestfs-actions.pod:3796 ../fish/guestfish-actions.pod:2927
10882 "Other partition table types that may work but are not supported include:"
10886 #: ../src/guestfs-actions.pod:3801 ../fish/guestfish-actions.pod:2932
10891 #: ../src/guestfs-actions.pod:3803 ../fish/guestfish-actions.pod:2934
10892 msgid "AIX disk labels."
10896 #: ../src/guestfs-actions.pod:3805 ../fish/guestfish-actions.pod:2936
10897 msgid "B<amiga> | B<rdb>"
10901 #: ../src/guestfs-actions.pod:3807 ../fish/guestfish-actions.pod:2938
10902 msgid "Amiga \"Rigid Disk Block\" format."
10906 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2940
10911 #: ../src/guestfs-actions.pod:3811 ../fish/guestfish-actions.pod:2942
10912 msgid "BSD disk labels."
10916 #: ../src/guestfs-actions.pod:3813 ../fish/guestfish-actions.pod:2944
10921 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2946
10922 msgid "DASD, used on IBM mainframes."
10926 #: ../src/guestfs-actions.pod:3817 ../fish/guestfish-actions.pod:2948
10931 #: ../src/guestfs-actions.pod:3819 ../fish/guestfish-actions.pod:2950
10932 msgid "MIPS/SGI volumes."
10936 #: ../src/guestfs-actions.pod:3821 ../fish/guestfish-actions.pod:2952
10941 #: ../src/guestfs-actions.pod:3823 ../fish/guestfish-actions.pod:2954
10942 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10946 #: ../src/guestfs-actions.pod:3825 ../fish/guestfish-actions.pod:2956
10951 #: ../src/guestfs-actions.pod:3827 ../fish/guestfish-actions.pod:2958
10952 msgid "NEC PC-98 format, common in Japan apparently."
10956 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2960
10961 #: ../src/guestfs-actions.pod:3831 ../fish/guestfish-actions.pod:2962
10962 msgid "Sun disk labels."
10966 #: ../src/guestfs-actions.pod:3837
10967 msgid "guestfs_part_list"
10971 #: ../src/guestfs-actions.pod:3839
10974 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10975 "\t\tconst char *device);\n"
10980 #: ../src/guestfs-actions.pod:3842 ../fish/guestfish-actions.pod:2970
10982 "This command parses the partition table on C<device> and returns the list of "
10983 "partitions found."
10987 #: ../src/guestfs-actions.pod:3845 ../fish/guestfish-actions.pod:2973
10988 msgid "The fields in the returned structure are:"
10992 #: ../src/guestfs-actions.pod:3849 ../fish/guestfish-actions.pod:2977
10993 msgid "B<part_num>"
10997 #: ../src/guestfs-actions.pod:3851 ../fish/guestfish-actions.pod:2979
10998 msgid "Partition number, counting from 1."
11002 #: ../src/guestfs-actions.pod:3853 ../fish/guestfish-actions.pod:2981
11003 msgid "B<part_start>"
11007 #: ../src/guestfs-actions.pod:3855
11009 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11010 "the device's sector size, see C<guestfs_blockdev_getss>."
11014 #: ../src/guestfs-actions.pod:3858 ../fish/guestfish-actions.pod:2986
11015 msgid "B<part_end>"
11019 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2988
11020 msgid "End of the partition in bytes."
11024 #: ../src/guestfs-actions.pod:3862 ../fish/guestfish-actions.pod:2990
11025 msgid "B<part_size>"
11029 #: ../src/guestfs-actions.pod:3864 ../fish/guestfish-actions.pod:2992
11030 msgid "Size of the partition in bytes."
11034 #: ../src/guestfs-actions.pod:3868
11036 "This function returns a C<struct guestfs_partition_list *> (see E<lt>guestfs-"
11037 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11038 "C<guestfs_free_partition_list> after use>."
11042 #: ../src/guestfs-actions.pod:3873
11043 msgid "guestfs_part_set_bootable"
11047 #: ../src/guestfs-actions.pod:3875
11050 " int guestfs_part_set_bootable (guestfs_h *g,\n"
11051 "\t\tconst char *device,\n"
11052 "\t\tint partnum,\n"
11053 "\t\tint bootable);\n"
11058 #: ../src/guestfs-actions.pod:3880 ../fish/guestfish-actions.pod:3000
11060 "This sets the bootable flag on partition numbered C<partnum> on device "
11061 "C<device>. Note that partitions are numbered from 1."
11065 #: ../src/guestfs-actions.pod:3883 ../fish/guestfish-actions.pod:3003
11067 "The bootable flag is used by some operating systems (notably Windows) to "
11068 "determine which partition to boot from. It is by no means universally "
11073 #: ../src/guestfs-actions.pod:3889
11074 msgid "guestfs_part_set_mbr_id"
11078 #: ../src/guestfs-actions.pod:3891
11081 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
11082 "\t\tconst char *device,\n"
11083 "\t\tint partnum,\n"
11084 "\t\tint idbyte);\n"
11089 #: ../src/guestfs-actions.pod:3896 ../fish/guestfish-actions.pod:3011
11091 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11092 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11093 "documentation are in fact hexadecimal numbers, but usually documented "
11094 "without any leading \"0x\" which might be confusing."
11098 #: ../src/guestfs-actions.pod:3908
11099 msgid "guestfs_part_set_name"
11103 #: ../src/guestfs-actions.pod:3910
11106 " int guestfs_part_set_name (guestfs_h *g,\n"
11107 "\t\tconst char *device,\n"
11108 "\t\tint partnum,\n"
11109 "\t\tconst char *name);\n"
11114 #: ../src/guestfs-actions.pod:3915 ../fish/guestfish-actions.pod:3025
11116 "This sets the partition name on partition numbered C<partnum> on device "
11117 "C<device>. Note that partitions are numbered from 1."
11121 #: ../src/guestfs-actions.pod:3918 ../fish/guestfish-actions.pod:3028
11123 "The partition name can only be set on certain types of partition table. "
11124 "This works on C<gpt> but not on C<mbr> partitions."
11128 #: ../src/guestfs-actions.pod:3923
11129 msgid "guestfs_part_to_dev"
11133 #: ../src/guestfs-actions.pod:3925
11136 " char *guestfs_part_to_dev (guestfs_h *g,\n"
11137 "\t\tconst char *partition);\n"
11142 #: ../src/guestfs-actions.pod:3928 ../fish/guestfish-actions.pod:3035
11144 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11145 "partition number, returning the device name (eg. \"/dev/sdb\")."
11149 #: ../src/guestfs-actions.pod:3932
11151 "The named partition must exist, for example as a string returned from "
11152 "C<guestfs_list_partitions>."
11156 #: ../src/guestfs-actions.pod:3938
11157 msgid "guestfs_ping_daemon"
11161 #: ../src/guestfs-actions.pod:3940
11164 " int guestfs_ping_daemon (guestfs_h *g);\n"
11169 #: ../src/guestfs-actions.pod:3942 ../fish/guestfish-actions.pod:3046
11171 "This is a test probe into the guestfs daemon running inside the qemu "
11172 "subprocess. Calling this function checks that the daemon responds to the "
11173 "ping message, without affecting the daemon or attached block device(s) in "
11178 #: ../src/guestfs-actions.pod:3949
11179 msgid "guestfs_pread"
11183 #: ../src/guestfs-actions.pod:3951
11186 " char *guestfs_pread (guestfs_h *g,\n"
11187 "\t\tconst char *path,\n"
11189 "\t\tint64_t offset,\n"
11190 "\t\tsize_t *size_r);\n"
11195 #: ../src/guestfs-actions.pod:3957 ../fish/guestfish-actions.pod:3055
11197 "This command lets you read part of a file. It reads C<count> bytes of the "
11198 "file, starting at C<offset>, from file C<path>."
11202 #: ../src/guestfs-actions.pod:3960 ../src/guestfs-actions.pod:3983
11203 #: ../fish/guestfish-actions.pod:3058 ../fish/guestfish-actions.pod:3073
11205 "This may read fewer bytes than requested. For further details see the "
11206 "L<pread(2)> system call."
11210 #: ../src/guestfs-actions.pod:3963
11211 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
11215 #: ../src/guestfs-actions.pod:3972
11216 msgid "guestfs_pread_device"
11220 #: ../src/guestfs-actions.pod:3974
11223 " char *guestfs_pread_device (guestfs_h *g,\n"
11224 "\t\tconst char *device,\n"
11226 "\t\tint64_t offset,\n"
11227 "\t\tsize_t *size_r);\n"
11232 #: ../src/guestfs-actions.pod:3980 ../fish/guestfish-actions.pod:3070
11234 "This command lets you read part of a file. It reads C<count> bytes of "
11235 "C<device>, starting at C<offset>."
11239 #: ../src/guestfs-actions.pod:3986
11240 msgid "See also C<guestfs_pread>."
11244 #: ../src/guestfs-actions.pod:3995
11245 msgid "guestfs_pvcreate"
11249 #: ../src/guestfs-actions.pod:3997
11252 " int guestfs_pvcreate (guestfs_h *g,\n"
11253 "\t\tconst char *device);\n"
11258 #: ../src/guestfs-actions.pod:4000 ../fish/guestfish-actions.pod:3085
11260 "This creates an LVM physical volume on the named C<device>, where C<device> "
11261 "should usually be a partition name such as C</dev/sda1>."
11265 #: ../src/guestfs-actions.pod:4006
11266 msgid "guestfs_pvremove"
11270 #: ../src/guestfs-actions.pod:4008
11273 " int guestfs_pvremove (guestfs_h *g,\n"
11274 "\t\tconst char *device);\n"
11279 #: ../src/guestfs-actions.pod:4011 ../fish/guestfish-actions.pod:3093
11281 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11286 #: ../src/guestfs-actions.pod:4014 ../fish/guestfish-actions.pod:3096
11288 "The implementation uses the C<pvremove> command which refuses to wipe "
11289 "physical volumes that contain any volume groups, so you have to remove those "
11294 #: ../src/guestfs-actions.pod:4020
11295 msgid "guestfs_pvresize"
11299 #: ../src/guestfs-actions.pod:4022
11302 " int guestfs_pvresize (guestfs_h *g,\n"
11303 "\t\tconst char *device);\n"
11308 #: ../src/guestfs-actions.pod:4025 ../fish/guestfish-actions.pod:3104
11310 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11311 "the new size of the underlying device."
11315 #: ../src/guestfs-actions.pod:4030
11316 msgid "guestfs_pvresize_size"
11320 #: ../src/guestfs-actions.pod:4032
11323 " int guestfs_pvresize_size (guestfs_h *g,\n"
11324 "\t\tconst char *device,\n"
11325 "\t\tint64_t size);\n"
11330 #: ../src/guestfs-actions.pod:4036
11332 "This command is the same as C<guestfs_pvresize> except that it allows you to "
11333 "specify the new size (in bytes) explicitly."
11337 #: ../src/guestfs-actions.pod:4041
11338 msgid "guestfs_pvs"
11342 #: ../src/guestfs-actions.pod:4043
11345 " char **guestfs_pvs (guestfs_h *g);\n"
11350 #: ../src/guestfs-actions.pod:4045 ../fish/guestfish-actions.pod:3118
11352 "List all the physical volumes detected. This is the equivalent of the L<pvs"
11357 #: ../src/guestfs-actions.pod:4048 ../fish/guestfish-actions.pod:3121
11359 "This returns a list of just the device names that contain PVs (eg. C</dev/"
11364 #: ../src/guestfs-actions.pod:4051
11365 msgid "See also C<guestfs_pvs_full>."
11369 #: ../src/guestfs-actions.pod:4057
11370 msgid "guestfs_pvs_full"
11374 #: ../src/guestfs-actions.pod:4059
11377 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
11382 #: ../src/guestfs-actions.pod:4061 ../fish/guestfish-actions.pod:3130
11384 "List all the physical volumes detected. This is the equivalent of the L<pvs"
11385 "(8)> command. The \"full\" version includes all fields."
11389 #: ../src/guestfs-actions.pod:4064
11391 "This function returns a C<struct guestfs_lvm_pv_list *> (see E<lt>guestfs-"
11392 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11393 "C<guestfs_free_lvm_pv_list> after use>."
11397 #: ../src/guestfs-actions.pod:4069
11398 msgid "guestfs_pvuuid"
11402 #: ../src/guestfs-actions.pod:4071
11405 " char *guestfs_pvuuid (guestfs_h *g,\n"
11406 "\t\tconst char *device);\n"
11411 #: ../src/guestfs-actions.pod:4074 ../fish/guestfish-actions.pod:3137
11412 msgid "This command returns the UUID of the LVM PV C<device>."
11416 #: ../src/guestfs-actions.pod:4079
11417 msgid "guestfs_pwrite"
11421 #: ../src/guestfs-actions.pod:4081
11424 " int guestfs_pwrite (guestfs_h *g,\n"
11425 "\t\tconst char *path,\n"
11426 "\t\tconst char *content,\n"
11427 "\t\tsize_t content_size,\n"
11428 "\t\tint64_t offset);\n"
11433 #: ../src/guestfs-actions.pod:4087 ../fish/guestfish-actions.pod:3143
11435 "This command writes to part of a file. It writes the data buffer C<content> "
11436 "to the file C<path> starting at offset C<offset>."
11440 #: ../src/guestfs-actions.pod:4090 ../fish/guestfish-actions.pod:3146
11442 "This command implements the L<pwrite(2)> system call, and like that system "
11443 "call it may not write the full data requested. The return value is the "
11444 "number of bytes that were actually written to the file. This could even be "
11445 "0, although short writes are unlikely for regular files in ordinary "
11450 #: ../src/guestfs-actions.pod:4096
11451 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
11455 #: ../src/guestfs-actions.pod:4103
11456 msgid "guestfs_pwrite_device"
11460 #: ../src/guestfs-actions.pod:4105
11463 " int guestfs_pwrite_device (guestfs_h *g,\n"
11464 "\t\tconst char *device,\n"
11465 "\t\tconst char *content,\n"
11466 "\t\tsize_t content_size,\n"
11467 "\t\tint64_t offset);\n"
11472 #: ../src/guestfs-actions.pod:4111 ../fish/guestfish-actions.pod:3161
11474 "This command writes to part of a device. It writes the data buffer "
11475 "C<content> to C<device> starting at offset C<offset>."
11479 #: ../src/guestfs-actions.pod:4114 ../fish/guestfish-actions.pod:3164
11481 "This command implements the L<pwrite(2)> system call, and like that system "
11482 "call it may not write the full data requested (although short writes to disk "
11483 "devices and partitions are probably impossible with standard Linux kernels)."
11487 #: ../src/guestfs-actions.pod:4119
11488 msgid "See also C<guestfs_pwrite>."
11492 #: ../src/guestfs-actions.pod:4126
11493 msgid "guestfs_read_file"
11497 #: ../src/guestfs-actions.pod:4128
11500 " char *guestfs_read_file (guestfs_h *g,\n"
11501 "\t\tconst char *path,\n"
11502 "\t\tsize_t *size_r);\n"
11507 #: ../src/guestfs-actions.pod:4132 ../fish/guestfish-actions.pod:3178
11508 msgid "This calls returns the contents of the file C<path> as a buffer."
11512 #: ../src/guestfs-actions.pod:4135
11514 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
11515 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
11516 "function is limited in the total size of file that can be handled."
11520 #: ../src/guestfs-actions.pod:4147
11521 msgid "guestfs_read_lines"
11525 #: ../src/guestfs-actions.pod:4149
11528 " char **guestfs_read_lines (guestfs_h *g,\n"
11529 "\t\tconst char *path);\n"
11534 #: ../src/guestfs-actions.pod:4154 ../fish/guestfish-actions.pod:3195
11536 "The file contents are returned as a list of lines. Trailing C<LF> and "
11537 "C<CRLF> character sequences are I<not> returned."
11541 #: ../src/guestfs-actions.pod:4157
11543 "Note that this function cannot correctly handle binary files (specifically, "
11544 "files containing C<\\0> character which is treated as end of line). For "
11545 "those you need to use the C<guestfs_read_file> function which has a more "
11546 "complex interface."
11550 #: ../src/guestfs-actions.pod:4166
11551 msgid "guestfs_readdir"
11555 #: ../src/guestfs-actions.pod:4168
11558 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
11559 "\t\tconst char *dir);\n"
11564 #: ../src/guestfs-actions.pod:4171 ../fish/guestfish-actions.pod:3207
11565 msgid "This returns the list of directory entries in directory C<dir>."
11569 #: ../src/guestfs-actions.pod:4173 ../fish/guestfish-actions.pod:3209
11571 "All entries in the directory are returned, including C<.> and C<..>. The "
11572 "entries are I<not> sorted, but returned in the same order as the underlying "
11577 #: ../src/guestfs-actions.pod:4177 ../fish/guestfish-actions.pod:3213
11579 "Also this call returns basic file type information about each file. The "
11580 "C<ftyp> field will contain one of the following characters:"
11584 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:3218
11589 #: ../src/guestfs-actions.pod:4184 ../fish/guestfish-actions.pod:3220
11590 msgid "Block special"
11594 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:3222
11599 #: ../src/guestfs-actions.pod:4188 ../fish/guestfish-actions.pod:3224
11600 msgid "Char special"
11604 #: ../src/guestfs-actions.pod:4190 ../fish/guestfish-actions.pod:3226
11609 #: ../src/guestfs-actions.pod:4192 ../fish/guestfish-actions.pod:3228
11614 #: ../src/guestfs-actions.pod:4194 ../fish/guestfish-actions.pod:3230
11619 #: ../src/guestfs-actions.pod:4196 ../fish/guestfish-actions.pod:3232
11620 msgid "FIFO (named pipe)"
11624 #: ../src/guestfs-actions.pod:4198 ../fish/guestfish-actions.pod:3234
11629 #: ../src/guestfs-actions.pod:4200 ../fish/guestfish-actions.pod:3236
11630 msgid "Symbolic link"
11634 #: ../src/guestfs-actions.pod:4202 ../fish/guestfish-actions.pod:3238
11639 #: ../src/guestfs-actions.pod:4204 ../fish/guestfish-actions.pod:3240
11640 msgid "Regular file"
11644 #: ../src/guestfs-actions.pod:4206 ../fish/guestfish-actions.pod:3242
11649 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:3244
11654 #: ../src/guestfs-actions.pod:4210 ../fish/guestfish-actions.pod:3246
11659 #: ../src/guestfs-actions.pod:4212 ../fish/guestfish-actions.pod:3248
11660 msgid "Unknown file type"
11664 #: ../src/guestfs-actions.pod:4214 ../fish/guestfish-actions.pod:3250
11669 #: ../src/guestfs-actions.pod:4216 ../fish/guestfish-actions.pod:3252
11671 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11675 #: ../src/guestfs-actions.pod:4221
11677 "This function is primarily intended for use by programs. To get a simple "
11678 "list of names, use C<guestfs_ls>. To get a printable directory for human "
11679 "consumption, use C<guestfs_ll>."
11683 #: ../src/guestfs-actions.pod:4225
11685 "This function returns a C<struct guestfs_dirent_list *> (see E<lt>guestfs-"
11686 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11687 "C<guestfs_free_dirent_list> after use>."
11691 #: ../src/guestfs-actions.pod:4230
11692 msgid "guestfs_readlink"
11696 #: ../src/guestfs-actions.pod:4232
11699 " char *guestfs_readlink (guestfs_h *g,\n"
11700 "\t\tconst char *path);\n"
11705 #: ../src/guestfs-actions.pod:4235 ../fish/guestfish-actions.pod:3265
11706 msgid "This command reads the target of a symbolic link."
11710 #: ../src/guestfs-actions.pod:4240
11711 msgid "guestfs_readlinklist"
11715 #: ../src/guestfs-actions.pod:4242
11718 " char **guestfs_readlinklist (guestfs_h *g,\n"
11719 "\t\tconst char *path,\n"
11720 "\t\tchar *const *names);\n"
11725 #: ../src/guestfs-actions.pod:4246 ../fish/guestfish-actions.pod:3271
11727 "This call allows you to do a C<readlink> operation on multiple files, where "
11728 "all files are in the directory C<path>. C<names> is the list of files from "
11733 #: ../src/guestfs-actions.pod:4250 ../fish/guestfish-actions.pod:3275
11735 "On return you get a list of strings, with a one-to-one correspondence to the "
11736 "C<names> list. Each string is the value of the symbolic link."
11740 #: ../src/guestfs-actions.pod:4254 ../fish/guestfish-actions.pod:3279
11742 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11743 "result string is the empty string C<\"\">. However the whole operation is "
11744 "completed even if there were C<readlink(2)> errors, and so you can call this "
11745 "function with names where you don't know if they are symbolic links already "
11746 "(albeit slightly less efficient)."
11750 #: ../src/guestfs-actions.pod:4261 ../fish/guestfish-actions.pod:3286
11752 "This call is intended for programs that want to efficiently list a directory "
11753 "contents without making many round-trips. Very long directory listings "
11754 "might cause the protocol message size to be exceeded, causing this call to "
11755 "fail. The caller must split up such requests into smaller groups of names."
11759 #: ../src/guestfs-actions.pod:4272
11760 msgid "guestfs_realpath"
11764 #: ../src/guestfs-actions.pod:4274
11767 " char *guestfs_realpath (guestfs_h *g,\n"
11768 "\t\tconst char *path);\n"
11773 #: ../src/guestfs-actions.pod:4277 ../fish/guestfish-actions.pod:3297
11775 "Return the canonicalized absolute pathname of C<path>. The returned path "
11776 "has no C<.>, C<..> or symbolic link path elements."
11780 #: ../src/guestfs-actions.pod:4283
11781 msgid "guestfs_removexattr"
11785 #: ../src/guestfs-actions.pod:4285
11788 " int guestfs_removexattr (guestfs_h *g,\n"
11789 "\t\tconst char *xattr,\n"
11790 "\t\tconst char *path);\n"
11795 #: ../src/guestfs-actions.pod:4289 ../fish/guestfish-actions.pod:3304
11797 "This call removes the extended attribute named C<xattr> of the file C<path>."
11801 #: ../src/guestfs-actions.pod:4292
11802 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11806 #: ../src/guestfs-actions.pod:4296
11807 msgid "guestfs_resize2fs"
11811 #: ../src/guestfs-actions.pod:4298
11814 " int guestfs_resize2fs (guestfs_h *g,\n"
11815 "\t\tconst char *device);\n"
11820 #: ../src/guestfs-actions.pod:4301 ../fish/guestfish-actions.pod:3313
11822 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11823 "underlying device."
11827 #: ../src/guestfs-actions.pod:4304
11829 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11830 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11831 "sometimes gives an error about this and sometimes not. In any case, it is "
11832 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11836 #: ../src/guestfs-actions.pod:4312
11837 msgid "guestfs_resize2fs_size"
11841 #: ../src/guestfs-actions.pod:4314
11844 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11845 "\t\tconst char *device,\n"
11846 "\t\tint64_t size);\n"
11851 #: ../src/guestfs-actions.pod:4318
11853 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11854 "to specify the new size (in bytes) explicitly."
11858 #: ../src/guestfs-actions.pod:4323
11863 #: ../src/guestfs-actions.pod:4325
11866 " int guestfs_rm (guestfs_h *g,\n"
11867 "\t\tconst char *path);\n"
11872 #: ../src/guestfs-actions.pod:4328 ../fish/guestfish-actions.pod:3333
11873 msgid "Remove the single file C<path>."
11877 #: ../src/guestfs-actions.pod:4332
11878 msgid "guestfs_rm_rf"
11882 #: ../src/guestfs-actions.pod:4334
11885 " int guestfs_rm_rf (guestfs_h *g,\n"
11886 "\t\tconst char *path);\n"
11891 #: ../src/guestfs-actions.pod:4337 ../fish/guestfish-actions.pod:3339
11893 "Remove the file or directory C<path>, recursively removing the contents if "
11894 "its a directory. This is like the C<rm -rf> shell command."
11898 #: ../src/guestfs-actions.pod:4343
11899 msgid "guestfs_rmdir"
11903 #: ../src/guestfs-actions.pod:4345
11906 " int guestfs_rmdir (guestfs_h *g,\n"
11907 "\t\tconst char *path);\n"
11912 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:3347
11913 msgid "Remove the single directory C<path>."
11917 #: ../src/guestfs-actions.pod:4352
11918 msgid "guestfs_rmmountpoint"
11922 #: ../src/guestfs-actions.pod:4354
11925 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11926 "\t\tconst char *exemptpath);\n"
11931 #: ../src/guestfs-actions.pod:4357
11933 "This calls removes a mountpoint that was previously created with "
11934 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11938 #: ../src/guestfs-actions.pod:4363
11939 msgid "guestfs_scrub_device"
11943 #: ../src/guestfs-actions.pod:4365
11946 " int guestfs_scrub_device (guestfs_h *g,\n"
11947 "\t\tconst char *device);\n"
11952 #: ../src/guestfs-actions.pod:4368 ../fish/guestfish-actions.pod:3361
11954 "This command writes patterns over C<device> to make data retrieval more "
11959 #: ../src/guestfs-actions.pod:4371 ../src/guestfs-actions.pod:4389
11960 #: ../src/guestfs-actions.pod:4405 ../fish/guestfish-actions.pod:3364
11961 #: ../fish/guestfish-actions.pod:3379 ../fish/guestfish-actions.pod:3392
11963 "It is an interface to the L<scrub(1)> program. See that manual page for "
11968 #: ../src/guestfs-actions.pod:4379
11969 msgid "guestfs_scrub_file"
11973 #: ../src/guestfs-actions.pod:4381
11976 " int guestfs_scrub_file (guestfs_h *g,\n"
11977 "\t\tconst char *file);\n"
11982 #: ../src/guestfs-actions.pod:4384 ../fish/guestfish-actions.pod:3374
11984 "This command writes patterns over a file to make data retrieval more "
11989 #: ../src/guestfs-actions.pod:4387 ../fish/guestfish-actions.pod:3377
11990 msgid "The file is I<removed> after scrubbing."
11994 #: ../src/guestfs-actions.pod:4394
11995 msgid "guestfs_scrub_freespace"
11999 #: ../src/guestfs-actions.pod:4396
12002 " int guestfs_scrub_freespace (guestfs_h *g,\n"
12003 "\t\tconst char *dir);\n"
12008 #: ../src/guestfs-actions.pod:4399
12010 "This command creates the directory C<dir> and then fills it with files until "
12011 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
12012 "and deletes them. The intention is to scrub any free space on the partition "
12013 "containing C<dir>."
12017 #: ../src/guestfs-actions.pod:4410
12018 msgid "guestfs_set_append"
12022 #: ../src/guestfs-actions.pod:4412
12025 " int guestfs_set_append (guestfs_h *g,\n"
12026 "\t\tconst char *append);\n"
12031 #: ../src/guestfs-actions.pod:4415 ../fish/guestfish-actions.pod:3401
12033 "This function is used to add additional options to the guest kernel command "
12038 #: ../src/guestfs-actions.pod:4418 ../fish/guestfish-actions.pod:3404
12040 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12041 "environment variable."
12045 #: ../src/guestfs-actions.pod:4421 ../fish/guestfish-actions.pod:3407
12047 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12048 "(libguestfs always adds a few of its own)."
12052 #: ../src/guestfs-actions.pod:4426
12053 msgid "guestfs_set_autosync"
12057 #: ../src/guestfs-actions.pod:4428
12060 " int guestfs_set_autosync (guestfs_h *g,\n"
12061 "\t\tint autosync);\n"
12066 #: ../src/guestfs-actions.pod:4431
12068 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12069 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
12070 "the handle is closed (also if the program exits without closing handles)."
12074 #: ../src/guestfs-actions.pod:4436 ../fish/guestfish-actions.pod:3421
12076 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12077 "disabled by default)."
12081 #: ../src/guestfs-actions.pod:4441
12082 msgid "guestfs_set_direct"
12086 #: ../src/guestfs-actions.pod:4443
12089 " int guestfs_set_direct (guestfs_h *g,\n"
12090 "\t\tint direct);\n"
12095 #: ../src/guestfs-actions.pod:4446 ../fish/guestfish-actions.pod:3430
12097 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12098 "passed directly through to the appliance once it is launched."
12102 #: ../src/guestfs-actions.pod:4450
12104 "One consequence of this is that log messages aren't caught by the library "
12105 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
12110 #: ../src/guestfs-actions.pod:4454 ../fish/guestfish-actions.pod:3438
12111 msgid "You probably don't want to use this unless you know what you are doing."
12115 #: ../src/guestfs-actions.pod:4457 ../fish/guestfish-actions.pod:3441
12116 msgid "The default is disabled."
12120 #: ../src/guestfs-actions.pod:4461
12121 msgid "guestfs_set_e2label"
12125 #: ../src/guestfs-actions.pod:4463
12128 " int guestfs_set_e2label (guestfs_h *g,\n"
12129 "\t\tconst char *device,\n"
12130 "\t\tconst char *label);\n"
12135 #: ../src/guestfs-actions.pod:4467 ../fish/guestfish-actions.pod:3447
12137 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12138 "C<label>. Filesystem labels are limited to 16 characters."
12142 #: ../src/guestfs-actions.pod:4471
12144 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
12145 "the existing label on a filesystem."
12149 #: ../src/guestfs-actions.pod:4476
12150 msgid "guestfs_set_e2uuid"
12154 #: ../src/guestfs-actions.pod:4478
12157 " int guestfs_set_e2uuid (guestfs_h *g,\n"
12158 "\t\tconst char *device,\n"
12159 "\t\tconst char *uuid);\n"
12164 #: ../src/guestfs-actions.pod:4482 ../fish/guestfish-actions.pod:3458
12166 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12167 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12168 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12172 #: ../src/guestfs-actions.pod:4487
12174 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
12175 "the existing UUID of a filesystem."
12179 #: ../src/guestfs-actions.pod:4492
12180 msgid "guestfs_set_memsize"
12184 #: ../src/guestfs-actions.pod:4494
12187 " int guestfs_set_memsize (guestfs_h *g,\n"
12188 "\t\tint memsize);\n"
12193 #: ../src/guestfs-actions.pod:4497
12195 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12196 "This only has any effect if called before C<guestfs_launch>."
12200 #: ../src/guestfs-actions.pod:4501 ../fish/guestfish-actions.pod:3476
12202 "You can also change this by setting the environment variable "
12203 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12207 #: ../src/guestfs-actions.pod:4510
12208 msgid "guestfs_set_network"
12212 #: ../src/guestfs-actions.pod:4512
12215 " int guestfs_set_network (guestfs_h *g,\n"
12216 "\t\tint network);\n"
12221 #: ../src/guestfs-actions.pod:4515 ../fish/guestfish-actions.pod:3489
12223 "If C<network> is true, then the network is enabled in the libguestfs "
12224 "appliance. The default is false."
12228 #: ../src/guestfs-actions.pod:4518 ../fish/guestfish-actions.pod:3492
12230 "This affects whether commands are able to access the network (see L<guestfs"
12231 "(3)/RUNNING COMMANDS>)."
12235 #: ../src/guestfs-actions.pod:4521
12237 "You must call this before calling C<guestfs_launch>, otherwise it has no "
12242 #: ../src/guestfs-actions.pod:4526
12243 msgid "guestfs_set_path"
12247 #: ../src/guestfs-actions.pod:4528
12250 " int guestfs_set_path (guestfs_h *g,\n"
12251 "\t\tconst char *searchpath);\n"
12256 #: ../src/guestfs-actions.pod:4531 ../fish/guestfish-actions.pod:3504
12257 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12261 #: ../src/guestfs-actions.pod:4533 ../fish/guestfish-actions.pod:3506
12263 "The default is C<$libdir/guestfs> unless overridden by setting "
12264 "C<LIBGUESTFS_PATH> environment variable."
12268 #: ../src/guestfs-actions.pod:4536 ../fish/guestfish-actions.pod:3509
12269 msgid "Setting C<path> to C<NULL> restores the default path."
12273 #: ../src/guestfs-actions.pod:4540
12274 msgid "guestfs_set_qemu"
12278 #: ../src/guestfs-actions.pod:4542
12281 " int guestfs_set_qemu (guestfs_h *g,\n"
12282 "\t\tconst char *qemu);\n"
12287 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3517
12288 msgid "Set the qemu binary that we will use."
12292 #: ../src/guestfs-actions.pod:4547 ../fish/guestfish-actions.pod:3519
12294 "The default is chosen when the library was compiled by the configure script."
12298 #: ../src/guestfs-actions.pod:4550 ../fish/guestfish-actions.pod:3522
12300 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12305 #: ../src/guestfs-actions.pod:4553 ../fish/guestfish-actions.pod:3525
12306 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12310 #: ../src/guestfs-actions.pod:4555 ../fish/guestfish-actions.pod:3527
12312 "Note that you should call this function as early as possible after creating "
12313 "the handle. This is because some pre-launch operations depend on testing "
12314 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12315 "don't retest features, and so you might see inconsistent results. Using the "
12316 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12317 "the qemu binary at the same time as the handle is created."
12321 #: ../src/guestfs-actions.pod:4565
12322 msgid "guestfs_set_recovery_proc"
12326 #: ../src/guestfs-actions.pod:4567
12329 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
12330 "\t\tint recoveryproc);\n"
12335 #: ../src/guestfs-actions.pod:4570
12337 "If this is called with the parameter C<false> then C<guestfs_launch> does "
12338 "not create a recovery process. The purpose of the recovery process is to "
12339 "stop runaway qemu processes in the case where the main program aborts "
12344 #: ../src/guestfs-actions.pod:4575
12346 "This only has any effect if called before C<guestfs_launch>, and the default "
12351 #: ../src/guestfs-actions.pod:4578 ../fish/guestfish-actions.pod:3549
12353 "About the only time when you would want to disable this is if the main "
12354 "process will fork itself into the background (\"daemonize\" itself). In "
12355 "this case the recovery process thinks that the main program has disappeared "
12356 "and so kills qemu, which is not very helpful."
12360 #: ../src/guestfs-actions.pod:4586
12361 msgid "guestfs_set_selinux"
12365 #: ../src/guestfs-actions.pod:4588
12368 " int guestfs_set_selinux (guestfs_h *g,\n"
12369 "\t\tint selinux);\n"
12374 #: ../src/guestfs-actions.pod:4591 ../fish/guestfish-actions.pod:3561
12376 "This sets the selinux flag that is passed to the appliance at boot time. "
12377 "The default is C<selinux=0> (disabled)."
12381 #: ../src/guestfs-actions.pod:4594 ../fish/guestfish-actions.pod:3564
12383 "Note that if SELinux is enabled, it is always in Permissive mode "
12384 "(C<enforcing=0>)."
12388 #: ../src/guestfs-actions.pod:4602
12389 msgid "guestfs_set_trace"
12393 #: ../src/guestfs-actions.pod:4604
12396 " int guestfs_set_trace (guestfs_h *g,\n"
12397 "\t\tint trace);\n"
12402 #: ../src/guestfs-actions.pod:4607 ../fish/guestfish-actions.pod:3576
12404 "If the command trace flag is set to 1, then commands are printed on stderr "
12405 "before they are executed in a format which is very similar to the one used "
12406 "by guestfish. In other words, you can run a program with this enabled, and "
12407 "you will get out a script which you can feed to guestfish to perform the "
12408 "same set of actions."
12412 #: ../src/guestfs-actions.pod:4614 ../fish/guestfish-actions.pod:3583
12414 "If you want to trace C API calls into libguestfs (and other libraries) then "
12415 "possibly a better way is to use the external ltrace(1) command."
12419 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3587
12421 "Command traces are disabled unless the environment variable "
12422 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12426 #: ../src/guestfs-actions.pod:4623
12427 msgid "guestfs_set_verbose"
12431 #: ../src/guestfs-actions.pod:4625
12434 " int guestfs_set_verbose (guestfs_h *g,\n"
12435 "\t\tint verbose);\n"
12440 #: ../src/guestfs-actions.pod:4628 ../fish/guestfish-actions.pod:3596
12441 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
12445 #: ../src/guestfs-actions.pod:4630 ../fish/guestfish-actions.pod:3598
12447 "Verbose messages are disabled unless the environment variable "
12448 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12452 #: ../src/guestfs-actions.pod:4635
12453 msgid "guestfs_setcon"
12457 #: ../src/guestfs-actions.pod:4637
12460 " int guestfs_setcon (guestfs_h *g,\n"
12461 "\t\tconst char *context);\n"
12466 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3605
12468 "This sets the SELinux security context of the daemon to the string "
12473 #: ../src/guestfs-actions.pod:4643 ../fish/guestfish-actions.pod:3608
12474 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12478 #: ../src/guestfs-actions.pod:4647
12479 msgid "guestfs_setxattr"
12483 #: ../src/guestfs-actions.pod:4649
12486 " int guestfs_setxattr (guestfs_h *g,\n"
12487 "\t\tconst char *xattr,\n"
12488 "\t\tconst char *val,\n"
12489 "\t\tint vallen,\n"
12490 "\t\tconst char *path);\n"
12495 #: ../src/guestfs-actions.pod:4655 ../fish/guestfish-actions.pod:3614
12497 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12498 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12502 #: ../src/guestfs-actions.pod:4659
12503 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
12507 #: ../src/guestfs-actions.pod:4663
12508 msgid "guestfs_sfdisk"
12512 #: ../src/guestfs-actions.pod:4665
12515 " int guestfs_sfdisk (guestfs_h *g,\n"
12516 "\t\tconst char *device,\n"
12519 "\t\tint sectors,\n"
12520 "\t\tchar *const *lines);\n"
12525 #: ../src/guestfs-actions.pod:4672 ../fish/guestfish-actions.pod:3624
12527 "This is a direct interface to the L<sfdisk(8)> program for creating "
12528 "partitions on block devices."
12532 #: ../src/guestfs-actions.pod:4675 ../fish/guestfish-actions.pod:3627
12533 msgid "C<device> should be a block device, for example C</dev/sda>."
12537 #: ../src/guestfs-actions.pod:4677 ../fish/guestfish-actions.pod:3629
12539 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12540 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
12541 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12542 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12543 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12544 "the kernel) cannot work out the right geometry and you will need to tell it."
12548 #: ../src/guestfs-actions.pod:4685 ../fish/guestfish-actions.pod:3637
12550 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12551 "refer to the L<sfdisk(8)> manpage."
12555 #: ../src/guestfs-actions.pod:4688 ../fish/guestfish-actions.pod:3640
12557 "To create a single partition occupying the whole disk, you would pass "
12558 "C<lines> as a single element list, when the single element being the string "
12563 #: ../src/guestfs-actions.pod:4692
12565 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
12569 #: ../src/guestfs-actions.pod:4700
12570 msgid "guestfs_sfdiskM"
12574 #: ../src/guestfs-actions.pod:4702
12577 " int guestfs_sfdiskM (guestfs_h *g,\n"
12578 "\t\tconst char *device,\n"
12579 "\t\tchar *const *lines);\n"
12584 #: ../src/guestfs-actions.pod:4706
12586 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
12587 "partition sizes are specified in megabytes only (rounded to the nearest "
12588 "cylinder) and you don't need to specify the cyls, heads and sectors "
12589 "parameters which were rarely if ever used anyway."
12593 #: ../src/guestfs-actions.pod:4712
12595 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
12596 "C<guestfs_part_disk>"
12600 #: ../src/guestfs-actions.pod:4720
12601 msgid "guestfs_sfdisk_N"
12605 #: ../src/guestfs-actions.pod:4722
12608 " int guestfs_sfdisk_N (guestfs_h *g,\n"
12609 "\t\tconst char *device,\n"
12610 "\t\tint partnum,\n"
12613 "\t\tint sectors,\n"
12614 "\t\tconst char *line);\n"
12619 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3670
12621 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
12622 "(note: C<n> counts from 1)."
12626 #: ../src/guestfs-actions.pod:4733
12628 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
12629 "for the cyls/heads/sectors parameters."
12633 #: ../src/guestfs-actions.pod:4736
12634 msgid "See also: C<guestfs_part_add>"
12638 #: ../src/guestfs-actions.pod:4743
12639 msgid "guestfs_sfdisk_disk_geometry"
12643 #: ../src/guestfs-actions.pod:4745
12646 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
12647 "\t\tconst char *device);\n"
12652 #: ../src/guestfs-actions.pod:4748
12654 "This displays the disk geometry of C<device> read from the partition table. "
12655 "Especially in the case where the underlying block device has been resized, "
12656 "this can be different from the kernel's idea of the geometry (see "
12657 "C<guestfs_sfdisk_kernel_geometry>)."
12661 #: ../src/guestfs-actions.pod:4753 ../src/guestfs-actions.pod:4766
12662 #: ../fish/guestfish-actions.pod:3690 ../fish/guestfish-actions.pod:3699
12663 msgid "The result is in human-readable format, and not designed to be parsed."
12667 #: ../src/guestfs-actions.pod:4759
12668 msgid "guestfs_sfdisk_kernel_geometry"
12672 #: ../src/guestfs-actions.pod:4761
12675 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
12676 "\t\tconst char *device);\n"
12681 #: ../src/guestfs-actions.pod:4764 ../fish/guestfish-actions.pod:3697
12682 msgid "This displays the kernel's idea of the geometry of C<device>."
12686 #: ../src/guestfs-actions.pod:4772
12687 msgid "guestfs_sfdisk_l"
12691 #: ../src/guestfs-actions.pod:4774
12694 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12695 "\t\tconst char *device);\n"
12700 #: ../src/guestfs-actions.pod:4777 ../fish/guestfish-actions.pod:3706
12702 "This displays the partition table on C<device>, in the human-readable output "
12703 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12707 #: ../src/guestfs-actions.pod:4781
12708 msgid "See also: C<guestfs_part_list>"
12712 #: ../src/guestfs-actions.pod:4786
12717 #: ../src/guestfs-actions.pod:4788
12720 " char *guestfs_sh (guestfs_h *g,\n"
12721 "\t\tconst char *command);\n"
12726 #: ../src/guestfs-actions.pod:4791 ../fish/guestfish-actions.pod:3716
12728 "This call runs a command from the guest filesystem via the guest's C</bin/"
12733 #: ../src/guestfs-actions.pod:4794
12734 msgid "This is like C<guestfs_command>, but passes the command to:"
12738 #: ../src/guestfs-actions.pod:4796 ../fish/guestfish-actions.pod:3721
12741 " /bin/sh -c \"command\"\n"
12746 #: ../src/guestfs-actions.pod:4798 ../fish/guestfish-actions.pod:3723
12748 "Depending on the guest's shell, this usually results in wildcards being "
12749 "expanded, shell expressions being interpolated and so on."
12753 #: ../src/guestfs-actions.pod:4802
12754 msgid "All the provisos about C<guestfs_command> apply to this call."
12758 #: ../src/guestfs-actions.pod:4807
12759 msgid "guestfs_sh_lines"
12763 #: ../src/guestfs-actions.pod:4809
12766 " char **guestfs_sh_lines (guestfs_h *g,\n"
12767 "\t\tconst char *command);\n"
12772 #: ../src/guestfs-actions.pod:4812
12774 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12779 #: ../src/guestfs-actions.pod:4815
12780 msgid "See also: C<guestfs_command_lines>"
12784 #: ../src/guestfs-actions.pod:4821
12785 msgid "guestfs_sleep"
12789 #: ../src/guestfs-actions.pod:4823
12792 " int guestfs_sleep (guestfs_h *g,\n"
12798 #: ../src/guestfs-actions.pod:4826 ../fish/guestfish-actions.pod:3742
12799 msgid "Sleep for C<secs> seconds."
12803 #: ../src/guestfs-actions.pod:4830 ../src/guestfs-structs.pod:109
12804 msgid "guestfs_stat"
12808 #: ../src/guestfs-actions.pod:4832
12811 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12812 "\t\tconst char *path);\n"
12817 #: ../src/guestfs-actions.pod:4837 ../fish/guestfish-actions.pod:3750
12818 msgid "This is the same as the C<stat(2)> system call."
12822 #: ../src/guestfs-actions.pod:4843 ../src/guestfs-structs.pod:135
12823 msgid "guestfs_statvfs"
12827 #: ../src/guestfs-actions.pod:4845
12830 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12831 "\t\tconst char *path);\n"
12836 #: ../src/guestfs-actions.pod:4848 ../fish/guestfish-actions.pod:3756
12838 "Returns file system statistics for any mounted file system. C<path> should "
12839 "be a file or directory in the mounted file system (typically it is the mount "
12840 "point itself, but it doesn't need to be)."
12844 #: ../src/guestfs-actions.pod:4852 ../fish/guestfish-actions.pod:3760
12845 msgid "This is the same as the C<statvfs(2)> system call."
12849 #: ../src/guestfs-actions.pod:4854
12851 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12852 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12856 #: ../src/guestfs-actions.pod:4858
12857 msgid "guestfs_strings"
12861 #: ../src/guestfs-actions.pod:4860
12864 " char **guestfs_strings (guestfs_h *g,\n"
12865 "\t\tconst char *path);\n"
12870 #: ../src/guestfs-actions.pod:4863 ../fish/guestfish-actions.pod:3766
12872 "This runs the L<strings(1)> command on a file and returns the list of "
12873 "printable strings found."
12877 #: ../src/guestfs-actions.pod:4873
12878 msgid "guestfs_strings_e"
12882 #: ../src/guestfs-actions.pod:4875
12885 " char **guestfs_strings_e (guestfs_h *g,\n"
12886 "\t\tconst char *encoding,\n"
12887 "\t\tconst char *path);\n"
12892 #: ../src/guestfs-actions.pod:4879
12894 "This is like the C<guestfs_strings> command, but allows you to specify the "
12895 "encoding of strings that are looked for in the source file C<path>."
12899 #: ../src/guestfs-actions.pod:4883 ../fish/guestfish-actions.pod:3780
12900 msgid "Allowed encodings are:"
12904 #: ../src/guestfs-actions.pod:4887 ../fish/guestfish-actions.pod:3784
12909 #: ../src/guestfs-actions.pod:4889
12911 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12912 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12916 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3789
12921 #: ../src/guestfs-actions.pod:4894 ../fish/guestfish-actions.pod:3791
12922 msgid "Single 8-bit-byte characters."
12926 #: ../src/guestfs-actions.pod:4896 ../fish/guestfish-actions.pod:3793
12931 #: ../src/guestfs-actions.pod:4898 ../fish/guestfish-actions.pod:3795
12932 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12936 #: ../src/guestfs-actions.pod:4901 ../fish/guestfish-actions.pod:3798
12937 msgid "l (lower case letter L)"
12941 #: ../src/guestfs-actions.pod:4903 ../fish/guestfish-actions.pod:3800
12943 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12944 "examining binaries in Windows guests."
12948 #: ../src/guestfs-actions.pod:4906 ../fish/guestfish-actions.pod:3803
12953 #: ../src/guestfs-actions.pod:4908 ../fish/guestfish-actions.pod:3805
12954 msgid "32-bit big endian such as UCS-4BE."
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 little endian such as UCS-4LE."
12968 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3813
12969 msgid "The returned strings are transcoded to UTF-8."
12973 #: ../src/guestfs-actions.pod:4925
12974 msgid "guestfs_swapoff_device"
12978 #: ../src/guestfs-actions.pod:4927
12981 " int guestfs_swapoff_device (guestfs_h *g,\n"
12982 "\t\tconst char *device);\n"
12987 #: ../src/guestfs-actions.pod:4930
12989 "This command disables the libguestfs appliance swap device or partition "
12990 "named C<device>. See C<guestfs_swapon_device>."
12994 #: ../src/guestfs-actions.pod:4936
12995 msgid "guestfs_swapoff_file"
12999 #: ../src/guestfs-actions.pod:4938
13002 " int guestfs_swapoff_file (guestfs_h *g,\n"
13003 "\t\tconst char *file);\n"
13008 #: ../src/guestfs-actions.pod:4941 ../fish/guestfish-actions.pod:3830
13009 msgid "This command disables the libguestfs appliance swap on file."
13013 #: ../src/guestfs-actions.pod:4945
13014 msgid "guestfs_swapoff_label"
13018 #: ../src/guestfs-actions.pod:4947
13021 " int guestfs_swapoff_label (guestfs_h *g,\n"
13022 "\t\tconst char *label);\n"
13027 #: ../src/guestfs-actions.pod:4950 ../fish/guestfish-actions.pod:3836
13029 "This command disables the libguestfs appliance swap on labeled swap "
13034 #: ../src/guestfs-actions.pod:4955
13035 msgid "guestfs_swapoff_uuid"
13039 #: ../src/guestfs-actions.pod:4957
13042 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
13043 "\t\tconst char *uuid);\n"
13048 #: ../src/guestfs-actions.pod:4960 ../fish/guestfish-actions.pod:3843
13050 "This command disables the libguestfs appliance swap partition with the given "
13055 #: ../src/guestfs-actions.pod:4965
13056 msgid "guestfs_swapon_device"
13060 #: ../src/guestfs-actions.pod:4967
13063 " int guestfs_swapon_device (guestfs_h *g,\n"
13064 "\t\tconst char *device);\n"
13069 #: ../src/guestfs-actions.pod:4970
13071 "This command enables the libguestfs appliance to use the swap device or "
13072 "partition named C<device>. The increased memory is made available for all "
13073 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
13077 #: ../src/guestfs-actions.pod:4975 ../fish/guestfish-actions.pod:3855
13079 "Note that you should not swap to existing guest swap partitions unless you "
13080 "know what you are doing. They may contain hibernation information, or other "
13081 "information that the guest doesn't want you to trash. You also risk leaking "
13082 "information about the host to the guest this way. Instead, attach a new "
13083 "host device to the guest and swap on that."
13087 #: ../src/guestfs-actions.pod:4984
13088 msgid "guestfs_swapon_file"
13092 #: ../src/guestfs-actions.pod:4986
13095 " int guestfs_swapon_file (guestfs_h *g,\n"
13096 "\t\tconst char *file);\n"
13101 #: ../src/guestfs-actions.pod:4989
13103 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
13108 #: ../src/guestfs-actions.pod:4994
13109 msgid "guestfs_swapon_label"
13113 #: ../src/guestfs-actions.pod:4996
13116 " int guestfs_swapon_label (guestfs_h *g,\n"
13117 "\t\tconst char *label);\n"
13122 #: ../src/guestfs-actions.pod:4999
13124 "This command enables swap to a labeled swap partition. See "
13125 "C<guestfs_swapon_device> for other notes."
13129 #: ../src/guestfs-actions.pod:5004
13130 msgid "guestfs_swapon_uuid"
13134 #: ../src/guestfs-actions.pod:5006
13137 " int guestfs_swapon_uuid (guestfs_h *g,\n"
13138 "\t\tconst char *uuid);\n"
13143 #: ../src/guestfs-actions.pod:5009
13145 "This command enables swap to a swap partition with the given UUID. See "
13146 "C<guestfs_swapon_device> for other notes."
13150 #: ../src/guestfs-actions.pod:5014
13151 msgid "guestfs_sync"
13155 #: ../src/guestfs-actions.pod:5016
13158 " int guestfs_sync (guestfs_h *g);\n"
13163 #: ../src/guestfs-actions.pod:5018 ../fish/guestfish-actions.pod:3887
13165 "This syncs the disk, so that any writes are flushed through to the "
13166 "underlying disk image."
13170 #: ../src/guestfs-actions.pod:5021 ../fish/guestfish-actions.pod:3890
13172 "You should always call this if you have modified a disk image, before "
13173 "closing the handle."
13177 #: ../src/guestfs-actions.pod:5026
13178 msgid "guestfs_tail"
13182 #: ../src/guestfs-actions.pod:5028
13185 " char **guestfs_tail (guestfs_h *g,\n"
13186 "\t\tconst char *path);\n"
13191 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3897
13193 "This command returns up to the last 10 lines of a file as a list of strings."
13197 #: ../src/guestfs-actions.pod:5041
13198 msgid "guestfs_tail_n"
13202 #: ../src/guestfs-actions.pod:5043
13205 " char **guestfs_tail_n (guestfs_h *g,\n"
13206 "\t\tint nrlines,\n"
13207 "\t\tconst char *path);\n"
13212 #: ../src/guestfs-actions.pod:5047 ../fish/guestfish-actions.pod:3907
13214 "If the parameter C<nrlines> is a positive number, this returns the last "
13215 "C<nrlines> lines of the file C<path>."
13219 #: ../src/guestfs-actions.pod:5050 ../fish/guestfish-actions.pod:3910
13221 "If the parameter C<nrlines> is a negative number, this returns lines from "
13222 "the file C<path>, starting with the C<-nrlines>th line."
13226 #: ../src/guestfs-actions.pod:5062
13227 msgid "guestfs_tar_in"
13231 #: ../src/guestfs-actions.pod:5064
13234 " int guestfs_tar_in (guestfs_h *g,\n"
13235 "\t\tconst char *tarfile,\n"
13236 "\t\tconst char *directory);\n"
13241 #: ../src/guestfs-actions.pod:5068 ../fish/guestfish-actions.pod:3922
13243 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13244 "tar file) into C<directory>."
13248 #: ../src/guestfs-actions.pod:5071
13250 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
13254 #: ../src/guestfs-actions.pod:5076
13255 msgid "guestfs_tar_out"
13259 #: ../src/guestfs-actions.pod:5078
13262 " int guestfs_tar_out (guestfs_h *g,\n"
13263 "\t\tconst char *directory,\n"
13264 "\t\tconst char *tarfile);\n"
13269 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3934
13271 "This command packs the contents of C<directory> and downloads it to local "
13276 #: ../src/guestfs-actions.pod:5085
13278 "To download a compressed tarball, use C<guestfs_tgz_out> or "
13279 "C<guestfs_txz_out>."
13283 #: ../src/guestfs-actions.pod:5090
13284 msgid "guestfs_tgz_in"
13288 #: ../src/guestfs-actions.pod:5092
13291 " int guestfs_tgz_in (guestfs_h *g,\n"
13292 "\t\tconst char *tarball,\n"
13293 "\t\tconst char *directory);\n"
13298 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3946
13300 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13301 "tar file) into C<directory>."
13305 #: ../src/guestfs-actions.pod:5099
13306 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
13310 #: ../src/guestfs-actions.pod:5103
13311 msgid "guestfs_tgz_out"
13315 #: ../src/guestfs-actions.pod:5105
13318 " int guestfs_tgz_out (guestfs_h *g,\n"
13319 "\t\tconst char *directory,\n"
13320 "\t\tconst char *tarball);\n"
13325 #: ../src/guestfs-actions.pod:5109 ../fish/guestfish-actions.pod:3957
13327 "This command packs the contents of C<directory> and downloads it to local "
13332 #: ../src/guestfs-actions.pod:5112
13333 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
13337 #: ../src/guestfs-actions.pod:5116
13338 msgid "guestfs_touch"
13342 #: ../src/guestfs-actions.pod:5118
13345 " int guestfs_touch (guestfs_h *g,\n"
13346 "\t\tconst char *path);\n"
13351 #: ../src/guestfs-actions.pod:5121 ../fish/guestfish-actions.pod:3968
13353 "Touch acts like the L<touch(1)> command. It can be used to update the "
13354 "timestamps on a file, or, if the file does not exist, to create a new zero-"
13359 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3972
13361 "This command only works on regular files, and will fail on other file types "
13362 "such as directories, symbolic links, block special etc."
13366 #: ../src/guestfs-actions.pod:5130
13367 msgid "guestfs_truncate"
13371 #: ../src/guestfs-actions.pod:5132
13374 " int guestfs_truncate (guestfs_h *g,\n"
13375 "\t\tconst char *path);\n"
13380 #: ../src/guestfs-actions.pod:5135 ../fish/guestfish-actions.pod:3979
13382 "This command truncates C<path> to a zero-length file. The file must exist "
13387 #: ../src/guestfs-actions.pod:5140
13388 msgid "guestfs_truncate_size"
13392 #: ../src/guestfs-actions.pod:5142
13395 " int guestfs_truncate_size (guestfs_h *g,\n"
13396 "\t\tconst char *path,\n"
13397 "\t\tint64_t size);\n"
13402 #: ../src/guestfs-actions.pod:5146 ../fish/guestfish-actions.pod:3986
13404 "This command truncates C<path> to size C<size> bytes. The file must exist "
13409 #: ../src/guestfs-actions.pod:5149
13411 "If the current file size is less than C<size> then the file is extended to "
13412 "the required size with zero bytes. This creates a sparse file (ie. disk "
13413 "blocks are not allocated for the file until you write to it). To create a "
13414 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
13418 #: ../src/guestfs-actions.pod:5157
13419 msgid "guestfs_tune2fs_l"
13423 #: ../src/guestfs-actions.pod:5159
13426 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
13427 "\t\tconst char *device);\n"
13432 #: ../src/guestfs-actions.pod:5162 ../fish/guestfish-actions.pod:3999
13434 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13439 #: ../src/guestfs-actions.pod:5165 ../fish/guestfish-actions.pod:4002
13441 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13442 "for more details. The list of fields returned isn't clearly defined, and "
13443 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13444 "and the filesystem itself."
13448 #: ../src/guestfs-actions.pod:5176
13449 msgid "guestfs_txz_in"
13453 #: ../src/guestfs-actions.pod:5178
13456 " int guestfs_txz_in (guestfs_h *g,\n"
13457 "\t\tconst char *tarball,\n"
13458 "\t\tconst char *directory);\n"
13463 #: ../src/guestfs-actions.pod:5182 ../fish/guestfish-actions.pod:4011
13465 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13466 "tar file) into C<directory>."
13470 #: ../src/guestfs-actions.pod:5187
13471 msgid "guestfs_txz_out"
13475 #: ../src/guestfs-actions.pod:5189
13478 " int guestfs_txz_out (guestfs_h *g,\n"
13479 "\t\tconst char *directory,\n"
13480 "\t\tconst char *tarball);\n"
13485 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:4020
13487 "This command packs the contents of C<directory> and downloads it to local "
13488 "file C<tarball> (as an xz compressed tar archive)."
13492 #: ../src/guestfs-actions.pod:5198
13493 msgid "guestfs_umask"
13497 #: ../src/guestfs-actions.pod:5200
13500 " int guestfs_umask (guestfs_h *g,\n"
13506 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:4029
13508 "This function sets the mask used for creating new files and device nodes to "
13513 #: ../src/guestfs-actions.pod:5206 ../fish/guestfish-actions.pod:4032
13515 "Typical umask values would be C<022> which creates new files with "
13516 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13517 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13521 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:4037
13523 "The default umask is C<022>. This is important because it means that "
13524 "directories and device nodes will be created with C<0644> or C<0755> mode "
13525 "even if you specify C<0777>."
13529 #: ../src/guestfs-actions.pod:5215
13531 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
13532 "C<guestfs_mkdir>."
13536 #: ../src/guestfs-actions.pod:5218 ../fish/guestfish-actions.pod:4044
13537 msgid "This call returns the previous umask."
13541 #: ../src/guestfs-actions.pod:5222
13542 msgid "guestfs_umount"
13546 #: ../src/guestfs-actions.pod:5224
13549 " int guestfs_umount (guestfs_h *g,\n"
13550 "\t\tconst char *pathordevice);\n"
13555 #: ../src/guestfs-actions.pod:5227 ../fish/guestfish-actions.pod:4052
13557 "This unmounts the given filesystem. The filesystem may be specified either "
13558 "by its mountpoint (path) or the device which contains the filesystem."
13562 #: ../src/guestfs-actions.pod:5233
13563 msgid "guestfs_umount_all"
13567 #: ../src/guestfs-actions.pod:5235
13570 " int guestfs_umount_all (guestfs_h *g);\n"
13575 #: ../src/guestfs-actions.pod:5237 ../fish/guestfish-actions.pod:4062
13576 msgid "This unmounts all mounted filesystems."
13580 #: ../src/guestfs-actions.pod:5239 ../fish/guestfish-actions.pod:4064
13581 msgid "Some internal mounts are not unmounted by this call."
13585 #: ../src/guestfs-actions.pod:5243
13586 msgid "guestfs_upload"
13590 #: ../src/guestfs-actions.pod:5245
13593 " int guestfs_upload (guestfs_h *g,\n"
13594 "\t\tconst char *filename,\n"
13595 "\t\tconst char *remotefilename);\n"
13600 #: ../src/guestfs-actions.pod:5249 ../src/guestfs-actions.pod:5265
13601 #: ../fish/guestfish-actions.pod:4070 ../fish/guestfish-actions.pod:4083
13602 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13606 #: ../src/guestfs-actions.pod:5254
13607 msgid "See also C<guestfs_download>."
13611 #: ../src/guestfs-actions.pod:5258
13612 msgid "guestfs_upload_offset"
13616 #: ../src/guestfs-actions.pod:5260
13619 " int guestfs_upload_offset (guestfs_h *g,\n"
13620 "\t\tconst char *filename,\n"
13621 "\t\tconst char *remotefilename,\n"
13622 "\t\tint64_t offset);\n"
13627 #: ../src/guestfs-actions.pod:5268 ../fish/guestfish-actions.pod:4086
13629 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
13630 "The intention is to overwrite parts of existing files or devices, although "
13631 "if a non-existant file is specified then it is created with a \"hole\" "
13632 "before C<offset>. The size of the data written is implicit in the size of "
13633 "the source C<filename>."
13637 #: ../src/guestfs-actions.pod:5275
13639 "Note that there is no limit on the amount of data that can be uploaded with "
13640 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
13641 "full amount unless an error occurs."
13645 #: ../src/guestfs-actions.pod:5280
13646 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
13650 #: ../src/guestfs-actions.pod:5284
13651 msgid "guestfs_utimens"
13655 #: ../src/guestfs-actions.pod:5286
13658 " int guestfs_utimens (guestfs_h *g,\n"
13659 "\t\tconst char *path,\n"
13660 "\t\tint64_t atsecs,\n"
13661 "\t\tint64_t atnsecs,\n"
13662 "\t\tint64_t mtsecs,\n"
13663 "\t\tint64_t mtnsecs);\n"
13668 #: ../src/guestfs-actions.pod:5293 ../fish/guestfish-actions.pod:4106
13669 msgid "This command sets the timestamps of a file with nanosecond precision."
13673 #: ../src/guestfs-actions.pod:5296 ../fish/guestfish-actions.pod:4109
13675 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
13680 #: ../src/guestfs-actions.pod:5299 ../fish/guestfish-actions.pod:4112
13682 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
13683 "nanoseconds from the epoch."
13687 #: ../src/guestfs-actions.pod:5302 ../fish/guestfish-actions.pod:4115
13689 "If the C<*nsecs> field contains the special value C<-1> then the "
13690 "corresponding timestamp is set to the current time. (The C<*secs> field is "
13691 "ignored in this case)."
13695 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:4119
13697 "If the C<*nsecs> field contains the special value C<-2> then the "
13698 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
13703 #: ../src/guestfs-actions.pod:5312 ../src/guestfs-structs.pod:175
13704 msgid "guestfs_version"
13708 #: ../src/guestfs-actions.pod:5314
13711 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
13716 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:4127
13718 "Return the libguestfs version number that the program is linked against."
13722 #: ../src/guestfs-actions.pod:5319 ../fish/guestfish-actions.pod:4130
13724 "Note that because of dynamic linking this is not necessarily the version of "
13725 "libguestfs that you compiled against. You can compile the program, and then "
13726 "at runtime dynamically link against a completely different C<libguestfs.so> "
13731 #: ../src/guestfs-actions.pod:5324 ../fish/guestfish-actions.pod:4135
13733 "This call was added in version C<1.0.58>. In previous versions of "
13734 "libguestfs there was no way to get the version number. From C code you can "
13735 "use dynamic linker functions to find out if this symbol exists (if it "
13736 "doesn't, then it's an earlier version)."
13740 #: ../src/guestfs-actions.pod:5330 ../fish/guestfish-actions.pod:4141
13742 "The call returns a structure with four elements. The first three (C<major>, "
13743 "C<minor> and C<release>) are numbers and correspond to the usual version "
13744 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13745 "but may be used for distro-specific information."
13749 #: ../src/guestfs-actions.pod:5336 ../fish/guestfish-actions.pod:4147
13751 "To construct the original version string: C<$major.$minor.$release$extra>"
13755 #: ../src/guestfs-actions.pod:5339 ../fish/guestfish-actions.pod:4150
13756 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13760 #: ../src/guestfs-actions.pod:5341
13762 "I<Note:> Don't use this call to test for availability of features. In "
13763 "enterprise distributions we backport features from later versions into "
13764 "earlier versions, making this an unreliable way to test for features. Use "
13765 "C<guestfs_available> instead."
13769 #: ../src/guestfs-actions.pod:5347
13771 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13772 "error. I<The caller must call C<guestfs_free_version> after use>."
13776 #: ../src/guestfs-actions.pod:5351
13777 msgid "guestfs_vfs_label"
13781 #: ../src/guestfs-actions.pod:5353
13784 " char *guestfs_vfs_label (guestfs_h *g,\n"
13785 "\t\tconst char *device);\n"
13790 #: ../src/guestfs-actions.pod:5356 ../fish/guestfish-actions.pod:4162
13791 msgid "This returns the filesystem label of the filesystem on C<device>."
13795 #: ../src/guestfs-actions.pod:5359 ../fish/guestfish-actions.pod:4165
13796 msgid "If the filesystem is unlabeled, this returns the empty string."
13800 #: ../src/guestfs-actions.pod:5361
13801 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13805 #: ../src/guestfs-actions.pod:5366
13806 msgid "guestfs_vfs_type"
13810 #: ../src/guestfs-actions.pod:5368
13813 " char *guestfs_vfs_type (guestfs_h *g,\n"
13814 "\t\tconst char *device);\n"
13819 #: ../src/guestfs-actions.pod:5371 ../fish/guestfish-actions.pod:4173
13821 "This command gets the filesystem type corresponding to the filesystem on "
13826 #: ../src/guestfs-actions.pod:5374 ../fish/guestfish-actions.pod:4176
13828 "For most filesystems, the result is the name of the Linux VFS module which "
13829 "would be used to mount this filesystem if you mounted it without specifying "
13830 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13834 #: ../src/guestfs-actions.pod:5382
13835 msgid "guestfs_vfs_uuid"
13839 #: ../src/guestfs-actions.pod:5384
13842 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13843 "\t\tconst char *device);\n"
13848 #: ../src/guestfs-actions.pod:5387 ../fish/guestfish-actions.pod:4185
13849 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13853 #: ../src/guestfs-actions.pod:5390 ../fish/guestfish-actions.pod:4188
13854 msgid "If the filesystem does not have a UUID, this returns the empty string."
13858 #: ../src/guestfs-actions.pod:5392
13859 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13863 #: ../src/guestfs-actions.pod:5397
13864 msgid "guestfs_vg_activate"
13868 #: ../src/guestfs-actions.pod:5399
13871 " int guestfs_vg_activate (guestfs_h *g,\n"
13872 "\t\tint activate,\n"
13873 "\t\tchar *const *volgroups);\n"
13878 #: ../src/guestfs-actions.pod:5403 ../fish/guestfish-actions.pod:4196
13880 "This command activates or (if C<activate> is false) deactivates all logical "
13881 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13882 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13883 "deactivated, then those devices disappear."
13887 #: ../src/guestfs-actions.pod:5409 ../fish/guestfish-actions.pod:4202
13888 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13892 #: ../src/guestfs-actions.pod:5411 ../fish/guestfish-actions.pod:4204
13894 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13895 "activated or deactivated."
13899 #: ../src/guestfs-actions.pod:5416
13900 msgid "guestfs_vg_activate_all"
13904 #: ../src/guestfs-actions.pod:5418
13907 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13908 "\t\tint activate);\n"
13913 #: ../src/guestfs-actions.pod:5421 ../fish/guestfish-actions.pod:4211
13915 "This command activates or (if C<activate> is false) deactivates all logical "
13916 "volumes in all volume groups. If activated, then they are made known to the "
13917 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13918 "those devices disappear."
13922 #: ../src/guestfs-actions.pod:5427 ../fish/guestfish-actions.pod:4217
13923 msgid "This command is the same as running C<vgchange -a y|n>"
13927 #: ../src/guestfs-actions.pod:5431
13928 msgid "guestfs_vgcreate"
13932 #: ../src/guestfs-actions.pod:5433
13935 " int guestfs_vgcreate (guestfs_h *g,\n"
13936 "\t\tconst char *volgroup,\n"
13937 "\t\tchar *const *physvols);\n"
13942 #: ../src/guestfs-actions.pod:5437 ../fish/guestfish-actions.pod:4223
13944 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13945 "of physical volumes C<physvols>."
13949 #: ../src/guestfs-actions.pod:5442
13950 msgid "guestfs_vglvuuids"
13954 #: ../src/guestfs-actions.pod:5444
13957 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13958 "\t\tconst char *vgname);\n"
13963 #: ../src/guestfs-actions.pod:5447 ../fish/guestfish-actions.pod:4230
13965 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13966 "volumes created in this volume group."
13970 #: ../src/guestfs-actions.pod:5450
13972 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13973 "associate logical volumes and volume groups."
13977 #: ../src/guestfs-actions.pod:5453
13978 msgid "See also C<guestfs_vgpvuuids>."
13982 #: ../src/guestfs-actions.pod:5459
13983 msgid "guestfs_vgpvuuids"
13987 #: ../src/guestfs-actions.pod:5461
13990 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13991 "\t\tconst char *vgname);\n"
13996 #: ../src/guestfs-actions.pod:5464 ../fish/guestfish-actions.pod:4242
13998 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13999 "volumes that this volume group resides on."
14003 #: ../src/guestfs-actions.pod:5467
14005 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
14006 "associate physical volumes and volume groups."
14010 #: ../src/guestfs-actions.pod:5470
14011 msgid "See also C<guestfs_vglvuuids>."
14015 #: ../src/guestfs-actions.pod:5476
14016 msgid "guestfs_vgremove"
14020 #: ../src/guestfs-actions.pod:5478
14023 " int guestfs_vgremove (guestfs_h *g,\n"
14024 "\t\tconst char *vgname);\n"
14029 #: ../src/guestfs-actions.pod:5481 ../fish/guestfish-actions.pod:4254
14030 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14034 #: ../src/guestfs-actions.pod:5483 ../fish/guestfish-actions.pod:4256
14036 "This also forcibly removes all logical volumes in the volume group (if any)."
14040 #: ../src/guestfs-actions.pod:5488
14041 msgid "guestfs_vgrename"
14045 #: ../src/guestfs-actions.pod:5490
14048 " int guestfs_vgrename (guestfs_h *g,\n"
14049 "\t\tconst char *volgroup,\n"
14050 "\t\tconst char *newvolgroup);\n"
14055 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:4263
14056 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14060 #: ../src/guestfs-actions.pod:5498
14061 msgid "guestfs_vgs"
14065 #: ../src/guestfs-actions.pod:5500
14068 " char **guestfs_vgs (guestfs_h *g);\n"
14073 #: ../src/guestfs-actions.pod:5502 ../fish/guestfish-actions.pod:4269
14075 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14080 #: ../src/guestfs-actions.pod:5505 ../fish/guestfish-actions.pod:4272
14082 "This returns a list of just the volume group names that were detected (eg. "
14087 #: ../src/guestfs-actions.pod:5508
14088 msgid "See also C<guestfs_vgs_full>."
14092 #: ../src/guestfs-actions.pod:5514
14093 msgid "guestfs_vgs_full"
14097 #: ../src/guestfs-actions.pod:5516
14100 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
14105 #: ../src/guestfs-actions.pod:5518 ../fish/guestfish-actions.pod:4281
14107 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14108 "> command. The \"full\" version includes all fields."
14112 #: ../src/guestfs-actions.pod:5521
14114 "This function returns a C<struct guestfs_lvm_vg_list *> (see E<lt>guestfs-"
14115 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
14116 "C<guestfs_free_lvm_vg_list> after use>."
14120 #: ../src/guestfs-actions.pod:5526
14121 msgid "guestfs_vgscan"
14125 #: ../src/guestfs-actions.pod:5528
14128 " int guestfs_vgscan (guestfs_h *g);\n"
14133 #: ../src/guestfs-actions.pod:5530 ../fish/guestfish-actions.pod:4288
14135 "This rescans all block devices and rebuilds the list of LVM physical "
14136 "volumes, volume groups and logical volumes."
14140 #: ../src/guestfs-actions.pod:5535
14141 msgid "guestfs_vguuid"
14145 #: ../src/guestfs-actions.pod:5537
14148 " char *guestfs_vguuid (guestfs_h *g,\n"
14149 "\t\tconst char *vgname);\n"
14154 #: ../src/guestfs-actions.pod:5540 ../fish/guestfish-actions.pod:4295
14155 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14159 #: ../src/guestfs-actions.pod:5545
14160 msgid "guestfs_wait_ready"
14164 #: ../src/guestfs-actions.pod:5547
14167 " int guestfs_wait_ready (guestfs_h *g);\n"
14172 #: ../src/guestfs-actions.pod:5549
14173 msgid "This function is a no op."
14177 #: ../src/guestfs-actions.pod:5551
14179 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
14180 "calling C<guestfs_launch> to wait for the launch to complete. However this "
14181 "is no longer necessary because C<guestfs_launch> now does the waiting."
14185 #: ../src/guestfs-actions.pod:5556
14187 "If you see any calls to this function in code then you can just remove them, "
14188 "unless you want to retain compatibility with older versions of the API."
14192 #: ../src/guestfs-actions.pod:5562
14193 msgid "guestfs_wc_c"
14197 #: ../src/guestfs-actions.pod:5564
14200 " int guestfs_wc_c (guestfs_h *g,\n"
14201 "\t\tconst char *path);\n"
14206 #: ../src/guestfs-actions.pod:5567 ../fish/guestfish-actions.pod:4301
14208 "This command counts the characters in a file, using the C<wc -c> external "
14213 #: ../src/guestfs-actions.pod:5572
14214 msgid "guestfs_wc_l"
14218 #: ../src/guestfs-actions.pod:5574
14221 " int guestfs_wc_l (guestfs_h *g,\n"
14222 "\t\tconst char *path);\n"
14227 #: ../src/guestfs-actions.pod:5577 ../fish/guestfish-actions.pod:4308
14229 "This command counts the lines in a file, using the C<wc -l> external command."
14233 #: ../src/guestfs-actions.pod:5582
14234 msgid "guestfs_wc_w"
14238 #: ../src/guestfs-actions.pod:5584
14241 " int guestfs_wc_w (guestfs_h *g,\n"
14242 "\t\tconst char *path);\n"
14247 #: ../src/guestfs-actions.pod:5587 ../fish/guestfish-actions.pod:4315
14249 "This command counts the words in a file, using the C<wc -w> external command."
14253 #: ../src/guestfs-actions.pod:5592
14254 msgid "guestfs_write"
14258 #: ../src/guestfs-actions.pod:5594
14261 " int guestfs_write (guestfs_h *g,\n"
14262 "\t\tconst char *path,\n"
14263 "\t\tconst char *content,\n"
14264 "\t\tsize_t content_size);\n"
14269 #: ../src/guestfs-actions.pod:5599 ../fish/guestfish-actions.pod:4322
14271 "This call creates a file called C<path>. The content of the file is the "
14272 "string C<content> (which can contain any 8 bit data)."
14276 #: ../src/guestfs-actions.pod:5607
14277 msgid "guestfs_write_file"
14281 #: ../src/guestfs-actions.pod:5609
14284 " int guestfs_write_file (guestfs_h *g,\n"
14285 "\t\tconst char *path,\n"
14286 "\t\tconst char *content,\n"
14292 #: ../src/guestfs-actions.pod:5614 ../fish/guestfish-actions.pod:4332
14294 "This call creates a file called C<path>. The contents of the file is the "
14295 "string C<content> (which can contain any 8 bit data), with length C<size>."
14299 #: ../src/guestfs-actions.pod:5618 ../fish/guestfish-actions.pod:4336
14301 "As a special case, if C<size> is C<0> then the length is calculated using "
14302 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14306 #: ../src/guestfs-actions.pod:5622 ../fish/guestfish-actions.pod:4340
14308 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14309 "I<not> work, even if the length is specified."
14313 #: ../src/guestfs-actions.pod:5630 ../fish/guestfish-actions.pod:4346
14315 "This function is deprecated. In new code, use the C<write> call instead."
14319 #: ../src/guestfs-actions.pod:5637
14320 msgid "guestfs_zegrep"
14324 #: ../src/guestfs-actions.pod:5639
14327 " char **guestfs_zegrep (guestfs_h *g,\n"
14328 "\t\tconst char *regex,\n"
14329 "\t\tconst char *path);\n"
14334 #: ../src/guestfs-actions.pod:5643 ../fish/guestfish-actions.pod:4357
14336 "This calls the external C<zegrep> program and returns the matching lines."
14340 #: ../src/guestfs-actions.pod:5653
14341 msgid "guestfs_zegrepi"
14345 #: ../src/guestfs-actions.pod:5655
14348 " char **guestfs_zegrepi (guestfs_h *g,\n"
14349 "\t\tconst char *regex,\n"
14350 "\t\tconst char *path);\n"
14355 #: ../src/guestfs-actions.pod:5659 ../fish/guestfish-actions.pod:4367
14357 "This calls the external C<zegrep -i> program and returns the matching lines."
14361 #: ../src/guestfs-actions.pod:5669
14362 msgid "guestfs_zero"
14366 #: ../src/guestfs-actions.pod:5671
14369 " int guestfs_zero (guestfs_h *g,\n"
14370 "\t\tconst char *device);\n"
14375 #: ../src/guestfs-actions.pod:5674 ../fish/guestfish-actions.pod:4377
14376 msgid "This command writes zeroes over the first few blocks of C<device>."
14380 #: ../src/guestfs-actions.pod:5676 ../fish/guestfish-actions.pod:4379
14382 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14383 "securely wipe the device). It should be sufficient to remove any partition "
14384 "tables, filesystem superblocks and so on."
14388 #: ../src/guestfs-actions.pod:5680
14389 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
14393 #: ../src/guestfs-actions.pod:5689
14394 msgid "guestfs_zero_device"
14398 #: ../src/guestfs-actions.pod:5691
14401 " int guestfs_zero_device (guestfs_h *g,\n"
14402 "\t\tconst char *device);\n"
14407 #: ../src/guestfs-actions.pod:5694
14409 "This command writes zeroes over the entire C<device>. Compare with "
14410 "C<guestfs_zero> which just zeroes the first few blocks of a device."
14414 #: ../src/guestfs-actions.pod:5708
14415 msgid "guestfs_zerofree"
14419 #: ../src/guestfs-actions.pod:5710
14422 " int guestfs_zerofree (guestfs_h *g,\n"
14423 "\t\tconst char *device);\n"
14428 #: ../src/guestfs-actions.pod:5713 ../fish/guestfish-actions.pod:4400
14430 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14431 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14432 "possible to compress the filesystem more effectively."
14436 #: ../src/guestfs-actions.pod:5718 ../fish/guestfish-actions.pod:4405
14437 msgid "You should B<not> run this program if the filesystem is mounted."
14441 #: ../src/guestfs-actions.pod:5721 ../fish/guestfish-actions.pod:4408
14443 "It is possible that using this program can damage the filesystem or data on "
14448 #: ../src/guestfs-actions.pod:5726
14449 msgid "guestfs_zfgrep"
14453 #: ../src/guestfs-actions.pod:5728
14456 " char **guestfs_zfgrep (guestfs_h *g,\n"
14457 "\t\tconst char *pattern,\n"
14458 "\t\tconst char *path);\n"
14463 #: ../src/guestfs-actions.pod:5732 ../fish/guestfish-actions.pod:4415
14465 "This calls the external C<zfgrep> program and returns the matching lines."
14469 #: ../src/guestfs-actions.pod:5742
14470 msgid "guestfs_zfgrepi"
14474 #: ../src/guestfs-actions.pod:5744
14477 " char **guestfs_zfgrepi (guestfs_h *g,\n"
14478 "\t\tconst char *pattern,\n"
14479 "\t\tconst char *path);\n"
14484 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:4425
14486 "This calls the external C<zfgrep -i> program and returns the matching lines."
14490 #: ../src/guestfs-actions.pod:5758
14491 msgid "guestfs_zfile"
14495 #: ../src/guestfs-actions.pod:5760
14498 " char *guestfs_zfile (guestfs_h *g,\n"
14499 "\t\tconst char *meth,\n"
14500 "\t\tconst char *path);\n"
14505 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:4435
14507 "This command runs C<file> after first decompressing C<path> using C<method>."
14511 #: ../src/guestfs-actions.pod:5767 ../fish/guestfish-actions.pod:4438
14512 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14516 #: ../src/guestfs-actions.pod:5769
14518 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
14523 #: ../src/guestfs-actions.pod:5775 ../fish/guestfish-actions.pod:4443
14525 "This function is deprecated. In new code, use the C<file> call instead."
14529 #: ../src/guestfs-actions.pod:5782
14530 msgid "guestfs_zgrep"
14534 #: ../src/guestfs-actions.pod:5784
14537 " char **guestfs_zgrep (guestfs_h *g,\n"
14538 "\t\tconst char *regex,\n"
14539 "\t\tconst char *path);\n"
14544 #: ../src/guestfs-actions.pod:5788 ../fish/guestfish-actions.pod:4454
14546 "This calls the external C<zgrep> program and returns the matching lines."
14550 #: ../src/guestfs-actions.pod:5798
14551 msgid "guestfs_zgrepi"
14555 #: ../src/guestfs-actions.pod:5800
14558 " char **guestfs_zgrepi (guestfs_h *g,\n"
14559 "\t\tconst char *regex,\n"
14560 "\t\tconst char *path);\n"
14565 #: ../src/guestfs-actions.pod:5804 ../fish/guestfish-actions.pod:4464
14567 "This calls the external C<zgrep -i> program and returns the matching lines."
14571 #: ../src/guestfs-availability.pod:3
14576 #: ../src/guestfs-availability.pod:5
14578 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
14579 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
14580 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
14581 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
14582 "L</guestfs_aug_save> L</guestfs_aug_set>"
14586 #: ../src/guestfs-availability.pod:21
14591 #: ../src/guestfs-availability.pod:23
14593 "The following functions: L</guestfs_inotify_add_watch> L</"
14594 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
14595 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
14599 #: ../src/guestfs-availability.pod:31
14600 msgid "B<linuxfsuuid>"
14604 #: ../src/guestfs-availability.pod:33
14606 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
14607 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
14611 #: ../src/guestfs-availability.pod:40
14612 msgid "B<linuxmodules>"
14616 #: ../src/guestfs-availability.pod:42
14617 msgid "The following functions: L</guestfs_modprobe>"
14621 #: ../src/guestfs-availability.pod:45
14622 msgid "B<linuxxattrs>"
14626 #: ../src/guestfs-availability.pod:47
14628 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
14629 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
14630 "guestfs_removexattr> L</guestfs_setxattr>"
14634 #: ../src/guestfs-availability.pod:56
14639 #: ../src/guestfs-availability.pod:58
14641 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
14642 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
14643 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
14647 #: ../src/guestfs-availability.pod:67
14652 #: ../src/guestfs-availability.pod:69
14654 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
14655 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
14656 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
14657 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
14658 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
14659 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
14660 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
14664 #: ../src/guestfs-availability.pod:92
14669 #: ../src/guestfs-availability.pod:94
14671 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
14672 "guestfs_mknod_b> L</guestfs_mknod_c>"
14676 #: ../src/guestfs-availability.pod:100
14681 #: ../src/guestfs-availability.pod:102
14682 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
14686 #: ../src/guestfs-availability.pod:105
14687 msgid "B<ntfsprogs>"
14691 #: ../src/guestfs-availability.pod:107
14693 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
14697 #: ../src/guestfs-availability.pod:111
14698 msgid "B<realpath>"
14702 #: ../src/guestfs-availability.pod:113
14703 msgid "The following functions: L</guestfs_realpath>"
14707 #: ../src/guestfs-availability.pod:116
14712 #: ../src/guestfs-availability.pod:118
14714 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
14715 "guestfs_scrub_freespace>"
14719 #: ../src/guestfs-availability.pod:123
14724 #: ../src/guestfs-availability.pod:125
14725 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14729 #: ../src/guestfs-availability.pod:129
14734 #: ../src/guestfs-availability.pod:131
14735 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14739 #: ../src/guestfs-availability.pod:135
14740 msgid "B<zerofree>"
14744 #: ../src/guestfs-availability.pod:137
14745 msgid "The following functions: L</guestfs_zerofree>"
14749 #: ../src/guestfs-structs.pod:1
14750 msgid "guestfs_int_bool"
14754 #: ../src/guestfs-structs.pod:3
14757 " struct guestfs_int_bool {\n"
14765 #: ../src/guestfs-structs.pod:8
14768 " struct guestfs_int_bool_list {\n"
14769 " uint32_t len; /* Number of elements in list. */\n"
14770 " struct guestfs_int_bool *val; /* Elements. */\n"
14776 #: ../src/guestfs-structs.pod:13
14779 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14780 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14785 #: ../src/guestfs-structs.pod:16
14786 msgid "guestfs_lvm_pv"
14790 #: ../src/guestfs-structs.pod:18
14793 " struct guestfs_lvm_pv {\n"
14794 " char *pv_name;\n"
14795 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14796 " char pv_uuid[32];\n"
14798 " uint64_t pv_size;\n"
14799 " uint64_t dev_size;\n"
14800 " uint64_t pv_free;\n"
14801 " uint64_t pv_used;\n"
14802 " char *pv_attr;\n"
14803 " int64_t pv_pe_count;\n"
14804 " int64_t pv_pe_alloc_count;\n"
14805 " char *pv_tags;\n"
14806 " uint64_t pe_start;\n"
14807 " int64_t pv_mda_count;\n"
14808 " uint64_t pv_mda_free;\n"
14814 #: ../src/guestfs-structs.pod:36
14817 " struct guestfs_lvm_pv_list {\n"
14818 " uint32_t len; /* Number of elements in list. */\n"
14819 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14825 #: ../src/guestfs-structs.pod:41
14828 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14829 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14834 #: ../src/guestfs-structs.pod:44
14835 msgid "guestfs_lvm_vg"
14839 #: ../src/guestfs-structs.pod:46
14842 " struct guestfs_lvm_vg {\n"
14843 " char *vg_name;\n"
14844 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14845 " char vg_uuid[32];\n"
14847 " char *vg_attr;\n"
14848 " uint64_t vg_size;\n"
14849 " uint64_t vg_free;\n"
14850 " char *vg_sysid;\n"
14851 " uint64_t vg_extent_size;\n"
14852 " int64_t vg_extent_count;\n"
14853 " int64_t vg_free_count;\n"
14854 " int64_t max_lv;\n"
14855 " int64_t max_pv;\n"
14856 " int64_t pv_count;\n"
14857 " int64_t lv_count;\n"
14858 " int64_t snap_count;\n"
14859 " int64_t vg_seqno;\n"
14860 " char *vg_tags;\n"
14861 " int64_t vg_mda_count;\n"
14862 " uint64_t vg_mda_free;\n"
14868 #: ../src/guestfs-structs.pod:69
14871 " struct guestfs_lvm_vg_list {\n"
14872 " uint32_t len; /* Number of elements in list. */\n"
14873 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14879 #: ../src/guestfs-structs.pod:74
14882 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14883 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14888 #: ../src/guestfs-structs.pod:77
14889 msgid "guestfs_lvm_lv"
14893 #: ../src/guestfs-structs.pod:79
14896 " struct guestfs_lvm_lv {\n"
14897 " char *lv_name;\n"
14898 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14899 " char lv_uuid[32];\n"
14900 " char *lv_attr;\n"
14901 " int64_t lv_major;\n"
14902 " int64_t lv_minor;\n"
14903 " int64_t lv_kernel_major;\n"
14904 " int64_t lv_kernel_minor;\n"
14905 " uint64_t lv_size;\n"
14906 " int64_t seg_count;\n"
14908 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14909 " float snap_percent;\n"
14910 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14911 " float copy_percent;\n"
14912 " char *move_pv;\n"
14913 " char *lv_tags;\n"
14914 " char *mirror_log;\n"
14915 " char *modules;\n"
14921 #: ../src/guestfs-structs.pod:101
14924 " struct guestfs_lvm_lv_list {\n"
14925 " uint32_t len; /* Number of elements in list. */\n"
14926 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14932 #: ../src/guestfs-structs.pod:106
14935 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14936 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14941 #: ../src/guestfs-structs.pod:111
14944 " struct guestfs_stat {\n"
14948 " int64_t nlink;\n"
14953 " int64_t blksize;\n"
14954 " int64_t blocks;\n"
14955 " int64_t atime;\n"
14956 " int64_t mtime;\n"
14957 " int64_t ctime;\n"
14963 #: ../src/guestfs-structs.pod:127
14966 " struct guestfs_stat_list {\n"
14967 " uint32_t len; /* Number of elements in list. */\n"
14968 " struct guestfs_stat *val; /* Elements. */\n"
14974 #: ../src/guestfs-structs.pod:132
14977 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14978 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14983 #: ../src/guestfs-structs.pod:137
14986 " struct guestfs_statvfs {\n"
14987 " int64_t bsize;\n"
14988 " int64_t frsize;\n"
14989 " int64_t blocks;\n"
14990 " int64_t bfree;\n"
14991 " int64_t bavail;\n"
14992 " int64_t files;\n"
14993 " int64_t ffree;\n"
14994 " int64_t favail;\n"
14997 " int64_t namemax;\n"
15003 #: ../src/guestfs-structs.pod:151
15006 " struct guestfs_statvfs_list {\n"
15007 " uint32_t len; /* Number of elements in list. */\n"
15008 " struct guestfs_statvfs *val; /* Elements. */\n"
15014 #: ../src/guestfs-structs.pod:156
15017 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
15018 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
15023 #: ../src/guestfs-structs.pod:159
15024 msgid "guestfs_dirent"
15028 #: ../src/guestfs-structs.pod:161
15031 " struct guestfs_dirent {\n"
15040 #: ../src/guestfs-structs.pod:167
15043 " struct guestfs_dirent_list {\n"
15044 " uint32_t len; /* Number of elements in list. */\n"
15045 " struct guestfs_dirent *val; /* Elements. */\n"
15051 #: ../src/guestfs-structs.pod:172
15054 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
15055 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
15060 #: ../src/guestfs-structs.pod:177
15063 " struct guestfs_version {\n"
15064 " int64_t major;\n"
15065 " int64_t minor;\n"
15066 " int64_t release;\n"
15073 #: ../src/guestfs-structs.pod:184
15076 " struct guestfs_version_list {\n"
15077 " uint32_t len; /* Number of elements in list. */\n"
15078 " struct guestfs_version *val; /* Elements. */\n"
15084 #: ../src/guestfs-structs.pod:189
15087 " void guestfs_free_version (struct guestfs_free_version *);\n"
15088 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
15093 #: ../src/guestfs-structs.pod:192
15094 msgid "guestfs_xattr"
15098 #: ../src/guestfs-structs.pod:194
15101 " struct guestfs_xattr {\n"
15102 " char *attrname;\n"
15103 " /* The next two fields describe a byte array. */\n"
15104 " uint32_t attrval_len;\n"
15105 " char *attrval;\n"
15111 #: ../src/guestfs-structs.pod:201
15114 " struct guestfs_xattr_list {\n"
15115 " uint32_t len; /* Number of elements in list. */\n"
15116 " struct guestfs_xattr *val; /* Elements. */\n"
15122 #: ../src/guestfs-structs.pod:206
15125 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
15126 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
15131 #: ../src/guestfs-structs.pod:209
15132 msgid "guestfs_inotify_event"
15136 #: ../src/guestfs-structs.pod:211
15139 " struct guestfs_inotify_event {\n"
15140 " int64_t in_wd;\n"
15141 " uint32_t in_mask;\n"
15142 " uint32_t in_cookie;\n"
15143 " char *in_name;\n"
15149 #: ../src/guestfs-structs.pod:218
15152 " struct guestfs_inotify_event_list {\n"
15153 " uint32_t len; /* Number of elements in list. */\n"
15154 " struct guestfs_inotify_event *val; /* Elements. */\n"
15160 #: ../src/guestfs-structs.pod:223
15163 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
15164 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
15169 #: ../src/guestfs-structs.pod:226
15170 msgid "guestfs_partition"
15174 #: ../src/guestfs-structs.pod:228
15177 " struct guestfs_partition {\n"
15178 " int32_t part_num;\n"
15179 " uint64_t part_start;\n"
15180 " uint64_t part_end;\n"
15181 " uint64_t part_size;\n"
15187 #: ../src/guestfs-structs.pod:235
15190 " struct guestfs_partition_list {\n"
15191 " uint32_t len; /* Number of elements in list. */\n"
15192 " struct guestfs_partition *val; /* Elements. */\n"
15198 #: ../src/guestfs-structs.pod:240
15201 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
15202 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
15207 #: ../fish/guestfish.pod:5
15208 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15212 #: ../fish/guestfish.pod:9
15215 " guestfish [--options] [commands]\n"
15220 #: ../fish/guestfish.pod:11
15228 #: ../fish/guestfish.pod:13
15231 " guestfish -a disk.img\n"
15236 #: ../fish/guestfish.pod:15
15239 " guestfish -a disk.img -m dev[:mountpoint]\n"
15244 #: ../fish/guestfish.pod:17
15247 " guestfish -d libvirt-domain\n"
15252 #: ../fish/guestfish.pod:19
15255 " guestfish -a disk.img -i\n"
15260 #: ../fish/guestfish.pod:21
15263 " guestfish -d libvirt-domain -i\n"
15268 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
15269 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
15270 #: ../tools/virt-rescue.pl:41
15275 #: ../fish/guestfish.pod:25
15277 "Using guestfish in read/write mode on live virtual machines can be "
15278 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15279 "option to use guestfish safely if the disk image or virtual machine might be "
15284 #: ../fish/guestfish.pod:32
15286 "Guestfish is a shell and command-line tool for examining and modifying "
15287 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15288 "functionality of the guestfs API, see L<guestfs(3)>."
15292 #: ../fish/guestfish.pod:36
15294 "Guestfish gives you structured access to the libguestfs API, from shell "
15295 "scripts or the command line or interactively. If you want to rescue a "
15296 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15301 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:800
15302 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
15303 #: ../tools/virt-resize.pl:66 ../tools/virt-cat.pl:50 ../tools/virt-tar.pl:45
15308 #: ../fish/guestfish.pod:43
15309 msgid "As an interactive shell"
15313 #: ../fish/guestfish.pod:45
15321 #: ../fish/guestfish.pod:47
15324 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15325 " editing virtual machine filesystems.\n"
15330 #: ../fish/guestfish.pod:50
15333 " Type: 'help' for a list of commands\n"
15334 " 'man' to read the manual\n"
15335 " 'quit' to quit the shell\n"
15340 #: ../fish/guestfish.pod:54
15343 " ><fs> add-ro disk.img\n"
15345 " ><fs> list-filesystems\n"
15346 " /dev/sda1: ext4\n"
15347 " /dev/vg_guest/lv_root: ext4\n"
15348 " /dev/vg_guest/lv_swap: swap\n"
15349 " ><fs> mount /dev/vg_guest/lv_root /\n"
15350 " ><fs> cat /etc/fstab\n"
15352 " # Created by anaconda\n"
15359 #: ../fish/guestfish.pod:67
15360 msgid "From shell scripts"
15364 #: ../fish/guestfish.pod:69
15365 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15369 #: ../fish/guestfish.pod:71
15372 " guestfish <<_EOF_\n"
15375 " mount /dev/vg_guest/lv_root /\n"
15376 " write /etc/motd \"Welcome, new users\"\n"
15382 #: ../fish/guestfish.pod:78
15383 msgid "List the LVM logical volumes in a disk image:"
15387 #: ../fish/guestfish.pod:80
15390 " guestfish -a disk.img --ro <<_EOF_\n"
15398 #: ../fish/guestfish.pod:85
15399 msgid "List all the filesystems in a disk image:"
15403 #: ../fish/guestfish.pod:87
15406 " guestfish -a disk.img --ro <<_EOF_\n"
15408 " list-filesystems\n"
15414 #: ../fish/guestfish.pod:92
15415 msgid "On one command line"
15419 #: ../fish/guestfish.pod:94
15420 msgid "Update C</etc/resolv.conf> in a guest:"
15424 #: ../fish/guestfish.pod:96
15428 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15429 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15434 #: ../fish/guestfish.pod:100
15435 msgid "Edit C</boot/grub/grub.conf> interactively:"
15439 #: ../fish/guestfish.pod:102
15442 " guestfish --add disk.img \\\n"
15443 " --mount /dev/vg_guest/lv_root \\\n"
15444 " --mount /dev/sda1:/boot \\\n"
15445 " edit /boot/grub/grub.conf\n"
15450 #: ../fish/guestfish.pod:107
15451 msgid "Mount disks automatically"
15455 #: ../fish/guestfish.pod:109
15457 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
15461 #: ../fish/guestfish.pod:112
15464 " guestfish --ro -a disk.img -i cat /etc/group\n"
15469 #: ../fish/guestfish.pod:114
15472 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15477 #: ../fish/guestfish.pod:116
15478 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15482 #: ../fish/guestfish.pod:118
15485 " guestfish -a disk.img -i edit /boot/grub/grub.conf\n"
15490 #: ../fish/guestfish.pod:120
15491 msgid "As a script interpreter"
15495 #: ../fish/guestfish.pod:122
15496 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15500 #: ../fish/guestfish.pod:124
15503 " #!/usr/bin/guestfish -f\n"
15504 " sparse test1.img 100M\n"
15506 " part-disk /dev/sda mbr\n"
15507 " mkfs ext2 /dev/sda1\n"
15512 #: ../fish/guestfish.pod:130
15513 msgid "Start with a prepared disk"
15517 #: ../fish/guestfish.pod:132
15519 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15520 "single ext2-formatted partition:"
15524 #: ../fish/guestfish.pod:135
15527 " guestfish -N fs\n"
15532 #: ../fish/guestfish.pod:137
15533 msgid "To list what is available do:"
15537 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:791
15540 " guestfish -N help | less\n"
15545 #: ../fish/guestfish.pod:141
15546 msgid "Remote control"
15550 #: ../fish/guestfish.pod:143
15553 " eval `guestfish --listen`\n"
15554 " guestfish --remote add-ro disk.img\n"
15555 " guestfish --remote run\n"
15556 " guestfish --remote lvs\n"
15561 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
15562 #: ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68
15563 #: ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171
15564 #: ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257
15565 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-cat.pl:79
15566 #: ../tools/virt-tar.pl:98 ../tools/virt-rescue.pl:103
15567 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
15572 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:124
15573 #: ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80
15574 #: ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86
15575 #: ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58
15576 #: ../tools/virt-cat.pl:87 ../tools/virt-tar.pl:106
15577 #: ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161
15578 #: ../tools/virt-list-partitions.pl:59
15583 #: ../fish/guestfish.pod:154
15584 msgid "Displays general help on options."
15588 #: ../fish/guestfish.pod:156
15589 msgid "B<-h> | B<--cmd-help>"
15593 #: ../fish/guestfish.pod:158
15594 msgid "Lists all available guestfish commands."
15598 #: ../fish/guestfish.pod:160
15599 msgid "B<-h cmd> | B<--cmd-help cmd>"
15603 #: ../fish/guestfish.pod:162
15604 msgid "Displays detailed help on a single command C<cmd>."
15608 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
15609 msgid "B<-a image> | B<--add image>"
15613 #: ../fish/guestfish.pod:166
15614 msgid "Add a block device or virtual machine image to the shell."
15618 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
15620 "The format of the disk image is auto-detected. To override this and force a "
15621 "particular format use the I<--format=..> option."
15625 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
15626 msgid "B<-c URI> | B<--connect URI>"
15630 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
15632 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15633 "URI to use. The default is to use the default libvirt connection."
15637 #: ../fish/guestfish.pod:177 ../fuse/guestmount.pod:90
15638 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
15642 #: ../fish/guestfish.pod:179 ../fuse/guestmount.pod:92
15644 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15645 "used, then any libvirt domain can be used. However in write mode, only "
15646 "libvirt domains which are shut down can be named here."
15650 #: ../fish/guestfish.pod:183
15651 msgid "B<-D> | B<--no-dest-paths>"
15655 #: ../fish/guestfish.pod:185
15657 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15658 "to hit the tab key to complete paths on the guest filesystem, but this "
15659 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15660 "allow this feature to be disabled."
15664 #: ../fish/guestfish.pod:190
15665 msgid "B<--echo-keys>"
15669 #: ../fish/guestfish.pod:192
15671 "When prompting for keys and passphrases, guestfish normally turns echoing "
15672 "off so you cannot see what you are typing. If you are not worried about "
15673 "Tempest attacks and there is no one else in the room you can specify this "
15674 "flag to see what you are typing."
15678 #: ../fish/guestfish.pod:197
15679 msgid "B<-f file> | B<--file file>"
15683 #: ../fish/guestfish.pod:199
15684 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15688 #: ../fish/guestfish.pod:202
15691 " #!/usr/bin/guestfish -f\n"
15696 #: ../fish/guestfish.pod:204 ../fuse/guestmount.pod:108
15697 msgid "B<--format=raw|qcow2|..> | B<--format>"
15701 #: ../fish/guestfish.pod:206 ../fuse/guestmount.pod:110
15703 "The default for the I<-a> option is to auto-detect the format of the disk "
15704 "image. Using this forces the disk format for I<-a> options which follow on "
15705 "the command line. Using I<--format> with no argument switches back to auto-"
15706 "detection for subsequent I<-a> options."
15710 #: ../fish/guestfish.pod:211 ../fish/guestfish.pod:504
15711 #: ../inspector/virt-inspector.pl:549
15712 msgid "For example:"
15716 #: ../fish/guestfish.pod:213
15719 " guestfish --format=raw -a disk.img\n"
15724 #: ../fish/guestfish.pod:215
15725 msgid "forces raw format (no auto-detection) for C<disk.img>."
15729 #: ../fish/guestfish.pod:217
15732 " guestfish --format=raw -a disk.img --format -a another.img\n"
15737 #: ../fish/guestfish.pod:219
15739 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
15740 "detection for C<another.img>."
15744 #: ../fish/guestfish.pod:222
15746 "If you have untrusted raw-format guest disk images, you should use this "
15747 "option to specify the disk format. This avoids a possible security problem "
15748 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15752 #: ../fish/guestfish.pod:227 ../fuse/guestmount.pod:128
15753 msgid "B<-i> | B<--inspector>"
15757 #: ../fish/guestfish.pod:229 ../fuse/guestmount.pod:130
15759 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15760 "system and mount filesystems as they would be mounted on the real virtual "
15765 #: ../fish/guestfish.pod:233
15766 msgid "Typical usage is either:"
15770 #: ../fish/guestfish.pod:235
15773 " guestfish -d myguest -i\n"
15778 #: ../fish/guestfish.pod:237
15779 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15783 #: ../fish/guestfish.pod:239
15786 " guestfish --ro -d myguest -i\n"
15791 #: ../fish/guestfish.pod:241
15792 msgid "(for active domains, readonly), or specify the block device directly:"
15796 #: ../fish/guestfish.pod:243
15799 " guestfish -a /dev/Guests/MyGuest -i\n"
15804 #: ../fish/guestfish.pod:245
15806 "Note that the command line syntax changed slightly over older versions of "
15807 "guestfish. You can still use the old syntax:"
15811 #: ../fish/guestfish.pod:248
15814 " guestfish [--ro] -i disk.img\n"
15819 #: ../fish/guestfish.pod:250
15822 " guestfish [--ro] -i libvirt-domain\n"
15827 #: ../fish/guestfish.pod:252
15828 msgid "B<--keys-from-stdin>"
15832 #: ../fish/guestfish.pod:254
15834 "Read key or passphrase parameters from stdin. The default is to try to read "
15835 "passphrases from the user by opening C</dev/tty>."
15839 #: ../fish/guestfish.pod:257
15840 msgid "B<--listen>"
15844 #: ../fish/guestfish.pod:259
15846 "Fork into the background and listen for remote commands. See section L</"
15847 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15851 #: ../fish/guestfish.pod:262
15852 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15856 #: ../fish/guestfish.pod:264
15857 msgid "Mount the named partition or logical volume on the given mountpoint."
15861 #: ../fish/guestfish.pod:266
15862 msgid "If the mountpoint is omitted, it defaults to C</>."
15866 #: ../fish/guestfish.pod:268
15867 msgid "You have to mount something on C</> before most commands will work."
15871 #: ../fish/guestfish.pod:270
15873 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15878 #: ../fish/guestfish.pod:273
15880 "If you don't know what filesystems a disk image contains, you can either run "
15881 "guestfish without this option, then list the partitions and LVs available "
15882 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
15883 "list-filesystems(1)> program."
15887 #: ../fish/guestfish.pod:278 ../fuse/guestmount.pod:142
15888 msgid "B<-n> | B<--no-sync>"
15892 #: ../fish/guestfish.pod:280
15894 "Disable autosync. This is enabled by default. See the discussion of "
15895 "autosync in the L<guestfs(3)> manpage."
15899 #: ../fish/guestfish.pod:283
15900 msgid "B<-N type> | B<--new type> | B<-N help>"
15904 #: ../fish/guestfish.pod:285
15906 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15907 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15908 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15913 #: ../fish/guestfish.pod:290
15914 msgid "B<--progress-bars>"
15918 #: ../fish/guestfish.pod:292
15919 msgid "Enable progress bars, even when guestfish is used non-interactively."
15923 #: ../fish/guestfish.pod:294
15925 "Progress bars are enabled by default when guestfish is used as an "
15926 "interactive shell."
15930 #: ../fish/guestfish.pod:297
15931 msgid "B<--no-progress-bars>"
15935 #: ../fish/guestfish.pod:299
15936 msgid "Disable progress bars."
15940 #: ../fish/guestfish.pod:301
15941 msgid "B<--remote[=pid]>"
15945 #: ../fish/guestfish.pod:303
15947 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15948 "CONTROL GUESTFISH OVER A SOCKET> below."
15952 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
15953 msgid "B<-r> | B<--ro>"
15957 #: ../fish/guestfish.pod:308
15959 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15960 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15964 #: ../fish/guestfish.pod:311 ../tools/virt-rescue.pl:187
15966 "The option must always be used if the disk image or virtual machine might be "
15967 "running, and is generally recommended in cases where you don't need write "
15968 "access to the disk."
15972 #: ../fish/guestfish.pod:315
15974 "Note that prepared disk images created with I<-N> are not affected by the "
15979 #: ../fish/guestfish.pod:318 ../fuse/guestmount.pod:194
15980 #: ../tools/virt-rescue.pl:195
15981 msgid "B<--selinux>"
15985 #: ../fish/guestfish.pod:320
15986 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15990 #: ../fish/guestfish.pod:322 ../fuse/guestmount.pod:198
15991 msgid "B<-v> | B<--verbose>"
15995 #: ../fish/guestfish.pod:324
15997 "Enable very verbose messages. This is particularly useful if you find a bug."
16001 #: ../fish/guestfish.pod:327 ../fuse/guestmount.pod:202
16002 msgid "B<-V> | B<--version>"
16006 #: ../fish/guestfish.pod:329
16007 msgid "Display the guestfish / libguestfs version number and exit."
16011 #: ../fish/guestfish.pod:331
16016 #: ../fish/guestfish.pod:333
16017 msgid "Echo each command before executing it."
16021 #: ../fish/guestfish.pod:337
16022 msgid "COMMANDS ON COMMAND LINE"
16026 #: ../fish/guestfish.pod:339
16028 "Any additional (non-option) arguments are treated as commands to execute."
16032 #: ../fish/guestfish.pod:342
16034 "Commands to execute should be separated by a colon (C<:>), where the colon "
16035 "is a separate parameter. Thus:"
16039 #: ../fish/guestfish.pod:345
16042 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16047 #: ../fish/guestfish.pod:347
16049 "If there are no additional arguments, then we enter a shell, either an "
16050 "interactive shell with a prompt (if the input is a terminal) or a non-"
16051 "interactive shell."
16055 #: ../fish/guestfish.pod:351
16057 "In either command line mode or non-interactive shell, the first command that "
16058 "gives an error causes the whole shell to exit. In interactive mode (with a "
16059 "prompt) if a command fails, you can continue to enter commands."
16063 #: ../fish/guestfish.pod:356
16064 msgid "USING launch (OR run)"
16068 #: ../fish/guestfish.pod:358
16070 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16071 "then launch it, then mount any disks you need, and finally issue actions/"
16072 "commands. So the general order of the day is:"
16076 #: ../fish/guestfish.pod:366
16077 msgid "add or -a/--add"
16081 #: ../fish/guestfish.pod:370
16082 msgid "launch (aka run)"
16086 #: ../fish/guestfish.pod:374
16087 msgid "mount or -m/--mount"
16091 #: ../fish/guestfish.pod:378
16092 msgid "any other commands"
16096 #: ../fish/guestfish.pod:382
16098 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16099 "guest before mounting or performing any other commands."
16103 #: ../fish/guestfish.pod:385
16105 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16106 "I<--new> options were given then C<run> is done automatically, simply "
16107 "because guestfish can't perform the action you asked for without doing this."
16111 #: ../fish/guestfish.pod:390
16116 #: ../fish/guestfish.pod:392
16118 "You can quote ordinary parameters using either single or double quotes. For "
16123 #: ../fish/guestfish.pod:395
16126 " add \"file with a space.img\"\n"
16131 #: ../fish/guestfish.pod:397
16134 " rm '/file name'\n"
16139 #: ../fish/guestfish.pod:399
16147 #: ../fish/guestfish.pod:401
16149 "A few commands require a list of strings to be passed. For these, use a "
16150 "whitespace-separated list, enclosed in quotes. Strings containing "
16151 "whitespace to be passed through must be enclosed in single quotes. A "
16152 "literal single quote must be escaped with a backslash."
16156 #: ../fish/guestfish.pod:406
16159 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16160 " command \"/bin/echo 'foo bar'\"\n"
16161 " command \"/bin/echo \\'foo\\'\"\n"
16166 #: ../fish/guestfish.pod:410
16167 msgid "OPTIONAL ARGUMENTS"
16171 #: ../fish/guestfish.pod:412
16173 "Some commands take optional arguments. These arguments appear in this "
16174 "documentation as C<[argname:..]>. You can use them as in these examples:"
16178 #: ../fish/guestfish.pod:416
16181 " add-drive-opts filename\n"
16186 #: ../fish/guestfish.pod:418
16189 " add-drive-opts filename readonly:true\n"
16194 #: ../fish/guestfish.pod:420
16197 " add-drive-opts filename format:qcow2 readonly:false\n"
16202 #: ../fish/guestfish.pod:422
16204 "Each optional argument can appear at most once. All optional arguments must "
16205 "appear after the required ones."
16209 #: ../fish/guestfish.pod:425
16214 #: ../fish/guestfish.pod:427
16216 "This section applies to all commands which can take integers as parameters."
16220 #: ../fish/guestfish.pod:430
16221 msgid "SIZE SUFFIX"
16225 #: ../fish/guestfish.pod:432
16227 "When the command takes a parameter measured in bytes, you can use one of the "
16228 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16232 #: ../fish/guestfish.pod:438
16233 msgid "B<k> or B<K> or B<KiB>"
16237 #: ../fish/guestfish.pod:440
16238 msgid "The size in kilobytes (multiplied by 1024)."
16242 #: ../fish/guestfish.pod:442
16247 #: ../fish/guestfish.pod:444
16248 msgid "The size in SI 1000 byte units."
16252 #: ../fish/guestfish.pod:446
16253 msgid "B<M> or B<MiB>"
16257 #: ../fish/guestfish.pod:448
16258 msgid "The size in megabytes (multiplied by 1048576)."
16262 #: ../fish/guestfish.pod:450
16267 #: ../fish/guestfish.pod:452
16268 msgid "The size in SI 1000000 byte units."
16272 #: ../fish/guestfish.pod:454
16273 msgid "B<G> or B<GiB>"
16277 #: ../fish/guestfish.pod:456
16278 msgid "The size in gigabytes (multiplied by 2**30)."
16282 #: ../fish/guestfish.pod:458
16287 #: ../fish/guestfish.pod:460
16288 msgid "The size in SI 10**9 byte units."
16292 #: ../fish/guestfish.pod:462
16293 msgid "B<T> or B<TiB>"
16297 #: ../fish/guestfish.pod:464
16298 msgid "The size in terabytes (multiplied by 2**40)."
16302 #: ../fish/guestfish.pod:466
16307 #: ../fish/guestfish.pod:468
16308 msgid "The size in SI 10**12 byte units."
16312 #: ../fish/guestfish.pod:470
16313 msgid "B<P> or B<PiB>"
16317 #: ../fish/guestfish.pod:472
16318 msgid "The size in petabytes (multiplied by 2**50)."
16322 #: ../fish/guestfish.pod:474
16327 #: ../fish/guestfish.pod:476
16328 msgid "The size in SI 10**15 byte units."
16332 #: ../fish/guestfish.pod:478
16333 msgid "B<E> or B<EiB>"
16337 #: ../fish/guestfish.pod:480
16338 msgid "The size in exabytes (multiplied by 2**60)."
16342 #: ../fish/guestfish.pod:482
16347 #: ../fish/guestfish.pod:484
16348 msgid "The size in SI 10**18 byte units."
16352 #: ../fish/guestfish.pod:486
16353 msgid "B<Z> or B<ZiB>"
16357 #: ../fish/guestfish.pod:488
16358 msgid "The size in zettabytes (multiplied by 2**70)."
16362 #: ../fish/guestfish.pod:490
16367 #: ../fish/guestfish.pod:492
16368 msgid "The size in SI 10**21 byte units."
16372 #: ../fish/guestfish.pod:494
16373 msgid "B<Y> or B<YiB>"
16377 #: ../fish/guestfish.pod:496
16378 msgid "The size in yottabytes (multiplied by 2**80)."
16382 #: ../fish/guestfish.pod:498
16387 #: ../fish/guestfish.pod:500
16388 msgid "The size in SI 10**24 byte units."
16392 #: ../fish/guestfish.pod:506
16395 " truncate-size /file 1G\n"
16400 #: ../fish/guestfish.pod:508
16401 msgid "would truncate the file to 1 gigabyte."
16405 #: ../fish/guestfish.pod:510
16407 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
16408 "the parameter to L</memsize> is specified in megabytes already). Adding a "
16409 "suffix will probably not do what you expect."
16413 #: ../fish/guestfish.pod:514
16414 msgid "OCTAL AND HEXADECIMAL NUMBERS"
16418 #: ../fish/guestfish.pod:516
16420 "For specifying the radix (base) use the C convention: C<0> to prefix an "
16421 "octal number or C<0x> to prefix a hexadecimal number. For example:"
16425 #: ../fish/guestfish.pod:519
16428 " 1234 decimal number 1234\n"
16429 " 02322 octal number, equivalent to decimal 1234\n"
16430 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16435 #: ../fish/guestfish.pod:523
16437 "When using the C<chmod> command, you almost always want to specify an octal "
16438 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16439 "L<chmod(1)> program):"
16443 #: ../fish/guestfish.pod:527
16446 " chmod 0777 /public # OK\n"
16447 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16452 #: ../fish/guestfish.pod:530
16454 "Commands that return numbers usually print them in decimal, but some "
16455 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16456 "octal, preceeded by C<0>)."
16460 #: ../fish/guestfish.pod:534
16461 msgid "WILDCARDS AND GLOBBING"
16465 #: ../fish/guestfish.pod:536
16467 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16468 "(globbing) by default. So for example the following will not do what you "
16473 #: ../fish/guestfish.pod:540
16481 #: ../fish/guestfish.pod:542
16483 "Assuming you don't have a directory called literally C</home/*> then the "
16484 "above command will return an error."
16488 #: ../fish/guestfish.pod:545
16489 msgid "To perform wildcard expansion, use the C<glob> command."
16493 #: ../fish/guestfish.pod:547
16496 " glob rm-rf /home/*\n"
16501 #: ../fish/guestfish.pod:549
16503 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16504 "many times), equivalent to:"
16508 #: ../fish/guestfish.pod:552
16511 " rm-rf /home/jim\n"
16512 " rm-rf /home/joe\n"
16513 " rm-rf /home/mary\n"
16518 #: ../fish/guestfish.pod:556
16519 msgid "C<glob> only works on simple guest paths and not on device names."
16523 #: ../fish/guestfish.pod:558
16525 "If you have several parameters, each containing a wildcard, then glob will "
16526 "perform a Cartesian product."
16530 #: ../fish/guestfish.pod:561
16535 #: ../fish/guestfish.pod:563
16537 "Any line which starts with a I<#> character is treated as a comment and "
16538 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16539 "a command. For example:"
16543 #: ../fish/guestfish.pod:567
16546 " # this is a comment\n"
16547 " # this is a comment\n"
16548 " foo # NOT a comment\n"
16553 #: ../fish/guestfish.pod:571
16554 msgid "Blank lines are also ignored."
16558 #: ../fish/guestfish.pod:573
16559 msgid "RUNNING COMMANDS LOCALLY"
16563 #: ../fish/guestfish.pod:575
16565 "Any line which starts with a I<!> character is treated as a command sent to "
16566 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
16570 #: ../fish/guestfish.pod:579
16574 " tgz-out /remote local/remote-data.tar.gz\n"
16579 #: ../fish/guestfish.pod:582
16581 "will create a directory C<local> on the host, and then export the contents "
16582 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
16583 "(See C<tgz-out>)."
16587 #: ../fish/guestfish.pod:586
16589 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
16590 "effect, due to the way that subprocesses work in Unix."
16594 #: ../fish/guestfish.pod:589
16599 #: ../fish/guestfish.pod:591
16601 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
16602 "command (a guestfish command) to the second command (any host command). For "
16607 #: ../fish/guestfish.pod:595
16610 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
16615 #: ../fish/guestfish.pod:597
16617 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
16618 "program). The above command would list all accounts in the guest filesystem "
16619 "which have UID 0, ie. root accounts including backdoors. Other examples:"
16623 #: ../fish/guestfish.pod:602
16626 " hexdump /bin/ls | head\n"
16627 " list-devices | tail -1\n"
16628 " tgz-out / - | tar ztf -\n"
16633 #: ../fish/guestfish.pod:606
16635 "The space before the pipe symbol is required, any space after the pipe "
16636 "symbol is optional. Everything after the pipe symbol is just passed "
16637 "straight to the host shell, so it can contain redirections, globs and "
16638 "anything else that makes sense on the host side."
16642 #: ../fish/guestfish.pod:611
16644 "To use a literal argument which begins with a pipe symbol, you have to quote "
16649 #: ../fish/guestfish.pod:614
16657 #: ../fish/guestfish.pod:616
16658 msgid "HOME DIRECTORIES"
16662 #: ../fish/guestfish.pod:618
16664 "If a parameter starts with the character C<~> then the tilde may be expanded "
16665 "as a home directory path (either C<~> for the current user's home directory, "
16666 "or C<~user> for another user)."
16670 #: ../fish/guestfish.pod:622
16672 "Note that home directory expansion happens for users known I<on the host>, "
16673 "not in the guest filesystem."
16677 #: ../fish/guestfish.pod:625
16679 "To use a literal argument which begins with a tilde, you have to quote it, "
16684 #: ../fish/guestfish.pod:628
16692 #: ../fish/guestfish.pod:632
16694 "Libguestfs has some support for Linux guests encrypted according to the "
16695 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
16696 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
16697 "LUKS is supported."
16701 #: ../fish/guestfish.pod:637
16702 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
16706 #: ../fish/guestfish.pod:639
16709 " ><fs> vfs-type /dev/sda2\n"
16715 #: ../fish/guestfish.pod:642
16717 "Then open those devices using L</luks-open>. This creates a device-mapper "
16718 "device called C</dev/mapper/luksdev>."
16722 #: ../fish/guestfish.pod:645
16725 " ><fs> luks-open /dev/sda2 luksdev\n"
16726 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
16731 #: ../fish/guestfish.pod:648
16733 "Finally you have to tell LVM to scan for volume groups on the newly created "
16738 #: ../fish/guestfish.pod:651
16742 " vg-activate-all true\n"
16747 #: ../fish/guestfish.pod:654
16748 msgid "The logical volume(s) can now be mounted in the usual way."
16752 #: ../fish/guestfish.pod:656
16754 "Before closing a LUKS device you must unmount any logical volumes on it and "
16755 "deactivate the volume groups by calling C<vg-activate false VG> on each "
16756 "one. Then you can close the mapper device:"
16760 #: ../fish/guestfish.pod:660
16763 " vg-activate false /dev/VG\n"
16764 " luks-close /dev/mapper/luksdev\n"
16769 #: ../fish/guestfish.pod:663
16770 msgid "WINDOWS PATHS"
16774 #: ../fish/guestfish.pod:665
16776 "If a path is prefixed with C<win:> then you can use Windows-style paths "
16777 "(with some limitations). The following commands are equivalent:"
16781 #: ../fish/guestfish.pod:668
16784 " file /WINDOWS/system32/config/system.LOG\n"
16789 #: ../fish/guestfish.pod:670
16792 " file win:/windows/system32/config/system.log\n"
16797 #: ../fish/guestfish.pod:672
16800 " file win:\\windows\\system32\\config\\system.log\n"
16805 #: ../fish/guestfish.pod:674
16808 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
16813 #: ../fish/guestfish.pod:676
16815 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
16816 "handles case insensitivity like Windows would. This only works in argument "
16817 "positions that expect a path."
16821 #: ../fish/guestfish.pod:680
16822 msgid "UPLOADING AND DOWNLOADING FILES"
16826 #: ../fish/guestfish.pod:682
16828 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
16829 "others which upload from or download to a local file, you can use the "
16830 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
16834 #: ../fish/guestfish.pod:686
16842 #: ../fish/guestfish.pod:688
16844 "reads stdin and creates from that a file C</foo> in the disk image, and:"
16848 #: ../fish/guestfish.pod:691
16851 " tar-out /etc - | tar tf -\n"
16856 #: ../fish/guestfish.pod:693
16858 "writes the tarball to stdout and then pipes that into the external \"tar\" "
16859 "command (see L</PIPES>)."
16863 #: ../fish/guestfish.pod:696
16865 "When using C<-> to read from stdin, the input is read up to the end of "
16866 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
16867 "some arbitrary end marker:"
16871 #: ../fish/guestfish.pod:700
16874 " upload -<<END /foo\n"
16883 #: ../fish/guestfish.pod:706
16885 "Any string of characters can be used instead of C<END>. The end marker must "
16886 "appear on a line of its own, without any preceeding or following characters "
16887 "(not even spaces)."
16891 #: ../fish/guestfish.pod:710
16893 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16894 "upload local files (so-called \"FileIn\" parameters in the generator)."
16898 #: ../fish/guestfish.pod:713
16899 msgid "EXIT ON ERROR BEHAVIOUR"
16903 #: ../fish/guestfish.pod:715
16905 "By default, guestfish will ignore any errors when in interactive mode (ie. "
16906 "taking commands from a human over a tty), and will exit on the first error "
16907 "in non-interactive mode (scripts, commands given on the command line)."
16911 #: ../fish/guestfish.pod:720
16913 "If you prefix a command with a I<-> character, then that command will not "
16914 "cause guestfish to exit, even if that (one) command returns an error."
16918 #: ../fish/guestfish.pod:724
16919 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16923 #: ../fish/guestfish.pod:726
16925 "Guestfish can be remote-controlled over a socket. This is useful "
16926 "particularly in shell scripts where you want to make several different "
16927 "changes to a filesystem, but you don't want the overhead of starting up a "
16928 "guestfish process each time."
16932 #: ../fish/guestfish.pod:731
16933 msgid "Start a guestfish server process using:"
16937 #: ../fish/guestfish.pod:733
16940 " eval `guestfish --listen`\n"
16945 #: ../fish/guestfish.pod:735
16946 msgid "and then send it commands by doing:"
16950 #: ../fish/guestfish.pod:737
16953 " guestfish --remote cmd [...]\n"
16958 #: ../fish/guestfish.pod:739
16959 msgid "To cause the server to exit, send it the exit command:"
16963 #: ../fish/guestfish.pod:741
16966 " guestfish --remote exit\n"
16971 #: ../fish/guestfish.pod:743
16973 "Note that the server will normally exit if there is an error in a command. "
16974 "You can change this in the usual way. See section L</EXIT ON ERROR "
16979 #: ../fish/guestfish.pod:747
16980 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16984 #: ../fish/guestfish.pod:749
16986 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16987 "is how the I<--remote> option knows where to send the commands. You can "
16988 "have several guestfish listener processes running using:"
16992 #: ../fish/guestfish.pod:753
16995 " eval `guestfish --listen`\n"
16996 " pid1=$GUESTFISH_PID\n"
16997 " eval `guestfish --listen`\n"
16998 " pid2=$GUESTFISH_PID\n"
17000 " guestfish --remote=$pid1 cmd\n"
17001 " guestfish --remote=$pid2 cmd\n"
17006 #: ../fish/guestfish.pod:761
17007 msgid "REMOTE CONTROL DETAILS"
17011 #: ../fish/guestfish.pod:763
17013 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
17014 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
17015 "and C<$PID> is the process ID of the server."
17019 #: ../fish/guestfish.pod:767
17020 msgid "Guestfish client and server versions must match exactly."
17024 #: ../fish/guestfish.pod:769
17025 msgid "PREPARED DISK IMAGES"
17029 #: ../fish/guestfish.pod:771
17031 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17032 "preformatted disk images that guestfish can make for you to save typing. "
17033 "This is particularly useful for testing purposes. This option is used "
17034 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17035 "can be mixed with I<-a>)."
17039 #: ../fish/guestfish.pod:777
17041 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17042 "the second and so on. Existing files in the current directory are "
17047 #: ../fish/guestfish.pod:781
17049 "The type briefly describes how the disk should be sized, partitioned, how "
17050 "filesystem(s) should be created, and how content should be added. "
17051 "Optionally the type can be followed by extra parameters, separated by C<:> "
17052 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
17053 "allocated disk, containing a single partition, with the partition formatted "
17054 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
17059 #: ../fish/guestfish.pod:789
17060 msgid "To list the available types and any extra parameters they take, run:"
17064 #: ../fish/guestfish.pod:793
17066 "Note that the prepared filesystem is not mounted. You would usually have to "
17067 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17071 #: ../fish/guestfish.pod:797
17073 "If any I<-N> or I<--new> options are given, the guest is automatically "
17078 #: ../fish/guestfish.pod:802
17079 msgid "Create a 100MB disk with an ext4-formatted partition:"
17083 #: ../fish/guestfish.pod:804
17086 " guestfish -N fs:ext4\n"
17091 #: ../fish/guestfish.pod:806
17092 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17096 #: ../fish/guestfish.pod:808
17099 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17104 #: ../fish/guestfish.pod:810
17105 msgid "Create a blank 200MB disk:"
17109 #: ../fish/guestfish.pod:812
17112 " guestfish -N disk:200M\n"
17117 #: ../fish/guestfish.pod:814
17118 msgid "PROGRESS BARS"
17122 #: ../fish/guestfish.pod:816
17124 "Some (not all) long-running commands send progress notification messages as "
17125 "they are running. Guestfish turns these messages into progress bars."
17129 #: ../fish/guestfish.pod:820
17131 "When a command that supports progress bars takes longer than two seconds to "
17132 "run, and if progress bars are enabled, then you will see one appearing below "
17137 #: ../fish/guestfish.pod:824
17140 " ><fs> copy-size /large-file /another-file 2048M\n"
17141 " / 10% [#####-----------------------------------------] 00:30\n"
17146 #: ../fish/guestfish.pod:827
17148 "The spinner on the left hand side moves round once for every progress "
17149 "notification received from the backend. This is a (reasonably) golden "
17150 "assurance that the command is \"doing something\" even if the progress bar "
17151 "is not moving, because the command is able to send the progress "
17152 "notifications. When the bar reaches 100% and the command finishes, the "
17153 "spinner disappears."
17157 #: ../fish/guestfish.pod:834
17159 "Progress bars are enabled by default when guestfish is used interactively. "
17160 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17161 "and you can disable them completely using I<--no-progress-bars>."
17165 #: ../fish/guestfish.pod:839
17166 msgid "GUESTFISH COMMANDS"
17170 #: ../fish/guestfish.pod:841
17172 "The commands in this section are guestfish convenience commands, in other "
17173 "words, they are not part of the L<guestfs(3)> API."
17177 #: ../fish/guestfish.pod:844
17182 #: ../fish/guestfish.pod:846
17191 #: ../fish/guestfish.pod:849
17193 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
17194 "this displays detailed help for a command."
17198 #: ../fish/guestfish.pod:852
17199 msgid "quit | exit"
17203 #: ../fish/guestfish.pod:854
17204 msgid "This exits guestfish. You can also use C<^D> key."
17208 #: ../fish/guestfish.pod:856
17209 msgid "@FISH_COMMANDS@"
17213 #: ../fish/guestfish.pod:858
17218 #: ../fish/guestfish.pod:862 ../test-tool/libguestfs-test-tool.pod:83
17223 #: ../fish/guestfish.pod:864
17225 "guestfish returns 0 if the commands completed without error, or 1 if there "
17230 #: ../fish/guestfish.pod:871
17235 #: ../fish/guestfish.pod:873
17237 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17242 #: ../fish/guestfish.pod:876
17243 msgid "GUESTFISH_PID"
17247 #: ../fish/guestfish.pod:878
17249 "Used with the I<--remote> option to specify the remote guestfish process to "
17250 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17254 #: ../fish/guestfish.pod:882
17259 #: ../fish/guestfish.pod:884
17261 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17262 "not specified, the external L<hexedit(1)> program is used."
17266 #: ../fish/guestfish.pod:888
17271 #: ../fish/guestfish.pod:890
17273 "If compiled with GNU readline support, various files in the home directory "
17274 "can be used. See L</FILES>."
17278 #: ../fish/guestfish.pod:899
17280 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17281 "effect as using the B<-v> option."
17285 #: ../fish/guestfish.pod:911
17287 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17288 "the discussion of paths in L<guestfs(3)>."
17292 #: ../fish/guestfish.pod:922
17293 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17297 #: ../fish/guestfish.pod:924
17302 #: ../fish/guestfish.pod:926
17304 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17309 #: ../fish/guestfish.pod:941 ../test-tool/libguestfs-test-tool.pod:88
17314 #: ../fish/guestfish.pod:945
17315 msgid "$HOME/.guestfish"
17319 #: ../fish/guestfish.pod:947
17321 "If compiled with GNU readline support, then the command history is saved in "
17326 #: ../fish/guestfish.pod:950
17327 msgid "$HOME/.inputrc"
17331 #: ../fish/guestfish.pod:952
17332 msgid "/etc/inputrc"
17336 #: ../fish/guestfish.pod:954
17338 "If compiled with GNU readline support, then these files can be used to "
17339 "configure readline. For further information, please see L<readline(3)/"
17340 "INITIALIZATION FILE>."
17344 #: ../fish/guestfish.pod:958
17345 msgid "To write rules which only apply to guestfish, use:"
17349 #: ../fish/guestfish.pod:960
17359 #: ../fish/guestfish.pod:964
17361 "Variables that you can set in inputrc that change the behaviour of guestfish "
17362 "in useful ways include:"
17366 #: ../fish/guestfish.pod:969
17367 msgid "completion-ignore-case (default: on)"
17371 #: ../fish/guestfish.pod:971
17373 "By default, guestfish will ignore case when tab-completing paths on the "
17378 #: ../fish/guestfish.pod:974
17381 " set completion-ignore-case off\n"
17386 #: ../fish/guestfish.pod:976
17387 msgid "to make guestfish case sensitive."
17391 #: ../fish/guestfish.pod:980
17396 #: ../fish/guestfish.pod:982
17397 msgid "test2.img (etc)"
17401 #: ../fish/guestfish.pod:984
17403 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
17404 "will be created in the file C<test1.img> in the current directory. The "
17405 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
17406 "the same name will be overwritten."
17410 #: ../fish/guestfish.pod:993
17412 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
17413 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
17414 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
17415 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
17419 #: ../fish/guestfish.pod:1017 ../test-tool/libguestfs-test-tool.pod:124
17420 #: ../fuse/guestmount.pod:234 ../inspector/virt-inspector.pl:598
17421 #: ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518
17422 #: ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251
17423 #: ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206
17424 #: ../tools/virt-cat.pl:203 ../tools/virt-tar.pl:300
17425 #: ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:567
17426 #: ../tools/virt-list-partitions.pl:273
17428 "This program is free software; you can redistribute it and/or modify it "
17429 "under the terms of the GNU General Public License as published by the Free "
17430 "Software Foundation; either version 2 of the License, or (at your option) "
17431 "any later version."
17435 #: ../fish/guestfish.pod:1022 ../test-tool/libguestfs-test-tool.pod:129
17436 #: ../fuse/guestmount.pod:239 ../inspector/virt-inspector.pl:603
17437 #: ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523
17438 #: ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256
17439 #: ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211
17440 #: ../tools/virt-cat.pl:208 ../tools/virt-tar.pl:305
17441 #: ../tools/virt-rescue.pl:290 ../tools/virt-make-fs.pl:572
17442 #: ../tools/virt-list-partitions.pl:278
17444 "This program is distributed in the hope that it will be useful, but WITHOUT "
17445 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
17446 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
17451 #: ../fish/guestfish.pod:1027 ../test-tool/libguestfs-test-tool.pod:134
17452 #: ../fuse/guestmount.pod:244 ../inspector/virt-inspector.pl:608
17453 #: ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528
17454 #: ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261
17455 #: ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216
17456 #: ../tools/virt-cat.pl:213 ../tools/virt-tar.pl:310
17457 #: ../tools/virt-rescue.pl:295 ../tools/virt-make-fs.pl:577
17458 #: ../tools/virt-list-partitions.pl:283
17460 "You should have received a copy of the GNU General Public License along with "
17461 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
17462 "Ave, Cambridge, MA 02139, USA."
17466 #: ../fish/guestfish-actions.pod:1
17471 #: ../fish/guestfish-actions.pod:3
17474 " add-cdrom filename\n"
17479 #: ../fish/guestfish-actions.pod:15
17481 "This call checks for the existence of C<filename>. This stops you from "
17482 "specifying other types of drive which are supported by qemu such as C<nbd:> "
17483 "and C<http:> URLs. To specify those, use the general L</config> call "
17488 #: ../fish/guestfish-actions.pod:22
17490 "If you just want to add an ISO file (often you use this as an efficient way "
17491 "to transfer large files into the guest), then you should probably use L</add-"
17492 "drive-ro> instead."
17496 #: ../fish/guestfish-actions.pod:35
17501 #: ../fish/guestfish-actions.pod:37
17504 " add-drive filename\n"
17509 #: ../fish/guestfish-actions.pod:39
17511 "This function is the equivalent of calling L</add-drive-opts> with no "
17512 "optional parameters, so the disk is added writable, with the format being "
17513 "detected automatically."
17517 #: ../fish/guestfish-actions.pod:43
17519 "Automatic detection of the format opens you up to a potential security hole "
17520 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
17521 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
17522 "you should think about replacing calls to this function with calls to L</add-"
17523 "drive-opts>, and specifying the format."
17527 #: ../fish/guestfish-actions.pod:50
17528 msgid "add-drive-opts"
17532 #: ../fish/guestfish-actions.pod:52
17537 #: ../fish/guestfish-actions.pod:54
17540 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
17545 #: ../fish/guestfish-actions.pod:81
17547 "This forces the image format. If you omit this (or use L</add-drive> or L</"
17548 "add-drive-ro>) then the format is automatically detected. Possible formats "
17549 "include C<raw> and C<qcow2>."
17553 #: ../fish/guestfish-actions.pod:92
17555 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
17556 "add-drive-with-if> call (q.v.)"
17560 #: ../fish/guestfish-actions.pod:97
17562 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
17566 #: ../fish/guestfish-actions.pod:99
17567 msgid "add-drive-ro"
17571 #: ../fish/guestfish-actions.pod:101
17576 #: ../fish/guestfish-actions.pod:103
17579 " add-drive-ro filename\n"
17584 #: ../fish/guestfish-actions.pod:105
17586 "This function is the equivalent of calling L</add-drive-opts> with the "
17587 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
17588 "is added read-only, with the format being detected automatically."
17592 #: ../fish/guestfish-actions.pod:110
17593 msgid "add-drive-ro-with-if"
17597 #: ../fish/guestfish-actions.pod:112
17600 " add-drive-ro-with-if filename iface\n"
17605 #: ../fish/guestfish-actions.pod:114
17607 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
17608 "interface emulation to use at run time."
17612 #: ../fish/guestfish-actions.pod:124
17613 msgid "add-drive-with-if"
17617 #: ../fish/guestfish-actions.pod:126
17620 " add-drive-with-if filename iface\n"
17625 #: ../fish/guestfish-actions.pod:128
17627 "This is the same as L</add-drive> but it allows you to specify the QEMU "
17628 "interface emulation to use at run time."
17632 #: ../fish/guestfish-actions.pod:138
17637 #: ../fish/guestfish-actions.pod:140
17640 " aug-clear augpath\n"
17645 #: ../fish/guestfish-actions.pod:145
17650 #: ../fish/guestfish-actions.pod:147
17658 #: ../fish/guestfish-actions.pod:149
17660 "Close the current Augeas handle and free up any resources used by it. After "
17661 "calling this, you have to call L</aug-init> again before you can use any "
17662 "other Augeas functions."
17666 #: ../fish/guestfish-actions.pod:154
17667 msgid "aug-defnode"
17671 #: ../fish/guestfish-actions.pod:156
17674 " aug-defnode name expr val\n"
17679 #: ../fish/guestfish-actions.pod:161
17681 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
17682 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
17683 "containing that single node."
17687 #: ../fish/guestfish-actions.pod:169
17692 #: ../fish/guestfish-actions.pod:171
17695 " aug-defvar name expr\n"
17700 #: ../fish/guestfish-actions.pod:180
17705 #: ../fish/guestfish-actions.pod:182
17708 " aug-get augpath\n"
17713 #: ../fish/guestfish-actions.pod:187
17718 #: ../fish/guestfish-actions.pod:189
17721 " aug-init root flags\n"
17726 #: ../fish/guestfish-actions.pod:195
17727 msgid "You must call this before using any other L</aug-*> commands."
17731 #: ../fish/guestfish-actions.pod:230
17732 msgid "Do not load the tree in L</aug-init>."
17736 #: ../fish/guestfish-actions.pod:234
17737 msgid "To close the handle, you can call L</aug-close>."
17741 #: ../fish/guestfish-actions.pod:238
17746 #: ../fish/guestfish-actions.pod:240
17749 " aug-insert augpath label true|false\n"
17754 #: ../fish/guestfish-actions.pod:250
17759 #: ../fish/guestfish-actions.pod:252
17767 #: ../fish/guestfish-actions.pod:259
17772 #: ../fish/guestfish-actions.pod:261
17775 " aug-ls augpath\n"
17780 #: ../fish/guestfish-actions.pod:263
17782 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
17783 "resulting nodes into alphabetical order."
17787 #: ../fish/guestfish-actions.pod:266
17792 #: ../fish/guestfish-actions.pod:268
17795 " aug-match augpath\n"
17800 #: ../fish/guestfish-actions.pod:274
17805 #: ../fish/guestfish-actions.pod:276
17808 " aug-mv src dest\n"
17813 #: ../fish/guestfish-actions.pod:281
17818 #: ../fish/guestfish-actions.pod:283
17821 " aug-rm augpath\n"
17826 #: ../fish/guestfish-actions.pod:289
17831 #: ../fish/guestfish-actions.pod:291
17839 #: ../fish/guestfish-actions.pod:295
17841 "The flags which were passed to L</aug-init> affect exactly how files are "
17846 #: ../fish/guestfish-actions.pod:298
17851 #: ../fish/guestfish-actions.pod:300
17854 " aug-set augpath val\n"
17859 #: ../fish/guestfish-actions.pod:304
17861 "In the Augeas API, it is possible to clear a node by setting the value to "
17862 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17863 "this call. Instead you must use the L</aug-clear> call."
17867 #: ../fish/guestfish-actions.pod:309
17872 #: ../fish/guestfish-actions.pod:311
17875 " available 'groups ...'\n"
17880 #: ../fish/guestfish-actions.pod:317
17882 "The libguestfs groups, and the functions that those groups correspond to, "
17883 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17884 "runtime by calling L</available-all-groups>."
17888 #: ../fish/guestfish-actions.pod:341
17889 msgid "You must call L</launch> before calling this function."
17893 #: ../fish/guestfish-actions.pod:363
17895 "This call was added in version C<1.0.80>. In previous versions of "
17896 "libguestfs all you could do would be to speculatively execute a command to "
17897 "find out if the daemon implemented it. See also L</version>."
17901 #: ../fish/guestfish-actions.pod:370
17902 msgid "available-all-groups"
17906 #: ../fish/guestfish-actions.pod:372
17909 " available-all-groups\n"
17914 #: ../fish/guestfish-actions.pod:374
17916 "This command returns a list of all optional groups that this daemon knows "
17917 "about. Note this returns both supported and unsupported groups. To find "
17918 "out which ones the daemon can actually support you have to call L</"
17919 "available> on each member of the returned list."
17923 #: ../fish/guestfish-actions.pod:380
17924 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
17928 #: ../fish/guestfish-actions.pod:382
17933 #: ../fish/guestfish-actions.pod:384
17936 " base64-in (base64file|-) filename\n"
17941 #: ../fish/guestfish-actions.pod:389 ../fish/guestfish-actions.pod:398
17942 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:769
17943 #: ../fish/guestfish-actions.pod:816 ../fish/guestfish-actions.pod:835
17944 #: ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:3928
17945 #: ../fish/guestfish-actions.pod:3940 ../fish/guestfish-actions.pod:3951
17946 #: ../fish/guestfish-actions.pod:3962 ../fish/guestfish-actions.pod:4014
17947 #: ../fish/guestfish-actions.pod:4023 ../fish/guestfish-actions.pod:4077
17948 #: ../fish/guestfish-actions.pod:4100
17949 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17953 #: ../fish/guestfish-actions.pod:391
17958 #: ../fish/guestfish-actions.pod:393
17961 " base64-out filename (base64file|-)\n"
17966 #: ../fish/guestfish-actions.pod:400
17967 msgid "blockdev-flushbufs"
17971 #: ../fish/guestfish-actions.pod:402
17974 " blockdev-flushbufs device\n"
17979 #: ../fish/guestfish-actions.pod:409
17980 msgid "blockdev-getbsz"
17984 #: ../fish/guestfish-actions.pod:411
17987 " blockdev-getbsz device\n"
17992 #: ../fish/guestfish-actions.pod:420
17993 msgid "blockdev-getro"
17997 #: ../fish/guestfish-actions.pod:422
18000 " blockdev-getro device\n"
18005 #: ../fish/guestfish-actions.pod:429
18006 msgid "blockdev-getsize64"
18010 #: ../fish/guestfish-actions.pod:431
18013 " blockdev-getsize64 device\n"
18018 #: ../fish/guestfish-actions.pod:435
18019 msgid "See also L</blockdev-getsz>."
18023 #: ../fish/guestfish-actions.pod:439
18024 msgid "blockdev-getss"
18028 #: ../fish/guestfish-actions.pod:441
18031 " blockdev-getss device\n"
18036 #: ../fish/guestfish-actions.pod:446
18038 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
18042 #: ../fish/guestfish-actions.pod:451
18043 msgid "blockdev-getsz"
18047 #: ../fish/guestfish-actions.pod:453
18050 " blockdev-getsz device\n"
18055 #: ../fish/guestfish-actions.pod:458
18057 "See also L</blockdev-getss> for the real sector size of the device, and L</"
18058 "blockdev-getsize64> for the more useful I<size in bytes>."
18062 #: ../fish/guestfish-actions.pod:464
18063 msgid "blockdev-rereadpt"
18067 #: ../fish/guestfish-actions.pod:466
18070 " blockdev-rereadpt device\n"
18075 #: ../fish/guestfish-actions.pod:472
18076 msgid "blockdev-setbsz"
18080 #: ../fish/guestfish-actions.pod:474
18083 " blockdev-setbsz device blocksize\n"
18088 #: ../fish/guestfish-actions.pod:483
18089 msgid "blockdev-setro"
18093 #: ../fish/guestfish-actions.pod:485
18096 " blockdev-setro device\n"
18101 #: ../fish/guestfish-actions.pod:491
18102 msgid "blockdev-setrw"
18106 #: ../fish/guestfish-actions.pod:493
18109 " blockdev-setrw device\n"
18114 #: ../fish/guestfish-actions.pod:499
18115 msgid "case-sensitive-path"
18119 #: ../fish/guestfish-actions.pod:501
18122 " case-sensitive-path path\n"
18127 #: ../fish/guestfish-actions.pod:525
18129 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
18130 "WINDOWS/system32\"> (the exact return value would depend on details of how "
18131 "the directories were originally created under Windows)."
18135 #: ../fish/guestfish-actions.pod:533
18136 msgid "See also L</realpath>."
18140 #: ../fish/guestfish-actions.pod:535
18145 #: ../fish/guestfish-actions.pod:537
18153 #: ../fish/guestfish-actions.pod:541
18155 "Note that this function cannot correctly handle binary files (specifically, "
18156 "files containing C<\\0> character which is treated as end of string). For "
18157 "those you need to use the L</read-file> or L</download> functions which have "
18158 "a more complex interface."
18162 #: ../fish/guestfish-actions.pod:549
18167 #: ../fish/guestfish-actions.pod:551
18170 " checksum csumtype path\n"
18175 #: ../fish/guestfish-actions.pod:594
18176 msgid "To get the checksum for a device, use L</checksum-device>."
18180 #: ../fish/guestfish-actions.pod:596
18181 msgid "To get the checksums for many files, use L</checksums-out>."
18185 #: ../fish/guestfish-actions.pod:598
18186 msgid "checksum-device"
18190 #: ../fish/guestfish-actions.pod:600
18193 " checksum-device csumtype device\n"
18198 #: ../fish/guestfish-actions.pod:602
18200 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
18201 "device named C<device>. For the types of checksums supported see the L</"
18202 "checksum> command."
18206 #: ../fish/guestfish-actions.pod:606
18207 msgid "checksums-out"
18211 #: ../fish/guestfish-actions.pod:608
18214 " checksums-out csumtype directory (sumsfile|-)\n"
18219 #: ../fish/guestfish-actions.pod:624
18224 #: ../fish/guestfish-actions.pod:626
18227 " chmod mode path\n"
18232 #: ../fish/guestfish-actions.pod:637
18237 #: ../fish/guestfish-actions.pod:639
18240 " chown owner group path\n"
18245 #: ../fish/guestfish-actions.pod:647
18250 #: ../fish/guestfish-actions.pod:649
18253 " command 'arguments ...'\n"
18258 #: ../fish/guestfish-actions.pod:656
18260 "The single parameter is an argv-style list of arguments. The first element "
18261 "is the name of the program to run. Subsequent elements are parameters. The "
18262 "list must be non-empty (ie. must contain a program name). Note that the "
18263 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
18267 #: ../fish/guestfish-actions.pod:684
18268 msgid "command-lines"
18272 #: ../fish/guestfish-actions.pod:686
18275 " command-lines 'arguments ...'\n"
18280 #: ../fish/guestfish-actions.pod:688
18282 "This is the same as L</command>, but splits the result into a list of lines."
18286 #: ../fish/guestfish-actions.pod:691
18287 msgid "See also: L</sh-lines>"
18291 #: ../fish/guestfish-actions.pod:696
18296 #: ../fish/guestfish-actions.pod:698
18299 " config qemuparam qemuvalue\n"
18304 #: ../fish/guestfish-actions.pod:709
18309 #: ../fish/guestfish-actions.pod:711
18312 " copy-size src dest size\n"
18317 #: ../fish/guestfish-actions.pod:719
18322 #: ../fish/guestfish-actions.pod:721
18330 #: ../fish/guestfish-actions.pod:726
18335 #: ../fish/guestfish-actions.pod:728
18343 #: ../fish/guestfish-actions.pod:733
18348 #: ../fish/guestfish-actions.pod:735
18356 #: ../fish/guestfish-actions.pod:742
18358 "If the destination is a device, it must be as large or larger than the "
18359 "source file or device, otherwise the copy will fail. This command cannot do "
18360 "partial copies (see L</copy-size>)."
18364 #: ../fish/guestfish-actions.pod:746
18369 #: ../fish/guestfish-actions.pod:748
18372 " debug subcmd 'extraargs ...'\n"
18377 #: ../fish/guestfish-actions.pod:750
18379 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
18380 "daemon) that runs inside the qemu subprocess."
18384 #: ../fish/guestfish-actions.pod:758
18385 msgid "debug-upload"
18389 #: ../fish/guestfish-actions.pod:760
18392 " debug-upload (filename|-) tmpname mode\n"
18397 #: ../fish/guestfish-actions.pod:762
18399 "The L</debug-upload> command uploads a file to the libguestfs appliance."
18403 #: ../fish/guestfish-actions.pod:771
18408 #: ../fish/guestfish-actions.pod:773
18416 #: ../fish/guestfish-actions.pod:781
18421 #: ../fish/guestfish-actions.pod:783
18429 #: ../fish/guestfish-actions.pod:792
18434 #: ../fish/guestfish-actions.pod:794
18442 #: ../fish/guestfish-actions.pod:800
18444 "Another way to get the same information is to enable verbose messages with "
18445 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
18446 "before running the program."
18450 #: ../fish/guestfish-actions.pod:805
18455 #: ../fish/guestfish-actions.pod:807
18458 " download remotefilename (filename|-)\n"
18463 #: ../fish/guestfish-actions.pod:814
18464 msgid "See also L</upload>, L</cat>."
18468 #: ../fish/guestfish-actions.pod:818
18469 msgid "download-offset"
18473 #: ../fish/guestfish-actions.pod:820
18476 " download-offset remotefilename (filename|-) offset size\n"
18481 #: ../fish/guestfish-actions.pod:828
18483 "Note that there is no limit on the amount of data that can be downloaded "
18484 "with this call, unlike with L</pread>, and this call always reads the full "
18485 "amount unless an error occurs."
18489 #: ../fish/guestfish-actions.pod:833
18490 msgid "See also L</download>, L</pread>."
18494 #: ../fish/guestfish-actions.pod:837
18495 msgid "drop-caches"
18499 #: ../fish/guestfish-actions.pod:839
18502 " drop-caches whattodrop\n"
18507 #: ../fish/guestfish-actions.pod:851
18512 #: ../fish/guestfish-actions.pod:853
18520 #: ../fish/guestfish-actions.pod:865
18525 #: ../fish/guestfish-actions.pod:867
18528 " e2fsck-f device\n"
18533 #: ../fish/guestfish-actions.pod:873
18535 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
18536 "should use L</fsck>."
18540 #: ../fish/guestfish-actions.pod:876
18541 msgid "echo-daemon"
18545 #: ../fish/guestfish-actions.pod:878
18548 " echo-daemon 'words ...'\n"
18553 #: ../fish/guestfish-actions.pod:885
18554 msgid "See also L</ping-daemon>."
18558 #: ../fish/guestfish-actions.pod:887
18563 #: ../fish/guestfish-actions.pod:889
18566 " egrep regex path\n"
18571 #: ../fish/guestfish-actions.pod:897
18576 #: ../fish/guestfish-actions.pod:899
18579 " egrepi regex path\n"
18584 #: ../fish/guestfish-actions.pod:907
18589 #: ../fish/guestfish-actions.pod:909
18592 " equal file1 file2\n"
18597 #: ../fish/guestfish-actions.pod:916
18602 #: ../fish/guestfish-actions.pod:918
18610 #: ../fish/guestfish-actions.pod:923
18611 msgid "See also L</is-file>, L</is-dir>, L</stat>."
18615 #: ../fish/guestfish-actions.pod:925
18620 #: ../fish/guestfish-actions.pod:927
18623 " fallocate path len\n"
18628 #: ../fish/guestfish-actions.pod:944
18629 msgid "fallocate64"
18633 #: ../fish/guestfish-actions.pod:946
18636 " fallocate64 path len\n"
18641 #: ../fish/guestfish-actions.pod:952
18643 "Note that this call allocates disk blocks for the file. To create a sparse "
18644 "file use L</truncate-size> instead."
18648 #: ../fish/guestfish-actions.pod:955
18650 "The deprecated call L</fallocate> does the same, but owing to an oversight "
18651 "it only allowed 30 bit lengths to be specified, effectively limiting the "
18652 "maximum size of files created through that call to 1GB."
18656 #: ../fish/guestfish-actions.pod:964
18661 #: ../fish/guestfish-actions.pod:966
18664 " fgrep pattern path\n"
18669 #: ../fish/guestfish-actions.pod:974
18674 #: ../fish/guestfish-actions.pod:976
18677 " fgrepi pattern path\n"
18682 #: ../fish/guestfish-actions.pod:984
18687 #: ../fish/guestfish-actions.pod:986
18695 #: ../fish/guestfish-actions.pod:998
18697 "This command can also be used on C</dev/> devices (and partitions, LV "
18698 "names). You can for example use this to determine if a device contains a "
18699 "filesystem, although it's usually better to use L</vfs-type>."
18703 #: ../fish/guestfish-actions.pod:1008
18704 msgid "file-architecture"
18708 #: ../fish/guestfish-actions.pod:1010
18711 " file-architecture filename\n"
18716 #: ../fish/guestfish-actions.pod:1113
18721 #: ../fish/guestfish-actions.pod:1115
18729 #: ../fish/guestfish-actions.pod:1119
18731 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
18732 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
18736 #: ../fish/guestfish-actions.pod:1123
18741 #: ../fish/guestfish-actions.pod:1125
18744 " fill c len path\n"
18749 #: ../fish/guestfish-actions.pod:1131
18751 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18752 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
18753 "L</fill-pattern>."
18757 #: ../fish/guestfish-actions.pod:1136
18758 msgid "fill-pattern"
18762 #: ../fish/guestfish-actions.pod:1138
18765 " fill-pattern pattern len path\n"
18770 #: ../fish/guestfish-actions.pod:1140
18772 "This function is like L</fill> except that it creates a new file of length "
18773 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18774 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18779 #: ../fish/guestfish-actions.pod:1145
18784 #: ../fish/guestfish-actions.pod:1147
18787 " find directory\n"
18792 #: ../fish/guestfish-actions.pod:1161
18793 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
18797 #: ../fish/guestfish-actions.pod:1174
18798 msgid "See also L</find0>."
18802 #: ../fish/guestfish-actions.pod:1179
18807 #: ../fish/guestfish-actions.pod:1181
18810 " find0 directory (files|-)\n"
18815 #: ../fish/guestfish-actions.pod:1187
18817 "This command works the same way as L</find> with the following exceptions:"
18821 #: ../fish/guestfish-actions.pod:1214
18822 msgid "findfs-label"
18826 #: ../fish/guestfish-actions.pod:1216
18829 " findfs-label label\n"
18834 #: ../fish/guestfish-actions.pod:1222
18835 msgid "To find the label of a filesystem, use L</vfs-label>."
18839 #: ../fish/guestfish-actions.pod:1224
18840 msgid "findfs-uuid"
18844 #: ../fish/guestfish-actions.pod:1226
18847 " findfs-uuid uuid\n"
18852 #: ../fish/guestfish-actions.pod:1232
18853 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
18857 #: ../fish/guestfish-actions.pod:1234
18862 #: ../fish/guestfish-actions.pod:1236
18865 " fsck fstype device\n"
18870 #: ../fish/guestfish-actions.pod:1266
18875 #: ../fish/guestfish-actions.pod:1268
18883 #: ../fish/guestfish-actions.pod:1275
18884 msgid "get-autosync"
18888 #: ../fish/guestfish-actions.pod:1277
18896 #: ../fish/guestfish-actions.pod:1281
18901 #: ../fish/guestfish-actions.pod:1283
18909 #: ../fish/guestfish-actions.pod:1287
18910 msgid "get-e2label"
18914 #: ../fish/guestfish-actions.pod:1289
18917 " get-e2label device\n"
18922 #: ../fish/guestfish-actions.pod:1301
18927 #: ../fish/guestfish-actions.pod:1303
18930 " get-e2uuid device\n"
18935 #: ../fish/guestfish-actions.pod:1315
18936 msgid "get-memsize"
18940 #: ../fish/guestfish-actions.pod:1317
18948 #: ../fish/guestfish-actions.pod:1322
18950 "If L</set-memsize> was not called on this handle, and if "
18951 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18952 "value for memsize."
18956 #: ../fish/guestfish-actions.pod:1329
18957 msgid "get-network"
18961 #: ../fish/guestfish-actions.pod:1331
18969 #: ../fish/guestfish-actions.pod:1335
18974 #: ../fish/guestfish-actions.pod:1337
18982 #: ../fish/guestfish-actions.pod:1344
18987 #: ../fish/guestfish-actions.pod:1346
18992 #: ../fish/guestfish-actions.pod:1348
19000 #: ../fish/guestfish-actions.pod:1355
19005 #: ../fish/guestfish-actions.pod:1357
19013 #: ../fish/guestfish-actions.pod:1364
19014 msgid "get-recovery-proc"
19018 #: ../fish/guestfish-actions.pod:1366
19021 " get-recovery-proc\n"
19026 #: ../fish/guestfish-actions.pod:1370
19027 msgid "get-selinux"
19031 #: ../fish/guestfish-actions.pod:1372
19039 #: ../fish/guestfish-actions.pod:1374
19041 "This returns the current setting of the selinux flag which is passed to the "
19042 "appliance at boot time. See L</set-selinux>."
19046 #: ../fish/guestfish-actions.pod:1380
19051 #: ../fish/guestfish-actions.pod:1382
19059 #: ../fish/guestfish-actions.pod:1389
19064 #: ../fish/guestfish-actions.pod:1391
19072 #: ../fish/guestfish-actions.pod:1395
19077 #: ../fish/guestfish-actions.pod:1397
19085 #: ../fish/guestfish-actions.pod:1399
19087 "Return the current umask. By default the umask is C<022> unless it has been "
19088 "set by calling L</umask>."
19092 #: ../fish/guestfish-actions.pod:1402
19093 msgid "get-verbose"
19097 #: ../fish/guestfish-actions.pod:1404
19105 #: ../fish/guestfish-actions.pod:1408
19110 #: ../fish/guestfish-actions.pod:1410
19118 #: ../fish/guestfish-actions.pod:1414
19119 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
19123 #: ../fish/guestfish-actions.pod:1417
19128 #: ../fish/guestfish-actions.pod:1419
19131 " getxattrs path\n"
19136 #: ../fish/guestfish-actions.pod:1427
19137 msgid "See also: L</lgetxattrs>, L<attr(5)>."
19141 #: ../fish/guestfish-actions.pod:1429
19142 msgid "glob-expand"
19146 #: ../fish/guestfish-actions.pod:1431
19149 " glob-expand pattern\n"
19154 #: ../fish/guestfish-actions.pod:1444
19159 #: ../fish/guestfish-actions.pod:1446
19162 " grep regex path\n"
19167 #: ../fish/guestfish-actions.pod:1454
19172 #: ../fish/guestfish-actions.pod:1456
19175 " grepi regex path\n"
19180 #: ../fish/guestfish-actions.pod:1464
19181 msgid "grub-install"
19185 #: ../fish/guestfish-actions.pod:1466
19188 " grub-install root device\n"
19193 #: ../fish/guestfish-actions.pod:1482
19198 #: ../fish/guestfish-actions.pod:1484
19206 #: ../fish/guestfish-actions.pod:1492
19211 #: ../fish/guestfish-actions.pod:1494
19214 " head-n nrlines path\n"
19219 #: ../fish/guestfish-actions.pod:1507
19224 #: ../fish/guestfish-actions.pod:1509
19232 #: ../fish/guestfish-actions.pod:1517
19237 #: ../fish/guestfish-actions.pod:1519
19240 " initrd-cat initrdpath filename\n"
19245 #: ../fish/guestfish-actions.pod:1531
19246 msgid "See also L</initrd-list>."
19250 #: ../fish/guestfish-actions.pod:1536
19251 msgid "initrd-list"
19255 #: ../fish/guestfish-actions.pod:1538
19258 " initrd-list path\n"
19263 #: ../fish/guestfish-actions.pod:1550
19264 msgid "inotify-add-watch"
19268 #: ../fish/guestfish-actions.pod:1552
19271 " inotify-add-watch path mask\n"
19276 #: ../fish/guestfish-actions.pod:1564
19277 msgid "inotify-close"
19281 #: ../fish/guestfish-actions.pod:1566
19289 #: ../fish/guestfish-actions.pod:1572
19290 msgid "inotify-files"
19294 #: ../fish/guestfish-actions.pod:1574
19302 #: ../fish/guestfish-actions.pod:1576
19304 "This function is a helpful wrapper around L</inotify-read> which just "
19305 "returns a list of pathnames of objects that were touched. The returned "
19306 "pathnames are sorted and deduplicated."
19310 #: ../fish/guestfish-actions.pod:1580
19311 msgid "inotify-init"
19315 #: ../fish/guestfish-actions.pod:1582
19318 " inotify-init maxevents\n"
19323 #: ../fish/guestfish-actions.pod:1588
19325 "C<maxevents> is the maximum number of events which will be queued up between "
19326 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
19327 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
19328 "default was 16384 events. Beyond this limit, the kernel throws away events, "
19329 "but records the fact that it threw them away by setting a flag "
19330 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
19334 #: ../fish/guestfish-actions.pod:1598
19336 "Before any events are generated, you have to add some watches to the "
19337 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
19338 "L</inotify-watch-all>."
19342 #: ../fish/guestfish-actions.pod:1604
19344 "Queued up events should be read periodically by calling L</inotify-read> (or "
19345 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
19346 "If you don't read the events out often enough then you risk the internal "
19347 "queue overflowing."
19351 #: ../fish/guestfish-actions.pod:1611
19353 "The handle should be closed after use by calling L</inotify-close>. This "
19354 "also removes any watches automatically."
19358 #: ../fish/guestfish-actions.pod:1620
19359 msgid "inotify-read"
19363 #: ../fish/guestfish-actions.pod:1622
19371 #: ../fish/guestfish-actions.pod:1635
19372 msgid "inotify-rm-watch"
19376 #: ../fish/guestfish-actions.pod:1637
19379 " inotify-rm-watch wd\n"
19384 #: ../fish/guestfish-actions.pod:1639
19385 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
19389 #: ../fish/guestfish-actions.pod:1642
19390 msgid "inspect-get-arch"
19394 #: ../fish/guestfish-actions.pod:1644
19397 " inspect-get-arch root\n"
19402 #: ../fish/guestfish-actions.pod:1646 ../fish/guestfish-actions.pod:1662
19403 #: ../fish/guestfish-actions.pod:1724 ../fish/guestfish-actions.pod:1742
19404 #: ../fish/guestfish-actions.pod:1763 ../fish/guestfish-actions.pod:1778
19405 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1818
19406 #: ../fish/guestfish-actions.pod:1849
19408 "This function should only be called with a root device string as returned by "
19413 #: ../fish/guestfish-actions.pod:1649
19415 "This returns the architecture of the inspected operating system. The "
19416 "possible return values are listed under L</file-architecture>."
19420 #: ../fish/guestfish-actions.pod:1658
19421 msgid "inspect-get-distro"
19425 #: ../fish/guestfish-actions.pod:1660
19428 " inspect-get-distro root\n"
19433 #: ../fish/guestfish-actions.pod:1720
19434 msgid "inspect-get-filesystems"
19438 #: ../fish/guestfish-actions.pod:1722
19441 " inspect-get-filesystems root\n"
19446 #: ../fish/guestfish-actions.pod:1735
19448 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19449 "get-mountpoints>."
19453 #: ../fish/guestfish-actions.pod:1738
19454 msgid "inspect-get-major-version"
19458 #: ../fish/guestfish-actions.pod:1740
19461 " inspect-get-major-version root\n"
19466 #: ../fish/guestfish-actions.pod:1759
19467 msgid "inspect-get-minor-version"
19471 #: ../fish/guestfish-actions.pod:1761
19474 " inspect-get-minor-version root\n"
19479 #: ../fish/guestfish-actions.pod:1771
19481 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19482 "get-major-version>."
19486 #: ../fish/guestfish-actions.pod:1774
19487 msgid "inspect-get-mountpoints"
19491 #: ../fish/guestfish-actions.pod:1776
19494 " inspect-get-mountpoints root\n"
19499 #: ../fish/guestfish-actions.pod:1794
19501 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19502 "get-filesystems>."
19506 #: ../fish/guestfish-actions.pod:1797
19507 msgid "inspect-get-product-name"
19511 #: ../fish/guestfish-actions.pod:1799
19514 " inspect-get-product-name root\n"
19519 #: ../fish/guestfish-actions.pod:1814
19520 msgid "inspect-get-type"
19524 #: ../fish/guestfish-actions.pod:1816
19527 " inspect-get-type root\n"
19532 #: ../fish/guestfish-actions.pod:1845
19533 msgid "inspect-get-windows-systemroot"
19537 #: ../fish/guestfish-actions.pod:1847
19540 " inspect-get-windows-systemroot root\n"
19545 #: ../fish/guestfish-actions.pod:1861
19550 #: ../fish/guestfish-actions.pod:1863
19558 #: ../fish/guestfish-actions.pod:1878
19560 "You can pass the root string(s) returned to other L</inspect-get-*> "
19561 "functions in order to query further information about each operating system, "
19562 "such as the name and version."
19566 #: ../fish/guestfish-actions.pod:1883
19568 "This function uses other libguestfs features such as L</mount-ro> and L</"
19569 "umount-all> in order to mount and unmount filesystems and look at the "
19570 "contents. This should be called with no disks currently mounted. The "
19571 "function may also use Augeas, so any existing Augeas handle will be closed."
19575 #: ../fish/guestfish-actions.pod:1895 ../fish/guestfish-actions.pod:2051
19576 #: ../fish/guestfish-actions.pod:2097
19577 msgid "See also L</list-filesystems>."
19581 #: ../fish/guestfish-actions.pod:1897
19582 msgid "is-blockdev"
19586 #: ../fish/guestfish-actions.pod:1899
19589 " is-blockdev path\n"
19594 #: ../fish/guestfish-actions.pod:1904 ../fish/guestfish-actions.pod:1922
19595 #: ../fish/guestfish-actions.pod:1941 ../fish/guestfish-actions.pod:1950
19596 #: ../fish/guestfish-actions.pod:1960 ../fish/guestfish-actions.pod:1994
19597 #: ../fish/guestfish-actions.pod:2003
19598 msgid "See also L</stat>."
19602 #: ../fish/guestfish-actions.pod:1906
19607 #: ../fish/guestfish-actions.pod:1908
19615 #: ../fish/guestfish-actions.pod:1915
19620 #: ../fish/guestfish-actions.pod:1917
19623 " is-chardev path\n"
19628 #: ../fish/guestfish-actions.pod:1924
19633 #: ../fish/guestfish-actions.pod:1926
19641 #: ../fish/guestfish-actions.pod:1933
19646 #: ../fish/guestfish-actions.pod:1935
19654 #: ../fish/guestfish-actions.pod:1943
19659 #: ../fish/guestfish-actions.pod:1945
19667 #: ../fish/guestfish-actions.pod:1952
19672 #: ../fish/guestfish-actions.pod:1954
19680 #: ../fish/guestfish-actions.pod:1962
19681 msgid "is-launching"
19685 #: ../fish/guestfish-actions.pod:1964
19693 #: ../fish/guestfish-actions.pod:1971
19698 #: ../fish/guestfish-actions.pod:1973
19706 #: ../fish/guestfish-actions.pod:1978
19711 #: ../fish/guestfish-actions.pod:1980
19719 #: ../fish/guestfish-actions.pod:1987
19724 #: ../fish/guestfish-actions.pod:1989
19727 " is-socket path\n"
19732 #: ../fish/guestfish-actions.pod:1996
19737 #: ../fish/guestfish-actions.pod:1998
19740 " is-symlink path\n"
19745 #: ../fish/guestfish-actions.pod:2005
19746 msgid "kill-subprocess"
19750 #: ../fish/guestfish-actions.pod:2007
19753 " kill-subprocess\n"
19758 #: ../fish/guestfish-actions.pod:2011
19763 #: ../fish/guestfish-actions.pod:2013
19768 #: ../fish/guestfish-actions.pod:2015
19776 #: ../fish/guestfish-actions.pod:2023
19781 #: ../fish/guestfish-actions.pod:2025
19784 " lchown owner group path\n"
19789 #: ../fish/guestfish-actions.pod:2027
19791 "Change the file owner to C<owner> and group to C<group>. This is like L</"
19792 "chown> but if C<path> is a symlink then the link itself is changed, not the "
19797 #: ../fish/guestfish-actions.pod:2035
19802 #: ../fish/guestfish-actions.pod:2037
19805 " lgetxattrs path\n"
19810 #: ../fish/guestfish-actions.pod:2039
19812 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
19813 "it returns the extended attributes of the link itself."
19817 #: ../fish/guestfish-actions.pod:2043
19818 msgid "list-devices"
19822 #: ../fish/guestfish-actions.pod:2045
19830 #: ../fish/guestfish-actions.pod:2053
19831 msgid "list-filesystems"
19835 #: ../fish/guestfish-actions.pod:2055
19838 " list-filesystems\n"
19843 #: ../fish/guestfish-actions.pod:2074
19845 "This command runs other libguestfs commands, which might include L</mount> "
19846 "and L</umount>, and therefore you should use this soon after launch and only "
19847 "when nothing is mounted."
19851 #: ../fish/guestfish-actions.pod:2078
19853 "Not all of the filesystems returned will be mountable. In particular, swap "
19854 "partitions are returned in the list. Also this command does not check that "
19855 "each filesystem found is valid and mountable, and some filesystems might be "
19856 "mountable but require special options. Filesystems may not all belong to a "
19857 "single logical operating system (use L</inspect-os> to look for OSes)."
19861 #: ../fish/guestfish-actions.pod:2086
19862 msgid "list-partitions"
19866 #: ../fish/guestfish-actions.pod:2088
19869 " list-partitions\n"
19874 #: ../fish/guestfish-actions.pod:2094
19876 "This does not return logical volumes. For that you will need to call L</"
19881 #: ../fish/guestfish-actions.pod:2099
19886 #: ../fish/guestfish-actions.pod:2101
19894 #: ../fish/guestfish-actions.pod:2109
19899 #: ../fish/guestfish-actions.pod:2111
19902 " ln target linkname\n"
19907 #: ../fish/guestfish-actions.pod:2115
19912 #: ../fish/guestfish-actions.pod:2117
19915 " ln-f target linkname\n"
19920 #: ../fish/guestfish-actions.pod:2122
19925 #: ../fish/guestfish-actions.pod:2124
19928 " ln-s target linkname\n"
19933 #: ../fish/guestfish-actions.pod:2128
19938 #: ../fish/guestfish-actions.pod:2130
19941 " ln-sf target linkname\n"
19946 #: ../fish/guestfish-actions.pod:2135
19947 msgid "lremovexattr"
19951 #: ../fish/guestfish-actions.pod:2137
19954 " lremovexattr xattr path\n"
19959 #: ../fish/guestfish-actions.pod:2139
19961 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
19962 "it removes an extended attribute of the link itself."
19966 #: ../fish/guestfish-actions.pod:2143
19971 #: ../fish/guestfish-actions.pod:2145
19979 #: ../fish/guestfish-actions.pod:2151
19981 "This command is mostly useful for interactive sessions. Programs should "
19982 "probably use L</readdir> instead."
19986 #: ../fish/guestfish-actions.pod:2154
19991 #: ../fish/guestfish-actions.pod:2156
19994 " lsetxattr xattr val vallen path\n"
19999 #: ../fish/guestfish-actions.pod:2158
20001 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
20002 "sets an extended attribute of the link itself."
20006 #: ../fish/guestfish-actions.pod:2162
20011 #: ../fish/guestfish-actions.pod:2164
20019 #: ../fish/guestfish-actions.pod:2168
20021 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
20022 "the link is stat-ed, not the file it refers to."
20026 #: ../fish/guestfish-actions.pod:2174
20031 #: ../fish/guestfish-actions.pod:2176
20034 " lstatlist path 'names ...'\n"
20039 #: ../fish/guestfish-actions.pod:2178
20041 "This call allows you to perform the L</lstat> operation on multiple files, "
20042 "where all files are in the directory C<path>. C<names> is the list of files "
20043 "from this directory."
20047 #: ../fish/guestfish-actions.pod:2187
20049 "This call is intended for programs that want to efficiently list a directory "
20050 "contents without making many round-trips. See also L</lxattrlist> for a "
20051 "similarly efficient call for getting extended attributes. Very long "
20052 "directory listings might cause the protocol message size to be exceeded, "
20053 "causing this call to fail. The caller must split up such requests into "
20054 "smaller groups of names."
20058 #: ../fish/guestfish-actions.pod:2195
20059 msgid "luks-add-key"
20063 #: ../fish/guestfish-actions.pod:2197
20066 " luks-add-key device keyslot\n"
20071 #: ../fish/guestfish-actions.pod:2204
20073 "Note that if C<keyslot> already contains a key, then this command will "
20074 "fail. You have to use L</luks-kill-slot> first to remove that key."
20078 #: ../fish/guestfish-actions.pod:2208 ../fish/guestfish-actions.pod:2230
20079 #: ../fish/guestfish-actions.pod:2243 ../fish/guestfish-actions.pod:2257
20080 #: ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2290
20082 "This command has one or more key or passphrase parameters. Guestfish will "
20083 "prompt for these separately."
20087 #: ../fish/guestfish-actions.pod:2211
20092 #: ../fish/guestfish-actions.pod:2213
20095 " luks-close device\n"
20100 #: ../fish/guestfish-actions.pod:2215
20102 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
20103 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
20104 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
20109 #: ../fish/guestfish-actions.pod:2221
20110 msgid "luks-format"
20114 #: ../fish/guestfish-actions.pod:2223
20117 " luks-format device keyslot\n"
20122 #: ../fish/guestfish-actions.pod:2236
20123 msgid "luks-format-cipher"
20127 #: ../fish/guestfish-actions.pod:2238
20130 " luks-format-cipher device keyslot cipher\n"
20135 #: ../fish/guestfish-actions.pod:2240
20137 "This command is the same as L</luks-format> but it also allows you to set "
20138 "the C<cipher> used."
20142 #: ../fish/guestfish-actions.pod:2249
20143 msgid "luks-kill-slot"
20147 #: ../fish/guestfish-actions.pod:2251
20150 " luks-kill-slot device keyslot\n"
20155 #: ../fish/guestfish-actions.pod:2260
20160 #: ../fish/guestfish-actions.pod:2262
20163 " luks-open device mapname\n"
20168 #: ../fish/guestfish-actions.pod:2276
20170 "If this block device contains LVM volume groups, then calling L</vgscan> "
20171 "followed by L</vg-activate-all> will make them visible."
20175 #: ../fish/guestfish-actions.pod:2283
20176 msgid "luks-open-ro"
20180 #: ../fish/guestfish-actions.pod:2285
20183 " luks-open-ro device mapname\n"
20188 #: ../fish/guestfish-actions.pod:2287
20190 "This is the same as L</luks-open> except that a read-only mapping is created."
20194 #: ../fish/guestfish-actions.pod:2293
20199 #: ../fish/guestfish-actions.pod:2295
20202 " lvcreate logvol volgroup mbytes\n"
20207 #: ../fish/guestfish-actions.pod:2300
20208 msgid "lvm-canonical-lv-name"
20212 #: ../fish/guestfish-actions.pod:2302
20215 " lvm-canonical-lv-name lvname\n"
20220 #: ../fish/guestfish-actions.pod:2311
20221 msgid "See also L</is-lv>."
20225 #: ../fish/guestfish-actions.pod:2313
20226 msgid "lvm-clear-filter"
20230 #: ../fish/guestfish-actions.pod:2315
20233 " lvm-clear-filter\n"
20238 #: ../fish/guestfish-actions.pod:2317
20240 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
20245 #: ../fish/guestfish-actions.pod:2323
20246 msgid "lvm-remove-all"
20250 #: ../fish/guestfish-actions.pod:2325
20253 " lvm-remove-all\n"
20258 #: ../fish/guestfish-actions.pod:2333
20259 msgid "lvm-set-filter"
20263 #: ../fish/guestfish-actions.pod:2335
20266 " lvm-set-filter 'devices ...'\n"
20271 #: ../fish/guestfish-actions.pod:2360
20276 #: ../fish/guestfish-actions.pod:2362
20279 " lvremove device\n"
20284 #: ../fish/guestfish-actions.pod:2370
20289 #: ../fish/guestfish-actions.pod:2372
20292 " lvrename logvol newlogvol\n"
20297 #: ../fish/guestfish-actions.pod:2376
20302 #: ../fish/guestfish-actions.pod:2378
20305 " lvresize device mbytes\n"
20310 #: ../fish/guestfish-actions.pod:2384
20311 msgid "lvresize-free"
20315 #: ../fish/guestfish-actions.pod:2386
20318 " lvresize-free lv percent\n"
20323 #: ../fish/guestfish-actions.pod:2394
20328 #: ../fish/guestfish-actions.pod:2396
20336 #: ../fish/guestfish-actions.pod:2404
20337 msgid "See also L</lvs-full>, L</list-filesystems>."
20341 #: ../fish/guestfish-actions.pod:2406
20346 #: ../fish/guestfish-actions.pod:2408
20354 #: ../fish/guestfish-actions.pod:2413
20359 #: ../fish/guestfish-actions.pod:2415
20367 #: ../fish/guestfish-actions.pod:2419
20372 #: ../fish/guestfish-actions.pod:2421
20375 " lxattrlist path 'names ...'\n"
20380 #: ../fish/guestfish-actions.pod:2437
20382 "This call is intended for programs that want to efficiently list a directory "
20383 "contents without making many round-trips. See also L</lstatlist> for a "
20384 "similarly efficient call for getting standard stats. Very long directory "
20385 "listings might cause the protocol message size to be exceeded, causing this "
20386 "call to fail. The caller must split up such requests into smaller groups of "
20391 #: ../fish/guestfish-actions.pod:2445
20396 #: ../fish/guestfish-actions.pod:2447
20404 #: ../fish/guestfish-actions.pod:2451
20409 #: ../fish/guestfish-actions.pod:2453
20412 " mkdir-mode path mode\n"
20417 #: ../fish/guestfish-actions.pod:2462
20418 msgid "See also L</mkdir>, L</umask>"
20422 #: ../fish/guestfish-actions.pod:2464
20427 #: ../fish/guestfish-actions.pod:2466
20435 #: ../fish/guestfish-actions.pod:2471
20440 #: ../fish/guestfish-actions.pod:2473
20443 " mkdtemp template\n"
20448 #: ../fish/guestfish-actions.pod:2494
20453 #: ../fish/guestfish-actions.pod:2496
20456 " mke2fs-J fstype blocksize device journal\n"
20461 #: ../fish/guestfish-actions.pod:2504
20462 msgid "See also L</mke2journal>."
20466 #: ../fish/guestfish-actions.pod:2506
20471 #: ../fish/guestfish-actions.pod:2508
20474 " mke2fs-JL fstype blocksize device label\n"
20479 #: ../fish/guestfish-actions.pod:2513
20480 msgid "See also L</mke2journal-L>."
20484 #: ../fish/guestfish-actions.pod:2515
20489 #: ../fish/guestfish-actions.pod:2517
20492 " mke2fs-JU fstype blocksize device uuid\n"
20497 #: ../fish/guestfish-actions.pod:2522
20498 msgid "See also L</mke2journal-U>."
20502 #: ../fish/guestfish-actions.pod:2524
20503 msgid "mke2journal"
20507 #: ../fish/guestfish-actions.pod:2526
20510 " mke2journal blocksize device\n"
20515 #: ../fish/guestfish-actions.pod:2533
20516 msgid "mke2journal-L"
20520 #: ../fish/guestfish-actions.pod:2535
20523 " mke2journal-L blocksize label device\n"
20528 #: ../fish/guestfish-actions.pod:2539
20529 msgid "mke2journal-U"
20533 #: ../fish/guestfish-actions.pod:2541
20536 " mke2journal-U blocksize uuid device\n"
20541 #: ../fish/guestfish-actions.pod:2545
20546 #: ../fish/guestfish-actions.pod:2547
20549 " mkfifo mode path\n"
20554 #: ../fish/guestfish-actions.pod:2549
20556 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
20557 "is just a convenient wrapper around L</mknod>."
20561 #: ../fish/guestfish-actions.pod:2555
20566 #: ../fish/guestfish-actions.pod:2557
20569 " mkfs fstype device\n"
20574 #: ../fish/guestfish-actions.pod:2563
20579 #: ../fish/guestfish-actions.pod:2565
20582 " mkfs-b fstype blocksize device\n"
20587 #: ../fish/guestfish-actions.pod:2567
20589 "This call is similar to L</mkfs>, but it allows you to control the block "
20590 "size of the resulting filesystem. Supported block sizes depend on the "
20591 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
20595 #: ../fish/guestfish-actions.pod:2575
20596 msgid "mkmountpoint"
20600 #: ../fish/guestfish-actions.pod:2577
20603 " mkmountpoint exemptpath\n"
20608 #: ../fish/guestfish-actions.pod:2579
20610 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
20611 "to create extra mountpoints before mounting the first filesystem."
20615 #: ../fish/guestfish-actions.pod:2603
20617 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
20618 "unexpected errors if you try to mix these calls. It is safest to manually "
20619 "unmount filesystems and remove mountpoints after use."
20623 #: ../fish/guestfish-actions.pod:2607
20625 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
20626 "for this to work for manual mountpoints, you must ensure that the innermost "
20627 "mountpoints have the longest pathnames, as in the example code above."
20631 #: ../fish/guestfish-actions.pod:2614
20633 "Autosync [see L</set-autosync>, this is set by default on handles] means "
20634 "that L</umount-all> is called when the handle is closed which can also "
20635 "trigger these issues."
20639 #: ../fish/guestfish-actions.pod:2618
20644 #: ../fish/guestfish-actions.pod:2620
20647 " mknod mode devmajor devminor path\n"
20652 #: ../fish/guestfish-actions.pod:2630
20654 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
20655 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
20656 "regular file). These constants are available in the standard Linux header "
20657 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
20658 "wrappers around this command which bitwise OR in the appropriate constant "
20663 #: ../fish/guestfish-actions.pod:2640
20668 #: ../fish/guestfish-actions.pod:2642
20671 " mknod-b mode devmajor devminor path\n"
20676 #: ../fish/guestfish-actions.pod:2644
20678 "This call creates a block device node called C<path> with mode C<mode> and "
20679 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20680 "wrapper around L</mknod>."
20684 #: ../fish/guestfish-actions.pod:2650
20689 #: ../fish/guestfish-actions.pod:2652
20692 " mknod-c mode devmajor devminor path\n"
20697 #: ../fish/guestfish-actions.pod:2654
20699 "This call creates a char device node called C<path> with mode C<mode> and "
20700 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20701 "wrapper around L</mknod>."
20705 #: ../fish/guestfish-actions.pod:2660
20710 #: ../fish/guestfish-actions.pod:2662
20718 #: ../fish/guestfish-actions.pod:2666
20723 #: ../fish/guestfish-actions.pod:2668
20726 " mkswap-L label device\n"
20731 #: ../fish/guestfish-actions.pod:2676
20736 #: ../fish/guestfish-actions.pod:2678
20739 " mkswap-U uuid device\n"
20744 #: ../fish/guestfish-actions.pod:2682
20745 msgid "mkswap-file"
20749 #: ../fish/guestfish-actions.pod:2684
20752 " mkswap-file path\n"
20757 #: ../fish/guestfish-actions.pod:2688
20759 "This command just writes a swap file signature to an existing file. To "
20760 "create the file itself, use something like L</fallocate>."
20764 #: ../fish/guestfish-actions.pod:2691
20769 #: ../fish/guestfish-actions.pod:2693
20772 " modprobe modulename\n"
20777 #: ../fish/guestfish-actions.pod:2700
20782 #: ../fish/guestfish-actions.pod:2702
20785 " mount device mountpoint\n"
20790 #: ../fish/guestfish-actions.pod:2718
20792 "B<Important note:> When you use this call, the filesystem options C<sync> "
20793 "and C<noatime> are set implicitly. This was originally done because we "
20794 "thought it would improve reliability, but it turns out that I<-o sync> has a "
20795 "very large negative performance impact and negligible effect on "
20796 "reliability. Therefore we recommend that you avoid using L</mount> in any "
20797 "code that needs performance, and instead use L</mount-options> (use an empty "
20798 "string for the first parameter if you don't want any options)."
20802 #: ../fish/guestfish-actions.pod:2728
20807 #: ../fish/guestfish-actions.pod:2730
20810 " mount-loop file mountpoint\n"
20815 #: ../fish/guestfish-actions.pod:2736
20816 msgid "mount-options"
20820 #: ../fish/guestfish-actions.pod:2738
20823 " mount-options options device mountpoint\n"
20828 #: ../fish/guestfish-actions.pod:2740
20830 "This is the same as the L</mount> command, but it allows you to set the "
20831 "mount options as for the L<mount(8)> I<-o> flag."
20835 #: ../fish/guestfish-actions.pod:2748
20840 #: ../fish/guestfish-actions.pod:2750
20843 " mount-ro device mountpoint\n"
20848 #: ../fish/guestfish-actions.pod:2752
20850 "This is the same as the L</mount> command, but it mounts the filesystem with "
20851 "the read-only (I<-o ro>) flag."
20855 #: ../fish/guestfish-actions.pod:2755
20860 #: ../fish/guestfish-actions.pod:2757
20863 " mount-vfs options vfstype device mountpoint\n"
20868 #: ../fish/guestfish-actions.pod:2759
20870 "This is the same as the L</mount> command, but it allows you to set both the "
20871 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20875 #: ../fish/guestfish-actions.pod:2763
20876 msgid "mountpoints"
20880 #: ../fish/guestfish-actions.pod:2765
20888 #: ../fish/guestfish-actions.pod:2767
20890 "This call is similar to L</mounts>. That call returns a list of devices. "
20891 "This one returns a hash table (map) of device name to directory where the "
20892 "device is mounted."
20896 #: ../fish/guestfish-actions.pod:2771
20901 #: ../fish/guestfish-actions.pod:2773
20909 #: ../fish/guestfish-actions.pod:2780
20910 msgid "See also: L</mountpoints>"
20914 #: ../fish/guestfish-actions.pod:2782
20919 #: ../fish/guestfish-actions.pod:2784
20927 #: ../fish/guestfish-actions.pod:2789
20928 msgid "ntfs-3g-probe"
20932 #: ../fish/guestfish-actions.pod:2791
20935 " ntfs-3g-probe true|false device\n"
20940 #: ../fish/guestfish-actions.pod:2805
20945 #: ../fish/guestfish-actions.pod:2807
20948 " ntfsresize device\n"
20953 #: ../fish/guestfish-actions.pod:2813
20954 msgid "ntfsresize-size"
20958 #: ../fish/guestfish-actions.pod:2815
20961 " ntfsresize-size device size\n"
20966 #: ../fish/guestfish-actions.pod:2817
20968 "This command is the same as L</ntfsresize> except that it allows you to "
20969 "specify the new size (in bytes) explicitly."
20973 #: ../fish/guestfish-actions.pod:2820
20978 #: ../fish/guestfish-actions.pod:2822
20981 " part-add device prlogex startsect endsect\n"
20986 #: ../fish/guestfish-actions.pod:2824
20988 "This command adds a partition to C<device>. If there is no partition table "
20989 "on the device, call L</part-init> first."
20993 #: ../fish/guestfish-actions.pod:2836
20995 "Creating a partition which covers the whole disk is not so easy. Use L</"
20996 "part-disk> to do that."
21000 #: ../fish/guestfish-actions.pod:2839
21005 #: ../fish/guestfish-actions.pod:2841
21008 " part-del device partnum\n"
21013 #: ../fish/guestfish-actions.pod:2849
21018 #: ../fish/guestfish-actions.pod:2851
21021 " part-disk device parttype\n"
21026 #: ../fish/guestfish-actions.pod:2853
21028 "This command is simply a combination of L</part-init> followed by L</part-"
21029 "add> to create a single primary partition covering the whole disk."
21033 #: ../fish/guestfish-actions.pod:2857
21035 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
21036 "possible values are described in L</part-init>."
21040 #: ../fish/guestfish-actions.pod:2863
21041 msgid "part-get-bootable"
21045 #: ../fish/guestfish-actions.pod:2865
21048 " part-get-bootable device partnum\n"
21053 #: ../fish/guestfish-actions.pod:2870
21054 msgid "See also L</part-set-bootable>."
21058 #: ../fish/guestfish-actions.pod:2872
21059 msgid "part-get-mbr-id"
21063 #: ../fish/guestfish-actions.pod:2874
21066 " part-get-mbr-id device partnum\n"
21071 #: ../fish/guestfish-actions.pod:2879 ../fish/guestfish-actions.pod:3017
21073 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
21074 "undefined results for other partition table types (see L</part-get-"
21079 #: ../fish/guestfish-actions.pod:2883
21080 msgid "part-get-parttype"
21084 #: ../fish/guestfish-actions.pod:2885
21087 " part-get-parttype device\n"
21092 #: ../fish/guestfish-actions.pod:2890
21094 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
21095 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
21096 "possible, although unusual. See L</part-init> for a full list."
21100 #: ../fish/guestfish-actions.pod:2895
21105 #: ../fish/guestfish-actions.pod:2897
21108 " part-init device parttype\n"
21113 #: ../fish/guestfish-actions.pod:2903
21115 "Initially there are no partitions. Following this, you should call L</part-"
21116 "add> for each partition required."
21120 #: ../fish/guestfish-actions.pod:2966
21125 #: ../fish/guestfish-actions.pod:2968
21128 " part-list device\n"
21133 #: ../fish/guestfish-actions.pod:2983
21135 "Start of the partition I<in bytes>. To get sectors you have to divide by "
21136 "the device's sector size, see L</blockdev-getss>."
21140 #: ../fish/guestfish-actions.pod:2996
21141 msgid "part-set-bootable"
21145 #: ../fish/guestfish-actions.pod:2998
21148 " part-set-bootable device partnum true|false\n"
21153 #: ../fish/guestfish-actions.pod:3007
21154 msgid "part-set-mbr-id"
21158 #: ../fish/guestfish-actions.pod:3009
21161 " part-set-mbr-id device partnum idbyte\n"
21166 #: ../fish/guestfish-actions.pod:3021
21167 msgid "part-set-name"
21171 #: ../fish/guestfish-actions.pod:3023
21174 " part-set-name device partnum name\n"
21179 #: ../fish/guestfish-actions.pod:3031
21180 msgid "part-to-dev"
21184 #: ../fish/guestfish-actions.pod:3033
21187 " part-to-dev partition\n"
21192 #: ../fish/guestfish-actions.pod:3039
21194 "The named partition must exist, for example as a string returned from L</"
21195 "list-partitions>."
21199 #: ../fish/guestfish-actions.pod:3042
21200 msgid "ping-daemon"
21204 #: ../fish/guestfish-actions.pod:3044
21212 #: ../fish/guestfish-actions.pod:3051
21217 #: ../fish/guestfish-actions.pod:3053
21220 " pread path count offset\n"
21225 #: ../fish/guestfish-actions.pod:3061
21226 msgid "See also L</pwrite>, L</pread-device>."
21230 #: ../fish/guestfish-actions.pod:3066
21231 msgid "pread-device"
21235 #: ../fish/guestfish-actions.pod:3068
21238 " pread-device device count offset\n"
21243 #: ../fish/guestfish-actions.pod:3076
21244 msgid "See also L</pread>."
21248 #: ../fish/guestfish-actions.pod:3081
21253 #: ../fish/guestfish-actions.pod:3083
21256 " pvcreate device\n"
21261 #: ../fish/guestfish-actions.pod:3089
21266 #: ../fish/guestfish-actions.pod:3091
21269 " pvremove device\n"
21274 #: ../fish/guestfish-actions.pod:3100
21279 #: ../fish/guestfish-actions.pod:3102
21282 " pvresize device\n"
21287 #: ../fish/guestfish-actions.pod:3107
21288 msgid "pvresize-size"
21292 #: ../fish/guestfish-actions.pod:3109
21295 " pvresize-size device size\n"
21300 #: ../fish/guestfish-actions.pod:3111
21302 "This command is the same as L</pvresize> except that it allows you to "
21303 "specify the new size (in bytes) explicitly."
21307 #: ../fish/guestfish-actions.pod:3114
21312 #: ../fish/guestfish-actions.pod:3116
21320 #: ../fish/guestfish-actions.pod:3124
21321 msgid "See also L</pvs-full>."
21325 #: ../fish/guestfish-actions.pod:3126
21330 #: ../fish/guestfish-actions.pod:3128
21338 #: ../fish/guestfish-actions.pod:3133
21343 #: ../fish/guestfish-actions.pod:3135
21351 #: ../fish/guestfish-actions.pod:3139
21356 #: ../fish/guestfish-actions.pod:3141
21359 " pwrite path content offset\n"
21364 #: ../fish/guestfish-actions.pod:3152
21365 msgid "See also L</pread>, L</pwrite-device>."
21369 #: ../fish/guestfish-actions.pod:3157
21370 msgid "pwrite-device"
21374 #: ../fish/guestfish-actions.pod:3159
21377 " pwrite-device device content offset\n"
21382 #: ../fish/guestfish-actions.pod:3169
21383 msgid "See also L</pwrite>."
21387 #: ../fish/guestfish-actions.pod:3174
21392 #: ../fish/guestfish-actions.pod:3176
21395 " read-file path\n"
21400 #: ../fish/guestfish-actions.pod:3181
21402 "Unlike L</cat>, this function can correctly handle files that contain "
21403 "embedded ASCII NUL characters. However unlike L</download>, this function "
21404 "is limited in the total size of file that can be handled."
21408 #: ../fish/guestfish-actions.pod:3189
21413 #: ../fish/guestfish-actions.pod:3191
21416 " read-lines path\n"
21421 #: ../fish/guestfish-actions.pod:3198
21423 "Note that this function cannot correctly handle binary files (specifically, "
21424 "files containing C<\\0> character which is treated as end of line). For "
21425 "those you need to use the L</read-file> function which has a more complex "
21430 #: ../fish/guestfish-actions.pod:3203
21435 #: ../fish/guestfish-actions.pod:3205
21443 #: ../fish/guestfish-actions.pod:3257
21445 "This function is primarily intended for use by programs. To get a simple "
21446 "list of names, use L</ls>. To get a printable directory for human "
21447 "consumption, use L</ll>."
21451 #: ../fish/guestfish-actions.pod:3261
21456 #: ../fish/guestfish-actions.pod:3263
21464 #: ../fish/guestfish-actions.pod:3267
21465 msgid "readlinklist"
21469 #: ../fish/guestfish-actions.pod:3269
21472 " readlinklist path 'names ...'\n"
21477 #: ../fish/guestfish-actions.pod:3293
21482 #: ../fish/guestfish-actions.pod:3295
21490 #: ../fish/guestfish-actions.pod:3300
21491 msgid "removexattr"
21495 #: ../fish/guestfish-actions.pod:3302
21498 " removexattr xattr path\n"
21503 #: ../fish/guestfish-actions.pod:3307
21504 msgid "See also: L</lremovexattr>, L<attr(5)>."
21508 #: ../fish/guestfish-actions.pod:3309
21513 #: ../fish/guestfish-actions.pod:3311
21516 " resize2fs device\n"
21521 #: ../fish/guestfish-actions.pod:3316
21523 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
21524 "before calling this command. For unknown reasons C<resize2fs> sometimes "
21525 "gives an error about this and sometimes not. In any case, it is always safe "
21526 "to call L</e2fsck-f> before calling this function."
21530 #: ../fish/guestfish-actions.pod:3322
21531 msgid "resize2fs-size"
21535 #: ../fish/guestfish-actions.pod:3324
21538 " resize2fs-size device size\n"
21543 #: ../fish/guestfish-actions.pod:3326
21545 "This command is the same as L</resize2fs> except that it allows you to "
21546 "specify the new size (in bytes) explicitly."
21550 #: ../fish/guestfish-actions.pod:3329
21555 #: ../fish/guestfish-actions.pod:3331
21563 #: ../fish/guestfish-actions.pod:3335
21568 #: ../fish/guestfish-actions.pod:3337
21576 #: ../fish/guestfish-actions.pod:3343
21581 #: ../fish/guestfish-actions.pod:3345
21589 #: ../fish/guestfish-actions.pod:3349
21590 msgid "rmmountpoint"
21594 #: ../fish/guestfish-actions.pod:3351
21597 " rmmountpoint exemptpath\n"
21602 #: ../fish/guestfish-actions.pod:3353
21604 "This calls removes a mountpoint that was previously created with L</"
21605 "mkmountpoint>. See L</mkmountpoint> for full details."
21609 #: ../fish/guestfish-actions.pod:3357
21610 msgid "scrub-device"
21614 #: ../fish/guestfish-actions.pod:3359
21617 " scrub-device device\n"
21622 #: ../fish/guestfish-actions.pod:3370
21627 #: ../fish/guestfish-actions.pod:3372
21630 " scrub-file file\n"
21635 #: ../fish/guestfish-actions.pod:3382
21636 msgid "scrub-freespace"
21640 #: ../fish/guestfish-actions.pod:3384
21643 " scrub-freespace dir\n"
21648 #: ../fish/guestfish-actions.pod:3386
21650 "This command creates the directory C<dir> and then fills it with files until "
21651 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
21652 "deletes them. The intention is to scrub any free space on the partition "
21653 "containing C<dir>."
21657 #: ../fish/guestfish-actions.pod:3395
21662 #: ../fish/guestfish-actions.pod:3397
21667 #: ../fish/guestfish-actions.pod:3399
21670 " set-append append\n"
21675 #: ../fish/guestfish-actions.pod:3410
21676 msgid "set-autosync"
21680 #: ../fish/guestfish-actions.pod:3412
21685 #: ../fish/guestfish-actions.pod:3414
21688 " set-autosync true|false\n"
21693 #: ../fish/guestfish-actions.pod:3416
21695 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
21696 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
21697 "closed (also if the program exits without closing handles)."
21701 #: ../fish/guestfish-actions.pod:3424
21706 #: ../fish/guestfish-actions.pod:3426
21711 #: ../fish/guestfish-actions.pod:3428
21714 " set-direct true|false\n"
21719 #: ../fish/guestfish-actions.pod:3434
21721 "One consequence of this is that log messages aren't caught by the library "
21722 "and handled by L</set-log-message-callback>, but go straight to stdout."
21726 #: ../fish/guestfish-actions.pod:3443
21727 msgid "set-e2label"
21731 #: ../fish/guestfish-actions.pod:3445
21734 " set-e2label device label\n"
21739 #: ../fish/guestfish-actions.pod:3451
21741 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
21742 "label on a filesystem."
21746 #: ../fish/guestfish-actions.pod:3454
21751 #: ../fish/guestfish-actions.pod:3456
21754 " set-e2uuid device uuid\n"
21759 #: ../fish/guestfish-actions.pod:3463
21761 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
21762 "UUID of a filesystem."
21766 #: ../fish/guestfish-actions.pod:3466
21767 msgid "set-memsize"
21771 #: ../fish/guestfish-actions.pod:3468
21776 #: ../fish/guestfish-actions.pod:3470
21779 " set-memsize memsize\n"
21784 #: ../fish/guestfish-actions.pod:3472
21786 "This sets the memory size in megabytes allocated to the qemu subprocess. "
21787 "This only has any effect if called before L</launch>."
21791 #: ../fish/guestfish-actions.pod:3483
21792 msgid "set-network"
21796 #: ../fish/guestfish-actions.pod:3485
21801 #: ../fish/guestfish-actions.pod:3487
21804 " set-network true|false\n"
21809 #: ../fish/guestfish-actions.pod:3495
21811 "You must call this before calling L</launch>, otherwise it has no effect."
21815 #: ../fish/guestfish-actions.pod:3498
21820 #: ../fish/guestfish-actions.pod:3500
21825 #: ../fish/guestfish-actions.pod:3502
21828 " set-path searchpath\n"
21833 #: ../fish/guestfish-actions.pod:3511
21838 #: ../fish/guestfish-actions.pod:3513
21843 #: ../fish/guestfish-actions.pod:3515
21851 #: ../fish/guestfish-actions.pod:3535
21852 msgid "set-recovery-proc"
21856 #: ../fish/guestfish-actions.pod:3537
21857 msgid "recovery-proc"
21861 #: ../fish/guestfish-actions.pod:3539
21864 " set-recovery-proc true|false\n"
21869 #: ../fish/guestfish-actions.pod:3541
21871 "If this is called with the parameter C<false> then L</launch> does not "
21872 "create a recovery process. The purpose of the recovery process is to stop "
21873 "runaway qemu processes in the case where the main program aborts abruptly."
21877 #: ../fish/guestfish-actions.pod:3546
21879 "This only has any effect if called before L</launch>, and the default is "
21884 #: ../fish/guestfish-actions.pod:3555
21885 msgid "set-selinux"
21889 #: ../fish/guestfish-actions.pod:3557
21894 #: ../fish/guestfish-actions.pod:3559
21897 " set-selinux true|false\n"
21902 #: ../fish/guestfish-actions.pod:3570
21907 #: ../fish/guestfish-actions.pod:3572
21912 #: ../fish/guestfish-actions.pod:3574
21915 " set-trace true|false\n"
21920 #: ../fish/guestfish-actions.pod:3590
21921 msgid "set-verbose"
21925 #: ../fish/guestfish-actions.pod:3592
21930 #: ../fish/guestfish-actions.pod:3594
21933 " set-verbose true|false\n"
21938 #: ../fish/guestfish-actions.pod:3601
21943 #: ../fish/guestfish-actions.pod:3603
21946 " setcon context\n"
21951 #: ../fish/guestfish-actions.pod:3610
21956 #: ../fish/guestfish-actions.pod:3612
21959 " setxattr xattr val vallen path\n"
21964 #: ../fish/guestfish-actions.pod:3618
21965 msgid "See also: L</lsetxattr>, L<attr(5)>."
21969 #: ../fish/guestfish-actions.pod:3620
21974 #: ../fish/guestfish-actions.pod:3622
21977 " sfdisk device cyls heads sectors 'lines ...'\n"
21982 #: ../fish/guestfish-actions.pod:3644
21983 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
21987 #: ../fish/guestfish-actions.pod:3650
21992 #: ../fish/guestfish-actions.pod:3652
21995 " sfdiskM device 'lines ...'\n"
22000 #: ../fish/guestfish-actions.pod:3654
22002 "This is a simplified interface to the L</sfdisk> command, where partition "
22003 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
22004 "you don't need to specify the cyls, heads and sectors parameters which were "
22005 "rarely if ever used anyway."
22009 #: ../fish/guestfish-actions.pod:3660
22010 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
22014 #: ../fish/guestfish-actions.pod:3666
22019 #: ../fish/guestfish-actions.pod:3668
22022 " sfdisk-N device partnum cyls heads sectors line\n"
22027 #: ../fish/guestfish-actions.pod:3673
22029 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
22030 "cyls/heads/sectors parameters."
22034 #: ../fish/guestfish-actions.pod:3676
22035 msgid "See also: L</part-add>"
22039 #: ../fish/guestfish-actions.pod:3681
22040 msgid "sfdisk-disk-geometry"
22044 #: ../fish/guestfish-actions.pod:3683
22047 " sfdisk-disk-geometry device\n"
22052 #: ../fish/guestfish-actions.pod:3685
22054 "This displays the disk geometry of C<device> read from the partition table. "
22055 "Especially in the case where the underlying block device has been resized, "
22056 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
22057 "kernel-geometry>)."
22061 #: ../fish/guestfish-actions.pod:3693
22062 msgid "sfdisk-kernel-geometry"
22066 #: ../fish/guestfish-actions.pod:3695
22069 " sfdisk-kernel-geometry device\n"
22074 #: ../fish/guestfish-actions.pod:3702
22079 #: ../fish/guestfish-actions.pod:3704
22082 " sfdisk-l device\n"
22087 #: ../fish/guestfish-actions.pod:3710
22088 msgid "See also: L</part-list>"
22092 #: ../fish/guestfish-actions.pod:3712
22097 #: ../fish/guestfish-actions.pod:3714
22105 #: ../fish/guestfish-actions.pod:3719
22106 msgid "This is like L</command>, but passes the command to:"
22110 #: ../fish/guestfish-actions.pod:3727
22111 msgid "All the provisos about L</command> apply to this call."
22115 #: ../fish/guestfish-actions.pod:3729
22120 #: ../fish/guestfish-actions.pod:3731
22123 " sh-lines command\n"
22128 #: ../fish/guestfish-actions.pod:3733
22129 msgid "This is the same as L</sh>, but splits the result into a list of lines."
22133 #: ../fish/guestfish-actions.pod:3736
22134 msgid "See also: L</command-lines>"
22138 #: ../fish/guestfish-actions.pod:3738
22143 #: ../fish/guestfish-actions.pod:3740
22151 #: ../fish/guestfish-actions.pod:3744
22156 #: ../fish/guestfish-actions.pod:3746
22164 #: ../fish/guestfish-actions.pod:3752
22169 #: ../fish/guestfish-actions.pod:3754
22177 #: ../fish/guestfish-actions.pod:3762
22182 #: ../fish/guestfish-actions.pod:3764
22190 #: ../fish/guestfish-actions.pod:3772
22195 #: ../fish/guestfish-actions.pod:3774
22198 " strings-e encoding path\n"
22203 #: ../fish/guestfish-actions.pod:3776
22205 "This is like the L</strings> command, but allows you to specify the encoding "
22206 "of strings that are looked for in the source file C<path>."
22210 #: ../fish/guestfish-actions.pod:3786
22212 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
22213 "ISO-8859-X (this is what L</strings> uses)."
22217 #: ../fish/guestfish-actions.pod:3818
22218 msgid "swapoff-device"
22222 #: ../fish/guestfish-actions.pod:3820
22225 " swapoff-device device\n"
22230 #: ../fish/guestfish-actions.pod:3822
22232 "This command disables the libguestfs appliance swap device or partition "
22233 "named C<device>. See L</swapon-device>."
22237 #: ../fish/guestfish-actions.pod:3826
22238 msgid "swapoff-file"
22242 #: ../fish/guestfish-actions.pod:3828
22245 " swapoff-file file\n"
22250 #: ../fish/guestfish-actions.pod:3832
22251 msgid "swapoff-label"
22255 #: ../fish/guestfish-actions.pod:3834
22258 " swapoff-label label\n"
22263 #: ../fish/guestfish-actions.pod:3839
22264 msgid "swapoff-uuid"
22268 #: ../fish/guestfish-actions.pod:3841
22271 " swapoff-uuid uuid\n"
22276 #: ../fish/guestfish-actions.pod:3846
22277 msgid "swapon-device"
22281 #: ../fish/guestfish-actions.pod:3848
22284 " swapon-device device\n"
22289 #: ../fish/guestfish-actions.pod:3850
22291 "This command enables the libguestfs appliance to use the swap device or "
22292 "partition named C<device>. The increased memory is made available for all "
22293 "commands, for example those run using L</command> or L</sh>."
22297 #: ../fish/guestfish-actions.pod:3862
22298 msgid "swapon-file"
22302 #: ../fish/guestfish-actions.pod:3864
22305 " swapon-file file\n"
22310 #: ../fish/guestfish-actions.pod:3866
22312 "This command enables swap to a file. See L</swapon-device> for other notes."
22316 #: ../fish/guestfish-actions.pod:3869
22317 msgid "swapon-label"
22321 #: ../fish/guestfish-actions.pod:3871
22324 " swapon-label label\n"
22329 #: ../fish/guestfish-actions.pod:3873
22331 "This command enables swap to a labeled swap partition. See L</swapon-"
22332 "device> for other notes."
22336 #: ../fish/guestfish-actions.pod:3876
22337 msgid "swapon-uuid"
22341 #: ../fish/guestfish-actions.pod:3878
22344 " swapon-uuid uuid\n"
22349 #: ../fish/guestfish-actions.pod:3880
22351 "This command enables swap to a swap partition with the given UUID. See L</"
22352 "swapon-device> for other notes."
22356 #: ../fish/guestfish-actions.pod:3883
22361 #: ../fish/guestfish-actions.pod:3885
22369 #: ../fish/guestfish-actions.pod:3893
22374 #: ../fish/guestfish-actions.pod:3895
22382 #: ../fish/guestfish-actions.pod:3903
22387 #: ../fish/guestfish-actions.pod:3905
22390 " tail-n nrlines path\n"
22395 #: ../fish/guestfish-actions.pod:3918
22400 #: ../fish/guestfish-actions.pod:3920
22403 " tar-in (tarfile|-) directory\n"
22408 #: ../fish/guestfish-actions.pod:3925
22409 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
22413 #: ../fish/guestfish-actions.pod:3930
22418 #: ../fish/guestfish-actions.pod:3932
22421 " tar-out directory (tarfile|-)\n"
22426 #: ../fish/guestfish-actions.pod:3937
22427 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
22431 #: ../fish/guestfish-actions.pod:3942
22436 #: ../fish/guestfish-actions.pod:3944
22439 " tgz-in (tarball|-) directory\n"
22444 #: ../fish/guestfish-actions.pod:3949
22445 msgid "To upload an uncompressed tarball, use L</tar-in>."
22449 #: ../fish/guestfish-actions.pod:3953
22454 #: ../fish/guestfish-actions.pod:3955
22457 " tgz-out directory (tarball|-)\n"
22462 #: ../fish/guestfish-actions.pod:3960
22463 msgid "To download an uncompressed tarball, use L</tar-out>."
22467 #: ../fish/guestfish-actions.pod:3964
22472 #: ../fish/guestfish-actions.pod:3966
22480 #: ../fish/guestfish-actions.pod:3975
22485 #: ../fish/guestfish-actions.pod:3977
22493 #: ../fish/guestfish-actions.pod:3982
22494 msgid "truncate-size"
22498 #: ../fish/guestfish-actions.pod:3984
22501 " truncate-size path size\n"
22506 #: ../fish/guestfish-actions.pod:3989
22508 "If the current file size is less than C<size> then the file is extended to "
22509 "the required size with zero bytes. This creates a sparse file (ie. disk "
22510 "blocks are not allocated for the file until you write to it). To create a "
22511 "non-sparse file of zeroes, use L</fallocate64> instead."
22515 #: ../fish/guestfish-actions.pod:3995
22520 #: ../fish/guestfish-actions.pod:3997
22523 " tune2fs-l device\n"
22528 #: ../fish/guestfish-actions.pod:4007
22533 #: ../fish/guestfish-actions.pod:4009
22536 " txz-in (tarball|-) directory\n"
22541 #: ../fish/guestfish-actions.pod:4016
22546 #: ../fish/guestfish-actions.pod:4018
22549 " txz-out directory (tarball|-)\n"
22554 #: ../fish/guestfish-actions.pod:4025
22559 #: ../fish/guestfish-actions.pod:4027
22567 #: ../fish/guestfish-actions.pod:4041
22568 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
22572 #: ../fish/guestfish-actions.pod:4046
22577 #: ../fish/guestfish-actions.pod:4048
22582 #: ../fish/guestfish-actions.pod:4050
22585 " umount pathordevice\n"
22590 #: ../fish/guestfish-actions.pod:4056
22595 #: ../fish/guestfish-actions.pod:4058
22596 msgid "unmount-all"
22600 #: ../fish/guestfish-actions.pod:4060
22608 #: ../fish/guestfish-actions.pod:4066
22613 #: ../fish/guestfish-actions.pod:4068
22616 " upload (filename|-) remotefilename\n"
22621 #: ../fish/guestfish-actions.pod:4075
22622 msgid "See also L</download>."
22626 #: ../fish/guestfish-actions.pod:4079
22627 msgid "upload-offset"
22631 #: ../fish/guestfish-actions.pod:4081
22634 " upload-offset (filename|-) remotefilename offset\n"
22639 #: ../fish/guestfish-actions.pod:4093
22641 "Note that there is no limit on the amount of data that can be uploaded with "
22642 "this call, unlike with L</pwrite>, and this call always writes the full "
22643 "amount unless an error occurs."
22647 #: ../fish/guestfish-actions.pod:4098
22648 msgid "See also L</upload>, L</pwrite>."
22652 #: ../fish/guestfish-actions.pod:4102
22657 #: ../fish/guestfish-actions.pod:4104
22660 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
22665 #: ../fish/guestfish-actions.pod:4123
22670 #: ../fish/guestfish-actions.pod:4125
22678 #: ../fish/guestfish-actions.pod:4152
22680 "I<Note:> Don't use this call to test for availability of features. In "
22681 "enterprise distributions we backport features from later versions into "
22682 "earlier versions, making this an unreliable way to test for features. Use "
22683 "L</available> instead."
22687 #: ../fish/guestfish-actions.pod:4158
22692 #: ../fish/guestfish-actions.pod:4160
22695 " vfs-label device\n"
22700 #: ../fish/guestfish-actions.pod:4167
22701 msgid "To find a filesystem from the label, use L</findfs-label>."
22705 #: ../fish/guestfish-actions.pod:4169
22710 #: ../fish/guestfish-actions.pod:4171
22713 " vfs-type device\n"
22718 #: ../fish/guestfish-actions.pod:4181
22723 #: ../fish/guestfish-actions.pod:4183
22726 " vfs-uuid device\n"
22731 #: ../fish/guestfish-actions.pod:4190
22732 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
22736 #: ../fish/guestfish-actions.pod:4192
22737 msgid "vg-activate"
22741 #: ../fish/guestfish-actions.pod:4194
22744 " vg-activate true|false 'volgroups ...'\n"
22749 #: ../fish/guestfish-actions.pod:4207
22750 msgid "vg-activate-all"
22754 #: ../fish/guestfish-actions.pod:4209
22757 " vg-activate-all true|false\n"
22762 #: ../fish/guestfish-actions.pod:4219
22767 #: ../fish/guestfish-actions.pod:4221
22770 " vgcreate volgroup 'physvols ...'\n"
22775 #: ../fish/guestfish-actions.pod:4226
22780 #: ../fish/guestfish-actions.pod:4228
22783 " vglvuuids vgname\n"
22788 #: ../fish/guestfish-actions.pod:4233
22790 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
22791 "logical volumes and volume groups."
22795 #: ../fish/guestfish-actions.pod:4236
22796 msgid "See also L</vgpvuuids>."
22800 #: ../fish/guestfish-actions.pod:4238
22805 #: ../fish/guestfish-actions.pod:4240
22808 " vgpvuuids vgname\n"
22813 #: ../fish/guestfish-actions.pod:4245
22815 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
22816 "physical volumes and volume groups."
22820 #: ../fish/guestfish-actions.pod:4248
22821 msgid "See also L</vglvuuids>."
22825 #: ../fish/guestfish-actions.pod:4250
22830 #: ../fish/guestfish-actions.pod:4252
22833 " vgremove vgname\n"
22838 #: ../fish/guestfish-actions.pod:4259
22843 #: ../fish/guestfish-actions.pod:4261
22846 " vgrename volgroup newvolgroup\n"
22851 #: ../fish/guestfish-actions.pod:4265
22856 #: ../fish/guestfish-actions.pod:4267
22864 #: ../fish/guestfish-actions.pod:4275
22865 msgid "See also L</vgs-full>."
22869 #: ../fish/guestfish-actions.pod:4277
22874 #: ../fish/guestfish-actions.pod:4279
22882 #: ../fish/guestfish-actions.pod:4284
22887 #: ../fish/guestfish-actions.pod:4286
22895 #: ../fish/guestfish-actions.pod:4291
22900 #: ../fish/guestfish-actions.pod:4293
22908 #: ../fish/guestfish-actions.pod:4297
22913 #: ../fish/guestfish-actions.pod:4299
22921 #: ../fish/guestfish-actions.pod:4304
22926 #: ../fish/guestfish-actions.pod:4306
22934 #: ../fish/guestfish-actions.pod:4311
22939 #: ../fish/guestfish-actions.pod:4313
22947 #: ../fish/guestfish-actions.pod:4318
22952 #: ../fish/guestfish-actions.pod:4320
22955 " write path content\n"
22960 #: ../fish/guestfish-actions.pod:4328
22965 #: ../fish/guestfish-actions.pod:4330
22968 " write-file path content size\n"
22973 #: ../fish/guestfish-actions.pod:4353
22978 #: ../fish/guestfish-actions.pod:4355
22981 " zegrep regex path\n"
22986 #: ../fish/guestfish-actions.pod:4363
22991 #: ../fish/guestfish-actions.pod:4365
22994 " zegrepi regex path\n"
22999 #: ../fish/guestfish-actions.pod:4373
23004 #: ../fish/guestfish-actions.pod:4375
23012 #: ../fish/guestfish-actions.pod:4383
23013 msgid "See also: L</zero-device>, L</scrub-device>."
23017 #: ../fish/guestfish-actions.pod:4385
23018 msgid "zero-device"
23022 #: ../fish/guestfish-actions.pod:4387
23025 " zero-device device\n"
23030 #: ../fish/guestfish-actions.pod:4389
23032 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
23033 "which just zeroes the first few blocks of a device."
23037 #: ../fish/guestfish-actions.pod:4396
23042 #: ../fish/guestfish-actions.pod:4398
23045 " zerofree device\n"
23050 #: ../fish/guestfish-actions.pod:4411
23055 #: ../fish/guestfish-actions.pod:4413
23058 " zfgrep pattern path\n"
23063 #: ../fish/guestfish-actions.pod:4421
23068 #: ../fish/guestfish-actions.pod:4423
23071 " zfgrepi pattern path\n"
23076 #: ../fish/guestfish-actions.pod:4431
23081 #: ../fish/guestfish-actions.pod:4433
23084 " zfile meth path\n"
23089 #: ../fish/guestfish-actions.pod:4440
23091 "Since 1.0.63, use L</file> instead which can now process compressed files."
23095 #: ../fish/guestfish-actions.pod:4450
23100 #: ../fish/guestfish-actions.pod:4452
23103 " zgrep regex path\n"
23108 #: ../fish/guestfish-actions.pod:4460
23113 #: ../fish/guestfish-actions.pod:4462
23116 " zgrepi regex path\n"
23121 #: ../fish/guestfish-commands.pod:1
23126 #: ../fish/guestfish-commands.pod:3
23131 #: ../fish/guestfish-commands.pod:5
23134 " alloc filename size\n"
23139 #: ../fish/guestfish-commands.pod:7
23141 "This creates an empty (zeroed) file of the given size, and then adds so it "
23142 "can be further examined."
23146 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
23147 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
23151 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
23152 msgid "Size can be specified using standard suffixes, eg. C<1M>."
23156 #: ../fish/guestfish-commands.pod:14
23158 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
23159 "image, see L</PREPARED DISK IMAGES>."
23163 #: ../fish/guestfish-commands.pod:17
23168 #: ../fish/guestfish-commands.pod:19
23171 " copy-in local [local ...] /remotedir\n"
23176 #: ../fish/guestfish-commands.pod:21
23178 "C<copy-in> copies local files or directories recursively into the disk "
23179 "image, placing them in the directory called C</remotedir> (which must "
23180 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
23181 "other commands as necessary."
23185 #: ../fish/guestfish-commands.pod:26
23187 "Multiple local files and directories can be specified, but the last "
23188 "parameter must always be a remote directory. Wildcards cannot be used."
23192 #: ../fish/guestfish-commands.pod:30
23197 #: ../fish/guestfish-commands.pod:32
23200 " copy-out remote [remote ...] localdir\n"
23205 #: ../fish/guestfish-commands.pod:34
23207 "C<copy-out> copies remote files or directories recursively out of the disk "
23208 "image, placing them on the host disk in a local directory called C<localdir> "
23209 "(which must exist). This guestfish meta-command turns into a sequence of L</"
23210 "download>, L</tar-out> and other commands as necessary."
23214 #: ../fish/guestfish-commands.pod:40
23216 "Multiple remote files and directories can be specified, but the last "
23217 "parameter must always be a local directory. To download to the current "
23218 "directory, use C<.> as in:"
23222 #: ../fish/guestfish-commands.pod:44
23225 " copy-out /home .\n"
23230 #: ../fish/guestfish-commands.pod:46
23232 "Wildcards cannot be used in the ordinary command, but you can use them with "
23233 "the help of L</glob> like this:"
23237 #: ../fish/guestfish-commands.pod:49
23240 " glob copy-out /home/* .\n"
23245 #: ../fish/guestfish-commands.pod:51
23250 #: ../fish/guestfish-commands.pod:53
23253 " echo [params ...]\n"
23258 #: ../fish/guestfish-commands.pod:55
23259 msgid "This echos the parameters to the terminal."
23263 #: ../fish/guestfish-commands.pod:57
23268 #: ../fish/guestfish-commands.pod:59
23273 #: ../fish/guestfish-commands.pod:61
23278 #: ../fish/guestfish-commands.pod:63
23286 #: ../fish/guestfish-commands.pod:65
23288 "This is used to edit a file. It downloads the file, edits it locally using "
23289 "your editor, then uploads the result."
23293 #: ../fish/guestfish-commands.pod:68
23295 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
23296 "or C<emacs> you will get those corresponding editors."
23300 #: ../fish/guestfish-commands.pod:72
23305 #: ../fish/guestfish-commands.pod:74
23308 " glob command args...\n"
23313 #: ../fish/guestfish-commands.pod:76
23315 "Expand wildcards in any paths in the args list, and run C<command> "
23316 "repeatedly on each matching path."
23320 #: ../fish/guestfish-commands.pod:79
23321 msgid "See L</WILDCARDS AND GLOBBING>."
23325 #: ../fish/guestfish-commands.pod:81
23330 #: ../fish/guestfish-commands.pod:83
23333 " hexedit <filename|device>\n"
23334 " hexedit <filename|device> <max>\n"
23335 " hexedit <filename|device> <start> <max>\n"
23340 #: ../fish/guestfish-commands.pod:87
23342 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
23347 #: ../fish/guestfish-commands.pod:90
23349 "This command works by downloading potentially the whole file or device, "
23350 "editing it locally, then uploading it. If the file or device is large, you "
23351 "have to specify which part you wish to edit by using C<max> and/or C<start> "
23352 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
23353 "usual modifiers allowed such as C<1M> (1 megabyte)."
23357 #: ../fish/guestfish-commands.pod:97
23358 msgid "For example to edit the first few sectors of a disk you might do:"
23362 #: ../fish/guestfish-commands.pod:100
23365 " hexedit /dev/sda 1M\n"
23370 #: ../fish/guestfish-commands.pod:102
23372 "which would allow you to edit anywhere within the first megabyte of the disk."
23376 #: ../fish/guestfish-commands.pod:105
23377 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
23381 #: ../fish/guestfish-commands.pod:107
23384 " hexedit /dev/sda1 0x400 0x400\n"
23389 #: ../fish/guestfish-commands.pod:109
23390 msgid "(assuming the superblock is in the standard location)."
23394 #: ../fish/guestfish-commands.pod:111
23396 "This command requires the external L<hexedit(1)> program. You can specify "
23397 "another program to use by setting the C<HEXEDITOR> environment variable."
23401 #: ../fish/guestfish-commands.pod:115
23402 msgid "See also L</hexdump>."
23406 #: ../fish/guestfish-commands.pod:117
23411 #: ../fish/guestfish-commands.pod:119
23419 #: ../fish/guestfish-commands.pod:121
23421 "Change the local directory, ie. the current directory of guestfish itself."
23425 #: ../fish/guestfish-commands.pod:124
23426 msgid "Note that C<!cd> won't do what you might expect."
23430 #: ../fish/guestfish-commands.pod:126
23435 #: ../fish/guestfish-commands.pod:128
23440 #: ../fish/guestfish-commands.pod:130
23448 #: ../fish/guestfish-commands.pod:132
23449 msgid "Opens the manual page for guestfish."
23453 #: ../fish/guestfish-commands.pod:134
23458 #: ../fish/guestfish-commands.pod:136
23463 #: ../fish/guestfish-commands.pod:138
23471 #: ../fish/guestfish-commands.pod:140
23479 #: ../fish/guestfish-commands.pod:142
23480 msgid "This is used to view a file."
23484 #: ../fish/guestfish-commands.pod:144
23486 "The default viewer is C<$PAGER>. However if you use the alternate command "
23487 "C<less> you will get the C<less> command specifically."
23491 #: ../fish/guestfish-commands.pod:147
23496 #: ../fish/guestfish-commands.pod:149
23504 #: ../fish/guestfish-commands.pod:151
23506 "Close and reopen the libguestfs handle. It is not necessary to use this "
23507 "normally, because the handle is closed properly when guestfish exits. "
23508 "However this is occasionally useful for testing."
23512 #: ../fish/guestfish-commands.pod:155
23517 #: ../fish/guestfish-commands.pod:157
23520 " sparse filename size\n"
23525 #: ../fish/guestfish-commands.pod:159
23527 "This creates an empty sparse file of the given size, and then adds so it can "
23528 "be further examined."
23532 #: ../fish/guestfish-commands.pod:162
23534 "In all respects it works the same as the L</alloc> command, except that the "
23535 "image file is allocated sparsely, which means that disk blocks are not "
23536 "assigned to the file until they are needed. Sparse disk files only use "
23537 "space when written to, but they are slower and there is a danger you could "
23538 "run out of real disk space during a write operation."
23542 #: ../fish/guestfish-commands.pod:172
23547 #: ../fish/guestfish-commands.pod:174
23555 #: ../fish/guestfish-commands.pod:176
23557 "This command returns a list of the optional groups known to the daemon, and "
23558 "indicates which ones are supported by this build of the libguestfs appliance."
23562 #: ../fish/guestfish-commands.pod:180
23563 msgid "See also L<guestfs(3)/AVAILABILITY>."
23567 #: ../fish/guestfish-commands.pod:182
23572 #: ../fish/guestfish-commands.pod:184
23575 " time command args...\n"
23580 #: ../fish/guestfish-commands.pod:186
23582 "Run the command as usual, but print the elapsed time afterwards. This can "
23583 "be useful for benchmarking operations."
23587 #: ../test-tool/libguestfs-test-tool.pod:5
23588 msgid "libguestfs-test-tool - End user tests for libguestfs"
23592 #: ../test-tool/libguestfs-test-tool.pod:9
23595 " libguestfs-test-tool [--options]\n"
23600 #: ../test-tool/libguestfs-test-tool.pod:13
23602 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
23603 "and developers, to allow them to check basic libguestfs functionality is "
23604 "working. This is needed because libguestfs occasionally breaks for reasons "
23605 "beyond our control: usually because of changes in the underlying qemu or "
23606 "kernel packages, or the host environment."
23610 #: ../test-tool/libguestfs-test-tool.pod:20
23611 msgid "If you suspect a problem in libguestfs, then just run:"
23615 #: ../test-tool/libguestfs-test-tool.pod:22
23618 " libguestfs-test-tool\n"
23623 #: ../test-tool/libguestfs-test-tool.pod:24
23624 msgid "It will print lots of diagnostic messages."
23628 #: ../test-tool/libguestfs-test-tool.pod:26
23629 msgid "If it runs to completion successfully, you will see this near the end:"
23633 #: ../test-tool/libguestfs-test-tool.pod:28
23636 " ===== TEST FINISHED OK =====\n"
23641 #: ../test-tool/libguestfs-test-tool.pod:30
23642 msgid "and the test tool will exit with code 0."
23646 #: ../test-tool/libguestfs-test-tool.pod:32
23648 "If it fails (and/or exits with non-zero error code), please paste the "
23649 "B<complete, unedited> output of the test tool into a bug report. More "
23650 "information about reporting bugs can be found on the L<http://libguestfs.org/"
23655 #: ../test-tool/libguestfs-test-tool.pod:41
23660 #: ../test-tool/libguestfs-test-tool.pod:43
23661 msgid "Display short usage information and exit."
23665 #: ../test-tool/libguestfs-test-tool.pod:45
23666 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
23670 #: ../test-tool/libguestfs-test-tool.pod:47
23672 "Pass an alternate name for the helper program. libguestfs-test-tool will "
23673 "normally look in the C<$libexec> directory that was configured when the tool "
23678 #: ../test-tool/libguestfs-test-tool.pod:51
23679 msgid "I<--qemu qemu_binary>"
23683 #: ../test-tool/libguestfs-test-tool.pod:53
23685 "If you have downloaded another qemu binary, point this option at the full "
23686 "path of the binary to try it."
23690 #: ../test-tool/libguestfs-test-tool.pod:56
23691 msgid "I<--qemudir qemu_source_dir>"
23695 #: ../test-tool/libguestfs-test-tool.pod:58
23697 "If you have compiled qemu from source, point this option at the source "
23698 "directory to try it."
23702 #: ../test-tool/libguestfs-test-tool.pod:61
23703 msgid "I<--timeout N>"
23707 #: ../test-tool/libguestfs-test-tool.pod:63
23709 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
23710 "does not usually need to be adjusted unless your machine is very slow."
23714 #: ../test-tool/libguestfs-test-tool.pod:69
23715 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
23719 #: ../test-tool/libguestfs-test-tool.pod:71
23721 "If you have compiled another version of qemu from source and would like to "
23722 "try that, then you can use the I<--qemudir> option to point to the qemu "
23723 "source directory."
23727 #: ../test-tool/libguestfs-test-tool.pod:75
23729 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
23730 "option to point to the binary."
23734 #: ../test-tool/libguestfs-test-tool.pod:78
23736 "When using an alternate qemu with libguestfs, usually you would need to "
23737 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
23738 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
23739 "use either of the I<--qemudir> or I<--qemu> options."
23743 #: ../test-tool/libguestfs-test-tool.pod:85
23745 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
23746 "I<1> if there was an error."
23750 #: ../test-tool/libguestfs-test-tool.pod:92
23751 msgid "/usr/libexec/libguestfs-test-tool-helper"
23755 #: ../test-tool/libguestfs-test-tool.pod:94
23757 "This helper program is run inside the appliance and provides additional "
23762 #: ../test-tool/libguestfs-test-tool.pod:97
23763 msgid "/usr/bin/mkisofs"
23767 #: ../test-tool/libguestfs-test-tool.pod:99
23769 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
23770 "which is used as part of the tests."
23774 #: ../test-tool/libguestfs-test-tool.pod:106
23776 "For the full list of environment variables which may affect libguestfs, "
23777 "please see the L<guestfs(3)> manual page."
23781 #: ../test-tool/libguestfs-test-tool.pod:111
23782 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
23786 #: ../test-tool/libguestfs-test-tool.pod:121
23787 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
23791 #: ../fuse/guestmount.pod:5
23793 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
23797 #: ../fuse/guestmount.pod:9
23800 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
23805 #: ../fuse/guestmount.pod:11
23808 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
23813 #: ../fuse/guestmount.pod:13
23816 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
23821 #: ../fuse/guestmount.pod:17
23823 "You must I<not> use C<guestmount> in read-write mode on live virtual "
23824 "machines. If you do this, you risk disk corruption in the VM."
23828 #: ../fuse/guestmount.pod:22
23830 "The guestmount program can be used to mount virtual machine filesystems and "
23831 "other disk images on the host. It uses libguestfs for access to the guest "
23832 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
23833 "a mountable device."
23837 #: ../fuse/guestmount.pod:27
23839 "Along with other options, you have to give at least one device (I<-a> "
23840 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
23841 "option) or use the I<-i> inspection option. How this works is better "
23842 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
23847 #: ../fuse/guestmount.pod:33
23849 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
23850 "by you, and the filesystem will not be visible to any other users unless you "
23851 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
23852 "the filesystem, use the C<fusermount -u> command."
23856 #: ../fuse/guestmount.pod:41
23858 "For a typical Windows guest which has its main filesystem on the first "
23863 #: ../fuse/guestmount.pod:44
23866 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
23871 #: ../fuse/guestmount.pod:46
23873 "For a typical Linux guest which has a /boot filesystem on the first "
23874 "partition, and the root filesystem on a logical volume:"
23878 #: ../fuse/guestmount.pod:49
23881 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
23886 #: ../fuse/guestmount.pod:51
23887 msgid "To get libguestfs to detect guest mountpoints for you:"
23891 #: ../fuse/guestmount.pod:53
23894 " guestmount -a guest.img -i --ro /mnt\n"
23899 #: ../fuse/guestmount.pod:55
23900 msgid "For a libvirt guest called \"Guest\" you could do:"
23904 #: ../fuse/guestmount.pod:57
23907 " guestmount -d Guest -i --ro /mnt\n"
23912 #: ../fuse/guestmount.pod:59
23914 "If you don't know what filesystems are contained in a guest or disk image, "
23915 "use L<virt-list-filesystems(1)> first:"
23919 #: ../fuse/guestmount.pod:62
23922 " virt-list-filesystems MyGuest\n"
23927 #: ../fuse/guestmount.pod:64
23929 "If you want to trace the libguestfs calls but without excessive debugging "
23930 "information, we recommend:"
23934 #: ../fuse/guestmount.pod:67
23937 " guestmount [...] --trace /mnt\n"
23942 #: ../fuse/guestmount.pod:69
23943 msgid "If you want to debug the program, we recommend:"
23947 #: ../fuse/guestmount.pod:71
23950 " guestmount [...] --trace --verbose /mnt\n"
23955 #: ../fuse/guestmount.pod:79
23956 msgid "Add a block device or virtual machine image."
23960 #: ../fuse/guestmount.pod:96
23961 msgid "B<--dir-cache-timeout N>"
23965 #: ../fuse/guestmount.pod:98
23967 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
23968 "seconds. The readdir cache [actually, there are several semi-independent "
23969 "caches] is populated after a readdir(2) call with the stat and extended "
23970 "attributes of the files in the directory, in anticipation that they will be "
23971 "requested soon after."
23975 #: ../fuse/guestmount.pod:104
23977 "There is also a different attribute cache implemented by FUSE (see the FUSE "
23978 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
23979 "requests, only cache existing ones."
23983 #: ../fuse/guestmount.pod:115
23985 "If you have untrusted raw-format guest disk images, you should use this "
23986 "option to specify the disk format. This avoids a possible security problem "
23987 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
23988 "guestfs_add_drive_opts>."
23992 #: ../fuse/guestmount.pod:120
23993 msgid "B<--fuse-help>"
23997 #: ../fuse/guestmount.pod:122
23998 msgid "Display help on special FUSE options (see I<-o> below)."
24002 #: ../fuse/guestmount.pod:126
24003 msgid "Display brief help and exit."
24007 #: ../fuse/guestmount.pod:134
24008 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
24012 #: ../fuse/guestmount.pod:136
24014 "Mount the named partition or logical volume on the given mountpoint B<in the "
24015 "guest> (this has nothing to do with mountpoints in the host)."
24019 #: ../fuse/guestmount.pod:139
24021 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
24022 "something on C</>."
24026 #: ../fuse/guestmount.pod:144
24028 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
24029 "unmounted. If you specify this option, then we don't attempt to sync the "
24030 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
24034 #: ../fuse/guestmount.pod:149
24035 msgid "B<-o option> | B<--option option>"
24039 #: ../fuse/guestmount.pod:151
24040 msgid "Pass extra options to FUSE."
24044 #: ../fuse/guestmount.pod:153
24046 "To get a list of all the extra options supported by FUSE, use the command "
24047 "below. Note that only the FUSE I<-o> options can be passed, and only some "
24048 "of them are a good idea."
24052 #: ../fuse/guestmount.pod:157
24055 " guestmount --fuse-help\n"
24060 #: ../fuse/guestmount.pod:159
24061 msgid "Some potentially useful FUSE options:"
24065 #: ../fuse/guestmount.pod:163
24066 msgid "B<-o allow_other>"
24070 #: ../fuse/guestmount.pod:165
24071 msgid "Allow other users to see the filesystem."
24075 #: ../fuse/guestmount.pod:167
24076 msgid "B<-o attr_timeout=N>"
24080 #: ../fuse/guestmount.pod:169
24081 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
24085 #: ../fuse/guestmount.pod:171
24086 msgid "B<-o kernel_cache>"
24090 #: ../fuse/guestmount.pod:173
24092 "Allow the kernel to cache files (reduces the number of reads that have to go "
24093 "through the L<guestfs(3)> API). This is generally a good idea if you can "
24094 "afford the extra memory usage."
24098 #: ../fuse/guestmount.pod:177
24099 msgid "B<-o uid=N> B<-o gid=N>"
24103 #: ../fuse/guestmount.pod:179
24105 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
24106 "the chosen values."
24110 #: ../fuse/guestmount.pod:186
24112 "Add devices and mount everything read-only. Also disallow writes and make "
24113 "the disk appear read-only to FUSE."
24117 #: ../fuse/guestmount.pod:189
24119 "This is highly recommended if you are not going to edit the guest disk. If "
24120 "the guest is running and this option is I<not> supplied, then there is a "
24121 "strong risk of disk corruption in the guest. We try to prevent this from "
24122 "happening, but it is not always possible."
24126 #: ../fuse/guestmount.pod:196
24127 msgid "Enable SELinux support for the guest."
24131 #: ../fuse/guestmount.pod:200
24132 msgid "Enable verbose messages from underlying libguestfs."
24136 #: ../fuse/guestmount.pod:204
24137 msgid "Display the program version and exit."
24141 #: ../fuse/guestmount.pod:206
24142 msgid "B<-x> | B<--trace>"
24146 #: ../fuse/guestmount.pod:208
24147 msgid "Trace libguestfs calls."
24151 #: ../fuse/guestmount.pod:210
24152 msgid "This also stops the daemon from forking into the background."
24156 #: ../fuse/guestmount.pod:216
24158 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
24159 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
24164 #: ../inspector/virt-inspector.pl:35
24166 "virt-inspector - Display operating system version and other information "
24167 "about a virtual machine"
24171 #: ../inspector/virt-inspector.pl:39
24174 " virt-inspector [--connect URI] domname\n"
24179 #: ../inspector/virt-inspector.pl:41
24182 " virt-inspector guest.img [guest.img ...]\n"
24187 #: ../inspector/virt-inspector.pl:45
24189 "B<virt-inspector> examines a virtual machine or disk image and tries to "
24190 "determine the version of the operating system and other information about "
24191 "the virtual machine."
24195 #: ../inspector/virt-inspector.pl:49
24196 msgid "Virt-inspector produces XML output for feeding into other programs."
24200 #: ../inspector/virt-inspector.pl:51
24202 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
24203 "libvirt domain (see: C<virsh list --all>)."
24207 #: ../inspector/virt-inspector.pl:54
24209 "You can also run virt-inspector directly on disk images from a single "
24210 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
24211 "has several block devices, in which case you should list them one after "
24212 "another, with the first corresponding to the guest's C</dev/sda>, the second "
24213 "to the guest's C</dev/sdb> and so on."
24217 #: ../inspector/virt-inspector.pl:60
24219 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
24220 "inspect several virtual machines, you have to run virt-inspector several "
24221 "times (for example, from a shell script for-loop)."
24225 #: ../inspector/virt-inspector.pl:65
24227 "Because virt-inspector needs direct access to guest images, it won't "
24228 "normally work over remote libvirt connections."
24232 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82
24233 #: ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88
24234 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-cat.pl:89
24235 #: ../tools/virt-tar.pl:108 ../tools/virt-rescue.pl:113
24236 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:61
24237 msgid "Display brief help."
24241 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88
24242 #: ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94
24243 #: ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66
24244 #: ../tools/virt-cat.pl:95 ../tools/virt-tar.pl:114
24245 #: ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169
24246 #: ../tools/virt-list-partitions.pl:67
24247 msgid "B<--version>"
24251 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90
24252 #: ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96
24253 #: ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68
24254 #: ../tools/virt-cat.pl:97 ../tools/virt-tar.pl:116
24255 #: ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171
24256 #: ../tools/virt-list-partitions.pl:69
24257 msgid "Display version number and exit."
24261 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112
24262 #: ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102
24263 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-cat.pl:103
24264 #: ../tools/virt-tar.pl:122 ../tools/virt-rescue.pl:135
24265 #: ../tools/virt-list-partitions.pl:75
24266 msgid "B<--connect URI> | B<-c URI>"
24270 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114
24271 #: ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104
24272 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-cat.pl:105
24273 #: ../tools/virt-tar.pl:124 ../tools/virt-rescue.pl:137
24274 #: ../tools/virt-list-partitions.pl:77
24276 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
24277 "to the default libvirt hypervisor."
24281 #: ../inspector/virt-inspector.pl:97
24283 "Libvirt is only used if you specify a C<domname> on the command line. If "
24284 "you specify guest block devices directly, then libvirt is not used at all."
24288 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124
24289 #: ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117
24290 #: ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523
24291 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-cat.pl:115
24292 #: ../tools/virt-tar.pl:134 ../tools/virt-rescue.pl:147
24293 #: ../tools/virt-list-partitions.pl:87
24294 msgid "B<--format> raw"
24298 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126
24299 #: ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119
24300 #: ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88
24301 #: ../tools/virt-cat.pl:117 ../tools/virt-tar.pl:136
24302 #: ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
24304 "Specify the format of disk images given on the command line. If this is "
24305 "omitted then the format is autodetected from the content of the disk image."
24309 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130
24310 #: ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123
24311 #: ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92
24312 #: ../tools/virt-cat.pl:121 ../tools/virt-tar.pl:140
24313 #: ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
24315 "If disk images are requested from libvirt, then this program asks libvirt "
24316 "for this information. In this case, the value of the format parameter is "
24321 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134
24322 #: ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127
24323 #: ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528
24324 #: ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96
24325 #: ../tools/virt-cat.pl:125 ../tools/virt-tar.pl:144
24326 #: ../tools/virt-rescue.pl:157 ../tools/virt-list-partitions.pl:97
24328 "If working with untrusted raw-format guest disk images, you should ensure "
24329 "the format is always specified."
24333 #: ../inspector/virt-inspector.pl:149
24338 #: ../inspector/virt-inspector.pl:151
24340 "The virt-inspector XML is described precisely in a RELAX NG schema which is "
24341 "supplied with libguestfs. This section is just an overview."
24345 #: ../inspector/virt-inspector.pl:154
24347 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
24348 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
24349 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
24350 "which is vanishingly rare in real world VMs."
24354 #: ../inspector/virt-inspector.pl:159
24355 msgid "E<lt>operatingsystemE<gt>"
24359 #: ../inspector/virt-inspector.pl:161
24361 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
24362 "describe the operating system, its architecture, the descriptive \"product "
24363 "name\" string, the type of OS and so on, as in this example:"
24367 #: ../inspector/virt-inspector.pl:165
24370 " <operatingsystems>\n"
24371 " <operatingsystem>\n"
24372 " <root>/dev/sda2</root>\n"
24373 " <name>windows</name>\n"
24374 " <arch>i386</arch>\n"
24375 " <distro>windows</distro>\n"
24376 " <product_name>Windows 7 Enterprise</product_name>\n"
24377 " <major_version>6</major_version>\n"
24378 " <minor_version>1</minor_version>\n"
24379 " <windows_systemroot>/Windows</windows_systemroot>\n"
24384 #: ../inspector/virt-inspector.pl:176
24386 "These fields are derived from the libguestfs inspection API, and you can "
24387 "find more details in L<guestfs(3)/INSPECTION>."
24391 #: ../inspector/virt-inspector.pl:179
24393 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
24394 "of view of libguestfs (block devices may have completely different names "
24395 "inside the VM itself)."
24399 #: ../inspector/virt-inspector.pl:240
24400 msgid "E<lt>mountpointsE<gt>"
24404 #: ../inspector/virt-inspector.pl:242
24406 "Un*x-like guests typically have multiple filesystems which are mounted at "
24407 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
24408 "element which looks like this:"
24412 #: ../inspector/virt-inspector.pl:246
24415 " <operatingsystems>\n"
24416 " <operatingsystem>\n"
24419 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
24420 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
24421 " </mountpoints>\n"
24426 #: ../inspector/virt-inspector.pl:254
24428 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
24429 "and may have completely different names inside the guest. Only mountable "
24430 "filesystems appear in this list, not things like swap devices."
24434 #: ../inspector/virt-inspector.pl:276
24435 msgid "E<lt>filesystemsE<gt>"
24439 #: ../inspector/virt-inspector.pl:278
24441 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
24442 "filesystems belonging to the guest, including swap and empty partitions. "
24443 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
24444 "this OS or shared by this OS and other OSes)."
24448 #: ../inspector/virt-inspector.pl:283
24449 msgid "You might see something like this:"
24453 #: ../inspector/virt-inspector.pl:285
24456 " <operatingsystems>\n"
24457 " <operatingsystem>\n"
24460 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
24461 " <type>ext4</type>\n"
24462 " <label>Fedora-13-x86_64</label>\n"
24463 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
24469 #: ../inspector/virt-inspector.pl:295
24471 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
24472 "the label, and the UUID."
24476 #: ../inspector/virt-inspector.pl:337
24477 msgid "E<lt>applicationsE<gt>"
24481 #: ../inspector/virt-inspector.pl:339
24483 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
24484 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
24485 "machine. At the moment we are only able to list RPMs and Debian packages "
24486 "installed, but in future we will support other Linux distros and Windows."
24490 #: ../inspector/virt-inspector.pl:345
24492 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
24493 "Typical values would be C<rpm> and C<deb>."
24497 #: ../inspector/virt-inspector.pl:348
24499 "E<lt>package_managementE<gt>, if present, describes the package manager. "
24500 "Typical values include C<yum>, C<up2date> and C<apt>"
24504 #: ../inspector/virt-inspector.pl:351
24505 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
24509 #: ../inspector/virt-inspector.pl:354
24512 " <operatingsystems>\n"
24513 " <operatingsystem>\n"
24515 " <applications>\n"
24517 " <name>coreutils</name>\n"
24518 " <version>8.5</version>\n"
24519 " <release>1</release>\n"
24520 " </application>\n"
24525 #: ../inspector/virt-inspector.pl:364
24527 "(The version and release fields may not be available for some package types)."
24531 #: ../inspector/virt-inspector.pl:544
24532 msgid "USING XPATH"
24536 #: ../inspector/virt-inspector.pl:546
24538 "You can use the XPath query language, and/or the xpath tool, in order to "
24539 "select parts of the XML."
24543 #: ../inspector/virt-inspector.pl:551
24546 " $ virt-inspector Guest | xpath //filesystems\n"
24547 " Found 1 nodes:\n"
24550 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
24551 " <type>ext4</type>\n"
24557 #: ../inspector/virt-inspector.pl:559
24560 " $ virt-inspector Guest | \\\n"
24561 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
24562 " Query didn't return a nodeset. Value: ext4\n"
24567 #: ../inspector/virt-inspector.pl:563 ../tools/virt-edit.pl:343
24568 #: ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477
24569 #: ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225
24570 #: ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179
24571 #: ../tools/virt-cat.pl:178 ../tools/virt-tar.pl:274
24572 #: ../tools/virt-rescue.pl:260 ../tools/virt-make-fs.pl:527
24573 #: ../tools/virt-list-partitions.pl:247
24574 msgid "SHELL QUOTING"
24578 #: ../inspector/virt-inspector.pl:565 ../tools/virt-edit.pl:345
24579 #: ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635
24580 #: ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481
24581 #: ../tools/virt-list-filesystems.pl:181 ../tools/virt-cat.pl:180
24582 #: ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:262
24583 #: ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
24585 "Libvirt guest names can contain arbitrary characters, some of which have "
24586 "meaning to the shell such as C<#> and space. You may need to quote or "
24587 "escape these characters on the command line. See the shell manual page L<sh"
24588 "(1)> for details."
24592 #: ../inspector/virt-inspector.pl:572
24594 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
24595 "L<Sys::Virt(3)>, L<http://www.w3.org/TR/xpath/>, L<http://libguestfs.org/>."
24599 #: ../inspector/virt-inspector.pl:586 ../tools/virt-edit.pl:364
24600 #: ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651
24601 #: ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510
24602 #: ../tools/virt-list-filesystems.pl:200 ../tools/virt-cat.pl:197
24603 #: ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:279
24604 #: ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
24605 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
24609 #: ../inspector/virt-inspector.pl:590
24610 msgid "Matthew Booth L<mbooth@redhat.com>"
24614 #: ../inspector/virt-inspector.pl:596 ../tools/virt-win-reg.pl:516
24615 #: ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
24616 msgid "Copyright (C) 2010 Red Hat Inc."
24620 #: ../tools/virt-edit.pl:34
24621 msgid "virt-edit - Edit a file in a virtual machine"
24625 #: ../tools/virt-edit.pl:38
24628 " virt-edit [--options] domname file\n"
24633 #: ../tools/virt-edit.pl:40
24636 " virt-edit [--options] disk.img [disk.img ...] file\n"
24641 #: ../tools/virt-edit.pl:42
24644 " virt-edit [domname|disk.img] file -e 'expr'\n"
24649 #: ../tools/virt-edit.pl:46
24651 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
24652 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
24653 "doing this, but doesn't catch all cases."
24657 #: ../tools/virt-edit.pl:52
24659 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
24660 "the named virtual machine (or disk image)."
24664 #: ../tools/virt-edit.pl:55
24666 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
24667 "you should look at the L<guestfish(1)> tool."
24671 #: ../tools/virt-edit.pl:60
24672 msgid "Edit the named files interactively:"
24676 #: ../tools/virt-edit.pl:62
24679 " virt-edit mydomain /boot/grub/grub.conf\n"
24684 #: ../tools/virt-edit.pl:64
24687 " virt-edit mydomain /etc/passwd\n"
24692 #: ../tools/virt-edit.pl:66
24694 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
24695 "below). To change the init default level to 5:"
24699 #: ../tools/virt-edit.pl:70
24702 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
24707 #: ../tools/virt-edit.pl:96
24708 msgid "B<--backup extension> | B<-b extension>"
24712 #: ../tools/virt-edit.pl:98
24714 "Create a backup of the original file I<in the guest disk image>. The backup "
24715 "has the original filename with C<extension> added."
24719 #: ../tools/virt-edit.pl:101
24721 "Usually the first character of C<extension> would be a dot C<.> so you would "
24726 #: ../tools/virt-edit.pl:104
24729 " virt-edit -b .orig [etc]\n"
24734 #: ../tools/virt-edit.pl:106
24735 msgid "By default, no backup file is made."
24739 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
24740 #: ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107
24741 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-cat.pl:108
24742 #: ../tools/virt-tar.pl:127 ../tools/virt-rescue.pl:140
24743 #: ../tools/virt-list-partitions.pl:80
24745 "If you specify guest block devices directly, then libvirt is not used at all."
24749 #: ../tools/virt-edit.pl:141
24750 msgid "B<--expr EXPR> | B<-e EXPR>"
24754 #: ../tools/virt-edit.pl:143
24756 "Instead of launching the external editor, non-interactively apply the Perl "
24757 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
24762 #: ../tools/virt-edit.pl:147
24764 "Be careful to properly quote the expression to prevent it from being altered "
24769 #: ../tools/virt-edit.pl:268
24770 msgid "NON-INTERACTIVE EDITING"
24774 #: ../tools/virt-edit.pl:270
24776 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
24777 "administrator can interactively edit the file."
24781 #: ../tools/virt-edit.pl:273
24783 "There are two ways also to use C<virt-edit> from scripts in order to make "
24784 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
24785 "like this, it's less error-prone to write scripts directly using the "
24786 "libguestfs API and Augeas for configuration file editing.)"
24790 #: ../tools/virt-edit.pl:279
24792 "The first method is to temporarily set C<$EDITOR> to any script or program "
24793 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
24794 "update C<tmpfile> in place however it likes."
24798 #: ../tools/virt-edit.pl:283
24800 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
24801 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
24802 "instances of C<foo> with C<bar> in a file:"
24806 #: ../tools/virt-edit.pl:287
24809 " virt-edit domname filename -e 's/foo/bar/'\n"
24814 #: ../tools/virt-edit.pl:289
24816 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
24817 "For example to delete root's password you could do:"
24821 #: ../tools/virt-edit.pl:292
24824 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
24829 #: ../tools/virt-edit.pl:294
24831 "What really happens is that the snippet is evaluated as a Perl expression "
24832 "for each line of the file. The line, including the final C<\\n>, is passed "
24833 "in C<$_> and the expression should update C<$_> or leave it unchanged."
24837 #: ../tools/virt-edit.pl:299
24839 "To delete a line, set C<$_> to the empty string. For example, to delete the "
24840 "C<apache> user account from the password file you can do:"
24844 #: ../tools/virt-edit.pl:302
24847 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
24852 #: ../tools/virt-edit.pl:304
24854 "To insert a line, prepend or append it to C<$_>. However appending lines to "
24855 "the end of the file is rather difficult this way since there is no concept "
24856 "of \"last line of the file\" - your expression just doesn't get called "
24857 "again. You might want to use the first method (setting C<$EDITOR>) if you "
24862 #: ../tools/virt-edit.pl:310
24864 "The variable C<$lineno> contains the current line number. As is "
24865 "traditional, the first line in the file is number C<1>."
24869 #: ../tools/virt-edit.pl:313
24871 "The return value from the expression is ignored, but the expression may call "
24872 "C<die> in order to abort the whole program, leaving the original file "
24877 #: ../tools/virt-edit.pl:317
24879 "Remember when matching the end of a line that C<$_> may contain the final C<"
24880 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
24881 "newline then neither of these. Thus to match or substitute some text at the "
24882 "end of a line, use this regular expression:"
24886 #: ../tools/virt-edit.pl:322
24889 " /some text(\\r?\\n)?$/\n"
24894 #: ../tools/virt-edit.pl:324
24896 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
24897 "$_> itself (since that would remove all newlines from the file):"
24901 #: ../tools/virt-edit.pl:328
24904 " my $m = $_; chomp $m; $m =~ /some text$/\n"
24909 #: ../tools/virt-edit.pl:334
24914 #: ../tools/virt-edit.pl:336
24916 "If set, this string is used as the editor. It may contain arguments, eg. C<"
24921 #: ../tools/virt-edit.pl:339
24922 msgid "If not set, C<vi> is used."
24926 #: ../tools/virt-edit.pl:352
24928 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24929 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
24934 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
24935 #: ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243
24936 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198
24937 #: ../tools/virt-cat.pl:195 ../tools/virt-tar.pl:292
24938 #: ../tools/virt-rescue.pl:277 ../tools/virt-make-fs.pl:559
24939 #: ../tools/virt-list-partitions.pl:265
24944 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655
24945 #: ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
24946 msgid "Copyright (C) 2009-2010 Red Hat Inc."
24950 #: ../tools/virt-win-reg.pl:37
24952 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
24956 #: ../tools/virt-win-reg.pl:41
24959 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
24964 #: ../tools/virt-win-reg.pl:43
24967 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
24972 #: ../tools/virt-win-reg.pl:45
24975 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
24980 #: ../tools/virt-win-reg.pl:47
24983 " virt-win-reg --merge domname [input.reg ...]\n"
24988 #: ../tools/virt-win-reg.pl:49
24991 " virt-win-reg [--options] disk.img ... # instead of domname\n"
24996 #: ../tools/virt-win-reg.pl:53
24998 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
24999 "virtual machines. If you do this, you I<will> get irreversible disk "
25000 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
25001 "but doesn't catch all cases."
25005 #: ../tools/virt-win-reg.pl:58
25007 "Modifying the Windows Registry is an inherently risky operation. The format "
25008 "is deliberately obscure and undocumented, and Registry changes can leave the "
25009 "system unbootable. Therefore when using the C<--merge> option, make sure "
25010 "you have a reliable backup first."
25014 #: ../tools/virt-win-reg.pl:65
25016 "This program can export and merge Windows Registry entries from a Windows "
25021 #: ../tools/virt-win-reg.pl:68
25023 "The first parameter is the libvirt guest name or the raw disk image of a "
25028 #: ../tools/virt-win-reg.pl:71
25030 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
25031 "exported (recursively). For example:"
25035 #: ../tools/virt-win-reg.pl:74
25038 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
25043 #: ../tools/virt-win-reg.pl:76
25045 "You can also display single values from within registry keys, for example:"
25049 #: ../tools/virt-win-reg.pl:79
25052 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
25053 " $ virt-win-reg Windows7 $cvkey ProductName\n"
25054 " Windows 7 Enterprise\n"
25059 #: ../tools/virt-win-reg.pl:83
25061 "With C<--merge>, you can merge a textual regedit file into the Windows "
25066 #: ../tools/virt-win-reg.pl:86
25069 " $ virt-win-reg --merge Windows7 changes.reg\n"
25074 #: ../tools/virt-win-reg.pl:88
25075 msgid "SUPPORTED SYSTEMS"
25079 #: ../tools/virt-win-reg.pl:90
25081 "The program currently supports Windows NT-derived guests starting with "
25082 "Windows XP through to at least Windows 7."
25086 #: ../tools/virt-win-reg.pl:93
25088 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
25089 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
25090 "and C<HKEY_USERS\\.DEFAULT>."
25094 #: ../tools/virt-win-reg.pl:97
25096 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
25101 #: ../tools/virt-win-reg.pl:100
25103 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
25108 #: ../tools/virt-win-reg.pl:103
25113 #: ../tools/virt-win-reg.pl:105
25115 "This program is only meant for simple access to the registry. If you want "
25116 "to do complicated things with the registry, we suggest you download the "
25117 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
25118 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
25119 "L<hivexregedit(1)>."
25123 #: ../tools/virt-win-reg.pl:111
25128 #: ../tools/virt-win-reg.pl:113
25130 "C<virt-win-reg> expects that regedit files have already been reencoded in "
25131 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
25132 "style line endings. Since Windows regedit files are often in UTF-16LE with "
25133 "Windows-style line endings, you may need to reencode the whole file before "
25134 "or after processing."
25138 #: ../tools/virt-win-reg.pl:119
25140 "To reencode a file from Windows format to Linux (before processing it with "
25141 "the C<--merge> option), you would do something like this:"
25145 #: ../tools/virt-win-reg.pl:122
25148 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
25153 #: ../tools/virt-win-reg.pl:124
25155 "To go in the opposite direction, after exporting and before sending the file "
25156 "to a Windows user, do something like this:"
25160 #: ../tools/virt-win-reg.pl:127
25163 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
25168 #: ../tools/virt-win-reg.pl:129
25169 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
25173 #: ../tools/virt-win-reg.pl:131
25175 "If you are unsure about the current encoding, use the L<file(1)> command. "
25176 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
25177 "style (CRLF) line endings, like this:"
25181 #: ../tools/virt-win-reg.pl:135
25184 " $ file software.reg\n"
25185 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
25186 " with CRLF line terminators\n"
25191 #: ../tools/virt-win-reg.pl:139
25192 msgid "This file would need conversion before you could C<--merge> it."
25196 #: ../tools/virt-win-reg.pl:143
25198 "Be careful when passing parameters containing C<\\> (backslash) in the "
25199 "shell. Usually you will have to use 'single quotes' or double backslashes "
25200 "(but not both) to protect them from the shell."
25204 #: ../tools/virt-win-reg.pl:147
25205 msgid "Paths and value names are case-insensitive."
25209 #: ../tools/virt-win-reg.pl:149
25210 msgid "CurrentControlSet etc."
25214 #: ../tools/virt-win-reg.pl:151
25216 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
25217 "Registry at the level of the hive file, and therefore you cannot modify "
25222 #: ../tools/virt-win-reg.pl:155
25224 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
25225 "circumstances it might refer to another control set. The way to find out is "
25226 "to look at the C<HKLM\\SYSTEM\\Select> key:"
25230 #: ../tools/virt-win-reg.pl:159
25233 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
25234 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
25235 " \"Current\"=dword:00000001\n"
25236 " \"Default\"=dword:00000001\n"
25237 " \"Failed\"=dword:00000000\n"
25238 " \"LastKnownGood\"=dword:00000002\n"
25243 #: ../tools/virt-win-reg.pl:166
25244 msgid "\"Default\" is the one which Windows will choose when it boots."
25248 #: ../tools/virt-win-reg.pl:168
25250 "Similarly, other C<Current...> keys in the path may need to be replaced."
25254 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
25259 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
25260 msgid "Enable debugging messages."
25264 #: ../tools/virt-win-reg.pl:232
25269 #: ../tools/virt-win-reg.pl:234
25271 "In merge mode, this merges a textual regedit file into the Windows Registry "
25272 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
25273 "displays or exports Registry entries instead."
25277 #: ../tools/virt-win-reg.pl:238
25279 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
25280 "result in disk corruption. However exporting (without this flag) is always "
25285 #: ../tools/virt-win-reg.pl:246
25286 msgid "B<--encoding> UTF-16LE|ASCII"
25290 #: ../tools/virt-win-reg.pl:248
25292 "When merging (only), you may need to specify the encoding for strings to be "
25293 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
25294 "(3)/ENCODING STRINGS>."
25298 #: ../tools/virt-win-reg.pl:252
25300 "The default is to use UTF-16LE, which should work with recent versions of "
25305 #: ../tools/virt-win-reg.pl:486
25307 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
25308 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
25309 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25313 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
25315 "When reporting bugs, please enable debugging and capture the I<complete> "
25320 #: ../tools/virt-win-reg.pl:504
25323 " export LIBGUESTFS_DEBUG=1\n"
25324 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
25329 #: ../tools/virt-win-reg.pl:507
25331 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
25336 #: ../tools/virt-df.pl:36
25337 msgid "virt-df - Display free space on virtual filesystems"
25341 #: ../tools/virt-df.pl:40
25344 " virt-df [--options]\n"
25349 #: ../tools/virt-df.pl:42
25352 " virt-df [--options] domname\n"
25357 #: ../tools/virt-df.pl:44
25360 " virt-df [--options] disk.img [disk.img ...]\n"
25365 #: ../tools/virt-df.pl:48
25367 "C<virt-df> is a command line tool to display free space on virtual machine "
25368 "filesystems. Unlike other tools, it doesn't just display the amount of "
25369 "space allocated to a virtual machine, but can look inside the virtual "
25370 "machine to see how much space is really being used."
25374 #: ../tools/virt-df.pl:53
25376 "It is like the L<df(1)> command, but for virtual machines, except that it "
25377 "also works for Windows virtual machines."
25381 #: ../tools/virt-df.pl:56
25383 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
25384 "of all active and inactive guests, and performs a C<df>-type operation on "
25385 "each one in turn, printing out the results."
25389 #: ../tools/virt-df.pl:60
25391 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
25392 "either the single named libvirt domain, or on the disk image(s) listed on "
25393 "the command line (which must all belong to a single VM). In this mode (with "
25394 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
25395 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
25399 #: ../tools/virt-df.pl:67
25401 "Use the C<--csv> option to get a format which can be easily parsed by other "
25402 "programs. Other options are mostly similar to standard C<df> options. See "
25403 "below for the complete list."
25407 #: ../tools/virt-df.pl:107
25412 #: ../tools/virt-df.pl:109
25414 "Write out the results in CSV format (comma-separated values). This format "
25415 "can be imported easily into databases and spreadsheets, but read L</NOTE "
25416 "ABOUT CSV FORMAT> below."
25420 #: ../tools/virt-df.pl:134
25421 msgid "B<--human-readable> | B<-h>"
25425 #: ../tools/virt-df.pl:136
25426 msgid "Print sizes in human-readable format."
25430 #: ../tools/virt-df.pl:138
25431 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
25435 #: ../tools/virt-df.pl:144
25436 msgid "B<--inodes> | B<-i>"
25440 #: ../tools/virt-df.pl:146
25441 msgid "Print inodes instead of blocks."
25445 #: ../tools/virt-df.pl:152
25446 msgid "B<--one-per-guest>"
25450 #: ../tools/virt-df.pl:154
25452 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
25453 "disks from several guests to a single libguestfs appliance."
25457 #: ../tools/virt-df.pl:157
25458 msgid "You might use this option in the following circumstances:"
25462 #: ../tools/virt-df.pl:163
25464 "If you think an untrusted guest might actively try to exploit the libguestfs "
25465 "appliance kernel, then this prevents one guest from interfering with the "
25466 "stats printed for another guest."
25470 #: ../tools/virt-df.pl:169
25472 "If the kernel has a bug which stops it from accessing a filesystem in one "
25473 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
25474 "and report stats for further guests."
25478 #: ../tools/virt-df.pl:180
25483 #: ../tools/virt-df.pl:182
25485 "Print UUIDs instead of names. This is useful for following a guest even "
25486 "when the guest is migrated or renamed, or when two guests happen to have the "
25491 #: ../tools/virt-df.pl:186
25493 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
25494 "images, we still print the disk image name even when this option is "
25499 #: ../tools/virt-df.pl:609
25500 msgid "NOTE ABOUT CSV FORMAT"
25504 #: ../tools/virt-df.pl:611
25506 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
25507 "should be easy to parse, but it is definitely not easy to parse."
25511 #: ../tools/virt-df.pl:614
25513 "Myth: Just split fields at commas. Reality: This does I<not> work "
25514 "reliably. This example has two columns:"
25518 #: ../tools/virt-df.pl:617
25521 " \"foo,bar\",baz\n"
25526 #: ../tools/virt-df.pl:619
25528 "Myth: Read the file one line at a time. Reality: This does I<not> work "
25529 "reliably. This example has one row:"
25533 #: ../tools/virt-df.pl:622
25542 #: ../tools/virt-df.pl:625
25544 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
25545 "packaged in major Linux distributions)."
25549 #: ../tools/virt-df.pl:628
25551 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
25552 "or Python's built-in csv library)."
25556 #: ../tools/virt-df.pl:631
25557 msgid "Most spreadsheets and databases can import CSV directly."
25561 #: ../tools/virt-df.pl:642
25563 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
25564 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25568 #: ../tools/virt-ls.pl:34
25569 msgid "virt-ls - List files in a virtual machine"
25573 #: ../tools/virt-ls.pl:38
25576 " virt-ls [--options] domname directory\n"
25581 #: ../tools/virt-ls.pl:40
25584 " virt-ls [--options] disk.img [disk.img ...] directory\n"
25589 #: ../tools/virt-ls.pl:44
25591 "C<virt-ls> is a command line tool to list the names of files in a directory "
25592 "inside a virtual machine or disk image."
25596 #: ../tools/virt-ls.pl:47
25598 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
25599 "For more complex cases you should look at the L<guestfish(1)> tool."
25603 #: ../tools/virt-ls.pl:51
25605 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
25606 "simple listing is like the ordinary L<ls(1)> command:"
25610 #: ../tools/virt-ls.pl:54
25613 " $ virt-ls myguest /\n"
25621 #: ../tools/virt-ls.pl:59
25622 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
25626 #: ../tools/virt-ls.pl:61
25629 " $ virt-ls -l myguest /\n"
25631 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
25632 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
25638 #: ../tools/virt-ls.pl:67
25640 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
25641 "and directories recursively:"
25645 #: ../tools/virt-ls.pl:70
25648 " $ virt-ls -R myguest /tmp\n"
25656 #: ../tools/virt-ls.pl:75
25658 "You I<cannot> combine these options. To do more complicated things, use "
25663 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103
25664 #: ../tools/virt-list-partitions.pl:112
25665 msgid "B<-l> | B<--long>"
25669 #: ../tools/virt-ls.pl:133
25670 msgid "B<-R> | B<--recursive>"
25674 #: ../tools/virt-ls.pl:135
25676 "Select the mode. With neither of these options, C<virt-ls> produces a "
25677 "simple, flat list of the files in the named directory."
25681 #: ../tools/virt-ls.pl:138
25683 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
25684 "like the plain C<ls -l> command)."
25688 #: ../tools/virt-ls.pl:141
25690 "C<virt-ls -R> produces a recursive list of files starting at the named "
25691 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
25696 #: ../tools/virt-ls.pl:145
25697 msgid "You cannot combine these options."
25701 #: ../tools/virt-ls.pl:234
25703 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
25704 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
25709 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204
25710 #: ../tools/virt-cat.pl:201 ../tools/virt-tar.pl:298
25711 msgid "Copyright (C) 2009 Red Hat Inc."
25715 #: ../tools/virt-resize.pl:42
25716 msgid "virt-resize - Resize a virtual machine disk"
25720 #: ../tools/virt-resize.pl:46
25723 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
25724 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
25725 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
25730 #: ../tools/virt-resize.pl:52
25732 "Virt-resize is a tool which can resize a virtual machine disk, making it "
25733 "larger or smaller overall, and resizing or deleting any partitions contained "
25738 #: ../tools/virt-resize.pl:56
25740 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
25741 "not> be used on live virtual machines - for consistent results, shut the "
25742 "virtual machine down before resizing it."
25746 #: ../tools/virt-resize.pl:60
25748 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
25749 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
25750 "read those manual pages first."
25754 #: ../tools/virt-resize.pl:68
25756 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
25757 "fill the extra 5GB of space."
25761 #: ../tools/virt-resize.pl:71
25764 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
25765 " virt-list-partitions -lht olddisk\n"
25766 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
25767 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
25772 #: ../tools/virt-resize.pl:76
25774 "As above, but make the /boot partition 200MB bigger, while giving the "
25775 "remaining space to /dev/sda2:"
25779 #: ../tools/virt-resize.pl:79
25782 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
25787 #: ../tools/virt-resize.pl:81
25788 msgid "As above, but the output format will be uncompressed qcow2:"
25792 #: ../tools/virt-resize.pl:83
25795 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
25796 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
25801 #: ../tools/virt-resize.pl:86
25802 msgid "DETAILED USAGE"
25806 #: ../tools/virt-resize.pl:88
25807 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25811 #: ../tools/virt-resize.pl:92
25812 msgid "1. Shut down the virtual machine"
25816 #: ../tools/virt-resize.pl:94
25817 msgid "2. Locate input disk image"
25821 #: ../tools/virt-resize.pl:96
25823 "Locate the input disk image (ie. the file or device on the host containing "
25824 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25825 "dumpxml> like this to find the disk image name:"
25829 #: ../tools/virt-resize.pl:100
25832 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25833 " Found 1 nodes:\n"
25835 " <source dev=\"/dev/vg/lv_guest\" />\n"
25840 #: ../tools/virt-resize.pl:105
25841 msgid "3. Look at current sizing"
25845 #: ../tools/virt-resize.pl:107
25847 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25851 #: ../tools/virt-resize.pl:110
25854 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25855 " /dev/sda1 ext3 101.9M\n"
25856 " /dev/sda2 pv 7.9G\n"
25857 " /dev/sda device 8.0G\n"
25862 #: ../tools/virt-resize.pl:115
25864 "(This example is a virtual machine with an 8 GB disk which we would like to "
25865 "expand up to 10 GB)."
25869 #: ../tools/virt-resize.pl:118
25870 msgid "4. Create output disk"
25874 #: ../tools/virt-resize.pl:120
25876 "Virt-resize cannot do in-place disk modifications. You have to have space "
25877 "to store the resized output disk."
25881 #: ../tools/virt-resize.pl:123
25883 "To store the resized disk image in a file, create a file of a suitable size:"
25887 #: ../tools/virt-resize.pl:126
25890 " # rm -f outdisk\n"
25891 " # truncate -s 10G outdisk\n"
25896 #: ../tools/virt-resize.pl:129
25897 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25901 #: ../tools/virt-resize.pl:131
25904 " # lvcreate -L 10G -n lv_name vg_name\n"
25909 #: ../tools/virt-resize.pl:133
25910 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25914 #: ../tools/virt-resize.pl:135
25917 " # virsh pool-list\n"
25918 " # virsh vol-create-as poolname newvol 10G\n"
25923 #: ../tools/virt-resize.pl:138
25928 #: ../tools/virt-resize.pl:140
25930 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25931 "file) and the output disk. The output disk is the one created in the "
25936 #: ../tools/virt-resize.pl:144
25939 " # virt-resize indisk outdisk\n"
25944 #: ../tools/virt-resize.pl:146
25946 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25947 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25948 "larger, then an extra, empty partition is created at the end of the disk "
25949 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25954 #: ../tools/virt-resize.pl:152
25956 "More realistically you'd want to expand existing partitions in the disk "
25957 "image by passing extra options (for the full list see the L</OPTIONS> "
25962 #: ../tools/virt-resize.pl:156
25964 "L</--expand> is the most useful option. It expands the named partition "
25965 "within the disk to fill any extra space:"
25969 #: ../tools/virt-resize.pl:159
25972 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25977 #: ../tools/virt-resize.pl:161
25979 "(In this case, an extra partition is I<not> created at the end of the disk, "
25980 "because there will be no unused space)."
25984 #: ../tools/virt-resize.pl:164
25986 "L</--resize> is the other commonly used option. The following would "
25987 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25988 "rest of the available space:"
25992 #: ../tools/virt-resize.pl:168
25995 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25996 " indisk outdisk\n"
26001 #: ../tools/virt-resize.pl:171
26003 "If the expanded partition in the image contains a filesystem or LVM PV, then "
26004 "if virt-resize knows how, it will resize the contents, the equivalent of "
26005 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
26006 ">. However virt-resize does not know how to resize some filesystems, so you "
26007 "would have to online resize them after booting the guest. And virt-resize "
26008 "also does not resize anything inside an LVM PV, it just resizes the PV "
26009 "itself and leaves the user to resize any LVs inside that PV as desired."
26013 #: ../tools/virt-resize.pl:180
26014 msgid "Other options are covered below."
26018 #: ../tools/virt-resize.pl:182
26023 #: ../tools/virt-resize.pl:184
26024 msgid "Thoroughly test the new disk image I<before> discarding the old one."
26028 #: ../tools/virt-resize.pl:186
26029 msgid "If you are using libvirt, edit the XML to point at the new disk:"
26033 #: ../tools/virt-resize.pl:188
26036 " # virsh edit guestname\n"
26041 #: ../tools/virt-resize.pl:190
26043 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
26044 "html#elementsDisks>"
26048 #: ../tools/virt-resize.pl:193
26049 msgid "Then start up the domain with the new, resized disk:"
26053 #: ../tools/virt-resize.pl:195
26056 " # virsh start guestname\n"
26061 #: ../tools/virt-resize.pl:197
26063 "and check that it still works. See also the L</NOTES> section below for "
26064 "additional information."
26068 #: ../tools/virt-resize.pl:200
26069 msgid "7. Resize LVs etc inside the guest"
26073 #: ../tools/virt-resize.pl:202
26074 msgid "(This can also be done offline using L<guestfish(1)>)"
26078 #: ../tools/virt-resize.pl:204
26080 "Once the guest has booted you should see the new space available, at least "
26081 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
26082 "may need to resize LVs inside PVs, and also resize filesystem types that "
26083 "virt-resize does not know how to expand."
26087 #: ../tools/virt-resize.pl:211
26088 msgid "SHRINKING A VIRTUAL MACHINE DISK"
26092 #: ../tools/virt-resize.pl:213
26094 "Shrinking is somewhat more complex than expanding, and only an overview is "
26099 #: ../tools/virt-resize.pl:216
26101 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
26102 "filesystems). The user has to shrink content before passing the disk image "
26103 "to virt-resize, and virt-resize will check that the content has been shrunk "
26108 #: ../tools/virt-resize.pl:221
26109 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
26113 #: ../tools/virt-resize.pl:223
26115 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
26116 "steps 3 and 4 above to allocate a new disk image."
26120 #: ../tools/virt-resize.pl:226
26122 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
26126 #: ../tools/virt-resize.pl:229
26127 msgid "IGNORING OR DELETING PARTITIONS"
26131 #: ../tools/virt-resize.pl:231
26133 "virt-resize also gives a convenient way to ignore or delete partitions when "
26134 "copying from the input disk to the output disk. Ignoring a partition speeds "
26135 "up the copy where you don't care about the existing contents of a "
26136 "partition. Deleting a partition removes it completely, but note that it "
26137 "also renumbers any partitions after the one which is deleted, which can "
26138 "leave some guests unbootable."
26142 #: ../tools/virt-resize.pl:238
26143 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
26147 #: ../tools/virt-resize.pl:240
26149 "If the input disk is in qcow2 format, then you may prefer that the output is "
26150 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
26151 "the fly. The output format is simply determined by the format of the empty "
26152 "output container that you provide. Thus to create qcow2 output, use:"
26156 #: ../tools/virt-resize.pl:246
26159 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
26164 #: ../tools/virt-resize.pl:248
26165 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
26169 #: ../tools/virt-resize.pl:250
26170 msgid "Similarly, to get non-sparse raw output use:"
26174 #: ../tools/virt-resize.pl:252
26177 " fallocate -l size outdisk\n"
26182 #: ../tools/virt-resize.pl:254
26184 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
26185 "dev/zero of=outdisk bs=1M count=..>)"
26189 #: ../tools/virt-resize.pl:267
26190 msgid "Display help."
26194 #: ../tools/virt-resize.pl:281
26195 msgid "B<--resize part=size>"
26199 #: ../tools/virt-resize.pl:283
26201 "Resize the named partition (expanding or shrinking it) so that it has the "
26206 #: ../tools/virt-resize.pl:286
26208 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
26209 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
26210 "Exabytes; or as a percentage of the current size; or as a relative number or "
26211 "percentage. For example:"
26215 #: ../tools/virt-resize.pl:291
26218 " --resize /dev/sda2=10G\n"
26223 #: ../tools/virt-resize.pl:293
26226 " --resize /dev/sda4=90%\n"
26231 #: ../tools/virt-resize.pl:295
26234 " --resize /dev/sda2=+1G\n"
26239 #: ../tools/virt-resize.pl:297
26242 " --resize /dev/sda2=-200M\n"
26247 #: ../tools/virt-resize.pl:299
26250 " --resize /dev/sda1=+128K\n"
26255 #: ../tools/virt-resize.pl:301
26258 " --resize /dev/sda1=+10%\n"
26263 #: ../tools/virt-resize.pl:303
26266 " --resize /dev/sda1=-10%\n"
26271 #: ../tools/virt-resize.pl:305
26273 "You can increase the size of any partition. Virt-resize will expand the "
26274 "direct content of the partition if it knows how (see C<--expand> below)."
26278 #: ../tools/virt-resize.pl:309
26280 "You can only I<decrease> the size of partitions that contain filesystems or "
26281 "PVs which have already been shrunk. Virt-resize will check this has been "
26282 "done before proceeding, or else will print an error (see also C<--resize-"
26287 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406
26288 #: ../tools/virt-resize.pl:423
26289 msgid "You can give this option multiple times."
26293 #: ../tools/virt-resize.pl:320
26294 msgid "B<--resize-force part=size>"
26298 #: ../tools/virt-resize.pl:322
26300 "This is the same as C<--resize> except that it will let you decrease the "
26301 "size of any partition. Generally this means you will lose any data which "
26302 "was at the end of the partition you shrink, but you may not care about that "
26303 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
26304 "as a swap partition)."
26308 #: ../tools/virt-resize.pl:328
26309 msgid "See also the C<--ignore> option."
26313 #: ../tools/virt-resize.pl:334
26314 msgid "B<--expand part>"
26318 #: ../tools/virt-resize.pl:336
26320 "Expand the named partition so it uses up all extra space (space left over "
26321 "after any other resize changes that you request have been done)."
26325 #: ../tools/virt-resize.pl:339
26327 "If virt-resize knows how, it will expand the direct content of the "
26328 "partition. For example, if the partition is an LVM PV, it will expand the "
26329 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
26330 "content it doesn't know about alone."
26334 #: ../tools/virt-resize.pl:344
26335 msgid "Currently virt-resize can resize:"
26339 #: ../tools/virt-resize.pl:350
26341 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
26346 #: ../tools/virt-resize.pl:355
26348 "NTFS filesystems contained directly in a partition, if libguestfs was "
26349 "compiled with support for NTFS."
26353 #: ../tools/virt-resize.pl:358
26355 "The filesystem must have been shut down consistently last time it was used. "
26356 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
26357 "consistency check, so at the first boot after resizing Windows will check "
26362 #: ../tools/virt-resize.pl:365
26364 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
26365 "inside the PV. The user will have to resize LVs as desired."
26369 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
26370 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
26374 #: ../tools/virt-resize.pl:377
26375 msgid "B<--shrink part>"
26379 #: ../tools/virt-resize.pl:379
26381 "Shrink the named partition until the overall disk image fits in the "
26382 "destination. The named partition B<must> contain a filesystem or PV which "
26383 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
26384 "online tools). Virt-resize will check this and give an error if it has not "
26389 #: ../tools/virt-resize.pl:385
26391 "The amount by which the overall disk must be shrunk (after carrying out all "
26392 "other operations requested by the user) is called the \"deficit\". For "
26393 "example, a straight copy (assume no other operations) from a 5GB disk image "
26394 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
26395 "would give an error unless the user specified a partition to shrink and that "
26396 "partition had more than a gigabyte of free space."
26400 #: ../tools/virt-resize.pl:399
26401 msgid "B<--ignore part>"
26405 #: ../tools/virt-resize.pl:401
26407 "Ignore the named partition. Effectively this means the partition is "
26408 "allocated on the destination disk, but the content is not copied across from "
26409 "the source disk. The content of the partition will be blank (all zero "
26414 #: ../tools/virt-resize.pl:412
26415 msgid "B<--delete part>"
26419 #: ../tools/virt-resize.pl:414
26421 "Delete the named partition. It would be more accurate to describe this as "
26422 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
26423 "the original disk image is left intact."
26427 #: ../tools/virt-resize.pl:418
26429 "Note that when you delete a partition, then anything contained in the "
26430 "partition is also deleted. Furthermore, this causes any partitions that "
26431 "come after to be I<renumbered>, which can easily make your guest unbootable."
26435 #: ../tools/virt-resize.pl:429
26436 msgid "B<--LV-expand logvol>"
26440 #: ../tools/virt-resize.pl:431
26442 "This takes the logical volume and, as a final step, expands it to fill all "
26443 "the space available in its volume group. A typical usage, assuming a Linux "
26444 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
26445 "lv_root> would be:"
26449 #: ../tools/virt-resize.pl:436
26452 " virt-resize indisk outdisk \\\n"
26453 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
26458 #: ../tools/virt-resize.pl:439
26460 "This would first expand the partition (and PV), and then expand the root "
26461 "device to fill the extra space in the PV."
26465 #: ../tools/virt-resize.pl:442
26467 "The contents of the LV are also resized if virt-resize knows how to do "
26468 "that. You can stop virt-resize from trying to expand the content by using "
26469 "the option C<--no-expand-content>."
26473 #: ../tools/virt-resize.pl:446
26474 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
26478 #: ../tools/virt-resize.pl:449
26480 "You can give this option multiple times, I<but> it doesn't make sense to do "
26481 "this unless the logical volumes you specify are all in different volume "
26486 #: ../tools/virt-resize.pl:457
26487 msgid "B<--no-copy-boot-loader>"
26491 #: ../tools/virt-resize.pl:459
26493 "By default, virt-resize copies over some sectors at the start of the disk "
26494 "(up to the beginning of the first partition). Commonly these sectors "
26495 "contain the Master Boot Record (MBR) and the boot loader, and are required "
26496 "in order for the guest to boot correctly."
26500 #: ../tools/virt-resize.pl:464
26502 "If you specify this flag, then this initial copy is not done. You may need "
26503 "to reinstall the boot loader in this case."
26507 #: ../tools/virt-resize.pl:472
26508 msgid "B<--no-extra-partition>"
26512 #: ../tools/virt-resize.pl:474
26514 "By default, virt-resize creates an extra partition if there is any extra, "
26515 "unused space after all resizing has happened. Use this option to prevent "
26516 "the extra partition from being created. If you do this then the extra space "
26517 "will be inaccessible until you run fdisk, parted, or some other partitioning "
26518 "tool in the guest."
26522 #: ../tools/virt-resize.pl:480
26524 "Note that if the surplus space is smaller than 10 MB, no extra partition "
26529 #: ../tools/virt-resize.pl:487
26530 msgid "B<--no-expand-content>"
26534 #: ../tools/virt-resize.pl:489
26536 "By default, virt-resize will try to expand the direct contents of "
26537 "partitions, if it knows how (see C<--expand> option above)."
26541 #: ../tools/virt-resize.pl:492
26543 "If you give the C<--no-expand-content> option then virt-resize will not "
26548 #: ../tools/virt-resize.pl:499
26549 msgid "B<-d> | B<--debug>"
26553 #: ../tools/virt-resize.pl:507
26554 msgid "B<-n> | B<--dryrun>"
26558 #: ../tools/virt-resize.pl:509
26559 msgid "Print a summary of what would be done, but don't do anything."
26563 #: ../tools/virt-resize.pl:515
26564 msgid "B<-q> | B<--quiet>"
26568 #: ../tools/virt-resize.pl:517
26569 msgid "Don't print the summary."
26573 #: ../tools/virt-resize.pl:525
26575 "Specify the format of the input disk image. If this flag is not given then "
26576 "it is auto-detected from the image itself."
26580 #: ../tools/virt-resize.pl:531
26582 "Note that this option I<does not> affect the output format. See L</QCOW2 "
26583 "AND NON-SPARSE RAW FORMATS>."
26587 #: ../tools/virt-resize.pl:538
26588 msgid "B<--output-format> raw"
26592 #: ../tools/virt-resize.pl:540
26594 "Specify the format of the output disk image. If this flag is not given then "
26595 "it is auto-detected from the image itself."
26599 #: ../tools/virt-resize.pl:546
26601 "Note that you still need to create the output disk with the right format. "
26602 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
26606 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
26611 #: ../tools/virt-resize.pl:1424
26612 msgid "\"Partition 1 does not end on cylinder boundary.\""
26616 #: ../tools/virt-resize.pl:1426
26618 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
26619 "means the partitions will not be aligned to the ancient CHS geometry. "
26620 "However CHS geometry is meaningless for disks manufactured since the early "
26621 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
26622 "cylinders is not required by any modern operating system."
26626 #: ../tools/virt-resize.pl:1433
26627 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
26631 #: ../tools/virt-resize.pl:1435
26633 "In Windows Vista and later versions, Microsoft switched to using a separate "
26634 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
26635 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
26636 "the boot partition. Doing so seems to break the guest completely. However "
26637 "expanding the second partition (ie. C: drive) should work."
26641 #: ../tools/virt-resize.pl:1442
26643 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
26644 "NTFS partitions have been expanded. This is just a safety check and (unless "
26645 "it find errors) is nothing to worry about."
26649 #: ../tools/virt-resize.pl:1446
26650 msgid "GUEST BOOT STUCK AT \"GRUB\""
26654 #: ../tools/virt-resize.pl:1448
26656 "If a Linux guest does not boot after resizing, and the boot is stuck after "
26657 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
26658 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
26659 "although we think is to do with partition alignment."
26663 #: ../tools/virt-resize.pl:1453
26666 " guestfish -i -a newdisk\n"
26667 " ><fs> cat /boot/grub/device.map\n"
26668 " # check the contents of this file are sensible or\n"
26669 " # edit the file if necessary\n"
26670 " ><fs> grub-install / /dev/vda\n"
26676 #: ../tools/virt-resize.pl:1460
26678 "For more flexible guest reconfiguration, including if you need to specify "
26679 "other parameters to grub-install, use L<virt-rescue(1)>."
26683 #: ../tools/virt-resize.pl:1463
26684 msgid "ALTERNATIVE TOOLS"
26688 #: ../tools/virt-resize.pl:1465
26690 "There are several proprietary tools for resizing partitions. We won't "
26691 "mention any here."
26695 #: ../tools/virt-resize.pl:1468
26697 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
26698 "operations on disk images. They can resize and move partitions, but I don't "
26699 "think they can do anything with the contents, and they certainly don't "
26704 #: ../tools/virt-resize.pl:1473
26706 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
26707 "but at a much lower level. You will probably end up hand-calculating sector "
26708 "offsets, which is something that virt-resize was designed to avoid. If you "
26709 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
26714 #: ../tools/virt-resize.pl:1488
26716 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
26717 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
26718 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)"
26719 ">, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
26720 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
26724 #: ../tools/virt-list-filesystems.pl:32
26726 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
26730 #: ../tools/virt-list-filesystems.pl:36
26733 " virt-list-filesystems [--options] domname\n"
26738 #: ../tools/virt-list-filesystems.pl:38
26741 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
26746 #: ../tools/virt-list-filesystems.pl:42
26748 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
26749 "are contained in a virtual machine or disk image."
26753 #: ../tools/virt-list-filesystems.pl:46
26755 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
26756 "functionality. For more complex cases you should look at the L<guestfish(1)"
26761 #: ../tools/virt-list-filesystems.pl:105
26763 "With this option, C<virt-list-filesystems> displays the type of each "
26764 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
26768 #: ../tools/virt-list-filesystems.pl:112
26769 msgid "B<-a> | B<--all>"
26773 #: ../tools/virt-list-filesystems.pl:114
26775 "Normally we only show mountable filesystems. If this option is given then "
26776 "swap devices are shown too."
26780 #: ../tools/virt-list-filesystems.pl:188
26782 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
26783 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
26784 ">, L<http://libguestfs.org/>."
26788 #: ../tools/virt-cat.pl:33
26789 msgid "virt-cat - Display a file in a virtual machine"
26793 #: ../tools/virt-cat.pl:37
26796 " virt-cat [--options] domname file\n"
26801 #: ../tools/virt-cat.pl:39
26804 " virt-cat [--options] disk.img [disk.img ...] file\n"
26809 #: ../tools/virt-cat.pl:43
26811 "C<virt-cat> is a command line tool to display the contents of C<file> where "
26812 "C<file> exists in the named virtual machine (or disk image)."
26816 #: ../tools/virt-cat.pl:46
26818 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
26819 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
26824 #: ../tools/virt-cat.pl:52
26826 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
26830 #: ../tools/virt-cat.pl:55
26833 " virt-cat mydomain /etc/fstab\n"
26838 #: ../tools/virt-cat.pl:57
26839 msgid "List syslog messages from a VM:"
26843 #: ../tools/virt-cat.pl:59
26846 " virt-cat mydomain /var/log/messages | tail\n"
26851 #: ../tools/virt-cat.pl:61
26852 msgid "Find out what DHCP IP address a VM acquired:"
26856 #: ../tools/virt-cat.pl:63
26859 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
26864 #: ../tools/virt-cat.pl:65
26865 msgid "Find out what packages were recently installed:"
26869 #: ../tools/virt-cat.pl:67
26872 " virt-cat mydomain /var/log/yum.log | tail\n"
26877 #: ../tools/virt-cat.pl:69
26878 msgid "Find out who is logged on inside a virtual machine:"
26882 #: ../tools/virt-cat.pl:71
26885 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
26891 #: ../tools/virt-cat.pl:74
26892 msgid "or who was logged on:"
26896 #: ../tools/virt-cat.pl:76
26899 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
26900 " last -f /tmp/wtmp\n"
26905 #: ../tools/virt-cat.pl:187
26907 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26908 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26912 #: ../tools/virt-tar.pl:33
26913 msgid "virt-tar - Extract or upload files to a virtual machine"
26917 #: ../tools/virt-tar.pl:37
26920 " virt-tar [--options] -x domname directory tarball\n"
26925 #: ../tools/virt-tar.pl:39
26928 " virt-tar [--options] -u domname tarball directory\n"
26933 #: ../tools/virt-tar.pl:41
26936 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
26941 #: ../tools/virt-tar.pl:43
26944 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
26949 #: ../tools/virt-tar.pl:47
26950 msgid "Download C</home> from the VM into a local tarball:"
26954 #: ../tools/virt-tar.pl:49
26957 " virt-tar -x domname /home home.tar\n"
26962 #: ../tools/virt-tar.pl:51
26965 " virt-tar -zx domname /home home.tar.gz\n"
26970 #: ../tools/virt-tar.pl:53
26971 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
26975 #: ../tools/virt-tar.pl:55
26978 " virt-tar -u domname uploadstuff.tar /tmp\n"
26983 #: ../tools/virt-tar.pl:57
26986 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
26991 #: ../tools/virt-tar.pl:61
26993 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
26994 "virtual machines. If you do this, you risk disk corruption in the VM. "
26995 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
26999 #: ../tools/virt-tar.pl:66
27001 "You can use C<-x> (extract) on live virtual machines, but you might get "
27002 "inconsistent results or errors if there is filesystem activity inside the "
27003 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
27004 "work, but the only way to guarantee consistent results is if the virtual "
27005 "machine is shut down."
27009 #: ../tools/virt-tar.pl:74
27011 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
27012 "parts of a guest filesystem. There are many possibilities: making backups, "
27013 "uploading data files, snooping on guest activity, fixing or customizing "
27018 #: ../tools/virt-tar.pl:79
27020 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
27021 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
27022 "should look at the L<guestfish(1)> tool."
27026 #: ../tools/virt-tar.pl:83
27028 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
27029 "its contents (recursively) from the virtual machine into a local tarball. "
27030 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
27031 "virtual machine. You cannot use these two options together."
27035 #: ../tools/virt-tar.pl:89
27037 "In addition, you may need to use the C<-z> (gZip) option to enable "
27038 "compression. When uploading, you have to specify C<-z> if the upload file "
27039 "is compressed because virt-tar won't detect this on its own."
27043 #: ../tools/virt-tar.pl:93
27045 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
27046 "example it cannot do PKZip files or bzip2 compression. If you want that "
27047 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
27048 "the L<libguestfs(3)> API)."
27052 #: ../tools/virt-tar.pl:151
27053 msgid "B<-x> | B<--extract> | B<--download>"
27057 #: ../tools/virt-tar.pl:153
27058 msgid "B<-u> | B<--upload>"
27062 #: ../tools/virt-tar.pl:155
27064 "Use C<-x> to extract (download) a directory from a virtual machine to a "
27069 #: ../tools/virt-tar.pl:158
27071 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
27072 "Please read the L</WARNING> section above before using this option."
27076 #: ../tools/virt-tar.pl:162
27077 msgid "You must specify exactly one of these options."
27081 #: ../tools/virt-tar.pl:168
27082 msgid "B<-z> | B<--gzip>"
27086 #: ../tools/virt-tar.pl:170
27087 msgid "Specify that the input or output tarball is gzip-compressed."
27091 #: ../tools/virt-tar.pl:283
27093 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
27094 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
27099 #: ../tools/virt-rescue.pl:33
27100 msgid "virt-rescue - Run a rescue shell on a virtual machine"
27104 #: ../tools/virt-rescue.pl:37
27107 " virt-rescue [--options] domname\n"
27112 #: ../tools/virt-rescue.pl:39
27115 " virt-rescue [--options] disk.img [disk.img ...]\n"
27120 #: ../tools/virt-rescue.pl:43
27122 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
27123 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
27124 "you from doing this, but doesn't catch all cases."
27128 #: ../tools/virt-rescue.pl:47
27130 "However if you use the I<--ro> (read only) option, then you can attach a "
27131 "shell to a live virtual machine. The results might be strange or "
27132 "inconsistent at times but you won't get disk corruption."
27136 #: ../tools/virt-rescue.pl:53
27138 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
27139 "need for a CD. virt-rescue gives you a rescue shell and some simple "
27140 "recovery tools which you can use to examine or rescue a virtual machine or "
27145 #: ../tools/virt-rescue.pl:58
27147 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
27148 "on disk image(s):"
27152 #: ../tools/virt-rescue.pl:61
27155 " virt-rescue GuestName\n"
27160 #: ../tools/virt-rescue.pl:63
27163 " virt-rescue --ro /path/to/disk.img\n"
27168 #: ../tools/virt-rescue.pl:65
27171 " virt-rescue /dev/sdc\n"
27176 #: ../tools/virt-rescue.pl:67
27177 msgid "For live VMs you I<must> use the --ro option."
27181 #: ../tools/virt-rescue.pl:69
27183 "When you run virt-rescue on a virtual machine or disk image, you are placed "
27184 "in an interactive bash shell where you can use many ordinary Linux "
27185 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
27186 "appliance. You must mount the virtual machine's filesystems by hand. There "
27187 "is an empty directory called C</sysroot> where you can mount filesystems."
27191 #: ../tools/virt-rescue.pl:76
27193 "In the example below, we list logical volumes, then choose one to mount "
27194 "under C</sysroot>:"
27198 #: ../tools/virt-rescue.pl:79
27202 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
27203 " lv_root vg_f11x64 -wi-a- 8.83G\n"
27204 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
27205 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
27206 " ><rescue> ls /sysroot\n"
27211 #: ../tools/virt-rescue.pl:86
27213 "If you don't know what filesystems are available on the virtual machine then "
27214 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
27218 #: ../tools/virt-rescue.pl:92
27220 "Virt-rescue can be used on I<any> disk image file or device, not just a "
27221 "virtual machine. For example you can use it on a blank file if you want to "
27222 "partition that file (although we would recommend using L<guestfish(1)> "
27223 "instead as it is more suitable for this purpose). You can even use virt-"
27224 "rescue on things like SD cards."
27228 #: ../tools/virt-rescue.pl:98
27230 "This tool is just designed for quick interactive hacking on a virtual "
27231 "machine. For more structured access to a virtual machine disk image, you "
27232 "should use L<guestfs(3)>. To get a structured shell that you can use to "
27233 "make scripted changes to guests, use L<guestfish(1)>."
27237 #: ../tools/virt-rescue.pl:127
27238 msgid "B<--append kernelopts>"
27242 #: ../tools/virt-rescue.pl:129
27243 msgid "Pass additional options to the rescue kernel."
27247 #: ../tools/virt-rescue.pl:164
27248 msgid "B<--memsize MB> | B<-m MB>"
27252 #: ../tools/virt-rescue.pl:166
27254 "Change the amount of memory allocated to the rescue system. The default is "
27255 "set by libguestfs and is small but adequate for running system tools. The "
27256 "occasional program might need more memory. The parameter is specified in "
27261 #: ../tools/virt-rescue.pl:175
27262 msgid "B<--network MB>"
27266 #: ../tools/virt-rescue.pl:177
27267 msgid "Enable QEMU user networking in the guest."
27271 #: ../tools/virt-rescue.pl:183
27272 msgid "B<--ro> | B<-r>"
27276 #: ../tools/virt-rescue.pl:185
27277 msgid "Open the image read-only."
27281 #: ../tools/virt-rescue.pl:197
27283 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
27284 "SELINUX> before using this option."
27288 #: ../tools/virt-rescue.pl:257
27290 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
27291 "ENVIRONMENT VARIABLES> for the complete list."
27295 #: ../tools/virt-rescue.pl:269
27297 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
27298 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27302 #: ../tools/virt-make-fs.pl:37
27303 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
27307 #: ../tools/virt-make-fs.pl:41
27310 " virt-make-fs [--options] input.tar output.img\n"
27315 #: ../tools/virt-make-fs.pl:43
27318 " virt-make-fs [--options] input.tar.gz output.img\n"
27323 #: ../tools/virt-make-fs.pl:45
27326 " virt-make-fs [--options] directory output.img\n"
27331 #: ../tools/virt-make-fs.pl:49
27333 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
27334 "archive or some files in a directory. It is similar to tools like L<mkisofs"
27335 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
27336 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
27337 "you want to attach these filesystems to existing virtual machines (eg. to "
27338 "import large amounts of read-only data to a VM)."
27342 #: ../tools/virt-make-fs.pl:57
27343 msgid "Basic usage is:"
27347 #: ../tools/virt-make-fs.pl:59
27350 " virt-make-fs input output\n"
27355 #: ../tools/virt-make-fs.pl:61
27357 "where C<input> is either a directory containing files that you want to add, "
27358 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
27359 "C<output> is a disk image. The input type is detected automatically. The "
27360 "output disk image defaults to a raw ext2 image unless you specify extra "
27361 "flags (see L</OPTIONS> below)."
27365 #: ../tools/virt-make-fs.pl:67
27366 msgid "EXTRA SPACE"
27370 #: ../tools/virt-make-fs.pl:69
27372 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
27373 "the files that it contains, but might have extra space. Depending on how "
27374 "you are going to use the output, you might think this extra space is wasted "
27375 "and want to minimize it, or you might want to leave space so that more files "
27376 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
27377 "but you can use the C<--size> flag to leave space in the filesystem if you "
27382 #: ../tools/virt-make-fs.pl:77
27384 "An alternative way to leave extra space but not make the output image any "
27385 "bigger is to use an alternative disk image format (instead of the default "
27386 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
27387 "image format (check your hypervisor supports this before using it). This "
27388 "allows you to choose a large C<--size> but the extra space won't actually be "
27389 "allocated in the image until you try to store something in it."
27393 #: ../tools/virt-make-fs.pl:85
27395 "Don't forget that you can also use local commands including L<resize2fs(8)> "
27396 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
27397 "resize to build another image from scratch."
27401 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
27402 #: ../tools/virt-make-fs.pl:142
27407 #: ../tools/virt-make-fs.pl:91
27410 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
27415 #: ../tools/virt-make-fs.pl:93
27416 msgid "FILESYSTEM TYPE"
27420 #: ../tools/virt-make-fs.pl:95
27422 "The default filesystem type is C<ext2>. Just about any filesystem type that "
27423 "libguestfs supports can be used (but I<not> read-only formats like "
27424 "ISO9660). Here are some of the more common choices:"
27428 #: ../tools/virt-make-fs.pl:101
27433 #: ../tools/virt-make-fs.pl:103
27435 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
27436 "you are not going to use the filesystem in a way that requires the journal, "
27437 "then this is just wasted overhead."
27441 #: ../tools/virt-make-fs.pl:107
27442 msgid "I<ntfs> or I<vfat>"
27446 #: ../tools/virt-make-fs.pl:109
27447 msgid "Useful if exporting data to a Windows guest."
27451 #: ../tools/virt-make-fs.pl:111
27453 "I<Note for vfat>: The tar archive or local directory must only contain files "
27454 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
27455 "program running within libguestfs is unable to change the ownership of non-"
27456 "root files, since vfat itself does not support this."
27460 #: ../tools/virt-make-fs.pl:116
27465 #: ../tools/virt-make-fs.pl:118
27467 "Lower overhead than C<ext2>, but certain limitations on filename length and "
27468 "total filesystem size."
27472 #: ../tools/virt-make-fs.pl:125
27475 " virt-make-fs --type=minix input minixfs.img\n"
27480 #: ../tools/virt-make-fs.pl:127
27481 msgid "TO PARTITION OR NOT TO PARTITION"
27485 #: ../tools/virt-make-fs.pl:129
27486 msgid "Optionally virt-make-fs can add a partition table to the output disk."
27490 #: ../tools/virt-make-fs.pl:131
27492 "Adding a partition can make the disk image more compatible with certain "
27493 "virtualized operating systems which don't expect to see a filesystem "
27494 "directly located on a block device (Linux doesn't care and will happily "
27495 "handle both types)."
27499 #: ../tools/virt-make-fs.pl:136
27501 "On the other hand, if you have a partition table then the output image is no "
27502 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
27503 "directly on a partitioned disk image. (However libguestfs tools such as "
27504 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
27508 #: ../tools/virt-make-fs.pl:144
27509 msgid "Add an MBR partition:"
27513 #: ../tools/virt-make-fs.pl:146
27516 " virt-make-fs --partition -- input disk.img\n"
27521 #: ../tools/virt-make-fs.pl:148
27523 "If the output disk image could be terabyte-sized or larger, it's better to "
27524 "use an EFI/GPT-compatible partition table:"
27528 #: ../tools/virt-make-fs.pl:151
27531 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
27536 #: ../tools/virt-make-fs.pl:179
27537 msgid "Enable debugging information."
27541 #: ../tools/virt-make-fs.pl:185
27542 msgid "B<--size=E<lt>NE<gt>>"
27546 #: ../tools/virt-make-fs.pl:187
27547 msgid "B<--size=+E<lt>NE<gt>>"
27551 #: ../tools/virt-make-fs.pl:189
27552 msgid "B<-s E<lt>NE<gt>>"
27556 #: ../tools/virt-make-fs.pl:191
27557 msgid "B<-s +E<lt>NE<gt>>"
27561 #: ../tools/virt-make-fs.pl:193
27563 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
27567 #: ../tools/virt-make-fs.pl:196
27569 "If this option is I<not> given, then the output image will be just large "
27570 "enough to contain all the files, with not much wasted space."
27574 #: ../tools/virt-make-fs.pl:199
27576 "To choose a fixed size output disk, specify an absolute number followed by b/"
27577 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27578 "Petabytes or Exabytes. This must be large enough to contain all the input "
27579 "files, else you will get an error."
27583 #: ../tools/virt-make-fs.pl:204
27585 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
27586 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27587 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
27588 "the input files, and (approximately) an extra 200 MB free space."
27592 #: ../tools/virt-make-fs.pl:210
27594 "Note that virt-make-fs estimates free space, and therefore will not produce "
27595 "filesystems containing precisely the free space requested. (It is much more "
27596 "expensive and time-consuming to produce a filesystem which has precisely the "
27597 "desired free space)."
27601 #: ../tools/virt-make-fs.pl:219
27602 msgid "B<--format=E<lt>fmtE<gt>>"
27606 #: ../tools/virt-make-fs.pl:221
27607 msgid "B<-F E<lt>fmtE<gt>>"
27611 #: ../tools/virt-make-fs.pl:223
27612 msgid "Choose the output disk image format."
27616 #: ../tools/virt-make-fs.pl:225
27617 msgid "The default is C<raw> (raw disk image)."
27621 #: ../tools/virt-make-fs.pl:227
27623 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
27624 "that would really make sense here is C<qcow2>."
27628 #: ../tools/virt-make-fs.pl:234
27629 msgid "B<--type=E<lt>fsE<gt>>"
27633 #: ../tools/virt-make-fs.pl:236
27634 msgid "B<-t E<lt>fsE<gt>>"
27638 #: ../tools/virt-make-fs.pl:238
27639 msgid "Choose the output filesystem type."
27643 #: ../tools/virt-make-fs.pl:240
27644 msgid "The default is C<ext2>."
27648 #: ../tools/virt-make-fs.pl:242
27650 "Any filesystem which is supported read-write by libguestfs can be used here."
27654 #: ../tools/virt-make-fs.pl:249
27655 msgid "B<--partition>"
27659 #: ../tools/virt-make-fs.pl:251
27660 msgid "B<--partition=E<lt>parttypeE<gt>>"
27664 #: ../tools/virt-make-fs.pl:253
27666 "If specified, this flag adds an MBR partition table to the output disk image."
27670 #: ../tools/virt-make-fs.pl:256
27672 "You can change the partition table type, eg. C<--partition=gpt> for large "
27677 #: ../tools/virt-make-fs.pl:259
27679 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
27680 "might consider the next parameter to be the partition type. For example:"
27684 #: ../tools/virt-make-fs.pl:263
27687 " virt-make-fs --partition input.tar ...\n"
27692 #: ../tools/virt-make-fs.pl:265
27694 "would cause virt-make-fs to think you wanted to use a partition type of "
27695 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
27696 "dash) between options and the input file argument:"
27700 #: ../tools/virt-make-fs.pl:269
27703 " virt-make-fs --partition -- input.tar ...\n"
27708 #: ../tools/virt-make-fs.pl:536
27710 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
27711 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
27712 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
27716 #: ../tools/virt-make-fs.pl:553
27719 " export LIBGUESTFS_DEBUG=1\n"
27720 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
27725 #: ../tools/virt-make-fs.pl:556
27727 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
27732 #: ../tools/virt-list-partitions.pl:32
27734 "virt-list-partitions - List partitions in a virtual machine or disk image"
27738 #: ../tools/virt-list-partitions.pl:36
27741 " virt-list-partitions [--options] domname\n"
27746 #: ../tools/virt-list-partitions.pl:38
27749 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
27754 #: ../tools/virt-list-partitions.pl:42
27756 "C<virt-list-partitions> is a command line tool to list the partitions that "
27757 "are contained in a virtual machine or disk image. It is mainly useful as a "
27758 "first step to using L<virt-resize(1)>."
27762 #: ../tools/virt-list-partitions.pl:47
27764 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
27765 "functionality. For more complex cases you should look at the L<guestfish(1)"
27770 #: ../tools/virt-list-partitions.pl:104
27771 msgid "B<-h> | B<--human-readable>"
27775 #: ../tools/virt-list-partitions.pl:106
27776 msgid "Show sizes in human-readable form (eg. \"1G\")."
27780 #: ../tools/virt-list-partitions.pl:114
27782 "With this option, C<virt-list-partitions> displays the type and size of each "
27783 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
27787 #: ../tools/virt-list-partitions.pl:121
27788 msgid "B<-t> | B<--total>"
27792 #: ../tools/virt-list-partitions.pl:123
27794 "Display the total size of each block device (as a separate row or rows)."
27798 #: ../tools/virt-list-partitions.pl:256
27800 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
27801 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
27802 "libguestfs.org/>."