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-28 18:08+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:370 ../inspector/virt-inspector.pl:374
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:357 ../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:366
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:380 ../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:2525 ../src/guestfs-actions.pod:2537
3898 #: ../src/guestfs-actions.pod:2554 ../src/guestfs-actions.pod:2662
3899 #: ../src/guestfs-actions.pod:2673 ../src/guestfs-actions.pod:2683
3900 #: ../src/guestfs-actions.pod:2694 ../src/guestfs-actions.pod:2706
3901 #: ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:2800
3902 #: ../src/guestfs-actions.pod:2817 ../src/guestfs-actions.pod:2831
3903 #: ../src/guestfs-actions.pod:2851 ../src/guestfs-actions.pod:2871
3904 #: ../src/guestfs-actions.pod:2900 ../src/guestfs-actions.pod:2916
3905 #: ../src/guestfs-actions.pod:2932 ../src/guestfs-actions.pod:2961
3906 #: ../src/guestfs-actions.pod:2970 ../src/guestfs-actions.pod:3003
3907 #: ../src/guestfs-actions.pod:3016 ../src/guestfs-actions.pod:3026
3908 #: ../src/guestfs-actions.pod:3038 ../src/guestfs-actions.pod:3052
3909 #: ../src/guestfs-actions.pod:3132 ../src/guestfs-actions.pod:3149
3910 #: ../src/guestfs-actions.pod:3159 ../src/guestfs-actions.pod:3204
3911 #: ../src/guestfs-actions.pod:3219 ../src/guestfs-actions.pod:3234
3912 #: ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3258
3913 #: ../src/guestfs-actions.pod:3269 ../src/guestfs-actions.pod:3283
3914 #: ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3312
3915 #: ../src/guestfs-actions.pod:3358 ../src/guestfs-actions.pod:3386
3916 #: ../src/guestfs-actions.pod:3402 ../src/guestfs-actions.pod:3418
3917 #: ../src/guestfs-actions.pod:3427 ../src/guestfs-actions.pod:3441
3918 #: ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3463
3919 #: ../src/guestfs-actions.pod:3475 ../src/guestfs-actions.pod:3507
3920 #: ../src/guestfs-actions.pod:3519 ../src/guestfs-actions.pod:3536
3921 #: ../src/guestfs-actions.pod:3547 ../src/guestfs-actions.pod:3561
3922 #: ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3632
3923 #: ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:3668
3924 #: ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3697
3925 #: ../src/guestfs-actions.pod:3819 ../src/guestfs-actions.pod:3871
3926 #: ../src/guestfs-actions.pod:3890 ../src/guestfs-actions.pod:3905
3927 #: ../src/guestfs-actions.pod:3931 ../src/guestfs-actions.pod:3988
3928 #: ../src/guestfs-actions.pod:4002 ../src/guestfs-actions.pod:4012
3929 #: ../src/guestfs-actions.pod:4023 ../src/guestfs-actions.pod:4278
3930 #: ../src/guestfs-actions.pod:4294 ../src/guestfs-actions.pod:4305
3931 #: ../src/guestfs-actions.pod:4314 ../src/guestfs-actions.pod:4325
3932 #: ../src/guestfs-actions.pod:4334 ../src/guestfs-actions.pod:4345
3933 #: ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:4376
3934 #: ../src/guestfs-actions.pod:4392 ../src/guestfs-actions.pod:4408
3935 #: ../src/guestfs-actions.pod:4423 ../src/guestfs-actions.pod:4443
3936 #: ../src/guestfs-actions.pod:4458 ../src/guestfs-actions.pod:4474
3937 #: ../src/guestfs-actions.pod:4492 ../src/guestfs-actions.pod:4508
3938 #: ../src/guestfs-actions.pod:4522 ../src/guestfs-actions.pod:4547
3939 #: ../src/guestfs-actions.pod:4568 ../src/guestfs-actions.pod:4584
3940 #: ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:4617
3941 #: ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4645
3942 #: ../src/guestfs-actions.pod:4679 ../src/guestfs-actions.pod:4699
3943 #: ../src/guestfs-actions.pod:4722 ../src/guestfs-actions.pod:4812
3944 #: ../src/guestfs-actions.pod:4918 ../src/guestfs-actions.pod:4927
3945 #: ../src/guestfs-actions.pod:4937 ../src/guestfs-actions.pod:4947
3946 #: ../src/guestfs-actions.pod:4966 ../src/guestfs-actions.pod:4976
3947 #: ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:4996
3948 #: ../src/guestfs-actions.pod:5008 ../src/guestfs-actions.pod:5058
3949 #: ../src/guestfs-actions.pod:5072 ../src/guestfs-actions.pod:5085
3950 #: ../src/guestfs-actions.pod:5098 ../src/guestfs-actions.pod:5112
3951 #: ../src/guestfs-actions.pod:5122 ../src/guestfs-actions.pod:5139
3952 #: ../src/guestfs-actions.pod:5169 ../src/guestfs-actions.pod:5180
3953 #: ../src/guestfs-actions.pod:5215 ../src/guestfs-actions.pod:5225
3954 #: ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:5266
3955 #: ../src/guestfs-actions.pod:5294 ../src/guestfs-actions.pod:5398
3956 #: ../src/guestfs-actions.pod:5413 ../src/guestfs-actions.pod:5424
3957 #: ../src/guestfs-actions.pod:5470 ../src/guestfs-actions.pod:5480
3958 #: ../src/guestfs-actions.pod:5517 ../src/guestfs-actions.pod:5544
3959 #: ../src/guestfs-actions.pod:5586 ../src/guestfs-actions.pod:5609
3960 #: ../src/guestfs-actions.pod:5666 ../src/guestfs-actions.pod:5682
3961 #: ../src/guestfs-actions.pod:5708
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:5617 ../src/guestfs-actions.pod:5762
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:4333 ../fish/guestfish-actions.pod:4430
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:2213 ../src/guestfs-actions.pod:2231
4362 #: ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3728
4363 #: ../src/guestfs-actions.pod:4082 ../src/guestfs-actions.pod:4105
4364 #: ../src/guestfs-actions.pod:5204 ../src/guestfs-actions.pod:5554
4365 #: ../src/guestfs-actions.pod:5564 ../src/guestfs-actions.pod:5574
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:2165 ../src/guestfs-actions.pod:2281
4402 #: ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2336
4403 #: ../src/guestfs-actions.pod:2651 ../src/guestfs-actions.pod:2948
4404 #: ../src/guestfs-actions.pod:3089 ../src/guestfs-actions.pod:3185
4405 #: ../src/guestfs-actions.pod:3743 ../src/guestfs-actions.pod:3919
4406 #: ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4221
4407 #: ../src/guestfs-actions.pod:4264 ../src/guestfs-actions.pod:4740
4408 #: ../src/guestfs-actions.pod:4753 ../src/guestfs-actions.pod:4767
4409 #: ../src/guestfs-actions.pod:4788 ../src/guestfs-actions.pod:5347
4410 #: ../src/guestfs-actions.pod:5363 ../src/guestfs-actions.pod:5378
4411 #: ../src/guestfs-actions.pod:5526 ../src/guestfs-actions.pod:5756
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:2187 ../src/guestfs-actions.pod:2375
4614 #: ../src/guestfs-actions.pod:2580 ../src/guestfs-actions.pod:2636
4615 #: ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:3066
4616 #: ../src/guestfs-actions.pod:3588 ../src/guestfs-actions.pod:4037
4617 #: ../src/guestfs-actions.pod:4146 ../src/guestfs-actions.pod:4252
4618 #: ../src/guestfs-actions.pod:4801 ../src/guestfs-actions.pod:4850
4619 #: ../src/guestfs-actions.pod:4902 ../src/guestfs-actions.pod:5018
4620 #: ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5439
4621 #: ../src/guestfs-actions.pod:5456 ../src/guestfs-actions.pod:5494
4622 #: ../src/guestfs-actions.pod:5630 ../src/guestfs-actions.pod:5646
4623 #: ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5735
4624 #: ../src/guestfs-actions.pod:5775 ../src/guestfs-actions.pod:5791
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:2389 ../src/guestfs-actions.pod:2400
5009 #: ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2423
5010 #: ../src/guestfs-actions.pod:2436 ../src/guestfs-actions.pod:2448
5011 #: ../src/guestfs-actions.pod:2461 ../src/guestfs-actions.pod:2472
5012 #: ../src/guestfs-actions.pod:2482 ../src/guestfs-actions.pod:2493
5013 #: ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2517
5014 #: ../src/guestfs-actions.pod:3713
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:4136
5263 #: ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:3177
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:3953 ../src/guestfs-actions.pod:3976
5285 #: ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:4107
5286 #: ../src/guestfs-actions.pod:4128 ../src/guestfs-actions.pod:4854
5287 #: ../src/guestfs-actions.pod:4906 ../src/guestfs-actions.pod:5022
5288 #: ../src/guestfs-actions.pod:5043 ../src/guestfs-actions.pod:5588
5289 #: ../src/guestfs-actions.pod:5611 ../src/guestfs-actions.pod:5634
5290 #: ../src/guestfs-actions.pod:5650 ../src/guestfs-actions.pod:5723
5291 #: ../src/guestfs-actions.pod:5739 ../src/guestfs-actions.pod:5779
5292 #: ../src/guestfs-actions.pod:5795 ../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:3047
5300 #: ../fish/guestfish-actions.pod:3062 ../fish/guestfish-actions.pod:3138
5301 #: ../fish/guestfish-actions.pod:3155 ../fish/guestfish-actions.pod:3170
5302 #: ../fish/guestfish-actions.pod:3753 ../fish/guestfish-actions.pod:3799
5303 #: ../fish/guestfish-actions.pod:3884 ../fish/guestfish-actions.pod:3899
5304 #: ../fish/guestfish-actions.pod:4309 ../fish/guestfish-actions.pod:4327
5305 #: ../fish/guestfish-actions.pod:4344 ../fish/guestfish-actions.pod:4354
5306 #: ../fish/guestfish-actions.pod:4402 ../fish/guestfish-actions.pod:4412
5307 #: ../fish/guestfish-actions.pod:4441 ../fish/guestfish-actions.pod:4451
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:3281
5516 #: ../src/guestfs-actions.pod:3384 ../src/guestfs-actions.pod:3400
5517 #: ../src/guestfs-actions.pod:3416 ../fish/guestfish-actions.pod:635
5518 #: ../fish/guestfish-actions.pod:2537 ../fish/guestfish-actions.pod:2622
5519 #: ../fish/guestfish-actions.pod:2632 ../fish/guestfish-actions.pod:2642
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:2550
5546 #: ../fish/guestfish-actions.pod:643 ../fish/guestfish-actions.pod:2015
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:5668
5708 #: ../src/guestfs-actions.pod:5684
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:5236
5950 #: ../fish/guestfish-actions.pod:812 ../fish/guestfish-actions.pod:4057
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:4489 ../src/guestfs-actions.pod:4581
7032 #: ../fish/guestfish-actions.pod:1326 ../fish/guestfish-actions.pod:1377
7033 #: ../fish/guestfish-actions.pod:3464 ../fish/guestfish-actions.pod:3551
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:2398
7198 #: ../src/guestfs-actions.pod:2421 ../src/guestfs-actions.pod:2470
7199 #: ../src/guestfs-actions.pod:2491 ../fish/guestfish-actions.pod:1387
7200 #: ../fish/guestfish-actions.pod:1897 ../fish/guestfish-actions.pod:1915
7201 #: ../fish/guestfish-actions.pod:1953 ../fish/guestfish-actions.pod:1969
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:2565
7319 #: ../src/guestfs-actions.pod:3120
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:5037
7497 #: ../fish/guestfish-actions.pod:1502 ../fish/guestfish-actions.pod:3897
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:3949
7569 #: ../src/guestfs-actions.pod:3972 ../src/guestfs-actions.pod:4124
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:2173 ../src/guestfs-actions.pod:2196
7831 #: ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2238
7832 #: ../src/guestfs-actions.pod:2268 ../src/guestfs-actions.pod:2289
7833 #: ../src/guestfs-actions.pod:2324
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:2163
7855 #: ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:2279
7856 #: ../src/guestfs-actions.pod:2314 ../src/guestfs-actions.pod:2334
7857 #: ../src/guestfs-actions.pod:2371 ../fish/guestfish-actions.pod:1656
7858 #: ../fish/guestfish-actions.pod:1702 ../fish/guestfish-actions.pod:1741
7859 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1827
7860 #: ../fish/guestfish-actions.pod:1843 ../fish/guestfish-actions.pod:1877
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
7895 #: ../src/guestfs-actions.pod:2135 ../fish/guestfish-actions.pod:1674
7896 msgid "Debian or a Debian-derived distro such as Ubuntu."
7900 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1676
7905 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1678
7910 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1680
7911 msgid "\"redhat-based\""
7915 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1682
7916 msgid "Some Red Hat-derived distro."
7920 #: ../src/guestfs-actions.pod:2145 ../fish/guestfish-actions.pod:1684
7925 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1686
7926 msgid "Red Hat Enterprise Linux and some derivatives."
7930 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2301
7931 #: ../fish/guestfish-actions.pod:1688 ../fish/guestfish-actions.pod:1814
7936 #: ../src/guestfs-actions.pod:2151 ../fish/guestfish-actions.pod:1690
7938 "Windows does not have distributions. This string is returned if the OS type "
7943 #: ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:2305
7944 #: ../fish/guestfish-actions.pod:1693 ../fish/guestfish-actions.pod:1818
7949 #: ../src/guestfs-actions.pod:2156 ../fish/guestfish-actions.pod:1695
7950 msgid "The distro could not be determined."
7954 #: ../src/guestfs-actions.pod:2160 ../src/guestfs-actions.pod:2311
7955 #: ../fish/guestfish-actions.pod:1699 ../fish/guestfish-actions.pod:1824
7957 "Future versions of libguestfs may return other strings here. The caller "
7958 "should be prepared to handle any string."
7962 #: ../src/guestfs-actions.pod:2168
7963 msgid "guestfs_inspect_get_filesystems"
7967 #: ../src/guestfs-actions.pod:2170
7970 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7971 "\t\tconst char *root);\n"
7976 #: ../src/guestfs-actions.pod:2176 ../fish/guestfish-actions.pod:1711
7978 "This returns a list of all the filesystems that we think are associated with "
7979 "this operating system. This includes the root filesystem, other ordinary "
7980 "filesystems, and non-mounted devices like swap partitions."
7984 #: ../src/guestfs-actions.pod:2181 ../fish/guestfish-actions.pod:1716
7986 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7987 "to be shared between operating systems."
7991 #: ../src/guestfs-actions.pod:2184
7993 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7994 "C<guestfs_inspect_get_mountpoints>."
7998 #: ../src/guestfs-actions.pod:2191
7999 msgid "guestfs_inspect_get_major_version"
8003 #: ../src/guestfs-actions.pod:2193
8006 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
8007 "\t\tconst char *root);\n"
8012 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1729
8014 "This returns the major version number of the inspected operating system."
8018 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1732
8020 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8021 "popular public names used by the operating system. Notably the operating "
8022 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8023 "1). You can find out the real versions corresponding to releases of Windows "
8024 "by consulting Wikipedia or MSDN."
8028 #: ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2226
8029 #: ../fish/guestfish-actions.pod:1739 ../fish/guestfish-actions.pod:1753
8030 msgid "If the version could not be determined, then C<0> is returned."
8034 #: ../src/guestfs-actions.pod:2215
8035 msgid "guestfs_inspect_get_minor_version"
8039 #: ../src/guestfs-actions.pod:2217
8042 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8043 "\t\tconst char *root);\n"
8048 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1750
8050 "This returns the minor version number of the inspected operating system."
8054 #: ../src/guestfs-actions.pod:2228
8056 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8057 "C<guestfs_inspect_get_major_version>."
8061 #: ../src/guestfs-actions.pod:2233
8062 msgid "guestfs_inspect_get_mountpoints"
8066 #: ../src/guestfs-actions.pod:2235
8069 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
8070 "\t\tconst char *root);\n"
8075 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1765
8077 "This returns a hash of where we think the filesystems associated with this "
8078 "operating system should be mounted. Callers should note that this is at "
8079 "best an educated guess made by reading configuration files such as C</etc/"
8084 #: ../src/guestfs-actions.pod:2246 ../fish/guestfish-actions.pod:1770
8086 "Each element in the returned hashtable has a key which is the path of the "
8087 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8088 "mounted there (eg. C</dev/sda1>)."
8092 #: ../src/guestfs-actions.pod:2251 ../fish/guestfish-actions.pod:1775
8094 "Non-mounted devices such as swap devices are I<not> returned in this list."
8098 #: ../src/guestfs-actions.pod:2254
8100 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8101 "C<guestfs_inspect_get_filesystems>."
8105 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2617
8106 #: ../src/guestfs-actions.pod:3571 ../src/guestfs-actions.pod:5154
8108 "This function returns a NULL-terminated array of strings, or NULL if there "
8109 "was an error. The array of strings will always have length C<2n+1>, where "
8110 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
8111 "caller must free the strings and the array after use>."
8115 #: ../src/guestfs-actions.pod:2263
8116 msgid "guestfs_inspect_get_product_name"
8120 #: ../src/guestfs-actions.pod:2265
8123 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
8124 "\t\tconst char *root);\n"
8129 #: ../src/guestfs-actions.pod:2271 ../fish/guestfish-actions.pod:1788
8131 "This returns the product name of the inspected operating system. The "
8132 "product name is generally some freeform string which can be displayed to the "
8133 "user, but should not be parsed by programs."
8137 #: ../src/guestfs-actions.pod:2276 ../fish/guestfish-actions.pod:1793
8139 "If the product name could not be determined, then the string C<unknown> is "
8144 #: ../src/guestfs-actions.pod:2284
8145 msgid "guestfs_inspect_get_type"
8149 #: ../src/guestfs-actions.pod:2286
8152 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
8153 "\t\tconst char *root);\n"
8158 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1805
8160 "This returns the type of the inspected operating system. Currently defined "
8165 #: ../src/guestfs-actions.pod:2297 ../fish/guestfish-actions.pod:1810
8170 #: ../src/guestfs-actions.pod:2299 ../fish/guestfish-actions.pod:1812
8171 msgid "Any Linux-based operating system."
8175 #: ../src/guestfs-actions.pod:2303 ../fish/guestfish-actions.pod:1816
8176 msgid "Any Microsoft Windows operating system."
8180 #: ../src/guestfs-actions.pod:2307 ../fish/guestfish-actions.pod:1820
8181 msgid "The operating system type could not be determined."
8185 #: ../src/guestfs-actions.pod:2319
8186 msgid "guestfs_inspect_get_windows_systemroot"
8190 #: ../src/guestfs-actions.pod:2321
8193 " char *guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
8194 "\t\tconst char *root);\n"
8199 #: ../src/guestfs-actions.pod:2327 ../fish/guestfish-actions.pod:1836
8201 "This returns the Windows systemroot of the inspected guest. The systemroot "
8202 "is a directory path such as C</WINDOWS>."
8206 #: ../src/guestfs-actions.pod:2330 ../fish/guestfish-actions.pod:1839
8208 "This call assumes that the guest is Windows and that the systemroot could be "
8209 "determined by inspection. If this is not the case then an error is returned."
8213 #: ../src/guestfs-actions.pod:2339
8214 msgid "guestfs_inspect_os"
8218 #: ../src/guestfs-actions.pod:2341
8221 " char **guestfs_inspect_os (guestfs_h *g);\n"
8226 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1849
8228 "This function uses other libguestfs functions and certain heuristics to "
8229 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8230 "for operating systems."
8234 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1853
8235 msgid "The list returned is empty if no operating systems were found."
8239 #: ../src/guestfs-actions.pod:2349 ../fish/guestfish-actions.pod:1855
8241 "If one operating system was found, then this returns a list with a single "
8242 "element, which is the name of the root filesystem of this operating system. "
8243 "It is also possible for this function to return a list containing more than "
8244 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8245 "element being the root filesystem of one of the operating systems."
8249 #: ../src/guestfs-actions.pod:2356
8251 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
8252 "functions in order to query further information about each operating system, "
8253 "such as the name and version."
8257 #: ../src/guestfs-actions.pod:2361
8259 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
8260 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
8261 "the contents. This should be called with no disks currently mounted. The "
8262 "function may also use Augeas, so any existing Augeas handle will be closed."
8266 #: ../src/guestfs-actions.pod:2367 ../fish/guestfish-actions.pod:1873
8268 "This function cannot decrypt encrypted disks. The caller must do that first "
8269 "(supplying the necessary keys) if the disk is encrypted."
8273 #: ../src/guestfs-actions.pod:2373 ../src/guestfs-actions.pod:2578
8274 #: ../src/guestfs-actions.pod:2634
8275 msgid "See also C<guestfs_list_filesystems>."
8279 #: ../src/guestfs-actions.pod:2379
8280 msgid "guestfs_is_blockdev"
8284 #: ../src/guestfs-actions.pod:2381
8287 " int guestfs_is_blockdev (guestfs_h *g,\n"
8288 "\t\tconst char *path);\n"
8293 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1885
8295 "This returns C<true> if and only if there is a block device with the given "
8300 #: ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2410
8301 #: ../src/guestfs-actions.pod:2434 ../src/guestfs-actions.pod:2446
8302 #: ../src/guestfs-actions.pod:2459 ../src/guestfs-actions.pod:2503
8303 #: ../src/guestfs-actions.pod:2515
8304 msgid "See also C<guestfs_stat>."
8308 #: ../src/guestfs-actions.pod:2391
8309 msgid "guestfs_is_busy"
8313 #: ../src/guestfs-actions.pod:2393
8316 " int guestfs_is_busy (guestfs_h *g);\n"
8321 #: ../src/guestfs-actions.pod:2395 ../fish/guestfish-actions.pod:1894
8323 "This returns true iff this handle is busy processing a command (in the "
8328 #: ../src/guestfs-actions.pod:2402
8329 msgid "guestfs_is_chardev"
8333 #: ../src/guestfs-actions.pod:2404
8336 " int guestfs_is_chardev (guestfs_h *g,\n"
8337 "\t\tconst char *path);\n"
8342 #: ../src/guestfs-actions.pod:2407 ../fish/guestfish-actions.pod:1903
8344 "This returns C<true> if and only if there is a character device with the "
8345 "given C<path> name."
8349 #: ../src/guestfs-actions.pod:2414
8350 msgid "guestfs_is_config"
8354 #: ../src/guestfs-actions.pod:2416
8357 " int guestfs_is_config (guestfs_h *g);\n"
8362 #: ../src/guestfs-actions.pod:2418 ../fish/guestfish-actions.pod:1912
8364 "This returns true iff this handle is being configured (in the C<CONFIG> "
8369 #: ../src/guestfs-actions.pod:2425
8370 msgid "guestfs_is_dir"
8374 #: ../src/guestfs-actions.pod:2427
8377 " int guestfs_is_dir (guestfs_h *g,\n"
8378 "\t\tconst char *path);\n"
8383 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1921
8385 "This returns C<true> if and only if there is a directory with the given "
8386 "C<path> name. Note that it returns false for other objects like files."
8390 #: ../src/guestfs-actions.pod:2438
8391 msgid "guestfs_is_fifo"
8395 #: ../src/guestfs-actions.pod:2440
8398 " int guestfs_is_fifo (guestfs_h *g,\n"
8399 "\t\tconst char *path);\n"
8404 #: ../src/guestfs-actions.pod:2443 ../fish/guestfish-actions.pod:1931
8406 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8407 "given C<path> name."
8411 #: ../src/guestfs-actions.pod:2450
8412 msgid "guestfs_is_file"
8416 #: ../src/guestfs-actions.pod:2452
8419 " int guestfs_is_file (guestfs_h *g,\n"
8420 "\t\tconst char *path);\n"
8425 #: ../src/guestfs-actions.pod:2455 ../fish/guestfish-actions.pod:1940
8427 "This returns C<true> if and only if there is a regular file with the given "
8428 "C<path> name. Note that it returns false for other objects like directories."
8432 #: ../src/guestfs-actions.pod:2463
8433 msgid "guestfs_is_launching"
8437 #: ../src/guestfs-actions.pod:2465
8440 " int guestfs_is_launching (guestfs_h *g);\n"
8445 #: ../src/guestfs-actions.pod:2467 ../fish/guestfish-actions.pod:1950
8447 "This returns true iff this handle is launching the subprocess (in the "
8448 "C<LAUNCHING> state)."
8452 #: ../src/guestfs-actions.pod:2474
8453 msgid "guestfs_is_lv"
8457 #: ../src/guestfs-actions.pod:2476
8460 " int guestfs_is_lv (guestfs_h *g,\n"
8461 "\t\tconst char *device);\n"
8466 #: ../src/guestfs-actions.pod:2479 ../fish/guestfish-actions.pod:1959
8468 "This command tests whether C<device> is a logical volume, and returns true "
8469 "iff this is the case."
8473 #: ../src/guestfs-actions.pod:2484
8474 msgid "guestfs_is_ready"
8478 #: ../src/guestfs-actions.pod:2486
8481 " int guestfs_is_ready (guestfs_h *g);\n"
8486 #: ../src/guestfs-actions.pod:2488 ../fish/guestfish-actions.pod:1966
8488 "This returns true iff this handle is ready to accept commands (in the "
8493 #: ../src/guestfs-actions.pod:2495
8494 msgid "guestfs_is_socket"
8498 #: ../src/guestfs-actions.pod:2497
8501 " int guestfs_is_socket (guestfs_h *g,\n"
8502 "\t\tconst char *path);\n"
8507 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1975
8509 "This returns C<true> if and only if there is a Unix domain socket with the "
8510 "given C<path> name."
8514 #: ../src/guestfs-actions.pod:2507
8515 msgid "guestfs_is_symlink"
8519 #: ../src/guestfs-actions.pod:2509
8522 " int guestfs_is_symlink (guestfs_h *g,\n"
8523 "\t\tconst char *path);\n"
8528 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1984
8530 "This returns C<true> if and only if there is a symbolic link with the given "
8535 #: ../src/guestfs-actions.pod:2519
8536 msgid "guestfs_kill_subprocess"
8540 #: ../src/guestfs-actions.pod:2521
8543 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8548 #: ../src/guestfs-actions.pod:2523 ../fish/guestfish-actions.pod:1993
8549 msgid "This kills the qemu subprocess. You should never need to call this."
8553 #: ../src/guestfs-actions.pod:2527
8554 msgid "guestfs_launch"
8558 #: ../src/guestfs-actions.pod:2529
8561 " int guestfs_launch (guestfs_h *g);\n"
8566 #: ../src/guestfs-actions.pod:2531 ../fish/guestfish-actions.pod:2001
8568 "Internally libguestfs is implemented by running a virtual machine using "
8573 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:2004
8575 "You should call this after configuring the handle (eg. adding drives) but "
8576 "before performing any actions."
8580 #: ../src/guestfs-actions.pod:2539
8581 msgid "guestfs_lchown"
8585 #: ../src/guestfs-actions.pod:2541
8588 " int guestfs_lchown (guestfs_h *g,\n"
8591 "\t\tconst char *path);\n"
8596 #: ../src/guestfs-actions.pod:2546
8598 "Change the file owner to C<owner> and group to C<group>. This is like "
8599 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8600 "changed, not the target."
8604 #: ../src/guestfs-actions.pod:2556
8605 msgid "guestfs_lgetxattrs"
8609 #: ../src/guestfs-actions.pod:2558
8612 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8613 "\t\tconst char *path);\n"
8618 #: ../src/guestfs-actions.pod:2561
8620 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8621 "then it returns the extended attributes of the link itself."
8625 #: ../src/guestfs-actions.pod:2570
8626 msgid "guestfs_list_devices"
8630 #: ../src/guestfs-actions.pod:2572
8633 " char **guestfs_list_devices (guestfs_h *g);\n"
8638 #: ../src/guestfs-actions.pod:2574 ../fish/guestfish-actions.pod:2031
8639 msgid "List all the block devices."
8643 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:2033
8644 msgid "The full block device names are returned, eg. C</dev/sda>."
8648 #: ../src/guestfs-actions.pod:2584
8649 msgid "guestfs_list_filesystems"
8653 #: ../src/guestfs-actions.pod:2586
8656 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8661 #: ../src/guestfs-actions.pod:2588 ../fish/guestfish-actions.pod:2041
8663 "This inspection command looks for filesystems on partitions, block devices "
8664 "and logical volumes, returning a list of devices containing filesystems and "
8669 #: ../src/guestfs-actions.pod:2592 ../fish/guestfish-actions.pod:2045
8671 "The return value is a hash, where the keys are the devices containing "
8672 "filesystems, and the values are the filesystem types. For example:"
8676 #: ../src/guestfs-actions.pod:2596 ../fish/guestfish-actions.pod:2049
8679 " \"/dev/sda1\" => \"ntfs\"\n"
8680 " \"/dev/sda2\" => \"ext2\"\n"
8681 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8682 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8687 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:2054
8689 "The value can have the special value \"unknown\", meaning the content of the "
8690 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8694 #: ../src/guestfs-actions.pod:2605
8696 "This command runs other libguestfs commands, which might include "
8697 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8698 "soon after launch and only when nothing is mounted."
8702 #: ../src/guestfs-actions.pod:2609
8704 "Not all of the filesystems returned will be mountable. In particular, swap "
8705 "partitions are returned in the list. Also this command does not check that "
8706 "each filesystem found is valid and mountable, and some filesystems might be "
8707 "mountable but require special options. Filesystems may not all belong to a "
8708 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
8712 #: ../src/guestfs-actions.pod:2623
8713 msgid "guestfs_list_partitions"
8717 #: ../src/guestfs-actions.pod:2625
8720 " char **guestfs_list_partitions (guestfs_h *g);\n"
8725 #: ../src/guestfs-actions.pod:2627 ../fish/guestfish-actions.pod:2074
8726 msgid "List all the partitions detected on all block devices."
8730 #: ../src/guestfs-actions.pod:2629 ../fish/guestfish-actions.pod:2076
8731 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8735 #: ../src/guestfs-actions.pod:2631
8737 "This does not return logical volumes. For that you will need to call "
8742 #: ../src/guestfs-actions.pod:2640
8747 #: ../src/guestfs-actions.pod:2642
8750 " char *guestfs_ll (guestfs_h *g,\n"
8751 "\t\tconst char *directory);\n"
8756 #: ../src/guestfs-actions.pod:2645 ../fish/guestfish-actions.pod:2087
8758 "List the files in C<directory> (relative to the root directory, there is no "
8759 "cwd) in the format of 'ls -la'."
8763 #: ../src/guestfs-actions.pod:2648 ../fish/guestfish-actions.pod:2090
8765 "This command is mostly useful for interactive sessions. It is I<not> "
8766 "intended that you try to parse the output string."
8770 #: ../src/guestfs-actions.pod:2654
8775 #: ../src/guestfs-actions.pod:2656
8778 " int guestfs_ln (guestfs_h *g,\n"
8779 "\t\tconst char *target,\n"
8780 "\t\tconst char *linkname);\n"
8785 #: ../src/guestfs-actions.pod:2660 ../fish/guestfish-actions.pod:2097
8786 msgid "This command creates a hard link using the C<ln> command."
8790 #: ../src/guestfs-actions.pod:2664
8791 msgid "guestfs_ln_f"
8795 #: ../src/guestfs-actions.pod:2666
8798 " int guestfs_ln_f (guestfs_h *g,\n"
8799 "\t\tconst char *target,\n"
8800 "\t\tconst char *linkname);\n"
8805 #: ../src/guestfs-actions.pod:2670 ../fish/guestfish-actions.pod:2103
8807 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8808 "option removes the link (C<linkname>) if it exists already."
8812 #: ../src/guestfs-actions.pod:2675
8813 msgid "guestfs_ln_s"
8817 #: ../src/guestfs-actions.pod:2677
8820 " int guestfs_ln_s (guestfs_h *g,\n"
8821 "\t\tconst char *target,\n"
8822 "\t\tconst char *linkname);\n"
8827 #: ../src/guestfs-actions.pod:2681 ../fish/guestfish-actions.pod:2110
8828 msgid "This command creates a symbolic link using the C<ln -s> command."
8832 #: ../src/guestfs-actions.pod:2685
8833 msgid "guestfs_ln_sf"
8837 #: ../src/guestfs-actions.pod:2687
8840 " int guestfs_ln_sf (guestfs_h *g,\n"
8841 "\t\tconst char *target,\n"
8842 "\t\tconst char *linkname);\n"
8847 #: ../src/guestfs-actions.pod:2691 ../fish/guestfish-actions.pod:2116
8849 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8850 "option removes the link (C<linkname>) if it exists already."
8854 #: ../src/guestfs-actions.pod:2696
8855 msgid "guestfs_lremovexattr"
8859 #: ../src/guestfs-actions.pod:2698
8862 " int guestfs_lremovexattr (guestfs_h *g,\n"
8863 "\t\tconst char *xattr,\n"
8864 "\t\tconst char *path);\n"
8869 #: ../src/guestfs-actions.pod:2702
8871 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8872 "link, then it removes an extended attribute of the link itself."
8876 #: ../src/guestfs-actions.pod:2708
8881 #: ../src/guestfs-actions.pod:2710
8884 " char **guestfs_ls (guestfs_h *g,\n"
8885 "\t\tconst char *directory);\n"
8890 #: ../src/guestfs-actions.pod:2713 ../fish/guestfish-actions.pod:2131
8892 "List the files in C<directory> (relative to the root directory, there is no "
8893 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
8897 #: ../src/guestfs-actions.pod:2717
8899 "This command is mostly useful for interactive sessions. Programs should "
8900 "probably use C<guestfs_readdir> instead."
8904 #: ../src/guestfs-actions.pod:2724
8905 msgid "guestfs_lsetxattr"
8909 #: ../src/guestfs-actions.pod:2726
8912 " int guestfs_lsetxattr (guestfs_h *g,\n"
8913 "\t\tconst char *xattr,\n"
8914 "\t\tconst char *val,\n"
8916 "\t\tconst char *path);\n"
8921 #: ../src/guestfs-actions.pod:2732
8923 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8924 "then it sets an extended attribute of the link itself."
8928 #: ../src/guestfs-actions.pod:2738
8929 msgid "guestfs_lstat"
8933 #: ../src/guestfs-actions.pod:2740
8936 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8937 "\t\tconst char *path);\n"
8942 #: ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:4819
8943 #: ../fish/guestfish-actions.pod:2150 ../fish/guestfish-actions.pod:3732
8944 msgid "Returns file information for the given C<path>."
8948 #: ../src/guestfs-actions.pod:2745
8950 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8951 "link, then the link is stat-ed, not the file it refers to."
8955 #: ../src/guestfs-actions.pod:2749 ../fish/guestfish-actions.pod:2156
8956 msgid "This is the same as the C<lstat(2)> system call."
8960 #: ../src/guestfs-actions.pod:2751 ../src/guestfs-actions.pod:4823
8962 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8963 "error. I<The caller must call C<guestfs_free_stat> after use>."
8967 #: ../src/guestfs-actions.pod:2755
8968 msgid "guestfs_lstatlist"
8972 #: ../src/guestfs-actions.pod:2757
8975 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8976 "\t\tconst char *path,\n"
8977 "\t\tchar *const *names);\n"
8982 #: ../src/guestfs-actions.pod:2761
8984 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8985 "files, where all files are in the directory C<path>. C<names> is the list "
8986 "of files from this directory."
8990 #: ../src/guestfs-actions.pod:2765 ../fish/guestfish-actions.pod:2166
8992 "On return you get a list of stat structs, with a one-to-one correspondence "
8993 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8994 "then the C<ino> field of that structure is set to C<-1>."
8998 #: ../src/guestfs-actions.pod:2770
9000 "This call is intended for programs that want to efficiently list a directory "
9001 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
9002 "for a similarly efficient call for getting extended attributes. Very long "
9003 "directory listings might cause the protocol message size to be exceeded, "
9004 "causing this call to fail. The caller must split up such requests into "
9005 "smaller groups of names."
9009 #: ../src/guestfs-actions.pod:2778
9011 "This function returns a C<struct guestfs_stat_list *> (see E<lt>guestfs-"
9012 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9013 "C<guestfs_free_stat_list> after use>."
9017 #: ../src/guestfs-actions.pod:2783
9018 msgid "guestfs_luks_add_key"
9022 #: ../src/guestfs-actions.pod:2785
9025 " int guestfs_luks_add_key (guestfs_h *g,\n"
9026 "\t\tconst char *device,\n"
9027 "\t\tconst char *key,\n"
9028 "\t\tconst char *newkey,\n"
9029 "\t\tint keyslot);\n"
9034 #: ../src/guestfs-actions.pod:2791 ../fish/guestfish-actions.pod:2183
9036 "This command adds a new key on LUKS device C<device>. C<key> is any "
9037 "existing key, and is used to access the device. C<newkey> is the new key to "
9038 "add. C<keyslot> is the key slot that will be replaced."
9042 #: ../src/guestfs-actions.pod:2796
9044 "Note that if C<keyslot> already contains a key, then this command will "
9045 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
9049 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2836
9050 #: ../src/guestfs-actions.pod:2856 ../src/guestfs-actions.pod:2873
9051 #: ../src/guestfs-actions.pod:2902 ../src/guestfs-actions.pod:2918
9053 "This function takes a key or passphrase parameter which could contain "
9054 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
9059 #: ../src/guestfs-actions.pod:2806
9060 msgid "guestfs_luks_close"
9064 #: ../src/guestfs-actions.pod:2808
9067 " int guestfs_luks_close (guestfs_h *g,\n"
9068 "\t\tconst char *device);\n"
9073 #: ../src/guestfs-actions.pod:2811
9075 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
9076 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
9077 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9078 "underlying block device."
9082 #: ../src/guestfs-actions.pod:2819
9083 msgid "guestfs_luks_format"
9087 #: ../src/guestfs-actions.pod:2821
9090 " int guestfs_luks_format (guestfs_h *g,\n"
9091 "\t\tconst char *device,\n"
9092 "\t\tconst char *key,\n"
9093 "\t\tint keyslot);\n"
9098 #: ../src/guestfs-actions.pod:2826 ../fish/guestfish-actions.pod:2209
9100 "This command erases existing data on C<device> and formats the device as a "
9101 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9102 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9106 #: ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2853
9107 #: ../src/guestfs-actions.pod:2972 ../src/guestfs-actions.pod:3699
9108 #: ../src/guestfs-actions.pod:4360 ../src/guestfs-actions.pod:4681
9109 #: ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4724
9110 #: ../src/guestfs-actions.pod:5689 ../fish/guestfish-actions.pod:2217
9111 #: ../fish/guestfish-actions.pod:2230 ../fish/guestfish-actions.pod:2314
9112 #: ../fish/guestfish-actions.pod:2844 ../fish/guestfish-actions.pod:3351
9113 #: ../fish/guestfish-actions.pod:3631 ../fish/guestfish-actions.pod:3647
9114 #: ../fish/guestfish-actions.pod:3662 ../fish/guestfish-actions.pod:4377
9116 "B<This command is dangerous. Without careful use you can easily destroy all "
9121 #: ../src/guestfs-actions.pod:2840
9122 msgid "guestfs_luks_format_cipher"
9126 #: ../src/guestfs-actions.pod:2842
9129 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
9130 "\t\tconst char *device,\n"
9131 "\t\tconst char *key,\n"
9132 "\t\tint keyslot,\n"
9133 "\t\tconst char *cipher);\n"
9138 #: ../src/guestfs-actions.pod:2848
9140 "This command is the same as C<guestfs_luks_format> but it also allows you to "
9141 "set the C<cipher> used."
9145 #: ../src/guestfs-actions.pod:2860
9146 msgid "guestfs_luks_kill_slot"
9150 #: ../src/guestfs-actions.pod:2862
9153 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
9154 "\t\tconst char *device,\n"
9155 "\t\tconst char *key,\n"
9156 "\t\tint keyslot);\n"
9161 #: ../src/guestfs-actions.pod:2867 ../fish/guestfish-actions.pod:2237
9163 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9164 "device C<device>. C<key> must be one of the I<other> keys."
9168 #: ../src/guestfs-actions.pod:2877
9169 msgid "guestfs_luks_open"
9173 #: ../src/guestfs-actions.pod:2879
9176 " int guestfs_luks_open (guestfs_h *g,\n"
9177 "\t\tconst char *device,\n"
9178 "\t\tconst char *key,\n"
9179 "\t\tconst char *mapname);\n"
9184 #: ../src/guestfs-actions.pod:2884 ../fish/guestfish-actions.pod:2248
9186 "This command opens a block device which has been encrypted according to the "
9187 "Linux Unified Key Setup (LUKS) standard."
9191 #: ../src/guestfs-actions.pod:2887 ../fish/guestfish-actions.pod:2251
9192 msgid "C<device> is the encrypted block device or partition."
9196 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:2253
9198 "The caller must supply one of the keys associated with the LUKS block "
9199 "device, in the C<key> parameter."
9203 #: ../src/guestfs-actions.pod:2892 ../fish/guestfish-actions.pod:2256
9205 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9206 "writes to this block device are decrypted from and encrypted to the "
9207 "underlying C<device> respectively."
9211 #: ../src/guestfs-actions.pod:2896
9213 "If this block device contains LVM volume groups, then calling "
9214 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
9219 #: ../src/guestfs-actions.pod:2906
9220 msgid "guestfs_luks_open_ro"
9224 #: ../src/guestfs-actions.pod:2908
9227 " int guestfs_luks_open_ro (guestfs_h *g,\n"
9228 "\t\tconst char *device,\n"
9229 "\t\tconst char *key,\n"
9230 "\t\tconst char *mapname);\n"
9235 #: ../src/guestfs-actions.pod:2913
9237 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
9242 #: ../src/guestfs-actions.pod:2922
9243 msgid "guestfs_lvcreate"
9247 #: ../src/guestfs-actions.pod:2924
9250 " int guestfs_lvcreate (guestfs_h *g,\n"
9251 "\t\tconst char *logvol,\n"
9252 "\t\tconst char *volgroup,\n"
9253 "\t\tint mbytes);\n"
9258 #: ../src/guestfs-actions.pod:2929 ../fish/guestfish-actions.pod:2281
9260 "This creates an LVM logical volume called C<logvol> on the volume group "
9261 "C<volgroup>, with C<size> megabytes."
9265 #: ../src/guestfs-actions.pod:2934
9266 msgid "guestfs_lvm_canonical_lv_name"
9270 #: ../src/guestfs-actions.pod:2936
9273 " char *guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
9274 "\t\tconst char *lvname);\n"
9279 #: ../src/guestfs-actions.pod:2939 ../fish/guestfish-actions.pod:2288
9281 "This converts alternative naming schemes for LVs that you might find to the "
9282 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
9287 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2292
9289 "This command returns an error if the C<lvname> parameter does not refer to a "
9294 #: ../src/guestfs-actions.pod:2946
9295 msgid "See also C<guestfs_is_lv>."
9299 #: ../src/guestfs-actions.pod:2951
9300 msgid "guestfs_lvm_clear_filter"
9304 #: ../src/guestfs-actions.pod:2953
9307 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
9312 #: ../src/guestfs-actions.pod:2955
9314 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
9315 "see every block device."
9319 #: ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:2994
9320 #: ../fish/guestfish-actions.pod:2304 ../fish/guestfish-actions.pod:2335
9322 "This command also clears the LVM cache and performs a volume group scan."
9326 #: ../src/guestfs-actions.pod:2963
9327 msgid "guestfs_lvm_remove_all"
9331 #: ../src/guestfs-actions.pod:2965
9334 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
9339 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2311
9341 "This command removes all LVM logical volumes, volume groups and physical "
9346 #: ../src/guestfs-actions.pod:2975
9347 msgid "guestfs_lvm_set_filter"
9351 #: ../src/guestfs-actions.pod:2977
9354 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
9355 "\t\tchar *const *devices);\n"
9360 #: ../src/guestfs-actions.pod:2980 ../fish/guestfish-actions.pod:2321
9362 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9363 "block devices in the list C<devices>, and will ignore all other attached "
9368 #: ../src/guestfs-actions.pod:2984 ../fish/guestfish-actions.pod:2325
9370 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9371 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9372 "there are two types of duplication possible: either cloned PVs/VGs which "
9373 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9374 "same name. In normal operation you cannot create this situation, but you "
9375 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9376 "inside the LVM metadata."
9380 #: ../src/guestfs-actions.pod:2997 ../fish/guestfish-actions.pod:2338
9381 msgid "You can filter whole block devices or individual partitions."
9385 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2340
9387 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9388 "filesystem), even if you are not filtering out that VG."
9392 #: ../src/guestfs-actions.pod:3005
9393 msgid "guestfs_lvremove"
9397 #: ../src/guestfs-actions.pod:3007
9400 " int guestfs_lvremove (guestfs_h *g,\n"
9401 "\t\tconst char *device);\n"
9406 #: ../src/guestfs-actions.pod:3010 ../fish/guestfish-actions.pod:2348
9408 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9409 "LV, such as C</dev/VG/LV>."
9413 #: ../src/guestfs-actions.pod:3013 ../fish/guestfish-actions.pod:2351
9415 "You can also remove all LVs in a volume group by specifying the VG name, C</"
9420 #: ../src/guestfs-actions.pod:3018
9421 msgid "guestfs_lvrename"
9425 #: ../src/guestfs-actions.pod:3020
9428 " int guestfs_lvrename (guestfs_h *g,\n"
9429 "\t\tconst char *logvol,\n"
9430 "\t\tconst char *newlogvol);\n"
9435 #: ../src/guestfs-actions.pod:3024 ../fish/guestfish-actions.pod:2358
9436 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9440 #: ../src/guestfs-actions.pod:3028
9441 msgid "guestfs_lvresize"
9445 #: ../src/guestfs-actions.pod:3030
9448 " int guestfs_lvresize (guestfs_h *g,\n"
9449 "\t\tconst char *device,\n"
9450 "\t\tint mbytes);\n"
9455 #: ../src/guestfs-actions.pod:3034 ../fish/guestfish-actions.pod:2364
9457 "This resizes (expands or shrinks) an existing LVM logical volume to "
9458 "C<mbytes>. When reducing, data in the reduced part is lost."
9462 #: ../src/guestfs-actions.pod:3040
9463 msgid "guestfs_lvresize_free"
9467 #: ../src/guestfs-actions.pod:3042
9470 " int guestfs_lvresize_free (guestfs_h *g,\n"
9471 "\t\tconst char *lv,\n"
9472 "\t\tint percent);\n"
9477 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2372
9479 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9480 "remaining free space in the volume group. Commonly you would call this with "
9481 "pc = 100 which expands the logical volume as much as possible, using all "
9482 "remaining free space in the volume group."
9486 #: ../src/guestfs-actions.pod:3054
9491 #: ../src/guestfs-actions.pod:3056
9494 " char **guestfs_lvs (guestfs_h *g);\n"
9499 #: ../src/guestfs-actions.pod:3058 ../fish/guestfish-actions.pod:2382
9501 "List all the logical volumes detected. This is the equivalent of the L<lvs"
9506 #: ../src/guestfs-actions.pod:3061 ../fish/guestfish-actions.pod:2385
9508 "This returns a list of the logical volume device names (eg. C</dev/"
9509 "VolGroup00/LogVol00>)."
9513 #: ../src/guestfs-actions.pod:3064
9514 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
9518 #: ../src/guestfs-actions.pod:3070
9519 msgid "guestfs_lvs_full"
9523 #: ../src/guestfs-actions.pod:3072
9526 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
9531 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2394
9533 "List all the logical volumes detected. This is the equivalent of the L<lvs"
9534 "(8)> command. The \"full\" version includes all fields."
9538 #: ../src/guestfs-actions.pod:3077
9540 "This function returns a C<struct guestfs_lvm_lv_list *> (see E<lt>guestfs-"
9541 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
9542 "C<guestfs_free_lvm_lv_list> after use>."
9546 #: ../src/guestfs-actions.pod:3082
9547 msgid "guestfs_lvuuid"
9551 #: ../src/guestfs-actions.pod:3084
9554 " char *guestfs_lvuuid (guestfs_h *g,\n"
9555 "\t\tconst char *device);\n"
9560 #: ../src/guestfs-actions.pod:3087 ../fish/guestfish-actions.pod:2401
9561 msgid "This command returns the UUID of the LVM LV C<device>."
9565 #: ../src/guestfs-actions.pod:3092
9566 msgid "guestfs_lxattrlist"
9570 #: ../src/guestfs-actions.pod:3094
9573 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9574 "\t\tconst char *path,\n"
9575 "\t\tchar *const *names);\n"
9580 #: ../src/guestfs-actions.pod:3098 ../fish/guestfish-actions.pod:2407
9582 "This call allows you to get the extended attributes of multiple files, where "
9583 "all files are in the directory C<path>. C<names> is the list of files from "
9588 #: ../src/guestfs-actions.pod:3102 ../fish/guestfish-actions.pod:2411
9590 "On return you get a flat list of xattr structs which must be interpreted "
9591 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9592 "C<attrval> in this struct is zero-length to indicate there was an error "
9593 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9594 "number (the number of following attributes for this file, which could be C<"
9595 "\"0\">). Then after the first xattr struct are the zero or more attributes "
9596 "for the first named file. This repeats for the second and subsequent files."
9600 #: ../src/guestfs-actions.pod:3112
9602 "This call is intended for programs that want to efficiently list a directory "
9603 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9604 "a similarly efficient call for getting standard stats. Very long directory "
9605 "listings might cause the protocol message size to be exceeded, causing this "
9606 "call to fail. The caller must split up such requests into smaller groups of "
9611 #: ../src/guestfs-actions.pod:3125
9612 msgid "guestfs_mkdir"
9616 #: ../src/guestfs-actions.pod:3127
9619 " int guestfs_mkdir (guestfs_h *g,\n"
9620 "\t\tconst char *path);\n"
9625 #: ../src/guestfs-actions.pod:3130 ../fish/guestfish-actions.pod:2433
9626 msgid "Create a directory named C<path>."
9630 #: ../src/guestfs-actions.pod:3134
9631 msgid "guestfs_mkdir_mode"
9635 #: ../src/guestfs-actions.pod:3136
9638 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9639 "\t\tconst char *path,\n"
9645 #: ../src/guestfs-actions.pod:3140 ../fish/guestfish-actions.pod:2439
9647 "This command creates a directory, setting the initial permissions of the "
9648 "directory to C<mode>."
9652 #: ../src/guestfs-actions.pod:3143 ../fish/guestfish-actions.pod:2442
9654 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9655 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9660 #: ../src/guestfs-actions.pod:3147
9661 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9665 #: ../src/guestfs-actions.pod:3151
9666 msgid "guestfs_mkdir_p"
9670 #: ../src/guestfs-actions.pod:3153
9673 " int guestfs_mkdir_p (guestfs_h *g,\n"
9674 "\t\tconst char *path);\n"
9679 #: ../src/guestfs-actions.pod:3156 ../fish/guestfish-actions.pod:2452
9681 "Create a directory named C<path>, creating any parent directories as "
9682 "necessary. This is like the C<mkdir -p> shell command."
9686 #: ../src/guestfs-actions.pod:3161
9687 msgid "guestfs_mkdtemp"
9691 #: ../src/guestfs-actions.pod:3163
9694 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9695 "\t\tconst char *template);\n"
9700 #: ../src/guestfs-actions.pod:3166 ../fish/guestfish-actions.pod:2459
9702 "This command creates a temporary directory. The C<template> parameter "
9703 "should be a full pathname for the temporary directory name with the final "
9704 "six characters being \"XXXXXX\"."
9708 #: ../src/guestfs-actions.pod:3171 ../fish/guestfish-actions.pod:2464
9710 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9711 "being suitable for Windows filesystems."
9715 #: ../src/guestfs-actions.pod:3174 ../fish/guestfish-actions.pod:2467
9716 msgid "The name of the temporary directory that was created is returned."
9720 #: ../src/guestfs-actions.pod:3177 ../fish/guestfish-actions.pod:2470
9721 msgid "The temporary directory is created with mode 0700 and is owned by root."
9725 #: ../src/guestfs-actions.pod:3180 ../fish/guestfish-actions.pod:2473
9727 "The caller is responsible for deleting the temporary directory and its "
9728 "contents after use."
9732 #: ../src/guestfs-actions.pod:3183 ../fish/guestfish-actions.pod:2476
9733 msgid "See also: L<mkdtemp(3)>"
9737 #: ../src/guestfs-actions.pod:3188
9738 msgid "guestfs_mke2fs_J"
9742 #: ../src/guestfs-actions.pod:3190
9745 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9746 "\t\tconst char *fstype,\n"
9747 "\t\tint blocksize,\n"
9748 "\t\tconst char *device,\n"
9749 "\t\tconst char *journal);\n"
9754 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2482
9756 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9757 "C<journal>. It is equivalent to the command:"
9761 #: ../src/guestfs-actions.pod:3200 ../fish/guestfish-actions.pod:2486
9764 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9769 #: ../src/guestfs-actions.pod:3202
9770 msgid "See also C<guestfs_mke2journal>."
9774 #: ../src/guestfs-actions.pod:3206
9775 msgid "guestfs_mke2fs_JL"
9779 #: ../src/guestfs-actions.pod:3208
9782 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9783 "\t\tconst char *fstype,\n"
9784 "\t\tint blocksize,\n"
9785 "\t\tconst char *device,\n"
9786 "\t\tconst char *label);\n"
9791 #: ../src/guestfs-actions.pod:3214 ../fish/guestfish-actions.pod:2494
9793 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9794 "the journal labeled C<label>."
9798 #: ../src/guestfs-actions.pod:3217
9799 msgid "See also C<guestfs_mke2journal_L>."
9803 #: ../src/guestfs-actions.pod:3221
9804 msgid "guestfs_mke2fs_JU"
9808 #: ../src/guestfs-actions.pod:3223
9811 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9812 "\t\tconst char *fstype,\n"
9813 "\t\tint blocksize,\n"
9814 "\t\tconst char *device,\n"
9815 "\t\tconst char *uuid);\n"
9820 #: ../src/guestfs-actions.pod:3229 ../fish/guestfish-actions.pod:2503
9822 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9823 "the journal with UUID C<uuid>."
9827 #: ../src/guestfs-actions.pod:3232
9828 msgid "See also C<guestfs_mke2journal_U>."
9832 #: ../src/guestfs-actions.pod:3236
9833 msgid "guestfs_mke2journal"
9837 #: ../src/guestfs-actions.pod:3238
9840 " int guestfs_mke2journal (guestfs_h *g,\n"
9841 "\t\tint blocksize,\n"
9842 "\t\tconst char *device);\n"
9847 #: ../src/guestfs-actions.pod:3242 ../fish/guestfish-actions.pod:2512
9849 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9854 #: ../src/guestfs-actions.pod:3245 ../fish/guestfish-actions.pod:2515
9857 " mke2fs -O journal_dev -b blocksize device\n"
9862 #: ../src/guestfs-actions.pod:3249
9863 msgid "guestfs_mke2journal_L"
9867 #: ../src/guestfs-actions.pod:3251
9870 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9871 "\t\tint blocksize,\n"
9872 "\t\tconst char *label,\n"
9873 "\t\tconst char *device);\n"
9878 #: ../src/guestfs-actions.pod:3256 ../fish/guestfish-actions.pod:2521
9879 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9883 #: ../src/guestfs-actions.pod:3260
9884 msgid "guestfs_mke2journal_U"
9888 #: ../src/guestfs-actions.pod:3262
9891 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9892 "\t\tint blocksize,\n"
9893 "\t\tconst char *uuid,\n"
9894 "\t\tconst char *device);\n"
9899 #: ../src/guestfs-actions.pod:3267 ../fish/guestfish-actions.pod:2527
9900 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9904 #: ../src/guestfs-actions.pod:3271
9905 msgid "guestfs_mkfifo"
9909 #: ../src/guestfs-actions.pod:3273
9912 " int guestfs_mkfifo (guestfs_h *g,\n"
9914 "\t\tconst char *path);\n"
9919 #: ../src/guestfs-actions.pod:3277
9921 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9922 "is just a convenient wrapper around C<guestfs_mknod>."
9926 #: ../src/guestfs-actions.pod:3285
9927 msgid "guestfs_mkfs"
9931 #: ../src/guestfs-actions.pod:3287
9934 " int guestfs_mkfs (guestfs_h *g,\n"
9935 "\t\tconst char *fstype,\n"
9936 "\t\tconst char *device);\n"
9941 #: ../src/guestfs-actions.pod:3291 ../fish/guestfish-actions.pod:2543
9943 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9944 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9948 #: ../src/guestfs-actions.pod:3297
9949 msgid "guestfs_mkfs_b"
9953 #: ../src/guestfs-actions.pod:3299
9956 " int guestfs_mkfs_b (guestfs_h *g,\n"
9957 "\t\tconst char *fstype,\n"
9958 "\t\tint blocksize,\n"
9959 "\t\tconst char *device);\n"
9964 #: ../src/guestfs-actions.pod:3304
9966 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9967 "block size of the resulting filesystem. Supported block sizes depend on the "
9968 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9972 #: ../src/guestfs-actions.pod:3309 ../fish/guestfish-actions.pod:2556
9974 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9979 #: ../src/guestfs-actions.pod:3314
9980 msgid "guestfs_mkmountpoint"
9984 #: ../src/guestfs-actions.pod:3316
9987 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9988 "\t\tconst char *exemptpath);\n"
9993 #: ../src/guestfs-actions.pod:3319
9995 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9996 "that can be used to create extra mountpoints before mounting the first "
10001 #: ../src/guestfs-actions.pod:3323 ../fish/guestfish-actions.pod:2567
10003 "These calls are I<only> necessary in some very limited circumstances, mainly "
10004 "the case where you want to mount a mix of unrelated and/or read-only "
10005 "filesystems together."
10009 #: ../src/guestfs-actions.pod:3327 ../fish/guestfish-actions.pod:2571
10011 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10012 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10013 "inside that. You can unpack this as follows in guestfish:"
10017 #: ../src/guestfs-actions.pod:3332 ../fish/guestfish-actions.pod:2576
10020 " add-ro Fedora-11-i686-Live.iso\n"
10022 " mkmountpoint /cd\n"
10023 " mkmountpoint /sqsh\n"
10024 " mkmountpoint /ext3fs\n"
10025 " mount /dev/sda /cd\n"
10026 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10027 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10032 #: ../src/guestfs-actions.pod:3341 ../fish/guestfish-actions.pod:2585
10033 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10037 #: ../src/guestfs-actions.pod:3343
10039 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
10040 "may get unexpected errors if you try to mix these calls. It is safest to "
10041 "manually unmount filesystems and remove mountpoints after use."
10045 #: ../src/guestfs-actions.pod:3347
10047 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
10048 "first, so for this to work for manual mountpoints, you must ensure that the "
10049 "innermost mountpoints have the longest pathnames, as in the example code "
10054 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2596
10056 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10060 #: ../src/guestfs-actions.pod:3354
10062 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
10063 "means that C<guestfs_umount_all> is called when the handle is closed which "
10064 "can also trigger these issues."
10068 #: ../src/guestfs-actions.pod:3360
10069 msgid "guestfs_mknod"
10073 #: ../src/guestfs-actions.pod:3362
10076 " int guestfs_mknod (guestfs_h *g,\n"
10078 "\t\tint devmajor,\n"
10079 "\t\tint devminor,\n"
10080 "\t\tconst char *path);\n"
10085 #: ../src/guestfs-actions.pod:3368 ../fish/guestfish-actions.pod:2606
10087 "This call creates block or character special devices, or named pipes (FIFOs)."
10091 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2609
10093 "The C<mode> parameter should be the mode, using the standard constants. "
10094 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10095 "used when creating block and character special devices."
10099 #: ../src/guestfs-actions.pod:3376
10101 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10102 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10103 "regular file). These constants are available in the standard Linux header "
10104 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
10105 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
10106 "the appropriate constant for you."
10110 #: ../src/guestfs-actions.pod:3388
10111 msgid "guestfs_mknod_b"
10115 #: ../src/guestfs-actions.pod:3390
10118 " int guestfs_mknod_b (guestfs_h *g,\n"
10120 "\t\tint devmajor,\n"
10121 "\t\tint devminor,\n"
10122 "\t\tconst char *path);\n"
10127 #: ../src/guestfs-actions.pod:3396
10129 "This call creates a block device node called C<path> with mode C<mode> and "
10130 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10131 "wrapper around C<guestfs_mknod>."
10135 #: ../src/guestfs-actions.pod:3404
10136 msgid "guestfs_mknod_c"
10140 #: ../src/guestfs-actions.pod:3406
10143 " int guestfs_mknod_c (guestfs_h *g,\n"
10145 "\t\tint devmajor,\n"
10146 "\t\tint devminor,\n"
10147 "\t\tconst char *path);\n"
10152 #: ../src/guestfs-actions.pod:3412
10154 "This call creates a char device node called C<path> with mode C<mode> and "
10155 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10156 "wrapper around C<guestfs_mknod>."
10160 #: ../src/guestfs-actions.pod:3420
10161 msgid "guestfs_mkswap"
10165 #: ../src/guestfs-actions.pod:3422
10168 " int guestfs_mkswap (guestfs_h *g,\n"
10169 "\t\tconst char *device);\n"
10174 #: ../src/guestfs-actions.pod:3425 ../fish/guestfish-actions.pod:2648
10175 msgid "Create a swap partition on C<device>."
10179 #: ../src/guestfs-actions.pod:3429
10180 msgid "guestfs_mkswap_L"
10184 #: ../src/guestfs-actions.pod:3431
10187 " int guestfs_mkswap_L (guestfs_h *g,\n"
10188 "\t\tconst char *label,\n"
10189 "\t\tconst char *device);\n"
10194 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2654
10195 msgid "Create a swap partition on C<device> with label C<label>."
10199 #: ../src/guestfs-actions.pod:3437 ../fish/guestfish-actions.pod:2656
10201 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
10202 "sda>), just to a partition. This appears to be a limitation of the kernel "
10207 #: ../src/guestfs-actions.pod:3443
10208 msgid "guestfs_mkswap_U"
10212 #: ../src/guestfs-actions.pod:3445
10215 " int guestfs_mkswap_U (guestfs_h *g,\n"
10216 "\t\tconst char *uuid,\n"
10217 "\t\tconst char *device);\n"
10222 #: ../src/guestfs-actions.pod:3449 ../fish/guestfish-actions.pod:2664
10223 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10227 #: ../src/guestfs-actions.pod:3453
10228 msgid "guestfs_mkswap_file"
10232 #: ../src/guestfs-actions.pod:3455
10235 " int guestfs_mkswap_file (guestfs_h *g,\n"
10236 "\t\tconst char *path);\n"
10241 #: ../src/guestfs-actions.pod:3458 ../fish/guestfish-actions.pod:2670
10242 msgid "Create a swap file."
10246 #: ../src/guestfs-actions.pod:3460
10248 "This command just writes a swap file signature to an existing file. To "
10249 "create the file itself, use something like C<guestfs_fallocate>."
10253 #: ../src/guestfs-actions.pod:3465
10254 msgid "guestfs_modprobe"
10258 #: ../src/guestfs-actions.pod:3467
10261 " int guestfs_modprobe (guestfs_h *g,\n"
10262 "\t\tconst char *modulename);\n"
10267 #: ../src/guestfs-actions.pod:3470 ../fish/guestfish-actions.pod:2679
10268 msgid "This loads a kernel module in the appliance."
10272 #: ../src/guestfs-actions.pod:3472 ../fish/guestfish-actions.pod:2681
10274 "The kernel module must have been whitelisted when libguestfs was built (see "
10275 "C<appliance/kmod.whitelist.in> in the source)."
10279 #: ../src/guestfs-actions.pod:3477
10280 msgid "guestfs_mount"
10284 #: ../src/guestfs-actions.pod:3479
10287 " int guestfs_mount (guestfs_h *g,\n"
10288 "\t\tconst char *device,\n"
10289 "\t\tconst char *mountpoint);\n"
10294 #: ../src/guestfs-actions.pod:3483 ../fish/guestfish-actions.pod:2688
10296 "Mount a guest disk at a position in the filesystem. Block devices are named "
10297 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10298 "those block devices contain partitions, they will have the usual names (eg. "
10299 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10303 #: ../src/guestfs-actions.pod:3489 ../fish/guestfish-actions.pod:2694
10305 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10306 "mounted on C</> before others can be mounted. Other filesystems can only be "
10307 "mounted on directories which already exist."
10311 #: ../src/guestfs-actions.pod:3494 ../fish/guestfish-actions.pod:2699
10313 "The mounted filesystem is writable, if we have sufficient permissions on the "
10314 "underlying device."
10318 #: ../src/guestfs-actions.pod:3497
10320 "B<Important note:> When you use this call, the filesystem options C<sync> "
10321 "and C<noatime> are set implicitly. This was originally done because we "
10322 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10323 "very large negative performance impact and negligible effect on "
10324 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
10325 "in any code that needs performance, and instead use C<guestfs_mount_options> "
10326 "(use an empty string for the first parameter if you don't want any options)."
10330 #: ../src/guestfs-actions.pod:3509
10331 msgid "guestfs_mount_loop"
10335 #: ../src/guestfs-actions.pod:3511
10338 " int guestfs_mount_loop (guestfs_h *g,\n"
10339 "\t\tconst char *file,\n"
10340 "\t\tconst char *mountpoint);\n"
10345 #: ../src/guestfs-actions.pod:3515 ../fish/guestfish-actions.pod:2716
10347 "This command lets you mount C<file> (a filesystem image in a file) on a "
10348 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10353 #: ../src/guestfs-actions.pod:3521
10354 msgid "guestfs_mount_options"
10358 #: ../src/guestfs-actions.pod:3523
10361 " int guestfs_mount_options (guestfs_h *g,\n"
10362 "\t\tconst char *options,\n"
10363 "\t\tconst char *device,\n"
10364 "\t\tconst char *mountpoint);\n"
10369 #: ../src/guestfs-actions.pod:3528
10371 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10372 "the mount options as for the L<mount(8)> I<-o> flag."
10376 #: ../src/guestfs-actions.pod:3532 ../fish/guestfish-actions.pod:2728
10378 "If the C<options> parameter is an empty string, then no options are passed "
10379 "(all options default to whatever the filesystem uses)."
10383 #: ../src/guestfs-actions.pod:3538
10384 msgid "guestfs_mount_ro"
10388 #: ../src/guestfs-actions.pod:3540
10391 " int guestfs_mount_ro (guestfs_h *g,\n"
10392 "\t\tconst char *device,\n"
10393 "\t\tconst char *mountpoint);\n"
10398 #: ../src/guestfs-actions.pod:3544
10400 "This is the same as the C<guestfs_mount> command, but it mounts the "
10401 "filesystem with the read-only (I<-o ro>) flag."
10405 #: ../src/guestfs-actions.pod:3549
10406 msgid "guestfs_mount_vfs"
10410 #: ../src/guestfs-actions.pod:3551
10413 " int guestfs_mount_vfs (guestfs_h *g,\n"
10414 "\t\tconst char *options,\n"
10415 "\t\tconst char *vfstype,\n"
10416 "\t\tconst char *device,\n"
10417 "\t\tconst char *mountpoint);\n"
10422 #: ../src/guestfs-actions.pod:3557
10424 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10425 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
10430 #: ../src/guestfs-actions.pod:3563
10431 msgid "guestfs_mountpoints"
10435 #: ../src/guestfs-actions.pod:3565
10438 " char **guestfs_mountpoints (guestfs_h *g);\n"
10443 #: ../src/guestfs-actions.pod:3567
10445 "This call is similar to C<guestfs_mounts>. That call returns a list of "
10446 "devices. This one returns a hash table (map) of device name to directory "
10447 "where the device is mounted."
10451 #: ../src/guestfs-actions.pod:3577
10452 msgid "guestfs_mounts"
10456 #: ../src/guestfs-actions.pod:3579
10459 " char **guestfs_mounts (guestfs_h *g);\n"
10464 #: ../src/guestfs-actions.pod:3581 ../fish/guestfish-actions.pod:2759
10466 "This returns the list of currently mounted filesystems. It returns the list "
10467 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10471 #: ../src/guestfs-actions.pod:3584 ../fish/guestfish-actions.pod:2762
10472 msgid "Some internal mounts are not shown."
10476 #: ../src/guestfs-actions.pod:3586
10477 msgid "See also: C<guestfs_mountpoints>"
10481 #: ../src/guestfs-actions.pod:3592
10486 #: ../src/guestfs-actions.pod:3594
10489 " int guestfs_mv (guestfs_h *g,\n"
10490 "\t\tconst char *src,\n"
10491 "\t\tconst char *dest);\n"
10496 #: ../src/guestfs-actions.pod:3598 ../fish/guestfish-actions.pod:2770
10498 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10499 "destination filename or destination directory."
10503 #: ../src/guestfs-actions.pod:3603
10504 msgid "guestfs_ntfs_3g_probe"
10508 #: ../src/guestfs-actions.pod:3605
10511 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
10513 "\t\tconst char *device);\n"
10518 #: ../src/guestfs-actions.pod:3609 ../fish/guestfish-actions.pod:2777
10520 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10521 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
10522 "write, and some cannot be mounted at all)."
10526 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2781
10528 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10529 "can be mounted read-write. Set it to false if you want to test if the "
10530 "volume can be mounted read-only."
10534 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2785
10536 "The return value is an integer which C<0> if the operation would succeed, or "
10537 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10541 #: ../src/guestfs-actions.pod:3623
10542 msgid "guestfs_ntfsresize"
10546 #: ../src/guestfs-actions.pod:3625
10549 " int guestfs_ntfsresize (guestfs_h *g,\n"
10550 "\t\tconst char *device);\n"
10555 #: ../src/guestfs-actions.pod:3628 ../fish/guestfish-actions.pod:2793
10557 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10558 "size of the underlying device. See also L<ntfsresize(8)>."
10562 #: ../src/guestfs-actions.pod:3634
10563 msgid "guestfs_ntfsresize_size"
10567 #: ../src/guestfs-actions.pod:3636
10570 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
10571 "\t\tconst char *device,\n"
10572 "\t\tint64_t size);\n"
10577 #: ../src/guestfs-actions.pod:3640
10579 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10580 "to specify the new size (in bytes) explicitly."
10584 #: ../src/guestfs-actions.pod:3645
10585 msgid "guestfs_part_add"
10589 #: ../src/guestfs-actions.pod:3647
10592 " int guestfs_part_add (guestfs_h *g,\n"
10593 "\t\tconst char *device,\n"
10594 "\t\tconst char *prlogex,\n"
10595 "\t\tint64_t startsect,\n"
10596 "\t\tint64_t endsect);\n"
10601 #: ../src/guestfs-actions.pod:3653
10603 "This command adds a partition to C<device>. If there is no partition table "
10604 "on the device, call C<guestfs_part_init> first."
10608 #: ../src/guestfs-actions.pod:3656 ../fish/guestfish-actions.pod:2811
10610 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10611 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10612 "C<logical>) and C<e> (or C<extended>) partition types."
10616 #: ../src/guestfs-actions.pod:3661 ../fish/guestfish-actions.pod:2816
10618 "C<startsect> and C<endsect> are the start and end of the partition in "
10619 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10620 "from the end of the disk (C<-1> is the last sector)."
10624 #: ../src/guestfs-actions.pod:3665
10626 "Creating a partition which covers the whole disk is not so easy. Use "
10627 "C<guestfs_part_disk> to do that."
10631 #: ../src/guestfs-actions.pod:3670
10632 msgid "guestfs_part_del"
10636 #: ../src/guestfs-actions.pod:3672
10639 " int guestfs_part_del (guestfs_h *g,\n"
10640 "\t\tconst char *device,\n"
10641 "\t\tint partnum);\n"
10646 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2827
10647 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10651 #: ../src/guestfs-actions.pod:3678 ../fish/guestfish-actions.pod:2829
10653 "Note that in the case of MBR partitioning, deleting an extended partition "
10654 "also deletes any logical partitions it contains."
10658 #: ../src/guestfs-actions.pod:3684
10659 msgid "guestfs_part_disk"
10663 #: ../src/guestfs-actions.pod:3686
10666 " int guestfs_part_disk (guestfs_h *g,\n"
10667 "\t\tconst char *device,\n"
10668 "\t\tconst char *parttype);\n"
10673 #: ../src/guestfs-actions.pod:3690
10675 "This command is simply a combination of C<guestfs_part_init> followed by "
10676 "C<guestfs_part_add> to create a single primary partition covering the whole "
10681 #: ../src/guestfs-actions.pod:3694
10683 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10684 "possible values are described in C<guestfs_part_init>."
10688 #: ../src/guestfs-actions.pod:3702
10689 msgid "guestfs_part_get_bootable"
10693 #: ../src/guestfs-actions.pod:3704
10696 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10697 "\t\tconst char *device,\n"
10698 "\t\tint partnum);\n"
10703 #: ../src/guestfs-actions.pod:3708 ../fish/guestfish-actions.pod:2851
10705 "This command returns true if the partition C<partnum> on C<device> has the "
10706 "bootable flag set."
10710 #: ../src/guestfs-actions.pod:3711
10711 msgid "See also C<guestfs_part_set_bootable>."
10715 #: ../src/guestfs-actions.pod:3715
10716 msgid "guestfs_part_get_mbr_id"
10720 #: ../src/guestfs-actions.pod:3717
10723 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10724 "\t\tconst char *device,\n"
10725 "\t\tint partnum);\n"
10730 #: ../src/guestfs-actions.pod:3721 ../fish/guestfish-actions.pod:2860
10732 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10733 "partition C<partnum>."
10737 #: ../src/guestfs-actions.pod:3724 ../src/guestfs-actions.pod:3886
10739 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10740 "undefined results for other partition table types (see "
10741 "C<guestfs_part_get_parttype>)."
10745 #: ../src/guestfs-actions.pod:3730
10746 msgid "guestfs_part_get_parttype"
10750 #: ../src/guestfs-actions.pod:3732
10753 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10754 "\t\tconst char *device);\n"
10759 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2871
10761 "This command examines the partition table on C<device> and returns the "
10762 "partition table type (format) being used."
10766 #: ../src/guestfs-actions.pod:3738
10768 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10769 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10770 "possible, although unusual. See C<guestfs_part_init> for a full list."
10774 #: ../src/guestfs-actions.pod:3746
10775 msgid "guestfs_part_init"
10779 #: ../src/guestfs-actions.pod:3748
10782 " int guestfs_part_init (guestfs_h *g,\n"
10783 "\t\tconst char *device,\n"
10784 "\t\tconst char *parttype);\n"
10789 #: ../src/guestfs-actions.pod:3752 ../fish/guestfish-actions.pod:2883
10791 "This creates an empty partition table on C<device> of one of the partition "
10792 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10793 "(for large disks)."
10797 #: ../src/guestfs-actions.pod:3756
10799 "Initially there are no partitions. Following this, you should call "
10800 "C<guestfs_part_add> for each partition required."
10804 #: ../src/guestfs-actions.pod:3759 ../fish/guestfish-actions.pod:2890
10805 msgid "Possible values for C<parttype> are:"
10809 #: ../src/guestfs-actions.pod:3763 ../fish/guestfish-actions.pod:2894
10810 msgid "B<efi> | B<gpt>"
10814 #: ../src/guestfs-actions.pod:3765 ../fish/guestfish-actions.pod:2896
10815 msgid "Intel EFI / GPT partition table."
10819 #: ../src/guestfs-actions.pod:3767 ../fish/guestfish-actions.pod:2898
10821 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10822 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10823 "the C<mbr> format."
10827 #: ../src/guestfs-actions.pod:3771 ../fish/guestfish-actions.pod:2902
10828 msgid "B<mbr> | B<msdos>"
10832 #: ../src/guestfs-actions.pod:3773 ../fish/guestfish-actions.pod:2904
10834 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10835 "Windows. This partition type will B<only> work for device sizes up to 2 "
10836 "TB. For large disks we recommend using C<gpt>."
10840 #: ../src/guestfs-actions.pod:3780 ../fish/guestfish-actions.pod:2911
10842 "Other partition table types that may work but are not supported include:"
10846 #: ../src/guestfs-actions.pod:3785 ../fish/guestfish-actions.pod:2916
10851 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2918
10852 msgid "AIX disk labels."
10856 #: ../src/guestfs-actions.pod:3789 ../fish/guestfish-actions.pod:2920
10857 msgid "B<amiga> | B<rdb>"
10861 #: ../src/guestfs-actions.pod:3791 ../fish/guestfish-actions.pod:2922
10862 msgid "Amiga \"Rigid Disk Block\" format."
10866 #: ../src/guestfs-actions.pod:3793 ../fish/guestfish-actions.pod:2924
10871 #: ../src/guestfs-actions.pod:3795 ../fish/guestfish-actions.pod:2926
10872 msgid "BSD disk labels."
10876 #: ../src/guestfs-actions.pod:3797 ../fish/guestfish-actions.pod:2928
10881 #: ../src/guestfs-actions.pod:3799 ../fish/guestfish-actions.pod:2930
10882 msgid "DASD, used on IBM mainframes."
10886 #: ../src/guestfs-actions.pod:3801 ../fish/guestfish-actions.pod:2932
10891 #: ../src/guestfs-actions.pod:3803 ../fish/guestfish-actions.pod:2934
10892 msgid "MIPS/SGI volumes."
10896 #: ../src/guestfs-actions.pod:3805 ../fish/guestfish-actions.pod:2936
10901 #: ../src/guestfs-actions.pod:3807 ../fish/guestfish-actions.pod:2938
10902 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10906 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2940
10911 #: ../src/guestfs-actions.pod:3811 ../fish/guestfish-actions.pod:2942
10912 msgid "NEC PC-98 format, common in Japan apparently."
10916 #: ../src/guestfs-actions.pod:3813 ../fish/guestfish-actions.pod:2944
10921 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2946
10922 msgid "Sun disk labels."
10926 #: ../src/guestfs-actions.pod:3821
10927 msgid "guestfs_part_list"
10931 #: ../src/guestfs-actions.pod:3823
10934 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10935 "\t\tconst char *device);\n"
10940 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2954
10942 "This command parses the partition table on C<device> and returns the list of "
10943 "partitions found."
10947 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2957
10948 msgid "The fields in the returned structure are:"
10952 #: ../src/guestfs-actions.pod:3833 ../fish/guestfish-actions.pod:2961
10953 msgid "B<part_num>"
10957 #: ../src/guestfs-actions.pod:3835 ../fish/guestfish-actions.pod:2963
10958 msgid "Partition number, counting from 1."
10962 #: ../src/guestfs-actions.pod:3837 ../fish/guestfish-actions.pod:2965
10963 msgid "B<part_start>"
10967 #: ../src/guestfs-actions.pod:3839
10969 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10970 "the device's sector size, see C<guestfs_blockdev_getss>."
10974 #: ../src/guestfs-actions.pod:3842 ../fish/guestfish-actions.pod:2970
10975 msgid "B<part_end>"
10979 #: ../src/guestfs-actions.pod:3844 ../fish/guestfish-actions.pod:2972
10980 msgid "End of the partition in bytes."
10984 #: ../src/guestfs-actions.pod:3846 ../fish/guestfish-actions.pod:2974
10985 msgid "B<part_size>"
10989 #: ../src/guestfs-actions.pod:3848 ../fish/guestfish-actions.pod:2976
10990 msgid "Size of the partition in bytes."
10994 #: ../src/guestfs-actions.pod:3852
10996 "This function returns a C<struct guestfs_partition_list *> (see E<lt>guestfs-"
10997 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
10998 "C<guestfs_free_partition_list> after use>."
11002 #: ../src/guestfs-actions.pod:3857
11003 msgid "guestfs_part_set_bootable"
11007 #: ../src/guestfs-actions.pod:3859
11010 " int guestfs_part_set_bootable (guestfs_h *g,\n"
11011 "\t\tconst char *device,\n"
11012 "\t\tint partnum,\n"
11013 "\t\tint bootable);\n"
11018 #: ../src/guestfs-actions.pod:3864 ../fish/guestfish-actions.pod:2984
11020 "This sets the bootable flag on partition numbered C<partnum> on device "
11021 "C<device>. Note that partitions are numbered from 1."
11025 #: ../src/guestfs-actions.pod:3867 ../fish/guestfish-actions.pod:2987
11027 "The bootable flag is used by some operating systems (notably Windows) to "
11028 "determine which partition to boot from. It is by no means universally "
11033 #: ../src/guestfs-actions.pod:3873
11034 msgid "guestfs_part_set_mbr_id"
11038 #: ../src/guestfs-actions.pod:3875
11041 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
11042 "\t\tconst char *device,\n"
11043 "\t\tint partnum,\n"
11044 "\t\tint idbyte);\n"
11049 #: ../src/guestfs-actions.pod:3880 ../fish/guestfish-actions.pod:2995
11051 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11052 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11053 "documentation are in fact hexadecimal numbers, but usually documented "
11054 "without any leading \"0x\" which might be confusing."
11058 #: ../src/guestfs-actions.pod:3892
11059 msgid "guestfs_part_set_name"
11063 #: ../src/guestfs-actions.pod:3894
11066 " int guestfs_part_set_name (guestfs_h *g,\n"
11067 "\t\tconst char *device,\n"
11068 "\t\tint partnum,\n"
11069 "\t\tconst char *name);\n"
11074 #: ../src/guestfs-actions.pod:3899 ../fish/guestfish-actions.pod:3009
11076 "This sets the partition name on partition numbered C<partnum> on device "
11077 "C<device>. Note that partitions are numbered from 1."
11081 #: ../src/guestfs-actions.pod:3902 ../fish/guestfish-actions.pod:3012
11083 "The partition name can only be set on certain types of partition table. "
11084 "This works on C<gpt> but not on C<mbr> partitions."
11088 #: ../src/guestfs-actions.pod:3907
11089 msgid "guestfs_part_to_dev"
11093 #: ../src/guestfs-actions.pod:3909
11096 " char *guestfs_part_to_dev (guestfs_h *g,\n"
11097 "\t\tconst char *partition);\n"
11102 #: ../src/guestfs-actions.pod:3912 ../fish/guestfish-actions.pod:3019
11104 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11105 "partition number, returning the device name (eg. \"/dev/sdb\")."
11109 #: ../src/guestfs-actions.pod:3916
11111 "The named partition must exist, for example as a string returned from "
11112 "C<guestfs_list_partitions>."
11116 #: ../src/guestfs-actions.pod:3922
11117 msgid "guestfs_ping_daemon"
11121 #: ../src/guestfs-actions.pod:3924
11124 " int guestfs_ping_daemon (guestfs_h *g);\n"
11129 #: ../src/guestfs-actions.pod:3926 ../fish/guestfish-actions.pod:3030
11131 "This is a test probe into the guestfs daemon running inside the qemu "
11132 "subprocess. Calling this function checks that the daemon responds to the "
11133 "ping message, without affecting the daemon or attached block device(s) in "
11138 #: ../src/guestfs-actions.pod:3933
11139 msgid "guestfs_pread"
11143 #: ../src/guestfs-actions.pod:3935
11146 " char *guestfs_pread (guestfs_h *g,\n"
11147 "\t\tconst char *path,\n"
11149 "\t\tint64_t offset,\n"
11150 "\t\tsize_t *size_r);\n"
11155 #: ../src/guestfs-actions.pod:3941 ../fish/guestfish-actions.pod:3039
11157 "This command lets you read part of a file. It reads C<count> bytes of the "
11158 "file, starting at C<offset>, from file C<path>."
11162 #: ../src/guestfs-actions.pod:3944 ../src/guestfs-actions.pod:3967
11163 #: ../fish/guestfish-actions.pod:3042 ../fish/guestfish-actions.pod:3057
11165 "This may read fewer bytes than requested. For further details see the "
11166 "L<pread(2)> system call."
11170 #: ../src/guestfs-actions.pod:3947
11171 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
11175 #: ../src/guestfs-actions.pod:3956
11176 msgid "guestfs_pread_device"
11180 #: ../src/guestfs-actions.pod:3958
11183 " char *guestfs_pread_device (guestfs_h *g,\n"
11184 "\t\tconst char *device,\n"
11186 "\t\tint64_t offset,\n"
11187 "\t\tsize_t *size_r);\n"
11192 #: ../src/guestfs-actions.pod:3964 ../fish/guestfish-actions.pod:3054
11194 "This command lets you read part of a file. It reads C<count> bytes of "
11195 "C<device>, starting at C<offset>."
11199 #: ../src/guestfs-actions.pod:3970
11200 msgid "See also C<guestfs_pread>."
11204 #: ../src/guestfs-actions.pod:3979
11205 msgid "guestfs_pvcreate"
11209 #: ../src/guestfs-actions.pod:3981
11212 " int guestfs_pvcreate (guestfs_h *g,\n"
11213 "\t\tconst char *device);\n"
11218 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:3069
11220 "This creates an LVM physical volume on the named C<device>, where C<device> "
11221 "should usually be a partition name such as C</dev/sda1>."
11225 #: ../src/guestfs-actions.pod:3990
11226 msgid "guestfs_pvremove"
11230 #: ../src/guestfs-actions.pod:3992
11233 " int guestfs_pvremove (guestfs_h *g,\n"
11234 "\t\tconst char *device);\n"
11239 #: ../src/guestfs-actions.pod:3995 ../fish/guestfish-actions.pod:3077
11241 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11246 #: ../src/guestfs-actions.pod:3998 ../fish/guestfish-actions.pod:3080
11248 "The implementation uses the C<pvremove> command which refuses to wipe "
11249 "physical volumes that contain any volume groups, so you have to remove those "
11254 #: ../src/guestfs-actions.pod:4004
11255 msgid "guestfs_pvresize"
11259 #: ../src/guestfs-actions.pod:4006
11262 " int guestfs_pvresize (guestfs_h *g,\n"
11263 "\t\tconst char *device);\n"
11268 #: ../src/guestfs-actions.pod:4009 ../fish/guestfish-actions.pod:3088
11270 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11271 "the new size of the underlying device."
11275 #: ../src/guestfs-actions.pod:4014
11276 msgid "guestfs_pvresize_size"
11280 #: ../src/guestfs-actions.pod:4016
11283 " int guestfs_pvresize_size (guestfs_h *g,\n"
11284 "\t\tconst char *device,\n"
11285 "\t\tint64_t size);\n"
11290 #: ../src/guestfs-actions.pod:4020
11292 "This command is the same as C<guestfs_pvresize> except that it allows you to "
11293 "specify the new size (in bytes) explicitly."
11297 #: ../src/guestfs-actions.pod:4025
11298 msgid "guestfs_pvs"
11302 #: ../src/guestfs-actions.pod:4027
11305 " char **guestfs_pvs (guestfs_h *g);\n"
11310 #: ../src/guestfs-actions.pod:4029 ../fish/guestfish-actions.pod:3102
11312 "List all the physical volumes detected. This is the equivalent of the L<pvs"
11317 #: ../src/guestfs-actions.pod:4032 ../fish/guestfish-actions.pod:3105
11319 "This returns a list of just the device names that contain PVs (eg. C</dev/"
11324 #: ../src/guestfs-actions.pod:4035
11325 msgid "See also C<guestfs_pvs_full>."
11329 #: ../src/guestfs-actions.pod:4041
11330 msgid "guestfs_pvs_full"
11334 #: ../src/guestfs-actions.pod:4043
11337 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
11342 #: ../src/guestfs-actions.pod:4045 ../fish/guestfish-actions.pod:3114
11344 "List all the physical volumes detected. This is the equivalent of the L<pvs"
11345 "(8)> command. The \"full\" version includes all fields."
11349 #: ../src/guestfs-actions.pod:4048
11351 "This function returns a C<struct guestfs_lvm_pv_list *> (see E<lt>guestfs-"
11352 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11353 "C<guestfs_free_lvm_pv_list> after use>."
11357 #: ../src/guestfs-actions.pod:4053
11358 msgid "guestfs_pvuuid"
11362 #: ../src/guestfs-actions.pod:4055
11365 " char *guestfs_pvuuid (guestfs_h *g,\n"
11366 "\t\tconst char *device);\n"
11371 #: ../src/guestfs-actions.pod:4058 ../fish/guestfish-actions.pod:3121
11372 msgid "This command returns the UUID of the LVM PV C<device>."
11376 #: ../src/guestfs-actions.pod:4063
11377 msgid "guestfs_pwrite"
11381 #: ../src/guestfs-actions.pod:4065
11384 " int guestfs_pwrite (guestfs_h *g,\n"
11385 "\t\tconst char *path,\n"
11386 "\t\tconst char *content,\n"
11387 "\t\tsize_t content_size,\n"
11388 "\t\tint64_t offset);\n"
11393 #: ../src/guestfs-actions.pod:4071 ../fish/guestfish-actions.pod:3127
11395 "This command writes to part of a file. It writes the data buffer C<content> "
11396 "to the file C<path> starting at offset C<offset>."
11400 #: ../src/guestfs-actions.pod:4074 ../fish/guestfish-actions.pod:3130
11402 "This command implements the L<pwrite(2)> system call, and like that system "
11403 "call it may not write the full data requested. The return value is the "
11404 "number of bytes that were actually written to the file. This could even be "
11405 "0, although short writes are unlikely for regular files in ordinary "
11410 #: ../src/guestfs-actions.pod:4080
11411 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
11415 #: ../src/guestfs-actions.pod:4087
11416 msgid "guestfs_pwrite_device"
11420 #: ../src/guestfs-actions.pod:4089
11423 " int guestfs_pwrite_device (guestfs_h *g,\n"
11424 "\t\tconst char *device,\n"
11425 "\t\tconst char *content,\n"
11426 "\t\tsize_t content_size,\n"
11427 "\t\tint64_t offset);\n"
11432 #: ../src/guestfs-actions.pod:4095 ../fish/guestfish-actions.pod:3145
11434 "This command writes to part of a device. It writes the data buffer "
11435 "C<content> to C<device> starting at offset C<offset>."
11439 #: ../src/guestfs-actions.pod:4098 ../fish/guestfish-actions.pod:3148
11441 "This command implements the L<pwrite(2)> system call, and like that system "
11442 "call it may not write the full data requested (although short writes to disk "
11443 "devices and partitions are probably impossible with standard Linux kernels)."
11447 #: ../src/guestfs-actions.pod:4103
11448 msgid "See also C<guestfs_pwrite>."
11452 #: ../src/guestfs-actions.pod:4110
11453 msgid "guestfs_read_file"
11457 #: ../src/guestfs-actions.pod:4112
11460 " char *guestfs_read_file (guestfs_h *g,\n"
11461 "\t\tconst char *path,\n"
11462 "\t\tsize_t *size_r);\n"
11467 #: ../src/guestfs-actions.pod:4116 ../fish/guestfish-actions.pod:3162
11468 msgid "This calls returns the contents of the file C<path> as a buffer."
11472 #: ../src/guestfs-actions.pod:4119
11474 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
11475 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
11476 "function is limited in the total size of file that can be handled."
11480 #: ../src/guestfs-actions.pod:4131
11481 msgid "guestfs_read_lines"
11485 #: ../src/guestfs-actions.pod:4133
11488 " char **guestfs_read_lines (guestfs_h *g,\n"
11489 "\t\tconst char *path);\n"
11494 #: ../src/guestfs-actions.pod:4138 ../fish/guestfish-actions.pod:3179
11496 "The file contents are returned as a list of lines. Trailing C<LF> and "
11497 "C<CRLF> character sequences are I<not> returned."
11501 #: ../src/guestfs-actions.pod:4141
11503 "Note that this function cannot correctly handle binary files (specifically, "
11504 "files containing C<\\0> character which is treated as end of line). For "
11505 "those you need to use the C<guestfs_read_file> function which has a more "
11506 "complex interface."
11510 #: ../src/guestfs-actions.pod:4150
11511 msgid "guestfs_readdir"
11515 #: ../src/guestfs-actions.pod:4152
11518 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
11519 "\t\tconst char *dir);\n"
11524 #: ../src/guestfs-actions.pod:4155 ../fish/guestfish-actions.pod:3191
11525 msgid "This returns the list of directory entries in directory C<dir>."
11529 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:3193
11531 "All entries in the directory are returned, including C<.> and C<..>. The "
11532 "entries are I<not> sorted, but returned in the same order as the underlying "
11537 #: ../src/guestfs-actions.pod:4161 ../fish/guestfish-actions.pod:3197
11539 "Also this call returns basic file type information about each file. The "
11540 "C<ftyp> field will contain one of the following characters:"
11544 #: ../src/guestfs-actions.pod:4166 ../fish/guestfish-actions.pod:3202
11549 #: ../src/guestfs-actions.pod:4168 ../fish/guestfish-actions.pod:3204
11550 msgid "Block special"
11554 #: ../src/guestfs-actions.pod:4170 ../fish/guestfish-actions.pod:3206
11559 #: ../src/guestfs-actions.pod:4172 ../fish/guestfish-actions.pod:3208
11560 msgid "Char special"
11564 #: ../src/guestfs-actions.pod:4174 ../fish/guestfish-actions.pod:3210
11569 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:3212
11574 #: ../src/guestfs-actions.pod:4178 ../fish/guestfish-actions.pod:3214
11579 #: ../src/guestfs-actions.pod:4180 ../fish/guestfish-actions.pod:3216
11580 msgid "FIFO (named pipe)"
11584 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:3218
11589 #: ../src/guestfs-actions.pod:4184 ../fish/guestfish-actions.pod:3220
11590 msgid "Symbolic link"
11594 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:3222
11599 #: ../src/guestfs-actions.pod:4188 ../fish/guestfish-actions.pod:3224
11600 msgid "Regular file"
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 "Unknown file type"
11624 #: ../src/guestfs-actions.pod:4198 ../fish/guestfish-actions.pod:3234
11629 #: ../src/guestfs-actions.pod:4200 ../fish/guestfish-actions.pod:3236
11631 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11635 #: ../src/guestfs-actions.pod:4205
11637 "This function is primarily intended for use by programs. To get a simple "
11638 "list of names, use C<guestfs_ls>. To get a printable directory for human "
11639 "consumption, use C<guestfs_ll>."
11643 #: ../src/guestfs-actions.pod:4209
11645 "This function returns a C<struct guestfs_dirent_list *> (see E<lt>guestfs-"
11646 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
11647 "C<guestfs_free_dirent_list> after use>."
11651 #: ../src/guestfs-actions.pod:4214
11652 msgid "guestfs_readlink"
11656 #: ../src/guestfs-actions.pod:4216
11659 " char *guestfs_readlink (guestfs_h *g,\n"
11660 "\t\tconst char *path);\n"
11665 #: ../src/guestfs-actions.pod:4219 ../fish/guestfish-actions.pod:3249
11666 msgid "This command reads the target of a symbolic link."
11670 #: ../src/guestfs-actions.pod:4224
11671 msgid "guestfs_readlinklist"
11675 #: ../src/guestfs-actions.pod:4226
11678 " char **guestfs_readlinklist (guestfs_h *g,\n"
11679 "\t\tconst char *path,\n"
11680 "\t\tchar *const *names);\n"
11685 #: ../src/guestfs-actions.pod:4230 ../fish/guestfish-actions.pod:3255
11687 "This call allows you to do a C<readlink> operation on multiple files, where "
11688 "all files are in the directory C<path>. C<names> is the list of files from "
11693 #: ../src/guestfs-actions.pod:4234 ../fish/guestfish-actions.pod:3259
11695 "On return you get a list of strings, with a one-to-one correspondence to the "
11696 "C<names> list. Each string is the value of the symbolic link."
11700 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:3263
11702 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11703 "result string is the empty string C<\"\">. However the whole operation is "
11704 "completed even if there were C<readlink(2)> errors, and so you can call this "
11705 "function with names where you don't know if they are symbolic links already "
11706 "(albeit slightly less efficient)."
11710 #: ../src/guestfs-actions.pod:4245 ../fish/guestfish-actions.pod:3270
11712 "This call is intended for programs that want to efficiently list a directory "
11713 "contents without making many round-trips. Very long directory listings "
11714 "might cause the protocol message size to be exceeded, causing this call to "
11715 "fail. The caller must split up such requests into smaller groups of names."
11719 #: ../src/guestfs-actions.pod:4256
11720 msgid "guestfs_realpath"
11724 #: ../src/guestfs-actions.pod:4258
11727 " char *guestfs_realpath (guestfs_h *g,\n"
11728 "\t\tconst char *path);\n"
11733 #: ../src/guestfs-actions.pod:4261 ../fish/guestfish-actions.pod:3281
11735 "Return the canonicalized absolute pathname of C<path>. The returned path "
11736 "has no C<.>, C<..> or symbolic link path elements."
11740 #: ../src/guestfs-actions.pod:4267
11741 msgid "guestfs_removexattr"
11745 #: ../src/guestfs-actions.pod:4269
11748 " int guestfs_removexattr (guestfs_h *g,\n"
11749 "\t\tconst char *xattr,\n"
11750 "\t\tconst char *path);\n"
11755 #: ../src/guestfs-actions.pod:4273 ../fish/guestfish-actions.pod:3288
11757 "This call removes the extended attribute named C<xattr> of the file C<path>."
11761 #: ../src/guestfs-actions.pod:4276
11762 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11766 #: ../src/guestfs-actions.pod:4280
11767 msgid "guestfs_resize2fs"
11771 #: ../src/guestfs-actions.pod:4282
11774 " int guestfs_resize2fs (guestfs_h *g,\n"
11775 "\t\tconst char *device);\n"
11780 #: ../src/guestfs-actions.pod:4285 ../fish/guestfish-actions.pod:3297
11782 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11783 "underlying device."
11787 #: ../src/guestfs-actions.pod:4288
11789 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11790 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11791 "sometimes gives an error about this and sometimes not. In any case, it is "
11792 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11796 #: ../src/guestfs-actions.pod:4296
11797 msgid "guestfs_resize2fs_size"
11801 #: ../src/guestfs-actions.pod:4298
11804 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11805 "\t\tconst char *device,\n"
11806 "\t\tint64_t size);\n"
11811 #: ../src/guestfs-actions.pod:4302
11813 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11814 "to specify the new size (in bytes) explicitly."
11818 #: ../src/guestfs-actions.pod:4307
11823 #: ../src/guestfs-actions.pod:4309
11826 " int guestfs_rm (guestfs_h *g,\n"
11827 "\t\tconst char *path);\n"
11832 #: ../src/guestfs-actions.pod:4312 ../fish/guestfish-actions.pod:3317
11833 msgid "Remove the single file C<path>."
11837 #: ../src/guestfs-actions.pod:4316
11838 msgid "guestfs_rm_rf"
11842 #: ../src/guestfs-actions.pod:4318
11845 " int guestfs_rm_rf (guestfs_h *g,\n"
11846 "\t\tconst char *path);\n"
11851 #: ../src/guestfs-actions.pod:4321 ../fish/guestfish-actions.pod:3323
11853 "Remove the file or directory C<path>, recursively removing the contents if "
11854 "its a directory. This is like the C<rm -rf> shell command."
11858 #: ../src/guestfs-actions.pod:4327
11859 msgid "guestfs_rmdir"
11863 #: ../src/guestfs-actions.pod:4329
11866 " int guestfs_rmdir (guestfs_h *g,\n"
11867 "\t\tconst char *path);\n"
11872 #: ../src/guestfs-actions.pod:4332 ../fish/guestfish-actions.pod:3331
11873 msgid "Remove the single directory C<path>."
11877 #: ../src/guestfs-actions.pod:4336
11878 msgid "guestfs_rmmountpoint"
11882 #: ../src/guestfs-actions.pod:4338
11885 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11886 "\t\tconst char *exemptpath);\n"
11891 #: ../src/guestfs-actions.pod:4341
11893 "This calls removes a mountpoint that was previously created with "
11894 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11898 #: ../src/guestfs-actions.pod:4347
11899 msgid "guestfs_scrub_device"
11903 #: ../src/guestfs-actions.pod:4349
11906 " int guestfs_scrub_device (guestfs_h *g,\n"
11907 "\t\tconst char *device);\n"
11912 #: ../src/guestfs-actions.pod:4352 ../fish/guestfish-actions.pod:3345
11914 "This command writes patterns over C<device> to make data retrieval more "
11919 #: ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4373
11920 #: ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:3348
11921 #: ../fish/guestfish-actions.pod:3363 ../fish/guestfish-actions.pod:3376
11923 "It is an interface to the L<scrub(1)> program. See that manual page for "
11928 #: ../src/guestfs-actions.pod:4363
11929 msgid "guestfs_scrub_file"
11933 #: ../src/guestfs-actions.pod:4365
11936 " int guestfs_scrub_file (guestfs_h *g,\n"
11937 "\t\tconst char *file);\n"
11942 #: ../src/guestfs-actions.pod:4368 ../fish/guestfish-actions.pod:3358
11944 "This command writes patterns over a file to make data retrieval more "
11949 #: ../src/guestfs-actions.pod:4371 ../fish/guestfish-actions.pod:3361
11950 msgid "The file is I<removed> after scrubbing."
11954 #: ../src/guestfs-actions.pod:4378
11955 msgid "guestfs_scrub_freespace"
11959 #: ../src/guestfs-actions.pod:4380
11962 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11963 "\t\tconst char *dir);\n"
11968 #: ../src/guestfs-actions.pod:4383
11970 "This command creates the directory C<dir> and then fills it with files until "
11971 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11972 "and deletes them. The intention is to scrub any free space on the partition "
11973 "containing C<dir>."
11977 #: ../src/guestfs-actions.pod:4394
11978 msgid "guestfs_set_append"
11982 #: ../src/guestfs-actions.pod:4396
11985 " int guestfs_set_append (guestfs_h *g,\n"
11986 "\t\tconst char *append);\n"
11991 #: ../src/guestfs-actions.pod:4399 ../fish/guestfish-actions.pod:3385
11993 "This function is used to add additional options to the guest kernel command "
11998 #: ../src/guestfs-actions.pod:4402 ../fish/guestfish-actions.pod:3388
12000 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12001 "environment variable."
12005 #: ../src/guestfs-actions.pod:4405 ../fish/guestfish-actions.pod:3391
12007 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12008 "(libguestfs always adds a few of its own)."
12012 #: ../src/guestfs-actions.pod:4410
12013 msgid "guestfs_set_autosync"
12017 #: ../src/guestfs-actions.pod:4412
12020 " int guestfs_set_autosync (guestfs_h *g,\n"
12021 "\t\tint autosync);\n"
12026 #: ../src/guestfs-actions.pod:4415
12028 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12029 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
12030 "the handle is closed (also if the program exits without closing handles)."
12034 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:3405
12036 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12037 "disabled by default)."
12041 #: ../src/guestfs-actions.pod:4425
12042 msgid "guestfs_set_direct"
12046 #: ../src/guestfs-actions.pod:4427
12049 " int guestfs_set_direct (guestfs_h *g,\n"
12050 "\t\tint direct);\n"
12055 #: ../src/guestfs-actions.pod:4430 ../fish/guestfish-actions.pod:3414
12057 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12058 "passed directly through to the appliance once it is launched."
12062 #: ../src/guestfs-actions.pod:4434
12064 "One consequence of this is that log messages aren't caught by the library "
12065 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
12070 #: ../src/guestfs-actions.pod:4438 ../fish/guestfish-actions.pod:3422
12071 msgid "You probably don't want to use this unless you know what you are doing."
12075 #: ../src/guestfs-actions.pod:4441 ../fish/guestfish-actions.pod:3425
12076 msgid "The default is disabled."
12080 #: ../src/guestfs-actions.pod:4445
12081 msgid "guestfs_set_e2label"
12085 #: ../src/guestfs-actions.pod:4447
12088 " int guestfs_set_e2label (guestfs_h *g,\n"
12089 "\t\tconst char *device,\n"
12090 "\t\tconst char *label);\n"
12095 #: ../src/guestfs-actions.pod:4451 ../fish/guestfish-actions.pod:3431
12097 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12098 "C<label>. Filesystem labels are limited to 16 characters."
12102 #: ../src/guestfs-actions.pod:4455
12104 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
12105 "the existing label on a filesystem."
12109 #: ../src/guestfs-actions.pod:4460
12110 msgid "guestfs_set_e2uuid"
12114 #: ../src/guestfs-actions.pod:4462
12117 " int guestfs_set_e2uuid (guestfs_h *g,\n"
12118 "\t\tconst char *device,\n"
12119 "\t\tconst char *uuid);\n"
12124 #: ../src/guestfs-actions.pod:4466 ../fish/guestfish-actions.pod:3442
12126 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12127 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12128 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12132 #: ../src/guestfs-actions.pod:4471
12134 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
12135 "the existing UUID of a filesystem."
12139 #: ../src/guestfs-actions.pod:4476
12140 msgid "guestfs_set_memsize"
12144 #: ../src/guestfs-actions.pod:4478
12147 " int guestfs_set_memsize (guestfs_h *g,\n"
12148 "\t\tint memsize);\n"
12153 #: ../src/guestfs-actions.pod:4481
12155 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12156 "This only has any effect if called before C<guestfs_launch>."
12160 #: ../src/guestfs-actions.pod:4485 ../fish/guestfish-actions.pod:3460
12162 "You can also change this by setting the environment variable "
12163 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12167 #: ../src/guestfs-actions.pod:4494
12168 msgid "guestfs_set_network"
12172 #: ../src/guestfs-actions.pod:4496
12175 " int guestfs_set_network (guestfs_h *g,\n"
12176 "\t\tint network);\n"
12181 #: ../src/guestfs-actions.pod:4499 ../fish/guestfish-actions.pod:3473
12183 "If C<network> is true, then the network is enabled in the libguestfs "
12184 "appliance. The default is false."
12188 #: ../src/guestfs-actions.pod:4502 ../fish/guestfish-actions.pod:3476
12190 "This affects whether commands are able to access the network (see L<guestfs"
12191 "(3)/RUNNING COMMANDS>)."
12195 #: ../src/guestfs-actions.pod:4505
12197 "You must call this before calling C<guestfs_launch>, otherwise it has no "
12202 #: ../src/guestfs-actions.pod:4510
12203 msgid "guestfs_set_path"
12207 #: ../src/guestfs-actions.pod:4512
12210 " int guestfs_set_path (guestfs_h *g,\n"
12211 "\t\tconst char *searchpath);\n"
12216 #: ../src/guestfs-actions.pod:4515 ../fish/guestfish-actions.pod:3488
12217 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12221 #: ../src/guestfs-actions.pod:4517 ../fish/guestfish-actions.pod:3490
12223 "The default is C<$libdir/guestfs> unless overridden by setting "
12224 "C<LIBGUESTFS_PATH> environment variable."
12228 #: ../src/guestfs-actions.pod:4520 ../fish/guestfish-actions.pod:3493
12229 msgid "Setting C<path> to C<NULL> restores the default path."
12233 #: ../src/guestfs-actions.pod:4524
12234 msgid "guestfs_set_qemu"
12238 #: ../src/guestfs-actions.pod:4526
12241 " int guestfs_set_qemu (guestfs_h *g,\n"
12242 "\t\tconst char *qemu);\n"
12247 #: ../src/guestfs-actions.pod:4529 ../fish/guestfish-actions.pod:3501
12248 msgid "Set the qemu binary that we will use."
12252 #: ../src/guestfs-actions.pod:4531 ../fish/guestfish-actions.pod:3503
12254 "The default is chosen when the library was compiled by the configure script."
12258 #: ../src/guestfs-actions.pod:4534 ../fish/guestfish-actions.pod:3506
12260 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12265 #: ../src/guestfs-actions.pod:4537 ../fish/guestfish-actions.pod:3509
12266 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12270 #: ../src/guestfs-actions.pod:4539 ../fish/guestfish-actions.pod:3511
12272 "Note that you should call this function as early as possible after creating "
12273 "the handle. This is because some pre-launch operations depend on testing "
12274 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12275 "don't retest features, and so you might see inconsistent results. Using the "
12276 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12277 "the qemu binary at the same time as the handle is created."
12281 #: ../src/guestfs-actions.pod:4549
12282 msgid "guestfs_set_recovery_proc"
12286 #: ../src/guestfs-actions.pod:4551
12289 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
12290 "\t\tint recoveryproc);\n"
12295 #: ../src/guestfs-actions.pod:4554
12297 "If this is called with the parameter C<false> then C<guestfs_launch> does "
12298 "not create a recovery process. The purpose of the recovery process is to "
12299 "stop runaway qemu processes in the case where the main program aborts "
12304 #: ../src/guestfs-actions.pod:4559
12306 "This only has any effect if called before C<guestfs_launch>, and the default "
12311 #: ../src/guestfs-actions.pod:4562 ../fish/guestfish-actions.pod:3533
12313 "About the only time when you would want to disable this is if the main "
12314 "process will fork itself into the background (\"daemonize\" itself). In "
12315 "this case the recovery process thinks that the main program has disappeared "
12316 "and so kills qemu, which is not very helpful."
12320 #: ../src/guestfs-actions.pod:4570
12321 msgid "guestfs_set_selinux"
12325 #: ../src/guestfs-actions.pod:4572
12328 " int guestfs_set_selinux (guestfs_h *g,\n"
12329 "\t\tint selinux);\n"
12334 #: ../src/guestfs-actions.pod:4575 ../fish/guestfish-actions.pod:3545
12336 "This sets the selinux flag that is passed to the appliance at boot time. "
12337 "The default is C<selinux=0> (disabled)."
12341 #: ../src/guestfs-actions.pod:4578 ../fish/guestfish-actions.pod:3548
12343 "Note that if SELinux is enabled, it is always in Permissive mode "
12344 "(C<enforcing=0>)."
12348 #: ../src/guestfs-actions.pod:4586
12349 msgid "guestfs_set_trace"
12353 #: ../src/guestfs-actions.pod:4588
12356 " int guestfs_set_trace (guestfs_h *g,\n"
12357 "\t\tint trace);\n"
12362 #: ../src/guestfs-actions.pod:4591 ../fish/guestfish-actions.pod:3560
12364 "If the command trace flag is set to 1, then commands are printed on stderr "
12365 "before they are executed in a format which is very similar to the one used "
12366 "by guestfish. In other words, you can run a program with this enabled, and "
12367 "you will get out a script which you can feed to guestfish to perform the "
12368 "same set of actions."
12372 #: ../src/guestfs-actions.pod:4598 ../fish/guestfish-actions.pod:3567
12374 "If you want to trace C API calls into libguestfs (and other libraries) then "
12375 "possibly a better way is to use the external ltrace(1) command."
12379 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3571
12381 "Command traces are disabled unless the environment variable "
12382 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12386 #: ../src/guestfs-actions.pod:4607
12387 msgid "guestfs_set_verbose"
12391 #: ../src/guestfs-actions.pod:4609
12394 " int guestfs_set_verbose (guestfs_h *g,\n"
12395 "\t\tint verbose);\n"
12400 #: ../src/guestfs-actions.pod:4612 ../fish/guestfish-actions.pod:3580
12401 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
12405 #: ../src/guestfs-actions.pod:4614 ../fish/guestfish-actions.pod:3582
12407 "Verbose messages are disabled unless the environment variable "
12408 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12412 #: ../src/guestfs-actions.pod:4619
12413 msgid "guestfs_setcon"
12417 #: ../src/guestfs-actions.pod:4621
12420 " int guestfs_setcon (guestfs_h *g,\n"
12421 "\t\tconst char *context);\n"
12426 #: ../src/guestfs-actions.pod:4624 ../fish/guestfish-actions.pod:3589
12428 "This sets the SELinux security context of the daemon to the string "
12433 #: ../src/guestfs-actions.pod:4627 ../fish/guestfish-actions.pod:3592
12434 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12438 #: ../src/guestfs-actions.pod:4631
12439 msgid "guestfs_setxattr"
12443 #: ../src/guestfs-actions.pod:4633
12446 " int guestfs_setxattr (guestfs_h *g,\n"
12447 "\t\tconst char *xattr,\n"
12448 "\t\tconst char *val,\n"
12449 "\t\tint vallen,\n"
12450 "\t\tconst char *path);\n"
12455 #: ../src/guestfs-actions.pod:4639 ../fish/guestfish-actions.pod:3598
12457 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12458 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12462 #: ../src/guestfs-actions.pod:4643
12463 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
12467 #: ../src/guestfs-actions.pod:4647
12468 msgid "guestfs_sfdisk"
12472 #: ../src/guestfs-actions.pod:4649
12475 " int guestfs_sfdisk (guestfs_h *g,\n"
12476 "\t\tconst char *device,\n"
12479 "\t\tint sectors,\n"
12480 "\t\tchar *const *lines);\n"
12485 #: ../src/guestfs-actions.pod:4656 ../fish/guestfish-actions.pod:3608
12487 "This is a direct interface to the L<sfdisk(8)> program for creating "
12488 "partitions on block devices."
12492 #: ../src/guestfs-actions.pod:4659 ../fish/guestfish-actions.pod:3611
12493 msgid "C<device> should be a block device, for example C</dev/sda>."
12497 #: ../src/guestfs-actions.pod:4661 ../fish/guestfish-actions.pod:3613
12499 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12500 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
12501 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12502 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12503 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12504 "the kernel) cannot work out the right geometry and you will need to tell it."
12508 #: ../src/guestfs-actions.pod:4669 ../fish/guestfish-actions.pod:3621
12510 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12511 "refer to the L<sfdisk(8)> manpage."
12515 #: ../src/guestfs-actions.pod:4672 ../fish/guestfish-actions.pod:3624
12517 "To create a single partition occupying the whole disk, you would pass "
12518 "C<lines> as a single element list, when the single element being the string "
12523 #: ../src/guestfs-actions.pod:4676
12525 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
12529 #: ../src/guestfs-actions.pod:4684
12530 msgid "guestfs_sfdiskM"
12534 #: ../src/guestfs-actions.pod:4686
12537 " int guestfs_sfdiskM (guestfs_h *g,\n"
12538 "\t\tconst char *device,\n"
12539 "\t\tchar *const *lines);\n"
12544 #: ../src/guestfs-actions.pod:4690
12546 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
12547 "partition sizes are specified in megabytes only (rounded to the nearest "
12548 "cylinder) and you don't need to specify the cyls, heads and sectors "
12549 "parameters which were rarely if ever used anyway."
12553 #: ../src/guestfs-actions.pod:4696
12555 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
12556 "C<guestfs_part_disk>"
12560 #: ../src/guestfs-actions.pod:4704
12561 msgid "guestfs_sfdisk_N"
12565 #: ../src/guestfs-actions.pod:4706
12568 " int guestfs_sfdisk_N (guestfs_h *g,\n"
12569 "\t\tconst char *device,\n"
12570 "\t\tint partnum,\n"
12573 "\t\tint sectors,\n"
12574 "\t\tconst char *line);\n"
12579 #: ../src/guestfs-actions.pod:4714 ../fish/guestfish-actions.pod:3654
12581 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
12582 "(note: C<n> counts from 1)."
12586 #: ../src/guestfs-actions.pod:4717
12588 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
12589 "for the cyls/heads/sectors parameters."
12593 #: ../src/guestfs-actions.pod:4720
12594 msgid "See also: C<guestfs_part_add>"
12598 #: ../src/guestfs-actions.pod:4727
12599 msgid "guestfs_sfdisk_disk_geometry"
12603 #: ../src/guestfs-actions.pod:4729
12606 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
12607 "\t\tconst char *device);\n"
12612 #: ../src/guestfs-actions.pod:4732
12614 "This displays the disk geometry of C<device> read from the partition table. "
12615 "Especially in the case where the underlying block device has been resized, "
12616 "this can be different from the kernel's idea of the geometry (see "
12617 "C<guestfs_sfdisk_kernel_geometry>)."
12621 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4750
12622 #: ../fish/guestfish-actions.pod:3674 ../fish/guestfish-actions.pod:3683
12623 msgid "The result is in human-readable format, and not designed to be parsed."
12627 #: ../src/guestfs-actions.pod:4743
12628 msgid "guestfs_sfdisk_kernel_geometry"
12632 #: ../src/guestfs-actions.pod:4745
12635 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
12636 "\t\tconst char *device);\n"
12641 #: ../src/guestfs-actions.pod:4748 ../fish/guestfish-actions.pod:3681
12642 msgid "This displays the kernel's idea of the geometry of C<device>."
12646 #: ../src/guestfs-actions.pod:4756
12647 msgid "guestfs_sfdisk_l"
12651 #: ../src/guestfs-actions.pod:4758
12654 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12655 "\t\tconst char *device);\n"
12660 #: ../src/guestfs-actions.pod:4761 ../fish/guestfish-actions.pod:3690
12662 "This displays the partition table on C<device>, in the human-readable output "
12663 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12667 #: ../src/guestfs-actions.pod:4765
12668 msgid "See also: C<guestfs_part_list>"
12672 #: ../src/guestfs-actions.pod:4770
12677 #: ../src/guestfs-actions.pod:4772
12680 " char *guestfs_sh (guestfs_h *g,\n"
12681 "\t\tconst char *command);\n"
12686 #: ../src/guestfs-actions.pod:4775 ../fish/guestfish-actions.pod:3700
12688 "This call runs a command from the guest filesystem via the guest's C</bin/"
12693 #: ../src/guestfs-actions.pod:4778
12694 msgid "This is like C<guestfs_command>, but passes the command to:"
12698 #: ../src/guestfs-actions.pod:4780 ../fish/guestfish-actions.pod:3705
12701 " /bin/sh -c \"command\"\n"
12706 #: ../src/guestfs-actions.pod:4782 ../fish/guestfish-actions.pod:3707
12708 "Depending on the guest's shell, this usually results in wildcards being "
12709 "expanded, shell expressions being interpolated and so on."
12713 #: ../src/guestfs-actions.pod:4786
12714 msgid "All the provisos about C<guestfs_command> apply to this call."
12718 #: ../src/guestfs-actions.pod:4791
12719 msgid "guestfs_sh_lines"
12723 #: ../src/guestfs-actions.pod:4793
12726 " char **guestfs_sh_lines (guestfs_h *g,\n"
12727 "\t\tconst char *command);\n"
12732 #: ../src/guestfs-actions.pod:4796
12734 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12739 #: ../src/guestfs-actions.pod:4799
12740 msgid "See also: C<guestfs_command_lines>"
12744 #: ../src/guestfs-actions.pod:4805
12745 msgid "guestfs_sleep"
12749 #: ../src/guestfs-actions.pod:4807
12752 " int guestfs_sleep (guestfs_h *g,\n"
12758 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3726
12759 msgid "Sleep for C<secs> seconds."
12763 #: ../src/guestfs-actions.pod:4814 ../src/guestfs-structs.pod:109
12764 msgid "guestfs_stat"
12768 #: ../src/guestfs-actions.pod:4816
12771 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12772 "\t\tconst char *path);\n"
12777 #: ../src/guestfs-actions.pod:4821 ../fish/guestfish-actions.pod:3734
12778 msgid "This is the same as the C<stat(2)> system call."
12782 #: ../src/guestfs-actions.pod:4827 ../src/guestfs-structs.pod:135
12783 msgid "guestfs_statvfs"
12787 #: ../src/guestfs-actions.pod:4829
12790 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12791 "\t\tconst char *path);\n"
12796 #: ../src/guestfs-actions.pod:4832 ../fish/guestfish-actions.pod:3740
12798 "Returns file system statistics for any mounted file system. C<path> should "
12799 "be a file or directory in the mounted file system (typically it is the mount "
12800 "point itself, but it doesn't need to be)."
12804 #: ../src/guestfs-actions.pod:4836 ../fish/guestfish-actions.pod:3744
12805 msgid "This is the same as the C<statvfs(2)> system call."
12809 #: ../src/guestfs-actions.pod:4838
12811 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12812 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12816 #: ../src/guestfs-actions.pod:4842
12817 msgid "guestfs_strings"
12821 #: ../src/guestfs-actions.pod:4844
12824 " char **guestfs_strings (guestfs_h *g,\n"
12825 "\t\tconst char *path);\n"
12830 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3750
12832 "This runs the L<strings(1)> command on a file and returns the list of "
12833 "printable strings found."
12837 #: ../src/guestfs-actions.pod:4857
12838 msgid "guestfs_strings_e"
12842 #: ../src/guestfs-actions.pod:4859
12845 " char **guestfs_strings_e (guestfs_h *g,\n"
12846 "\t\tconst char *encoding,\n"
12847 "\t\tconst char *path);\n"
12852 #: ../src/guestfs-actions.pod:4863
12854 "This is like the C<guestfs_strings> command, but allows you to specify the "
12855 "encoding of strings that are looked for in the source file C<path>."
12859 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3764
12860 msgid "Allowed encodings are:"
12864 #: ../src/guestfs-actions.pod:4871 ../fish/guestfish-actions.pod:3768
12869 #: ../src/guestfs-actions.pod:4873
12871 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12872 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12876 #: ../src/guestfs-actions.pod:4876 ../fish/guestfish-actions.pod:3773
12881 #: ../src/guestfs-actions.pod:4878 ../fish/guestfish-actions.pod:3775
12882 msgid "Single 8-bit-byte characters."
12886 #: ../src/guestfs-actions.pod:4880 ../fish/guestfish-actions.pod:3777
12891 #: ../src/guestfs-actions.pod:4882 ../fish/guestfish-actions.pod:3779
12892 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12896 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3782
12897 msgid "l (lower case letter L)"
12901 #: ../src/guestfs-actions.pod:4887 ../fish/guestfish-actions.pod:3784
12903 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12904 "examining binaries in Windows guests."
12908 #: ../src/guestfs-actions.pod:4890 ../fish/guestfish-actions.pod:3787
12913 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3789
12914 msgid "32-bit big endian such as UCS-4BE."
12918 #: ../src/guestfs-actions.pod:4894 ../fish/guestfish-actions.pod:3791
12923 #: ../src/guestfs-actions.pod:4896 ../fish/guestfish-actions.pod:3793
12924 msgid "32-bit little endian such as UCS-4LE."
12928 #: ../src/guestfs-actions.pod:4900 ../fish/guestfish-actions.pod:3797
12929 msgid "The returned strings are transcoded to UTF-8."
12933 #: ../src/guestfs-actions.pod:4909
12934 msgid "guestfs_swapoff_device"
12938 #: ../src/guestfs-actions.pod:4911
12941 " int guestfs_swapoff_device (guestfs_h *g,\n"
12942 "\t\tconst char *device);\n"
12947 #: ../src/guestfs-actions.pod:4914
12949 "This command disables the libguestfs appliance swap device or partition "
12950 "named C<device>. See C<guestfs_swapon_device>."
12954 #: ../src/guestfs-actions.pod:4920
12955 msgid "guestfs_swapoff_file"
12959 #: ../src/guestfs-actions.pod:4922
12962 " int guestfs_swapoff_file (guestfs_h *g,\n"
12963 "\t\tconst char *file);\n"
12968 #: ../src/guestfs-actions.pod:4925 ../fish/guestfish-actions.pod:3814
12969 msgid "This command disables the libguestfs appliance swap on file."
12973 #: ../src/guestfs-actions.pod:4929
12974 msgid "guestfs_swapoff_label"
12978 #: ../src/guestfs-actions.pod:4931
12981 " int guestfs_swapoff_label (guestfs_h *g,\n"
12982 "\t\tconst char *label);\n"
12987 #: ../src/guestfs-actions.pod:4934 ../fish/guestfish-actions.pod:3820
12989 "This command disables the libguestfs appliance swap on labeled swap "
12994 #: ../src/guestfs-actions.pod:4939
12995 msgid "guestfs_swapoff_uuid"
12999 #: ../src/guestfs-actions.pod:4941
13002 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
13003 "\t\tconst char *uuid);\n"
13008 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3827
13010 "This command disables the libguestfs appliance swap partition with the given "
13015 #: ../src/guestfs-actions.pod:4949
13016 msgid "guestfs_swapon_device"
13020 #: ../src/guestfs-actions.pod:4951
13023 " int guestfs_swapon_device (guestfs_h *g,\n"
13024 "\t\tconst char *device);\n"
13029 #: ../src/guestfs-actions.pod:4954
13031 "This command enables the libguestfs appliance to use the swap device or "
13032 "partition named C<device>. The increased memory is made available for all "
13033 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
13037 #: ../src/guestfs-actions.pod:4959 ../fish/guestfish-actions.pod:3839
13039 "Note that you should not swap to existing guest swap partitions unless you "
13040 "know what you are doing. They may contain hibernation information, or other "
13041 "information that the guest doesn't want you to trash. You also risk leaking "
13042 "information about the host to the guest this way. Instead, attach a new "
13043 "host device to the guest and swap on that."
13047 #: ../src/guestfs-actions.pod:4968
13048 msgid "guestfs_swapon_file"
13052 #: ../src/guestfs-actions.pod:4970
13055 " int guestfs_swapon_file (guestfs_h *g,\n"
13056 "\t\tconst char *file);\n"
13061 #: ../src/guestfs-actions.pod:4973
13063 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
13068 #: ../src/guestfs-actions.pod:4978
13069 msgid "guestfs_swapon_label"
13073 #: ../src/guestfs-actions.pod:4980
13076 " int guestfs_swapon_label (guestfs_h *g,\n"
13077 "\t\tconst char *label);\n"
13082 #: ../src/guestfs-actions.pod:4983
13084 "This command enables swap to a labeled swap partition. See "
13085 "C<guestfs_swapon_device> for other notes."
13089 #: ../src/guestfs-actions.pod:4988
13090 msgid "guestfs_swapon_uuid"
13094 #: ../src/guestfs-actions.pod:4990
13097 " int guestfs_swapon_uuid (guestfs_h *g,\n"
13098 "\t\tconst char *uuid);\n"
13103 #: ../src/guestfs-actions.pod:4993
13105 "This command enables swap to a swap partition with the given UUID. See "
13106 "C<guestfs_swapon_device> for other notes."
13110 #: ../src/guestfs-actions.pod:4998
13111 msgid "guestfs_sync"
13115 #: ../src/guestfs-actions.pod:5000
13118 " int guestfs_sync (guestfs_h *g);\n"
13123 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3871
13125 "This syncs the disk, so that any writes are flushed through to the "
13126 "underlying disk image."
13130 #: ../src/guestfs-actions.pod:5005 ../fish/guestfish-actions.pod:3874
13132 "You should always call this if you have modified a disk image, before "
13133 "closing the handle."
13137 #: ../src/guestfs-actions.pod:5010
13138 msgid "guestfs_tail"
13142 #: ../src/guestfs-actions.pod:5012
13145 " char **guestfs_tail (guestfs_h *g,\n"
13146 "\t\tconst char *path);\n"
13151 #: ../src/guestfs-actions.pod:5015 ../fish/guestfish-actions.pod:3881
13153 "This command returns up to the last 10 lines of a file as a list of strings."
13157 #: ../src/guestfs-actions.pod:5025
13158 msgid "guestfs_tail_n"
13162 #: ../src/guestfs-actions.pod:5027
13165 " char **guestfs_tail_n (guestfs_h *g,\n"
13166 "\t\tint nrlines,\n"
13167 "\t\tconst char *path);\n"
13172 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3891
13174 "If the parameter C<nrlines> is a positive number, this returns the last "
13175 "C<nrlines> lines of the file C<path>."
13179 #: ../src/guestfs-actions.pod:5034 ../fish/guestfish-actions.pod:3894
13181 "If the parameter C<nrlines> is a negative number, this returns lines from "
13182 "the file C<path>, starting with the C<-nrlines>th line."
13186 #: ../src/guestfs-actions.pod:5046
13187 msgid "guestfs_tar_in"
13191 #: ../src/guestfs-actions.pod:5048
13194 " int guestfs_tar_in (guestfs_h *g,\n"
13195 "\t\tconst char *tarfile,\n"
13196 "\t\tconst char *directory);\n"
13201 #: ../src/guestfs-actions.pod:5052 ../fish/guestfish-actions.pod:3906
13203 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13204 "tar file) into C<directory>."
13208 #: ../src/guestfs-actions.pod:5055
13210 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
13214 #: ../src/guestfs-actions.pod:5060
13215 msgid "guestfs_tar_out"
13219 #: ../src/guestfs-actions.pod:5062
13222 " int guestfs_tar_out (guestfs_h *g,\n"
13223 "\t\tconst char *directory,\n"
13224 "\t\tconst char *tarfile);\n"
13229 #: ../src/guestfs-actions.pod:5066 ../fish/guestfish-actions.pod:3918
13231 "This command packs the contents of C<directory> and downloads it to local "
13236 #: ../src/guestfs-actions.pod:5069
13238 "To download a compressed tarball, use C<guestfs_tgz_out> or "
13239 "C<guestfs_txz_out>."
13243 #: ../src/guestfs-actions.pod:5074
13244 msgid "guestfs_tgz_in"
13248 #: ../src/guestfs-actions.pod:5076
13251 " int guestfs_tgz_in (guestfs_h *g,\n"
13252 "\t\tconst char *tarball,\n"
13253 "\t\tconst char *directory);\n"
13258 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3930
13260 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13261 "tar file) into C<directory>."
13265 #: ../src/guestfs-actions.pod:5083
13266 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
13270 #: ../src/guestfs-actions.pod:5087
13271 msgid "guestfs_tgz_out"
13275 #: ../src/guestfs-actions.pod:5089
13278 " int guestfs_tgz_out (guestfs_h *g,\n"
13279 "\t\tconst char *directory,\n"
13280 "\t\tconst char *tarball);\n"
13285 #: ../src/guestfs-actions.pod:5093 ../fish/guestfish-actions.pod:3941
13287 "This command packs the contents of C<directory> and downloads it to local "
13292 #: ../src/guestfs-actions.pod:5096
13293 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
13297 #: ../src/guestfs-actions.pod:5100
13298 msgid "guestfs_touch"
13302 #: ../src/guestfs-actions.pod:5102
13305 " int guestfs_touch (guestfs_h *g,\n"
13306 "\t\tconst char *path);\n"
13311 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3952
13313 "Touch acts like the L<touch(1)> command. It can be used to update the "
13314 "timestamps on a file, or, if the file does not exist, to create a new zero-"
13319 #: ../src/guestfs-actions.pod:5109 ../fish/guestfish-actions.pod:3956
13321 "This command only works on regular files, and will fail on other file types "
13322 "such as directories, symbolic links, block special etc."
13326 #: ../src/guestfs-actions.pod:5114
13327 msgid "guestfs_truncate"
13331 #: ../src/guestfs-actions.pod:5116
13334 " int guestfs_truncate (guestfs_h *g,\n"
13335 "\t\tconst char *path);\n"
13340 #: ../src/guestfs-actions.pod:5119 ../fish/guestfish-actions.pod:3963
13342 "This command truncates C<path> to a zero-length file. The file must exist "
13347 #: ../src/guestfs-actions.pod:5124
13348 msgid "guestfs_truncate_size"
13352 #: ../src/guestfs-actions.pod:5126
13355 " int guestfs_truncate_size (guestfs_h *g,\n"
13356 "\t\tconst char *path,\n"
13357 "\t\tint64_t size);\n"
13362 #: ../src/guestfs-actions.pod:5130 ../fish/guestfish-actions.pod:3970
13364 "This command truncates C<path> to size C<size> bytes. The file must exist "
13369 #: ../src/guestfs-actions.pod:5133
13371 "If the current file size is less than C<size> then the file is extended to "
13372 "the required size with zero bytes. This creates a sparse file (ie. disk "
13373 "blocks are not allocated for the file until you write to it). To create a "
13374 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
13378 #: ../src/guestfs-actions.pod:5141
13379 msgid "guestfs_tune2fs_l"
13383 #: ../src/guestfs-actions.pod:5143
13386 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
13387 "\t\tconst char *device);\n"
13392 #: ../src/guestfs-actions.pod:5146 ../fish/guestfish-actions.pod:3983
13394 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13399 #: ../src/guestfs-actions.pod:5149 ../fish/guestfish-actions.pod:3986
13401 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13402 "for more details. The list of fields returned isn't clearly defined, and "
13403 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13404 "and the filesystem itself."
13408 #: ../src/guestfs-actions.pod:5160
13409 msgid "guestfs_txz_in"
13413 #: ../src/guestfs-actions.pod:5162
13416 " int guestfs_txz_in (guestfs_h *g,\n"
13417 "\t\tconst char *tarball,\n"
13418 "\t\tconst char *directory);\n"
13423 #: ../src/guestfs-actions.pod:5166 ../fish/guestfish-actions.pod:3995
13425 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13426 "tar file) into C<directory>."
13430 #: ../src/guestfs-actions.pod:5171
13431 msgid "guestfs_txz_out"
13435 #: ../src/guestfs-actions.pod:5173
13438 " int guestfs_txz_out (guestfs_h *g,\n"
13439 "\t\tconst char *directory,\n"
13440 "\t\tconst char *tarball);\n"
13445 #: ../src/guestfs-actions.pod:5177 ../fish/guestfish-actions.pod:4004
13447 "This command packs the contents of C<directory> and downloads it to local "
13448 "file C<tarball> (as an xz compressed tar archive)."
13452 #: ../src/guestfs-actions.pod:5182
13453 msgid "guestfs_umask"
13457 #: ../src/guestfs-actions.pod:5184
13460 " int guestfs_umask (guestfs_h *g,\n"
13466 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:4013
13468 "This function sets the mask used for creating new files and device nodes to "
13473 #: ../src/guestfs-actions.pod:5190 ../fish/guestfish-actions.pod:4016
13475 "Typical umask values would be C<022> which creates new files with "
13476 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13477 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13481 #: ../src/guestfs-actions.pod:5195 ../fish/guestfish-actions.pod:4021
13483 "The default umask is C<022>. This is important because it means that "
13484 "directories and device nodes will be created with C<0644> or C<0755> mode "
13485 "even if you specify C<0777>."
13489 #: ../src/guestfs-actions.pod:5199
13491 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
13492 "C<guestfs_mkdir>."
13496 #: ../src/guestfs-actions.pod:5202 ../fish/guestfish-actions.pod:4028
13497 msgid "This call returns the previous umask."
13501 #: ../src/guestfs-actions.pod:5206
13502 msgid "guestfs_umount"
13506 #: ../src/guestfs-actions.pod:5208
13509 " int guestfs_umount (guestfs_h *g,\n"
13510 "\t\tconst char *pathordevice);\n"
13515 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:4036
13517 "This unmounts the given filesystem. The filesystem may be specified either "
13518 "by its mountpoint (path) or the device which contains the filesystem."
13522 #: ../src/guestfs-actions.pod:5217
13523 msgid "guestfs_umount_all"
13527 #: ../src/guestfs-actions.pod:5219
13530 " int guestfs_umount_all (guestfs_h *g);\n"
13535 #: ../src/guestfs-actions.pod:5221 ../fish/guestfish-actions.pod:4046
13536 msgid "This unmounts all mounted filesystems."
13540 #: ../src/guestfs-actions.pod:5223 ../fish/guestfish-actions.pod:4048
13541 msgid "Some internal mounts are not unmounted by this call."
13545 #: ../src/guestfs-actions.pod:5227
13546 msgid "guestfs_upload"
13550 #: ../src/guestfs-actions.pod:5229
13553 " int guestfs_upload (guestfs_h *g,\n"
13554 "\t\tconst char *filename,\n"
13555 "\t\tconst char *remotefilename);\n"
13560 #: ../src/guestfs-actions.pod:5233 ../src/guestfs-actions.pod:5249
13561 #: ../fish/guestfish-actions.pod:4054 ../fish/guestfish-actions.pod:4067
13562 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13566 #: ../src/guestfs-actions.pod:5238
13567 msgid "See also C<guestfs_download>."
13571 #: ../src/guestfs-actions.pod:5242
13572 msgid "guestfs_upload_offset"
13576 #: ../src/guestfs-actions.pod:5244
13579 " int guestfs_upload_offset (guestfs_h *g,\n"
13580 "\t\tconst char *filename,\n"
13581 "\t\tconst char *remotefilename,\n"
13582 "\t\tint64_t offset);\n"
13587 #: ../src/guestfs-actions.pod:5252 ../fish/guestfish-actions.pod:4070
13589 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
13590 "The intention is to overwrite parts of existing files or devices, although "
13591 "if a non-existant file is specified then it is created with a \"hole\" "
13592 "before C<offset>. The size of the data written is implicit in the size of "
13593 "the source C<filename>."
13597 #: ../src/guestfs-actions.pod:5259
13599 "Note that there is no limit on the amount of data that can be uploaded with "
13600 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
13601 "full amount unless an error occurs."
13605 #: ../src/guestfs-actions.pod:5264
13606 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
13610 #: ../src/guestfs-actions.pod:5268
13611 msgid "guestfs_utimens"
13615 #: ../src/guestfs-actions.pod:5270
13618 " int guestfs_utimens (guestfs_h *g,\n"
13619 "\t\tconst char *path,\n"
13620 "\t\tint64_t atsecs,\n"
13621 "\t\tint64_t atnsecs,\n"
13622 "\t\tint64_t mtsecs,\n"
13623 "\t\tint64_t mtnsecs);\n"
13628 #: ../src/guestfs-actions.pod:5277 ../fish/guestfish-actions.pod:4090
13629 msgid "This command sets the timestamps of a file with nanosecond precision."
13633 #: ../src/guestfs-actions.pod:5280 ../fish/guestfish-actions.pod:4093
13635 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
13640 #: ../src/guestfs-actions.pod:5283 ../fish/guestfish-actions.pod:4096
13642 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
13643 "nanoseconds from the epoch."
13647 #: ../src/guestfs-actions.pod:5286 ../fish/guestfish-actions.pod:4099
13649 "If the C<*nsecs> field contains the special value C<-1> then the "
13650 "corresponding timestamp is set to the current time. (The C<*secs> field is "
13651 "ignored in this case)."
13655 #: ../src/guestfs-actions.pod:5290 ../fish/guestfish-actions.pod:4103
13657 "If the C<*nsecs> field contains the special value C<-2> then the "
13658 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
13663 #: ../src/guestfs-actions.pod:5296 ../src/guestfs-structs.pod:175
13664 msgid "guestfs_version"
13668 #: ../src/guestfs-actions.pod:5298
13671 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
13676 #: ../src/guestfs-actions.pod:5300 ../fish/guestfish-actions.pod:4111
13678 "Return the libguestfs version number that the program is linked against."
13682 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:4114
13684 "Note that because of dynamic linking this is not necessarily the version of "
13685 "libguestfs that you compiled against. You can compile the program, and then "
13686 "at runtime dynamically link against a completely different C<libguestfs.so> "
13691 #: ../src/guestfs-actions.pod:5308 ../fish/guestfish-actions.pod:4119
13693 "This call was added in version C<1.0.58>. In previous versions of "
13694 "libguestfs there was no way to get the version number. From C code you can "
13695 "use dynamic linker functions to find out if this symbol exists (if it "
13696 "doesn't, then it's an earlier version)."
13700 #: ../src/guestfs-actions.pod:5314 ../fish/guestfish-actions.pod:4125
13702 "The call returns a structure with four elements. The first three (C<major>, "
13703 "C<minor> and C<release>) are numbers and correspond to the usual version "
13704 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13705 "but may be used for distro-specific information."
13709 #: ../src/guestfs-actions.pod:5320 ../fish/guestfish-actions.pod:4131
13711 "To construct the original version string: C<$major.$minor.$release$extra>"
13715 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:4134
13716 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13720 #: ../src/guestfs-actions.pod:5325
13722 "I<Note:> Don't use this call to test for availability of features. In "
13723 "enterprise distributions we backport features from later versions into "
13724 "earlier versions, making this an unreliable way to test for features. Use "
13725 "C<guestfs_available> instead."
13729 #: ../src/guestfs-actions.pod:5331
13731 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13732 "error. I<The caller must call C<guestfs_free_version> after use>."
13736 #: ../src/guestfs-actions.pod:5335
13737 msgid "guestfs_vfs_label"
13741 #: ../src/guestfs-actions.pod:5337
13744 " char *guestfs_vfs_label (guestfs_h *g,\n"
13745 "\t\tconst char *device);\n"
13750 #: ../src/guestfs-actions.pod:5340 ../fish/guestfish-actions.pod:4146
13751 msgid "This returns the filesystem label of the filesystem on C<device>."
13755 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4149
13756 msgid "If the filesystem is unlabeled, this returns the empty string."
13760 #: ../src/guestfs-actions.pod:5345
13761 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13765 #: ../src/guestfs-actions.pod:5350
13766 msgid "guestfs_vfs_type"
13770 #: ../src/guestfs-actions.pod:5352
13773 " char *guestfs_vfs_type (guestfs_h *g,\n"
13774 "\t\tconst char *device);\n"
13779 #: ../src/guestfs-actions.pod:5355 ../fish/guestfish-actions.pod:4157
13781 "This command gets the filesystem type corresponding to the filesystem on "
13786 #: ../src/guestfs-actions.pod:5358 ../fish/guestfish-actions.pod:4160
13788 "For most filesystems, the result is the name of the Linux VFS module which "
13789 "would be used to mount this filesystem if you mounted it without specifying "
13790 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13794 #: ../src/guestfs-actions.pod:5366
13795 msgid "guestfs_vfs_uuid"
13799 #: ../src/guestfs-actions.pod:5368
13802 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13803 "\t\tconst char *device);\n"
13808 #: ../src/guestfs-actions.pod:5371 ../fish/guestfish-actions.pod:4169
13809 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13813 #: ../src/guestfs-actions.pod:5374 ../fish/guestfish-actions.pod:4172
13814 msgid "If the filesystem does not have a UUID, this returns the empty string."
13818 #: ../src/guestfs-actions.pod:5376
13819 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13823 #: ../src/guestfs-actions.pod:5381
13824 msgid "guestfs_vg_activate"
13828 #: ../src/guestfs-actions.pod:5383
13831 " int guestfs_vg_activate (guestfs_h *g,\n"
13832 "\t\tint activate,\n"
13833 "\t\tchar *const *volgroups);\n"
13838 #: ../src/guestfs-actions.pod:5387 ../fish/guestfish-actions.pod:4180
13840 "This command activates or (if C<activate> is false) deactivates all logical "
13841 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13842 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13843 "deactivated, then those devices disappear."
13847 #: ../src/guestfs-actions.pod:5393 ../fish/guestfish-actions.pod:4186
13848 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13852 #: ../src/guestfs-actions.pod:5395 ../fish/guestfish-actions.pod:4188
13854 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13855 "activated or deactivated."
13859 #: ../src/guestfs-actions.pod:5400
13860 msgid "guestfs_vg_activate_all"
13864 #: ../src/guestfs-actions.pod:5402
13867 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13868 "\t\tint activate);\n"
13873 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:4195
13875 "This command activates or (if C<activate> is false) deactivates all logical "
13876 "volumes in all volume groups. If activated, then they are made known to the "
13877 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13878 "those devices disappear."
13882 #: ../src/guestfs-actions.pod:5411 ../fish/guestfish-actions.pod:4201
13883 msgid "This command is the same as running C<vgchange -a y|n>"
13887 #: ../src/guestfs-actions.pod:5415
13888 msgid "guestfs_vgcreate"
13892 #: ../src/guestfs-actions.pod:5417
13895 " int guestfs_vgcreate (guestfs_h *g,\n"
13896 "\t\tconst char *volgroup,\n"
13897 "\t\tchar *const *physvols);\n"
13902 #: ../src/guestfs-actions.pod:5421 ../fish/guestfish-actions.pod:4207
13904 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13905 "of physical volumes C<physvols>."
13909 #: ../src/guestfs-actions.pod:5426
13910 msgid "guestfs_vglvuuids"
13914 #: ../src/guestfs-actions.pod:5428
13917 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13918 "\t\tconst char *vgname);\n"
13923 #: ../src/guestfs-actions.pod:5431 ../fish/guestfish-actions.pod:4214
13925 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13926 "volumes created in this volume group."
13930 #: ../src/guestfs-actions.pod:5434
13932 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13933 "associate logical volumes and volume groups."
13937 #: ../src/guestfs-actions.pod:5437
13938 msgid "See also C<guestfs_vgpvuuids>."
13942 #: ../src/guestfs-actions.pod:5443
13943 msgid "guestfs_vgpvuuids"
13947 #: ../src/guestfs-actions.pod:5445
13950 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13951 "\t\tconst char *vgname);\n"
13956 #: ../src/guestfs-actions.pod:5448 ../fish/guestfish-actions.pod:4226
13958 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13959 "volumes that this volume group resides on."
13963 #: ../src/guestfs-actions.pod:5451
13965 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13966 "associate physical volumes and volume groups."
13970 #: ../src/guestfs-actions.pod:5454
13971 msgid "See also C<guestfs_vglvuuids>."
13975 #: ../src/guestfs-actions.pod:5460
13976 msgid "guestfs_vgremove"
13980 #: ../src/guestfs-actions.pod:5462
13983 " int guestfs_vgremove (guestfs_h *g,\n"
13984 "\t\tconst char *vgname);\n"
13989 #: ../src/guestfs-actions.pod:5465 ../fish/guestfish-actions.pod:4238
13990 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13994 #: ../src/guestfs-actions.pod:5467 ../fish/guestfish-actions.pod:4240
13996 "This also forcibly removes all logical volumes in the volume group (if any)."
14000 #: ../src/guestfs-actions.pod:5472
14001 msgid "guestfs_vgrename"
14005 #: ../src/guestfs-actions.pod:5474
14008 " int guestfs_vgrename (guestfs_h *g,\n"
14009 "\t\tconst char *volgroup,\n"
14010 "\t\tconst char *newvolgroup);\n"
14015 #: ../src/guestfs-actions.pod:5478 ../fish/guestfish-actions.pod:4247
14016 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14020 #: ../src/guestfs-actions.pod:5482
14021 msgid "guestfs_vgs"
14025 #: ../src/guestfs-actions.pod:5484
14028 " char **guestfs_vgs (guestfs_h *g);\n"
14033 #: ../src/guestfs-actions.pod:5486 ../fish/guestfish-actions.pod:4253
14035 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14040 #: ../src/guestfs-actions.pod:5489 ../fish/guestfish-actions.pod:4256
14042 "This returns a list of just the volume group names that were detected (eg. "
14047 #: ../src/guestfs-actions.pod:5492
14048 msgid "See also C<guestfs_vgs_full>."
14052 #: ../src/guestfs-actions.pod:5498
14053 msgid "guestfs_vgs_full"
14057 #: ../src/guestfs-actions.pod:5500
14060 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
14065 #: ../src/guestfs-actions.pod:5502 ../fish/guestfish-actions.pod:4265
14067 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14068 "> command. The \"full\" version includes all fields."
14072 #: ../src/guestfs-actions.pod:5505
14074 "This function returns a C<struct guestfs_lvm_vg_list *> (see E<lt>guestfs-"
14075 "structs.hE<gt>), or NULL if there was an error. I<The caller must call "
14076 "C<guestfs_free_lvm_vg_list> after use>."
14080 #: ../src/guestfs-actions.pod:5510
14081 msgid "guestfs_vgscan"
14085 #: ../src/guestfs-actions.pod:5512
14088 " int guestfs_vgscan (guestfs_h *g);\n"
14093 #: ../src/guestfs-actions.pod:5514 ../fish/guestfish-actions.pod:4272
14095 "This rescans all block devices and rebuilds the list of LVM physical "
14096 "volumes, volume groups and logical volumes."
14100 #: ../src/guestfs-actions.pod:5519
14101 msgid "guestfs_vguuid"
14105 #: ../src/guestfs-actions.pod:5521
14108 " char *guestfs_vguuid (guestfs_h *g,\n"
14109 "\t\tconst char *vgname);\n"
14114 #: ../src/guestfs-actions.pod:5524 ../fish/guestfish-actions.pod:4279
14115 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14119 #: ../src/guestfs-actions.pod:5529
14120 msgid "guestfs_wait_ready"
14124 #: ../src/guestfs-actions.pod:5531
14127 " int guestfs_wait_ready (guestfs_h *g);\n"
14132 #: ../src/guestfs-actions.pod:5533
14133 msgid "This function is a no op."
14137 #: ../src/guestfs-actions.pod:5535
14139 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
14140 "calling C<guestfs_launch> to wait for the launch to complete. However this "
14141 "is no longer necessary because C<guestfs_launch> now does the waiting."
14145 #: ../src/guestfs-actions.pod:5540
14147 "If you see any calls to this function in code then you can just remove them, "
14148 "unless you want to retain compatibility with older versions of the API."
14152 #: ../src/guestfs-actions.pod:5546
14153 msgid "guestfs_wc_c"
14157 #: ../src/guestfs-actions.pod:5548
14160 " int guestfs_wc_c (guestfs_h *g,\n"
14161 "\t\tconst char *path);\n"
14166 #: ../src/guestfs-actions.pod:5551 ../fish/guestfish-actions.pod:4285
14168 "This command counts the characters in a file, using the C<wc -c> external "
14173 #: ../src/guestfs-actions.pod:5556
14174 msgid "guestfs_wc_l"
14178 #: ../src/guestfs-actions.pod:5558
14181 " int guestfs_wc_l (guestfs_h *g,\n"
14182 "\t\tconst char *path);\n"
14187 #: ../src/guestfs-actions.pod:5561 ../fish/guestfish-actions.pod:4292
14189 "This command counts the lines in a file, using the C<wc -l> external command."
14193 #: ../src/guestfs-actions.pod:5566
14194 msgid "guestfs_wc_w"
14198 #: ../src/guestfs-actions.pod:5568
14201 " int guestfs_wc_w (guestfs_h *g,\n"
14202 "\t\tconst char *path);\n"
14207 #: ../src/guestfs-actions.pod:5571 ../fish/guestfish-actions.pod:4299
14209 "This command counts the words in a file, using the C<wc -w> external command."
14213 #: ../src/guestfs-actions.pod:5576
14214 msgid "guestfs_write"
14218 #: ../src/guestfs-actions.pod:5578
14221 " int guestfs_write (guestfs_h *g,\n"
14222 "\t\tconst char *path,\n"
14223 "\t\tconst char *content,\n"
14224 "\t\tsize_t content_size);\n"
14229 #: ../src/guestfs-actions.pod:5583 ../fish/guestfish-actions.pod:4306
14231 "This call creates a file called C<path>. The content of the file is the "
14232 "string C<content> (which can contain any 8 bit data)."
14236 #: ../src/guestfs-actions.pod:5591
14237 msgid "guestfs_write_file"
14241 #: ../src/guestfs-actions.pod:5593
14244 " int guestfs_write_file (guestfs_h *g,\n"
14245 "\t\tconst char *path,\n"
14246 "\t\tconst char *content,\n"
14252 #: ../src/guestfs-actions.pod:5598 ../fish/guestfish-actions.pod:4316
14254 "This call creates a file called C<path>. The contents of the file is the "
14255 "string C<content> (which can contain any 8 bit data), with length C<size>."
14259 #: ../src/guestfs-actions.pod:5602 ../fish/guestfish-actions.pod:4320
14261 "As a special case, if C<size> is C<0> then the length is calculated using "
14262 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14266 #: ../src/guestfs-actions.pod:5606 ../fish/guestfish-actions.pod:4324
14268 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14269 "I<not> work, even if the length is specified."
14273 #: ../src/guestfs-actions.pod:5614 ../fish/guestfish-actions.pod:4330
14275 "This function is deprecated. In new code, use the C<write> call instead."
14279 #: ../src/guestfs-actions.pod:5621
14280 msgid "guestfs_zegrep"
14284 #: ../src/guestfs-actions.pod:5623
14287 " char **guestfs_zegrep (guestfs_h *g,\n"
14288 "\t\tconst char *regex,\n"
14289 "\t\tconst char *path);\n"
14294 #: ../src/guestfs-actions.pod:5627 ../fish/guestfish-actions.pod:4341
14296 "This calls the external C<zegrep> program and returns the matching lines."
14300 #: ../src/guestfs-actions.pod:5637
14301 msgid "guestfs_zegrepi"
14305 #: ../src/guestfs-actions.pod:5639
14308 " char **guestfs_zegrepi (guestfs_h *g,\n"
14309 "\t\tconst char *regex,\n"
14310 "\t\tconst char *path);\n"
14315 #: ../src/guestfs-actions.pod:5643 ../fish/guestfish-actions.pod:4351
14317 "This calls the external C<zegrep -i> program and returns the matching lines."
14321 #: ../src/guestfs-actions.pod:5653
14322 msgid "guestfs_zero"
14326 #: ../src/guestfs-actions.pod:5655
14329 " int guestfs_zero (guestfs_h *g,\n"
14330 "\t\tconst char *device);\n"
14335 #: ../src/guestfs-actions.pod:5658 ../fish/guestfish-actions.pod:4361
14336 msgid "This command writes zeroes over the first few blocks of C<device>."
14340 #: ../src/guestfs-actions.pod:5660 ../fish/guestfish-actions.pod:4363
14342 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14343 "securely wipe the device). It should be sufficient to remove any partition "
14344 "tables, filesystem superblocks and so on."
14348 #: ../src/guestfs-actions.pod:5664
14349 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
14353 #: ../src/guestfs-actions.pod:5673
14354 msgid "guestfs_zero_device"
14358 #: ../src/guestfs-actions.pod:5675
14361 " int guestfs_zero_device (guestfs_h *g,\n"
14362 "\t\tconst char *device);\n"
14367 #: ../src/guestfs-actions.pod:5678
14369 "This command writes zeroes over the entire C<device>. Compare with "
14370 "C<guestfs_zero> which just zeroes the first few blocks of a device."
14374 #: ../src/guestfs-actions.pod:5692
14375 msgid "guestfs_zerofree"
14379 #: ../src/guestfs-actions.pod:5694
14382 " int guestfs_zerofree (guestfs_h *g,\n"
14383 "\t\tconst char *device);\n"
14388 #: ../src/guestfs-actions.pod:5697 ../fish/guestfish-actions.pod:4384
14390 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14391 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14392 "possible to compress the filesystem more effectively."
14396 #: ../src/guestfs-actions.pod:5702 ../fish/guestfish-actions.pod:4389
14397 msgid "You should B<not> run this program if the filesystem is mounted."
14401 #: ../src/guestfs-actions.pod:5705 ../fish/guestfish-actions.pod:4392
14403 "It is possible that using this program can damage the filesystem or data on "
14408 #: ../src/guestfs-actions.pod:5710
14409 msgid "guestfs_zfgrep"
14413 #: ../src/guestfs-actions.pod:5712
14416 " char **guestfs_zfgrep (guestfs_h *g,\n"
14417 "\t\tconst char *pattern,\n"
14418 "\t\tconst char *path);\n"
14423 #: ../src/guestfs-actions.pod:5716 ../fish/guestfish-actions.pod:4399
14425 "This calls the external C<zfgrep> program and returns the matching lines."
14429 #: ../src/guestfs-actions.pod:5726
14430 msgid "guestfs_zfgrepi"
14434 #: ../src/guestfs-actions.pod:5728
14437 " char **guestfs_zfgrepi (guestfs_h *g,\n"
14438 "\t\tconst char *pattern,\n"
14439 "\t\tconst char *path);\n"
14444 #: ../src/guestfs-actions.pod:5732 ../fish/guestfish-actions.pod:4409
14446 "This calls the external C<zfgrep -i> program and returns the matching lines."
14450 #: ../src/guestfs-actions.pod:5742
14451 msgid "guestfs_zfile"
14455 #: ../src/guestfs-actions.pod:5744
14458 " char *guestfs_zfile (guestfs_h *g,\n"
14459 "\t\tconst char *meth,\n"
14460 "\t\tconst char *path);\n"
14465 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:4419
14467 "This command runs C<file> after first decompressing C<path> using C<method>."
14471 #: ../src/guestfs-actions.pod:5751 ../fish/guestfish-actions.pod:4422
14472 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14476 #: ../src/guestfs-actions.pod:5753
14478 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
14483 #: ../src/guestfs-actions.pod:5759 ../fish/guestfish-actions.pod:4427
14485 "This function is deprecated. In new code, use the C<file> call instead."
14489 #: ../src/guestfs-actions.pod:5766
14490 msgid "guestfs_zgrep"
14494 #: ../src/guestfs-actions.pod:5768
14497 " char **guestfs_zgrep (guestfs_h *g,\n"
14498 "\t\tconst char *regex,\n"
14499 "\t\tconst char *path);\n"
14504 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:4438
14506 "This calls the external C<zgrep> program and returns the matching lines."
14510 #: ../src/guestfs-actions.pod:5782
14511 msgid "guestfs_zgrepi"
14515 #: ../src/guestfs-actions.pod:5784
14518 " char **guestfs_zgrepi (guestfs_h *g,\n"
14519 "\t\tconst char *regex,\n"
14520 "\t\tconst char *path);\n"
14525 #: ../src/guestfs-actions.pod:5788 ../fish/guestfish-actions.pod:4448
14527 "This calls the external C<zgrep -i> program and returns the matching lines."
14531 #: ../src/guestfs-availability.pod:3
14536 #: ../src/guestfs-availability.pod:5
14538 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
14539 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
14540 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
14541 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
14542 "L</guestfs_aug_save> L</guestfs_aug_set>"
14546 #: ../src/guestfs-availability.pod:21
14551 #: ../src/guestfs-availability.pod:23
14553 "The following functions: L</guestfs_inotify_add_watch> L</"
14554 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
14555 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
14559 #: ../src/guestfs-availability.pod:31
14560 msgid "B<linuxfsuuid>"
14564 #: ../src/guestfs-availability.pod:33
14566 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
14567 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
14571 #: ../src/guestfs-availability.pod:40
14572 msgid "B<linuxmodules>"
14576 #: ../src/guestfs-availability.pod:42
14577 msgid "The following functions: L</guestfs_modprobe>"
14581 #: ../src/guestfs-availability.pod:45
14582 msgid "B<linuxxattrs>"
14586 #: ../src/guestfs-availability.pod:47
14588 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
14589 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
14590 "guestfs_removexattr> L</guestfs_setxattr>"
14594 #: ../src/guestfs-availability.pod:56
14599 #: ../src/guestfs-availability.pod:58
14601 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
14602 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
14603 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
14607 #: ../src/guestfs-availability.pod:67
14612 #: ../src/guestfs-availability.pod:69
14614 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
14615 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
14616 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
14617 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
14618 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
14619 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
14620 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
14624 #: ../src/guestfs-availability.pod:92
14629 #: ../src/guestfs-availability.pod:94
14631 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
14632 "guestfs_mknod_b> L</guestfs_mknod_c>"
14636 #: ../src/guestfs-availability.pod:100
14641 #: ../src/guestfs-availability.pod:102
14642 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
14646 #: ../src/guestfs-availability.pod:105
14647 msgid "B<ntfsprogs>"
14651 #: ../src/guestfs-availability.pod:107
14653 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
14657 #: ../src/guestfs-availability.pod:111
14658 msgid "B<realpath>"
14662 #: ../src/guestfs-availability.pod:113
14663 msgid "The following functions: L</guestfs_realpath>"
14667 #: ../src/guestfs-availability.pod:116
14672 #: ../src/guestfs-availability.pod:118
14674 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
14675 "guestfs_scrub_freespace>"
14679 #: ../src/guestfs-availability.pod:123
14684 #: ../src/guestfs-availability.pod:125
14685 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14689 #: ../src/guestfs-availability.pod:129
14694 #: ../src/guestfs-availability.pod:131
14695 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14699 #: ../src/guestfs-availability.pod:135
14700 msgid "B<zerofree>"
14704 #: ../src/guestfs-availability.pod:137
14705 msgid "The following functions: L</guestfs_zerofree>"
14709 #: ../src/guestfs-structs.pod:1
14710 msgid "guestfs_int_bool"
14714 #: ../src/guestfs-structs.pod:3
14717 " struct guestfs_int_bool {\n"
14725 #: ../src/guestfs-structs.pod:8
14728 " struct guestfs_int_bool_list {\n"
14729 " uint32_t len; /* Number of elements in list. */\n"
14730 " struct guestfs_int_bool *val; /* Elements. */\n"
14736 #: ../src/guestfs-structs.pod:13
14739 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14740 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14745 #: ../src/guestfs-structs.pod:16
14746 msgid "guestfs_lvm_pv"
14750 #: ../src/guestfs-structs.pod:18
14753 " struct guestfs_lvm_pv {\n"
14754 " char *pv_name;\n"
14755 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14756 " char pv_uuid[32];\n"
14758 " uint64_t pv_size;\n"
14759 " uint64_t dev_size;\n"
14760 " uint64_t pv_free;\n"
14761 " uint64_t pv_used;\n"
14762 " char *pv_attr;\n"
14763 " int64_t pv_pe_count;\n"
14764 " int64_t pv_pe_alloc_count;\n"
14765 " char *pv_tags;\n"
14766 " uint64_t pe_start;\n"
14767 " int64_t pv_mda_count;\n"
14768 " uint64_t pv_mda_free;\n"
14774 #: ../src/guestfs-structs.pod:36
14777 " struct guestfs_lvm_pv_list {\n"
14778 " uint32_t len; /* Number of elements in list. */\n"
14779 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14785 #: ../src/guestfs-structs.pod:41
14788 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14789 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14794 #: ../src/guestfs-structs.pod:44
14795 msgid "guestfs_lvm_vg"
14799 #: ../src/guestfs-structs.pod:46
14802 " struct guestfs_lvm_vg {\n"
14803 " char *vg_name;\n"
14804 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14805 " char vg_uuid[32];\n"
14807 " char *vg_attr;\n"
14808 " uint64_t vg_size;\n"
14809 " uint64_t vg_free;\n"
14810 " char *vg_sysid;\n"
14811 " uint64_t vg_extent_size;\n"
14812 " int64_t vg_extent_count;\n"
14813 " int64_t vg_free_count;\n"
14814 " int64_t max_lv;\n"
14815 " int64_t max_pv;\n"
14816 " int64_t pv_count;\n"
14817 " int64_t lv_count;\n"
14818 " int64_t snap_count;\n"
14819 " int64_t vg_seqno;\n"
14820 " char *vg_tags;\n"
14821 " int64_t vg_mda_count;\n"
14822 " uint64_t vg_mda_free;\n"
14828 #: ../src/guestfs-structs.pod:69
14831 " struct guestfs_lvm_vg_list {\n"
14832 " uint32_t len; /* Number of elements in list. */\n"
14833 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14839 #: ../src/guestfs-structs.pod:74
14842 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14843 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14848 #: ../src/guestfs-structs.pod:77
14849 msgid "guestfs_lvm_lv"
14853 #: ../src/guestfs-structs.pod:79
14856 " struct guestfs_lvm_lv {\n"
14857 " char *lv_name;\n"
14858 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
14859 " char lv_uuid[32];\n"
14860 " char *lv_attr;\n"
14861 " int64_t lv_major;\n"
14862 " int64_t lv_minor;\n"
14863 " int64_t lv_kernel_major;\n"
14864 " int64_t lv_kernel_minor;\n"
14865 " uint64_t lv_size;\n"
14866 " int64_t seg_count;\n"
14868 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14869 " float snap_percent;\n"
14870 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14871 " float copy_percent;\n"
14872 " char *move_pv;\n"
14873 " char *lv_tags;\n"
14874 " char *mirror_log;\n"
14875 " char *modules;\n"
14881 #: ../src/guestfs-structs.pod:101
14884 " struct guestfs_lvm_lv_list {\n"
14885 " uint32_t len; /* Number of elements in list. */\n"
14886 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14892 #: ../src/guestfs-structs.pod:106
14895 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14896 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14901 #: ../src/guestfs-structs.pod:111
14904 " struct guestfs_stat {\n"
14908 " int64_t nlink;\n"
14913 " int64_t blksize;\n"
14914 " int64_t blocks;\n"
14915 " int64_t atime;\n"
14916 " int64_t mtime;\n"
14917 " int64_t ctime;\n"
14923 #: ../src/guestfs-structs.pod:127
14926 " struct guestfs_stat_list {\n"
14927 " uint32_t len; /* Number of elements in list. */\n"
14928 " struct guestfs_stat *val; /* Elements. */\n"
14934 #: ../src/guestfs-structs.pod:132
14937 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14938 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14943 #: ../src/guestfs-structs.pod:137
14946 " struct guestfs_statvfs {\n"
14947 " int64_t bsize;\n"
14948 " int64_t frsize;\n"
14949 " int64_t blocks;\n"
14950 " int64_t bfree;\n"
14951 " int64_t bavail;\n"
14952 " int64_t files;\n"
14953 " int64_t ffree;\n"
14954 " int64_t favail;\n"
14957 " int64_t namemax;\n"
14963 #: ../src/guestfs-structs.pod:151
14966 " struct guestfs_statvfs_list {\n"
14967 " uint32_t len; /* Number of elements in list. */\n"
14968 " struct guestfs_statvfs *val; /* Elements. */\n"
14974 #: ../src/guestfs-structs.pod:156
14977 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14978 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14983 #: ../src/guestfs-structs.pod:159
14984 msgid "guestfs_dirent"
14988 #: ../src/guestfs-structs.pod:161
14991 " struct guestfs_dirent {\n"
15000 #: ../src/guestfs-structs.pod:167
15003 " struct guestfs_dirent_list {\n"
15004 " uint32_t len; /* Number of elements in list. */\n"
15005 " struct guestfs_dirent *val; /* Elements. */\n"
15011 #: ../src/guestfs-structs.pod:172
15014 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
15015 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
15020 #: ../src/guestfs-structs.pod:177
15023 " struct guestfs_version {\n"
15024 " int64_t major;\n"
15025 " int64_t minor;\n"
15026 " int64_t release;\n"
15033 #: ../src/guestfs-structs.pod:184
15036 " struct guestfs_version_list {\n"
15037 " uint32_t len; /* Number of elements in list. */\n"
15038 " struct guestfs_version *val; /* Elements. */\n"
15044 #: ../src/guestfs-structs.pod:189
15047 " void guestfs_free_version (struct guestfs_free_version *);\n"
15048 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
15053 #: ../src/guestfs-structs.pod:192
15054 msgid "guestfs_xattr"
15058 #: ../src/guestfs-structs.pod:194
15061 " struct guestfs_xattr {\n"
15062 " char *attrname;\n"
15063 " /* The next two fields describe a byte array. */\n"
15064 " uint32_t attrval_len;\n"
15065 " char *attrval;\n"
15071 #: ../src/guestfs-structs.pod:201
15074 " struct guestfs_xattr_list {\n"
15075 " uint32_t len; /* Number of elements in list. */\n"
15076 " struct guestfs_xattr *val; /* Elements. */\n"
15082 #: ../src/guestfs-structs.pod:206
15085 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
15086 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
15091 #: ../src/guestfs-structs.pod:209
15092 msgid "guestfs_inotify_event"
15096 #: ../src/guestfs-structs.pod:211
15099 " struct guestfs_inotify_event {\n"
15100 " int64_t in_wd;\n"
15101 " uint32_t in_mask;\n"
15102 " uint32_t in_cookie;\n"
15103 " char *in_name;\n"
15109 #: ../src/guestfs-structs.pod:218
15112 " struct guestfs_inotify_event_list {\n"
15113 " uint32_t len; /* Number of elements in list. */\n"
15114 " struct guestfs_inotify_event *val; /* Elements. */\n"
15120 #: ../src/guestfs-structs.pod:223
15123 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
15124 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
15129 #: ../src/guestfs-structs.pod:226
15130 msgid "guestfs_partition"
15134 #: ../src/guestfs-structs.pod:228
15137 " struct guestfs_partition {\n"
15138 " int32_t part_num;\n"
15139 " uint64_t part_start;\n"
15140 " uint64_t part_end;\n"
15141 " uint64_t part_size;\n"
15147 #: ../src/guestfs-structs.pod:235
15150 " struct guestfs_partition_list {\n"
15151 " uint32_t len; /* Number of elements in list. */\n"
15152 " struct guestfs_partition *val; /* Elements. */\n"
15158 #: ../src/guestfs-structs.pod:240
15161 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
15162 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
15167 #: ../fish/guestfish.pod:5
15168 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15172 #: ../fish/guestfish.pod:9
15175 " guestfish [--options] [commands]\n"
15180 #: ../fish/guestfish.pod:11
15188 #: ../fish/guestfish.pod:13
15191 " guestfish -a disk.img\n"
15196 #: ../fish/guestfish.pod:15
15199 " guestfish -a disk.img -m dev[:mountpoint]\n"
15204 #: ../fish/guestfish.pod:17
15207 " guestfish -d libvirt-domain\n"
15212 #: ../fish/guestfish.pod:19
15215 " guestfish -a disk.img -i\n"
15220 #: ../fish/guestfish.pod:21
15223 " guestfish -d libvirt-domain -i\n"
15228 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
15229 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
15230 #: ../tools/virt-rescue.pl:41
15235 #: ../fish/guestfish.pod:25
15237 "Using guestfish in read/write mode on live virtual machines can be "
15238 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15239 "option to use guestfish safely if the disk image or virtual machine might be "
15244 #: ../fish/guestfish.pod:32
15246 "Guestfish is a shell and command-line tool for examining and modifying "
15247 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15248 "functionality of the guestfs API, see L<guestfs(3)>."
15252 #: ../fish/guestfish.pod:36
15254 "Guestfish gives you structured access to the libguestfs API, from shell "
15255 "scripts or the command line or interactively. If you want to rescue a "
15256 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15261 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:800
15262 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
15263 #: ../tools/virt-resize.pl:66 ../tools/virt-cat.pl:50 ../tools/virt-tar.pl:45
15268 #: ../fish/guestfish.pod:43
15269 msgid "As an interactive shell"
15273 #: ../fish/guestfish.pod:45
15281 #: ../fish/guestfish.pod:47
15284 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15285 " editing virtual machine filesystems.\n"
15290 #: ../fish/guestfish.pod:50
15293 " Type: 'help' for a list of commands\n"
15294 " 'man' to read the manual\n"
15295 " 'quit' to quit the shell\n"
15300 #: ../fish/guestfish.pod:54
15303 " ><fs> add-ro disk.img\n"
15305 " ><fs> list-filesystems\n"
15306 " /dev/sda1: ext4\n"
15307 " /dev/vg_guest/lv_root: ext4\n"
15308 " /dev/vg_guest/lv_swap: swap\n"
15309 " ><fs> mount /dev/vg_guest/lv_root /\n"
15310 " ><fs> cat /etc/fstab\n"
15312 " # Created by anaconda\n"
15319 #: ../fish/guestfish.pod:67
15320 msgid "From shell scripts"
15324 #: ../fish/guestfish.pod:69
15325 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15329 #: ../fish/guestfish.pod:71
15332 " guestfish <<_EOF_\n"
15335 " mount /dev/vg_guest/lv_root /\n"
15336 " write /etc/motd \"Welcome, new users\"\n"
15342 #: ../fish/guestfish.pod:78
15343 msgid "List the LVM logical volumes in a disk image:"
15347 #: ../fish/guestfish.pod:80
15350 " guestfish -a disk.img --ro <<_EOF_\n"
15358 #: ../fish/guestfish.pod:85
15359 msgid "List all the filesystems in a disk image:"
15363 #: ../fish/guestfish.pod:87
15366 " guestfish -a disk.img --ro <<_EOF_\n"
15368 " list-filesystems\n"
15374 #: ../fish/guestfish.pod:92
15375 msgid "On one command line"
15379 #: ../fish/guestfish.pod:94
15380 msgid "Update C</etc/resolv.conf> in a guest:"
15384 #: ../fish/guestfish.pod:96
15388 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15389 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15394 #: ../fish/guestfish.pod:100
15395 msgid "Edit C</boot/grub/grub.conf> interactively:"
15399 #: ../fish/guestfish.pod:102
15402 " guestfish --add disk.img \\\n"
15403 " --mount /dev/vg_guest/lv_root \\\n"
15404 " --mount /dev/sda1:/boot \\\n"
15405 " edit /boot/grub/grub.conf\n"
15410 #: ../fish/guestfish.pod:107
15411 msgid "Mount disks automatically"
15415 #: ../fish/guestfish.pod:109
15417 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
15421 #: ../fish/guestfish.pod:112
15424 " guestfish --ro -a disk.img -i cat /etc/group\n"
15429 #: ../fish/guestfish.pod:114
15432 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15437 #: ../fish/guestfish.pod:116
15438 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15442 #: ../fish/guestfish.pod:118
15445 " guestfish -a disk.img -i edit /boot/grub/grub.conf\n"
15450 #: ../fish/guestfish.pod:120
15451 msgid "As a script interpreter"
15455 #: ../fish/guestfish.pod:122
15456 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15460 #: ../fish/guestfish.pod:124
15463 " #!/usr/bin/guestfish -f\n"
15464 " sparse test1.img 100M\n"
15466 " part-disk /dev/sda mbr\n"
15467 " mkfs ext2 /dev/sda1\n"
15472 #: ../fish/guestfish.pod:130
15473 msgid "Start with a prepared disk"
15477 #: ../fish/guestfish.pod:132
15479 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15480 "single ext2-formatted partition:"
15484 #: ../fish/guestfish.pod:135
15487 " guestfish -N fs\n"
15492 #: ../fish/guestfish.pod:137
15493 msgid "To list what is available do:"
15497 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:791
15500 " guestfish -N help | less\n"
15505 #: ../fish/guestfish.pod:141
15506 msgid "Remote control"
15510 #: ../fish/guestfish.pod:143
15513 " eval `guestfish --listen`\n"
15514 " guestfish --remote add-ro disk.img\n"
15515 " guestfish --remote run\n"
15516 " guestfish --remote lvs\n"
15521 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
15522 #: ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68
15523 #: ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171
15524 #: ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257
15525 #: ../tools/virt-list-filesystems.pl:50 ../tools/virt-cat.pl:79
15526 #: ../tools/virt-tar.pl:98 ../tools/virt-rescue.pl:103
15527 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
15532 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:124
15533 #: ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80
15534 #: ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86
15535 #: ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58
15536 #: ../tools/virt-cat.pl:87 ../tools/virt-tar.pl:106
15537 #: ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161
15538 #: ../tools/virt-list-partitions.pl:59
15543 #: ../fish/guestfish.pod:154
15544 msgid "Displays general help on options."
15548 #: ../fish/guestfish.pod:156
15549 msgid "B<-h> | B<--cmd-help>"
15553 #: ../fish/guestfish.pod:158
15554 msgid "Lists all available guestfish commands."
15558 #: ../fish/guestfish.pod:160
15559 msgid "B<-h cmd> | B<--cmd-help cmd>"
15563 #: ../fish/guestfish.pod:162
15564 msgid "Displays detailed help on a single command C<cmd>."
15568 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
15569 msgid "B<-a image> | B<--add image>"
15573 #: ../fish/guestfish.pod:166
15574 msgid "Add a block device or virtual machine image to the shell."
15578 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
15580 "The format of the disk image is auto-detected. To override this and force a "
15581 "particular format use the I<--format=..> option."
15585 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
15586 msgid "B<-c URI> | B<--connect URI>"
15590 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
15592 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15593 "URI to use. The default is to use the default libvirt connection."
15597 #: ../fish/guestfish.pod:177 ../fuse/guestmount.pod:90
15598 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
15602 #: ../fish/guestfish.pod:179 ../fuse/guestmount.pod:92
15604 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15605 "used, then any libvirt domain can be used. However in write mode, only "
15606 "libvirt domains which are shut down can be named here."
15610 #: ../fish/guestfish.pod:183
15611 msgid "B<-D> | B<--no-dest-paths>"
15615 #: ../fish/guestfish.pod:185
15617 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15618 "to hit the tab key to complete paths on the guest filesystem, but this "
15619 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15620 "allow this feature to be disabled."
15624 #: ../fish/guestfish.pod:190
15625 msgid "B<--echo-keys>"
15629 #: ../fish/guestfish.pod:192
15631 "When prompting for keys and passphrases, guestfish normally turns echoing "
15632 "off so you cannot see what you are typing. If you are not worried about "
15633 "Tempest attacks and there is no one else in the room you can specify this "
15634 "flag to see what you are typing."
15638 #: ../fish/guestfish.pod:197
15639 msgid "B<-f file> | B<--file file>"
15643 #: ../fish/guestfish.pod:199
15644 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15648 #: ../fish/guestfish.pod:202
15651 " #!/usr/bin/guestfish -f\n"
15656 #: ../fish/guestfish.pod:204 ../fuse/guestmount.pod:108
15657 msgid "B<--format=raw|qcow2|..> | B<--format>"
15661 #: ../fish/guestfish.pod:206 ../fuse/guestmount.pod:110
15663 "The default for the I<-a> option is to auto-detect the format of the disk "
15664 "image. Using this forces the disk format for I<-a> options which follow on "
15665 "the command line. Using I<--format> with no argument switches back to auto-"
15666 "detection for subsequent I<-a> options."
15670 #: ../fish/guestfish.pod:211 ../fish/guestfish.pod:504
15671 msgid "For example:"
15675 #: ../fish/guestfish.pod:213
15678 " guestfish --format=raw -a disk.img\n"
15683 #: ../fish/guestfish.pod:215
15684 msgid "forces raw format (no auto-detection) for C<disk.img>."
15688 #: ../fish/guestfish.pod:217
15691 " guestfish --format=raw -a disk.img --format -a another.img\n"
15696 #: ../fish/guestfish.pod:219
15698 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
15699 "detection for C<another.img>."
15703 #: ../fish/guestfish.pod:222
15705 "If you have untrusted raw-format guest disk images, you should use this "
15706 "option to specify the disk format. This avoids a possible security problem "
15707 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15711 #: ../fish/guestfish.pod:227 ../fuse/guestmount.pod:128
15712 msgid "B<-i> | B<--inspector>"
15716 #: ../fish/guestfish.pod:229 ../fuse/guestmount.pod:130
15718 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15719 "system and mount filesystems as they would be mounted on the real virtual "
15724 #: ../fish/guestfish.pod:233
15725 msgid "Typical usage is either:"
15729 #: ../fish/guestfish.pod:235
15732 " guestfish -d myguest -i\n"
15737 #: ../fish/guestfish.pod:237
15738 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15742 #: ../fish/guestfish.pod:239
15745 " guestfish --ro -d myguest -i\n"
15750 #: ../fish/guestfish.pod:241
15751 msgid "(for active domains, readonly), or specify the block device directly:"
15755 #: ../fish/guestfish.pod:243
15758 " guestfish -a /dev/Guests/MyGuest -i\n"
15763 #: ../fish/guestfish.pod:245
15765 "Note that the command line syntax changed slightly over older versions of "
15766 "guestfish. You can still use the old syntax:"
15770 #: ../fish/guestfish.pod:248
15773 " guestfish [--ro] -i disk.img\n"
15778 #: ../fish/guestfish.pod:250
15781 " guestfish [--ro] -i libvirt-domain\n"
15786 #: ../fish/guestfish.pod:252
15787 msgid "B<--keys-from-stdin>"
15791 #: ../fish/guestfish.pod:254
15793 "Read key or passphrase parameters from stdin. The default is to try to read "
15794 "passphrases from the user by opening C</dev/tty>."
15798 #: ../fish/guestfish.pod:257
15799 msgid "B<--listen>"
15803 #: ../fish/guestfish.pod:259
15805 "Fork into the background and listen for remote commands. See section L</"
15806 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15810 #: ../fish/guestfish.pod:262
15811 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15815 #: ../fish/guestfish.pod:264
15816 msgid "Mount the named partition or logical volume on the given mountpoint."
15820 #: ../fish/guestfish.pod:266
15821 msgid "If the mountpoint is omitted, it defaults to C</>."
15825 #: ../fish/guestfish.pod:268
15826 msgid "You have to mount something on C</> before most commands will work."
15830 #: ../fish/guestfish.pod:270
15832 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15837 #: ../fish/guestfish.pod:273
15839 "If you don't know what filesystems a disk image contains, you can either run "
15840 "guestfish without this option, then list the partitions and LVs available "
15841 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
15842 "list-filesystems(1)> program."
15846 #: ../fish/guestfish.pod:278 ../fuse/guestmount.pod:142
15847 msgid "B<-n> | B<--no-sync>"
15851 #: ../fish/guestfish.pod:280
15853 "Disable autosync. This is enabled by default. See the discussion of "
15854 "autosync in the L<guestfs(3)> manpage."
15858 #: ../fish/guestfish.pod:283
15859 msgid "B<-N type> | B<--new type> | B<-N help>"
15863 #: ../fish/guestfish.pod:285
15865 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15866 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15867 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15872 #: ../fish/guestfish.pod:290
15873 msgid "B<--progress-bars>"
15877 #: ../fish/guestfish.pod:292
15878 msgid "Enable progress bars, even when guestfish is used non-interactively."
15882 #: ../fish/guestfish.pod:294
15884 "Progress bars are enabled by default when guestfish is used as an "
15885 "interactive shell."
15889 #: ../fish/guestfish.pod:297
15890 msgid "B<--no-progress-bars>"
15894 #: ../fish/guestfish.pod:299
15895 msgid "Disable progress bars."
15899 #: ../fish/guestfish.pod:301
15900 msgid "B<--remote[=pid]>"
15904 #: ../fish/guestfish.pod:303
15906 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15907 "CONTROL GUESTFISH OVER A SOCKET> below."
15911 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
15912 msgid "B<-r> | B<--ro>"
15916 #: ../fish/guestfish.pod:308
15918 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15919 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15923 #: ../fish/guestfish.pod:311 ../tools/virt-rescue.pl:187
15925 "The option must always be used if the disk image or virtual machine might be "
15926 "running, and is generally recommended in cases where you don't need write "
15927 "access to the disk."
15931 #: ../fish/guestfish.pod:315
15933 "Note that prepared disk images created with I<-N> are not affected by the "
15938 #: ../fish/guestfish.pod:318 ../fuse/guestmount.pod:194
15939 #: ../tools/virt-rescue.pl:195
15940 msgid "B<--selinux>"
15944 #: ../fish/guestfish.pod:320
15945 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15949 #: ../fish/guestfish.pod:322 ../fuse/guestmount.pod:198
15950 msgid "B<-v> | B<--verbose>"
15954 #: ../fish/guestfish.pod:324
15956 "Enable very verbose messages. This is particularly useful if you find a bug."
15960 #: ../fish/guestfish.pod:327 ../fuse/guestmount.pod:202
15961 msgid "B<-V> | B<--version>"
15965 #: ../fish/guestfish.pod:329
15966 msgid "Display the guestfish / libguestfs version number and exit."
15970 #: ../fish/guestfish.pod:331
15975 #: ../fish/guestfish.pod:333
15976 msgid "Echo each command before executing it."
15980 #: ../fish/guestfish.pod:337
15981 msgid "COMMANDS ON COMMAND LINE"
15985 #: ../fish/guestfish.pod:339
15987 "Any additional (non-option) arguments are treated as commands to execute."
15991 #: ../fish/guestfish.pod:342
15993 "Commands to execute should be separated by a colon (C<:>), where the colon "
15994 "is a separate parameter. Thus:"
15998 #: ../fish/guestfish.pod:345
16001 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16006 #: ../fish/guestfish.pod:347
16008 "If there are no additional arguments, then we enter a shell, either an "
16009 "interactive shell with a prompt (if the input is a terminal) or a non-"
16010 "interactive shell."
16014 #: ../fish/guestfish.pod:351
16016 "In either command line mode or non-interactive shell, the first command that "
16017 "gives an error causes the whole shell to exit. In interactive mode (with a "
16018 "prompt) if a command fails, you can continue to enter commands."
16022 #: ../fish/guestfish.pod:356
16023 msgid "USING launch (OR run)"
16027 #: ../fish/guestfish.pod:358
16029 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16030 "then launch it, then mount any disks you need, and finally issue actions/"
16031 "commands. So the general order of the day is:"
16035 #: ../fish/guestfish.pod:366
16036 msgid "add or -a/--add"
16040 #: ../fish/guestfish.pod:370
16041 msgid "launch (aka run)"
16045 #: ../fish/guestfish.pod:374
16046 msgid "mount or -m/--mount"
16050 #: ../fish/guestfish.pod:378
16051 msgid "any other commands"
16055 #: ../fish/guestfish.pod:382
16057 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16058 "guest before mounting or performing any other commands."
16062 #: ../fish/guestfish.pod:385
16064 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16065 "I<--new> options were given then C<run> is done automatically, simply "
16066 "because guestfish can't perform the action you asked for without doing this."
16070 #: ../fish/guestfish.pod:390
16075 #: ../fish/guestfish.pod:392
16077 "You can quote ordinary parameters using either single or double quotes. For "
16082 #: ../fish/guestfish.pod:395
16085 " add \"file with a space.img\"\n"
16090 #: ../fish/guestfish.pod:397
16093 " rm '/file name'\n"
16098 #: ../fish/guestfish.pod:399
16106 #: ../fish/guestfish.pod:401
16108 "A few commands require a list of strings to be passed. For these, use a "
16109 "whitespace-separated list, enclosed in quotes. Strings containing "
16110 "whitespace to be passed through must be enclosed in single quotes. A "
16111 "literal single quote must be escaped with a backslash."
16115 #: ../fish/guestfish.pod:406
16118 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16119 " command \"/bin/echo 'foo bar'\"\n"
16120 " command \"/bin/echo \\'foo\\'\"\n"
16125 #: ../fish/guestfish.pod:410
16126 msgid "OPTIONAL ARGUMENTS"
16130 #: ../fish/guestfish.pod:412
16132 "Some commands take optional arguments. These arguments appear in this "
16133 "documentation as C<[argname:..]>. You can use them as in these examples:"
16137 #: ../fish/guestfish.pod:416
16140 " add-drive-opts filename\n"
16145 #: ../fish/guestfish.pod:418
16148 " add-drive-opts filename readonly:true\n"
16153 #: ../fish/guestfish.pod:420
16156 " add-drive-opts filename format:qcow2 readonly:false\n"
16161 #: ../fish/guestfish.pod:422
16163 "Each optional argument can appear at most once. All optional arguments must "
16164 "appear after the required ones."
16168 #: ../fish/guestfish.pod:425
16173 #: ../fish/guestfish.pod:427
16175 "This section applies to all commands which can take integers as parameters."
16179 #: ../fish/guestfish.pod:430
16180 msgid "SIZE SUFFIX"
16184 #: ../fish/guestfish.pod:432
16186 "When the command takes a parameter measured in bytes, you can use one of the "
16187 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16191 #: ../fish/guestfish.pod:438
16192 msgid "B<k> or B<K> or B<KiB>"
16196 #: ../fish/guestfish.pod:440
16197 msgid "The size in kilobytes (multiplied by 1024)."
16201 #: ../fish/guestfish.pod:442
16206 #: ../fish/guestfish.pod:444
16207 msgid "The size in SI 1000 byte units."
16211 #: ../fish/guestfish.pod:446
16212 msgid "B<M> or B<MiB>"
16216 #: ../fish/guestfish.pod:448
16217 msgid "The size in megabytes (multiplied by 1048576)."
16221 #: ../fish/guestfish.pod:450
16226 #: ../fish/guestfish.pod:452
16227 msgid "The size in SI 1000000 byte units."
16231 #: ../fish/guestfish.pod:454
16232 msgid "B<G> or B<GiB>"
16236 #: ../fish/guestfish.pod:456
16237 msgid "The size in gigabytes (multiplied by 2**30)."
16241 #: ../fish/guestfish.pod:458
16246 #: ../fish/guestfish.pod:460
16247 msgid "The size in SI 10**9 byte units."
16251 #: ../fish/guestfish.pod:462
16252 msgid "B<T> or B<TiB>"
16256 #: ../fish/guestfish.pod:464
16257 msgid "The size in terabytes (multiplied by 2**40)."
16261 #: ../fish/guestfish.pod:466
16266 #: ../fish/guestfish.pod:468
16267 msgid "The size in SI 10**12 byte units."
16271 #: ../fish/guestfish.pod:470
16272 msgid "B<P> or B<PiB>"
16276 #: ../fish/guestfish.pod:472
16277 msgid "The size in petabytes (multiplied by 2**50)."
16281 #: ../fish/guestfish.pod:474
16286 #: ../fish/guestfish.pod:476
16287 msgid "The size in SI 10**15 byte units."
16291 #: ../fish/guestfish.pod:478
16292 msgid "B<E> or B<EiB>"
16296 #: ../fish/guestfish.pod:480
16297 msgid "The size in exabytes (multiplied by 2**60)."
16301 #: ../fish/guestfish.pod:482
16306 #: ../fish/guestfish.pod:484
16307 msgid "The size in SI 10**18 byte units."
16311 #: ../fish/guestfish.pod:486
16312 msgid "B<Z> or B<ZiB>"
16316 #: ../fish/guestfish.pod:488
16317 msgid "The size in zettabytes (multiplied by 2**70)."
16321 #: ../fish/guestfish.pod:490
16326 #: ../fish/guestfish.pod:492
16327 msgid "The size in SI 10**21 byte units."
16331 #: ../fish/guestfish.pod:494
16332 msgid "B<Y> or B<YiB>"
16336 #: ../fish/guestfish.pod:496
16337 msgid "The size in yottabytes (multiplied by 2**80)."
16341 #: ../fish/guestfish.pod:498
16346 #: ../fish/guestfish.pod:500
16347 msgid "The size in SI 10**24 byte units."
16351 #: ../fish/guestfish.pod:506
16354 " truncate-size /file 1G\n"
16359 #: ../fish/guestfish.pod:508
16360 msgid "would truncate the file to 1 gigabyte."
16364 #: ../fish/guestfish.pod:510
16366 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
16367 "the parameter to L</memsize> is specified in megabytes already). Adding a "
16368 "suffix will probably not do what you expect."
16372 #: ../fish/guestfish.pod:514
16373 msgid "OCTAL AND HEXADECIMAL NUMBERS"
16377 #: ../fish/guestfish.pod:516
16379 "For specifying the radix (base) use the C convention: C<0> to prefix an "
16380 "octal number or C<0x> to prefix a hexadecimal number. For example:"
16384 #: ../fish/guestfish.pod:519
16387 " 1234 decimal number 1234\n"
16388 " 02322 octal number, equivalent to decimal 1234\n"
16389 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16394 #: ../fish/guestfish.pod:523
16396 "When using the C<chmod> command, you almost always want to specify an octal "
16397 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16398 "L<chmod(1)> program):"
16402 #: ../fish/guestfish.pod:527
16405 " chmod 0777 /public # OK\n"
16406 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16411 #: ../fish/guestfish.pod:530
16413 "Commands that return numbers usually print them in decimal, but some "
16414 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16415 "octal, preceeded by C<0>)."
16419 #: ../fish/guestfish.pod:534
16420 msgid "WILDCARDS AND GLOBBING"
16424 #: ../fish/guestfish.pod:536
16426 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16427 "(globbing) by default. So for example the following will not do what you "
16432 #: ../fish/guestfish.pod:540
16440 #: ../fish/guestfish.pod:542
16442 "Assuming you don't have a directory called literally C</home/*> then the "
16443 "above command will return an error."
16447 #: ../fish/guestfish.pod:545
16448 msgid "To perform wildcard expansion, use the C<glob> command."
16452 #: ../fish/guestfish.pod:547
16455 " glob rm-rf /home/*\n"
16460 #: ../fish/guestfish.pod:549
16462 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16463 "many times), equivalent to:"
16467 #: ../fish/guestfish.pod:552
16470 " rm-rf /home/jim\n"
16471 " rm-rf /home/joe\n"
16472 " rm-rf /home/mary\n"
16477 #: ../fish/guestfish.pod:556
16478 msgid "C<glob> only works on simple guest paths and not on device names."
16482 #: ../fish/guestfish.pod:558
16484 "If you have several parameters, each containing a wildcard, then glob will "
16485 "perform a Cartesian product."
16489 #: ../fish/guestfish.pod:561
16494 #: ../fish/guestfish.pod:563
16496 "Any line which starts with a I<#> character is treated as a comment and "
16497 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16498 "a command. For example:"
16502 #: ../fish/guestfish.pod:567
16505 " # this is a comment\n"
16506 " # this is a comment\n"
16507 " foo # NOT a comment\n"
16512 #: ../fish/guestfish.pod:571
16513 msgid "Blank lines are also ignored."
16517 #: ../fish/guestfish.pod:573
16518 msgid "RUNNING COMMANDS LOCALLY"
16522 #: ../fish/guestfish.pod:575
16524 "Any line which starts with a I<!> character is treated as a command sent to "
16525 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
16529 #: ../fish/guestfish.pod:579
16533 " tgz-out /remote local/remote-data.tar.gz\n"
16538 #: ../fish/guestfish.pod:582
16540 "will create a directory C<local> on the host, and then export the contents "
16541 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
16542 "(See C<tgz-out>)."
16546 #: ../fish/guestfish.pod:586
16548 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
16549 "effect, due to the way that subprocesses work in Unix."
16553 #: ../fish/guestfish.pod:589
16558 #: ../fish/guestfish.pod:591
16560 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
16561 "command (a guestfish command) to the second command (any host command). For "
16566 #: ../fish/guestfish.pod:595
16569 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
16574 #: ../fish/guestfish.pod:597
16576 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
16577 "program). The above command would list all accounts in the guest filesystem "
16578 "which have UID 0, ie. root accounts including backdoors. Other examples:"
16582 #: ../fish/guestfish.pod:602
16585 " hexdump /bin/ls | head\n"
16586 " list-devices | tail -1\n"
16587 " tgz-out / - | tar ztf -\n"
16592 #: ../fish/guestfish.pod:606
16594 "The space before the pipe symbol is required, any space after the pipe "
16595 "symbol is optional. Everything after the pipe symbol is just passed "
16596 "straight to the host shell, so it can contain redirections, globs and "
16597 "anything else that makes sense on the host side."
16601 #: ../fish/guestfish.pod:611
16603 "To use a literal argument which begins with a pipe symbol, you have to quote "
16608 #: ../fish/guestfish.pod:614
16616 #: ../fish/guestfish.pod:616
16617 msgid "HOME DIRECTORIES"
16621 #: ../fish/guestfish.pod:618
16623 "If a parameter starts with the character C<~> then the tilde may be expanded "
16624 "as a home directory path (either C<~> for the current user's home directory, "
16625 "or C<~user> for another user)."
16629 #: ../fish/guestfish.pod:622
16631 "Note that home directory expansion happens for users known I<on the host>, "
16632 "not in the guest filesystem."
16636 #: ../fish/guestfish.pod:625
16638 "To use a literal argument which begins with a tilde, you have to quote it, "
16643 #: ../fish/guestfish.pod:628
16651 #: ../fish/guestfish.pod:632
16653 "Libguestfs has some support for Linux guests encrypted according to the "
16654 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
16655 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
16656 "LUKS is supported."
16660 #: ../fish/guestfish.pod:637
16661 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
16665 #: ../fish/guestfish.pod:639
16668 " ><fs> vfs-type /dev/sda2\n"
16674 #: ../fish/guestfish.pod:642
16676 "Then open those devices using L</luks-open>. This creates a device-mapper "
16677 "device called C</dev/mapper/luksdev>."
16681 #: ../fish/guestfish.pod:645
16684 " ><fs> luks-open /dev/sda2 luksdev\n"
16685 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
16690 #: ../fish/guestfish.pod:648
16692 "Finally you have to tell LVM to scan for volume groups on the newly created "
16697 #: ../fish/guestfish.pod:651
16701 " vg-activate-all true\n"
16706 #: ../fish/guestfish.pod:654
16707 msgid "The logical volume(s) can now be mounted in the usual way."
16711 #: ../fish/guestfish.pod:656
16713 "Before closing a LUKS device you must unmount any logical volumes on it and "
16714 "deactivate the volume groups by calling C<vg-activate false VG> on each "
16715 "one. Then you can close the mapper device:"
16719 #: ../fish/guestfish.pod:660
16722 " vg-activate false /dev/VG\n"
16723 " luks-close /dev/mapper/luksdev\n"
16728 #: ../fish/guestfish.pod:663
16729 msgid "WINDOWS PATHS"
16733 #: ../fish/guestfish.pod:665
16735 "If a path is prefixed with C<win:> then you can use Windows-style paths "
16736 "(with some limitations). The following commands are equivalent:"
16740 #: ../fish/guestfish.pod:668
16743 " file /WINDOWS/system32/config/system.LOG\n"
16748 #: ../fish/guestfish.pod:670
16751 " file win:/windows/system32/config/system.log\n"
16756 #: ../fish/guestfish.pod:672
16759 " file win:\\windows\\system32\\config\\system.log\n"
16764 #: ../fish/guestfish.pod:674
16767 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
16772 #: ../fish/guestfish.pod:676
16774 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
16775 "handles case insensitivity like Windows would. This only works in argument "
16776 "positions that expect a path."
16780 #: ../fish/guestfish.pod:680
16781 msgid "UPLOADING AND DOWNLOADING FILES"
16785 #: ../fish/guestfish.pod:682
16787 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
16788 "others which upload from or download to a local file, you can use the "
16789 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
16793 #: ../fish/guestfish.pod:686
16801 #: ../fish/guestfish.pod:688
16803 "reads stdin and creates from that a file C</foo> in the disk image, and:"
16807 #: ../fish/guestfish.pod:691
16810 " tar-out /etc - | tar tf -\n"
16815 #: ../fish/guestfish.pod:693
16817 "writes the tarball to stdout and then pipes that into the external \"tar\" "
16818 "command (see L</PIPES>)."
16822 #: ../fish/guestfish.pod:696
16824 "When using C<-> to read from stdin, the input is read up to the end of "
16825 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
16826 "some arbitrary end marker:"
16830 #: ../fish/guestfish.pod:700
16833 " upload -<<END /foo\n"
16842 #: ../fish/guestfish.pod:706
16844 "Any string of characters can be used instead of C<END>. The end marker must "
16845 "appear on a line of its own, without any preceeding or following characters "
16846 "(not even spaces)."
16850 #: ../fish/guestfish.pod:710
16852 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16853 "upload local files (so-called \"FileIn\" parameters in the generator)."
16857 #: ../fish/guestfish.pod:713
16858 msgid "EXIT ON ERROR BEHAVIOUR"
16862 #: ../fish/guestfish.pod:715
16864 "By default, guestfish will ignore any errors when in interactive mode (ie. "
16865 "taking commands from a human over a tty), and will exit on the first error "
16866 "in non-interactive mode (scripts, commands given on the command line)."
16870 #: ../fish/guestfish.pod:720
16872 "If you prefix a command with a I<-> character, then that command will not "
16873 "cause guestfish to exit, even if that (one) command returns an error."
16877 #: ../fish/guestfish.pod:724
16878 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16882 #: ../fish/guestfish.pod:726
16884 "Guestfish can be remote-controlled over a socket. This is useful "
16885 "particularly in shell scripts where you want to make several different "
16886 "changes to a filesystem, but you don't want the overhead of starting up a "
16887 "guestfish process each time."
16891 #: ../fish/guestfish.pod:731
16892 msgid "Start a guestfish server process using:"
16896 #: ../fish/guestfish.pod:733
16899 " eval `guestfish --listen`\n"
16904 #: ../fish/guestfish.pod:735
16905 msgid "and then send it commands by doing:"
16909 #: ../fish/guestfish.pod:737
16912 " guestfish --remote cmd [...]\n"
16917 #: ../fish/guestfish.pod:739
16918 msgid "To cause the server to exit, send it the exit command:"
16922 #: ../fish/guestfish.pod:741
16925 " guestfish --remote exit\n"
16930 #: ../fish/guestfish.pod:743
16932 "Note that the server will normally exit if there is an error in a command. "
16933 "You can change this in the usual way. See section L</EXIT ON ERROR "
16938 #: ../fish/guestfish.pod:747
16939 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16943 #: ../fish/guestfish.pod:749
16945 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16946 "is how the I<--remote> option knows where to send the commands. You can "
16947 "have several guestfish listener processes running using:"
16951 #: ../fish/guestfish.pod:753
16954 " eval `guestfish --listen`\n"
16955 " pid1=$GUESTFISH_PID\n"
16956 " eval `guestfish --listen`\n"
16957 " pid2=$GUESTFISH_PID\n"
16959 " guestfish --remote=$pid1 cmd\n"
16960 " guestfish --remote=$pid2 cmd\n"
16965 #: ../fish/guestfish.pod:761
16966 msgid "REMOTE CONTROL DETAILS"
16970 #: ../fish/guestfish.pod:763
16972 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
16973 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
16974 "and C<$PID> is the process ID of the server."
16978 #: ../fish/guestfish.pod:767
16979 msgid "Guestfish client and server versions must match exactly."
16983 #: ../fish/guestfish.pod:769
16984 msgid "PREPARED DISK IMAGES"
16988 #: ../fish/guestfish.pod:771
16990 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
16991 "preformatted disk images that guestfish can make for you to save typing. "
16992 "This is particularly useful for testing purposes. This option is used "
16993 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
16994 "can be mixed with I<-a>)."
16998 #: ../fish/guestfish.pod:777
17000 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17001 "the second and so on. Existing files in the current directory are "
17006 #: ../fish/guestfish.pod:781
17008 "The type briefly describes how the disk should be sized, partitioned, how "
17009 "filesystem(s) should be created, and how content should be added. "
17010 "Optionally the type can be followed by extra parameters, separated by C<:> "
17011 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
17012 "allocated disk, containing a single partition, with the partition formatted "
17013 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
17018 #: ../fish/guestfish.pod:789
17019 msgid "To list the available types and any extra parameters they take, run:"
17023 #: ../fish/guestfish.pod:793
17025 "Note that the prepared filesystem is not mounted. You would usually have to "
17026 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17030 #: ../fish/guestfish.pod:797
17032 "If any I<-N> or I<--new> options are given, the guest is automatically "
17037 #: ../fish/guestfish.pod:802
17038 msgid "Create a 100MB disk with an ext4-formatted partition:"
17042 #: ../fish/guestfish.pod:804
17045 " guestfish -N fs:ext4\n"
17050 #: ../fish/guestfish.pod:806
17051 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17055 #: ../fish/guestfish.pod:808
17058 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17063 #: ../fish/guestfish.pod:810
17064 msgid "Create a blank 200MB disk:"
17068 #: ../fish/guestfish.pod:812
17071 " guestfish -N disk:200M\n"
17076 #: ../fish/guestfish.pod:814
17077 msgid "PROGRESS BARS"
17081 #: ../fish/guestfish.pod:816
17083 "Some (not all) long-running commands send progress notification messages as "
17084 "they are running. Guestfish turns these messages into progress bars."
17088 #: ../fish/guestfish.pod:820
17090 "When a command that supports progress bars takes longer than two seconds to "
17091 "run, and if progress bars are enabled, then you will see one appearing below "
17096 #: ../fish/guestfish.pod:824
17099 " ><fs> copy-size /large-file /another-file 2048M\n"
17100 " / 10% [#####-----------------------------------------] 00:30\n"
17105 #: ../fish/guestfish.pod:827
17107 "The spinner on the left hand side moves round once for every progress "
17108 "notification received from the backend. This is a (reasonably) golden "
17109 "assurance that the command is \"doing something\" even if the progress bar "
17110 "is not moving, because the command is able to send the progress "
17111 "notifications. When the bar reaches 100% and the command finishes, the "
17112 "spinner disappears."
17116 #: ../fish/guestfish.pod:834
17118 "Progress bars are enabled by default when guestfish is used interactively. "
17119 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17120 "and you can disable them completely using I<--no-progress-bars>."
17124 #: ../fish/guestfish.pod:839
17125 msgid "GUESTFISH COMMANDS"
17129 #: ../fish/guestfish.pod:841
17131 "The commands in this section are guestfish convenience commands, in other "
17132 "words, they are not part of the L<guestfs(3)> API."
17136 #: ../fish/guestfish.pod:844
17141 #: ../fish/guestfish.pod:846
17150 #: ../fish/guestfish.pod:849
17152 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
17153 "this displays detailed help for a command."
17157 #: ../fish/guestfish.pod:852
17158 msgid "quit | exit"
17162 #: ../fish/guestfish.pod:854
17163 msgid "This exits guestfish. You can also use C<^D> key."
17167 #: ../fish/guestfish.pod:856
17168 msgid "@FISH_COMMANDS@"
17172 #: ../fish/guestfish.pod:858
17177 #: ../fish/guestfish.pod:862 ../test-tool/libguestfs-test-tool.pod:83
17182 #: ../fish/guestfish.pod:864
17184 "guestfish returns 0 if the commands completed without error, or 1 if there "
17189 #: ../fish/guestfish.pod:871
17194 #: ../fish/guestfish.pod:873
17196 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17201 #: ../fish/guestfish.pod:876
17202 msgid "GUESTFISH_PID"
17206 #: ../fish/guestfish.pod:878
17208 "Used with the I<--remote> option to specify the remote guestfish process to "
17209 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17213 #: ../fish/guestfish.pod:882
17218 #: ../fish/guestfish.pod:884
17220 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17221 "not specified, the external L<hexedit(1)> program is used."
17225 #: ../fish/guestfish.pod:888
17230 #: ../fish/guestfish.pod:890
17232 "If compiled with GNU readline support, various files in the home directory "
17233 "can be used. See L</FILES>."
17237 #: ../fish/guestfish.pod:899
17239 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17240 "effect as using the B<-v> option."
17244 #: ../fish/guestfish.pod:911
17246 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17247 "the discussion of paths in L<guestfs(3)>."
17251 #: ../fish/guestfish.pod:922
17252 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17256 #: ../fish/guestfish.pod:924
17261 #: ../fish/guestfish.pod:926
17263 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17268 #: ../fish/guestfish.pod:941 ../test-tool/libguestfs-test-tool.pod:88
17273 #: ../fish/guestfish.pod:945
17274 msgid "$HOME/.guestfish"
17278 #: ../fish/guestfish.pod:947
17280 "If compiled with GNU readline support, then the command history is saved in "
17285 #: ../fish/guestfish.pod:950
17286 msgid "$HOME/.inputrc"
17290 #: ../fish/guestfish.pod:952
17291 msgid "/etc/inputrc"
17295 #: ../fish/guestfish.pod:954
17297 "If compiled with GNU readline support, then these files can be used to "
17298 "configure readline. For further information, please see L<readline(3)/"
17299 "INITIALIZATION FILE>."
17303 #: ../fish/guestfish.pod:958
17304 msgid "To write rules which only apply to guestfish, use:"
17308 #: ../fish/guestfish.pod:960
17318 #: ../fish/guestfish.pod:964
17320 "Variables that you can set in inputrc that change the behaviour of guestfish "
17321 "in useful ways include:"
17325 #: ../fish/guestfish.pod:969
17326 msgid "completion-ignore-case (default: on)"
17330 #: ../fish/guestfish.pod:971
17332 "By default, guestfish will ignore case when tab-completing paths on the "
17337 #: ../fish/guestfish.pod:974
17340 " set completion-ignore-case off\n"
17345 #: ../fish/guestfish.pod:976
17346 msgid "to make guestfish case sensitive."
17350 #: ../fish/guestfish.pod:980
17355 #: ../fish/guestfish.pod:982
17356 msgid "test2.img (etc)"
17360 #: ../fish/guestfish.pod:984
17362 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
17363 "will be created in the file C<test1.img> in the current directory. The "
17364 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
17365 "the same name will be overwritten."
17369 #: ../fish/guestfish.pod:993
17371 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
17372 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
17373 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
17374 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
17378 #: ../fish/guestfish.pod:1017 ../test-tool/libguestfs-test-tool.pod:124
17379 #: ../fuse/guestmount.pod:234 ../inspector/virt-inspector.pl:384
17380 #: ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518
17381 #: ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251
17382 #: ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206
17383 #: ../tools/virt-cat.pl:203 ../tools/virt-tar.pl:300
17384 #: ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:567
17385 #: ../tools/virt-list-partitions.pl:273
17387 "This program is free software; you can redistribute it and/or modify it "
17388 "under the terms of the GNU General Public License as published by the Free "
17389 "Software Foundation; either version 2 of the License, or (at your option) "
17390 "any later version."
17394 #: ../fish/guestfish.pod:1022 ../test-tool/libguestfs-test-tool.pod:129
17395 #: ../fuse/guestmount.pod:239 ../inspector/virt-inspector.pl:389
17396 #: ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523
17397 #: ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256
17398 #: ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211
17399 #: ../tools/virt-cat.pl:208 ../tools/virt-tar.pl:305
17400 #: ../tools/virt-rescue.pl:290 ../tools/virt-make-fs.pl:572
17401 #: ../tools/virt-list-partitions.pl:278
17403 "This program is distributed in the hope that it will be useful, but WITHOUT "
17404 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
17405 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
17410 #: ../fish/guestfish.pod:1027 ../test-tool/libguestfs-test-tool.pod:134
17411 #: ../fuse/guestmount.pod:244 ../inspector/virt-inspector.pl:394
17412 #: ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528
17413 #: ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261
17414 #: ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216
17415 #: ../tools/virt-cat.pl:213 ../tools/virt-tar.pl:310
17416 #: ../tools/virt-rescue.pl:295 ../tools/virt-make-fs.pl:577
17417 #: ../tools/virt-list-partitions.pl:283
17419 "You should have received a copy of the GNU General Public License along with "
17420 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
17421 "Ave, Cambridge, MA 02139, USA."
17425 #: ../fish/guestfish-actions.pod:1
17430 #: ../fish/guestfish-actions.pod:3
17433 " add-cdrom filename\n"
17438 #: ../fish/guestfish-actions.pod:15
17440 "This call checks for the existence of C<filename>. This stops you from "
17441 "specifying other types of drive which are supported by qemu such as C<nbd:> "
17442 "and C<http:> URLs. To specify those, use the general L</config> call "
17447 #: ../fish/guestfish-actions.pod:22
17449 "If you just want to add an ISO file (often you use this as an efficient way "
17450 "to transfer large files into the guest), then you should probably use L</add-"
17451 "drive-ro> instead."
17455 #: ../fish/guestfish-actions.pod:35
17460 #: ../fish/guestfish-actions.pod:37
17463 " add-drive filename\n"
17468 #: ../fish/guestfish-actions.pod:39
17470 "This function is the equivalent of calling L</add-drive-opts> with no "
17471 "optional parameters, so the disk is added writable, with the format being "
17472 "detected automatically."
17476 #: ../fish/guestfish-actions.pod:43
17478 "Automatic detection of the format opens you up to a potential security hole "
17479 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
17480 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
17481 "you should think about replacing calls to this function with calls to L</add-"
17482 "drive-opts>, and specifying the format."
17486 #: ../fish/guestfish-actions.pod:50
17487 msgid "add-drive-opts"
17491 #: ../fish/guestfish-actions.pod:52
17496 #: ../fish/guestfish-actions.pod:54
17499 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
17504 #: ../fish/guestfish-actions.pod:81
17506 "This forces the image format. If you omit this (or use L</add-drive> or L</"
17507 "add-drive-ro>) then the format is automatically detected. Possible formats "
17508 "include C<raw> and C<qcow2>."
17512 #: ../fish/guestfish-actions.pod:92
17514 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
17515 "add-drive-with-if> call (q.v.)"
17519 #: ../fish/guestfish-actions.pod:97
17521 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
17525 #: ../fish/guestfish-actions.pod:99
17526 msgid "add-drive-ro"
17530 #: ../fish/guestfish-actions.pod:101
17535 #: ../fish/guestfish-actions.pod:103
17538 " add-drive-ro filename\n"
17543 #: ../fish/guestfish-actions.pod:105
17545 "This function is the equivalent of calling L</add-drive-opts> with the "
17546 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
17547 "is added read-only, with the format being detected automatically."
17551 #: ../fish/guestfish-actions.pod:110
17552 msgid "add-drive-ro-with-if"
17556 #: ../fish/guestfish-actions.pod:112
17559 " add-drive-ro-with-if filename iface\n"
17564 #: ../fish/guestfish-actions.pod:114
17566 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
17567 "interface emulation to use at run time."
17571 #: ../fish/guestfish-actions.pod:124
17572 msgid "add-drive-with-if"
17576 #: ../fish/guestfish-actions.pod:126
17579 " add-drive-with-if filename iface\n"
17584 #: ../fish/guestfish-actions.pod:128
17586 "This is the same as L</add-drive> but it allows you to specify the QEMU "
17587 "interface emulation to use at run time."
17591 #: ../fish/guestfish-actions.pod:138
17596 #: ../fish/guestfish-actions.pod:140
17599 " aug-clear augpath\n"
17604 #: ../fish/guestfish-actions.pod:145
17609 #: ../fish/guestfish-actions.pod:147
17617 #: ../fish/guestfish-actions.pod:149
17619 "Close the current Augeas handle and free up any resources used by it. After "
17620 "calling this, you have to call L</aug-init> again before you can use any "
17621 "other Augeas functions."
17625 #: ../fish/guestfish-actions.pod:154
17626 msgid "aug-defnode"
17630 #: ../fish/guestfish-actions.pod:156
17633 " aug-defnode name expr val\n"
17638 #: ../fish/guestfish-actions.pod:161
17640 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
17641 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
17642 "containing that single node."
17646 #: ../fish/guestfish-actions.pod:169
17651 #: ../fish/guestfish-actions.pod:171
17654 " aug-defvar name expr\n"
17659 #: ../fish/guestfish-actions.pod:180
17664 #: ../fish/guestfish-actions.pod:182
17667 " aug-get augpath\n"
17672 #: ../fish/guestfish-actions.pod:187
17677 #: ../fish/guestfish-actions.pod:189
17680 " aug-init root flags\n"
17685 #: ../fish/guestfish-actions.pod:195
17686 msgid "You must call this before using any other L</aug-*> commands."
17690 #: ../fish/guestfish-actions.pod:230
17691 msgid "Do not load the tree in L</aug-init>."
17695 #: ../fish/guestfish-actions.pod:234
17696 msgid "To close the handle, you can call L</aug-close>."
17700 #: ../fish/guestfish-actions.pod:238
17705 #: ../fish/guestfish-actions.pod:240
17708 " aug-insert augpath label true|false\n"
17713 #: ../fish/guestfish-actions.pod:250
17718 #: ../fish/guestfish-actions.pod:252
17726 #: ../fish/guestfish-actions.pod:259
17731 #: ../fish/guestfish-actions.pod:261
17734 " aug-ls augpath\n"
17739 #: ../fish/guestfish-actions.pod:263
17741 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
17742 "resulting nodes into alphabetical order."
17746 #: ../fish/guestfish-actions.pod:266
17751 #: ../fish/guestfish-actions.pod:268
17754 " aug-match augpath\n"
17759 #: ../fish/guestfish-actions.pod:274
17764 #: ../fish/guestfish-actions.pod:276
17767 " aug-mv src dest\n"
17772 #: ../fish/guestfish-actions.pod:281
17777 #: ../fish/guestfish-actions.pod:283
17780 " aug-rm augpath\n"
17785 #: ../fish/guestfish-actions.pod:289
17790 #: ../fish/guestfish-actions.pod:291
17798 #: ../fish/guestfish-actions.pod:295
17800 "The flags which were passed to L</aug-init> affect exactly how files are "
17805 #: ../fish/guestfish-actions.pod:298
17810 #: ../fish/guestfish-actions.pod:300
17813 " aug-set augpath val\n"
17818 #: ../fish/guestfish-actions.pod:304
17820 "In the Augeas API, it is possible to clear a node by setting the value to "
17821 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17822 "this call. Instead you must use the L</aug-clear> call."
17826 #: ../fish/guestfish-actions.pod:309
17831 #: ../fish/guestfish-actions.pod:311
17834 " available 'groups ...'\n"
17839 #: ../fish/guestfish-actions.pod:317
17841 "The libguestfs groups, and the functions that those groups correspond to, "
17842 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17843 "runtime by calling L</available-all-groups>."
17847 #: ../fish/guestfish-actions.pod:341
17848 msgid "You must call L</launch> before calling this function."
17852 #: ../fish/guestfish-actions.pod:363
17854 "This call was added in version C<1.0.80>. In previous versions of "
17855 "libguestfs all you could do would be to speculatively execute a command to "
17856 "find out if the daemon implemented it. See also L</version>."
17860 #: ../fish/guestfish-actions.pod:370
17861 msgid "available-all-groups"
17865 #: ../fish/guestfish-actions.pod:372
17868 " available-all-groups\n"
17873 #: ../fish/guestfish-actions.pod:374
17875 "This command returns a list of all optional groups that this daemon knows "
17876 "about. Note this returns both supported and unsupported groups. To find "
17877 "out which ones the daemon can actually support you have to call L</"
17878 "available> on each member of the returned list."
17882 #: ../fish/guestfish-actions.pod:380
17883 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
17887 #: ../fish/guestfish-actions.pod:382
17892 #: ../fish/guestfish-actions.pod:384
17895 " base64-in (base64file|-) filename\n"
17900 #: ../fish/guestfish-actions.pod:389 ../fish/guestfish-actions.pod:398
17901 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:769
17902 #: ../fish/guestfish-actions.pod:816 ../fish/guestfish-actions.pod:835
17903 #: ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:3912
17904 #: ../fish/guestfish-actions.pod:3924 ../fish/guestfish-actions.pod:3935
17905 #: ../fish/guestfish-actions.pod:3946 ../fish/guestfish-actions.pod:3998
17906 #: ../fish/guestfish-actions.pod:4007 ../fish/guestfish-actions.pod:4061
17907 #: ../fish/guestfish-actions.pod:4084
17908 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17912 #: ../fish/guestfish-actions.pod:391
17917 #: ../fish/guestfish-actions.pod:393
17920 " base64-out filename (base64file|-)\n"
17925 #: ../fish/guestfish-actions.pod:400
17926 msgid "blockdev-flushbufs"
17930 #: ../fish/guestfish-actions.pod:402
17933 " blockdev-flushbufs device\n"
17938 #: ../fish/guestfish-actions.pod:409
17939 msgid "blockdev-getbsz"
17943 #: ../fish/guestfish-actions.pod:411
17946 " blockdev-getbsz device\n"
17951 #: ../fish/guestfish-actions.pod:420
17952 msgid "blockdev-getro"
17956 #: ../fish/guestfish-actions.pod:422
17959 " blockdev-getro device\n"
17964 #: ../fish/guestfish-actions.pod:429
17965 msgid "blockdev-getsize64"
17969 #: ../fish/guestfish-actions.pod:431
17972 " blockdev-getsize64 device\n"
17977 #: ../fish/guestfish-actions.pod:435
17978 msgid "See also L</blockdev-getsz>."
17982 #: ../fish/guestfish-actions.pod:439
17983 msgid "blockdev-getss"
17987 #: ../fish/guestfish-actions.pod:441
17990 " blockdev-getss device\n"
17995 #: ../fish/guestfish-actions.pod:446
17997 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
18001 #: ../fish/guestfish-actions.pod:451
18002 msgid "blockdev-getsz"
18006 #: ../fish/guestfish-actions.pod:453
18009 " blockdev-getsz device\n"
18014 #: ../fish/guestfish-actions.pod:458
18016 "See also L</blockdev-getss> for the real sector size of the device, and L</"
18017 "blockdev-getsize64> for the more useful I<size in bytes>."
18021 #: ../fish/guestfish-actions.pod:464
18022 msgid "blockdev-rereadpt"
18026 #: ../fish/guestfish-actions.pod:466
18029 " blockdev-rereadpt device\n"
18034 #: ../fish/guestfish-actions.pod:472
18035 msgid "blockdev-setbsz"
18039 #: ../fish/guestfish-actions.pod:474
18042 " blockdev-setbsz device blocksize\n"
18047 #: ../fish/guestfish-actions.pod:483
18048 msgid "blockdev-setro"
18052 #: ../fish/guestfish-actions.pod:485
18055 " blockdev-setro device\n"
18060 #: ../fish/guestfish-actions.pod:491
18061 msgid "blockdev-setrw"
18065 #: ../fish/guestfish-actions.pod:493
18068 " blockdev-setrw device\n"
18073 #: ../fish/guestfish-actions.pod:499
18074 msgid "case-sensitive-path"
18078 #: ../fish/guestfish-actions.pod:501
18081 " case-sensitive-path path\n"
18086 #: ../fish/guestfish-actions.pod:525
18088 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
18089 "WINDOWS/system32\"> (the exact return value would depend on details of how "
18090 "the directories were originally created under Windows)."
18094 #: ../fish/guestfish-actions.pod:533
18095 msgid "See also L</realpath>."
18099 #: ../fish/guestfish-actions.pod:535
18104 #: ../fish/guestfish-actions.pod:537
18112 #: ../fish/guestfish-actions.pod:541
18114 "Note that this function cannot correctly handle binary files (specifically, "
18115 "files containing C<\\0> character which is treated as end of string). For "
18116 "those you need to use the L</read-file> or L</download> functions which have "
18117 "a more complex interface."
18121 #: ../fish/guestfish-actions.pod:549
18126 #: ../fish/guestfish-actions.pod:551
18129 " checksum csumtype path\n"
18134 #: ../fish/guestfish-actions.pod:594
18135 msgid "To get the checksum for a device, use L</checksum-device>."
18139 #: ../fish/guestfish-actions.pod:596
18140 msgid "To get the checksums for many files, use L</checksums-out>."
18144 #: ../fish/guestfish-actions.pod:598
18145 msgid "checksum-device"
18149 #: ../fish/guestfish-actions.pod:600
18152 " checksum-device csumtype device\n"
18157 #: ../fish/guestfish-actions.pod:602
18159 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
18160 "device named C<device>. For the types of checksums supported see the L</"
18161 "checksum> command."
18165 #: ../fish/guestfish-actions.pod:606
18166 msgid "checksums-out"
18170 #: ../fish/guestfish-actions.pod:608
18173 " checksums-out csumtype directory (sumsfile|-)\n"
18178 #: ../fish/guestfish-actions.pod:624
18183 #: ../fish/guestfish-actions.pod:626
18186 " chmod mode path\n"
18191 #: ../fish/guestfish-actions.pod:637
18196 #: ../fish/guestfish-actions.pod:639
18199 " chown owner group path\n"
18204 #: ../fish/guestfish-actions.pod:647
18209 #: ../fish/guestfish-actions.pod:649
18212 " command 'arguments ...'\n"
18217 #: ../fish/guestfish-actions.pod:656
18219 "The single parameter is an argv-style list of arguments. The first element "
18220 "is the name of the program to run. Subsequent elements are parameters. The "
18221 "list must be non-empty (ie. must contain a program name). Note that the "
18222 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
18226 #: ../fish/guestfish-actions.pod:684
18227 msgid "command-lines"
18231 #: ../fish/guestfish-actions.pod:686
18234 " command-lines 'arguments ...'\n"
18239 #: ../fish/guestfish-actions.pod:688
18241 "This is the same as L</command>, but splits the result into a list of lines."
18245 #: ../fish/guestfish-actions.pod:691
18246 msgid "See also: L</sh-lines>"
18250 #: ../fish/guestfish-actions.pod:696
18255 #: ../fish/guestfish-actions.pod:698
18258 " config qemuparam qemuvalue\n"
18263 #: ../fish/guestfish-actions.pod:709
18268 #: ../fish/guestfish-actions.pod:711
18271 " copy-size src dest size\n"
18276 #: ../fish/guestfish-actions.pod:719
18281 #: ../fish/guestfish-actions.pod:721
18289 #: ../fish/guestfish-actions.pod:726
18294 #: ../fish/guestfish-actions.pod:728
18302 #: ../fish/guestfish-actions.pod:733
18307 #: ../fish/guestfish-actions.pod:735
18315 #: ../fish/guestfish-actions.pod:742
18317 "If the destination is a device, it must be as large or larger than the "
18318 "source file or device, otherwise the copy will fail. This command cannot do "
18319 "partial copies (see L</copy-size>)."
18323 #: ../fish/guestfish-actions.pod:746
18328 #: ../fish/guestfish-actions.pod:748
18331 " debug subcmd 'extraargs ...'\n"
18336 #: ../fish/guestfish-actions.pod:750
18338 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
18339 "daemon) that runs inside the qemu subprocess."
18343 #: ../fish/guestfish-actions.pod:758
18344 msgid "debug-upload"
18348 #: ../fish/guestfish-actions.pod:760
18351 " debug-upload (filename|-) tmpname mode\n"
18356 #: ../fish/guestfish-actions.pod:762
18358 "The L</debug-upload> command uploads a file to the libguestfs appliance."
18362 #: ../fish/guestfish-actions.pod:771
18367 #: ../fish/guestfish-actions.pod:773
18375 #: ../fish/guestfish-actions.pod:781
18380 #: ../fish/guestfish-actions.pod:783
18388 #: ../fish/guestfish-actions.pod:792
18393 #: ../fish/guestfish-actions.pod:794
18401 #: ../fish/guestfish-actions.pod:800
18403 "Another way to get the same information is to enable verbose messages with "
18404 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
18405 "before running the program."
18409 #: ../fish/guestfish-actions.pod:805
18414 #: ../fish/guestfish-actions.pod:807
18417 " download remotefilename (filename|-)\n"
18422 #: ../fish/guestfish-actions.pod:814
18423 msgid "See also L</upload>, L</cat>."
18427 #: ../fish/guestfish-actions.pod:818
18428 msgid "download-offset"
18432 #: ../fish/guestfish-actions.pod:820
18435 " download-offset remotefilename (filename|-) offset size\n"
18440 #: ../fish/guestfish-actions.pod:828
18442 "Note that there is no limit on the amount of data that can be downloaded "
18443 "with this call, unlike with L</pread>, and this call always reads the full "
18444 "amount unless an error occurs."
18448 #: ../fish/guestfish-actions.pod:833
18449 msgid "See also L</download>, L</pread>."
18453 #: ../fish/guestfish-actions.pod:837
18454 msgid "drop-caches"
18458 #: ../fish/guestfish-actions.pod:839
18461 " drop-caches whattodrop\n"
18466 #: ../fish/guestfish-actions.pod:851
18471 #: ../fish/guestfish-actions.pod:853
18479 #: ../fish/guestfish-actions.pod:865
18484 #: ../fish/guestfish-actions.pod:867
18487 " e2fsck-f device\n"
18492 #: ../fish/guestfish-actions.pod:873
18494 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
18495 "should use L</fsck>."
18499 #: ../fish/guestfish-actions.pod:876
18500 msgid "echo-daemon"
18504 #: ../fish/guestfish-actions.pod:878
18507 " echo-daemon 'words ...'\n"
18512 #: ../fish/guestfish-actions.pod:885
18513 msgid "See also L</ping-daemon>."
18517 #: ../fish/guestfish-actions.pod:887
18522 #: ../fish/guestfish-actions.pod:889
18525 " egrep regex path\n"
18530 #: ../fish/guestfish-actions.pod:897
18535 #: ../fish/guestfish-actions.pod:899
18538 " egrepi regex path\n"
18543 #: ../fish/guestfish-actions.pod:907
18548 #: ../fish/guestfish-actions.pod:909
18551 " equal file1 file2\n"
18556 #: ../fish/guestfish-actions.pod:916
18561 #: ../fish/guestfish-actions.pod:918
18569 #: ../fish/guestfish-actions.pod:923
18570 msgid "See also L</is-file>, L</is-dir>, L</stat>."
18574 #: ../fish/guestfish-actions.pod:925
18579 #: ../fish/guestfish-actions.pod:927
18582 " fallocate path len\n"
18587 #: ../fish/guestfish-actions.pod:944
18588 msgid "fallocate64"
18592 #: ../fish/guestfish-actions.pod:946
18595 " fallocate64 path len\n"
18600 #: ../fish/guestfish-actions.pod:952
18602 "Note that this call allocates disk blocks for the file. To create a sparse "
18603 "file use L</truncate-size> instead."
18607 #: ../fish/guestfish-actions.pod:955
18609 "The deprecated call L</fallocate> does the same, but owing to an oversight "
18610 "it only allowed 30 bit lengths to be specified, effectively limiting the "
18611 "maximum size of files created through that call to 1GB."
18615 #: ../fish/guestfish-actions.pod:964
18620 #: ../fish/guestfish-actions.pod:966
18623 " fgrep pattern path\n"
18628 #: ../fish/guestfish-actions.pod:974
18633 #: ../fish/guestfish-actions.pod:976
18636 " fgrepi pattern path\n"
18641 #: ../fish/guestfish-actions.pod:984
18646 #: ../fish/guestfish-actions.pod:986
18654 #: ../fish/guestfish-actions.pod:998
18656 "This command can also be used on C</dev/> devices (and partitions, LV "
18657 "names). You can for example use this to determine if a device contains a "
18658 "filesystem, although it's usually better to use L</vfs-type>."
18662 #: ../fish/guestfish-actions.pod:1008
18663 msgid "file-architecture"
18667 #: ../fish/guestfish-actions.pod:1010
18670 " file-architecture filename\n"
18675 #: ../fish/guestfish-actions.pod:1113
18680 #: ../fish/guestfish-actions.pod:1115
18688 #: ../fish/guestfish-actions.pod:1119
18690 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
18691 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
18695 #: ../fish/guestfish-actions.pod:1123
18700 #: ../fish/guestfish-actions.pod:1125
18703 " fill c len path\n"
18708 #: ../fish/guestfish-actions.pod:1131
18710 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18711 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
18712 "L</fill-pattern>."
18716 #: ../fish/guestfish-actions.pod:1136
18717 msgid "fill-pattern"
18721 #: ../fish/guestfish-actions.pod:1138
18724 " fill-pattern pattern len path\n"
18729 #: ../fish/guestfish-actions.pod:1140
18731 "This function is like L</fill> except that it creates a new file of length "
18732 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18733 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18738 #: ../fish/guestfish-actions.pod:1145
18743 #: ../fish/guestfish-actions.pod:1147
18746 " find directory\n"
18751 #: ../fish/guestfish-actions.pod:1161
18752 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
18756 #: ../fish/guestfish-actions.pod:1174
18757 msgid "See also L</find0>."
18761 #: ../fish/guestfish-actions.pod:1179
18766 #: ../fish/guestfish-actions.pod:1181
18769 " find0 directory (files|-)\n"
18774 #: ../fish/guestfish-actions.pod:1187
18776 "This command works the same way as L</find> with the following exceptions:"
18780 #: ../fish/guestfish-actions.pod:1214
18781 msgid "findfs-label"
18785 #: ../fish/guestfish-actions.pod:1216
18788 " findfs-label label\n"
18793 #: ../fish/guestfish-actions.pod:1222
18794 msgid "To find the label of a filesystem, use L</vfs-label>."
18798 #: ../fish/guestfish-actions.pod:1224
18799 msgid "findfs-uuid"
18803 #: ../fish/guestfish-actions.pod:1226
18806 " findfs-uuid uuid\n"
18811 #: ../fish/guestfish-actions.pod:1232
18812 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
18816 #: ../fish/guestfish-actions.pod:1234
18821 #: ../fish/guestfish-actions.pod:1236
18824 " fsck fstype device\n"
18829 #: ../fish/guestfish-actions.pod:1266
18834 #: ../fish/guestfish-actions.pod:1268
18842 #: ../fish/guestfish-actions.pod:1275
18843 msgid "get-autosync"
18847 #: ../fish/guestfish-actions.pod:1277
18855 #: ../fish/guestfish-actions.pod:1281
18860 #: ../fish/guestfish-actions.pod:1283
18868 #: ../fish/guestfish-actions.pod:1287
18869 msgid "get-e2label"
18873 #: ../fish/guestfish-actions.pod:1289
18876 " get-e2label device\n"
18881 #: ../fish/guestfish-actions.pod:1301
18886 #: ../fish/guestfish-actions.pod:1303
18889 " get-e2uuid device\n"
18894 #: ../fish/guestfish-actions.pod:1315
18895 msgid "get-memsize"
18899 #: ../fish/guestfish-actions.pod:1317
18907 #: ../fish/guestfish-actions.pod:1322
18909 "If L</set-memsize> was not called on this handle, and if "
18910 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18911 "value for memsize."
18915 #: ../fish/guestfish-actions.pod:1329
18916 msgid "get-network"
18920 #: ../fish/guestfish-actions.pod:1331
18928 #: ../fish/guestfish-actions.pod:1335
18933 #: ../fish/guestfish-actions.pod:1337
18941 #: ../fish/guestfish-actions.pod:1344
18946 #: ../fish/guestfish-actions.pod:1346
18951 #: ../fish/guestfish-actions.pod:1348
18959 #: ../fish/guestfish-actions.pod:1355
18964 #: ../fish/guestfish-actions.pod:1357
18972 #: ../fish/guestfish-actions.pod:1364
18973 msgid "get-recovery-proc"
18977 #: ../fish/guestfish-actions.pod:1366
18980 " get-recovery-proc\n"
18985 #: ../fish/guestfish-actions.pod:1370
18986 msgid "get-selinux"
18990 #: ../fish/guestfish-actions.pod:1372
18998 #: ../fish/guestfish-actions.pod:1374
19000 "This returns the current setting of the selinux flag which is passed to the "
19001 "appliance at boot time. See L</set-selinux>."
19005 #: ../fish/guestfish-actions.pod:1380
19010 #: ../fish/guestfish-actions.pod:1382
19018 #: ../fish/guestfish-actions.pod:1389
19023 #: ../fish/guestfish-actions.pod:1391
19031 #: ../fish/guestfish-actions.pod:1395
19036 #: ../fish/guestfish-actions.pod:1397
19044 #: ../fish/guestfish-actions.pod:1399
19046 "Return the current umask. By default the umask is C<022> unless it has been "
19047 "set by calling L</umask>."
19051 #: ../fish/guestfish-actions.pod:1402
19052 msgid "get-verbose"
19056 #: ../fish/guestfish-actions.pod:1404
19064 #: ../fish/guestfish-actions.pod:1408
19069 #: ../fish/guestfish-actions.pod:1410
19077 #: ../fish/guestfish-actions.pod:1414
19078 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
19082 #: ../fish/guestfish-actions.pod:1417
19087 #: ../fish/guestfish-actions.pod:1419
19090 " getxattrs path\n"
19095 #: ../fish/guestfish-actions.pod:1427
19096 msgid "See also: L</lgetxattrs>, L<attr(5)>."
19100 #: ../fish/guestfish-actions.pod:1429
19101 msgid "glob-expand"
19105 #: ../fish/guestfish-actions.pod:1431
19108 " glob-expand pattern\n"
19113 #: ../fish/guestfish-actions.pod:1444
19118 #: ../fish/guestfish-actions.pod:1446
19121 " grep regex path\n"
19126 #: ../fish/guestfish-actions.pod:1454
19131 #: ../fish/guestfish-actions.pod:1456
19134 " grepi regex path\n"
19139 #: ../fish/guestfish-actions.pod:1464
19140 msgid "grub-install"
19144 #: ../fish/guestfish-actions.pod:1466
19147 " grub-install root device\n"
19152 #: ../fish/guestfish-actions.pod:1482
19157 #: ../fish/guestfish-actions.pod:1484
19165 #: ../fish/guestfish-actions.pod:1492
19170 #: ../fish/guestfish-actions.pod:1494
19173 " head-n nrlines path\n"
19178 #: ../fish/guestfish-actions.pod:1507
19183 #: ../fish/guestfish-actions.pod:1509
19191 #: ../fish/guestfish-actions.pod:1517
19196 #: ../fish/guestfish-actions.pod:1519
19199 " initrd-cat initrdpath filename\n"
19204 #: ../fish/guestfish-actions.pod:1531
19205 msgid "See also L</initrd-list>."
19209 #: ../fish/guestfish-actions.pod:1536
19210 msgid "initrd-list"
19214 #: ../fish/guestfish-actions.pod:1538
19217 " initrd-list path\n"
19222 #: ../fish/guestfish-actions.pod:1550
19223 msgid "inotify-add-watch"
19227 #: ../fish/guestfish-actions.pod:1552
19230 " inotify-add-watch path mask\n"
19235 #: ../fish/guestfish-actions.pod:1564
19236 msgid "inotify-close"
19240 #: ../fish/guestfish-actions.pod:1566
19248 #: ../fish/guestfish-actions.pod:1572
19249 msgid "inotify-files"
19253 #: ../fish/guestfish-actions.pod:1574
19261 #: ../fish/guestfish-actions.pod:1576
19263 "This function is a helpful wrapper around L</inotify-read> which just "
19264 "returns a list of pathnames of objects that were touched. The returned "
19265 "pathnames are sorted and deduplicated."
19269 #: ../fish/guestfish-actions.pod:1580
19270 msgid "inotify-init"
19274 #: ../fish/guestfish-actions.pod:1582
19277 " inotify-init maxevents\n"
19282 #: ../fish/guestfish-actions.pod:1588
19284 "C<maxevents> is the maximum number of events which will be queued up between "
19285 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
19286 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
19287 "default was 16384 events. Beyond this limit, the kernel throws away events, "
19288 "but records the fact that it threw them away by setting a flag "
19289 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
19293 #: ../fish/guestfish-actions.pod:1598
19295 "Before any events are generated, you have to add some watches to the "
19296 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
19297 "L</inotify-watch-all>."
19301 #: ../fish/guestfish-actions.pod:1604
19303 "Queued up events should be read periodically by calling L</inotify-read> (or "
19304 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
19305 "If you don't read the events out often enough then you risk the internal "
19306 "queue overflowing."
19310 #: ../fish/guestfish-actions.pod:1611
19312 "The handle should be closed after use by calling L</inotify-close>. This "
19313 "also removes any watches automatically."
19317 #: ../fish/guestfish-actions.pod:1620
19318 msgid "inotify-read"
19322 #: ../fish/guestfish-actions.pod:1622
19330 #: ../fish/guestfish-actions.pod:1635
19331 msgid "inotify-rm-watch"
19335 #: ../fish/guestfish-actions.pod:1637
19338 " inotify-rm-watch wd\n"
19343 #: ../fish/guestfish-actions.pod:1639
19344 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
19348 #: ../fish/guestfish-actions.pod:1642
19349 msgid "inspect-get-arch"
19353 #: ../fish/guestfish-actions.pod:1644
19356 " inspect-get-arch root\n"
19361 #: ../fish/guestfish-actions.pod:1646 ../fish/guestfish-actions.pod:1662
19362 #: ../fish/guestfish-actions.pod:1708 ../fish/guestfish-actions.pod:1726
19363 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1762
19364 #: ../fish/guestfish-actions.pod:1785 ../fish/guestfish-actions.pod:1802
19365 #: ../fish/guestfish-actions.pod:1833
19367 "This function should only be called with a root device string as returned by "
19372 #: ../fish/guestfish-actions.pod:1649
19374 "This returns the architecture of the inspected operating system. The "
19375 "possible return values are listed under L</file-architecture>."
19379 #: ../fish/guestfish-actions.pod:1658
19380 msgid "inspect-get-distro"
19384 #: ../fish/guestfish-actions.pod:1660
19387 " inspect-get-distro root\n"
19392 #: ../fish/guestfish-actions.pod:1704
19393 msgid "inspect-get-filesystems"
19397 #: ../fish/guestfish-actions.pod:1706
19400 " inspect-get-filesystems root\n"
19405 #: ../fish/guestfish-actions.pod:1719
19407 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19408 "get-mountpoints>."
19412 #: ../fish/guestfish-actions.pod:1722
19413 msgid "inspect-get-major-version"
19417 #: ../fish/guestfish-actions.pod:1724
19420 " inspect-get-major-version root\n"
19425 #: ../fish/guestfish-actions.pod:1743
19426 msgid "inspect-get-minor-version"
19430 #: ../fish/guestfish-actions.pod:1745
19433 " inspect-get-minor-version root\n"
19438 #: ../fish/guestfish-actions.pod:1755
19440 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19441 "get-major-version>."
19445 #: ../fish/guestfish-actions.pod:1758
19446 msgid "inspect-get-mountpoints"
19450 #: ../fish/guestfish-actions.pod:1760
19453 " inspect-get-mountpoints root\n"
19458 #: ../fish/guestfish-actions.pod:1778
19460 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
19461 "get-filesystems>."
19465 #: ../fish/guestfish-actions.pod:1781
19466 msgid "inspect-get-product-name"
19470 #: ../fish/guestfish-actions.pod:1783
19473 " inspect-get-product-name root\n"
19478 #: ../fish/guestfish-actions.pod:1798
19479 msgid "inspect-get-type"
19483 #: ../fish/guestfish-actions.pod:1800
19486 " inspect-get-type root\n"
19491 #: ../fish/guestfish-actions.pod:1829
19492 msgid "inspect-get-windows-systemroot"
19496 #: ../fish/guestfish-actions.pod:1831
19499 " inspect-get-windows-systemroot root\n"
19504 #: ../fish/guestfish-actions.pod:1845
19509 #: ../fish/guestfish-actions.pod:1847
19517 #: ../fish/guestfish-actions.pod:1862
19519 "You can pass the root string(s) returned to other L</inspect-get-*> "
19520 "functions in order to query further information about each operating system, "
19521 "such as the name and version."
19525 #: ../fish/guestfish-actions.pod:1867
19527 "This function uses other libguestfs features such as L</mount-ro> and L</"
19528 "umount-all> in order to mount and unmount filesystems and look at the "
19529 "contents. This should be called with no disks currently mounted. The "
19530 "function may also use Augeas, so any existing Augeas handle will be closed."
19534 #: ../fish/guestfish-actions.pod:1879 ../fish/guestfish-actions.pod:2035
19535 #: ../fish/guestfish-actions.pod:2081
19536 msgid "See also L</list-filesystems>."
19540 #: ../fish/guestfish-actions.pod:1881
19541 msgid "is-blockdev"
19545 #: ../fish/guestfish-actions.pod:1883
19548 " is-blockdev path\n"
19553 #: ../fish/guestfish-actions.pod:1888 ../fish/guestfish-actions.pod:1906
19554 #: ../fish/guestfish-actions.pod:1925 ../fish/guestfish-actions.pod:1934
19555 #: ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1978
19556 #: ../fish/guestfish-actions.pod:1987
19557 msgid "See also L</stat>."
19561 #: ../fish/guestfish-actions.pod:1890
19566 #: ../fish/guestfish-actions.pod:1892
19574 #: ../fish/guestfish-actions.pod:1899
19579 #: ../fish/guestfish-actions.pod:1901
19582 " is-chardev path\n"
19587 #: ../fish/guestfish-actions.pod:1908
19592 #: ../fish/guestfish-actions.pod:1910
19600 #: ../fish/guestfish-actions.pod:1917
19605 #: ../fish/guestfish-actions.pod:1919
19613 #: ../fish/guestfish-actions.pod:1927
19618 #: ../fish/guestfish-actions.pod:1929
19626 #: ../fish/guestfish-actions.pod:1936
19631 #: ../fish/guestfish-actions.pod:1938
19639 #: ../fish/guestfish-actions.pod:1946
19640 msgid "is-launching"
19644 #: ../fish/guestfish-actions.pod:1948
19652 #: ../fish/guestfish-actions.pod:1955
19657 #: ../fish/guestfish-actions.pod:1957
19665 #: ../fish/guestfish-actions.pod:1962
19670 #: ../fish/guestfish-actions.pod:1964
19678 #: ../fish/guestfish-actions.pod:1971
19683 #: ../fish/guestfish-actions.pod:1973
19686 " is-socket path\n"
19691 #: ../fish/guestfish-actions.pod:1980
19696 #: ../fish/guestfish-actions.pod:1982
19699 " is-symlink path\n"
19704 #: ../fish/guestfish-actions.pod:1989
19705 msgid "kill-subprocess"
19709 #: ../fish/guestfish-actions.pod:1991
19712 " kill-subprocess\n"
19717 #: ../fish/guestfish-actions.pod:1995
19722 #: ../fish/guestfish-actions.pod:1997
19727 #: ../fish/guestfish-actions.pod:1999
19735 #: ../fish/guestfish-actions.pod:2007
19740 #: ../fish/guestfish-actions.pod:2009
19743 " lchown owner group path\n"
19748 #: ../fish/guestfish-actions.pod:2011
19750 "Change the file owner to C<owner> and group to C<group>. This is like L</"
19751 "chown> but if C<path> is a symlink then the link itself is changed, not the "
19756 #: ../fish/guestfish-actions.pod:2019
19761 #: ../fish/guestfish-actions.pod:2021
19764 " lgetxattrs path\n"
19769 #: ../fish/guestfish-actions.pod:2023
19771 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
19772 "it returns the extended attributes of the link itself."
19776 #: ../fish/guestfish-actions.pod:2027
19777 msgid "list-devices"
19781 #: ../fish/guestfish-actions.pod:2029
19789 #: ../fish/guestfish-actions.pod:2037
19790 msgid "list-filesystems"
19794 #: ../fish/guestfish-actions.pod:2039
19797 " list-filesystems\n"
19802 #: ../fish/guestfish-actions.pod:2058
19804 "This command runs other libguestfs commands, which might include L</mount> "
19805 "and L</umount>, and therefore you should use this soon after launch and only "
19806 "when nothing is mounted."
19810 #: ../fish/guestfish-actions.pod:2062
19812 "Not all of the filesystems returned will be mountable. In particular, swap "
19813 "partitions are returned in the list. Also this command does not check that "
19814 "each filesystem found is valid and mountable, and some filesystems might be "
19815 "mountable but require special options. Filesystems may not all belong to a "
19816 "single logical operating system (use L</inspect-os> to look for OSes)."
19820 #: ../fish/guestfish-actions.pod:2070
19821 msgid "list-partitions"
19825 #: ../fish/guestfish-actions.pod:2072
19828 " list-partitions\n"
19833 #: ../fish/guestfish-actions.pod:2078
19835 "This does not return logical volumes. For that you will need to call L</"
19840 #: ../fish/guestfish-actions.pod:2083
19845 #: ../fish/guestfish-actions.pod:2085
19853 #: ../fish/guestfish-actions.pod:2093
19858 #: ../fish/guestfish-actions.pod:2095
19861 " ln target linkname\n"
19866 #: ../fish/guestfish-actions.pod:2099
19871 #: ../fish/guestfish-actions.pod:2101
19874 " ln-f target linkname\n"
19879 #: ../fish/guestfish-actions.pod:2106
19884 #: ../fish/guestfish-actions.pod:2108
19887 " ln-s target linkname\n"
19892 #: ../fish/guestfish-actions.pod:2112
19897 #: ../fish/guestfish-actions.pod:2114
19900 " ln-sf target linkname\n"
19905 #: ../fish/guestfish-actions.pod:2119
19906 msgid "lremovexattr"
19910 #: ../fish/guestfish-actions.pod:2121
19913 " lremovexattr xattr path\n"
19918 #: ../fish/guestfish-actions.pod:2123
19920 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
19921 "it removes an extended attribute of the link itself."
19925 #: ../fish/guestfish-actions.pod:2127
19930 #: ../fish/guestfish-actions.pod:2129
19938 #: ../fish/guestfish-actions.pod:2135
19940 "This command is mostly useful for interactive sessions. Programs should "
19941 "probably use L</readdir> instead."
19945 #: ../fish/guestfish-actions.pod:2138
19950 #: ../fish/guestfish-actions.pod:2140
19953 " lsetxattr xattr val vallen path\n"
19958 #: ../fish/guestfish-actions.pod:2142
19960 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
19961 "sets an extended attribute of the link itself."
19965 #: ../fish/guestfish-actions.pod:2146
19970 #: ../fish/guestfish-actions.pod:2148
19978 #: ../fish/guestfish-actions.pod:2152
19980 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
19981 "the link is stat-ed, not the file it refers to."
19985 #: ../fish/guestfish-actions.pod:2158
19990 #: ../fish/guestfish-actions.pod:2160
19993 " lstatlist path 'names ...'\n"
19998 #: ../fish/guestfish-actions.pod:2162
20000 "This call allows you to perform the L</lstat> operation on multiple files, "
20001 "where all files are in the directory C<path>. C<names> is the list of files "
20002 "from this directory."
20006 #: ../fish/guestfish-actions.pod:2171
20008 "This call is intended for programs that want to efficiently list a directory "
20009 "contents without making many round-trips. See also L</lxattrlist> for a "
20010 "similarly efficient call for getting extended attributes. Very long "
20011 "directory listings might cause the protocol message size to be exceeded, "
20012 "causing this call to fail. The caller must split up such requests into "
20013 "smaller groups of names."
20017 #: ../fish/guestfish-actions.pod:2179
20018 msgid "luks-add-key"
20022 #: ../fish/guestfish-actions.pod:2181
20025 " luks-add-key device keyslot\n"
20030 #: ../fish/guestfish-actions.pod:2188
20032 "Note that if C<keyslot> already contains a key, then this command will "
20033 "fail. You have to use L</luks-kill-slot> first to remove that key."
20037 #: ../fish/guestfish-actions.pod:2192 ../fish/guestfish-actions.pod:2214
20038 #: ../fish/guestfish-actions.pod:2227 ../fish/guestfish-actions.pod:2241
20039 #: ../fish/guestfish-actions.pod:2264 ../fish/guestfish-actions.pod:2274
20041 "This command has one or more key or passphrase parameters. Guestfish will "
20042 "prompt for these separately."
20046 #: ../fish/guestfish-actions.pod:2195
20051 #: ../fish/guestfish-actions.pod:2197
20054 " luks-close device\n"
20059 #: ../fish/guestfish-actions.pod:2199
20061 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
20062 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
20063 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
20068 #: ../fish/guestfish-actions.pod:2205
20069 msgid "luks-format"
20073 #: ../fish/guestfish-actions.pod:2207
20076 " luks-format device keyslot\n"
20081 #: ../fish/guestfish-actions.pod:2220
20082 msgid "luks-format-cipher"
20086 #: ../fish/guestfish-actions.pod:2222
20089 " luks-format-cipher device keyslot cipher\n"
20094 #: ../fish/guestfish-actions.pod:2224
20096 "This command is the same as L</luks-format> but it also allows you to set "
20097 "the C<cipher> used."
20101 #: ../fish/guestfish-actions.pod:2233
20102 msgid "luks-kill-slot"
20106 #: ../fish/guestfish-actions.pod:2235
20109 " luks-kill-slot device keyslot\n"
20114 #: ../fish/guestfish-actions.pod:2244
20119 #: ../fish/guestfish-actions.pod:2246
20122 " luks-open device mapname\n"
20127 #: ../fish/guestfish-actions.pod:2260
20129 "If this block device contains LVM volume groups, then calling L</vgscan> "
20130 "followed by L</vg-activate-all> will make them visible."
20134 #: ../fish/guestfish-actions.pod:2267
20135 msgid "luks-open-ro"
20139 #: ../fish/guestfish-actions.pod:2269
20142 " luks-open-ro device mapname\n"
20147 #: ../fish/guestfish-actions.pod:2271
20149 "This is the same as L</luks-open> except that a read-only mapping is created."
20153 #: ../fish/guestfish-actions.pod:2277
20158 #: ../fish/guestfish-actions.pod:2279
20161 " lvcreate logvol volgroup mbytes\n"
20166 #: ../fish/guestfish-actions.pod:2284
20167 msgid "lvm-canonical-lv-name"
20171 #: ../fish/guestfish-actions.pod:2286
20174 " lvm-canonical-lv-name lvname\n"
20179 #: ../fish/guestfish-actions.pod:2295
20180 msgid "See also L</is-lv>."
20184 #: ../fish/guestfish-actions.pod:2297
20185 msgid "lvm-clear-filter"
20189 #: ../fish/guestfish-actions.pod:2299
20192 " lvm-clear-filter\n"
20197 #: ../fish/guestfish-actions.pod:2301
20199 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
20204 #: ../fish/guestfish-actions.pod:2307
20205 msgid "lvm-remove-all"
20209 #: ../fish/guestfish-actions.pod:2309
20212 " lvm-remove-all\n"
20217 #: ../fish/guestfish-actions.pod:2317
20218 msgid "lvm-set-filter"
20222 #: ../fish/guestfish-actions.pod:2319
20225 " lvm-set-filter 'devices ...'\n"
20230 #: ../fish/guestfish-actions.pod:2344
20235 #: ../fish/guestfish-actions.pod:2346
20238 " lvremove device\n"
20243 #: ../fish/guestfish-actions.pod:2354
20248 #: ../fish/guestfish-actions.pod:2356
20251 " lvrename logvol newlogvol\n"
20256 #: ../fish/guestfish-actions.pod:2360
20261 #: ../fish/guestfish-actions.pod:2362
20264 " lvresize device mbytes\n"
20269 #: ../fish/guestfish-actions.pod:2368
20270 msgid "lvresize-free"
20274 #: ../fish/guestfish-actions.pod:2370
20277 " lvresize-free lv percent\n"
20282 #: ../fish/guestfish-actions.pod:2378
20287 #: ../fish/guestfish-actions.pod:2380
20295 #: ../fish/guestfish-actions.pod:2388
20296 msgid "See also L</lvs-full>, L</list-filesystems>."
20300 #: ../fish/guestfish-actions.pod:2390
20305 #: ../fish/guestfish-actions.pod:2392
20313 #: ../fish/guestfish-actions.pod:2397
20318 #: ../fish/guestfish-actions.pod:2399
20326 #: ../fish/guestfish-actions.pod:2403
20331 #: ../fish/guestfish-actions.pod:2405
20334 " lxattrlist path 'names ...'\n"
20339 #: ../fish/guestfish-actions.pod:2421
20341 "This call is intended for programs that want to efficiently list a directory "
20342 "contents without making many round-trips. See also L</lstatlist> for a "
20343 "similarly efficient call for getting standard stats. Very long directory "
20344 "listings might cause the protocol message size to be exceeded, causing this "
20345 "call to fail. The caller must split up such requests into smaller groups of "
20350 #: ../fish/guestfish-actions.pod:2429
20355 #: ../fish/guestfish-actions.pod:2431
20363 #: ../fish/guestfish-actions.pod:2435
20368 #: ../fish/guestfish-actions.pod:2437
20371 " mkdir-mode path mode\n"
20376 #: ../fish/guestfish-actions.pod:2446
20377 msgid "See also L</mkdir>, L</umask>"
20381 #: ../fish/guestfish-actions.pod:2448
20386 #: ../fish/guestfish-actions.pod:2450
20394 #: ../fish/guestfish-actions.pod:2455
20399 #: ../fish/guestfish-actions.pod:2457
20402 " mkdtemp template\n"
20407 #: ../fish/guestfish-actions.pod:2478
20412 #: ../fish/guestfish-actions.pod:2480
20415 " mke2fs-J fstype blocksize device journal\n"
20420 #: ../fish/guestfish-actions.pod:2488
20421 msgid "See also L</mke2journal>."
20425 #: ../fish/guestfish-actions.pod:2490
20430 #: ../fish/guestfish-actions.pod:2492
20433 " mke2fs-JL fstype blocksize device label\n"
20438 #: ../fish/guestfish-actions.pod:2497
20439 msgid "See also L</mke2journal-L>."
20443 #: ../fish/guestfish-actions.pod:2499
20448 #: ../fish/guestfish-actions.pod:2501
20451 " mke2fs-JU fstype blocksize device uuid\n"
20456 #: ../fish/guestfish-actions.pod:2506
20457 msgid "See also L</mke2journal-U>."
20461 #: ../fish/guestfish-actions.pod:2508
20462 msgid "mke2journal"
20466 #: ../fish/guestfish-actions.pod:2510
20469 " mke2journal blocksize device\n"
20474 #: ../fish/guestfish-actions.pod:2517
20475 msgid "mke2journal-L"
20479 #: ../fish/guestfish-actions.pod:2519
20482 " mke2journal-L blocksize label device\n"
20487 #: ../fish/guestfish-actions.pod:2523
20488 msgid "mke2journal-U"
20492 #: ../fish/guestfish-actions.pod:2525
20495 " mke2journal-U blocksize uuid device\n"
20500 #: ../fish/guestfish-actions.pod:2529
20505 #: ../fish/guestfish-actions.pod:2531
20508 " mkfifo mode path\n"
20513 #: ../fish/guestfish-actions.pod:2533
20515 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
20516 "is just a convenient wrapper around L</mknod>."
20520 #: ../fish/guestfish-actions.pod:2539
20525 #: ../fish/guestfish-actions.pod:2541
20528 " mkfs fstype device\n"
20533 #: ../fish/guestfish-actions.pod:2547
20538 #: ../fish/guestfish-actions.pod:2549
20541 " mkfs-b fstype blocksize device\n"
20546 #: ../fish/guestfish-actions.pod:2551
20548 "This call is similar to L</mkfs>, but it allows you to control the block "
20549 "size of the resulting filesystem. Supported block sizes depend on the "
20550 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
20554 #: ../fish/guestfish-actions.pod:2559
20555 msgid "mkmountpoint"
20559 #: ../fish/guestfish-actions.pod:2561
20562 " mkmountpoint exemptpath\n"
20567 #: ../fish/guestfish-actions.pod:2563
20569 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
20570 "to create extra mountpoints before mounting the first filesystem."
20574 #: ../fish/guestfish-actions.pod:2587
20576 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
20577 "unexpected errors if you try to mix these calls. It is safest to manually "
20578 "unmount filesystems and remove mountpoints after use."
20582 #: ../fish/guestfish-actions.pod:2591
20584 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
20585 "for this to work for manual mountpoints, you must ensure that the innermost "
20586 "mountpoints have the longest pathnames, as in the example code above."
20590 #: ../fish/guestfish-actions.pod:2598
20592 "Autosync [see L</set-autosync>, this is set by default on handles] means "
20593 "that L</umount-all> is called when the handle is closed which can also "
20594 "trigger these issues."
20598 #: ../fish/guestfish-actions.pod:2602
20603 #: ../fish/guestfish-actions.pod:2604
20606 " mknod mode devmajor devminor path\n"
20611 #: ../fish/guestfish-actions.pod:2614
20613 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
20614 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
20615 "regular file). These constants are available in the standard Linux header "
20616 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
20617 "wrappers around this command which bitwise OR in the appropriate constant "
20622 #: ../fish/guestfish-actions.pod:2624
20627 #: ../fish/guestfish-actions.pod:2626
20630 " mknod-b mode devmajor devminor path\n"
20635 #: ../fish/guestfish-actions.pod:2628
20637 "This call creates a block device node called C<path> with mode C<mode> and "
20638 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20639 "wrapper around L</mknod>."
20643 #: ../fish/guestfish-actions.pod:2634
20648 #: ../fish/guestfish-actions.pod:2636
20651 " mknod-c mode devmajor devminor path\n"
20656 #: ../fish/guestfish-actions.pod:2638
20658 "This call creates a char device node called C<path> with mode C<mode> and "
20659 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20660 "wrapper around L</mknod>."
20664 #: ../fish/guestfish-actions.pod:2644
20669 #: ../fish/guestfish-actions.pod:2646
20677 #: ../fish/guestfish-actions.pod:2650
20682 #: ../fish/guestfish-actions.pod:2652
20685 " mkswap-L label device\n"
20690 #: ../fish/guestfish-actions.pod:2660
20695 #: ../fish/guestfish-actions.pod:2662
20698 " mkswap-U uuid device\n"
20703 #: ../fish/guestfish-actions.pod:2666
20704 msgid "mkswap-file"
20708 #: ../fish/guestfish-actions.pod:2668
20711 " mkswap-file path\n"
20716 #: ../fish/guestfish-actions.pod:2672
20718 "This command just writes a swap file signature to an existing file. To "
20719 "create the file itself, use something like L</fallocate>."
20723 #: ../fish/guestfish-actions.pod:2675
20728 #: ../fish/guestfish-actions.pod:2677
20731 " modprobe modulename\n"
20736 #: ../fish/guestfish-actions.pod:2684
20741 #: ../fish/guestfish-actions.pod:2686
20744 " mount device mountpoint\n"
20749 #: ../fish/guestfish-actions.pod:2702
20751 "B<Important note:> When you use this call, the filesystem options C<sync> "
20752 "and C<noatime> are set implicitly. This was originally done because we "
20753 "thought it would improve reliability, but it turns out that I<-o sync> has a "
20754 "very large negative performance impact and negligible effect on "
20755 "reliability. Therefore we recommend that you avoid using L</mount> in any "
20756 "code that needs performance, and instead use L</mount-options> (use an empty "
20757 "string for the first parameter if you don't want any options)."
20761 #: ../fish/guestfish-actions.pod:2712
20766 #: ../fish/guestfish-actions.pod:2714
20769 " mount-loop file mountpoint\n"
20774 #: ../fish/guestfish-actions.pod:2720
20775 msgid "mount-options"
20779 #: ../fish/guestfish-actions.pod:2722
20782 " mount-options options device mountpoint\n"
20787 #: ../fish/guestfish-actions.pod:2724
20789 "This is the same as the L</mount> command, but it allows you to set the "
20790 "mount options as for the L<mount(8)> I<-o> flag."
20794 #: ../fish/guestfish-actions.pod:2732
20799 #: ../fish/guestfish-actions.pod:2734
20802 " mount-ro device mountpoint\n"
20807 #: ../fish/guestfish-actions.pod:2736
20809 "This is the same as the L</mount> command, but it mounts the filesystem with "
20810 "the read-only (I<-o ro>) flag."
20814 #: ../fish/guestfish-actions.pod:2739
20819 #: ../fish/guestfish-actions.pod:2741
20822 " mount-vfs options vfstype device mountpoint\n"
20827 #: ../fish/guestfish-actions.pod:2743
20829 "This is the same as the L</mount> command, but it allows you to set both the "
20830 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20834 #: ../fish/guestfish-actions.pod:2747
20835 msgid "mountpoints"
20839 #: ../fish/guestfish-actions.pod:2749
20847 #: ../fish/guestfish-actions.pod:2751
20849 "This call is similar to L</mounts>. That call returns a list of devices. "
20850 "This one returns a hash table (map) of device name to directory where the "
20851 "device is mounted."
20855 #: ../fish/guestfish-actions.pod:2755
20860 #: ../fish/guestfish-actions.pod:2757
20868 #: ../fish/guestfish-actions.pod:2764
20869 msgid "See also: L</mountpoints>"
20873 #: ../fish/guestfish-actions.pod:2766
20878 #: ../fish/guestfish-actions.pod:2768
20886 #: ../fish/guestfish-actions.pod:2773
20887 msgid "ntfs-3g-probe"
20891 #: ../fish/guestfish-actions.pod:2775
20894 " ntfs-3g-probe true|false device\n"
20899 #: ../fish/guestfish-actions.pod:2789
20904 #: ../fish/guestfish-actions.pod:2791
20907 " ntfsresize device\n"
20912 #: ../fish/guestfish-actions.pod:2797
20913 msgid "ntfsresize-size"
20917 #: ../fish/guestfish-actions.pod:2799
20920 " ntfsresize-size device size\n"
20925 #: ../fish/guestfish-actions.pod:2801
20927 "This command is the same as L</ntfsresize> except that it allows you to "
20928 "specify the new size (in bytes) explicitly."
20932 #: ../fish/guestfish-actions.pod:2804
20937 #: ../fish/guestfish-actions.pod:2806
20940 " part-add device prlogex startsect endsect\n"
20945 #: ../fish/guestfish-actions.pod:2808
20947 "This command adds a partition to C<device>. If there is no partition table "
20948 "on the device, call L</part-init> first."
20952 #: ../fish/guestfish-actions.pod:2820
20954 "Creating a partition which covers the whole disk is not so easy. Use L</"
20955 "part-disk> to do that."
20959 #: ../fish/guestfish-actions.pod:2823
20964 #: ../fish/guestfish-actions.pod:2825
20967 " part-del device partnum\n"
20972 #: ../fish/guestfish-actions.pod:2833
20977 #: ../fish/guestfish-actions.pod:2835
20980 " part-disk device parttype\n"
20985 #: ../fish/guestfish-actions.pod:2837
20987 "This command is simply a combination of L</part-init> followed by L</part-"
20988 "add> to create a single primary partition covering the whole disk."
20992 #: ../fish/guestfish-actions.pod:2841
20994 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
20995 "possible values are described in L</part-init>."
20999 #: ../fish/guestfish-actions.pod:2847
21000 msgid "part-get-bootable"
21004 #: ../fish/guestfish-actions.pod:2849
21007 " part-get-bootable device partnum\n"
21012 #: ../fish/guestfish-actions.pod:2854
21013 msgid "See also L</part-set-bootable>."
21017 #: ../fish/guestfish-actions.pod:2856
21018 msgid "part-get-mbr-id"
21022 #: ../fish/guestfish-actions.pod:2858
21025 " part-get-mbr-id device partnum\n"
21030 #: ../fish/guestfish-actions.pod:2863 ../fish/guestfish-actions.pod:3001
21032 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
21033 "undefined results for other partition table types (see L</part-get-"
21038 #: ../fish/guestfish-actions.pod:2867
21039 msgid "part-get-parttype"
21043 #: ../fish/guestfish-actions.pod:2869
21046 " part-get-parttype device\n"
21051 #: ../fish/guestfish-actions.pod:2874
21053 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
21054 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
21055 "possible, although unusual. See L</part-init> for a full list."
21059 #: ../fish/guestfish-actions.pod:2879
21064 #: ../fish/guestfish-actions.pod:2881
21067 " part-init device parttype\n"
21072 #: ../fish/guestfish-actions.pod:2887
21074 "Initially there are no partitions. Following this, you should call L</part-"
21075 "add> for each partition required."
21079 #: ../fish/guestfish-actions.pod:2950
21084 #: ../fish/guestfish-actions.pod:2952
21087 " part-list device\n"
21092 #: ../fish/guestfish-actions.pod:2967
21094 "Start of the partition I<in bytes>. To get sectors you have to divide by "
21095 "the device's sector size, see L</blockdev-getss>."
21099 #: ../fish/guestfish-actions.pod:2980
21100 msgid "part-set-bootable"
21104 #: ../fish/guestfish-actions.pod:2982
21107 " part-set-bootable device partnum true|false\n"
21112 #: ../fish/guestfish-actions.pod:2991
21113 msgid "part-set-mbr-id"
21117 #: ../fish/guestfish-actions.pod:2993
21120 " part-set-mbr-id device partnum idbyte\n"
21125 #: ../fish/guestfish-actions.pod:3005
21126 msgid "part-set-name"
21130 #: ../fish/guestfish-actions.pod:3007
21133 " part-set-name device partnum name\n"
21138 #: ../fish/guestfish-actions.pod:3015
21139 msgid "part-to-dev"
21143 #: ../fish/guestfish-actions.pod:3017
21146 " part-to-dev partition\n"
21151 #: ../fish/guestfish-actions.pod:3023
21153 "The named partition must exist, for example as a string returned from L</"
21154 "list-partitions>."
21158 #: ../fish/guestfish-actions.pod:3026
21159 msgid "ping-daemon"
21163 #: ../fish/guestfish-actions.pod:3028
21171 #: ../fish/guestfish-actions.pod:3035
21176 #: ../fish/guestfish-actions.pod:3037
21179 " pread path count offset\n"
21184 #: ../fish/guestfish-actions.pod:3045
21185 msgid "See also L</pwrite>, L</pread-device>."
21189 #: ../fish/guestfish-actions.pod:3050
21190 msgid "pread-device"
21194 #: ../fish/guestfish-actions.pod:3052
21197 " pread-device device count offset\n"
21202 #: ../fish/guestfish-actions.pod:3060
21203 msgid "See also L</pread>."
21207 #: ../fish/guestfish-actions.pod:3065
21212 #: ../fish/guestfish-actions.pod:3067
21215 " pvcreate device\n"
21220 #: ../fish/guestfish-actions.pod:3073
21225 #: ../fish/guestfish-actions.pod:3075
21228 " pvremove device\n"
21233 #: ../fish/guestfish-actions.pod:3084
21238 #: ../fish/guestfish-actions.pod:3086
21241 " pvresize device\n"
21246 #: ../fish/guestfish-actions.pod:3091
21247 msgid "pvresize-size"
21251 #: ../fish/guestfish-actions.pod:3093
21254 " pvresize-size device size\n"
21259 #: ../fish/guestfish-actions.pod:3095
21261 "This command is the same as L</pvresize> except that it allows you to "
21262 "specify the new size (in bytes) explicitly."
21266 #: ../fish/guestfish-actions.pod:3098
21271 #: ../fish/guestfish-actions.pod:3100
21279 #: ../fish/guestfish-actions.pod:3108
21280 msgid "See also L</pvs-full>."
21284 #: ../fish/guestfish-actions.pod:3110
21289 #: ../fish/guestfish-actions.pod:3112
21297 #: ../fish/guestfish-actions.pod:3117
21302 #: ../fish/guestfish-actions.pod:3119
21310 #: ../fish/guestfish-actions.pod:3123
21315 #: ../fish/guestfish-actions.pod:3125
21318 " pwrite path content offset\n"
21323 #: ../fish/guestfish-actions.pod:3136
21324 msgid "See also L</pread>, L</pwrite-device>."
21328 #: ../fish/guestfish-actions.pod:3141
21329 msgid "pwrite-device"
21333 #: ../fish/guestfish-actions.pod:3143
21336 " pwrite-device device content offset\n"
21341 #: ../fish/guestfish-actions.pod:3153
21342 msgid "See also L</pwrite>."
21346 #: ../fish/guestfish-actions.pod:3158
21351 #: ../fish/guestfish-actions.pod:3160
21354 " read-file path\n"
21359 #: ../fish/guestfish-actions.pod:3165
21361 "Unlike L</cat>, this function can correctly handle files that contain "
21362 "embedded ASCII NUL characters. However unlike L</download>, this function "
21363 "is limited in the total size of file that can be handled."
21367 #: ../fish/guestfish-actions.pod:3173
21372 #: ../fish/guestfish-actions.pod:3175
21375 " read-lines path\n"
21380 #: ../fish/guestfish-actions.pod:3182
21382 "Note that this function cannot correctly handle binary files (specifically, "
21383 "files containing C<\\0> character which is treated as end of line). For "
21384 "those you need to use the L</read-file> function which has a more complex "
21389 #: ../fish/guestfish-actions.pod:3187
21394 #: ../fish/guestfish-actions.pod:3189
21402 #: ../fish/guestfish-actions.pod:3241
21404 "This function is primarily intended for use by programs. To get a simple "
21405 "list of names, use L</ls>. To get a printable directory for human "
21406 "consumption, use L</ll>."
21410 #: ../fish/guestfish-actions.pod:3245
21415 #: ../fish/guestfish-actions.pod:3247
21423 #: ../fish/guestfish-actions.pod:3251
21424 msgid "readlinklist"
21428 #: ../fish/guestfish-actions.pod:3253
21431 " readlinklist path 'names ...'\n"
21436 #: ../fish/guestfish-actions.pod:3277
21441 #: ../fish/guestfish-actions.pod:3279
21449 #: ../fish/guestfish-actions.pod:3284
21450 msgid "removexattr"
21454 #: ../fish/guestfish-actions.pod:3286
21457 " removexattr xattr path\n"
21462 #: ../fish/guestfish-actions.pod:3291
21463 msgid "See also: L</lremovexattr>, L<attr(5)>."
21467 #: ../fish/guestfish-actions.pod:3293
21472 #: ../fish/guestfish-actions.pod:3295
21475 " resize2fs device\n"
21480 #: ../fish/guestfish-actions.pod:3300
21482 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
21483 "before calling this command. For unknown reasons C<resize2fs> sometimes "
21484 "gives an error about this and sometimes not. In any case, it is always safe "
21485 "to call L</e2fsck-f> before calling this function."
21489 #: ../fish/guestfish-actions.pod:3306
21490 msgid "resize2fs-size"
21494 #: ../fish/guestfish-actions.pod:3308
21497 " resize2fs-size device size\n"
21502 #: ../fish/guestfish-actions.pod:3310
21504 "This command is the same as L</resize2fs> except that it allows you to "
21505 "specify the new size (in bytes) explicitly."
21509 #: ../fish/guestfish-actions.pod:3313
21514 #: ../fish/guestfish-actions.pod:3315
21522 #: ../fish/guestfish-actions.pod:3319
21527 #: ../fish/guestfish-actions.pod:3321
21535 #: ../fish/guestfish-actions.pod:3327
21540 #: ../fish/guestfish-actions.pod:3329
21548 #: ../fish/guestfish-actions.pod:3333
21549 msgid "rmmountpoint"
21553 #: ../fish/guestfish-actions.pod:3335
21556 " rmmountpoint exemptpath\n"
21561 #: ../fish/guestfish-actions.pod:3337
21563 "This calls removes a mountpoint that was previously created with L</"
21564 "mkmountpoint>. See L</mkmountpoint> for full details."
21568 #: ../fish/guestfish-actions.pod:3341
21569 msgid "scrub-device"
21573 #: ../fish/guestfish-actions.pod:3343
21576 " scrub-device device\n"
21581 #: ../fish/guestfish-actions.pod:3354
21586 #: ../fish/guestfish-actions.pod:3356
21589 " scrub-file file\n"
21594 #: ../fish/guestfish-actions.pod:3366
21595 msgid "scrub-freespace"
21599 #: ../fish/guestfish-actions.pod:3368
21602 " scrub-freespace dir\n"
21607 #: ../fish/guestfish-actions.pod:3370
21609 "This command creates the directory C<dir> and then fills it with files until "
21610 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
21611 "deletes them. The intention is to scrub any free space on the partition "
21612 "containing C<dir>."
21616 #: ../fish/guestfish-actions.pod:3379
21621 #: ../fish/guestfish-actions.pod:3381
21626 #: ../fish/guestfish-actions.pod:3383
21629 " set-append append\n"
21634 #: ../fish/guestfish-actions.pod:3394
21635 msgid "set-autosync"
21639 #: ../fish/guestfish-actions.pod:3396
21644 #: ../fish/guestfish-actions.pod:3398
21647 " set-autosync true|false\n"
21652 #: ../fish/guestfish-actions.pod:3400
21654 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
21655 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
21656 "closed (also if the program exits without closing handles)."
21660 #: ../fish/guestfish-actions.pod:3408
21665 #: ../fish/guestfish-actions.pod:3410
21670 #: ../fish/guestfish-actions.pod:3412
21673 " set-direct true|false\n"
21678 #: ../fish/guestfish-actions.pod:3418
21680 "One consequence of this is that log messages aren't caught by the library "
21681 "and handled by L</set-log-message-callback>, but go straight to stdout."
21685 #: ../fish/guestfish-actions.pod:3427
21686 msgid "set-e2label"
21690 #: ../fish/guestfish-actions.pod:3429
21693 " set-e2label device label\n"
21698 #: ../fish/guestfish-actions.pod:3435
21700 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
21701 "label on a filesystem."
21705 #: ../fish/guestfish-actions.pod:3438
21710 #: ../fish/guestfish-actions.pod:3440
21713 " set-e2uuid device uuid\n"
21718 #: ../fish/guestfish-actions.pod:3447
21720 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
21721 "UUID of a filesystem."
21725 #: ../fish/guestfish-actions.pod:3450
21726 msgid "set-memsize"
21730 #: ../fish/guestfish-actions.pod:3452
21735 #: ../fish/guestfish-actions.pod:3454
21738 " set-memsize memsize\n"
21743 #: ../fish/guestfish-actions.pod:3456
21745 "This sets the memory size in megabytes allocated to the qemu subprocess. "
21746 "This only has any effect if called before L</launch>."
21750 #: ../fish/guestfish-actions.pod:3467
21751 msgid "set-network"
21755 #: ../fish/guestfish-actions.pod:3469
21760 #: ../fish/guestfish-actions.pod:3471
21763 " set-network true|false\n"
21768 #: ../fish/guestfish-actions.pod:3479
21770 "You must call this before calling L</launch>, otherwise it has no effect."
21774 #: ../fish/guestfish-actions.pod:3482
21779 #: ../fish/guestfish-actions.pod:3484
21784 #: ../fish/guestfish-actions.pod:3486
21787 " set-path searchpath\n"
21792 #: ../fish/guestfish-actions.pod:3495
21797 #: ../fish/guestfish-actions.pod:3497
21802 #: ../fish/guestfish-actions.pod:3499
21810 #: ../fish/guestfish-actions.pod:3519
21811 msgid "set-recovery-proc"
21815 #: ../fish/guestfish-actions.pod:3521
21816 msgid "recovery-proc"
21820 #: ../fish/guestfish-actions.pod:3523
21823 " set-recovery-proc true|false\n"
21828 #: ../fish/guestfish-actions.pod:3525
21830 "If this is called with the parameter C<false> then L</launch> does not "
21831 "create a recovery process. The purpose of the recovery process is to stop "
21832 "runaway qemu processes in the case where the main program aborts abruptly."
21836 #: ../fish/guestfish-actions.pod:3530
21838 "This only has any effect if called before L</launch>, and the default is "
21843 #: ../fish/guestfish-actions.pod:3539
21844 msgid "set-selinux"
21848 #: ../fish/guestfish-actions.pod:3541
21853 #: ../fish/guestfish-actions.pod:3543
21856 " set-selinux true|false\n"
21861 #: ../fish/guestfish-actions.pod:3554
21866 #: ../fish/guestfish-actions.pod:3556
21871 #: ../fish/guestfish-actions.pod:3558
21874 " set-trace true|false\n"
21879 #: ../fish/guestfish-actions.pod:3574
21880 msgid "set-verbose"
21884 #: ../fish/guestfish-actions.pod:3576
21889 #: ../fish/guestfish-actions.pod:3578
21892 " set-verbose true|false\n"
21897 #: ../fish/guestfish-actions.pod:3585
21902 #: ../fish/guestfish-actions.pod:3587
21905 " setcon context\n"
21910 #: ../fish/guestfish-actions.pod:3594
21915 #: ../fish/guestfish-actions.pod:3596
21918 " setxattr xattr val vallen path\n"
21923 #: ../fish/guestfish-actions.pod:3602
21924 msgid "See also: L</lsetxattr>, L<attr(5)>."
21928 #: ../fish/guestfish-actions.pod:3604
21933 #: ../fish/guestfish-actions.pod:3606
21936 " sfdisk device cyls heads sectors 'lines ...'\n"
21941 #: ../fish/guestfish-actions.pod:3628
21942 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
21946 #: ../fish/guestfish-actions.pod:3634
21951 #: ../fish/guestfish-actions.pod:3636
21954 " sfdiskM device 'lines ...'\n"
21959 #: ../fish/guestfish-actions.pod:3638
21961 "This is a simplified interface to the L</sfdisk> command, where partition "
21962 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
21963 "you don't need to specify the cyls, heads and sectors parameters which were "
21964 "rarely if ever used anyway."
21968 #: ../fish/guestfish-actions.pod:3644
21969 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
21973 #: ../fish/guestfish-actions.pod:3650
21978 #: ../fish/guestfish-actions.pod:3652
21981 " sfdisk-N device partnum cyls heads sectors line\n"
21986 #: ../fish/guestfish-actions.pod:3657
21988 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
21989 "cyls/heads/sectors parameters."
21993 #: ../fish/guestfish-actions.pod:3660
21994 msgid "See also: L</part-add>"
21998 #: ../fish/guestfish-actions.pod:3665
21999 msgid "sfdisk-disk-geometry"
22003 #: ../fish/guestfish-actions.pod:3667
22006 " sfdisk-disk-geometry device\n"
22011 #: ../fish/guestfish-actions.pod:3669
22013 "This displays the disk geometry of C<device> read from the partition table. "
22014 "Especially in the case where the underlying block device has been resized, "
22015 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
22016 "kernel-geometry>)."
22020 #: ../fish/guestfish-actions.pod:3677
22021 msgid "sfdisk-kernel-geometry"
22025 #: ../fish/guestfish-actions.pod:3679
22028 " sfdisk-kernel-geometry device\n"
22033 #: ../fish/guestfish-actions.pod:3686
22038 #: ../fish/guestfish-actions.pod:3688
22041 " sfdisk-l device\n"
22046 #: ../fish/guestfish-actions.pod:3694
22047 msgid "See also: L</part-list>"
22051 #: ../fish/guestfish-actions.pod:3696
22056 #: ../fish/guestfish-actions.pod:3698
22064 #: ../fish/guestfish-actions.pod:3703
22065 msgid "This is like L</command>, but passes the command to:"
22069 #: ../fish/guestfish-actions.pod:3711
22070 msgid "All the provisos about L</command> apply to this call."
22074 #: ../fish/guestfish-actions.pod:3713
22079 #: ../fish/guestfish-actions.pod:3715
22082 " sh-lines command\n"
22087 #: ../fish/guestfish-actions.pod:3717
22088 msgid "This is the same as L</sh>, but splits the result into a list of lines."
22092 #: ../fish/guestfish-actions.pod:3720
22093 msgid "See also: L</command-lines>"
22097 #: ../fish/guestfish-actions.pod:3722
22102 #: ../fish/guestfish-actions.pod:3724
22110 #: ../fish/guestfish-actions.pod:3728
22115 #: ../fish/guestfish-actions.pod:3730
22123 #: ../fish/guestfish-actions.pod:3736
22128 #: ../fish/guestfish-actions.pod:3738
22136 #: ../fish/guestfish-actions.pod:3746
22141 #: ../fish/guestfish-actions.pod:3748
22149 #: ../fish/guestfish-actions.pod:3756
22154 #: ../fish/guestfish-actions.pod:3758
22157 " strings-e encoding path\n"
22162 #: ../fish/guestfish-actions.pod:3760
22164 "This is like the L</strings> command, but allows you to specify the encoding "
22165 "of strings that are looked for in the source file C<path>."
22169 #: ../fish/guestfish-actions.pod:3770
22171 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
22172 "ISO-8859-X (this is what L</strings> uses)."
22176 #: ../fish/guestfish-actions.pod:3802
22177 msgid "swapoff-device"
22181 #: ../fish/guestfish-actions.pod:3804
22184 " swapoff-device device\n"
22189 #: ../fish/guestfish-actions.pod:3806
22191 "This command disables the libguestfs appliance swap device or partition "
22192 "named C<device>. See L</swapon-device>."
22196 #: ../fish/guestfish-actions.pod:3810
22197 msgid "swapoff-file"
22201 #: ../fish/guestfish-actions.pod:3812
22204 " swapoff-file file\n"
22209 #: ../fish/guestfish-actions.pod:3816
22210 msgid "swapoff-label"
22214 #: ../fish/guestfish-actions.pod:3818
22217 " swapoff-label label\n"
22222 #: ../fish/guestfish-actions.pod:3823
22223 msgid "swapoff-uuid"
22227 #: ../fish/guestfish-actions.pod:3825
22230 " swapoff-uuid uuid\n"
22235 #: ../fish/guestfish-actions.pod:3830
22236 msgid "swapon-device"
22240 #: ../fish/guestfish-actions.pod:3832
22243 " swapon-device device\n"
22248 #: ../fish/guestfish-actions.pod:3834
22250 "This command enables the libguestfs appliance to use the swap device or "
22251 "partition named C<device>. The increased memory is made available for all "
22252 "commands, for example those run using L</command> or L</sh>."
22256 #: ../fish/guestfish-actions.pod:3846
22257 msgid "swapon-file"
22261 #: ../fish/guestfish-actions.pod:3848
22264 " swapon-file file\n"
22269 #: ../fish/guestfish-actions.pod:3850
22271 "This command enables swap to a file. See L</swapon-device> for other notes."
22275 #: ../fish/guestfish-actions.pod:3853
22276 msgid "swapon-label"
22280 #: ../fish/guestfish-actions.pod:3855
22283 " swapon-label label\n"
22288 #: ../fish/guestfish-actions.pod:3857
22290 "This command enables swap to a labeled swap partition. See L</swapon-"
22291 "device> for other notes."
22295 #: ../fish/guestfish-actions.pod:3860
22296 msgid "swapon-uuid"
22300 #: ../fish/guestfish-actions.pod:3862
22303 " swapon-uuid uuid\n"
22308 #: ../fish/guestfish-actions.pod:3864
22310 "This command enables swap to a swap partition with the given UUID. See L</"
22311 "swapon-device> for other notes."
22315 #: ../fish/guestfish-actions.pod:3867
22320 #: ../fish/guestfish-actions.pod:3869
22328 #: ../fish/guestfish-actions.pod:3877
22333 #: ../fish/guestfish-actions.pod:3879
22341 #: ../fish/guestfish-actions.pod:3887
22346 #: ../fish/guestfish-actions.pod:3889
22349 " tail-n nrlines path\n"
22354 #: ../fish/guestfish-actions.pod:3902
22359 #: ../fish/guestfish-actions.pod:3904
22362 " tar-in (tarfile|-) directory\n"
22367 #: ../fish/guestfish-actions.pod:3909
22368 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
22372 #: ../fish/guestfish-actions.pod:3914
22377 #: ../fish/guestfish-actions.pod:3916
22380 " tar-out directory (tarfile|-)\n"
22385 #: ../fish/guestfish-actions.pod:3921
22386 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
22390 #: ../fish/guestfish-actions.pod:3926
22395 #: ../fish/guestfish-actions.pod:3928
22398 " tgz-in (tarball|-) directory\n"
22403 #: ../fish/guestfish-actions.pod:3933
22404 msgid "To upload an uncompressed tarball, use L</tar-in>."
22408 #: ../fish/guestfish-actions.pod:3937
22413 #: ../fish/guestfish-actions.pod:3939
22416 " tgz-out directory (tarball|-)\n"
22421 #: ../fish/guestfish-actions.pod:3944
22422 msgid "To download an uncompressed tarball, use L</tar-out>."
22426 #: ../fish/guestfish-actions.pod:3948
22431 #: ../fish/guestfish-actions.pod:3950
22439 #: ../fish/guestfish-actions.pod:3959
22444 #: ../fish/guestfish-actions.pod:3961
22452 #: ../fish/guestfish-actions.pod:3966
22453 msgid "truncate-size"
22457 #: ../fish/guestfish-actions.pod:3968
22460 " truncate-size path size\n"
22465 #: ../fish/guestfish-actions.pod:3973
22467 "If the current file size is less than C<size> then the file is extended to "
22468 "the required size with zero bytes. This creates a sparse file (ie. disk "
22469 "blocks are not allocated for the file until you write to it). To create a "
22470 "non-sparse file of zeroes, use L</fallocate64> instead."
22474 #: ../fish/guestfish-actions.pod:3979
22479 #: ../fish/guestfish-actions.pod:3981
22482 " tune2fs-l device\n"
22487 #: ../fish/guestfish-actions.pod:3991
22492 #: ../fish/guestfish-actions.pod:3993
22495 " txz-in (tarball|-) directory\n"
22500 #: ../fish/guestfish-actions.pod:4000
22505 #: ../fish/guestfish-actions.pod:4002
22508 " txz-out directory (tarball|-)\n"
22513 #: ../fish/guestfish-actions.pod:4009
22518 #: ../fish/guestfish-actions.pod:4011
22526 #: ../fish/guestfish-actions.pod:4025
22527 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
22531 #: ../fish/guestfish-actions.pod:4030
22536 #: ../fish/guestfish-actions.pod:4032
22541 #: ../fish/guestfish-actions.pod:4034
22544 " umount pathordevice\n"
22549 #: ../fish/guestfish-actions.pod:4040
22554 #: ../fish/guestfish-actions.pod:4042
22555 msgid "unmount-all"
22559 #: ../fish/guestfish-actions.pod:4044
22567 #: ../fish/guestfish-actions.pod:4050
22572 #: ../fish/guestfish-actions.pod:4052
22575 " upload (filename|-) remotefilename\n"
22580 #: ../fish/guestfish-actions.pod:4059
22581 msgid "See also L</download>."
22585 #: ../fish/guestfish-actions.pod:4063
22586 msgid "upload-offset"
22590 #: ../fish/guestfish-actions.pod:4065
22593 " upload-offset (filename|-) remotefilename offset\n"
22598 #: ../fish/guestfish-actions.pod:4077
22600 "Note that there is no limit on the amount of data that can be uploaded with "
22601 "this call, unlike with L</pwrite>, and this call always writes the full "
22602 "amount unless an error occurs."
22606 #: ../fish/guestfish-actions.pod:4082
22607 msgid "See also L</upload>, L</pwrite>."
22611 #: ../fish/guestfish-actions.pod:4086
22616 #: ../fish/guestfish-actions.pod:4088
22619 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
22624 #: ../fish/guestfish-actions.pod:4107
22629 #: ../fish/guestfish-actions.pod:4109
22637 #: ../fish/guestfish-actions.pod:4136
22639 "I<Note:> Don't use this call to test for availability of features. In "
22640 "enterprise distributions we backport features from later versions into "
22641 "earlier versions, making this an unreliable way to test for features. Use "
22642 "L</available> instead."
22646 #: ../fish/guestfish-actions.pod:4142
22651 #: ../fish/guestfish-actions.pod:4144
22654 " vfs-label device\n"
22659 #: ../fish/guestfish-actions.pod:4151
22660 msgid "To find a filesystem from the label, use L</findfs-label>."
22664 #: ../fish/guestfish-actions.pod:4153
22669 #: ../fish/guestfish-actions.pod:4155
22672 " vfs-type device\n"
22677 #: ../fish/guestfish-actions.pod:4165
22682 #: ../fish/guestfish-actions.pod:4167
22685 " vfs-uuid device\n"
22690 #: ../fish/guestfish-actions.pod:4174
22691 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
22695 #: ../fish/guestfish-actions.pod:4176
22696 msgid "vg-activate"
22700 #: ../fish/guestfish-actions.pod:4178
22703 " vg-activate true|false 'volgroups ...'\n"
22708 #: ../fish/guestfish-actions.pod:4191
22709 msgid "vg-activate-all"
22713 #: ../fish/guestfish-actions.pod:4193
22716 " vg-activate-all true|false\n"
22721 #: ../fish/guestfish-actions.pod:4203
22726 #: ../fish/guestfish-actions.pod:4205
22729 " vgcreate volgroup 'physvols ...'\n"
22734 #: ../fish/guestfish-actions.pod:4210
22739 #: ../fish/guestfish-actions.pod:4212
22742 " vglvuuids vgname\n"
22747 #: ../fish/guestfish-actions.pod:4217
22749 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
22750 "logical volumes and volume groups."
22754 #: ../fish/guestfish-actions.pod:4220
22755 msgid "See also L</vgpvuuids>."
22759 #: ../fish/guestfish-actions.pod:4222
22764 #: ../fish/guestfish-actions.pod:4224
22767 " vgpvuuids vgname\n"
22772 #: ../fish/guestfish-actions.pod:4229
22774 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
22775 "physical volumes and volume groups."
22779 #: ../fish/guestfish-actions.pod:4232
22780 msgid "See also L</vglvuuids>."
22784 #: ../fish/guestfish-actions.pod:4234
22789 #: ../fish/guestfish-actions.pod:4236
22792 " vgremove vgname\n"
22797 #: ../fish/guestfish-actions.pod:4243
22802 #: ../fish/guestfish-actions.pod:4245
22805 " vgrename volgroup newvolgroup\n"
22810 #: ../fish/guestfish-actions.pod:4249
22815 #: ../fish/guestfish-actions.pod:4251
22823 #: ../fish/guestfish-actions.pod:4259
22824 msgid "See also L</vgs-full>."
22828 #: ../fish/guestfish-actions.pod:4261
22833 #: ../fish/guestfish-actions.pod:4263
22841 #: ../fish/guestfish-actions.pod:4268
22846 #: ../fish/guestfish-actions.pod:4270
22854 #: ../fish/guestfish-actions.pod:4275
22859 #: ../fish/guestfish-actions.pod:4277
22867 #: ../fish/guestfish-actions.pod:4281
22872 #: ../fish/guestfish-actions.pod:4283
22880 #: ../fish/guestfish-actions.pod:4288
22885 #: ../fish/guestfish-actions.pod:4290
22893 #: ../fish/guestfish-actions.pod:4295
22898 #: ../fish/guestfish-actions.pod:4297
22906 #: ../fish/guestfish-actions.pod:4302
22911 #: ../fish/guestfish-actions.pod:4304
22914 " write path content\n"
22919 #: ../fish/guestfish-actions.pod:4312
22924 #: ../fish/guestfish-actions.pod:4314
22927 " write-file path content size\n"
22932 #: ../fish/guestfish-actions.pod:4337
22937 #: ../fish/guestfish-actions.pod:4339
22940 " zegrep regex path\n"
22945 #: ../fish/guestfish-actions.pod:4347
22950 #: ../fish/guestfish-actions.pod:4349
22953 " zegrepi regex path\n"
22958 #: ../fish/guestfish-actions.pod:4357
22963 #: ../fish/guestfish-actions.pod:4359
22971 #: ../fish/guestfish-actions.pod:4367
22972 msgid "See also: L</zero-device>, L</scrub-device>."
22976 #: ../fish/guestfish-actions.pod:4369
22977 msgid "zero-device"
22981 #: ../fish/guestfish-actions.pod:4371
22984 " zero-device device\n"
22989 #: ../fish/guestfish-actions.pod:4373
22991 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
22992 "which just zeroes the first few blocks of a device."
22996 #: ../fish/guestfish-actions.pod:4380
23001 #: ../fish/guestfish-actions.pod:4382
23004 " zerofree device\n"
23009 #: ../fish/guestfish-actions.pod:4395
23014 #: ../fish/guestfish-actions.pod:4397
23017 " zfgrep pattern path\n"
23022 #: ../fish/guestfish-actions.pod:4405
23027 #: ../fish/guestfish-actions.pod:4407
23030 " zfgrepi pattern path\n"
23035 #: ../fish/guestfish-actions.pod:4415
23040 #: ../fish/guestfish-actions.pod:4417
23043 " zfile meth path\n"
23048 #: ../fish/guestfish-actions.pod:4424
23050 "Since 1.0.63, use L</file> instead which can now process compressed files."
23054 #: ../fish/guestfish-actions.pod:4434
23059 #: ../fish/guestfish-actions.pod:4436
23062 " zgrep regex path\n"
23067 #: ../fish/guestfish-actions.pod:4444
23072 #: ../fish/guestfish-actions.pod:4446
23075 " zgrepi regex path\n"
23080 #: ../fish/guestfish-commands.pod:1
23085 #: ../fish/guestfish-commands.pod:3
23090 #: ../fish/guestfish-commands.pod:5
23093 " alloc filename size\n"
23098 #: ../fish/guestfish-commands.pod:7
23100 "This creates an empty (zeroed) file of the given size, and then adds so it "
23101 "can be further examined."
23105 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
23106 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
23110 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
23111 msgid "Size can be specified using standard suffixes, eg. C<1M>."
23115 #: ../fish/guestfish-commands.pod:14
23117 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
23118 "image, see L</PREPARED DISK IMAGES>."
23122 #: ../fish/guestfish-commands.pod:17
23127 #: ../fish/guestfish-commands.pod:19
23130 " copy-in local [local ...] /remotedir\n"
23135 #: ../fish/guestfish-commands.pod:21
23137 "C<copy-in> copies local files or directories recursively into the disk "
23138 "image, placing them in the directory called C</remotedir> (which must "
23139 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
23140 "other commands as necessary."
23144 #: ../fish/guestfish-commands.pod:26
23146 "Multiple local files and directories can be specified, but the last "
23147 "parameter must always be a remote directory. Wildcards cannot be used."
23151 #: ../fish/guestfish-commands.pod:30
23156 #: ../fish/guestfish-commands.pod:32
23159 " copy-out remote [remote ...] localdir\n"
23164 #: ../fish/guestfish-commands.pod:34
23166 "C<copy-out> copies remote files or directories recursively out of the disk "
23167 "image, placing them on the host disk in a local directory called C<localdir> "
23168 "(which must exist). This guestfish meta-command turns into a sequence of L</"
23169 "download>, L</tar-out> and other commands as necessary."
23173 #: ../fish/guestfish-commands.pod:40
23175 "Multiple remote files and directories can be specified, but the last "
23176 "parameter must always be a local directory. To download to the current "
23177 "directory, use C<.> as in:"
23181 #: ../fish/guestfish-commands.pod:44
23184 " copy-out /home .\n"
23189 #: ../fish/guestfish-commands.pod:46
23191 "Wildcards cannot be used in the ordinary command, but you can use them with "
23192 "the help of L</glob> like this:"
23196 #: ../fish/guestfish-commands.pod:49
23199 " glob copy-out /home/* .\n"
23204 #: ../fish/guestfish-commands.pod:51
23209 #: ../fish/guestfish-commands.pod:53
23212 " echo [params ...]\n"
23217 #: ../fish/guestfish-commands.pod:55
23218 msgid "This echos the parameters to the terminal."
23222 #: ../fish/guestfish-commands.pod:57
23227 #: ../fish/guestfish-commands.pod:59
23232 #: ../fish/guestfish-commands.pod:61
23237 #: ../fish/guestfish-commands.pod:63
23245 #: ../fish/guestfish-commands.pod:65
23247 "This is used to edit a file. It downloads the file, edits it locally using "
23248 "your editor, then uploads the result."
23252 #: ../fish/guestfish-commands.pod:68
23254 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
23255 "or C<emacs> you will get those corresponding editors."
23259 #: ../fish/guestfish-commands.pod:72
23264 #: ../fish/guestfish-commands.pod:74
23267 " glob command args...\n"
23272 #: ../fish/guestfish-commands.pod:76
23274 "Expand wildcards in any paths in the args list, and run C<command> "
23275 "repeatedly on each matching path."
23279 #: ../fish/guestfish-commands.pod:79
23280 msgid "See L</WILDCARDS AND GLOBBING>."
23284 #: ../fish/guestfish-commands.pod:81
23289 #: ../fish/guestfish-commands.pod:83
23292 " hexedit <filename|device>\n"
23293 " hexedit <filename|device> <max>\n"
23294 " hexedit <filename|device> <start> <max>\n"
23299 #: ../fish/guestfish-commands.pod:87
23301 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
23306 #: ../fish/guestfish-commands.pod:90
23308 "This command works by downloading potentially the whole file or device, "
23309 "editing it locally, then uploading it. If the file or device is large, you "
23310 "have to specify which part you wish to edit by using C<max> and/or C<start> "
23311 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
23312 "usual modifiers allowed such as C<1M> (1 megabyte)."
23316 #: ../fish/guestfish-commands.pod:97
23317 msgid "For example to edit the first few sectors of a disk you might do:"
23321 #: ../fish/guestfish-commands.pod:100
23324 " hexedit /dev/sda 1M\n"
23329 #: ../fish/guestfish-commands.pod:102
23331 "which would allow you to edit anywhere within the first megabyte of the disk."
23335 #: ../fish/guestfish-commands.pod:105
23336 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
23340 #: ../fish/guestfish-commands.pod:107
23343 " hexedit /dev/sda1 0x400 0x400\n"
23348 #: ../fish/guestfish-commands.pod:109
23349 msgid "(assuming the superblock is in the standard location)."
23353 #: ../fish/guestfish-commands.pod:111
23355 "This command requires the external L<hexedit(1)> program. You can specify "
23356 "another program to use by setting the C<HEXEDITOR> environment variable."
23360 #: ../fish/guestfish-commands.pod:115
23361 msgid "See also L</hexdump>."
23365 #: ../fish/guestfish-commands.pod:117
23370 #: ../fish/guestfish-commands.pod:119
23378 #: ../fish/guestfish-commands.pod:121
23380 "Change the local directory, ie. the current directory of guestfish itself."
23384 #: ../fish/guestfish-commands.pod:124
23385 msgid "Note that C<!cd> won't do what you might expect."
23389 #: ../fish/guestfish-commands.pod:126
23394 #: ../fish/guestfish-commands.pod:128
23399 #: ../fish/guestfish-commands.pod:130
23407 #: ../fish/guestfish-commands.pod:132
23408 msgid "Opens the manual page for guestfish."
23412 #: ../fish/guestfish-commands.pod:134
23417 #: ../fish/guestfish-commands.pod:136
23422 #: ../fish/guestfish-commands.pod:138
23430 #: ../fish/guestfish-commands.pod:140
23438 #: ../fish/guestfish-commands.pod:142
23439 msgid "This is used to view a file."
23443 #: ../fish/guestfish-commands.pod:144
23445 "The default viewer is C<$PAGER>. However if you use the alternate command "
23446 "C<less> you will get the C<less> command specifically."
23450 #: ../fish/guestfish-commands.pod:147
23455 #: ../fish/guestfish-commands.pod:149
23463 #: ../fish/guestfish-commands.pod:151
23465 "Close and reopen the libguestfs handle. It is not necessary to use this "
23466 "normally, because the handle is closed properly when guestfish exits. "
23467 "However this is occasionally useful for testing."
23471 #: ../fish/guestfish-commands.pod:155
23476 #: ../fish/guestfish-commands.pod:157
23479 " sparse filename size\n"
23484 #: ../fish/guestfish-commands.pod:159
23486 "This creates an empty sparse file of the given size, and then adds so it can "
23487 "be further examined."
23491 #: ../fish/guestfish-commands.pod:162
23493 "In all respects it works the same as the L</alloc> command, except that the "
23494 "image file is allocated sparsely, which means that disk blocks are not "
23495 "assigned to the file until they are needed. Sparse disk files only use "
23496 "space when written to, but they are slower and there is a danger you could "
23497 "run out of real disk space during a write operation."
23501 #: ../fish/guestfish-commands.pod:172
23506 #: ../fish/guestfish-commands.pod:174
23514 #: ../fish/guestfish-commands.pod:176
23516 "This command returns a list of the optional groups known to the daemon, and "
23517 "indicates which ones are supported by this build of the libguestfs appliance."
23521 #: ../fish/guestfish-commands.pod:180
23522 msgid "See also L<guestfs(3)/AVAILABILITY>."
23526 #: ../fish/guestfish-commands.pod:182
23531 #: ../fish/guestfish-commands.pod:184
23534 " time command args...\n"
23539 #: ../fish/guestfish-commands.pod:186
23541 "Run the command as usual, but print the elapsed time afterwards. This can "
23542 "be useful for benchmarking operations."
23546 #: ../test-tool/libguestfs-test-tool.pod:5
23547 msgid "libguestfs-test-tool - End user tests for libguestfs"
23551 #: ../test-tool/libguestfs-test-tool.pod:9
23554 " libguestfs-test-tool [--options]\n"
23559 #: ../test-tool/libguestfs-test-tool.pod:13
23561 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
23562 "and developers, to allow them to check basic libguestfs functionality is "
23563 "working. This is needed because libguestfs occasionally breaks for reasons "
23564 "beyond our control: usually because of changes in the underlying qemu or "
23565 "kernel packages, or the host environment."
23569 #: ../test-tool/libguestfs-test-tool.pod:20
23570 msgid "If you suspect a problem in libguestfs, then just run:"
23574 #: ../test-tool/libguestfs-test-tool.pod:22
23577 " libguestfs-test-tool\n"
23582 #: ../test-tool/libguestfs-test-tool.pod:24
23583 msgid "It will print lots of diagnostic messages."
23587 #: ../test-tool/libguestfs-test-tool.pod:26
23588 msgid "If it runs to completion successfully, you will see this near the end:"
23592 #: ../test-tool/libguestfs-test-tool.pod:28
23595 " ===== TEST FINISHED OK =====\n"
23600 #: ../test-tool/libguestfs-test-tool.pod:30
23601 msgid "and the test tool will exit with code 0."
23605 #: ../test-tool/libguestfs-test-tool.pod:32
23607 "If it fails (and/or exits with non-zero error code), please paste the "
23608 "B<complete, unedited> output of the test tool into a bug report. More "
23609 "information about reporting bugs can be found on the L<http://libguestfs.org/"
23614 #: ../test-tool/libguestfs-test-tool.pod:41
23619 #: ../test-tool/libguestfs-test-tool.pod:43
23620 msgid "Display short usage information and exit."
23624 #: ../test-tool/libguestfs-test-tool.pod:45
23625 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
23629 #: ../test-tool/libguestfs-test-tool.pod:47
23631 "Pass an alternate name for the helper program. libguestfs-test-tool will "
23632 "normally look in the C<$libexec> directory that was configured when the tool "
23637 #: ../test-tool/libguestfs-test-tool.pod:51
23638 msgid "I<--qemu qemu_binary>"
23642 #: ../test-tool/libguestfs-test-tool.pod:53
23644 "If you have downloaded another qemu binary, point this option at the full "
23645 "path of the binary to try it."
23649 #: ../test-tool/libguestfs-test-tool.pod:56
23650 msgid "I<--qemudir qemu_source_dir>"
23654 #: ../test-tool/libguestfs-test-tool.pod:58
23656 "If you have compiled qemu from source, point this option at the source "
23657 "directory to try it."
23661 #: ../test-tool/libguestfs-test-tool.pod:61
23662 msgid "I<--timeout N>"
23666 #: ../test-tool/libguestfs-test-tool.pod:63
23668 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
23669 "does not usually need to be adjusted unless your machine is very slow."
23673 #: ../test-tool/libguestfs-test-tool.pod:69
23674 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
23678 #: ../test-tool/libguestfs-test-tool.pod:71
23680 "If you have compiled another version of qemu from source and would like to "
23681 "try that, then you can use the I<--qemudir> option to point to the qemu "
23682 "source directory."
23686 #: ../test-tool/libguestfs-test-tool.pod:75
23688 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
23689 "option to point to the binary."
23693 #: ../test-tool/libguestfs-test-tool.pod:78
23695 "When using an alternate qemu with libguestfs, usually you would need to "
23696 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
23697 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
23698 "use either of the I<--qemudir> or I<--qemu> options."
23702 #: ../test-tool/libguestfs-test-tool.pod:85
23704 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
23705 "I<1> if there was an error."
23709 #: ../test-tool/libguestfs-test-tool.pod:92
23710 msgid "/usr/libexec/libguestfs-test-tool-helper"
23714 #: ../test-tool/libguestfs-test-tool.pod:94
23716 "This helper program is run inside the appliance and provides additional "
23721 #: ../test-tool/libguestfs-test-tool.pod:97
23722 msgid "/usr/bin/mkisofs"
23726 #: ../test-tool/libguestfs-test-tool.pod:99
23728 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
23729 "which is used as part of the tests."
23733 #: ../test-tool/libguestfs-test-tool.pod:106
23735 "For the full list of environment variables which may affect libguestfs, "
23736 "please see the L<guestfs(3)> manual page."
23740 #: ../test-tool/libguestfs-test-tool.pod:111
23741 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
23745 #: ../test-tool/libguestfs-test-tool.pod:121
23746 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
23750 #: ../fuse/guestmount.pod:5
23752 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
23756 #: ../fuse/guestmount.pod:9
23759 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
23764 #: ../fuse/guestmount.pod:11
23767 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
23772 #: ../fuse/guestmount.pod:13
23775 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
23780 #: ../fuse/guestmount.pod:17
23782 "You must I<not> use C<guestmount> in read-write mode on live virtual "
23783 "machines. If you do this, you risk disk corruption in the VM."
23787 #: ../fuse/guestmount.pod:22
23789 "The guestmount program can be used to mount virtual machine filesystems and "
23790 "other disk images on the host. It uses libguestfs for access to the guest "
23791 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
23792 "a mountable device."
23796 #: ../fuse/guestmount.pod:27
23798 "Along with other options, you have to give at least one device (I<-a> "
23799 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
23800 "option) or use the I<-i> inspection option. How this works is better "
23801 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
23806 #: ../fuse/guestmount.pod:33
23808 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
23809 "by you, and the filesystem will not be visible to any other users unless you "
23810 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
23811 "the filesystem, use the C<fusermount -u> command."
23815 #: ../fuse/guestmount.pod:41
23817 "For a typical Windows guest which has its main filesystem on the first "
23822 #: ../fuse/guestmount.pod:44
23825 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
23830 #: ../fuse/guestmount.pod:46
23832 "For a typical Linux guest which has a /boot filesystem on the first "
23833 "partition, and the root filesystem on a logical volume:"
23837 #: ../fuse/guestmount.pod:49
23840 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
23845 #: ../fuse/guestmount.pod:51
23846 msgid "To get libguestfs to detect guest mountpoints for you:"
23850 #: ../fuse/guestmount.pod:53
23853 " guestmount -a guest.img -i --ro /mnt\n"
23858 #: ../fuse/guestmount.pod:55
23859 msgid "For a libvirt guest called \"Guest\" you could do:"
23863 #: ../fuse/guestmount.pod:57
23866 " guestmount -d Guest -i --ro /mnt\n"
23871 #: ../fuse/guestmount.pod:59
23873 "If you don't know what filesystems are contained in a guest or disk image, "
23874 "use L<virt-list-filesystems(1)> first:"
23878 #: ../fuse/guestmount.pod:62
23881 " virt-list-filesystems MyGuest\n"
23886 #: ../fuse/guestmount.pod:64
23888 "If you want to trace the libguestfs calls but without excessive debugging "
23889 "information, we recommend:"
23893 #: ../fuse/guestmount.pod:67
23896 " guestmount [...] --trace /mnt\n"
23901 #: ../fuse/guestmount.pod:69
23902 msgid "If you want to debug the program, we recommend:"
23906 #: ../fuse/guestmount.pod:71
23909 " guestmount [...] --trace --verbose /mnt\n"
23914 #: ../fuse/guestmount.pod:79
23915 msgid "Add a block device or virtual machine image."
23919 #: ../fuse/guestmount.pod:96
23920 msgid "B<--dir-cache-timeout N>"
23924 #: ../fuse/guestmount.pod:98
23926 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
23927 "seconds. The readdir cache [actually, there are several semi-independent "
23928 "caches] is populated after a readdir(2) call with the stat and extended "
23929 "attributes of the files in the directory, in anticipation that they will be "
23930 "requested soon after."
23934 #: ../fuse/guestmount.pod:104
23936 "There is also a different attribute cache implemented by FUSE (see the FUSE "
23937 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
23938 "requests, only cache existing ones."
23942 #: ../fuse/guestmount.pod:115
23944 "If you have untrusted raw-format guest disk images, you should use this "
23945 "option to specify the disk format. This avoids a possible security problem "
23946 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
23947 "guestfs_add_drive_opts>."
23951 #: ../fuse/guestmount.pod:120
23952 msgid "B<--fuse-help>"
23956 #: ../fuse/guestmount.pod:122
23957 msgid "Display help on special FUSE options (see I<-o> below)."
23961 #: ../fuse/guestmount.pod:126
23962 msgid "Display brief help and exit."
23966 #: ../fuse/guestmount.pod:134
23967 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
23971 #: ../fuse/guestmount.pod:136
23973 "Mount the named partition or logical volume on the given mountpoint B<in the "
23974 "guest> (this has nothing to do with mountpoints in the host)."
23978 #: ../fuse/guestmount.pod:139
23980 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
23981 "something on C</>."
23985 #: ../fuse/guestmount.pod:144
23987 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
23988 "unmounted. If you specify this option, then we don't attempt to sync the "
23989 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
23993 #: ../fuse/guestmount.pod:149
23994 msgid "B<-o option> | B<--option option>"
23998 #: ../fuse/guestmount.pod:151
23999 msgid "Pass extra options to FUSE."
24003 #: ../fuse/guestmount.pod:153
24005 "To get a list of all the extra options supported by FUSE, use the command "
24006 "below. Note that only the FUSE I<-o> options can be passed, and only some "
24007 "of them are a good idea."
24011 #: ../fuse/guestmount.pod:157
24014 " guestmount --fuse-help\n"
24019 #: ../fuse/guestmount.pod:159
24020 msgid "Some potentially useful FUSE options:"
24024 #: ../fuse/guestmount.pod:163
24025 msgid "B<-o allow_other>"
24029 #: ../fuse/guestmount.pod:165
24030 msgid "Allow other users to see the filesystem."
24034 #: ../fuse/guestmount.pod:167
24035 msgid "B<-o attr_timeout=N>"
24039 #: ../fuse/guestmount.pod:169
24040 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
24044 #: ../fuse/guestmount.pod:171
24045 msgid "B<-o kernel_cache>"
24049 #: ../fuse/guestmount.pod:173
24051 "Allow the kernel to cache files (reduces the number of reads that have to go "
24052 "through the L<guestfs(3)> API). This is generally a good idea if you can "
24053 "afford the extra memory usage."
24057 #: ../fuse/guestmount.pod:177
24058 msgid "B<-o uid=N> B<-o gid=N>"
24062 #: ../fuse/guestmount.pod:179
24064 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
24065 "the chosen values."
24069 #: ../fuse/guestmount.pod:186
24071 "Add devices and mount everything read-only. Also disallow writes and make "
24072 "the disk appear read-only to FUSE."
24076 #: ../fuse/guestmount.pod:189
24078 "This is highly recommended if you are not going to edit the guest disk. If "
24079 "the guest is running and this option is I<not> supplied, then there is a "
24080 "strong risk of disk corruption in the guest. We try to prevent this from "
24081 "happening, but it is not always possible."
24085 #: ../fuse/guestmount.pod:196
24086 msgid "Enable SELinux support for the guest."
24090 #: ../fuse/guestmount.pod:200
24091 msgid "Enable verbose messages from underlying libguestfs."
24095 #: ../fuse/guestmount.pod:204
24096 msgid "Display the program version and exit."
24100 #: ../fuse/guestmount.pod:206
24101 msgid "B<-x> | B<--trace>"
24105 #: ../fuse/guestmount.pod:208
24106 msgid "Trace libguestfs calls."
24110 #: ../fuse/guestmount.pod:210
24111 msgid "This also stops the daemon from forking into the background."
24115 #: ../fuse/guestmount.pod:216
24117 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
24118 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
24123 #: ../inspector/virt-inspector.pl:35
24125 "virt-inspector - Display operating system version and other information "
24126 "about a virtual machine"
24130 #: ../inspector/virt-inspector.pl:39
24133 " virt-inspector [--connect URI] domname\n"
24138 #: ../inspector/virt-inspector.pl:41
24141 " virt-inspector guest.img [guest.img ...]\n"
24146 #: ../inspector/virt-inspector.pl:45
24148 "B<virt-inspector> examines a virtual machine or disk image and tries to "
24149 "determine the version of the operating system and other information about "
24150 "the virtual machine."
24154 #: ../inspector/virt-inspector.pl:49
24155 msgid "Virt-inspector produces XML output for feeding into other programs."
24159 #: ../inspector/virt-inspector.pl:51
24161 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
24162 "libvirt domain (see: C<virsh list --all>)."
24166 #: ../inspector/virt-inspector.pl:54
24168 "You can also run virt-inspector directly on disk images from a single "
24169 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
24170 "has several block devices, in which case you should list them one after "
24171 "another, with the first corresponding to the guest's C</dev/sda>, the second "
24172 "to the guest's C</dev/sdb> and so on."
24176 #: ../inspector/virt-inspector.pl:60
24178 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
24179 "inspect several virtual machines, you have to run virt-inspector several "
24180 "times (for example, from a shell script for-loop)."
24184 #: ../inspector/virt-inspector.pl:65
24186 "Because virt-inspector needs direct access to guest images, it won't "
24187 "normally work over remote libvirt connections."
24191 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82
24192 #: ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88
24193 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-cat.pl:89
24194 #: ../tools/virt-tar.pl:108 ../tools/virt-rescue.pl:113
24195 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:61
24196 msgid "Display brief help."
24200 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88
24201 #: ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94
24202 #: ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66
24203 #: ../tools/virt-cat.pl:95 ../tools/virt-tar.pl:114
24204 #: ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169
24205 #: ../tools/virt-list-partitions.pl:67
24206 msgid "B<--version>"
24210 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90
24211 #: ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96
24212 #: ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68
24213 #: ../tools/virt-cat.pl:97 ../tools/virt-tar.pl:116
24214 #: ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171
24215 #: ../tools/virt-list-partitions.pl:69
24216 msgid "Display version number and exit."
24220 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112
24221 #: ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102
24222 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-cat.pl:103
24223 #: ../tools/virt-tar.pl:122 ../tools/virt-rescue.pl:135
24224 #: ../tools/virt-list-partitions.pl:75
24225 msgid "B<--connect URI> | B<-c URI>"
24229 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114
24230 #: ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104
24231 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-cat.pl:105
24232 #: ../tools/virt-tar.pl:124 ../tools/virt-rescue.pl:137
24233 #: ../tools/virt-list-partitions.pl:77
24235 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
24236 "to the default libvirt hypervisor."
24240 #: ../inspector/virt-inspector.pl:97
24242 "Libvirt is only used if you specify a C<domname> on the command line. If "
24243 "you specify guest block devices directly, then libvirt is not used at all."
24247 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124
24248 #: ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117
24249 #: ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523
24250 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-cat.pl:115
24251 #: ../tools/virt-tar.pl:134 ../tools/virt-rescue.pl:147
24252 #: ../tools/virt-list-partitions.pl:87
24253 msgid "B<--format> raw"
24257 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126
24258 #: ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119
24259 #: ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88
24260 #: ../tools/virt-cat.pl:117 ../tools/virt-tar.pl:136
24261 #: ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
24263 "Specify the format of disk images given on the command line. If this is "
24264 "omitted then the format is autodetected from the content of the disk image."
24268 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130
24269 #: ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123
24270 #: ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92
24271 #: ../tools/virt-cat.pl:121 ../tools/virt-tar.pl:140
24272 #: ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
24274 "If disk images are requested from libvirt, then this program asks libvirt "
24275 "for this information. In this case, the value of the format parameter is "
24280 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134
24281 #: ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127
24282 #: ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528
24283 #: ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96
24284 #: ../tools/virt-cat.pl:125 ../tools/virt-tar.pl:144
24285 #: ../tools/virt-rescue.pl:157 ../tools/virt-list-partitions.pl:97
24287 "If working with untrusted raw-format guest disk images, you should ensure "
24288 "the format is always specified."
24292 #: ../inspector/virt-inspector.pl:350 ../tools/virt-edit.pl:343
24293 #: ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477
24294 #: ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225
24295 #: ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179
24296 #: ../tools/virt-cat.pl:178 ../tools/virt-tar.pl:274
24297 #: ../tools/virt-rescue.pl:260 ../tools/virt-make-fs.pl:527
24298 #: ../tools/virt-list-partitions.pl:247
24299 msgid "SHELL QUOTING"
24303 #: ../inspector/virt-inspector.pl:352 ../tools/virt-edit.pl:345
24304 #: ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635
24305 #: ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481
24306 #: ../tools/virt-list-filesystems.pl:181 ../tools/virt-cat.pl:180
24307 #: ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:262
24308 #: ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
24310 "Libvirt guest names can contain arbitrary characters, some of which have "
24311 "meaning to the shell such as C<#> and space. You may need to quote or "
24312 "escape these characters on the command line. See the shell manual page L<sh"
24313 "(1)> for details."
24317 #: ../inspector/virt-inspector.pl:359 ../tools/virt-df.pl:642
24319 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
24320 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24324 #: ../inspector/virt-inspector.pl:372 ../tools/virt-edit.pl:364
24325 #: ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651
24326 #: ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510
24327 #: ../tools/virt-list-filesystems.pl:200 ../tools/virt-cat.pl:197
24328 #: ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:279
24329 #: ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
24330 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
24334 #: ../inspector/virt-inspector.pl:376
24335 msgid "Matthew Booth L<mbooth@redhat.com>"
24339 #: ../inspector/virt-inspector.pl:382 ../tools/virt-win-reg.pl:516
24340 #: ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
24341 msgid "Copyright (C) 2010 Red Hat Inc."
24345 #: ../tools/virt-edit.pl:34
24346 msgid "virt-edit - Edit a file in a virtual machine"
24350 #: ../tools/virt-edit.pl:38
24353 " virt-edit [--options] domname file\n"
24358 #: ../tools/virt-edit.pl:40
24361 " virt-edit [--options] disk.img [disk.img ...] file\n"
24366 #: ../tools/virt-edit.pl:42
24369 " virt-edit [domname|disk.img] file -e 'expr'\n"
24374 #: ../tools/virt-edit.pl:46
24376 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
24377 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
24378 "doing this, but doesn't catch all cases."
24382 #: ../tools/virt-edit.pl:52
24384 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
24385 "the named virtual machine (or disk image)."
24389 #: ../tools/virt-edit.pl:55
24391 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
24392 "you should look at the L<guestfish(1)> tool."
24396 #: ../tools/virt-edit.pl:60
24397 msgid "Edit the named files interactively:"
24401 #: ../tools/virt-edit.pl:62
24404 " virt-edit mydomain /boot/grub/grub.conf\n"
24409 #: ../tools/virt-edit.pl:64
24412 " virt-edit mydomain /etc/passwd\n"
24417 #: ../tools/virt-edit.pl:66
24419 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
24420 "below). To change the init default level to 5:"
24424 #: ../tools/virt-edit.pl:70
24427 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
24432 #: ../tools/virt-edit.pl:96
24433 msgid "B<--backup extension> | B<-b extension>"
24437 #: ../tools/virt-edit.pl:98
24439 "Create a backup of the original file I<in the guest disk image>. The backup "
24440 "has the original filename with C<extension> added."
24444 #: ../tools/virt-edit.pl:101
24446 "Usually the first character of C<extension> would be a dot C<.> so you would "
24451 #: ../tools/virt-edit.pl:104
24454 " virt-edit -b .orig [etc]\n"
24459 #: ../tools/virt-edit.pl:106
24460 msgid "By default, no backup file is made."
24464 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
24465 #: ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107
24466 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-cat.pl:108
24467 #: ../tools/virt-tar.pl:127 ../tools/virt-rescue.pl:140
24468 #: ../tools/virt-list-partitions.pl:80
24470 "If you specify guest block devices directly, then libvirt is not used at all."
24474 #: ../tools/virt-edit.pl:141
24475 msgid "B<--expr EXPR> | B<-e EXPR>"
24479 #: ../tools/virt-edit.pl:143
24481 "Instead of launching the external editor, non-interactively apply the Perl "
24482 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
24487 #: ../tools/virt-edit.pl:147
24489 "Be careful to properly quote the expression to prevent it from being altered "
24494 #: ../tools/virt-edit.pl:268
24495 msgid "NON-INTERACTIVE EDITING"
24499 #: ../tools/virt-edit.pl:270
24501 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
24502 "administrator can interactively edit the file."
24506 #: ../tools/virt-edit.pl:273
24508 "There are two ways also to use C<virt-edit> from scripts in order to make "
24509 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
24510 "like this, it's less error-prone to write scripts directly using the "
24511 "libguestfs API and Augeas for configuration file editing.)"
24515 #: ../tools/virt-edit.pl:279
24517 "The first method is to temporarily set C<$EDITOR> to any script or program "
24518 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
24519 "update C<tmpfile> in place however it likes."
24523 #: ../tools/virt-edit.pl:283
24525 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
24526 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
24527 "instances of C<foo> with C<bar> in a file:"
24531 #: ../tools/virt-edit.pl:287
24534 " virt-edit domname filename -e 's/foo/bar/'\n"
24539 #: ../tools/virt-edit.pl:289
24541 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
24542 "For example to delete root's password you could do:"
24546 #: ../tools/virt-edit.pl:292
24549 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
24554 #: ../tools/virt-edit.pl:294
24556 "What really happens is that the snippet is evaluated as a Perl expression "
24557 "for each line of the file. The line, including the final C<\\n>, is passed "
24558 "in C<$_> and the expression should update C<$_> or leave it unchanged."
24562 #: ../tools/virt-edit.pl:299
24564 "To delete a line, set C<$_> to the empty string. For example, to delete the "
24565 "C<apache> user account from the password file you can do:"
24569 #: ../tools/virt-edit.pl:302
24572 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
24577 #: ../tools/virt-edit.pl:304
24579 "To insert a line, prepend or append it to C<$_>. However appending lines to "
24580 "the end of the file is rather difficult this way since there is no concept "
24581 "of \"last line of the file\" - your expression just doesn't get called "
24582 "again. You might want to use the first method (setting C<$EDITOR>) if you "
24587 #: ../tools/virt-edit.pl:310
24589 "The variable C<$lineno> contains the current line number. As is "
24590 "traditional, the first line in the file is number C<1>."
24594 #: ../tools/virt-edit.pl:313
24596 "The return value from the expression is ignored, but the expression may call "
24597 "C<die> in order to abort the whole program, leaving the original file "
24602 #: ../tools/virt-edit.pl:317
24604 "Remember when matching the end of a line that C<$_> may contain the final C<"
24605 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
24606 "newline then neither of these. Thus to match or substitute some text at the "
24607 "end of a line, use this regular expression:"
24611 #: ../tools/virt-edit.pl:322
24614 " /some text(\\r?\\n)?$/\n"
24619 #: ../tools/virt-edit.pl:324
24621 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
24622 "$_> itself (since that would remove all newlines from the file):"
24626 #: ../tools/virt-edit.pl:328
24629 " my $m = $_; chomp $m; $m =~ /some text$/\n"
24634 #: ../tools/virt-edit.pl:334
24639 #: ../tools/virt-edit.pl:336
24641 "If set, this string is used as the editor. It may contain arguments, eg. C<"
24646 #: ../tools/virt-edit.pl:339
24647 msgid "If not set, C<vi> is used."
24651 #: ../tools/virt-edit.pl:352
24653 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
24654 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
24659 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
24660 #: ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243
24661 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198
24662 #: ../tools/virt-cat.pl:195 ../tools/virt-tar.pl:292
24663 #: ../tools/virt-rescue.pl:277 ../tools/virt-make-fs.pl:559
24664 #: ../tools/virt-list-partitions.pl:265
24669 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655
24670 #: ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
24671 msgid "Copyright (C) 2009-2010 Red Hat Inc."
24675 #: ../tools/virt-win-reg.pl:37
24677 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
24681 #: ../tools/virt-win-reg.pl:41
24684 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
24689 #: ../tools/virt-win-reg.pl:43
24692 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
24697 #: ../tools/virt-win-reg.pl:45
24700 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
24705 #: ../tools/virt-win-reg.pl:47
24708 " virt-win-reg --merge domname [input.reg ...]\n"
24713 #: ../tools/virt-win-reg.pl:49
24716 " virt-win-reg [--options] disk.img ... # instead of domname\n"
24721 #: ../tools/virt-win-reg.pl:53
24723 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
24724 "virtual machines. If you do this, you I<will> get irreversible disk "
24725 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
24726 "but doesn't catch all cases."
24730 #: ../tools/virt-win-reg.pl:58
24732 "Modifying the Windows Registry is an inherently risky operation. The format "
24733 "is deliberately obscure and undocumented, and Registry changes can leave the "
24734 "system unbootable. Therefore when using the C<--merge> option, make sure "
24735 "you have a reliable backup first."
24739 #: ../tools/virt-win-reg.pl:65
24741 "This program can export and merge Windows Registry entries from a Windows "
24746 #: ../tools/virt-win-reg.pl:68
24748 "The first parameter is the libvirt guest name or the raw disk image of a "
24753 #: ../tools/virt-win-reg.pl:71
24755 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
24756 "exported (recursively). For example:"
24760 #: ../tools/virt-win-reg.pl:74
24763 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
24768 #: ../tools/virt-win-reg.pl:76
24770 "You can also display single values from within registry keys, for example:"
24774 #: ../tools/virt-win-reg.pl:79
24777 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
24778 " $ virt-win-reg Windows7 $cvkey ProductName\n"
24779 " Windows 7 Enterprise\n"
24784 #: ../tools/virt-win-reg.pl:83
24786 "With C<--merge>, you can merge a textual regedit file into the Windows "
24791 #: ../tools/virt-win-reg.pl:86
24794 " $ virt-win-reg --merge Windows7 changes.reg\n"
24799 #: ../tools/virt-win-reg.pl:88
24800 msgid "SUPPORTED SYSTEMS"
24804 #: ../tools/virt-win-reg.pl:90
24806 "The program currently supports Windows NT-derived guests starting with "
24807 "Windows XP through to at least Windows 7."
24811 #: ../tools/virt-win-reg.pl:93
24813 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
24814 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
24815 "and C<HKEY_USERS\\.DEFAULT>."
24819 #: ../tools/virt-win-reg.pl:97
24821 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
24826 #: ../tools/virt-win-reg.pl:100
24828 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
24833 #: ../tools/virt-win-reg.pl:103
24838 #: ../tools/virt-win-reg.pl:105
24840 "This program is only meant for simple access to the registry. If you want "
24841 "to do complicated things with the registry, we suggest you download the "
24842 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
24843 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
24844 "L<hivexregedit(1)>."
24848 #: ../tools/virt-win-reg.pl:111
24853 #: ../tools/virt-win-reg.pl:113
24855 "C<virt-win-reg> expects that regedit files have already been reencoded in "
24856 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
24857 "style line endings. Since Windows regedit files are often in UTF-16LE with "
24858 "Windows-style line endings, you may need to reencode the whole file before "
24859 "or after processing."
24863 #: ../tools/virt-win-reg.pl:119
24865 "To reencode a file from Windows format to Linux (before processing it with "
24866 "the C<--merge> option), you would do something like this:"
24870 #: ../tools/virt-win-reg.pl:122
24873 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
24878 #: ../tools/virt-win-reg.pl:124
24880 "To go in the opposite direction, after exporting and before sending the file "
24881 "to a Windows user, do something like this:"
24885 #: ../tools/virt-win-reg.pl:127
24888 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
24893 #: ../tools/virt-win-reg.pl:129
24894 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
24898 #: ../tools/virt-win-reg.pl:131
24900 "If you are unsure about the current encoding, use the L<file(1)> command. "
24901 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
24902 "style (CRLF) line endings, like this:"
24906 #: ../tools/virt-win-reg.pl:135
24909 " $ file software.reg\n"
24910 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
24911 " with CRLF line terminators\n"
24916 #: ../tools/virt-win-reg.pl:139
24917 msgid "This file would need conversion before you could C<--merge> it."
24921 #: ../tools/virt-win-reg.pl:143
24923 "Be careful when passing parameters containing C<\\> (backslash) in the "
24924 "shell. Usually you will have to use 'single quotes' or double backslashes "
24925 "(but not both) to protect them from the shell."
24929 #: ../tools/virt-win-reg.pl:147
24930 msgid "Paths and value names are case-insensitive."
24934 #: ../tools/virt-win-reg.pl:149
24935 msgid "CurrentControlSet etc."
24939 #: ../tools/virt-win-reg.pl:151
24941 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
24942 "Registry at the level of the hive file, and therefore you cannot modify "
24947 #: ../tools/virt-win-reg.pl:155
24949 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
24950 "circumstances it might refer to another control set. The way to find out is "
24951 "to look at the C<HKLM\\SYSTEM\\Select> key:"
24955 #: ../tools/virt-win-reg.pl:159
24958 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
24959 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
24960 " \"Current\"=dword:00000001\n"
24961 " \"Default\"=dword:00000001\n"
24962 " \"Failed\"=dword:00000000\n"
24963 " \"LastKnownGood\"=dword:00000002\n"
24968 #: ../tools/virt-win-reg.pl:166
24969 msgid "\"Default\" is the one which Windows will choose when it boots."
24973 #: ../tools/virt-win-reg.pl:168
24975 "Similarly, other C<Current...> keys in the path may need to be replaced."
24979 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
24984 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
24985 msgid "Enable debugging messages."
24989 #: ../tools/virt-win-reg.pl:232
24994 #: ../tools/virt-win-reg.pl:234
24996 "In merge mode, this merges a textual regedit file into the Windows Registry "
24997 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
24998 "displays or exports Registry entries instead."
25002 #: ../tools/virt-win-reg.pl:238
25004 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
25005 "result in disk corruption. However exporting (without this flag) is always "
25010 #: ../tools/virt-win-reg.pl:246
25011 msgid "B<--encoding> UTF-16LE|ASCII"
25015 #: ../tools/virt-win-reg.pl:248
25017 "When merging (only), you may need to specify the encoding for strings to be "
25018 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
25019 "(3)/ENCODING STRINGS>."
25023 #: ../tools/virt-win-reg.pl:252
25025 "The default is to use UTF-16LE, which should work with recent versions of "
25030 #: ../tools/virt-win-reg.pl:486
25032 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
25033 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
25034 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25038 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
25040 "When reporting bugs, please enable debugging and capture the I<complete> "
25045 #: ../tools/virt-win-reg.pl:504
25048 " export LIBGUESTFS_DEBUG=1\n"
25049 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
25054 #: ../tools/virt-win-reg.pl:507
25056 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
25061 #: ../tools/virt-df.pl:36
25062 msgid "virt-df - Display free space on virtual filesystems"
25066 #: ../tools/virt-df.pl:40
25069 " virt-df [--options]\n"
25074 #: ../tools/virt-df.pl:42
25077 " virt-df [--options] domname\n"
25082 #: ../tools/virt-df.pl:44
25085 " virt-df [--options] disk.img [disk.img ...]\n"
25090 #: ../tools/virt-df.pl:48
25092 "C<virt-df> is a command line tool to display free space on virtual machine "
25093 "filesystems. Unlike other tools, it doesn't just display the amount of "
25094 "space allocated to a virtual machine, but can look inside the virtual "
25095 "machine to see how much space is really being used."
25099 #: ../tools/virt-df.pl:53
25101 "It is like the L<df(1)> command, but for virtual machines, except that it "
25102 "also works for Windows virtual machines."
25106 #: ../tools/virt-df.pl:56
25108 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
25109 "of all active and inactive guests, and performs a C<df>-type operation on "
25110 "each one in turn, printing out the results."
25114 #: ../tools/virt-df.pl:60
25116 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
25117 "either the single named libvirt domain, or on the disk image(s) listed on "
25118 "the command line (which must all belong to a single VM). In this mode (with "
25119 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
25120 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
25124 #: ../tools/virt-df.pl:67
25126 "Use the C<--csv> option to get a format which can be easily parsed by other "
25127 "programs. Other options are mostly similar to standard C<df> options. See "
25128 "below for the complete list."
25132 #: ../tools/virt-df.pl:107
25137 #: ../tools/virt-df.pl:109
25139 "Write out the results in CSV format (comma-separated values). This format "
25140 "can be imported easily into databases and spreadsheets, but read L</NOTE "
25141 "ABOUT CSV FORMAT> below."
25145 #: ../tools/virt-df.pl:134
25146 msgid "B<--human-readable> | B<-h>"
25150 #: ../tools/virt-df.pl:136
25151 msgid "Print sizes in human-readable format."
25155 #: ../tools/virt-df.pl:138
25156 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
25160 #: ../tools/virt-df.pl:144
25161 msgid "B<--inodes> | B<-i>"
25165 #: ../tools/virt-df.pl:146
25166 msgid "Print inodes instead of blocks."
25170 #: ../tools/virt-df.pl:152
25171 msgid "B<--one-per-guest>"
25175 #: ../tools/virt-df.pl:154
25177 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
25178 "disks from several guests to a single libguestfs appliance."
25182 #: ../tools/virt-df.pl:157
25183 msgid "You might use this option in the following circumstances:"
25187 #: ../tools/virt-df.pl:163
25189 "If you think an untrusted guest might actively try to exploit the libguestfs "
25190 "appliance kernel, then this prevents one guest from interfering with the "
25191 "stats printed for another guest."
25195 #: ../tools/virt-df.pl:169
25197 "If the kernel has a bug which stops it from accessing a filesystem in one "
25198 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
25199 "and report stats for further guests."
25203 #: ../tools/virt-df.pl:180
25208 #: ../tools/virt-df.pl:182
25210 "Print UUIDs instead of names. This is useful for following a guest even "
25211 "when the guest is migrated or renamed, or when two guests happen to have the "
25216 #: ../tools/virt-df.pl:186
25218 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
25219 "images, we still print the disk image name even when this option is "
25224 #: ../tools/virt-df.pl:609
25225 msgid "NOTE ABOUT CSV FORMAT"
25229 #: ../tools/virt-df.pl:611
25231 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
25232 "should be easy to parse, but it is definitely not easy to parse."
25236 #: ../tools/virt-df.pl:614
25238 "Myth: Just split fields at commas. Reality: This does I<not> work "
25239 "reliably. This example has two columns:"
25243 #: ../tools/virt-df.pl:617
25246 " \"foo,bar\",baz\n"
25251 #: ../tools/virt-df.pl:619
25253 "Myth: Read the file one line at a time. Reality: This does I<not> work "
25254 "reliably. This example has one row:"
25258 #: ../tools/virt-df.pl:622
25267 #: ../tools/virt-df.pl:625
25269 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
25270 "packaged in major Linux distributions)."
25274 #: ../tools/virt-df.pl:628
25276 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
25277 "or Python's built-in csv library)."
25281 #: ../tools/virt-df.pl:631
25282 msgid "Most spreadsheets and databases can import CSV directly."
25286 #: ../tools/virt-ls.pl:34
25287 msgid "virt-ls - List files in a virtual machine"
25291 #: ../tools/virt-ls.pl:38
25294 " virt-ls [--options] domname directory\n"
25299 #: ../tools/virt-ls.pl:40
25302 " virt-ls [--options] disk.img [disk.img ...] directory\n"
25307 #: ../tools/virt-ls.pl:44
25309 "C<virt-ls> is a command line tool to list the names of files in a directory "
25310 "inside a virtual machine or disk image."
25314 #: ../tools/virt-ls.pl:47
25316 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
25317 "For more complex cases you should look at the L<guestfish(1)> tool."
25321 #: ../tools/virt-ls.pl:51
25323 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
25324 "simple listing is like the ordinary L<ls(1)> command:"
25328 #: ../tools/virt-ls.pl:54
25331 " $ virt-ls myguest /\n"
25339 #: ../tools/virt-ls.pl:59
25340 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
25344 #: ../tools/virt-ls.pl:61
25347 " $ virt-ls -l myguest /\n"
25349 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
25350 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
25356 #: ../tools/virt-ls.pl:67
25358 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
25359 "and directories recursively:"
25363 #: ../tools/virt-ls.pl:70
25366 " $ virt-ls -R myguest /tmp\n"
25374 #: ../tools/virt-ls.pl:75
25376 "You I<cannot> combine these options. To do more complicated things, use "
25381 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103
25382 #: ../tools/virt-list-partitions.pl:112
25383 msgid "B<-l> | B<--long>"
25387 #: ../tools/virt-ls.pl:133
25388 msgid "B<-R> | B<--recursive>"
25392 #: ../tools/virt-ls.pl:135
25394 "Select the mode. With neither of these options, C<virt-ls> produces a "
25395 "simple, flat list of the files in the named directory."
25399 #: ../tools/virt-ls.pl:138
25401 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
25402 "like the plain C<ls -l> command)."
25406 #: ../tools/virt-ls.pl:141
25408 "C<virt-ls -R> produces a recursive list of files starting at the named "
25409 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
25414 #: ../tools/virt-ls.pl:145
25415 msgid "You cannot combine these options."
25419 #: ../tools/virt-ls.pl:234
25421 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
25422 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
25427 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204
25428 #: ../tools/virt-cat.pl:201 ../tools/virt-tar.pl:298
25429 msgid "Copyright (C) 2009 Red Hat Inc."
25433 #: ../tools/virt-resize.pl:42
25434 msgid "virt-resize - Resize a virtual machine disk"
25438 #: ../tools/virt-resize.pl:46
25441 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
25442 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
25443 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
25448 #: ../tools/virt-resize.pl:52
25450 "Virt-resize is a tool which can resize a virtual machine disk, making it "
25451 "larger or smaller overall, and resizing or deleting any partitions contained "
25456 #: ../tools/virt-resize.pl:56
25458 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
25459 "not> be used on live virtual machines - for consistent results, shut the "
25460 "virtual machine down before resizing it."
25464 #: ../tools/virt-resize.pl:60
25466 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
25467 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
25468 "read those manual pages first."
25472 #: ../tools/virt-resize.pl:68
25474 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
25475 "fill the extra 5GB of space."
25479 #: ../tools/virt-resize.pl:71
25482 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
25483 " virt-list-partitions -lht olddisk\n"
25484 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
25485 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
25490 #: ../tools/virt-resize.pl:76
25492 "As above, but make the /boot partition 200MB bigger, while giving the "
25493 "remaining space to /dev/sda2:"
25497 #: ../tools/virt-resize.pl:79
25500 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
25505 #: ../tools/virt-resize.pl:81
25506 msgid "As above, but the output format will be uncompressed qcow2:"
25510 #: ../tools/virt-resize.pl:83
25513 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
25514 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
25519 #: ../tools/virt-resize.pl:86
25520 msgid "DETAILED USAGE"
25524 #: ../tools/virt-resize.pl:88
25525 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25529 #: ../tools/virt-resize.pl:92
25530 msgid "1. Shut down the virtual machine"
25534 #: ../tools/virt-resize.pl:94
25535 msgid "2. Locate input disk image"
25539 #: ../tools/virt-resize.pl:96
25541 "Locate the input disk image (ie. the file or device on the host containing "
25542 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25543 "dumpxml> like this to find the disk image name:"
25547 #: ../tools/virt-resize.pl:100
25550 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25551 " Found 1 nodes:\n"
25553 " <source dev=\"/dev/vg/lv_guest\" />\n"
25558 #: ../tools/virt-resize.pl:105
25559 msgid "3. Look at current sizing"
25563 #: ../tools/virt-resize.pl:107
25565 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25569 #: ../tools/virt-resize.pl:110
25572 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25573 " /dev/sda1 ext3 101.9M\n"
25574 " /dev/sda2 pv 7.9G\n"
25575 " /dev/sda device 8.0G\n"
25580 #: ../tools/virt-resize.pl:115
25582 "(This example is a virtual machine with an 8 GB disk which we would like to "
25583 "expand up to 10 GB)."
25587 #: ../tools/virt-resize.pl:118
25588 msgid "4. Create output disk"
25592 #: ../tools/virt-resize.pl:120
25594 "Virt-resize cannot do in-place disk modifications. You have to have space "
25595 "to store the resized output disk."
25599 #: ../tools/virt-resize.pl:123
25601 "To store the resized disk image in a file, create a file of a suitable size:"
25605 #: ../tools/virt-resize.pl:126
25608 " # rm -f outdisk\n"
25609 " # truncate -s 10G outdisk\n"
25614 #: ../tools/virt-resize.pl:129
25615 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25619 #: ../tools/virt-resize.pl:131
25622 " # lvcreate -L 10G -n lv_name vg_name\n"
25627 #: ../tools/virt-resize.pl:133
25628 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25632 #: ../tools/virt-resize.pl:135
25635 " # virsh pool-list\n"
25636 " # virsh vol-create-as poolname newvol 10G\n"
25641 #: ../tools/virt-resize.pl:138
25646 #: ../tools/virt-resize.pl:140
25648 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25649 "file) and the output disk. The output disk is the one created in the "
25654 #: ../tools/virt-resize.pl:144
25657 " # virt-resize indisk outdisk\n"
25662 #: ../tools/virt-resize.pl:146
25664 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25665 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25666 "larger, then an extra, empty partition is created at the end of the disk "
25667 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25672 #: ../tools/virt-resize.pl:152
25674 "More realistically you'd want to expand existing partitions in the disk "
25675 "image by passing extra options (for the full list see the L</OPTIONS> "
25680 #: ../tools/virt-resize.pl:156
25682 "L</--expand> is the most useful option. It expands the named partition "
25683 "within the disk to fill any extra space:"
25687 #: ../tools/virt-resize.pl:159
25690 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25695 #: ../tools/virt-resize.pl:161
25697 "(In this case, an extra partition is I<not> created at the end of the disk, "
25698 "because there will be no unused space)."
25702 #: ../tools/virt-resize.pl:164
25704 "L</--resize> is the other commonly used option. The following would "
25705 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25706 "rest of the available space:"
25710 #: ../tools/virt-resize.pl:168
25713 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25714 " indisk outdisk\n"
25719 #: ../tools/virt-resize.pl:171
25721 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25722 "if virt-resize knows how, it will resize the contents, the equivalent of "
25723 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
25724 ">. However virt-resize does not know how to resize some filesystems, so you "
25725 "would have to online resize them after booting the guest. And virt-resize "
25726 "also does not resize anything inside an LVM PV, it just resizes the PV "
25727 "itself and leaves the user to resize any LVs inside that PV as desired."
25731 #: ../tools/virt-resize.pl:180
25732 msgid "Other options are covered below."
25736 #: ../tools/virt-resize.pl:182
25741 #: ../tools/virt-resize.pl:184
25742 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25746 #: ../tools/virt-resize.pl:186
25747 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25751 #: ../tools/virt-resize.pl:188
25754 " # virsh edit guestname\n"
25759 #: ../tools/virt-resize.pl:190
25761 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
25762 "html#elementsDisks>"
25766 #: ../tools/virt-resize.pl:193
25767 msgid "Then start up the domain with the new, resized disk:"
25771 #: ../tools/virt-resize.pl:195
25774 " # virsh start guestname\n"
25779 #: ../tools/virt-resize.pl:197
25781 "and check that it still works. See also the L</NOTES> section below for "
25782 "additional information."
25786 #: ../tools/virt-resize.pl:200
25787 msgid "7. Resize LVs etc inside the guest"
25791 #: ../tools/virt-resize.pl:202
25792 msgid "(This can also be done offline using L<guestfish(1)>)"
25796 #: ../tools/virt-resize.pl:204
25798 "Once the guest has booted you should see the new space available, at least "
25799 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25800 "may need to resize LVs inside PVs, and also resize filesystem types that "
25801 "virt-resize does not know how to expand."
25805 #: ../tools/virt-resize.pl:211
25806 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25810 #: ../tools/virt-resize.pl:213
25812 "Shrinking is somewhat more complex than expanding, and only an overview is "
25817 #: ../tools/virt-resize.pl:216
25819 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25820 "filesystems). The user has to shrink content before passing the disk image "
25821 "to virt-resize, and virt-resize will check that the content has been shrunk "
25826 #: ../tools/virt-resize.pl:221
25827 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25831 #: ../tools/virt-resize.pl:223
25833 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25834 "steps 3 and 4 above to allocate a new disk image."
25838 #: ../tools/virt-resize.pl:226
25840 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25844 #: ../tools/virt-resize.pl:229
25845 msgid "IGNORING OR DELETING PARTITIONS"
25849 #: ../tools/virt-resize.pl:231
25851 "virt-resize also gives a convenient way to ignore or delete partitions when "
25852 "copying from the input disk to the output disk. Ignoring a partition speeds "
25853 "up the copy where you don't care about the existing contents of a "
25854 "partition. Deleting a partition removes it completely, but note that it "
25855 "also renumbers any partitions after the one which is deleted, which can "
25856 "leave some guests unbootable."
25860 #: ../tools/virt-resize.pl:238
25861 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
25865 #: ../tools/virt-resize.pl:240
25867 "If the input disk is in qcow2 format, then you may prefer that the output is "
25868 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
25869 "the fly. The output format is simply determined by the format of the empty "
25870 "output container that you provide. Thus to create qcow2 output, use:"
25874 #: ../tools/virt-resize.pl:246
25877 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
25882 #: ../tools/virt-resize.pl:248
25883 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
25887 #: ../tools/virt-resize.pl:250
25888 msgid "Similarly, to get non-sparse raw output use:"
25892 #: ../tools/virt-resize.pl:252
25895 " fallocate -l size outdisk\n"
25900 #: ../tools/virt-resize.pl:254
25902 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
25903 "dev/zero of=outdisk bs=1M count=..>)"
25907 #: ../tools/virt-resize.pl:267
25908 msgid "Display help."
25912 #: ../tools/virt-resize.pl:281
25913 msgid "B<--resize part=size>"
25917 #: ../tools/virt-resize.pl:283
25919 "Resize the named partition (expanding or shrinking it) so that it has the "
25924 #: ../tools/virt-resize.pl:286
25926 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25927 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25928 "Exabytes; or as a percentage of the current size; or as a relative number or "
25929 "percentage. For example:"
25933 #: ../tools/virt-resize.pl:291
25936 " --resize /dev/sda2=10G\n"
25941 #: ../tools/virt-resize.pl:293
25944 " --resize /dev/sda4=90%\n"
25949 #: ../tools/virt-resize.pl:295
25952 " --resize /dev/sda2=+1G\n"
25957 #: ../tools/virt-resize.pl:297
25960 " --resize /dev/sda2=-200M\n"
25965 #: ../tools/virt-resize.pl:299
25968 " --resize /dev/sda1=+128K\n"
25973 #: ../tools/virt-resize.pl:301
25976 " --resize /dev/sda1=+10%\n"
25981 #: ../tools/virt-resize.pl:303
25984 " --resize /dev/sda1=-10%\n"
25989 #: ../tools/virt-resize.pl:305
25991 "You can increase the size of any partition. Virt-resize will expand the "
25992 "direct content of the partition if it knows how (see C<--expand> below)."
25996 #: ../tools/virt-resize.pl:309
25998 "You can only I<decrease> the size of partitions that contain filesystems or "
25999 "PVs which have already been shrunk. Virt-resize will check this has been "
26000 "done before proceeding, or else will print an error (see also C<--resize-"
26005 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406
26006 #: ../tools/virt-resize.pl:423
26007 msgid "You can give this option multiple times."
26011 #: ../tools/virt-resize.pl:320
26012 msgid "B<--resize-force part=size>"
26016 #: ../tools/virt-resize.pl:322
26018 "This is the same as C<--resize> except that it will let you decrease the "
26019 "size of any partition. Generally this means you will lose any data which "
26020 "was at the end of the partition you shrink, but you may not care about that "
26021 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
26022 "as a swap partition)."
26026 #: ../tools/virt-resize.pl:328
26027 msgid "See also the C<--ignore> option."
26031 #: ../tools/virt-resize.pl:334
26032 msgid "B<--expand part>"
26036 #: ../tools/virt-resize.pl:336
26038 "Expand the named partition so it uses up all extra space (space left over "
26039 "after any other resize changes that you request have been done)."
26043 #: ../tools/virt-resize.pl:339
26045 "If virt-resize knows how, it will expand the direct content of the "
26046 "partition. For example, if the partition is an LVM PV, it will expand the "
26047 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
26048 "content it doesn't know about alone."
26052 #: ../tools/virt-resize.pl:344
26053 msgid "Currently virt-resize can resize:"
26057 #: ../tools/virt-resize.pl:350
26059 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
26064 #: ../tools/virt-resize.pl:355
26066 "NTFS filesystems contained directly in a partition, if libguestfs was "
26067 "compiled with support for NTFS."
26071 #: ../tools/virt-resize.pl:358
26073 "The filesystem must have been shut down consistently last time it was used. "
26074 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
26075 "consistency check, so at the first boot after resizing Windows will check "
26080 #: ../tools/virt-resize.pl:365
26082 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
26083 "inside the PV. The user will have to resize LVs as desired."
26087 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
26088 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
26092 #: ../tools/virt-resize.pl:377
26093 msgid "B<--shrink part>"
26097 #: ../tools/virt-resize.pl:379
26099 "Shrink the named partition until the overall disk image fits in the "
26100 "destination. The named partition B<must> contain a filesystem or PV which "
26101 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
26102 "online tools). Virt-resize will check this and give an error if it has not "
26107 #: ../tools/virt-resize.pl:385
26109 "The amount by which the overall disk must be shrunk (after carrying out all "
26110 "other operations requested by the user) is called the \"deficit\". For "
26111 "example, a straight copy (assume no other operations) from a 5GB disk image "
26112 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
26113 "would give an error unless the user specified a partition to shrink and that "
26114 "partition had more than a gigabyte of free space."
26118 #: ../tools/virt-resize.pl:399
26119 msgid "B<--ignore part>"
26123 #: ../tools/virt-resize.pl:401
26125 "Ignore the named partition. Effectively this means the partition is "
26126 "allocated on the destination disk, but the content is not copied across from "
26127 "the source disk. The content of the partition will be blank (all zero "
26132 #: ../tools/virt-resize.pl:412
26133 msgid "B<--delete part>"
26137 #: ../tools/virt-resize.pl:414
26139 "Delete the named partition. It would be more accurate to describe this as "
26140 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
26141 "the original disk image is left intact."
26145 #: ../tools/virt-resize.pl:418
26147 "Note that when you delete a partition, then anything contained in the "
26148 "partition is also deleted. Furthermore, this causes any partitions that "
26149 "come after to be I<renumbered>, which can easily make your guest unbootable."
26153 #: ../tools/virt-resize.pl:429
26154 msgid "B<--LV-expand logvol>"
26158 #: ../tools/virt-resize.pl:431
26160 "This takes the logical volume and, as a final step, expands it to fill all "
26161 "the space available in its volume group. A typical usage, assuming a Linux "
26162 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
26163 "lv_root> would be:"
26167 #: ../tools/virt-resize.pl:436
26170 " virt-resize indisk outdisk \\\n"
26171 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
26176 #: ../tools/virt-resize.pl:439
26178 "This would first expand the partition (and PV), and then expand the root "
26179 "device to fill the extra space in the PV."
26183 #: ../tools/virt-resize.pl:442
26185 "The contents of the LV are also resized if virt-resize knows how to do "
26186 "that. You can stop virt-resize from trying to expand the content by using "
26187 "the option C<--no-expand-content>."
26191 #: ../tools/virt-resize.pl:446
26192 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
26196 #: ../tools/virt-resize.pl:449
26198 "You can give this option multiple times, I<but> it doesn't make sense to do "
26199 "this unless the logical volumes you specify are all in different volume "
26204 #: ../tools/virt-resize.pl:457
26205 msgid "B<--no-copy-boot-loader>"
26209 #: ../tools/virt-resize.pl:459
26211 "By default, virt-resize copies over some sectors at the start of the disk "
26212 "(up to the beginning of the first partition). Commonly these sectors "
26213 "contain the Master Boot Record (MBR) and the boot loader, and are required "
26214 "in order for the guest to boot correctly."
26218 #: ../tools/virt-resize.pl:464
26220 "If you specify this flag, then this initial copy is not done. You may need "
26221 "to reinstall the boot loader in this case."
26225 #: ../tools/virt-resize.pl:472
26226 msgid "B<--no-extra-partition>"
26230 #: ../tools/virt-resize.pl:474
26232 "By default, virt-resize creates an extra partition if there is any extra, "
26233 "unused space after all resizing has happened. Use this option to prevent "
26234 "the extra partition from being created. If you do this then the extra space "
26235 "will be inaccessible until you run fdisk, parted, or some other partitioning "
26236 "tool in the guest."
26240 #: ../tools/virt-resize.pl:480
26242 "Note that if the surplus space is smaller than 10 MB, no extra partition "
26247 #: ../tools/virt-resize.pl:487
26248 msgid "B<--no-expand-content>"
26252 #: ../tools/virt-resize.pl:489
26254 "By default, virt-resize will try to expand the direct contents of "
26255 "partitions, if it knows how (see C<--expand> option above)."
26259 #: ../tools/virt-resize.pl:492
26261 "If you give the C<--no-expand-content> option then virt-resize will not "
26266 #: ../tools/virt-resize.pl:499
26267 msgid "B<-d> | B<--debug>"
26271 #: ../tools/virt-resize.pl:507
26272 msgid "B<-n> | B<--dryrun>"
26276 #: ../tools/virt-resize.pl:509
26277 msgid "Print a summary of what would be done, but don't do anything."
26281 #: ../tools/virt-resize.pl:515
26282 msgid "B<-q> | B<--quiet>"
26286 #: ../tools/virt-resize.pl:517
26287 msgid "Don't print the summary."
26291 #: ../tools/virt-resize.pl:525
26293 "Specify the format of the input disk image. If this flag is not given then "
26294 "it is auto-detected from the image itself."
26298 #: ../tools/virt-resize.pl:531
26300 "Note that this option I<does not> affect the output format. See L</QCOW2 "
26301 "AND NON-SPARSE RAW FORMATS>."
26305 #: ../tools/virt-resize.pl:538
26306 msgid "B<--output-format> raw"
26310 #: ../tools/virt-resize.pl:540
26312 "Specify the format of the output disk image. If this flag is not given then "
26313 "it is auto-detected from the image itself."
26317 #: ../tools/virt-resize.pl:546
26319 "Note that you still need to create the output disk with the right format. "
26320 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
26324 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
26329 #: ../tools/virt-resize.pl:1424
26330 msgid "\"Partition 1 does not end on cylinder boundary.\""
26334 #: ../tools/virt-resize.pl:1426
26336 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
26337 "means the partitions will not be aligned to the ancient CHS geometry. "
26338 "However CHS geometry is meaningless for disks manufactured since the early "
26339 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
26340 "cylinders is not required by any modern operating system."
26344 #: ../tools/virt-resize.pl:1433
26345 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
26349 #: ../tools/virt-resize.pl:1435
26351 "In Windows Vista and later versions, Microsoft switched to using a separate "
26352 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
26353 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
26354 "the boot partition. Doing so seems to break the guest completely. However "
26355 "expanding the second partition (ie. C: drive) should work."
26359 #: ../tools/virt-resize.pl:1442
26361 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
26362 "NTFS partitions have been expanded. This is just a safety check and (unless "
26363 "it find errors) is nothing to worry about."
26367 #: ../tools/virt-resize.pl:1446
26368 msgid "GUEST BOOT STUCK AT \"GRUB\""
26372 #: ../tools/virt-resize.pl:1448
26374 "If a Linux guest does not boot after resizing, and the boot is stuck after "
26375 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
26376 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
26377 "although we think is to do with partition alignment."
26381 #: ../tools/virt-resize.pl:1453
26384 " guestfish -i -a newdisk\n"
26385 " ><fs> cat /boot/grub/device.map\n"
26386 " # check the contents of this file are sensible or\n"
26387 " # edit the file if necessary\n"
26388 " ><fs> grub-install / /dev/vda\n"
26394 #: ../tools/virt-resize.pl:1460
26396 "For more flexible guest reconfiguration, including if you need to specify "
26397 "other parameters to grub-install, use L<virt-rescue(1)>."
26401 #: ../tools/virt-resize.pl:1463
26402 msgid "ALTERNATIVE TOOLS"
26406 #: ../tools/virt-resize.pl:1465
26408 "There are several proprietary tools for resizing partitions. We won't "
26409 "mention any here."
26413 #: ../tools/virt-resize.pl:1468
26415 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
26416 "operations on disk images. They can resize and move partitions, but I don't "
26417 "think they can do anything with the contents, and they certainly don't "
26422 #: ../tools/virt-resize.pl:1473
26424 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
26425 "but at a much lower level. You will probably end up hand-calculating sector "
26426 "offsets, which is something that virt-resize was designed to avoid. If you "
26427 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
26432 #: ../tools/virt-resize.pl:1488
26434 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
26435 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
26436 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)"
26437 ">, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
26438 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
26442 #: ../tools/virt-list-filesystems.pl:32
26444 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
26448 #: ../tools/virt-list-filesystems.pl:36
26451 " virt-list-filesystems [--options] domname\n"
26456 #: ../tools/virt-list-filesystems.pl:38
26459 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
26464 #: ../tools/virt-list-filesystems.pl:42
26466 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
26467 "are contained in a virtual machine or disk image."
26471 #: ../tools/virt-list-filesystems.pl:46
26473 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
26474 "functionality. For more complex cases you should look at the L<guestfish(1)"
26479 #: ../tools/virt-list-filesystems.pl:105
26481 "With this option, C<virt-list-filesystems> displays the type of each "
26482 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
26486 #: ../tools/virt-list-filesystems.pl:112
26487 msgid "B<-a> | B<--all>"
26491 #: ../tools/virt-list-filesystems.pl:114
26493 "Normally we only show mountable filesystems. If this option is given then "
26494 "swap devices are shown too."
26498 #: ../tools/virt-list-filesystems.pl:188
26500 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
26501 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
26502 ">, L<http://libguestfs.org/>."
26506 #: ../tools/virt-cat.pl:33
26507 msgid "virt-cat - Display a file in a virtual machine"
26511 #: ../tools/virt-cat.pl:37
26514 " virt-cat [--options] domname file\n"
26519 #: ../tools/virt-cat.pl:39
26522 " virt-cat [--options] disk.img [disk.img ...] file\n"
26527 #: ../tools/virt-cat.pl:43
26529 "C<virt-cat> is a command line tool to display the contents of C<file> where "
26530 "C<file> exists in the named virtual machine (or disk image)."
26534 #: ../tools/virt-cat.pl:46
26536 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
26537 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
26542 #: ../tools/virt-cat.pl:52
26544 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
26548 #: ../tools/virt-cat.pl:55
26551 " virt-cat mydomain /etc/fstab\n"
26556 #: ../tools/virt-cat.pl:57
26557 msgid "List syslog messages from a VM:"
26561 #: ../tools/virt-cat.pl:59
26564 " virt-cat mydomain /var/log/messages | tail\n"
26569 #: ../tools/virt-cat.pl:61
26570 msgid "Find out what DHCP IP address a VM acquired:"
26574 #: ../tools/virt-cat.pl:63
26577 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
26582 #: ../tools/virt-cat.pl:65
26583 msgid "Find out what packages were recently installed:"
26587 #: ../tools/virt-cat.pl:67
26590 " virt-cat mydomain /var/log/yum.log | tail\n"
26595 #: ../tools/virt-cat.pl:69
26596 msgid "Find out who is logged on inside a virtual machine:"
26600 #: ../tools/virt-cat.pl:71
26603 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
26609 #: ../tools/virt-cat.pl:74
26610 msgid "or who was logged on:"
26614 #: ../tools/virt-cat.pl:76
26617 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
26618 " last -f /tmp/wtmp\n"
26623 #: ../tools/virt-cat.pl:187
26625 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26626 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26630 #: ../tools/virt-tar.pl:33
26631 msgid "virt-tar - Extract or upload files to a virtual machine"
26635 #: ../tools/virt-tar.pl:37
26638 " virt-tar [--options] -x domname directory tarball\n"
26643 #: ../tools/virt-tar.pl:39
26646 " virt-tar [--options] -u domname tarball directory\n"
26651 #: ../tools/virt-tar.pl:41
26654 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
26659 #: ../tools/virt-tar.pl:43
26662 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
26667 #: ../tools/virt-tar.pl:47
26668 msgid "Download C</home> from the VM into a local tarball:"
26672 #: ../tools/virt-tar.pl:49
26675 " virt-tar -x domname /home home.tar\n"
26680 #: ../tools/virt-tar.pl:51
26683 " virt-tar -zx domname /home home.tar.gz\n"
26688 #: ../tools/virt-tar.pl:53
26689 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
26693 #: ../tools/virt-tar.pl:55
26696 " virt-tar -u domname uploadstuff.tar /tmp\n"
26701 #: ../tools/virt-tar.pl:57
26704 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
26709 #: ../tools/virt-tar.pl:61
26711 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
26712 "virtual machines. If you do this, you risk disk corruption in the VM. "
26713 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
26717 #: ../tools/virt-tar.pl:66
26719 "You can use C<-x> (extract) on live virtual machines, but you might get "
26720 "inconsistent results or errors if there is filesystem activity inside the "
26721 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
26722 "work, but the only way to guarantee consistent results is if the virtual "
26723 "machine is shut down."
26727 #: ../tools/virt-tar.pl:74
26729 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
26730 "parts of a guest filesystem. There are many possibilities: making backups, "
26731 "uploading data files, snooping on guest activity, fixing or customizing "
26736 #: ../tools/virt-tar.pl:79
26738 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
26739 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
26740 "should look at the L<guestfish(1)> tool."
26744 #: ../tools/virt-tar.pl:83
26746 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
26747 "its contents (recursively) from the virtual machine into a local tarball. "
26748 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
26749 "virtual machine. You cannot use these two options together."
26753 #: ../tools/virt-tar.pl:89
26755 "In addition, you may need to use the C<-z> (gZip) option to enable "
26756 "compression. When uploading, you have to specify C<-z> if the upload file "
26757 "is compressed because virt-tar won't detect this on its own."
26761 #: ../tools/virt-tar.pl:93
26763 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
26764 "example it cannot do PKZip files or bzip2 compression. If you want that "
26765 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
26766 "the L<libguestfs(3)> API)."
26770 #: ../tools/virt-tar.pl:151
26771 msgid "B<-x> | B<--extract> | B<--download>"
26775 #: ../tools/virt-tar.pl:153
26776 msgid "B<-u> | B<--upload>"
26780 #: ../tools/virt-tar.pl:155
26782 "Use C<-x> to extract (download) a directory from a virtual machine to a "
26787 #: ../tools/virt-tar.pl:158
26789 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
26790 "Please read the L</WARNING> section above before using this option."
26794 #: ../tools/virt-tar.pl:162
26795 msgid "You must specify exactly one of these options."
26799 #: ../tools/virt-tar.pl:168
26800 msgid "B<-z> | B<--gzip>"
26804 #: ../tools/virt-tar.pl:170
26805 msgid "Specify that the input or output tarball is gzip-compressed."
26809 #: ../tools/virt-tar.pl:283
26811 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
26812 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
26817 #: ../tools/virt-rescue.pl:33
26818 msgid "virt-rescue - Run a rescue shell on a virtual machine"
26822 #: ../tools/virt-rescue.pl:37
26825 " virt-rescue [--options] domname\n"
26830 #: ../tools/virt-rescue.pl:39
26833 " virt-rescue [--options] disk.img [disk.img ...]\n"
26838 #: ../tools/virt-rescue.pl:43
26840 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
26841 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
26842 "you from doing this, but doesn't catch all cases."
26846 #: ../tools/virt-rescue.pl:47
26848 "However if you use the I<--ro> (read only) option, then you can attach a "
26849 "shell to a live virtual machine. The results might be strange or "
26850 "inconsistent at times but you won't get disk corruption."
26854 #: ../tools/virt-rescue.pl:53
26856 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
26857 "need for a CD. virt-rescue gives you a rescue shell and some simple "
26858 "recovery tools which you can use to examine or rescue a virtual machine or "
26863 #: ../tools/virt-rescue.pl:58
26865 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
26866 "on disk image(s):"
26870 #: ../tools/virt-rescue.pl:61
26873 " virt-rescue GuestName\n"
26878 #: ../tools/virt-rescue.pl:63
26881 " virt-rescue --ro /path/to/disk.img\n"
26886 #: ../tools/virt-rescue.pl:65
26889 " virt-rescue /dev/sdc\n"
26894 #: ../tools/virt-rescue.pl:67
26895 msgid "For live VMs you I<must> use the --ro option."
26899 #: ../tools/virt-rescue.pl:69
26901 "When you run virt-rescue on a virtual machine or disk image, you are placed "
26902 "in an interactive bash shell where you can use many ordinary Linux "
26903 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
26904 "appliance. You must mount the virtual machine's filesystems by hand. There "
26905 "is an empty directory called C</sysroot> where you can mount filesystems."
26909 #: ../tools/virt-rescue.pl:76
26911 "In the example below, we list logical volumes, then choose one to mount "
26912 "under C</sysroot>:"
26916 #: ../tools/virt-rescue.pl:79
26920 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
26921 " lv_root vg_f11x64 -wi-a- 8.83G\n"
26922 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
26923 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
26924 " ><rescue> ls /sysroot\n"
26929 #: ../tools/virt-rescue.pl:86
26931 "If you don't know what filesystems are available on the virtual machine then "
26932 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
26936 #: ../tools/virt-rescue.pl:92
26938 "Virt-rescue can be used on I<any> disk image file or device, not just a "
26939 "virtual machine. For example you can use it on a blank file if you want to "
26940 "partition that file (although we would recommend using L<guestfish(1)> "
26941 "instead as it is more suitable for this purpose). You can even use virt-"
26942 "rescue on things like SD cards."
26946 #: ../tools/virt-rescue.pl:98
26948 "This tool is just designed for quick interactive hacking on a virtual "
26949 "machine. For more structured access to a virtual machine disk image, you "
26950 "should use L<guestfs(3)>. To get a structured shell that you can use to "
26951 "make scripted changes to guests, use L<guestfish(1)>."
26955 #: ../tools/virt-rescue.pl:127
26956 msgid "B<--append kernelopts>"
26960 #: ../tools/virt-rescue.pl:129
26961 msgid "Pass additional options to the rescue kernel."
26965 #: ../tools/virt-rescue.pl:164
26966 msgid "B<--memsize MB> | B<-m MB>"
26970 #: ../tools/virt-rescue.pl:166
26972 "Change the amount of memory allocated to the rescue system. The default is "
26973 "set by libguestfs and is small but adequate for running system tools. The "
26974 "occasional program might need more memory. The parameter is specified in "
26979 #: ../tools/virt-rescue.pl:175
26980 msgid "B<--network MB>"
26984 #: ../tools/virt-rescue.pl:177
26985 msgid "Enable QEMU user networking in the guest."
26989 #: ../tools/virt-rescue.pl:183
26990 msgid "B<--ro> | B<-r>"
26994 #: ../tools/virt-rescue.pl:185
26995 msgid "Open the image read-only."
26999 #: ../tools/virt-rescue.pl:197
27001 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
27002 "SELINUX> before using this option."
27006 #: ../tools/virt-rescue.pl:257
27008 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
27009 "ENVIRONMENT VARIABLES> for the complete list."
27013 #: ../tools/virt-rescue.pl:269
27015 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
27016 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27020 #: ../tools/virt-make-fs.pl:37
27021 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
27025 #: ../tools/virt-make-fs.pl:41
27028 " virt-make-fs [--options] input.tar output.img\n"
27033 #: ../tools/virt-make-fs.pl:43
27036 " virt-make-fs [--options] input.tar.gz output.img\n"
27041 #: ../tools/virt-make-fs.pl:45
27044 " virt-make-fs [--options] directory output.img\n"
27049 #: ../tools/virt-make-fs.pl:49
27051 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
27052 "archive or some files in a directory. It is similar to tools like L<mkisofs"
27053 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
27054 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
27055 "you want to attach these filesystems to existing virtual machines (eg. to "
27056 "import large amounts of read-only data to a VM)."
27060 #: ../tools/virt-make-fs.pl:57
27061 msgid "Basic usage is:"
27065 #: ../tools/virt-make-fs.pl:59
27068 " virt-make-fs input output\n"
27073 #: ../tools/virt-make-fs.pl:61
27075 "where C<input> is either a directory containing files that you want to add, "
27076 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
27077 "C<output> is a disk image. The input type is detected automatically. The "
27078 "output disk image defaults to a raw ext2 image unless you specify extra "
27079 "flags (see L</OPTIONS> below)."
27083 #: ../tools/virt-make-fs.pl:67
27084 msgid "EXTRA SPACE"
27088 #: ../tools/virt-make-fs.pl:69
27090 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
27091 "the files that it contains, but might have extra space. Depending on how "
27092 "you are going to use the output, you might think this extra space is wasted "
27093 "and want to minimize it, or you might want to leave space so that more files "
27094 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
27095 "but you can use the C<--size> flag to leave space in the filesystem if you "
27100 #: ../tools/virt-make-fs.pl:77
27102 "An alternative way to leave extra space but not make the output image any "
27103 "bigger is to use an alternative disk image format (instead of the default "
27104 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
27105 "image format (check your hypervisor supports this before using it). This "
27106 "allows you to choose a large C<--size> but the extra space won't actually be "
27107 "allocated in the image until you try to store something in it."
27111 #: ../tools/virt-make-fs.pl:85
27113 "Don't forget that you can also use local commands including L<resize2fs(8)> "
27114 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
27115 "resize to build another image from scratch."
27119 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
27120 #: ../tools/virt-make-fs.pl:142
27125 #: ../tools/virt-make-fs.pl:91
27128 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
27133 #: ../tools/virt-make-fs.pl:93
27134 msgid "FILESYSTEM TYPE"
27138 #: ../tools/virt-make-fs.pl:95
27140 "The default filesystem type is C<ext2>. Just about any filesystem type that "
27141 "libguestfs supports can be used (but I<not> read-only formats like "
27142 "ISO9660). Here are some of the more common choices:"
27146 #: ../tools/virt-make-fs.pl:101
27151 #: ../tools/virt-make-fs.pl:103
27153 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
27154 "you are not going to use the filesystem in a way that requires the journal, "
27155 "then this is just wasted overhead."
27159 #: ../tools/virt-make-fs.pl:107
27160 msgid "I<ntfs> or I<vfat>"
27164 #: ../tools/virt-make-fs.pl:109
27165 msgid "Useful if exporting data to a Windows guest."
27169 #: ../tools/virt-make-fs.pl:111
27171 "I<Note for vfat>: The tar archive or local directory must only contain files "
27172 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
27173 "program running within libguestfs is unable to change the ownership of non-"
27174 "root files, since vfat itself does not support this."
27178 #: ../tools/virt-make-fs.pl:116
27183 #: ../tools/virt-make-fs.pl:118
27185 "Lower overhead than C<ext2>, but certain limitations on filename length and "
27186 "total filesystem size."
27190 #: ../tools/virt-make-fs.pl:125
27193 " virt-make-fs --type=minix input minixfs.img\n"
27198 #: ../tools/virt-make-fs.pl:127
27199 msgid "TO PARTITION OR NOT TO PARTITION"
27203 #: ../tools/virt-make-fs.pl:129
27204 msgid "Optionally virt-make-fs can add a partition table to the output disk."
27208 #: ../tools/virt-make-fs.pl:131
27210 "Adding a partition can make the disk image more compatible with certain "
27211 "virtualized operating systems which don't expect to see a filesystem "
27212 "directly located on a block device (Linux doesn't care and will happily "
27213 "handle both types)."
27217 #: ../tools/virt-make-fs.pl:136
27219 "On the other hand, if you have a partition table then the output image is no "
27220 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
27221 "directly on a partitioned disk image. (However libguestfs tools such as "
27222 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
27226 #: ../tools/virt-make-fs.pl:144
27227 msgid "Add an MBR partition:"
27231 #: ../tools/virt-make-fs.pl:146
27234 " virt-make-fs --partition -- input disk.img\n"
27239 #: ../tools/virt-make-fs.pl:148
27241 "If the output disk image could be terabyte-sized or larger, it's better to "
27242 "use an EFI/GPT-compatible partition table:"
27246 #: ../tools/virt-make-fs.pl:151
27249 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
27254 #: ../tools/virt-make-fs.pl:179
27255 msgid "Enable debugging information."
27259 #: ../tools/virt-make-fs.pl:185
27260 msgid "B<--size=E<lt>NE<gt>>"
27264 #: ../tools/virt-make-fs.pl:187
27265 msgid "B<--size=+E<lt>NE<gt>>"
27269 #: ../tools/virt-make-fs.pl:189
27270 msgid "B<-s E<lt>NE<gt>>"
27274 #: ../tools/virt-make-fs.pl:191
27275 msgid "B<-s +E<lt>NE<gt>>"
27279 #: ../tools/virt-make-fs.pl:193
27281 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
27285 #: ../tools/virt-make-fs.pl:196
27287 "If this option is I<not> given, then the output image will be just large "
27288 "enough to contain all the files, with not much wasted space."
27292 #: ../tools/virt-make-fs.pl:199
27294 "To choose a fixed size output disk, specify an absolute number followed by b/"
27295 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27296 "Petabytes or Exabytes. This must be large enough to contain all the input "
27297 "files, else you will get an error."
27301 #: ../tools/virt-make-fs.pl:204
27303 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
27304 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27305 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
27306 "the input files, and (approximately) an extra 200 MB free space."
27310 #: ../tools/virt-make-fs.pl:210
27312 "Note that virt-make-fs estimates free space, and therefore will not produce "
27313 "filesystems containing precisely the free space requested. (It is much more "
27314 "expensive and time-consuming to produce a filesystem which has precisely the "
27315 "desired free space)."
27319 #: ../tools/virt-make-fs.pl:219
27320 msgid "B<--format=E<lt>fmtE<gt>>"
27324 #: ../tools/virt-make-fs.pl:221
27325 msgid "B<-F E<lt>fmtE<gt>>"
27329 #: ../tools/virt-make-fs.pl:223
27330 msgid "Choose the output disk image format."
27334 #: ../tools/virt-make-fs.pl:225
27335 msgid "The default is C<raw> (raw disk image)."
27339 #: ../tools/virt-make-fs.pl:227
27341 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
27342 "that would really make sense here is C<qcow2>."
27346 #: ../tools/virt-make-fs.pl:234
27347 msgid "B<--type=E<lt>fsE<gt>>"
27351 #: ../tools/virt-make-fs.pl:236
27352 msgid "B<-t E<lt>fsE<gt>>"
27356 #: ../tools/virt-make-fs.pl:238
27357 msgid "Choose the output filesystem type."
27361 #: ../tools/virt-make-fs.pl:240
27362 msgid "The default is C<ext2>."
27366 #: ../tools/virt-make-fs.pl:242
27368 "Any filesystem which is supported read-write by libguestfs can be used here."
27372 #: ../tools/virt-make-fs.pl:249
27373 msgid "B<--partition>"
27377 #: ../tools/virt-make-fs.pl:251
27378 msgid "B<--partition=E<lt>parttypeE<gt>>"
27382 #: ../tools/virt-make-fs.pl:253
27384 "If specified, this flag adds an MBR partition table to the output disk image."
27388 #: ../tools/virt-make-fs.pl:256
27390 "You can change the partition table type, eg. C<--partition=gpt> for large "
27395 #: ../tools/virt-make-fs.pl:259
27397 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
27398 "might consider the next parameter to be the partition type. For example:"
27402 #: ../tools/virt-make-fs.pl:263
27405 " virt-make-fs --partition input.tar ...\n"
27410 #: ../tools/virt-make-fs.pl:265
27412 "would cause virt-make-fs to think you wanted to use a partition type of "
27413 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
27414 "dash) between options and the input file argument:"
27418 #: ../tools/virt-make-fs.pl:269
27421 " virt-make-fs --partition -- input.tar ...\n"
27426 #: ../tools/virt-make-fs.pl:536
27428 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
27429 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
27430 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
27434 #: ../tools/virt-make-fs.pl:553
27437 " export LIBGUESTFS_DEBUG=1\n"
27438 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
27443 #: ../tools/virt-make-fs.pl:556
27445 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
27450 #: ../tools/virt-list-partitions.pl:32
27452 "virt-list-partitions - List partitions in a virtual machine or disk image"
27456 #: ../tools/virt-list-partitions.pl:36
27459 " virt-list-partitions [--options] domname\n"
27464 #: ../tools/virt-list-partitions.pl:38
27467 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
27472 #: ../tools/virt-list-partitions.pl:42
27474 "C<virt-list-partitions> is a command line tool to list the partitions that "
27475 "are contained in a virtual machine or disk image. It is mainly useful as a "
27476 "first step to using L<virt-resize(1)>."
27480 #: ../tools/virt-list-partitions.pl:47
27482 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
27483 "functionality. For more complex cases you should look at the L<guestfish(1)"
27488 #: ../tools/virt-list-partitions.pl:104
27489 msgid "B<-h> | B<--human-readable>"
27493 #: ../tools/virt-list-partitions.pl:106
27494 msgid "Show sizes in human-readable form (eg. \"1G\")."
27498 #: ../tools/virt-list-partitions.pl:114
27500 "With this option, C<virt-list-partitions> displays the type and size of each "
27501 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
27505 #: ../tools/virt-list-partitions.pl:121
27506 msgid "B<-t> | B<--total>"
27510 #: ../tools/virt-list-partitions.pl:123
27512 "Display the total size of each block device (as a separate row or rows)."
27516 #: ../tools/virt-list-partitions.pl:256
27518 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
27519 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
27520 "libguestfs.org/>."