1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.7.4\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2010-11-11 18:35+0000\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=utf-8\n"
17 "Content-Transfer-Encoding: ENCODING"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1 ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1 ../inspector/virt-inspector.pl:31 ../tools/virt-edit.pl:30 ../tools/virt-win-reg.pl:33 ../tools/virt-df.pl:32 ../tools/virt-ls.pl:30 ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28 ../tools/virt-tar.pl:29 ../tools/virt-rescue.pl:29 ../tools/virt-make-fs.pl:33 ../tools/virt-list-partitions.pl:28
25 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pl:33 ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35 ../tools/virt-df.pl:34 ../tools/virt-ls.pl:32 ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30 ../tools/virt-tar.pl:31 ../tools/virt-rescue.pl:31 ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
30 #: ../src/guestfs.pod:5
31 msgid "guestfs - Library for accessing and modifying virtual machine images"
35 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pl:37 ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39 ../tools/virt-df.pl:38 ../tools/virt-ls.pl:36 ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34 ../tools/virt-tar.pl:35 ../tools/virt-rescue.pl:35 ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
40 #: ../src/guestfs.pod:9
43 " #include <guestfs.h>\n"
48 #: ../src/guestfs.pod:11
51 " guestfs_h *g = guestfs_create ();\n"
52 " guestfs_add_drive (g, \"guest.img\");\n"
53 " guestfs_launch (g);\n"
54 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
55 " guestfs_touch (g, \"/hello\");\n"
56 " guestfs_umount (g, \"/\");\n"
57 " guestfs_sync (g);\n"
58 " guestfs_close (g);\n"
63 #: ../src/guestfs.pod:20
66 " cc prog.c -o prog -lguestfs\n"
68 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
73 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:30 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pl:43 ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63 ../tools/virt-df.pl:46 ../tools/virt-ls.pl:42 ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40 ../tools/virt-tar.pl:72 ../tools/virt-rescue.pl:51 ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
78 #: ../src/guestfs.pod:26
80 "Libguestfs is a library for accessing and modifying guest disk images. "
81 "Amongst the things this is good for: making batch configuration changes to "
82 "guests, getting disk used/free statistics (see also: virt-df), migrating "
83 "between virtualization systems (see also: virt-p2v), performing partial "
84 "backups, performing partial guest clones, cloning guests and changing "
85 "registry/UUID/hostname info, and much else besides."
89 #: ../src/guestfs.pod:34
91 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
92 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
93 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
98 #: ../src/guestfs.pod:39
100 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
101 "what filesystem is in each LV, etc.). It can also run commands in the "
102 "context of the guest. Also you can access filesystems over FUSE."
106 #: ../src/guestfs.pod:44
108 "Libguestfs is a library that can be linked with C and C++ management "
109 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
110 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
115 #: ../src/guestfs.pod:49
117 "You don't need to be root to use libguestfs, although obviously you do need "
118 "enough permissions to access the disk images."
122 #: ../src/guestfs.pod:52
124 "Libguestfs is a large API because it can do many things. For a gentle "
125 "introduction, please read the L</API OVERVIEW> section next."
129 #: ../src/guestfs.pod:55
134 #: ../src/guestfs.pod:57
136 "This section provides a gentler overview of the libguestfs API. We also try "
137 "to group API calls together, where that may not be obvious from reading "
138 "about the individual calls in the main section of this manual."
142 #: ../src/guestfs.pod:62
147 #: ../src/guestfs.pod:64
149 "Before you can use libguestfs calls, you have to create a handle. Then you "
150 "must add at least one disk image to the handle, followed by launching the "
151 "handle, then performing whatever operations you want, and finally closing "
152 "the handle. By convention we use the single letter C<g> for the name of the "
153 "handle variable, although of course you can use any name you want."
157 #: ../src/guestfs.pod:71
158 msgid "The general structure of all libguestfs-using programs looks like this:"
162 #: ../src/guestfs.pod:74
165 " guestfs_h *g = guestfs_create ();\n"
170 #: ../src/guestfs.pod:76
173 " /* Call guestfs_add_drive additional times if there are\n"
174 " * multiple disk images.\n"
176 " guestfs_add_drive (g, \"guest.img\");\n"
181 #: ../src/guestfs.pod:81
184 " /* Most manipulation calls won't work until you've launched\n"
185 " * the handle 'g'. You have to do this _after_ adding drives\n"
186 " * and _before_ other commands.\n"
188 " guestfs_launch (g);\n"
193 #: ../src/guestfs.pod:87
196 " /* Now you can examine what partitions, LVs etc are available.\n"
198 " char **partitions = guestfs_list_partitions (g);\n"
199 " char **logvols = guestfs_lvs (g);\n"
204 #: ../src/guestfs.pod:92
207 " /* To access a filesystem in the image, you must mount it.\n"
209 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
214 #: ../src/guestfs.pod:96
217 " /* Now you can perform filesystem actions on the guest\n"
220 " guestfs_touch (g, \"/hello\");\n"
225 #: ../src/guestfs.pod:101
228 " /* You only need to call guestfs_sync if you have made\n"
229 " * changes to the guest image. (But if you've made changes\n"
230 " * then you *must* sync). See also: guestfs_umount and\n"
231 " * guestfs_umount_all calls.\n"
233 " guestfs_sync (g);\n"
238 #: ../src/guestfs.pod:108
241 " /* Close the handle 'g'. */\n"
242 " guestfs_close (g);\n"
247 #: ../src/guestfs.pod:111
249 "The code above doesn't include any error checking. In real code you should "
250 "check return values carefully for errors. In general all functions that "
251 "return integers return C<-1> on error, and all functions that return "
252 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
253 "how to handle errors, and consult the documentation for each function call "
254 "below to see precisely how they return error indications."
258 #: ../src/guestfs.pod:119
263 #: ../src/guestfs.pod:121
265 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
266 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
267 "actual block device, or simply an empty file of zeroes that you have created "
268 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
273 #: ../src/guestfs.pod:127
275 "The call you should use in modern code for adding drives is "
276 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
277 "specifying that the format is raw, do:"
281 #: ../src/guestfs.pod:131
284 " guestfs_add_drive_opts (g, filename,\n"
285 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
291 #: ../src/guestfs.pod:135
292 msgid "You can add a disk read-only using:"
296 #: ../src/guestfs.pod:137
299 " guestfs_add_drive_opts (g, filename,\n"
300 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
301 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
307 #: ../src/guestfs.pod:142
309 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
310 "libguestfs won't modify the file."
314 #: ../src/guestfs.pod:145
316 "Be extremely cautious if the disk image is in use, eg. if it is being used "
317 "by a virtual machine. Adding it read-write will almost certainly cause disk "
318 "corruption, but adding it read-only is safe."
322 #: ../src/guestfs.pod:149
324 "You must add at least one disk image, and you may add multiple disk images. "
325 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
326 "first one you added), C</dev/sdb> (for the second one you added), etc."
330 #: ../src/guestfs.pod:154
332 "Once L</guestfs_launch> has been called you cannot add any more images. You "
333 "can call L</guestfs_list_devices> to get a list of the device names, in the "
334 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
338 #: ../src/guestfs.pod:159
343 #: ../src/guestfs.pod:161
345 "Before you can read or write files, create directories and so on in a disk "
346 "image that contains filesystems, you have to mount those filesystems using "
347 "L</guestfs_mount>. If you already know that a disk image contains (for "
348 "example) one partition with a filesystem on that partition, then you can "
353 #: ../src/guestfs.pod:167
356 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
361 #: ../src/guestfs.pod:169
363 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
364 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
365 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
369 #: ../src/guestfs.pod:173
371 "If you are given a disk image and you don't know what it contains then you "
372 "have to find out. Libguestfs can do that too: use "
373 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
374 "and LVs, and either try mounting each to see what is mountable, or else "
375 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also "
376 "has a set of APIs for inspection of disk images (see L</INSPECTION> below). "
377 "But you might find it easier to look at higher level programs built on top "
378 "of libguestfs, in particular L<virt-inspector(1)>."
382 #: ../src/guestfs.pod:183
384 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
385 "several other variations of the C<guestfs_mount_*> call."
389 #: ../src/guestfs.pod:186
390 msgid "FILESYSTEM ACCESS AND MODIFICATION"
394 #: ../src/guestfs.pod:188
396 "The majority of the libguestfs API consists of fairly low-level calls for "
397 "accessing and modifying the files, directories, symlinks etc on mounted "
398 "filesystems. There are over a hundred such calls which you can find listed "
399 "in detail below in this man page, and we don't even pretend to cover them "
400 "all in this overview."
404 #: ../src/guestfs.pod:194
406 "Specify filenames as full paths, starting with C<\"/\"> and including the "
411 #: ../src/guestfs.pod:197
413 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
414 "the file called C<\"etc/passwd\"> then you could do:"
418 #: ../src/guestfs.pod:200
421 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
426 #: ../src/guestfs.pod:202
428 "This would return C<data> as a newly allocated buffer containing the full "
429 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
430 "or C<NULL> if there was an error."
434 #: ../src/guestfs.pod:206
436 "As another example, to create a top-level directory on that filesystem "
437 "called C<\"var\"> you would do:"
441 #: ../src/guestfs.pod:209
444 " guestfs_mkdir (g, \"/var\");\n"
449 #: ../src/guestfs.pod:211
450 msgid "To create a symlink you could do:"
454 #: ../src/guestfs.pod:213
457 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
458 " \"/etc/rc3.d/S30portmap\");\n"
463 #: ../src/guestfs.pod:216
465 "Libguestfs will reject attempts to use relative paths and there is no "
466 "concept of a current working directory."
470 #: ../src/guestfs.pod:219
472 "Libguestfs can return errors in many situations: for example if the "
473 "filesystem isn't writable, or if a file or directory that you requested "
474 "doesn't exist. If you are using the C API (documented here) you have to "
475 "check for those error conditions after each call. (Other language bindings "
476 "turn these errors into exceptions)."
480 #: ../src/guestfs.pod:225
482 "File writes are affected by the per-handle umask, set by calling "
483 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
487 #: ../src/guestfs.pod:228
492 #: ../src/guestfs.pod:230
494 "Libguestfs contains API calls to read, create and modify partition tables on "
499 #: ../src/guestfs.pod:233
501 "In the common case where you want to create a single partition covering the "
502 "whole disk, you should use the L</guestfs_part_disk> call:"
506 #: ../src/guestfs.pod:237
509 " const char *parttype = \"mbr\";\n"
510 " if (disk_is_larger_than_2TB)\n"
511 " parttype = \"gpt\";\n"
512 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
517 #: ../src/guestfs.pod:242
519 "Obviously this effectively wipes anything that was on that disk image "
524 #: ../src/guestfs.pod:245
529 #: ../src/guestfs.pod:247
531 "Libguestfs provides access to a large part of the LVM2 API, such as "
532 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
533 "unless you familiarize yourself with the concepts of physical volumes, "
534 "volume groups and logical volumes."
538 #: ../src/guestfs.pod:252
540 "This author strongly recommends reading the LVM HOWTO, online at "
541 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
545 #: ../src/guestfs.pod:255
550 #: ../src/guestfs.pod:257
552 "Use L</guestfs_cat> to download small, text only files. This call is "
553 "limited to files which are less than 2 MB and which cannot contain any ASCII "
554 "NUL (C<\\0>) characters. However it has a very simple to use API."
558 #: ../src/guestfs.pod:262
560 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
561 "bit data, since it returns a (pointer, size) pair. However it is still "
562 "limited to \"small\" files, less than 2 MB."
566 #: ../src/guestfs.pod:266
568 "L</guestfs_download> can be used to download any file, with no limits on "
569 "content or size (even files larger than 4 GB)."
573 #: ../src/guestfs.pod:269
574 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
578 #: ../src/guestfs.pod:272
583 #: ../src/guestfs.pod:274
585 "It's often the case that you want to write a file or files to the disk "
590 #: ../src/guestfs.pod:277
592 "To write a small file with fixed content, use L</guestfs_write>. To create "
593 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
594 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
595 "variety of other functions for creating test files, for example "
596 "L</guestfs_fill> and L</guestfs_fill_pattern>."
600 #: ../src/guestfs.pod:283
602 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
603 "file content or size (even files larger than 4 GB)."
607 #: ../src/guestfs.pod:286
608 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
612 #: ../src/guestfs.pod:288
614 "However the fastest way to upload I<large numbers of arbitrary files> is to "
615 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
616 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
617 "the drive in a predictable way (eg. adding it last after all other drives) "
618 "then you can get the device name from L</guestfs_list_devices> and mount it "
619 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
620 "sometimes non-portable between kernel versions, and they don't support "
621 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
622 "using a label or UUID, use an ISO image instead."
626 #: ../src/guestfs.pod:299
631 #: ../src/guestfs.pod:301
633 "There are various different commands for copying between files and devices "
634 "and in and out of the guest filesystem. These are summarised in the table "
639 #: ../src/guestfs.pod:307
640 msgid "B<file> to B<file>"
644 #: ../src/guestfs.pod:309
646 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
647 "directories recursively."
651 #: ../src/guestfs.pod:312
652 msgid "B<file or device> to B<file or device>"
656 #: ../src/guestfs.pod:314
658 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
659 "devices in the guest."
663 #: ../src/guestfs.pod:317
664 msgid "Example: duplicate the contents of an LV:"
668 #: ../src/guestfs.pod:319
671 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
676 #: ../src/guestfs.pod:321
678 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
679 "(C</dev/VG/Original>). To copy less than the whole source device, use "
680 "L</guestfs_copy_size>."
684 #: ../src/guestfs.pod:325
685 msgid "B<file on the host> to B<file or device>"
689 #: ../src/guestfs.pod:327
690 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
694 #: ../src/guestfs.pod:329
695 msgid "B<file or device> to B<file on the host>"
699 #: ../src/guestfs.pod:331
700 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
704 #: ../src/guestfs.pod:335
705 msgid "LISTING FILES"
709 #: ../src/guestfs.pod:337
711 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
712 "L<guestfish(1)>-equivalent command C<ll>)."
716 #: ../src/guestfs.pod:340
718 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
719 "programs, as a flat list of strings."
723 #: ../src/guestfs.pod:343
725 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
726 "directory, plus additional information about each one. It is more "
727 "equivalent to using the L<readdir(3)> call on a local filesystem."
731 #: ../src/guestfs.pod:347
733 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
738 #: ../src/guestfs.pod:350
739 msgid "RUNNING COMMANDS"
743 #: ../src/guestfs.pod:352
745 "Although libguestfs is primarily an API for manipulating files inside guest "
746 "images, we also provide some limited facilities for running commands inside "
751 #: ../src/guestfs.pod:356
752 msgid "There are many limitations to this:"
756 #: ../src/guestfs.pod:360 ../src/guestfs.pod:365 ../src/guestfs.pod:370 ../src/guestfs.pod:374 ../src/guestfs.pod:379 ../src/guestfs.pod:383 ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:1224 ../src/guestfs.pod:1229 ../src/guestfs.pod:1233 ../src/guestfs.pod:1449 ../src/guestfs.pod:1454 ../src/guestfs.pod:1458 ../src/guestfs.pod:1560 ../src/guestfs.pod:1564 ../src/guestfs.pod:1568 ../src/guestfs.pod:1573 ../src/guestfs.pod:1581 ../src/guestfs.pod:1600 ../src/guestfs.pod:1608 ../src/guestfs.pod:1838 ../src/guestfs.pod:1844 ../src/guestfs.pod:1849 ../src/guestfs.pod:1855 ../src/guestfs.pod:1962 ../src/guestfs.pod:1966 ../src/guestfs.pod:1970 ../src/guestfs.pod:1974 ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:569 ../src/guestfs-actions.pod:577 ../src/guestfs-actions.pod:584 ../src/guestfs-actions.pod:591 ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:1591 ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1599 ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1771 ../src/guestfs-actions.pod:1775 ../src/guestfs-actions.pod:1780 ../src/guestfs-actions.pod:1785 ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:1850 ../src/guestfs-actions.pod:1855 ../fish/guestfish.pod:376 ../fish/guestfish.pod:380 ../fish/guestfish.pod:384 ../fish/guestfish.pod:388 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:375 ../fish/guestfish-actions.pod:383 ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:397 ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1071 ../fish/guestfish-actions.pod:1075 ../fish/guestfish-actions.pod:1079 ../fish/guestfish-actions.pod:1087 ../fish/guestfish-actions.pod:1091 ../fish/guestfish-actions.pod:1095 ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1109 ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1203 ../fish/guestfish-actions.pod:1207 ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1259 ../fish/guestfish-actions.pod:1263 ../fish/guestfish-actions.pod:1268 ../inspector/virt-inspector.pl:584 ../inspector/virt-inspector.pl:588 ../tools/virt-df.pl:161 ../tools/virt-df.pl:167 ../tools/virt-resize.pl:348 ../tools/virt-resize.pl:353 ../tools/virt-resize.pl:363
761 #: ../src/guestfs.pod:362
763 "The kernel version that the command runs under will be different from what "
768 #: ../src/guestfs.pod:367
770 "If the command needs to communicate with daemons, then most likely they "
775 #: ../src/guestfs.pod:372
776 msgid "The command will be running in limited memory."
780 #: ../src/guestfs.pod:376
782 "The network may not be available unless you enable it (see "
783 "L</guestfs_set_network>)."
787 #: ../src/guestfs.pod:381
788 msgid "Only supports Linux guests (not Windows, BSD, etc)."
792 #: ../src/guestfs.pod:385
793 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
797 #: ../src/guestfs.pod:390
799 "For SELinux guests, you may need to enable SELinux and load policy first. "
800 "See L</SELINUX> in this manpage."
804 #: ../src/guestfs.pod:395
806 "I<Security:> It is not safe to run commands from untrusted, possibly "
807 "malicious guests. These commands may attempt to exploit your program by "
808 "sending unexpected output. They could also try to exploit the Linux kernel "
809 "or qemu provided by the libguestfs appliance. They could use the network "
810 "provided by the libguestfs appliance to bypass ordinary network partitions "
811 "and firewalls. They could use the elevated privileges or different SELinux "
812 "context of your program to their advantage."
816 #: ../src/guestfs.pod:404
818 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
819 "(a script which runs when the guest next boots normally), and to have this "
820 "script run the commands you want in the normal context of the running guest, "
821 "network security and so on."
825 #: ../src/guestfs.pod:411
827 "The two main API calls to run commands are L</guestfs_command> and "
828 "L</guestfs_sh> (there are also variations)."
832 #: ../src/guestfs.pod:414
834 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
835 "shell globs, redirections, etc will work."
839 #: ../src/guestfs.pod:417
840 msgid "CONFIGURATION FILES"
844 #: ../src/guestfs.pod:419
846 "To read and write configuration files in Linux guest filesystems, we "
847 "strongly recommend using Augeas. For example, Augeas understands how to "
848 "read and write, say, a Linux shadow password file or X.org configuration "
849 "file, and so avoids you having to write that code."
853 #: ../src/guestfs.pod:424
855 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
856 "document Augeas itself here because there is excellent documentation on the "
857 "L<http://augeas.net/> website."
861 #: ../src/guestfs.pod:428
863 "If you don't want to use Augeas (you fool!) then try calling "
864 "L</guestfs_read_lines> to get the file as a list of lines which you can "
869 #: ../src/guestfs.pod:432
874 #: ../src/guestfs.pod:434
876 "We support SELinux guests. To ensure that labeling happens correctly in "
877 "SELinux guests, you need to enable SELinux and load the guest's policy:"
881 #: ../src/guestfs.pod:440 ../src/guestfs.pod:953
886 #: ../src/guestfs.pod:442
887 msgid "Before launching, do:"
891 #: ../src/guestfs.pod:444
894 " guestfs_set_selinux (g, 1);\n"
899 #: ../src/guestfs.pod:446 ../src/guestfs.pod:957
904 #: ../src/guestfs.pod:448
906 "After mounting the guest's filesystem(s), load the policy. This is best "
907 "done by running the L<load_policy(8)> command in the guest itself:"
911 #: ../src/guestfs.pod:452
914 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
919 #: ../src/guestfs.pod:454
921 "(Older versions of C<load_policy> require you to specify the name of the "
926 #: ../src/guestfs.pod:457 ../src/guestfs.pod:963
931 #: ../src/guestfs.pod:459
933 "Optionally, set the security context for the API. The correct security "
934 "context to use can only be known by inspecting the guest. As an example:"
938 #: ../src/guestfs.pod:463
941 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
946 #: ../src/guestfs.pod:467
947 msgid "This will work for running commands and editing existing files."
951 #: ../src/guestfs.pod:469
953 "When new files are created, you may need to label them explicitly, for "
954 "example by running the external command C<restorecon pathname>."
958 #: ../src/guestfs.pod:473
963 #: ../src/guestfs.pod:475
965 "Certain calls are affected by the current file mode creation mask (the "
966 "\"umask\"). In particular ones which create files or directories, such as "
967 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
968 "either the default mode that the file is created with or modifies the mode "
973 #: ../src/guestfs.pod:481
975 "The default umask is C<022>, so files are created with modes such as C<0644> "
976 "and directories with C<0755>."
980 #: ../src/guestfs.pod:484
982 "There are two ways to avoid being affected by umask. Either set umask to 0 "
983 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
984 "L</guestfs_chmod> after creating each file or directory."
988 #: ../src/guestfs.pod:488
989 msgid "For more information about umask, see L<umask(2)>."
993 #: ../src/guestfs.pod:490 ../fish/guestfish.pod:669
994 msgid "ENCRYPTED DISKS"
998 #: ../src/guestfs.pod:492
1000 "Libguestfs allows you to access Linux guests which have been encrypted using "
1001 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1002 "standard. This includes nearly all whole disk encryption systems used by "
1003 "modern Linux guests."
1007 #: ../src/guestfs.pod:498
1009 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1010 "returns the string C<crypto_LUKS>)."
1014 #: ../src/guestfs.pod:501
1016 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1017 "will require the passphrase!"
1021 #: ../src/guestfs.pod:504
1023 "Opening a LUKS device creates a new device mapper device called "
1024 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
1025 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
1026 "decrypted from and encrypted to the underlying block device respectively."
1030 #: ../src/guestfs.pod:510
1032 "LVM volume groups on the device can be made visible by calling "
1033 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
1034 "volume(s) can now be mounted in the usual way."
1038 #: ../src/guestfs.pod:514
1040 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1041 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1042 "[\"/dev/VG\"])>. Then close the mapper device by calling "
1043 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1044 "underlying encrypted block device)."
1048 #: ../src/guestfs.pod:521
1053 #: ../src/guestfs.pod:523
1055 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1056 "contains operating systems. (These APIs used to be in a separate Perl-only "
1057 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1058 "frequently used part of this library has been rewritten in C and moved into "
1063 #: ../src/guestfs.pod:529
1065 "Add all disks belonging to the unknown virtual machine and call "
1066 "L</guestfs_launch> in the usual way."
1070 #: ../src/guestfs.pod:532
1072 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1073 "and certain heuristics, and returns a list of operating systems that were "
1074 "found. An empty list means none were found. A single element is the root "
1075 "filesystem of the operating system. For dual- or multi-boot guests, "
1076 "multiple roots can be returned, each one corresponding to a separate "
1077 "operating system. (Multi-boot virtual machines are extremely rare in the "
1078 "world of virtualization, but since this scenario can happen, we have built "
1079 "libguestfs to deal with it.)"
1083 #: ../src/guestfs.pod:541
1085 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1086 "to get additional details about that operating system. For example, call "
1087 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1088 "Windows and Linux-based operating systems respectively."
1092 #: ../src/guestfs.pod:547
1094 "Un*x-like and Linux-based operating systems usually consist of several "
1095 "filesystems which are mounted at boot time (for example, a separate boot "
1096 "partition mounted on C</boot>). The inspection rules are able to detect how "
1097 "filesystems correspond to mount points. Call "
1098 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1099 "hash table like this example:"
1103 #: ../src/guestfs.pod:554
1106 " /boot => /dev/sda1\n"
1107 " / => /dev/vg_guest/lv_root\n"
1108 " /usr => /dev/vg_guest/lv_usr\n"
1113 #: ../src/guestfs.pod:558
1115 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1116 "filesystems as suggested."
1120 #: ../src/guestfs.pod:561
1122 "Be careful to mount filesystems in the right order (eg. C</> before "
1123 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1128 #: ../src/guestfs.pod:565
1130 "Inspection currently only works for some common operating systems. "
1131 "Contributors are welcome to send patches for other operating systems that we "
1132 "currently cannot detect."
1136 #: ../src/guestfs.pod:569
1138 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1139 "for more details. The L</guestfs_inspect_os> function just ignores any "
1140 "encrypted devices."
1144 #: ../src/guestfs.pod:573
1146 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1147 "inspection and caches the results in the guest handle. Subsequent calls to "
1148 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1149 "re-read the disks. If you change the content of the guest disks, you can "
1150 "redo inspection by calling L</guestfs_inspect_os> again."
1154 #: ../src/guestfs.pod:580
1155 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1159 #: ../src/guestfs.pod:582
1161 "Libguestfs can mount NTFS partitions. It does this using the "
1162 "L<http://www.ntfs-3g.org/> driver."
1166 #: ../src/guestfs.pod:585
1168 "DOS and Windows still use drive letters, and the filesystems are always "
1169 "treated as case insensitive by Windows itself, and therefore you might find "
1170 "a Windows configuration file referring to a path like "
1171 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1172 "that directory might be referred to as C</WINDOWS/System32>."
1176 #: ../src/guestfs.pod:591
1178 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1179 "libguestfs to read the appropriate Windows Registry and configuration files, "
1180 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1181 "L<virt-inspector(1)>)."
1185 #: ../src/guestfs.pod:596
1187 "Replacing backslash characters with forward slash characters is also outside "
1188 "the scope of libguestfs, but something that you can easily do."
1192 #: ../src/guestfs.pod:599
1194 "Where we can help is in resolving the case insensitivity of paths. For "
1195 "this, call L</guestfs_case_sensitive_path>."
1199 #: ../src/guestfs.pod:602
1201 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1202 "files, through the library C<hivex> which is part of the libguestfs project "
1203 "although ships as a separate tarball. You have to locate and download the "
1204 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1205 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1206 "L<virt-win-reg(1)> for more help on this issue."
1210 #: ../src/guestfs.pod:610
1211 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1215 #: ../src/guestfs.pod:612
1217 "Although we don't want to discourage you from using the C API, we will "
1218 "mention here that the same API is also available in other languages."
1222 #: ../src/guestfs.pod:615
1224 "The API is broadly identical in all supported languages. This means that "
1225 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, "
1226 "C<g.mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1227 "words, a straightforward, predictable isomorphism between each language."
1231 #: ../src/guestfs.pod:621
1233 "Error messages are automatically transformed into exceptions if the language "
1238 #: ../src/guestfs.pod:624
1240 "We don't try to \"object orientify\" parts of the API in OO languages, "
1241 "although contributors are welcome to write higher level APIs above what we "
1242 "provide in their favourite languages if they wish."
1246 #: ../src/guestfs.pod:630
1251 #: ../src/guestfs.pod:632
1253 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1254 "identical to the C API. C++ classes and exceptions are not used."
1258 #: ../src/guestfs.pod:636
1263 #: ../src/guestfs.pod:638
1265 "The C# bindings are highly experimental. Please read the warnings at the "
1266 "top of C<csharp/Libguestfs.cs>."
1270 #: ../src/guestfs.pod:641
1275 #: ../src/guestfs.pod:643
1277 "This is the only language binding that is working but incomplete. Only "
1278 "calls which return simple integers have been bound in Haskell, and we are "
1279 "looking for help to complete this binding."
1283 #: ../src/guestfs.pod:647
1288 #: ../src/guestfs.pod:649
1290 "Full documentation is contained in the Javadoc which is distributed with "
1295 #: ../src/guestfs.pod:652
1300 #: ../src/guestfs.pod:654
1301 msgid "For documentation see the file C<guestfs.mli>."
1305 #: ../src/guestfs.pod:656
1310 #: ../src/guestfs.pod:658
1311 msgid "For documentation see L<Sys::Guestfs(3)>."
1315 #: ../src/guestfs.pod:660
1320 #: ../src/guestfs.pod:662
1322 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1323 "the php-libguestfs package for your distribution."
1327 #: ../src/guestfs.pod:665
1328 msgid "The PHP binding only works correctly on 64 bit machines."
1332 #: ../src/guestfs.pod:667
1337 #: ../src/guestfs.pod:669
1338 msgid "For documentation do:"
1342 #: ../src/guestfs.pod:671
1346 " >>> import guestfs\n"
1347 " >>> help (guestfs)\n"
1352 #: ../src/guestfs.pod:675
1357 #: ../src/guestfs.pod:677
1359 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1360 "can find examples written in Ruby in the libguestfs source."
1364 #: ../src/guestfs.pod:680
1365 msgid "B<shell scripts>"
1369 #: ../src/guestfs.pod:682
1370 msgid "For documentation see L<guestfish(1)>."
1374 #: ../src/guestfs.pod:686
1375 msgid "LIBGUESTFS GOTCHAS"
1379 #: ../src/guestfs.pod:688
1381 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1382 "system [...] that works in the way it is documented but is counterintuitive "
1383 "and almost invites mistakes.\""
1387 #: ../src/guestfs.pod:692
1389 "Since we developed libguestfs and the associated tools, there are several "
1390 "things we would have designed differently, but are now stuck with for "
1391 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1392 "release, you can expect these to change. Beware of them."
1396 #: ../src/guestfs.pod:700
1397 msgid "Autosync / forgetting to sync."
1401 #: ../src/guestfs.pod:702
1403 "When modifying a filesystem from C or another language, you B<must> unmount "
1404 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1405 "libguestfs handle. You can also call:"
1409 #: ../src/guestfs.pod:706
1412 " guestfs_set_autosync (g, 1);\n"
1417 #: ../src/guestfs.pod:708
1419 "to have the unmount/sync done automatically for you when the handle 'g' is "
1420 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1425 #: ../src/guestfs.pod:712
1427 "If you forget to do this, then it is entirely possible that your changes "
1428 "won't be written out, or will be partially written, or (very rarely) that "
1429 "you'll get disk corruption."
1433 #: ../src/guestfs.pod:716
1435 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1436 "guestfish scripts that forget to sync will work just fine, which can make "
1437 "this very puzzling if you are trying to debug a problem."
1441 #: ../src/guestfs.pod:720
1443 "Update: Autosync is enabled by default for all API users starting from "
1444 "libguestfs 1.5.24."
1448 #: ../src/guestfs.pod:723
1449 msgid "Mount option C<-o sync> should not be the default."
1453 #: ../src/guestfs.pod:725
1455 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1456 "However C<-o sync> does not add any reliability benefit, but does have a "
1457 "very large performance impact."
1461 #: ../src/guestfs.pod:729
1463 "The work around is to use L</guestfs_mount_options> and set the mount "
1464 "options that you actually want to use."
1468 #: ../src/guestfs.pod:732
1469 msgid "Read-only should be the default."
1473 #: ../src/guestfs.pod:734
1475 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1476 "specify I<--rw> if you want to make changes to the image."
1480 #: ../src/guestfs.pod:737
1481 msgid "This would reduce the potential to corrupt live VM images."
1485 #: ../src/guestfs.pod:739
1487 "Note that many filesystems change the disk when you just mount and unmount, "
1488 "even if you didn't perform any writes. You need to use "
1489 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1493 #: ../src/guestfs.pod:743
1494 msgid "guestfish command line is hard to use."
1498 #: ../src/guestfs.pod:745
1500 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1501 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1502 "exist, so it fails. In earlier versions of guestfish the error message was "
1503 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1504 "we should have used C<guestfish -c command> to run commands."
1508 #: ../src/guestfs.pod:752
1509 msgid "guestfish megabyte modifiers don't work right on all commands"
1513 #: ../src/guestfs.pod:754
1515 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1516 "other modifiers). What guestfish actually does is to multiply the number "
1517 "part by the modifier part and pass the result to the C API. However this "
1518 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1519 "expecting some other unit (eg. megabytes)."
1523 #: ../src/guestfs.pod:761
1524 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1528 #: ../src/guestfs.pod:763
1531 " lvcreate LV VG 100M\n"
1536 #: ../src/guestfs.pod:765
1538 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1539 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1540 "megabytes * megabytes) logical volume. The error message you get from this "
1541 "is also a little obscure."
1545 #: ../src/guestfs.pod:770
1547 "This could be fixed in the generator by specially marking parameters and "
1548 "return values which take bytes or other units."
1552 #: ../src/guestfs.pod:773
1553 msgid "Ambiguity between devices and paths"
1557 #: ../src/guestfs.pod:775
1559 "There is a subtle ambiguity in the API between a device name "
1560 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1561 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1565 #: ../src/guestfs.pod:780
1567 "In the current API we usually resolve this ambiguity by having two separate "
1568 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1569 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1570 "detecting if the path supplied begins with C</dev/>."
1574 #: ../src/guestfs.pod:786
1576 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1577 "make paths/devices into structured names. One way to do this would be to "
1578 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1579 "aspect of grub. Another way would be to use a structured type, equivalent "
1580 "to this OCaml type:"
1584 #: ../src/guestfs.pod:792
1587 " type path = Path of string | Device of int | Partition of int * int\n"
1592 #: ../src/guestfs.pod:794
1593 msgid "which would allow you to pass arguments like:"
1597 #: ../src/guestfs.pod:796
1600 " Path \"/foo/bar\"\n"
1601 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1602 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1603 " Path \"/dev/sdb2\" (* not a device *)\n"
1608 #: ../src/guestfs.pod:801
1610 "As you can see there are still problems to resolve even with this "
1611 "representation. Also consider how it might work in guestfish."
1615 #: ../src/guestfs.pod:806
1616 msgid "PROTOCOL LIMITS"
1620 #: ../src/guestfs.pod:808
1622 "Internally libguestfs uses a message-based protocol to pass API calls and "
1623 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1624 "plenty more detail about this). The maximum message size used by the "
1625 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1626 "aware of this limit. The API calls which may be affected are individually "
1627 "documented, with a link back to this section of the documentation."
1631 #: ../src/guestfs.pod:816
1633 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1634 "a simple string. Because this string is at some point internally encoded as "
1635 "a message, the maximum size that it can return is slightly under 4 MB. If "
1636 "the requested file is larger than this then you will get an error."
1640 #: ../src/guestfs.pod:822
1642 "In order to transfer large files into and out of the guest filesystem, you "
1643 "need to use particular calls that support this. The sections L</UPLOADING> "
1644 "and L</DOWNLOADING> document how to do this."
1648 #: ../src/guestfs.pod:826
1650 "You might also consider mounting the disk image using our FUSE filesystem "
1651 "support (L<guestmount(1)>)."
1655 #: ../src/guestfs.pod:829
1656 msgid "KEYS AND PASSPHRASES"
1660 #: ../src/guestfs.pod:831
1662 "Certain libguestfs calls take a parameter that contains sensitive key "
1663 "material, passed in as a C string."
1667 #: ../src/guestfs.pod:834
1669 "In the future we would hope to change the libguestfs implementation so that "
1670 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1671 "swap. However this is I<not> done at the moment, because of the complexity "
1672 "of such an implementation."
1676 #: ../src/guestfs.pod:839
1678 "Therefore you should be aware that any key parameter you pass to libguestfs "
1679 "might end up being written out to the swap partition. If this is a concern, "
1680 "scrub the swap partition or don't use libguestfs on encrypted devices."
1684 #: ../src/guestfs.pod:844
1685 msgid "CONNECTION MANAGEMENT"
1689 #: ../src/guestfs.pod:846
1694 #: ../src/guestfs.pod:848
1696 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1697 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1698 "handle and release all resources used."
1702 #: ../src/guestfs.pod:852
1704 "For information on using multiple handles and threads, see the section "
1705 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1709 #: ../src/guestfs.pod:855
1710 msgid "guestfs_create"
1714 #: ../src/guestfs.pod:857
1717 " guestfs_h *guestfs_create (void);\n"
1722 #: ../src/guestfs.pod:859
1723 msgid "Create a connection handle."
1727 #: ../src/guestfs.pod:861
1729 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
1730 "on the handle at least once."
1734 #: ../src/guestfs.pod:864
1736 "This function returns a non-NULL pointer to a handle on success or NULL on "
1741 #: ../src/guestfs.pod:867
1742 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1746 #: ../src/guestfs.pod:869
1748 "You may also want to configure error handling for the handle. See L</ERROR "
1749 "HANDLING> section below."
1753 #: ../src/guestfs.pod:872
1754 msgid "guestfs_close"
1758 #: ../src/guestfs.pod:874
1761 " void guestfs_close (guestfs_h *g);\n"
1766 #: ../src/guestfs.pod:876
1767 msgid "This closes the connection handle and frees up all resources used."
1771 #: ../src/guestfs.pod:878
1772 msgid "ERROR HANDLING"
1776 #: ../src/guestfs.pod:880
1778 "API functions can return errors. For example, almost all functions that "
1779 "return C<int> will return C<-1> to indicate an error."
1783 #: ../src/guestfs.pod:883
1785 "Additional information is available for errors: an error message string and "
1786 "optionally an error number (errno) if the thing that failed was a system "
1791 #: ../src/guestfs.pod:887
1793 "You can get at the additional information about the last error on the handle "
1794 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
1795 "up an error handler with L</guestfs_set_error_handler>."
1799 #: ../src/guestfs.pod:892
1801 "When the handle is created, a default error handler is installed which "
1802 "prints the error message string to C<stderr>. For small short-running "
1803 "command line programs it is sufficient to do:"
1807 #: ../src/guestfs.pod:896
1810 " if (guestfs_launch (g) == -1)\n"
1811 " exit (EXIT_FAILURE);\n"
1816 #: ../src/guestfs.pod:899
1818 "since the default error handler will ensure that an error message has been "
1819 "printed to C<stderr> before the program exits."
1823 #: ../src/guestfs.pod:902
1825 "For other programs the caller will almost certainly want to install an "
1826 "alternate error handler or do error handling in-line like this:"
1830 #: ../src/guestfs.pod:905
1833 " g = guestfs_create ();\n"
1838 #: ../src/guestfs.pod:907
1841 " /* This disables the default behaviour of printing errors\n"
1843 " guestfs_set_error_handler (g, NULL, NULL);\n"
1848 #: ../src/guestfs.pod:911
1851 " if (guestfs_launch (g) == -1) {\n"
1852 " /* Examine the error message and print it etc. */\n"
1853 " char *msg = guestfs_last_error (g);\n"
1854 " int errnum = guestfs_last_errno (g);\n"
1855 " fprintf (stderr, \"%s\\n\", msg);\n"
1862 #: ../src/guestfs.pod:919
1864 "Out of memory errors are handled differently. The default action is to call "
1865 "L<abort(3)>. If this is undesirable, then you can set a handler using "
1866 "L</guestfs_set_out_of_memory_handler>."
1870 #: ../src/guestfs.pod:923
1872 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
1873 "because there is no handle if this happens there is no way to get additional "
1874 "error information. However L</guestfs_create> is supposed to be a "
1875 "lightweight operation which can only fail because of insufficient memory (it "
1876 "returns NULL in this case)."
1880 #: ../src/guestfs.pod:929
1881 msgid "guestfs_last_error"
1885 #: ../src/guestfs.pod:931
1888 " const char *guestfs_last_error (guestfs_h *g);\n"
1893 #: ../src/guestfs.pod:933
1895 "This returns the last error message that happened on C<g>. If there has not "
1896 "been an error since the handle was created, then this returns C<NULL>."
1900 #: ../src/guestfs.pod:937
1902 "The lifetime of the returned string is until the next error occurs, or "
1903 "L</guestfs_close> is called."
1907 #: ../src/guestfs.pod:940
1908 msgid "guestfs_last_errno"
1912 #: ../src/guestfs.pod:942
1915 " int guestfs_last_errno (guestfs_h *g);\n"
1920 #: ../src/guestfs.pod:944
1921 msgid "This returns the last error number (errno) that happened on C<g>."
1925 #: ../src/guestfs.pod:946
1926 msgid "If successful, an errno integer not equal to zero is returned."
1930 #: ../src/guestfs.pod:948
1931 msgid "If no error, this returns 0. This call can return 0 in three situations:"
1935 #: ../src/guestfs.pod:955
1936 msgid "There has not been any error on the handle."
1940 #: ../src/guestfs.pod:959
1942 "There has been an error but the errno was meaningless. This corresponds to "
1943 "the case where the error did not come from a failed system call, but for "
1944 "some other reason."
1948 #: ../src/guestfs.pod:965
1950 "There was an error from a failed system call, but for some reason the errno "
1951 "was not captured and returned. This usually indicates a bug in libguestfs."
1955 #: ../src/guestfs.pod:971
1957 "Libguestfs tries to convert the errno from inside the applicance into a "
1958 "corresponding errno for the caller (not entirely trivial: the appliance "
1959 "might be running a completely different operating system from the library "
1960 "and error numbers are not standardized across Un*xen). If this could not be "
1961 "done, then the error is translated to C<EINVAL>. In practice this should "
1962 "only happen in very rare circumstances."
1966 #: ../src/guestfs.pod:979
1967 msgid "guestfs_set_error_handler"
1971 #: ../src/guestfs.pod:981
1974 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1976 " const char *msg);\n"
1977 " void guestfs_set_error_handler (guestfs_h *g,\n"
1978 " guestfs_error_handler_cb cb,\n"
1984 #: ../src/guestfs.pod:988
1986 "The callback C<cb> will be called if there is an error. The parameters "
1987 "passed to the callback are an opaque data pointer and the error message "
1992 #: ../src/guestfs.pod:992
1994 "C<errno> is not passed to the callback. To get that the callback must call "
1995 "L</guestfs_last_errno>."
1999 #: ../src/guestfs.pod:995
2001 "Note that the message string C<msg> is freed as soon as the callback "
2002 "function returns, so if you want to stash it somewhere you must make your "
2007 #: ../src/guestfs.pod:999
2008 msgid "The default handler prints messages on C<stderr>."
2012 #: ../src/guestfs.pod:1001
2013 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2017 #: ../src/guestfs.pod:1003
2018 msgid "guestfs_get_error_handler"
2022 #: ../src/guestfs.pod:1005
2025 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2026 " void **opaque_rtn);\n"
2031 #: ../src/guestfs.pod:1008
2032 msgid "Returns the current error handler callback."
2036 #: ../src/guestfs.pod:1010
2037 msgid "guestfs_set_out_of_memory_handler"
2041 #: ../src/guestfs.pod:1012
2044 " typedef void (*guestfs_abort_cb) (void);\n"
2045 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2046 " guestfs_abort_cb);\n"
2051 #: ../src/guestfs.pod:1016
2053 "The callback C<cb> will be called if there is an out of memory situation. "
2054 "I<Note this callback must not return>."
2058 #: ../src/guestfs.pod:1019
2059 msgid "The default is to call L<abort(3)>."
2063 #: ../src/guestfs.pod:1021
2064 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2068 #: ../src/guestfs.pod:1024
2069 msgid "guestfs_get_out_of_memory_handler"
2073 #: ../src/guestfs.pod:1026
2076 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2081 #: ../src/guestfs.pod:1028
2082 msgid "This returns the current out of memory handler."
2086 #: ../src/guestfs.pod:1030
2091 #: ../src/guestfs.pod:1032
2093 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
2098 #: ../src/guestfs.pod:1035
2100 "By default it looks for these in the directory C<$libdir/guestfs> "
2101 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
2105 #: ../src/guestfs.pod:1038
2107 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
2108 "to change the directories that libguestfs will search in. The value is a "
2109 "colon-separated list of paths. The current directory is I<not> searched "
2110 "unless the path contains an empty element or C<.>. For example "
2111 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
2112 "then C</usr/lib/guestfs>."
2116 #: ../src/guestfs.pod:1045
2117 msgid "HIGH-LEVEL API ACTIONS"
2121 #: ../src/guestfs.pod:1047
2122 msgid "ABI GUARANTEE"
2126 #: ../src/guestfs.pod:1049
2128 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2129 "actions as outlined in this section. Although we will deprecate some "
2130 "actions, for example if they get replaced by newer calls, we will keep the "
2131 "old actions forever. This allows you the developer to program in confidence "
2132 "against the libguestfs API."
2136 #: ../src/guestfs.pod:1055 ../fish/guestfish.pod:907
2141 #: ../src/guestfs.pod:1057
2146 #: ../src/guestfs.pod:1059
2151 #: ../src/guestfs.pod:1061
2152 msgid "AVAILABILITY"
2156 #: ../src/guestfs.pod:1063
2157 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2161 #: ../src/guestfs.pod:1065
2163 "Using L</guestfs_available> you can test availability of the following "
2164 "groups of functions. This test queries the appliance to see if the "
2165 "appliance you are currently using supports the functionality."
2169 #: ../src/guestfs.pod:1070
2170 msgid "@AVAILABILITY@"
2174 #: ../src/guestfs.pod:1072
2175 msgid "GUESTFISH supported COMMAND"
2179 #: ../src/guestfs.pod:1074
2181 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2182 "prints out the available groups and whether they are supported by this build "
2183 "of libguestfs. Note however that you have to do C<run> first."
2187 #: ../src/guestfs.pod:1079
2188 msgid "SINGLE CALLS AT COMPILE TIME"
2192 #: ../src/guestfs.pod:1081
2194 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2195 "function, such as:"
2199 #: ../src/guestfs.pod:1084
2202 " #define LIBGUESTFS_HAVE_DD 1\n"
2207 #: ../src/guestfs.pod:1086
2208 msgid "if L</guestfs_dd> is available."
2212 #: ../src/guestfs.pod:1088
2214 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2215 "function is available at compile time, we recommended using build tools such "
2216 "as autoconf or cmake. For example in autotools you could use:"
2220 #: ../src/guestfs.pod:1093
2223 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2224 " AC_CHECK_FUNCS([guestfs_dd])\n"
2229 #: ../src/guestfs.pod:1096
2231 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2236 #: ../src/guestfs.pod:1099
2237 msgid "SINGLE CALLS AT RUN TIME"
2241 #: ../src/guestfs.pod:1101
2243 "Testing at compile time doesn't guarantee that a function really exists in "
2244 "the library. The reason is that you might be dynamically linked against a "
2245 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2246 "This situation unfortunately results in a segmentation fault, which is a "
2247 "shortcoming of the C dynamic linking system itself."
2251 #: ../src/guestfs.pod:1108
2253 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2254 "in this example program (note that you still need the compile time check as "
2259 #: ../src/guestfs.pod:1112
2262 " #include <stdio.h>\n"
2263 " #include <stdlib.h>\n"
2264 " #include <unistd.h>\n"
2265 " #include <dlfcn.h>\n"
2266 " #include <guestfs.h>\n"
2271 #: ../src/guestfs.pod:1118
2276 " #ifdef LIBGUESTFS_HAVE_DD\n"
2278 " int has_function;\n"
2283 #: ../src/guestfs.pod:1124
2286 " /* Test if the function guestfs_dd is really available. */\n"
2287 " dl = dlopen (NULL, RTLD_LAZY);\n"
2289 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2290 " exit (EXIT_FAILURE);\n"
2292 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2298 #: ../src/guestfs.pod:1133
2301 " if (!has_function)\n"
2302 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2304 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2305 " /* Now it's safe to call\n"
2306 " guestfs_dd (g, \"foo\", \"bar\");\n"
2310 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2317 #: ../src/guestfs.pod:1146
2319 "You may think the above is an awful lot of hassle, and it is. There are "
2320 "other ways outside of the C linking system to ensure that this kind of "
2321 "incompatibility never arises, such as using package versioning:"
2325 #: ../src/guestfs.pod:1151
2328 " Requires: libguestfs >= 1.0.80\n"
2333 #: ../src/guestfs.pod:1153
2334 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2338 #: ../src/guestfs.pod:1155
2340 "A recent feature of the API is the introduction of calls which take optional "
2341 "arguments. In C these are declared 3 ways. The main way is as a call which "
2342 "takes variable arguments (ie. C<...>), as in this example:"
2346 #: ../src/guestfs.pod:1160
2349 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2354 #: ../src/guestfs.pod:1162
2356 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2357 "call with no optional arguments specified:"
2361 #: ../src/guestfs.pod:1165
2364 " guestfs_add_drive_opts (g, filename, -1);\n"
2369 #: ../src/guestfs.pod:1167
2370 msgid "With a single optional argument:"
2374 #: ../src/guestfs.pod:1169
2377 " guestfs_add_drive_opts (g, filename,\n"
2378 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2384 #: ../src/guestfs.pod:1173
2389 #: ../src/guestfs.pod:1175
2392 " guestfs_add_drive_opts (g, filename,\n"
2393 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2394 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2400 #: ../src/guestfs.pod:1180
2402 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2407 #: ../src/guestfs.pod:1183
2408 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2412 #: ../src/guestfs.pod:1185
2414 "The second variant has the same name with the suffix C<_va>, which works the "
2415 "same way but takes a C<va_list>. See the C manual for details. For the "
2416 "example function, this is declared:"
2420 #: ../src/guestfs.pod:1189
2423 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2429 #: ../src/guestfs.pod:1192
2430 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2434 #: ../src/guestfs.pod:1194
2436 "The third variant is useful where you need to construct these calls. You "
2437 "pass in a structure where you fill in the optional fields. The structure "
2438 "has a bitmask as the first element which you must set to indicate which "
2439 "fields you have filled in. For our example function the structure and call "
2444 #: ../src/guestfs.pod:1200
2447 " struct guestfs_add_drive_opts_argv {\n"
2448 " uint64_t bitmask;\n"
2450 " const char *format;\n"
2453 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
2454 " const struct guestfs_add_drive_opts_argv *optargs);\n"
2459 #: ../src/guestfs.pod:1209
2460 msgid "You could call it like this:"
2464 #: ../src/guestfs.pod:1211
2467 " struct guestfs_add_drive_opts_argv optargs = {\n"
2468 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
2469 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
2471 " .format = \"qcow2\"\n"
2477 #: ../src/guestfs.pod:1218
2480 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
2485 #: ../src/guestfs.pod:1220 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1255
2490 #: ../src/guestfs.pod:1226
2491 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
2495 #: ../src/guestfs.pod:1231
2496 msgid "You do not need to fill in all fields of the structure."
2500 #: ../src/guestfs.pod:1235
2502 "There must be a one-to-one correspondence between fields of the structure "
2503 "that are filled in, and bits set in the bitmask."
2507 #: ../src/guestfs.pod:1240
2508 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
2512 #: ../src/guestfs.pod:1242
2514 "In other languages, optional arguments are expressed in the way that is "
2515 "natural for that language. We refer you to the language-specific "
2516 "documentation for more details on that."
2520 #: ../src/guestfs.pod:1246
2521 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
2525 #: ../src/guestfs.pod:1248 ../src/guestfs.pod:1253
2530 #: ../src/guestfs.pod:1250
2532 "<!-- old anchor for the next section --> <a "
2533 "name=\"state_machine_and_low_level_event_api\"/>"
2537 #: ../src/guestfs.pod:1255
2538 msgid "ARCHITECTURE"
2542 #: ../src/guestfs.pod:1257
2544 "Internally, libguestfs is implemented by running an appliance (a special "
2545 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2546 "process of the main program."
2550 #: ../src/guestfs.pod:1261
2553 " ___________________\n"
2555 " | main program |\n"
2557 " | | child process / appliance\n"
2558 " | | __________________________\n"
2560 " +-------------------+ RPC | +-----------------+ |\n"
2561 " | libguestfs <--------------------> guestfsd | |\n"
2562 " | | | +-----------------+ |\n"
2563 " \\___________________/ | | Linux kernel | |\n"
2564 " | +--^--------------+ |\n"
2565 " \\_________|________________/\n"
2571 " \\______________/\n"
2576 #: ../src/guestfs.pod:1281
2578 "The library, linked to the main program, creates the child process and hence "
2579 "the appliance in the L</guestfs_launch> function."
2583 #: ../src/guestfs.pod:1284
2585 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2586 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2587 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2588 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2589 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2590 "attached to the qemu process which translates device access by the "
2591 "appliance's Linux kernel into accesses to the image."
2595 #: ../src/guestfs.pod:1293
2597 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2598 "Although the disk image you are attached to might also be used by some "
2599 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2600 "care if both libguestfs's qemu process and your virtual machine are trying "
2601 "to update the disk image at the same time, since these usually results in "
2602 "massive disk corruption)."
2606 #: ../src/guestfs.pod:1300
2607 msgid "STATE MACHINE"
2611 #: ../src/guestfs.pod:1302
2612 msgid "libguestfs uses a state machine to model the child process:"
2616 #: ../src/guestfs.pod:1304
2628 " / | \\ \\ guestfs_launch\n"
2629 " / | _\\__V______\n"
2631 " / | | LAUNCHING |\n"
2632 " / | \\___________/\n"
2634 " / | guestfs_launch\n"
2636 " ______ / __|____V\n"
2637 " / \\ ------> / \\\n"
2638 " | BUSY | | READY |\n"
2639 " \\______/ <------ \\________/\n"
2644 #: ../src/guestfs.pod:1326
2646 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2647 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2648 "(3) alternating between READY and BUSY as commands are issued to, and "
2649 "carried out by, the child process."
2653 #: ../src/guestfs.pod:1331
2655 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2656 "asynchronously at any time (eg. due to some internal error), and that causes "
2657 "the state to transition back to CONFIG."
2661 #: ../src/guestfs.pod:1335
2663 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2664 "issued when in the CONFIG state."
2668 #: ../src/guestfs.pod:1338
2670 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2671 "L</guestfs_launch> blocks until the child process is READY to accept "
2672 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2673 "moves the state from CONFIG to LAUNCHING while it is running."
2677 #: ../src/guestfs.pod:1344
2679 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2680 "state. These API calls block waiting for the command to be carried out "
2681 "(ie. the state to transition to BUSY and then back to READY). There are no "
2682 "non-blocking versions, and no way to issue more than one command per handle "
2687 #: ../src/guestfs.pod:1350
2689 "Finally, the child process sends asynchronous messages back to the main "
2690 "program, such as kernel log messages. You can register a callback to "
2691 "receive these messages."
2695 #: ../src/guestfs.pod:1354
2696 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2700 #: ../src/guestfs.pod:1356
2702 "The child process generates events in some situations. Current events "
2703 "include: receiving a log message, the child process exits."
2707 #: ../src/guestfs.pod:1359
2709 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2714 #: ../src/guestfs.pod:1362
2716 "Only I<one callback of each type> can be registered for each handle. "
2717 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2718 "that type. Cancel all callbacks of this type by calling this function with "
2719 "C<cb> set to C<NULL>."
2723 #: ../src/guestfs.pod:1367
2724 msgid "guestfs_set_log_message_callback"
2728 #: ../src/guestfs.pod:1369
2731 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2732 " char *buf, int len);\n"
2733 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2734 " guestfs_log_message_cb cb,\n"
2740 #: ../src/guestfs.pod:1375
2742 "The callback function C<cb> will be called whenever qemu or the guest writes "
2743 "anything to the console."
2747 #: ../src/guestfs.pod:1378
2748 msgid "Use this function to capture kernel messages and similar."
2752 #: ../src/guestfs.pod:1380
2754 "Normally there is no log message handler, and log messages are just "
2759 #: ../src/guestfs.pod:1383
2760 msgid "guestfs_set_subprocess_quit_callback"
2764 #: ../src/guestfs.pod:1385
2767 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2768 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2769 " guestfs_subprocess_quit_cb cb,\n"
2775 #: ../src/guestfs.pod:1390
2777 "The callback function C<cb> will be called when the child process quits, "
2778 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2779 "corresponds to a transition from any state to the CONFIG state)."
2783 #: ../src/guestfs.pod:1395
2784 msgid "guestfs_set_launch_done_callback"
2788 #: ../src/guestfs.pod:1397
2791 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2792 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2793 " guestfs_launch_done_cb cb,\n"
2799 #: ../src/guestfs.pod:1402
2801 "The callback function C<cb> will be called when the child process becomes "
2802 "ready first time after it has been launched. (This corresponds to a "
2803 "transition from LAUNCHING to the READY state)."
2807 #: ../src/guestfs.pod:1406
2808 msgid "guestfs_set_close_callback"
2812 #: ../src/guestfs.pod:1408
2815 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2816 " void guestfs_set_close_callback (guestfs_h *g,\n"
2817 " guestfs_close_cb cb,\n"
2823 #: ../src/guestfs.pod:1413
2825 "The callback function C<cb> will be called while the handle is being closed "
2826 "(synchronously from L</guestfs_close>)."
2830 #: ../src/guestfs.pod:1416
2832 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2833 "handles that are open when the program exits. This means that this callback "
2834 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2835 "problems in higher-level languages (eg. if your HLL interpreter has already "
2836 "been cleaned up by the time this is called, and if your callback then jumps "
2837 "into some HLL function)."
2841 #: ../src/guestfs.pod:1424
2842 msgid "guestfs_set_progress_callback"
2846 #: ../src/guestfs.pod:1426
2849 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2850 " int proc_nr, int serial,\n"
2851 " uint64_t position, uint64_t total);\n"
2852 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2853 " guestfs_progress_cb cb,\n"
2859 #: ../src/guestfs.pod:1433
2861 "Some long-running operations can generate progress messages. If this "
2862 "callback is registered, then it will be called each time a progress message "
2863 "is generated (usually two seconds after the operation started, and three "
2864 "times per second thereafter until it completes, although the frequency may "
2865 "change in future versions)."
2869 #: ../src/guestfs.pod:1439
2871 "The callback receives two numbers: C<position> and C<total>. The units of "
2872 "C<total> are not defined, although for some operations C<total> may relate "
2873 "in some way to the amount of data to be transferred (eg. in bytes or "
2874 "megabytes), and C<position> may be the portion which has been transferred."
2878 #: ../src/guestfs.pod:1445
2879 msgid "The only defined and stable parts of the API are:"
2883 #: ../src/guestfs.pod:1451
2885 "The callback can display to the user some type of progress bar or indicator "
2886 "which shows the ratio of C<position>:C<total>."
2890 #: ../src/guestfs.pod:1456
2891 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2895 #: ../src/guestfs.pod:1460
2897 "If any progress notification is sent during a call, then a final progress "
2898 "notification is always sent when C<position> = C<total>."
2902 #: ../src/guestfs.pod:1463
2904 "This is to simplify caller code, so callers can easily set the progress "
2905 "indicator to \"100%\" at the end of the operation, without requiring special "
2906 "code to detect this case."
2910 #: ../src/guestfs.pod:1469
2912 "The callback also receives the procedure number and serial number of the "
2913 "call. These are only useful for debugging protocol issues, and the callback "
2914 "can normally ignore them. The callback may want to print these numbers in "
2915 "error messages or debugging messages."
2919 #: ../src/guestfs.pod:1474
2920 msgid "PRIVATE DATA AREA"
2924 #: ../src/guestfs.pod:1476
2926 "You can attach named pieces of private data to the libguestfs handle, and "
2927 "fetch them by name for the lifetime of the handle. This is called the "
2928 "private data area and is only available from the C API."
2932 #: ../src/guestfs.pod:1480
2933 msgid "To attach a named piece of data, use the following call:"
2937 #: ../src/guestfs.pod:1482
2940 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2945 #: ../src/guestfs.pod:1484
2947 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2948 "pointer (which can be C<NULL>). Any previous item with the same name is "
2953 #: ../src/guestfs.pod:1488
2955 "You can use any C<key> you want, but names beginning with an underscore "
2956 "character are reserved for internal libguestfs purposes (for implementing "
2957 "language bindings). It is recommended to prefix the name with some unique "
2958 "string to avoid collisions with other users."
2962 #: ../src/guestfs.pod:1493
2963 msgid "To retrieve the pointer, use:"
2967 #: ../src/guestfs.pod:1495
2970 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2975 #: ../src/guestfs.pod:1497
2977 "This function returns C<NULL> if either no data is found associated with "
2978 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2983 #: ../src/guestfs.pod:1501
2985 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2986 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2987 "all. In particular, libguestfs does I<not> try to free the data when the "
2988 "handle is closed. If the data must be freed, then the caller must either "
2989 "free it before calling L</guestfs_close> or must set up a close callback to "
2990 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2991 "can be registered for a handle)."
2995 #: ../src/guestfs.pod:1509
2997 "The private data area is implemented using a hash table, and should be "
2998 "reasonably efficient for moderate numbers of keys."
3002 #: ../src/guestfs.pod:1512
3003 msgid "BLOCK DEVICE NAMING"
3007 #: ../src/guestfs.pod:1514
3009 "In the kernel there is now quite a profusion of schemata for naming block "
3010 "devices (in this context, by I<block device> I mean a physical or virtual "
3011 "hard drive). The original Linux IDE driver used names starting with "
3012 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
3013 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
3014 "replacement for the old IDE driver (particularly for SATA devices) those "
3015 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
3016 "machines with paravirtualized drivers. This has created several different "
3017 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
3022 #: ../src/guestfs.pod:1526
3024 "As discussed above, libguestfs uses a qemu appliance running an embedded "
3025 "Linux kernel to access block devices. We can run a variety of appliances "
3026 "based on a variety of Linux kernels."
3030 #: ../src/guestfs.pod:1530
3032 "This causes a problem for libguestfs because many API calls use device or "
3033 "partition names. Working scripts and the recipe (example) scripts that we "
3034 "make available over the internet could fail if the naming scheme changes."
3038 #: ../src/guestfs.pod:1535
3040 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
3041 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
3042 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
3043 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
3047 #: ../src/guestfs.pod:1541
3049 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
3050 "L</guestfs_list_partitions> and similar calls return the true names of the "
3051 "devices and partitions as known to the appliance."
3055 #: ../src/guestfs.pod:1546
3056 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
3060 #: ../src/guestfs.pod:1548
3062 "Usually this translation is transparent. However in some (very rare) cases "
3063 "you may need to know the exact algorithm. Such cases include where you use "
3064 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
3065 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
3070 #: ../src/guestfs.pod:1554
3072 "The algorithm is applied only to I<parameters> which are known to be either "
3073 "device or partition names. Return values from functions such as "
3074 "L</guestfs_list_devices> are never changed."
3078 #: ../src/guestfs.pod:1562
3079 msgid "Is the string a parameter which is a device or partition name?"
3083 #: ../src/guestfs.pod:1566
3084 msgid "Does the string begin with C</dev/sd>?"
3088 #: ../src/guestfs.pod:1570
3090 "Does the named device exist? If so, we use that device. However if I<not> "
3091 "then we continue with this algorithm."
3095 #: ../src/guestfs.pod:1575
3096 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
3100 #: ../src/guestfs.pod:1577
3101 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
3105 #: ../src/guestfs.pod:1579
3106 msgid "If that named device exists, use it. If not, continue."
3110 #: ../src/guestfs.pod:1583
3111 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
3115 #: ../src/guestfs.pod:1585
3116 msgid "If that named device exists, use it. If not, return an error."
3120 #: ../src/guestfs.pod:1589
3121 msgid "PORTABILITY CONCERNS"
3125 #: ../src/guestfs.pod:1591
3127 "Although the standard naming scheme and automatic translation is useful for "
3128 "simple programs and guestfish scripts, for larger programs it is best not to "
3129 "rely on this mechanism."
3133 #: ../src/guestfs.pod:1595
3135 "Where possible for maximum future portability programs using libguestfs "
3136 "should use these future-proof techniques:"
3140 #: ../src/guestfs.pod:1602
3142 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
3143 "device names, and then use those names directly."
3147 #: ../src/guestfs.pod:1605
3148 msgid "Since those device names exist by definition, they will never be translated."
3152 #: ../src/guestfs.pod:1610
3154 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
3155 "filesystem labels."
3159 #: ../src/guestfs.pod:1615
3164 #: ../src/guestfs.pod:1617
3165 msgid "COMMUNICATION PROTOCOL"
3169 #: ../src/guestfs.pod:1619
3171 "Don't rely on using this protocol directly. This section documents how it "
3172 "currently works, but it may change at any time."
3176 #: ../src/guestfs.pod:1622
3178 "The protocol used to talk between the library and the daemon running inside "
3179 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3180 "1014, RFC 1832, RFC 4506)."
3184 #: ../src/guestfs.pod:1626
3186 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3187 "this file is automatically generated)."
3191 #: ../src/guestfs.pod:1629
3193 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3194 "and C<FileOut> parameters, which are handled with very simple request/reply "
3195 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3196 "parameters, which use the same request and reply messages, but they may also "
3197 "be followed by files sent using a chunked encoding."
3201 #: ../src/guestfs.pod:1636
3202 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3206 #: ../src/guestfs.pod:1638
3207 msgid "For ordinary functions, the request message is:"
3211 #: ../src/guestfs.pod:1640
3214 " total length (header + arguments,\n"
3215 " but not including the length word itself)\n"
3216 " struct guestfs_message_header (encoded as XDR)\n"
3217 " struct guestfs_<foo>_args (encoded as XDR)\n"
3222 #: ../src/guestfs.pod:1645
3224 "The total length field allows the daemon to allocate a fixed size buffer "
3225 "into which it slurps the rest of the message. As a result, the total length "
3226 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3227 "effective size of any request is limited to somewhere under this size."
3231 #: ../src/guestfs.pod:1651
3233 "Note also that many functions don't take any arguments, in which case the "
3234 "C<guestfs_I<foo>_args> is completely omitted."
3238 #: ../src/guestfs.pod:1654
3240 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3241 "receiver knows what type of args structure to expect, or none at all."
3245 #: ../src/guestfs.pod:1658
3246 msgid "The reply message for ordinary functions is:"
3250 #: ../src/guestfs.pod:1660
3253 " total length (header + ret,\n"
3254 " but not including the length word itself)\n"
3255 " struct guestfs_message_header (encoded as XDR)\n"
3256 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3261 #: ../src/guestfs.pod:1665
3263 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3264 "functions that return no formal return values."
3268 #: ../src/guestfs.pod:1668
3269 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3273 #: ../src/guestfs.pod:1671
3275 "In the case of an error, a flag is set in the header, and the reply message "
3276 "is slightly changed:"
3280 #: ../src/guestfs.pod:1674
3283 " total length (header + error,\n"
3284 " but not including the length word itself)\n"
3285 " struct guestfs_message_header (encoded as XDR)\n"
3286 " struct guestfs_message_error (encoded as XDR)\n"
3291 #: ../src/guestfs.pod:1679
3293 "The C<guestfs_message_error> structure contains the error message as a "
3298 #: ../src/guestfs.pod:1682
3299 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3303 #: ../src/guestfs.pod:1684
3305 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3306 "The normal request message is sent (see above). However this is followed by "
3307 "a sequence of file chunks."
3311 #: ../src/guestfs.pod:1688
3314 " total length (header + arguments,\n"
3315 " but not including the length word itself,\n"
3316 " and not including the chunks)\n"
3317 " struct guestfs_message_header (encoded as XDR)\n"
3318 " struct guestfs_<foo>_args (encoded as XDR)\n"
3319 " sequence of chunks for FileIn param #0\n"
3320 " sequence of chunks for FileIn param #1 etc.\n"
3325 #: ../src/guestfs.pod:1696
3326 msgid "The \"sequence of chunks\" is:"
3330 #: ../src/guestfs.pod:1698
3333 " length of chunk (not including length word itself)\n"
3334 " struct guestfs_chunk (encoded as XDR)\n"
3335 " length of chunk\n"
3336 " struct guestfs_chunk (encoded as XDR)\n"
3338 " length of chunk\n"
3339 " struct guestfs_chunk (with data.data_len == 0)\n"
3344 #: ../src/guestfs.pod:1706
3346 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3347 "is set in the final chunk to indicate either successful completion or early "
3352 #: ../src/guestfs.pod:1710
3354 "At time of writing there are no functions that have more than one FileIn "
3355 "parameter. However this is (theoretically) supported, by sending the "
3356 "sequence of chunks for each FileIn parameter one after another (from left to "
3361 #: ../src/guestfs.pod:1715
3363 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3364 "transfer. The library does this by sending a chunk with a special flag set "
3365 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3366 "RPC, does I<not> send any reply, and goes back to reading the next request."
3370 #: ../src/guestfs.pod:1721
3372 "The daemon may also cancel. It does this by writing a special word "
3373 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3374 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3375 "cancel chunk). The special word is chosen so that even if cancellation "
3376 "happens right at the end of the transfer (after the library has finished "
3377 "writing and has started listening for the reply), the \"spurious\" cancel "
3378 "flag will not be confused with the reply message."
3382 #: ../src/guestfs.pod:1730
3384 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3385 "limit), and also files where the size is not known in advance (eg. from "
3386 "pipes or sockets). However the chunks are rather small "
3387 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3388 "to keep much in memory."
3392 #: ../src/guestfs.pod:1736
3393 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3397 #: ../src/guestfs.pod:1738
3399 "The protocol for FileOut parameters is exactly the same as for FileIn "
3400 "parameters, but with the roles of daemon and library reversed."
3404 #: ../src/guestfs.pod:1741
3407 " total length (header + ret,\n"
3408 " but not including the length word itself,\n"
3409 " and not including the chunks)\n"
3410 " struct guestfs_message_header (encoded as XDR)\n"
3411 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3412 " sequence of chunks for FileOut param #0\n"
3413 " sequence of chunks for FileOut param #1 etc.\n"
3418 #: ../src/guestfs.pod:1749
3419 msgid "INITIAL MESSAGE"
3423 #: ../src/guestfs.pod:1751
3425 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3426 "which indicates that the guest and daemon is alive. This is what "
3427 "L</guestfs_launch> waits for."
3431 #: ../src/guestfs.pod:1755
3432 msgid "PROGRESS NOTIFICATION MESSAGES"
3436 #: ../src/guestfs.pod:1757
3438 "The daemon may send progress notification messages at any time. These are "
3439 "distinguished by the normal length word being replaced by "
3440 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3444 #: ../src/guestfs.pod:1761
3446 "The library turns them into progress callbacks (see "
3447 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3448 "discards them if not."
3452 #: ../src/guestfs.pod:1765
3454 "The daemon self-limits the frequency of progress messages it sends (see "
3455 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3460 #: ../src/guestfs.pod:1769
3461 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3465 #: ../src/guestfs.pod:1771
3467 "All high-level libguestfs actions are synchronous. If you want to use "
3468 "libguestfs asynchronously then you must create a thread."
3472 #: ../src/guestfs.pod:1774
3474 "Only use the handle from a single thread. Either use the handle exclusively "
3475 "from one thread, or provide your own mutex so that two threads cannot issue "
3476 "calls on the same handle at the same time."
3480 #: ../src/guestfs.pod:1778
3482 "See the graphical program guestfs-browser for one possible architecture for "
3483 "multithreaded programs using libvirt and libguestfs."
3487 #: ../src/guestfs.pod:1781
3488 msgid "QEMU WRAPPERS"
3492 #: ../src/guestfs.pod:1783
3494 "If you want to compile your own qemu, run qemu from a non-standard location, "
3495 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3500 #: ../src/guestfs.pod:1787
3502 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3503 "last command in the shell script (so that qemu replaces the shell and "
3504 "becomes the direct child of the libguestfs-using program). If you don't do "
3505 "this, then the qemu process won't be cleaned up correctly."
3509 #: ../src/guestfs.pod:1792
3511 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3516 #: ../src/guestfs.pod:1795
3520 " qemudir=/home/rjones/d/qemu\n"
3521 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
3527 #: ../src/guestfs.pod:1799
3529 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3530 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3535 #: ../src/guestfs.pod:1803
3538 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3543 #: ../src/guestfs.pod:1805
3545 "Note that libguestfs also calls qemu with the -help and -version options in "
3546 "order to determine features."
3550 #: ../src/guestfs.pod:1808
3551 msgid "LIBGUESTFS VERSION NUMBERS"
3555 #: ../src/guestfs.pod:1810
3557 "Since April 2010, libguestfs has started to make separate development and "
3558 "stable releases, along with corresponding branches in our git repository. "
3559 "These separate releases can be identified by version number:"
3563 #: ../src/guestfs.pod:1815
3566 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3567 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3573 " | `-------- sub-version\n"
3575 " `------ always '1' because we don't change the ABI\n"
3580 #: ../src/guestfs.pod:1826
3581 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3585 #: ../src/guestfs.pod:1828
3587 "As time passes we cherry pick fixes from the development branch and backport "
3588 "those into the stable branch, the effect being that the stable branch should "
3589 "get more stable and less buggy over time. So the stable releases are ideal "
3590 "for people who don't need new features but would just like the software to "
3595 #: ../src/guestfs.pod:1834
3596 msgid "Our criteria for backporting changes are:"
3600 #: ../src/guestfs.pod:1840
3602 "Documentation changes which don't affect any code are backported unless the "
3603 "documentation refers to a future feature which is not in stable."
3607 #: ../src/guestfs.pod:1846
3609 "Bug fixes which are not controversial, fix obvious problems, and have been "
3610 "well tested are backported."
3614 #: ../src/guestfs.pod:1851
3616 "Simple rearrangements of code which shouldn't affect how it works get "
3617 "backported. This is so that the code in the two branches doesn't get too "
3618 "far out of step, allowing us to backport future fixes more easily."
3622 #: ../src/guestfs.pod:1857
3624 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3625 "exceptional case: the new feature is required in order to implement an "
3626 "important bug fix."
3630 #: ../src/guestfs.pod:1863
3632 "A new stable branch starts when we think the new features in development are "
3633 "substantial and compelling enough over the current stable branch to warrant "
3634 "it. When that happens we create new stable and development versions 1.N.0 "
3635 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3636 "stable at this point, but by backporting fixes from development, that branch "
3637 "will stabilize over time."
3641 #: ../src/guestfs.pod:1871 ../fish/guestfish.pod:914 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330 ../tools/virt-rescue.pl:255
3642 msgid "ENVIRONMENT VARIABLES"
3646 #: ../src/guestfs.pod:1875 ../fish/guestfish.pod:940
3647 msgid "LIBGUESTFS_APPEND"
3651 #: ../src/guestfs.pod:1877 ../fish/guestfish.pod:942
3652 msgid "Pass additional options to the guest kernel."
3656 #: ../src/guestfs.pod:1879 ../fish/guestfish.pod:944
3657 msgid "LIBGUESTFS_DEBUG"
3661 #: ../src/guestfs.pod:1881
3663 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3664 "effect as calling C<guestfs_set_verbose (g, 1)>."
3668 #: ../src/guestfs.pod:1884 ../fish/guestfish.pod:949
3669 msgid "LIBGUESTFS_MEMSIZE"
3673 #: ../src/guestfs.pod:1886 ../fish/guestfish.pod:951
3674 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
3678 #: ../src/guestfs.pod:1889 ../fish/guestfish.pod:954
3681 " LIBGUESTFS_MEMSIZE=700\n"
3686 #: ../src/guestfs.pod:1891 ../fish/guestfish.pod:956
3687 msgid "LIBGUESTFS_PATH"
3691 #: ../src/guestfs.pod:1893
3693 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3694 "the discussion of paths in section PATH above."
3698 #: ../src/guestfs.pod:1896 ../fish/guestfish.pod:961
3699 msgid "LIBGUESTFS_QEMU"
3703 #: ../src/guestfs.pod:1898 ../fish/guestfish.pod:963
3705 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3706 "which was found at compile time by the configure script is used."
3710 #: ../src/guestfs.pod:1902
3711 msgid "See also L</QEMU WRAPPERS> above."
3715 #: ../src/guestfs.pod:1904 ../fish/guestfish.pod:967
3716 msgid "LIBGUESTFS_TRACE"
3720 #: ../src/guestfs.pod:1906
3722 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3723 "effect as calling C<guestfs_set_trace (g, 1)>."
3727 #: ../src/guestfs.pod:1909 ../fish/guestfish.pod:976
3732 #: ../src/guestfs.pod:1911 ../fish/guestfish.pod:978
3733 msgid "Location of temporary directory, defaults to C</tmp>."
3737 #: ../src/guestfs.pod:1913 ../fish/guestfish.pod:980
3739 "If libguestfs was compiled to use the supermin appliance then the real "
3740 "appliance is cached in this directory, shared between all handles belonging "
3741 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
3742 "use in case C</tmp> is not large enough."
3746 #: ../src/guestfs.pod:1921 ../fish/guestfish.pod:1038 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233 ../inspector/virt-inspector.pl:570 ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484 ../tools/virt-df.pl:640 ../tools/virt-ls.pl:232 ../tools/virt-resize.pl:1486 ../tools/virt-list-filesystems.pl:186 ../tools/virt-tar.pl:281 ../tools/virt-rescue.pl:267 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:254
3751 #: ../src/guestfs.pod:1923
3753 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
3754 "L<virt-edit(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
3755 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
3756 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
3757 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
3761 #: ../src/guestfs.pod:1941
3763 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
3764 "L<lvm(8)>, L<disktype(1)>."
3768 #: ../src/guestfs.pod:1948 ../tools/virt-win-reg.pl:499 ../tools/virt-make-fs.pl:548
3773 #: ../src/guestfs.pod:1950
3774 msgid "To get a list of bugs against libguestfs use this link:"
3778 #: ../src/guestfs.pod:1952
3779 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
3783 #: ../src/guestfs.pod:1954
3784 msgid "To report a new bug against libguestfs use this link:"
3788 #: ../src/guestfs.pod:1956
3789 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
3793 #: ../src/guestfs.pod:1958
3794 msgid "When reporting a bug, please check:"
3798 #: ../src/guestfs.pod:1964
3799 msgid "That the bug hasn't been reported already."
3803 #: ../src/guestfs.pod:1968
3804 msgid "That you are testing a recent version."
3808 #: ../src/guestfs.pod:1972
3809 msgid "Describe the bug accurately, and give a way to reproduce it."
3813 #: ../src/guestfs.pod:1976
3815 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3820 #: ../src/guestfs.pod:1981 ../fish/guestfish.pod:1055 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244 ../inspector/virt-inspector.pl:580
3825 #: ../src/guestfs.pod:1983 ../fish/guestfish.pod:1057 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
3826 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3830 #: ../src/guestfs.pod:1985 ../fish/guestfish.pod:1059 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248 ../inspector/virt-inspector.pl:594 ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:514 ../tools/virt-df.pl:653 ../tools/virt-ls.pl:247 ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:296 ../tools/virt-rescue.pl:281 ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:269
3835 #: ../src/guestfs.pod:1987 ../fish/guestfish.pod:1061 ../fuse/guestmount.pod:250
3836 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3840 #: ../src/guestfs.pod:1990
3842 "This library is free software; you can redistribute it and/or modify it "
3843 "under the terms of the GNU Lesser General Public License as published by the "
3844 "Free Software Foundation; either version 2 of the License, or (at your "
3845 "option) any later version."
3849 #: ../src/guestfs.pod:1995
3851 "This library is distributed in the hope that it will be useful, but WITHOUT "
3852 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3853 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3858 #: ../src/guestfs.pod:2000
3860 "You should have received a copy of the GNU Lesser General Public License "
3861 "along with this library; if not, write to the Free Software Foundation, "
3862 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3866 #: ../src/guestfs-actions.pod:1
3867 msgid "guestfs_add_cdrom"
3871 #: ../src/guestfs-actions.pod:3
3875 " guestfs_add_cdrom (guestfs_h *g,\n"
3876 " const char *filename);\n"
3881 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
3882 msgid "This function adds a virtual CD-ROM disk image to the guest."
3886 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
3887 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3891 #: ../src/guestfs-actions.pod:17
3893 "This call checks for the existence of C<filename>. This stops you from "
3894 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3895 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3900 #: ../src/guestfs-actions.pod:24
3902 "If you just want to add an ISO file (often you use this as an efficient way "
3903 "to transfer large files into the guest), then you should probably use "
3904 "C<guestfs_add_drive_ro> instead."
3908 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:126 ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:224 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:408 ../src/guestfs-actions.pod:428 ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:487 ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:533 ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:633 ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779 ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807 ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:1006 ../src/guestfs-actions.pod:1090 ../src/guestfs-actions.pod:1108 ../src/guestfs-actions.pod:1127 ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1161 ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1262 ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:1324 ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2213 ../src/guestfs-actions.pod:2357 ../src/guestfs-actions.pod:2418 ../src/guestfs-actions.pod:2453 ../src/guestfs-actions.pod:2989 ../src/guestfs-actions.pod:3004 ../src/guestfs-actions.pod:3024 ../src/guestfs-actions.pod:3149 ../src/guestfs-actions.pod:3163 ../src/guestfs-actions.pod:3176 ../src/guestfs-actions.pod:3190 ../src/guestfs-actions.pod:3205 ../src/guestfs-actions.pod:3241 ../src/guestfs-actions.pod:3313 ../src/guestfs-actions.pod:3333 ../src/guestfs-actions.pod:3350 ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3396 ../src/guestfs-actions.pod:3428 ../src/guestfs-actions.pod:3447 ../src/guestfs-actions.pod:3466 ../src/guestfs-actions.pod:3501 ../src/guestfs-actions.pod:3513 ../src/guestfs-actions.pod:3549 ../src/guestfs-actions.pod:3565 ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3593 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:3703 ../src/guestfs-actions.pod:3723 ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3787 ../src/guestfs-actions.pod:3805 ../src/guestfs-actions.pod:3823 ../src/guestfs-actions.pod:3839 ../src/guestfs-actions.pod:3853 ../src/guestfs-actions.pod:3867 ../src/guestfs-actions.pod:3884 ../src/guestfs-actions.pod:3899 ../src/guestfs-actions.pod:3919 ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:3999 ../src/guestfs-actions.pod:4018 ../src/guestfs-actions.pod:4037 ../src/guestfs-actions.pod:4049 ../src/guestfs-actions.pod:4066 ../src/guestfs-actions.pod:4079 ../src/guestfs-actions.pod:4094 ../src/guestfs-actions.pod:4109 ../src/guestfs-actions.pod:4144 ../src/guestfs-actions.pod:4159 ../src/guestfs-actions.pod:4179 ../src/guestfs-actions.pod:4193 ../src/guestfs-actions.pod:4210 ../src/guestfs-actions.pod:4259 ../src/guestfs-actions.pod:4296 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4338 ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4373 ../src/guestfs-actions.pod:4507 ../src/guestfs-actions.pod:4564 ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4604 ../src/guestfs-actions.pod:4636 ../src/guestfs-actions.pod:4702 ../src/guestfs-actions.pod:4719 ../src/guestfs-actions.pod:4732 ../src/guestfs-actions.pod:4746 ../src/guestfs-actions.pod:5035 ../src/guestfs-actions.pod:5054 ../src/guestfs-actions.pod:5068 ../src/guestfs-actions.pod:5080 ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:5106 ../src/guestfs-actions.pod:5120 ../src/guestfs-actions.pod:5136 ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5176 ../src/guestfs-actions.pod:5195 ../src/guestfs-actions.pod:5213 ../src/guestfs-actions.pod:5236 ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5273 ../src/guestfs-actions.pod:5294 ../src/guestfs-actions.pod:5313 ../src/guestfs-actions.pod:5330 ../src/guestfs-actions.pod:5358 ../src/guestfs-actions.pod:5382 ../src/guestfs-actions.pod:5401 ../src/guestfs-actions.pod:5425 ../src/guestfs-actions.pod:5440 ../src/guestfs-actions.pod:5455 ../src/guestfs-actions.pod:5474 ../src/guestfs-actions.pod:5511 ../src/guestfs-actions.pod:5534 ../src/guestfs-actions.pod:5560 ../src/guestfs-actions.pod:5668 ../src/guestfs-actions.pod:5789 ../src/guestfs-actions.pod:5801 ../src/guestfs-actions.pod:5814 ../src/guestfs-actions.pod:5827 ../src/guestfs-actions.pod:5849 ../src/guestfs-actions.pod:5862 ../src/guestfs-actions.pod:5875 ../src/guestfs-actions.pod:5888 ../src/guestfs-actions.pod:5903 ../src/guestfs-actions.pod:5962 ../src/guestfs-actions.pod:5979 ../src/guestfs-actions.pod:5995 ../src/guestfs-actions.pod:6011 ../src/guestfs-actions.pod:6028 ../src/guestfs-actions.pod:6041 ../src/guestfs-actions.pod:6061 ../src/guestfs-actions.pod:6097 ../src/guestfs-actions.pod:6111 ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6165 ../src/guestfs-actions.pod:6183 ../src/guestfs-actions.pod:6212 ../src/guestfs-actions.pod:6243 ../src/guestfs-actions.pod:6362 ../src/guestfs-actions.pod:6380 ../src/guestfs-actions.pod:6394 ../src/guestfs-actions.pod:6449 ../src/guestfs-actions.pod:6462 ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6540 ../src/guestfs-actions.pod:6594 ../src/guestfs-actions.pod:6620 ../src/guestfs-actions.pod:6686 ../src/guestfs-actions.pod:6705 ../src/guestfs-actions.pod:6734
3909 msgid "This function returns 0 on success or -1 on error."
3913 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
3915 "This function is deprecated. In new code, use the C<add_drive_opts> call "
3920 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:243 ../src/guestfs-actions.pod:264 ../src/guestfs-actions.pod:1435 ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1942 ../src/guestfs-actions.pod:6628 ../src/guestfs-actions.pod:6797 ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:156 ../fish/guestfish-actions.pod:170 ../fish/guestfish-actions.pod:951 ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1322 ../fish/guestfish-actions.pod:4377 ../fish/guestfish-actions.pod:4474
3922 "Deprecated functions will not be removed from the API, but the fact that "
3923 "they are deprecated indicates that there are problems with correct use of "
3928 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:128 ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:2991 ../src/guestfs-actions.pod:3006 ../src/guestfs-actions.pod:4146 ../src/guestfs-actions.pod:5215 ../src/guestfs-actions.pod:5332 ../src/guestfs-actions.pod:5442 ../src/guestfs-actions.pod:5905 ../src/guestfs-actions.pod:6030 ../src/guestfs-actions.pod:6542
3929 msgid "(Added in 0.3)"
3933 #: ../src/guestfs-actions.pod:41
3934 msgid "guestfs_add_domain"
3938 #: ../src/guestfs-actions.pod:43
3942 " guestfs_add_domain (guestfs_h *g,\n"
3943 " const char *dom,\n"
3949 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:137
3951 "You may supply a list of optional arguments to this call. Use zero or more "
3952 "of the following pairs of parameters, and terminate the list with C<-1> on "
3953 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
3957 #: ../src/guestfs-actions.pod:53
3960 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
3961 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
3962 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
3967 #: ../src/guestfs-actions.pod:57
3969 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
3970 "It works by connecting to libvirt, requesting the domain and domain XML from "
3971 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
3976 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
3978 "The number of disks added is returned. This operation is atomic: if an "
3979 "error is returned, then no disks are added."
3983 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
3985 "This function does some minimal checks to make sure the libvirt domain is "
3986 "not running (unless C<readonly> is true). In a future version we will try "
3987 "to acquire the libvirt lock on each disk."
3991 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
3993 "Disks must be accessible locally. This often means that adding disks from a "
3994 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
3995 "unless those disks are accessible via the same device path locally too."
3999 #: ../src/guestfs-actions.pod:74
4001 "The optional C<libvirturi> parameter sets the libvirt URI (see "
4002 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
4003 "default libvirt URI (or one set through an environment variable, see the "
4004 "libvirt documentation for full details). If you are using the C API "
4005 "directly then it is more flexible to create the libvirt connection object "
4006 "yourself, get the domain object, and call C<guestfs_add_libvirt_dom>."
4010 #: ../src/guestfs-actions.pod:82
4012 "The other optional parameters are passed directly through to "
4013 "C<guestfs_add_drive_opts>."
4017 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:336 ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:1307 ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1864 ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:2003 ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2081 ../src/guestfs-actions.pod:2344 ../src/guestfs-actions.pod:2602 ../src/guestfs-actions.pod:2623 ../src/guestfs-actions.pod:4282 ../src/guestfs-actions.pod:4410 ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:4842 ../src/guestfs-actions.pod:6138 ../src/guestfs-actions.pod:6553 ../src/guestfs-actions.pod:6566 ../src/guestfs-actions.pod:6579
4018 msgid "On error this function returns -1."
4022 #: ../src/guestfs-actions.pod:87
4023 msgid "guestfs_add_domain_va"
4027 #: ../src/guestfs-actions.pod:89
4031 " guestfs_add_domain_va (guestfs_h *g,\n"
4032 " const char *dom,\n"
4038 #: ../src/guestfs-actions.pod:94
4039 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4043 #: ../src/guestfs-actions.pod:96 ../src/guestfs-actions.pod:107 ../src/guestfs-actions.pod:200 ../src/guestfs-actions.pod:211
4044 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4048 #: ../src/guestfs-actions.pod:98
4049 msgid "guestfs_add_domain_argv"
4053 #: ../src/guestfs-actions.pod:100
4057 " guestfs_add_domain_argv (guestfs_h *g,\n"
4058 " const char *dom,\n"
4059 " const struct guestfs_add_domain_argv *optargs);\n"
4064 #: ../src/guestfs-actions.pod:105
4065 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4069 #: ../src/guestfs-actions.pod:109
4070 msgid "guestfs_add_drive"
4074 #: ../src/guestfs-actions.pod:111
4078 " guestfs_add_drive (guestfs_h *g,\n"
4079 " const char *filename);\n"
4084 #: ../src/guestfs-actions.pod:115
4086 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4087 "optional parameters, so the disk is added writable, with the format being "
4088 "detected automatically."
4092 #: ../src/guestfs-actions.pod:119
4094 "Automatic detection of the format opens you up to a potential security hole "
4095 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4096 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4097 "you should think about replacing calls to this function with calls to "
4098 "C<guestfs_add_drive_opts>, and specifying the format."
4102 #: ../src/guestfs-actions.pod:130
4103 msgid "guestfs_add_drive_opts"
4107 #: ../src/guestfs-actions.pod:132
4111 " guestfs_add_drive_opts (guestfs_h *g,\n"
4112 " const char *filename,\n"
4118 #: ../src/guestfs-actions.pod:142
4121 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4122 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4123 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4128 #: ../src/guestfs-actions.pod:146 ../fish/guestfish-actions.pod:92
4130 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4131 "The first time you call this function, the disk appears as C</dev/sda>, the "
4132 "second time as C</dev/sdb>, and so on."
4136 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:97
4138 "You don't necessarily need to be root when using libguestfs. However you "
4139 "obviously do need sufficient permissions to access the filename for whatever "
4140 "operations you want to perform (ie. read access if you just want to read the "
4141 "image or write access if you want to modify the image)."
4145 #: ../src/guestfs-actions.pod:157 ../fish/guestfish-actions.pod:103
4146 msgid "This call checks that C<filename> exists."
4150 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:105
4151 msgid "The optional arguments are:"
4155 #: ../src/guestfs-actions.pod:163 ../fish/guestfish-actions.pod:109
4160 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:111
4162 "If true then the image is treated as read-only. Writes are still allowed, "
4163 "but they are stored in a temporary snapshot overlay which is discarded at "
4164 "the end. The disk that you add is not modified."
4168 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:115
4173 #: ../src/guestfs-actions.pod:171
4175 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4176 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4177 "Possible formats include C<raw> and C<qcow2>."
4181 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:121
4183 "Automatic detection of the format opens you up to a potential security hole "
4184 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4185 "RHBZ#642934. Specifying the format closes this security hole."
4189 #: ../src/guestfs-actions.pod:180 ../fish/guestfish-actions.pod:126
4194 #: ../src/guestfs-actions.pod:182
4196 "This rarely-used option lets you emulate the behaviour of the deprecated "
4197 "C<guestfs_add_drive_with_if> call (q.v.)"
4201 #: ../src/guestfs-actions.pod:189
4202 msgid "(Added in 1.5.23)"
4206 #: ../src/guestfs-actions.pod:191
4207 msgid "guestfs_add_drive_opts_va"
4211 #: ../src/guestfs-actions.pod:193
4215 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4216 " const char *filename,\n"
4222 #: ../src/guestfs-actions.pod:198
4223 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4227 #: ../src/guestfs-actions.pod:202
4228 msgid "guestfs_add_drive_opts_argv"
4232 #: ../src/guestfs-actions.pod:204
4236 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4237 " const char *filename,\n"
4238 " const struct guestfs_add_drive_opts_argv "
4244 #: ../src/guestfs-actions.pod:209
4245 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4249 #: ../src/guestfs-actions.pod:213
4250 msgid "guestfs_add_drive_ro"
4254 #: ../src/guestfs-actions.pod:215
4258 " guestfs_add_drive_ro (guestfs_h *g,\n"
4259 " const char *filename);\n"
4264 #: ../src/guestfs-actions.pod:219
4266 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4267 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4268 "disk is added read-only, with the format being detected automatically."
4272 #: ../src/guestfs-actions.pod:226
4273 msgid "(Added in 1.0.38)"
4277 #: ../src/guestfs-actions.pod:228
4278 msgid "guestfs_add_drive_ro_with_if"
4282 #: ../src/guestfs-actions.pod:230
4286 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4287 " const char *filename,\n"
4288 " const char *iface);\n"
4293 #: ../src/guestfs-actions.pod:235
4295 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4296 "QEMU interface emulation to use at run time."
4300 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:268 ../src/guestfs-actions.pod:2303
4301 msgid "(Added in 1.0.84)"
4305 #: ../src/guestfs-actions.pod:249
4306 msgid "guestfs_add_drive_with_if"
4310 #: ../src/guestfs-actions.pod:251
4314 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4315 " const char *filename,\n"
4316 " const char *iface);\n"
4321 #: ../src/guestfs-actions.pod:256
4323 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4324 "QEMU interface emulation to use at run time."
4328 #: ../src/guestfs-actions.pod:270
4329 msgid "guestfs_aug_clear"
4333 #: ../src/guestfs-actions.pod:272
4337 " guestfs_aug_clear (guestfs_h *g,\n"
4338 " const char *augpath);\n"
4343 #: ../src/guestfs-actions.pod:276 ../fish/guestfish-actions.pod:178
4345 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4346 "L<augtool(1)> C<clear> command."
4350 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:2083
4351 msgid "(Added in 1.3.4)"
4355 #: ../src/guestfs-actions.pod:283
4356 msgid "guestfs_aug_close"
4360 #: ../src/guestfs-actions.pod:285
4364 " guestfs_aug_close (guestfs_h *g);\n"
4369 #: ../src/guestfs-actions.pod:288
4371 "Close the current Augeas handle and free up any resources used by it. After "
4372 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4373 "any other Augeas functions."
4377 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:320 ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:475 ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535 ../src/guestfs-actions.pod:4893
4378 msgid "(Added in 0.7)"
4382 #: ../src/guestfs-actions.pod:297
4383 msgid "guestfs_aug_defnode"
4387 #: ../src/guestfs-actions.pod:299
4390 " struct guestfs_int_bool *\n"
4391 " guestfs_aug_defnode (guestfs_h *g,\n"
4392 " const char *name,\n"
4393 " const char *expr,\n"
4394 " const char *val);\n"
4399 #: ../src/guestfs-actions.pod:305 ../fish/guestfish-actions.pod:194
4400 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4404 #: ../src/guestfs-actions.pod:308
4406 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4407 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4408 "containing that single node."
4412 #: ../src/guestfs-actions.pod:312 ../fish/guestfish-actions.pod:201
4414 "On success this returns a pair containing the number of nodes in the "
4415 "nodeset, and a boolean flag if a node was created."
4419 #: ../src/guestfs-actions.pod:316
4421 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4422 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4426 #: ../src/guestfs-actions.pod:322
4427 msgid "guestfs_aug_defvar"
4431 #: ../src/guestfs-actions.pod:324
4435 " guestfs_aug_defvar (guestfs_h *g,\n"
4436 " const char *name,\n"
4437 " const char *expr);\n"
4442 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:209
4444 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4445 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4449 #: ../src/guestfs-actions.pod:333 ../fish/guestfish-actions.pod:213
4451 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4452 "evaluates to something which is not a nodeset."
4456 #: ../src/guestfs-actions.pod:340
4457 msgid "guestfs_aug_get"
4461 #: ../src/guestfs-actions.pod:342
4465 " guestfs_aug_get (guestfs_h *g,\n"
4466 " const char *augpath);\n"
4471 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:220
4473 "Look up the value associated with C<path>. If C<path> matches exactly one "
4474 "node, the C<value> is returned."
4478 #: ../src/guestfs-actions.pod:349 ../src/guestfs-actions.pod:849 ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:927 ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1046 ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:1212 ../src/guestfs-actions.pod:1341 ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1644 ../src/guestfs-actions.pod:1807 ../src/guestfs-actions.pod:1824 ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1936 ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2268 ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2679 ../src/guestfs-actions.pod:2735 ../src/guestfs-actions.pod:2758 ../src/guestfs-actions.pod:3135 ../src/guestfs-actions.pod:3485 ../src/guestfs-actions.pod:3655 ../src/guestfs-actions.pod:3765 ../src/guestfs-actions.pod:4428 ../src/guestfs-actions.pod:4621 ../src/guestfs-actions.pod:4791 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:5018 ../src/guestfs-actions.pod:5581 ../src/guestfs-actions.pod:5597 ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:5638 ../src/guestfs-actions.pod:6302 ../src/guestfs-actions.pod:6321 ../src/guestfs-actions.pod:6339 ../src/guestfs-actions.pod:6519 ../src/guestfs-actions.pod:6791
4480 "This function returns a string, or NULL on error. I<The caller must free "
4481 "the returned string after use>."
4485 #: ../src/guestfs-actions.pod:354
4486 msgid "guestfs_aug_init"
4490 #: ../src/guestfs-actions.pod:356
4494 " guestfs_aug_init (guestfs_h *g,\n"
4495 " const char *root,\n"
4501 #: ../src/guestfs-actions.pod:361 ../fish/guestfish-actions.pod:227
4503 "Create a new Augeas handle for editing configuration files. If there was "
4504 "any previous Augeas handle associated with this guestfs session, then it is "
4509 #: ../src/guestfs-actions.pod:365
4510 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4514 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:234
4515 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4519 #: ../src/guestfs-actions.pod:371 ../fish/guestfish-actions.pod:237
4521 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4522 "logical I<or> of the following integers:"
4526 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:243
4527 msgid "C<AUG_SAVE_BACKUP> = 1"
4531 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:245
4532 msgid "Keep the original file with a C<.augsave> extension."
4536 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:247
4537 msgid "C<AUG_SAVE_NEWFILE> = 2"
4541 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:249
4543 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4544 "original. Overrides C<AUG_SAVE_BACKUP>."
4548 #: ../src/guestfs-actions.pod:386 ../fish/guestfish-actions.pod:252
4549 msgid "C<AUG_TYPE_CHECK> = 4"
4553 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:254
4554 msgid "Typecheck lenses (can be expensive)."
4558 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:256
4559 msgid "C<AUG_NO_STDINC> = 8"
4563 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:258
4564 msgid "Do not use standard load path for modules."
4568 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:260
4569 msgid "C<AUG_SAVE_NOOP> = 16"
4573 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:262
4574 msgid "Make save a no-op, just record what would have been changed."
4578 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:264
4579 msgid "C<AUG_NO_LOAD> = 32"
4583 #: ../src/guestfs-actions.pod:400
4584 msgid "Do not load the tree in C<guestfs_aug_init>."
4588 #: ../src/guestfs-actions.pod:404
4589 msgid "To close the handle, you can call C<guestfs_aug_close>."
4593 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:272
4594 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4598 #: ../src/guestfs-actions.pod:412
4599 msgid "guestfs_aug_insert"
4603 #: ../src/guestfs-actions.pod:414
4607 " guestfs_aug_insert (guestfs_h *g,\n"
4608 " const char *augpath,\n"
4609 " const char *label,\n"
4615 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:278
4617 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4618 "or after C<path> (depending on the boolean flag C<before>)."
4622 #: ../src/guestfs-actions.pod:424 ../fish/guestfish-actions.pod:282
4624 "C<path> must match exactly one existing node in the tree, and C<label> must "
4625 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4629 #: ../src/guestfs-actions.pod:432
4630 msgid "guestfs_aug_load"
4634 #: ../src/guestfs-actions.pod:434
4638 " guestfs_aug_load (guestfs_h *g);\n"
4643 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:290
4644 msgid "Load files into the tree."
4648 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:292
4649 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4653 #: ../src/guestfs-actions.pod:446
4654 msgid "guestfs_aug_ls"
4658 #: ../src/guestfs-actions.pod:448
4662 " guestfs_aug_ls (guestfs_h *g,\n"
4663 " const char *augpath);\n"
4668 #: ../src/guestfs-actions.pod:452
4670 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4671 "sorting the resulting nodes into alphabetical order."
4675 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:471 ../src/guestfs-actions.pod:617 ../src/guestfs-actions.pod:1065 ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1375 ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1497 ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:2148 ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:2183 ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:2250 ../src/guestfs-actions.pod:2321 ../src/guestfs-actions.pod:2370 ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:2698 ../src/guestfs-actions.pod:2800 ../src/guestfs-actions.pod:3055 ../src/guestfs-actions.pod:3117 ../src/guestfs-actions.pod:3222 ../src/guestfs-actions.pod:3627 ../src/guestfs-actions.pod:4243 ../src/guestfs-actions.pod:4763 ../src/guestfs-actions.pod:4889 ../src/guestfs-actions.pod:5003 ../src/guestfs-actions.pod:5654 ../src/guestfs-actions.pod:5715 ../src/guestfs-actions.pod:5770 ../src/guestfs-actions.pod:5916 ../src/guestfs-actions.pod:5940 ../src/guestfs-actions.pod:6412 ../src/guestfs-actions.pod:6432 ../src/guestfs-actions.pod:6479 ../src/guestfs-actions.pod:6644 ../src/guestfs-actions.pod:6663 ../src/guestfs-actions.pod:6748 ../src/guestfs-actions.pod:6767 ../src/guestfs-actions.pod:6813 ../src/guestfs-actions.pod:6832
4677 "This function returns a NULL-terminated array of strings (like "
4678 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
4679 "strings and the array after use>."
4683 #: ../src/guestfs-actions.pod:459 ../src/guestfs-actions.pod:990 ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:2878 ../src/guestfs-actions.pod:2909 ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3705 ../src/guestfs-actions.pod:3738 ../src/guestfs-actions.pod:3901 ../src/guestfs-actions.pod:4247 ../src/guestfs-actions.pod:4704 ../src/guestfs-actions.pod:5082 ../src/guestfs-actions.pod:5096 ../src/guestfs-actions.pod:5108 ../src/guestfs-actions.pod:5516 ../src/guestfs-actions.pod:6154 ../src/guestfs-actions.pod:6167 ../src/guestfs-actions.pod:6396 ../src/guestfs-actions.pod:6599 ../src/guestfs-actions.pod:6632
4684 msgid "(Added in 0.8)"
4688 #: ../src/guestfs-actions.pod:461
4689 msgid "guestfs_aug_match"
4693 #: ../src/guestfs-actions.pod:463
4697 " guestfs_aug_match (guestfs_h *g,\n"
4698 " const char *augpath);\n"
4703 #: ../src/guestfs-actions.pod:467 ../fish/guestfish-actions.pod:306
4705 "Returns a list of paths which match the path expression C<path>. The "
4706 "returned paths are sufficiently qualified so that they match exactly one "
4707 "node in the current tree."
4711 #: ../src/guestfs-actions.pod:477
4712 msgid "guestfs_aug_mv"
4716 #: ../src/guestfs-actions.pod:479
4720 " guestfs_aug_mv (guestfs_h *g,\n"
4721 " const char *src,\n"
4722 " const char *dest);\n"
4727 #: ../src/guestfs-actions.pod:484 ../fish/guestfish-actions.pod:314
4729 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4730 "C<dest> is overwritten if it exists."
4734 #: ../src/guestfs-actions.pod:491
4735 msgid "guestfs_aug_rm"
4739 #: ../src/guestfs-actions.pod:493
4743 " guestfs_aug_rm (guestfs_h *g,\n"
4744 " const char *augpath);\n"
4749 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:321
4750 msgid "Remove C<path> and all of its children."
4754 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:323
4755 msgid "On success this returns the number of entries which were removed."
4759 #: ../src/guestfs-actions.pod:505
4760 msgid "guestfs_aug_save"
4764 #: ../src/guestfs-actions.pod:507
4768 " guestfs_aug_save (guestfs_h *g);\n"
4773 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:329
4774 msgid "This writes all pending changes to disk."
4778 #: ../src/guestfs-actions.pod:512
4780 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4785 #: ../src/guestfs-actions.pod:519
4786 msgid "guestfs_aug_set"
4790 #: ../src/guestfs-actions.pod:521
4794 " guestfs_aug_set (guestfs_h *g,\n"
4795 " const char *augpath,\n"
4796 " const char *val);\n"
4801 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:338
4802 msgid "Set the value associated with C<path> to C<val>."
4806 #: ../src/guestfs-actions.pod:528
4808 "In the Augeas API, it is possible to clear a node by setting the value to "
4809 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4810 "this call. Instead you must use the C<guestfs_aug_clear> call."
4814 #: ../src/guestfs-actions.pod:537
4815 msgid "guestfs_available"
4819 #: ../src/guestfs-actions.pod:539
4823 " guestfs_available (guestfs_h *g,\n"
4824 " char *const *groups);\n"
4829 #: ../src/guestfs-actions.pod:543 ../fish/guestfish-actions.pod:349
4831 "This command is used to check the availability of some groups of "
4832 "functionality in the appliance, which not all builds of the libguestfs "
4833 "appliance will be able to provide."
4837 #: ../src/guestfs-actions.pod:547
4839 "The libguestfs groups, and the functions that those groups correspond to, "
4840 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4841 "runtime by calling C<guestfs_available_all_groups>."
4845 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:358
4847 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4848 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4849 "and Augeas (configuration file editing) functions."
4853 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:363
4854 msgid "The command returns no error if I<all> requested groups are available."
4858 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:365
4860 "It fails with an error if one or more of the requested groups is unavailable "
4865 #: ../src/guestfs-actions.pod:562 ../fish/guestfish-actions.pod:368
4867 "If an unknown group name is included in the list of groups then an error is "
4872 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:371
4877 #: ../src/guestfs-actions.pod:571
4878 msgid "You must call C<guestfs_launch> before calling this function."
4882 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:379
4884 "The reason is because we don't know what groups are supported by the "
4885 "appliance/daemon until it is running and can be queried."
4889 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:385
4891 "If a group of functions is available, this does not necessarily mean that "
4892 "they will work. You still have to check for errors when calling individual "
4893 "API functions even if they are available."
4897 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:392
4899 "It is usually the job of distro packagers to build complete functionality "
4900 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4901 "with all requirements satisfied, will support everything."
4905 #: ../src/guestfs-actions.pod:593
4907 "This call was added in version C<1.0.80>. In previous versions of "
4908 "libguestfs all you could do would be to speculatively execute a command to "
4909 "find out if the daemon implemented it. See also C<guestfs_version>."
4913 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:1163
4914 msgid "(Added in 1.0.80)"
4918 #: ../src/guestfs-actions.pod:604
4919 msgid "guestfs_available_all_groups"
4923 #: ../src/guestfs-actions.pod:606
4927 " guestfs_available_all_groups (guestfs_h *g);\n"
4932 #: ../src/guestfs-actions.pod:609
4934 "This command returns a list of all optional groups that this daemon knows "
4935 "about. Note this returns both supported and unsupported groups. To find "
4936 "out which ones the daemon can actually support you have to call "
4937 "C<guestfs_available> on each member of the returned list."
4941 #: ../src/guestfs-actions.pod:615
4942 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4946 #: ../src/guestfs-actions.pod:621
4947 msgid "(Added in 1.3.15)"
4951 #: ../src/guestfs-actions.pod:623
4952 msgid "guestfs_base64_in"
4956 #: ../src/guestfs-actions.pod:625
4960 " guestfs_base64_in (guestfs_h *g,\n"
4961 " const char *base64file,\n"
4962 " const char *filename);\n"
4967 #: ../src/guestfs-actions.pod:630 ../fish/guestfish-actions.pod:422
4968 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4972 #: ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649
4973 msgid "(Added in 1.3.5)"
4977 #: ../src/guestfs-actions.pod:637
4978 msgid "guestfs_base64_out"
4982 #: ../src/guestfs-actions.pod:639
4986 " guestfs_base64_out (guestfs_h *g,\n"
4987 " const char *filename,\n"
4988 " const char *base64file);\n"
4993 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:431
4995 "This command downloads the contents of C<filename>, writing it out to local "
4996 "file C<base64file> encoded as base64."
5000 #: ../src/guestfs-actions.pod:651
5001 msgid "guestfs_blockdev_flushbufs"
5005 #: ../src/guestfs-actions.pod:653
5009 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5010 " const char *device);\n"
5015 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:440
5016 msgid "This tells the kernel to flush internal buffers associated with C<device>."
5020 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:677 ../src/guestfs-actions.pod:692 ../src/guestfs-actions.pod:708 ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:777 ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454 ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473 ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498 ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517 ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5021 msgid "This uses the L<blockdev(8)> command."
5025 #: ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:681 ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781 ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
5026 msgid "(Added in 0.9.3)"
5030 #: ../src/guestfs-actions.pod:666
5031 msgid "guestfs_blockdev_getbsz"
5035 #: ../src/guestfs-actions.pod:668
5039 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5040 " const char *device);\n"
5045 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:449
5046 msgid "This returns the block size of a device."
5050 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5052 "(Note this is different from both I<size in blocks> and I<filesystem block "
5057 #: ../src/guestfs-actions.pod:683
5058 msgid "guestfs_blockdev_getro"
5062 #: ../src/guestfs-actions.pod:685
5066 " guestfs_blockdev_getro (guestfs_h *g,\n"
5067 " const char *device);\n"
5072 #: ../src/guestfs-actions.pod:689 ../fish/guestfish-actions.pod:460
5074 "Returns a boolean indicating if the block device is read-only (true if "
5075 "read-only, false if not)."
5079 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:1396 ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1891 ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2044 ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2817 ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:2876 ../src/guestfs-actions.pod:2891 ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2921 ../src/guestfs-actions.pod:2934 ../src/guestfs-actions.pod:2948 ../src/guestfs-actions.pod:2963 ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:4392
5080 msgid "This function returns a C truth value on success or -1 on error."
5084 #: ../src/guestfs-actions.pod:698
5085 msgid "guestfs_blockdev_getsize64"
5089 #: ../src/guestfs-actions.pod:700
5093 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5094 " const char *device);\n"
5099 #: ../src/guestfs-actions.pod:704 ../fish/guestfish-actions.pod:469
5100 msgid "This returns the size of the device in bytes."
5104 #: ../src/guestfs-actions.pod:706
5105 msgid "See also C<guestfs_blockdev_getsz>."
5109 #: ../src/guestfs-actions.pod:714
5110 msgid "guestfs_blockdev_getss"
5114 #: ../src/guestfs-actions.pod:716
5118 " guestfs_blockdev_getss (guestfs_h *g,\n"
5119 " const char *device);\n"
5124 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:479
5126 "This returns the size of sectors on a block device. Usually 512, but can be "
5127 "larger for modern devices."
5131 #: ../src/guestfs-actions.pod:723
5133 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5138 #: ../src/guestfs-actions.pod:732
5139 msgid "guestfs_blockdev_getsz"
5143 #: ../src/guestfs-actions.pod:734
5147 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5148 " const char *device);\n"
5153 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:491
5155 "This returns the size of the device in units of 512-byte sectors (even if "
5156 "the sectorsize isn't 512 bytes ... weird)."
5160 #: ../src/guestfs-actions.pod:741
5162 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5163 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5167 #: ../src/guestfs-actions.pod:751
5168 msgid "guestfs_blockdev_rereadpt"
5172 #: ../src/guestfs-actions.pod:753
5176 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5177 " const char *device);\n"
5182 #: ../src/guestfs-actions.pod:757 ../fish/guestfish-actions.pod:504
5183 msgid "Reread the partition table on C<device>."
5187 #: ../src/guestfs-actions.pod:765
5188 msgid "guestfs_blockdev_setbsz"
5192 #: ../src/guestfs-actions.pod:767
5196 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5197 " const char *device,\n"
5198 " int blocksize);\n"
5203 #: ../src/guestfs-actions.pod:772 ../fish/guestfish-actions.pod:512
5204 msgid "This sets the block size of a device."
5208 #: ../src/guestfs-actions.pod:783
5209 msgid "guestfs_blockdev_setro"
5213 #: ../src/guestfs-actions.pod:785
5217 " guestfs_blockdev_setro (guestfs_h *g,\n"
5218 " const char *device);\n"
5223 #: ../src/guestfs-actions.pod:789 ../fish/guestfish-actions.pod:523
5224 msgid "Sets the block device named C<device> to read-only."
5228 #: ../src/guestfs-actions.pod:797
5229 msgid "guestfs_blockdev_setrw"
5233 #: ../src/guestfs-actions.pod:799
5237 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5238 " const char *device);\n"
5243 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:531
5244 msgid "Sets the block device named C<device> to read-write."
5248 #: ../src/guestfs-actions.pod:811
5249 msgid "guestfs_case_sensitive_path"
5253 #: ../src/guestfs-actions.pod:813
5257 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5258 " const char *path);\n"
5263 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:539
5265 "This can be used to resolve case insensitive paths on a filesystem which is "
5266 "case sensitive. The use case is to resolve paths which you have read from "
5267 "Windows configuration files or the Windows Registry, to the true path."
5271 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:544
5273 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5274 "(and probably others), which is that although the underlying filesystem is "
5275 "case-insensitive, the driver exports the filesystem to Linux as "
5280 #: ../src/guestfs-actions.pod:827 ../fish/guestfish-actions.pod:549
5282 "One consequence of this is that special directories such as C<c:\\windows> "
5283 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5284 "precise details of how they were created. In Windows itself this would not "
5289 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:555
5291 "Bug or feature? You decide: "
5292 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
5296 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:558
5298 "This function resolves the true case of each element in the path and returns "
5299 "the case-sensitive path."
5303 #: ../src/guestfs-actions.pod:839
5305 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
5306 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5307 "how the directories were originally created under Windows)."
5311 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:566
5312 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5316 #: ../src/guestfs-actions.pod:847
5317 msgid "See also C<guestfs_realpath>."
5321 #: ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:6324
5322 msgid "(Added in 1.0.75)"
5326 #: ../src/guestfs-actions.pod:854
5331 #: ../src/guestfs-actions.pod:856
5335 " guestfs_cat (guestfs_h *g,\n"
5336 " const char *path);\n"
5341 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:4879 ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3221
5342 msgid "Return the contents of the file named C<path>."
5346 #: ../src/guestfs-actions.pod:862
5348 "Note that this function cannot correctly handle binary files (specifically, "
5349 "files containing C<\\0> character which is treated as end of string). For "
5350 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5351 "functions which have a more complex interface."
5355 #: ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:1049 ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1360 ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1482 ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1750 ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:2187 ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:2254 ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:2300 ../src/guestfs-actions.pod:4661 ../src/guestfs-actions.pod:4687 ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:4844 ../src/guestfs-actions.pod:4868 ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:5920 ../src/guestfs-actions.pod:5944 ../src/guestfs-actions.pod:6596 ../src/guestfs-actions.pod:6622 ../src/guestfs-actions.pod:6648 ../src/guestfs-actions.pod:6667 ../src/guestfs-actions.pod:6752 ../src/guestfs-actions.pod:6771 ../src/guestfs-actions.pod:6817 ../src/guestfs-actions.pod:6836 ../fish/guestfish-actions.pod:582 ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729 ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915 ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992 ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462 ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500 ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525 ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3091 ../fish/guestfish-actions.pod:3106 ../fish/guestfish-actions.pod:3182 ../fish/guestfish-actions.pod:3199 ../fish/guestfish-actions.pod:3214 ../fish/guestfish-actions.pod:3797 ../fish/guestfish-actions.pod:3843 ../fish/guestfish-actions.pod:3928 ../fish/guestfish-actions.pod:3943 ../fish/guestfish-actions.pod:4353 ../fish/guestfish-actions.pod:4371 ../fish/guestfish-actions.pod:4388 ../fish/guestfish-actions.pod:4398 ../fish/guestfish-actions.pod:4446 ../fish/guestfish-actions.pod:4456 ../fish/guestfish-actions.pod:4485 ../fish/guestfish-actions.pod:4495
5357 "Because of the message protocol, there is a transfer limit of somewhere "
5358 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5362 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:3059 ../src/guestfs-actions.pod:3121 ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3226 ../src/guestfs-actions.pod:3631 ../src/guestfs-actions.pod:3645 ../src/guestfs-actions.pod:4767 ../src/guestfs-actions.pod:4781 ../src/guestfs-actions.pod:6483 ../src/guestfs-actions.pod:6497
5363 msgid "(Added in 0.4)"
5367 #: ../src/guestfs-actions.pod:875
5368 msgid "guestfs_checksum"
5372 #: ../src/guestfs-actions.pod:877
5376 " guestfs_checksum (guestfs_h *g,\n"
5377 " const char *csumtype,\n"
5378 " const char *path);\n"
5383 #: ../src/guestfs-actions.pod:882 ../fish/guestfish-actions.pod:589
5384 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5388 #: ../src/guestfs-actions.pod:885 ../fish/guestfish-actions.pod:592
5390 "The type of checksum to compute is given by the C<csumtype> parameter which "
5391 "must have one of the following values:"
5395 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:597
5400 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:599
5402 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5407 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:602
5412 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:604
5413 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5417 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:606
5422 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:608
5423 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5427 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:610
5432 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:612
5433 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5437 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:614
5442 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:616
5443 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5447 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:618
5452 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:620
5453 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5457 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:622
5462 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:624
5463 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5467 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:628
5468 msgid "The checksum is returned as a printable string."
5472 #: ../src/guestfs-actions.pod:923
5473 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
5477 #: ../src/guestfs-actions.pod:925
5478 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
5482 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:1238 ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2862 ../src/guestfs-actions.pod:2923 ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:6185
5483 msgid "(Added in 1.0.2)"
5487 #: ../src/guestfs-actions.pod:932
5488 msgid "guestfs_checksum_device"
5492 #: ../src/guestfs-actions.pod:934
5496 " guestfs_checksum_device (guestfs_h *g,\n"
5497 " const char *csumtype,\n"
5498 " const char *device);\n"
5503 #: ../src/guestfs-actions.pod:939
5505 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5506 "device named C<device>. For the types of checksums supported see the "
5507 "C<guestfs_checksum> command."
5511 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:4357 ../src/guestfs-actions.pod:4394 ../src/guestfs-actions.pod:4412 ../src/guestfs-actions.pod:4588 ../src/guestfs-actions.pod:6099 ../src/guestfs-actions.pod:6113 ../src/guestfs-actions.pod:6509
5512 msgid "(Added in 1.3.2)"
5516 #: ../src/guestfs-actions.pod:948
5517 msgid "guestfs_checksums_out"
5521 #: ../src/guestfs-actions.pod:950
5525 " guestfs_checksums_out (guestfs_h *g,\n"
5526 " const char *csumtype,\n"
5527 " const char *directory,\n"
5528 " const char *sumsfile);\n"
5533 #: ../src/guestfs-actions.pod:956 ../fish/guestfish-actions.pod:646
5535 "This command computes the checksums of all regular files in C<directory> and "
5536 "then emits a list of those checksums to the local output file C<sumsfile>."
5540 #: ../src/guestfs-actions.pod:960 ../fish/guestfish-actions.pod:650
5542 "This can be used for verifying the integrity of a virtual machine. However "
5543 "to be properly secure you should pay attention to the output of the checksum "
5544 "command (it uses the ones from GNU coreutils). In particular when the "
5545 "filename is not printable, coreutils uses a special backslash syntax. For "
5546 "more information, see the GNU coreutils info file."
5550 #: ../src/guestfs-actions.pod:970
5551 msgid "(Added in 1.3.7)"
5555 #: ../src/guestfs-actions.pod:972
5556 msgid "guestfs_chmod"
5560 #: ../src/guestfs-actions.pod:974
5564 " guestfs_chmod (guestfs_h *g,\n"
5566 " const char *path);\n"
5571 #: ../src/guestfs-actions.pod:979 ../fish/guestfish-actions.pod:664
5573 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5578 #: ../src/guestfs-actions.pod:982 ../fish/guestfish-actions.pod:667
5580 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5581 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5586 #: ../src/guestfs-actions.pod:986 ../src/guestfs-actions.pod:3882 ../src/guestfs-actions.pod:3997 ../src/guestfs-actions.pod:4016 ../src/guestfs-actions.pod:4035 ../fish/guestfish-actions.pod:671 ../fish/guestfish-actions.pod:2581 ../fish/guestfish-actions.pod:2666 ../fish/guestfish-actions.pod:2676 ../fish/guestfish-actions.pod:2686
5587 msgid "The mode actually set is affected by the umask."
5591 #: ../src/guestfs-actions.pod:992
5592 msgid "guestfs_chown"
5596 #: ../src/guestfs-actions.pod:994
5600 " guestfs_chown (guestfs_h *g,\n"
5603 " const char *path);\n"
5608 #: ../src/guestfs-actions.pod:1000 ../fish/guestfish-actions.pod:677
5609 msgid "Change the file owner to C<owner> and group to C<group>."
5613 #: ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:3020 ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2059
5615 "Only numeric uid and gid are supported. If you want to use names, you will "
5616 "need to locate and parse the password file yourself (Augeas support makes "
5617 "this relatively easy)."
5621 #: ../src/guestfs-actions.pod:1010
5622 msgid "guestfs_command"
5626 #: ../src/guestfs-actions.pod:1012
5630 " guestfs_command (guestfs_h *g,\n"
5631 " char *const *arguments);\n"
5636 #: ../src/guestfs-actions.pod:1016 ../fish/guestfish-actions.pod:687
5638 "This call runs a command from the guest filesystem. The filesystem must be "
5639 "mounted, and must contain a compatible operating system (ie. something "
5640 "Linux, with the same or compatible processor architecture)."
5644 #: ../src/guestfs-actions.pod:1021
5646 "The single parameter is an argv-style list of arguments. The first element "
5647 "is the name of the program to run. Subsequent elements are parameters. The "
5648 "list must be non-empty (ie. must contain a program name). Note that the "
5649 "command runs directly, and is I<not> invoked via the shell (see "
5654 #: ../src/guestfs-actions.pod:1028 ../fish/guestfish-actions.pod:699
5655 msgid "The return value is anything printed to I<stdout> by the command."
5659 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:702
5661 "If the command returns a non-zero exit status, then this function returns an "
5662 "error message. The error message string is the content of I<stderr> from "
5667 #: ../src/guestfs-actions.pod:1035 ../fish/guestfish-actions.pod:706
5669 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5670 "C</bin>. If you require a program from another location, you should provide "
5671 "the full path in the first parameter."
5675 #: ../src/guestfs-actions.pod:1040 ../fish/guestfish-actions.pod:711
5677 "Shared libraries and data files required by the program must be available on "
5678 "filesystems which are mounted in the correct places. It is the caller's "
5679 "responsibility to ensure all filesystems that are needed are mounted at the "
5684 #: ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1535
5685 msgid "(Added in 0.9.1)"
5689 #: ../src/guestfs-actions.pod:1054
5690 msgid "guestfs_command_lines"
5694 #: ../src/guestfs-actions.pod:1056
5698 " guestfs_command_lines (guestfs_h *g,\n"
5699 " char *const *arguments);\n"
5704 #: ../src/guestfs-actions.pod:1060
5706 "This is the same as C<guestfs_command>, but splits the result into a list of "
5711 #: ../src/guestfs-actions.pod:1063
5712 msgid "See also: C<guestfs_sh_lines>"
5716 #: ../src/guestfs-actions.pod:1074
5717 msgid "guestfs_config"
5721 #: ../src/guestfs-actions.pod:1076
5725 " guestfs_config (guestfs_h *g,\n"
5726 " const char *qemuparam,\n"
5727 " const char *qemuvalue);\n"
5732 #: ../src/guestfs-actions.pod:1081 ../fish/guestfish-actions.pod:736
5734 "This can be used to add arbitrary qemu command line parameters of the form "
5735 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
5736 "setting some parameters which would interfere with parameters that we use."
5740 #: ../src/guestfs-actions.pod:1086 ../fish/guestfish-actions.pod:741
5741 msgid "The first character of C<param> string must be a C<-> (dash)."
5745 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:743
5746 msgid "C<value> can be NULL."
5750 #: ../src/guestfs-actions.pod:1094
5751 msgid "guestfs_copy_size"
5755 #: ../src/guestfs-actions.pod:1096
5759 " guestfs_copy_size (guestfs_h *g,\n"
5760 " const char *src,\n"
5761 " const char *dest,\n"
5767 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:749
5769 "This command copies exactly C<size> bytes from one source device or file "
5770 "C<src> to another destination device or file C<dest>."
5774 #: ../src/guestfs-actions.pod:1105 ../fish/guestfish-actions.pod:752
5776 "Note this will fail if the source is too short or if the destination is not "
5781 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:6688 ../src/guestfs-actions.pod:6707
5783 "This long-running command can generate progress notification messages so "
5784 "that the caller can display a progress bar or indicator. To receive these "
5785 "messages, the caller must register a progress callback. See "
5786 "L<guestfs(3)/guestfs_set_progress_callback>."
5790 #: ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:3658 ../src/guestfs-actions.pod:4794 ../src/guestfs-actions.pod:6416 ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:6522
5791 msgid "(Added in 1.0.87)"
5795 #: ../src/guestfs-actions.pod:1117
5800 #: ../src/guestfs-actions.pod:1119
5804 " guestfs_cp (guestfs_h *g,\n"
5805 " const char *src,\n"
5806 " const char *dest);\n"
5811 #: ../src/guestfs-actions.pod:1124 ../fish/guestfish-actions.pod:759
5813 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5814 "destination filename or destination directory."
5818 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1215 ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:4261 ../src/guestfs-actions.pod:4638
5819 msgid "(Added in 1.0.18)"
5823 #: ../src/guestfs-actions.pod:1131
5824 msgid "guestfs_cp_a"
5828 #: ../src/guestfs-actions.pod:1133
5832 " guestfs_cp_a (guestfs_h *g,\n"
5833 " const char *src,\n"
5834 " const char *dest);\n"
5839 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:766
5841 "This copies a file or directory from C<src> to C<dest> recursively using the "
5846 #: ../src/guestfs-actions.pod:1145
5851 #: ../src/guestfs-actions.pod:1147
5855 " guestfs_dd (guestfs_h *g,\n"
5856 " const char *src,\n"
5857 " const char *dest);\n"
5862 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:773
5864 "This command copies from one source device or file C<src> to another "
5865 "destination device or file C<dest>. Normally you would use this to copy to "
5866 "or from a device or partition, for example to duplicate a filesystem."
5870 #: ../src/guestfs-actions.pod:1157
5872 "If the destination is a device, it must be as large or larger than the "
5873 "source file or device, otherwise the copy will fail. This command cannot do "
5874 "partial copies (see C<guestfs_copy_size>)."
5878 #: ../src/guestfs-actions.pod:1165
5883 #: ../src/guestfs-actions.pod:1167
5887 " guestfs_df (guestfs_h *g);\n"
5892 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:786
5893 msgid "This command runs the C<df> command to report disk space used."
5897 #: ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:1189 ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
5899 "This command is mostly useful for interactive sessions. It is I<not> "
5900 "intended that you try to parse the output string. Use C<statvfs> from "
5905 #: ../src/guestfs-actions.pod:1179 ../src/guestfs-actions.pod:1196 ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2325 ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:4161 ../src/guestfs-actions.pod:5923 ../src/guestfs-actions.pod:5947 ../src/guestfs-actions.pod:6555 ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6581
5906 msgid "(Added in 1.0.54)"
5910 #: ../src/guestfs-actions.pod:1181
5911 msgid "guestfs_df_h"
5915 #: ../src/guestfs-actions.pod:1183
5919 " guestfs_df_h (guestfs_h *g);\n"
5924 #: ../src/guestfs-actions.pod:1186 ../fish/guestfish-actions.pod:796
5926 "This command runs the C<df -h> command to report disk space used in "
5927 "human-readable format."
5931 #: ../src/guestfs-actions.pod:1198
5932 msgid "guestfs_dmesg"
5936 #: ../src/guestfs-actions.pod:1200
5940 " guestfs_dmesg (guestfs_h *g);\n"
5945 #: ../src/guestfs-actions.pod:1203 ../fish/guestfish-actions.pod:807
5947 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5948 "This is sometimes useful for extended debugging of problems."
5952 #: ../src/guestfs-actions.pod:1207
5954 "Another way to get the same information is to enable verbose messages with "
5955 "C<guestfs_set_verbose> or by setting the environment variable "
5956 "C<LIBGUESTFS_DEBUG=1> before running the program."
5960 #: ../src/guestfs-actions.pod:1217
5961 msgid "guestfs_download"
5965 #: ../src/guestfs-actions.pod:1219
5969 " guestfs_download (guestfs_h *g,\n"
5970 " const char *remotefilename,\n"
5971 " const char *filename);\n"
5976 #: ../src/guestfs-actions.pod:1224 ../src/guestfs-actions.pod:1249 ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
5978 "Download file C<remotefilename> and save it as C<filename> on the local "
5983 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:6179 ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4101
5984 msgid "C<filename> can also be a named pipe."
5988 #: ../src/guestfs-actions.pod:1229
5989 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5993 #: ../src/guestfs-actions.pod:1240
5994 msgid "guestfs_download_offset"
5998 #: ../src/guestfs-actions.pod:1242
6002 " guestfs_download_offset (guestfs_h *g,\n"
6003 " const char *remotefilename,\n"
6004 " const char *filename,\n"
6005 " int64_t offset,\n"
6011 #: ../src/guestfs-actions.pod:1252 ../fish/guestfish-actions.pod:836
6013 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6014 "region must be within the file or device)."
6018 #: ../src/guestfs-actions.pod:1255
6020 "Note that there is no limit on the amount of data that can be downloaded "
6021 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6022 "full amount unless an error occurs."
6026 #: ../src/guestfs-actions.pod:1260
6027 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6031 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:6214
6032 msgid "(Added in 1.5.17)"
6036 #: ../src/guestfs-actions.pod:1271
6037 msgid "guestfs_drop_caches"
6041 #: ../src/guestfs-actions.pod:1273
6045 " guestfs_drop_caches (guestfs_h *g,\n"
6046 " int whattodrop);\n"
6051 #: ../src/guestfs-actions.pod:1277 ../fish/guestfish-actions.pod:852
6053 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6054 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6055 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6059 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:857
6060 msgid "Setting C<whattodrop> to 3 should drop everything."
6064 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:859
6066 "This automatically calls L<sync(2)> before the operation, so that the "
6067 "maximum guest memory is freed."
6071 #: ../src/guestfs-actions.pod:1291
6076 #: ../src/guestfs-actions.pod:1293
6080 " guestfs_du (guestfs_h *g,\n"
6081 " const char *path);\n"
6086 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:866
6088 "This command runs the C<du -s> command to estimate file space usage for "
6093 #: ../src/guestfs-actions.pod:1300 ../fish/guestfish-actions.pod:869
6095 "C<path> can be a file or a directory. If C<path> is a directory then the "
6096 "estimate includes the contents of the directory and all subdirectories "
6101 #: ../src/guestfs-actions.pod:1304 ../fish/guestfish-actions.pod:873
6102 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6106 #: ../src/guestfs-actions.pod:1311
6107 msgid "guestfs_e2fsck_f"
6111 #: ../src/guestfs-actions.pod:1313
6115 " guestfs_e2fsck_f (guestfs_h *g,\n"
6116 " const char *device);\n"
6121 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:880
6123 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6124 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6129 #: ../src/guestfs-actions.pod:1321
6131 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6132 "Normally you should use C<guestfs_fsck>."
6136 #: ../src/guestfs-actions.pod:1326
6137 msgid "(Added in 1.0.29)"
6141 #: ../src/guestfs-actions.pod:1328
6142 msgid "guestfs_echo_daemon"
6146 #: ../src/guestfs-actions.pod:1330
6150 " guestfs_echo_daemon (guestfs_h *g,\n"
6151 " char *const *words);\n"
6156 #: ../src/guestfs-actions.pod:1334 ../fish/guestfish-actions.pod:891
6158 "This command concatenates the list of C<words> passed with single spaces "
6159 "between them and returns the resulting string."
6163 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:894
6164 msgid "You can use this command to test the connection through to the daemon."
6168 #: ../src/guestfs-actions.pod:1339
6169 msgid "See also C<guestfs_ping_daemon>."
6173 #: ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:5427
6174 msgid "(Added in 1.0.69)"
6178 #: ../src/guestfs-actions.pod:1346
6179 msgid "guestfs_egrep"
6183 #: ../src/guestfs-actions.pod:1348
6187 " guestfs_egrep (guestfs_h *g,\n"
6188 " const char *regex,\n"
6189 " const char *path);\n"
6194 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:902
6195 msgid "This calls the external C<egrep> program and returns the matching lines."
6199 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1382 ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1485 ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:2171 ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2420 ../src/guestfs-actions.pod:2442 ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3151 ../src/guestfs-actions.pod:3165 ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:4096 ../src/guestfs-actions.pod:4972 ../src/guestfs-actions.pod:5021 ../src/guestfs-actions.pod:5791 ../src/guestfs-actions.pod:5803 ../src/guestfs-actions.pod:5816 ../src/guestfs-actions.pod:5829 ../src/guestfs-actions.pod:5851 ../src/guestfs-actions.pod:5864 ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:5890 ../src/guestfs-actions.pod:6651 ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:6755 ../src/guestfs-actions.pod:6774 ../src/guestfs-actions.pod:6820 ../src/guestfs-actions.pod:6839
6200 msgid "(Added in 1.0.66)"
6204 #: ../src/guestfs-actions.pod:1365
6205 msgid "guestfs_egrepi"
6209 #: ../src/guestfs-actions.pod:1367
6213 " guestfs_egrepi (guestfs_h *g,\n"
6214 " const char *regex,\n"
6215 " const char *path);\n"
6220 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:912
6221 msgid "This calls the external C<egrep -i> program and returns the matching lines."
6225 #: ../src/guestfs-actions.pod:1384
6226 msgid "guestfs_equal"
6230 #: ../src/guestfs-actions.pod:1386
6234 " guestfs_equal (guestfs_h *g,\n"
6235 " const char *file1,\n"
6236 " const char *file2);\n"
6241 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:922
6243 "This compares the two files C<file1> and C<file2> and returns true if their "
6244 "content is exactly equal, or false otherwise."
6248 #: ../src/guestfs-actions.pod:1394 ../fish/guestfish-actions.pod:925
6249 msgid "The external L<cmp(1)> program is used for the comparison."
6253 #: ../src/guestfs-actions.pod:1400
6254 msgid "guestfs_exists"
6258 #: ../src/guestfs-actions.pod:1402
6262 " guestfs_exists (guestfs_h *g,\n"
6263 " const char *path);\n"
6268 #: ../src/guestfs-actions.pod:1406 ../fish/guestfish-actions.pod:931
6270 "This returns C<true> if and only if there is a file, directory (or anything) "
6271 "with the given C<path> name."
6275 #: ../src/guestfs-actions.pod:1409
6276 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6280 #: ../src/guestfs-actions.pod:1415
6281 msgid "guestfs_fallocate"
6285 #: ../src/guestfs-actions.pod:1417
6289 " guestfs_fallocate (guestfs_h *g,\n"
6290 " const char *path,\n"
6296 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1448 ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6298 "This command preallocates a file (containing zero bytes) named C<path> of "
6299 "size C<len> bytes. If the file exists already, it is overwritten."
6303 #: ../src/guestfs-actions.pod:1426 ../fish/guestfish-actions.pod:944
6305 "Do not confuse this with the guestfish-specific C<alloc> command which "
6306 "allocates a file in the host and attaches it as a device."
6310 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:948
6312 "This function is deprecated. In new code, use the C<fallocate64> call "
6317 #: ../src/guestfs-actions.pod:1441
6318 msgid "guestfs_fallocate64"
6322 #: ../src/guestfs-actions.pod:1443
6326 " guestfs_fallocate64 (guestfs_h *g,\n"
6327 " const char *path,\n"
6333 #: ../src/guestfs-actions.pod:1452
6335 "Note that this call allocates disk blocks for the file. To create a sparse "
6336 "file use C<guestfs_truncate_size> instead."
6340 #: ../src/guestfs-actions.pod:1455
6342 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6343 "oversight it only allowed 30 bit lengths to be specified, effectively "
6344 "limiting the maximum size of files created through that call to 1GB."
6348 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:971
6350 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6351 "commands which create a file in the host and attach it as a device."
6355 #: ../src/guestfs-actions.pod:1466
6356 msgid "(Added in 1.3.17)"
6360 #: ../src/guestfs-actions.pod:1468
6361 msgid "guestfs_fgrep"
6365 #: ../src/guestfs-actions.pod:1470
6369 " guestfs_fgrep (guestfs_h *g,\n"
6370 " const char *pattern,\n"
6371 " const char *path);\n"
6376 #: ../src/guestfs-actions.pod:1475 ../fish/guestfish-actions.pod:979
6377 msgid "This calls the external C<fgrep> program and returns the matching lines."
6381 #: ../src/guestfs-actions.pod:1487
6382 msgid "guestfs_fgrepi"
6386 #: ../src/guestfs-actions.pod:1489
6390 " guestfs_fgrepi (guestfs_h *g,\n"
6391 " const char *pattern,\n"
6392 " const char *path);\n"
6397 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:989
6398 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
6402 #: ../src/guestfs-actions.pod:1506
6403 msgid "guestfs_file"
6407 #: ../src/guestfs-actions.pod:1508
6411 " guestfs_file (guestfs_h *g,\n"
6412 " const char *path);\n"
6417 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:999
6419 "This call uses the standard L<file(1)> command to determine the type or "
6420 "contents of the file."
6424 #: ../src/guestfs-actions.pod:1515 ../fish/guestfish-actions.pod:1002
6426 "This call will also transparently look inside various types of compressed "
6431 #: ../src/guestfs-actions.pod:1518 ../fish/guestfish-actions.pod:1005
6433 "The exact command which runs is C<file -zb path>. Note in particular that "
6434 "the filename is not prepended to the output (the C<-b> option)."
6438 #: ../src/guestfs-actions.pod:1522
6440 "This command can also be used on C</dev/> devices (and partitions, LV "
6441 "names). You can for example use this to determine if a device contains a "
6442 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
6446 #: ../src/guestfs-actions.pod:1527 ../fish/guestfish-actions.pod:1014
6448 "If the C<path> does not begin with C</dev/> then this command only works for "
6449 "the content of regular files. For other file types (directory, symbolic "
6450 "link etc) it will just return the string C<directory> etc."
6454 #: ../src/guestfs-actions.pod:1537
6455 msgid "guestfs_file_architecture"
6459 #: ../src/guestfs-actions.pod:1539
6463 " guestfs_file_architecture (guestfs_h *g,\n"
6464 " const char *filename);\n"
6469 #: ../src/guestfs-actions.pod:1543 ../fish/guestfish-actions.pod:1023
6471 "This detects the architecture of the binary C<filename>, and returns it if "
6476 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1026
6477 msgid "Currently defined architectures are:"
6481 #: ../src/guestfs-actions.pod:1550 ../fish/guestfish-actions.pod:1030
6486 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1032
6488 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6489 "irrespective of the precise processor requirements of the binary."
6493 #: ../src/guestfs-actions.pod:1555 ../fish/guestfish-actions.pod:1035
6498 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1037
6499 msgid "64 bit x86-64."
6503 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1039
6508 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1041
6509 msgid "32 bit SPARC."
6513 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1043
6518 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1045
6519 msgid "64 bit SPARC V9 and above."
6523 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1047
6528 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1049
6529 msgid "Intel Itanium."
6533 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1051
6538 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1053
6539 msgid "32 bit Power PC."
6543 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1055
6548 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1057
6549 msgid "64 bit Power PC."
6553 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1061
6554 msgid "Libguestfs may return other architecture strings in future."
6558 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1063
6559 msgid "The function works on at least the following types of files:"
6563 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1069
6564 msgid "many types of Un*x and Linux binary"
6568 #: ../src/guestfs-actions.pod:1593 ../fish/guestfish-actions.pod:1073
6569 msgid "many types of Un*x and Linux shared library"
6573 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1077
6574 msgid "Windows Win32 and Win64 binaries"
6578 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1081
6579 msgid "Windows Win32 and Win64 DLLs"
6583 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1083
6584 msgid "Win32 binaries and DLLs return C<i386>."
6588 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1085
6589 msgid "Win64 binaries and DLLs return C<x86_64>."
6593 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1089
6594 msgid "Linux kernel modules"
6598 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1093
6599 msgid "Linux new-style initrd images"
6603 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1097
6604 msgid "some non-x86 Linux vmlinuz kernels"
6608 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1101
6609 msgid "What it can't do currently:"
6613 #: ../src/guestfs-actions.pod:1627 ../fish/guestfish-actions.pod:1107
6614 msgid "static libraries (libfoo.a)"
6618 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1111
6619 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6623 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1115
6624 msgid "x86 Linux vmlinuz kernels"
6628 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1117
6630 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6631 "compressed code, and are horribly hard to unpack. If you want to find the "
6632 "architecture of a kernel, use the architecture of the associated initrd or "
6633 "kernel module(s) instead."
6637 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1810 ../src/guestfs-actions.pod:1827 ../src/guestfs-actions.pod:2478 ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2577 ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2625 ../src/guestfs-actions.pod:2658 ../src/guestfs-actions.pod:2682 ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:2804 ../src/guestfs-actions.pod:2936
6638 msgid "(Added in 1.5.3)"
6642 #: ../src/guestfs-actions.pod:1649
6643 msgid "guestfs_filesize"
6647 #: ../src/guestfs-actions.pod:1651
6651 " guestfs_filesize (guestfs_h *g,\n"
6652 " const char *file);\n"
6657 #: ../src/guestfs-actions.pod:1655 ../fish/guestfish-actions.pod:1128
6658 msgid "This command returns the size of C<file> in bytes."
6662 #: ../src/guestfs-actions.pod:1657
6664 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6665 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6666 "devices, use C<guestfs_blockdev_getsize64>."
6670 #: ../src/guestfs-actions.pod:1663
6671 msgid "(Added in 1.0.82)"
6675 #: ../src/guestfs-actions.pod:1665
6676 msgid "guestfs_fill"
6680 #: ../src/guestfs-actions.pod:1667
6684 " guestfs_fill (guestfs_h *g,\n"
6687 " const char *path);\n"
6692 #: ../src/guestfs-actions.pod:1673 ../fish/guestfish-actions.pod:1138
6694 "This command creates a new file called C<path>. The initial content of the "
6695 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6700 #: ../src/guestfs-actions.pod:1677
6702 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6703 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6704 "bytes use C<guestfs_fill_pattern>."
6708 #: ../src/guestfs-actions.pod:1689
6709 msgid "(Added in 1.0.79)"
6713 #: ../src/guestfs-actions.pod:1691
6714 msgid "guestfs_fill_pattern"
6718 #: ../src/guestfs-actions.pod:1693
6722 " guestfs_fill_pattern (guestfs_h *g,\n"
6723 " const char *pattern,\n"
6725 " const char *path);\n"
6730 #: ../src/guestfs-actions.pod:1699
6732 "This function is like C<guestfs_fill> except that it creates a new file of "
6733 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
6734 "pattern is truncated if necessary to ensure the length of the file is "
6735 "exactly C<len> bytes."
6739 #: ../src/guestfs-actions.pod:1711
6740 msgid "(Added in 1.3.12)"
6744 #: ../src/guestfs-actions.pod:1713
6745 msgid "guestfs_find"
6749 #: ../src/guestfs-actions.pod:1715
6753 " guestfs_find (guestfs_h *g,\n"
6754 " const char *directory);\n"
6759 #: ../src/guestfs-actions.pod:1719 ../fish/guestfish-actions.pod:1160
6761 "This command lists out all files and directories, recursively, starting at "
6762 "C<directory>. It is essentially equivalent to running the shell command "
6763 "C<find directory -print> but some post-processing happens on the output, "
6768 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1165
6770 "This returns a list of strings I<without any prefix>. Thus if the directory "
6775 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1168
6785 #: ../src/guestfs-actions.pod:1731
6786 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
6790 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1175
6801 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1180
6802 msgid "If C<directory> is not a directory, then this command returns an error."
6806 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1183
6807 msgid "The returned list is sorted."
6811 #: ../src/guestfs-actions.pod:1744
6812 msgid "See also C<guestfs_find0>."
6816 #: ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:3595 ../src/guestfs-actions.pod:5056
6817 msgid "(Added in 1.0.27)"
6821 #: ../src/guestfs-actions.pod:1755
6822 msgid "guestfs_find0"
6826 #: ../src/guestfs-actions.pod:1757
6830 " guestfs_find0 (guestfs_h *g,\n"
6831 " const char *directory,\n"
6832 " const char *files);\n"
6837 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1194
6839 "This command lists out all files and directories, recursively, starting at "
6840 "C<directory>, placing the resulting list in the external file called "
6845 #: ../src/guestfs-actions.pod:1766
6847 "This command works the same way as C<guestfs_find> with the following "
6852 #: ../src/guestfs-actions.pod:1773 ../fish/guestfish-actions.pod:1205
6853 msgid "The resulting list is written to an external file."
6857 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1209
6859 "Items (filenames) in the result are separated by C<\\0> characters. See "
6860 "L<find(1)> option I<-print0>."
6864 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1214
6865 msgid "This command is not limited in the number of names that it can return."
6869 #: ../src/guestfs-actions.pod:1787 ../fish/guestfish-actions.pod:1219
6870 msgid "The result list is not sorted."
6874 #: ../src/guestfs-actions.pod:1793
6875 msgid "(Added in 1.0.74)"
6879 #: ../src/guestfs-actions.pod:1795
6880 msgid "guestfs_findfs_label"
6884 #: ../src/guestfs-actions.pod:1797
6888 " guestfs_findfs_label (guestfs_h *g,\n"
6889 " const char *label);\n"
6894 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1229
6896 "This command searches the filesystems and returns the one which has the "
6897 "given label. An error is returned if no such filesystem can be found."
6901 #: ../src/guestfs-actions.pod:1805
6902 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6906 #: ../src/guestfs-actions.pod:1812
6907 msgid "guestfs_findfs_uuid"
6911 #: ../src/guestfs-actions.pod:1814
6915 " guestfs_findfs_uuid (guestfs_h *g,\n"
6916 " const char *uuid);\n"
6921 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1239
6923 "This command searches the filesystems and returns the one which has the "
6924 "given UUID. An error is returned if no such filesystem can be found."
6928 #: ../src/guestfs-actions.pod:1822
6929 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6933 #: ../src/guestfs-actions.pod:1829
6934 msgid "guestfs_fsck"
6938 #: ../src/guestfs-actions.pod:1831
6942 " guestfs_fsck (guestfs_h *g,\n"
6943 " const char *fstype,\n"
6944 " const char *device);\n"
6949 #: ../src/guestfs-actions.pod:1836 ../fish/guestfish-actions.pod:1249
6951 "This runs the filesystem checker (fsck) on C<device> which should have "
6952 "filesystem type C<fstype>."
6956 #: ../src/guestfs-actions.pod:1839 ../fish/guestfish-actions.pod:1252
6958 "The returned integer is the status. See L<fsck(8)> for the list of status "
6959 "codes from C<fsck>."
6963 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1261
6964 msgid "Multiple status codes can be summed together."
6968 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1265
6970 "A non-zero return code can mean \"success\", for example if errors have been "
6971 "corrected on the filesystem."
6975 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1270
6976 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6980 #: ../src/guestfs-actions.pod:1862 ../fish/guestfish-actions.pod:1275
6981 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6985 #: ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:6693
6986 msgid "(Added in 1.0.16)"
6990 #: ../src/guestfs-actions.pod:1868
6991 msgid "guestfs_get_append"
6995 #: ../src/guestfs-actions.pod:1870
6999 " guestfs_get_append (guestfs_h *g);\n"
7004 #: ../src/guestfs-actions.pod:1873 ../fish/guestfish-actions.pod:1281
7006 "Return the additional kernel options which are added to the guest kernel "
7011 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1284
7012 msgid "If C<NULL> then no options are added."
7016 #: ../src/guestfs-actions.pod:1878
7018 "This function returns a string which may be NULL. There is no way to return "
7019 "an error from this function. The string is owned by the guest handle and "
7020 "must I<not> be freed."
7024 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:4734 ../src/guestfs-actions.pod:5197 ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:5584 ../src/guestfs-actions.pod:5600 ../src/guestfs-actions.pod:5617 ../src/guestfs-actions.pod:6364 ../src/guestfs-actions.pod:6382 ../src/guestfs-actions.pod:6736
7025 msgid "(Added in 1.0.26)"
7029 #: ../src/guestfs-actions.pod:1884
7030 msgid "guestfs_get_autosync"
7034 #: ../src/guestfs-actions.pod:1886
7038 " guestfs_get_autosync (guestfs_h *g);\n"
7043 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1290
7044 msgid "Get the autosync flag."
7048 #: ../src/guestfs-actions.pod:1895
7049 msgid "guestfs_get_direct"
7053 #: ../src/guestfs-actions.pod:1897
7057 " guestfs_get_direct (guestfs_h *g);\n"
7062 #: ../src/guestfs-actions.pod:1900 ../fish/guestfish-actions.pod:1296
7063 msgid "Return the direct appliance mode flag."
7067 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:5238
7068 msgid "(Added in 1.0.72)"
7072 #: ../src/guestfs-actions.pod:1906
7073 msgid "guestfs_get_e2label"
7077 #: ../src/guestfs-actions.pod:1908
7081 " guestfs_get_e2label (guestfs_h *g,\n"
7082 " const char *device);\n"
7087 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1302
7088 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7092 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1305
7094 "This function is deprecated. In new code, use the C<vfs_label> call "
7099 #: ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:5256 ../src/guestfs-actions.pod:5275
7100 msgid "(Added in 1.0.15)"
7104 #: ../src/guestfs-actions.pod:1927
7105 msgid "guestfs_get_e2uuid"
7109 #: ../src/guestfs-actions.pod:1929
7113 " guestfs_get_e2uuid (guestfs_h *g,\n"
7114 " const char *device);\n"
7119 #: ../src/guestfs-actions.pod:1933 ../fish/guestfish-actions.pod:1316
7120 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7124 #: ../src/guestfs-actions.pod:1939 ../fish/guestfish-actions.pod:1319
7125 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7129 #: ../src/guestfs-actions.pod:1948
7130 msgid "guestfs_get_memsize"
7134 #: ../src/guestfs-actions.pod:1950
7138 " guestfs_get_memsize (guestfs_h *g);\n"
7143 #: ../src/guestfs-actions.pod:1953 ../fish/guestfish-actions.pod:1330
7144 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
7148 #: ../src/guestfs-actions.pod:1956
7150 "If C<guestfs_set_memsize> was not called on this handle, and if "
7151 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7152 "value for memsize."
7156 #: ../src/guestfs-actions.pod:1960 ../src/guestfs-actions.pod:2041 ../src/guestfs-actions.pod:5291 ../src/guestfs-actions.pod:5398 ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388 ../fish/guestfish-actions.pod:3508 ../fish/guestfish-actions.pod:3595
7157 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7161 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:3886 ../src/guestfs-actions.pod:4001 ../src/guestfs-actions.pod:4020 ../src/guestfs-actions.pod:4039 ../src/guestfs-actions.pod:4051 ../src/guestfs-actions.pod:4068 ../src/guestfs-actions.pod:4081 ../src/guestfs-actions.pod:4959 ../src/guestfs-actions.pod:5296 ../src/guestfs-actions.pod:5539 ../src/guestfs-actions.pod:6140
7162 msgid "(Added in 1.0.55)"
7166 #: ../src/guestfs-actions.pod:1967
7167 msgid "guestfs_get_network"
7171 #: ../src/guestfs-actions.pod:1969
7175 " guestfs_get_network (guestfs_h *g);\n"
7180 #: ../src/guestfs-actions.pod:1972 ../fish/guestfish-actions.pod:1344
7181 msgid "This returns the enable network flag."
7185 #: ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:5315
7186 msgid "(Added in 1.5.4)"
7190 #: ../src/guestfs-actions.pod:1978
7191 msgid "guestfs_get_path"
7195 #: ../src/guestfs-actions.pod:1980
7199 " guestfs_get_path (guestfs_h *g);\n"
7204 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1350
7205 msgid "Return the current search path."
7209 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1352
7211 "This is always non-NULL. If it wasn't set already, then this will return "
7216 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2017
7218 "This function returns a string, or NULL on error. The string is owned by "
7219 "the guest handle and must I<not> be freed."
7223 #: ../src/guestfs-actions.pod:1993
7224 msgid "guestfs_get_pid"
7228 #: ../src/guestfs-actions.pod:1995
7232 " guestfs_get_pid (guestfs_h *g);\n"
7237 #: ../src/guestfs-actions.pod:1998 ../fish/guestfish-actions.pod:1361
7239 "Return the process ID of the qemu subprocess. If there is no qemu "
7240 "subprocess, then this will return an error."
7244 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1364
7245 msgid "This is an internal call used for debugging and testing."
7249 #: ../src/guestfs-actions.pod:2005
7250 msgid "(Added in 1.0.56)"
7254 #: ../src/guestfs-actions.pod:2007
7255 msgid "guestfs_get_qemu"
7259 #: ../src/guestfs-actions.pod:2009
7263 " guestfs_get_qemu (guestfs_h *g);\n"
7268 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1370
7269 msgid "Return the current qemu binary."
7273 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1372
7275 "This is always non-NULL. If it wasn't set already, then this will return "
7276 "the default qemu binary name."
7280 #: ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:5360
7281 msgid "(Added in 1.0.6)"
7285 #: ../src/guestfs-actions.pod:2022
7286 msgid "guestfs_get_recovery_proc"
7290 #: ../src/guestfs-actions.pod:2024
7294 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7299 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1379
7300 msgid "Return the recovery process enabled flag."
7304 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3293 ../src/guestfs-actions.pod:3693 ../src/guestfs-actions.pod:3725 ../src/guestfs-actions.pod:4664 ../src/guestfs-actions.pod:5007 ../src/guestfs-actions.pod:5384 ../src/guestfs-actions.pod:6043 ../src/guestfs-actions.pod:6063 ../src/guestfs-actions.pod:6245
7305 msgid "(Added in 1.0.77)"
7309 #: ../src/guestfs-actions.pod:2033
7310 msgid "guestfs_get_selinux"
7314 #: ../src/guestfs-actions.pod:2035
7318 " guestfs_get_selinux (guestfs_h *g);\n"
7323 #: ../src/guestfs-actions.pod:2038
7325 "This returns the current setting of the selinux flag which is passed to the "
7326 "appliance at boot time. See C<guestfs_set_selinux>."
7330 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2109 ../src/guestfs-actions.pod:5403 ../src/guestfs-actions.pod:5457
7331 msgid "(Added in 1.0.67)"
7335 #: ../src/guestfs-actions.pod:2048
7336 msgid "guestfs_get_state"
7340 #: ../src/guestfs-actions.pod:2050
7344 " guestfs_get_state (guestfs_h *g);\n"
7349 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1395
7351 "This returns the current state as an opaque integer. This is only useful "
7352 "for printing debug and internal error messages."
7356 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:2829 ../src/guestfs-actions.pod:2858 ../src/guestfs-actions.pod:2919 ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:1398 ../fish/guestfish-actions.pod:1941 ../fish/guestfish-actions.pod:1959 ../fish/guestfish-actions.pod:1997 ../fish/guestfish-actions.pod:2013
7357 msgid "For more information on states, see L<guestfs(3)>."
7361 #: ../src/guestfs-actions.pod:2062
7362 msgid "guestfs_get_trace"
7366 #: ../src/guestfs-actions.pod:2064
7370 " guestfs_get_trace (guestfs_h *g);\n"
7375 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1404
7376 msgid "Return the command trace flag."
7380 #: ../src/guestfs-actions.pod:2073
7381 msgid "guestfs_get_umask"
7385 #: ../src/guestfs-actions.pod:2075
7389 " guestfs_get_umask (guestfs_h *g);\n"
7394 #: ../src/guestfs-actions.pod:2078
7396 "Return the current umask. By default the umask is C<022> unless it has been "
7397 "set by calling C<guestfs_umask>."
7401 #: ../src/guestfs-actions.pod:2085
7402 msgid "guestfs_get_verbose"
7406 #: ../src/guestfs-actions.pod:2087
7410 " guestfs_get_verbose (guestfs_h *g);\n"
7415 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1417
7416 msgid "This returns the verbose messages flag."
7420 #: ../src/guestfs-actions.pod:2096
7421 msgid "guestfs_getcon"
7425 #: ../src/guestfs-actions.pod:2098
7429 " guestfs_getcon (guestfs_h *g);\n"
7434 #: ../src/guestfs-actions.pod:2101 ../fish/guestfish-actions.pod:1423
7435 msgid "This gets the SELinux security context of the daemon."
7439 #: ../src/guestfs-actions.pod:2103
7440 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
7444 #: ../src/guestfs-actions.pod:2111
7445 msgid "guestfs_getxattrs"
7449 #: ../src/guestfs-actions.pod:2113
7452 " struct guestfs_xattr_list *\n"
7453 " guestfs_getxattrs (guestfs_h *g,\n"
7454 " const char *path);\n"
7459 #: ../src/guestfs-actions.pod:2117 ../fish/guestfish-actions.pod:1432
7460 msgid "This call lists the extended attributes of the file or directory C<path>."
7464 #: ../src/guestfs-actions.pod:2120 ../fish/guestfish-actions.pod:1435
7466 "At the system call level, this is a combination of the L<listxattr(2)> and "
7467 "L<getxattr(2)> calls."
7471 #: ../src/guestfs-actions.pod:2123
7472 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
7476 #: ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:3038 ../src/guestfs-actions.pod:3689
7478 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
7479 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
7483 #: ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:3042 ../src/guestfs-actions.pod:3207 ../src/guestfs-actions.pod:3243 ../src/guestfs-actions.pod:5037 ../src/guestfs-actions.pod:5476 ../src/guestfs-actions.pod:6801
7484 msgid "(Added in 1.0.59)"
7488 #: ../src/guestfs-actions.pod:2131
7489 msgid "guestfs_glob_expand"
7493 #: ../src/guestfs-actions.pod:2133
7497 " guestfs_glob_expand (guestfs_h *g,\n"
7498 " const char *pattern);\n"
7503 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1444
7505 "This command searches for all the pathnames matching C<pattern> according to "
7506 "the wildcard expansion rules used by the shell."
7510 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1448
7511 msgid "If no paths match, then this returns an empty list (note: not an error)."
7515 #: ../src/guestfs-actions.pod:2144 ../fish/guestfish-actions.pod:1451
7517 "It is just a wrapper around the C L<glob(3)> function with flags "
7518 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
7522 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:5658
7523 msgid "(Added in 1.0.50)"
7527 #: ../src/guestfs-actions.pod:2154
7528 msgid "guestfs_grep"
7532 #: ../src/guestfs-actions.pod:2156
7536 " guestfs_grep (guestfs_h *g,\n"
7537 " const char *regex,\n"
7538 " const char *path);\n"
7543 #: ../src/guestfs-actions.pod:2161 ../fish/guestfish-actions.pod:1459
7544 msgid "This calls the external C<grep> program and returns the matching lines."
7548 #: ../src/guestfs-actions.pod:2173
7549 msgid "guestfs_grepi"
7553 #: ../src/guestfs-actions.pod:2175
7557 " guestfs_grepi (guestfs_h *g,\n"
7558 " const char *regex,\n"
7559 " const char *path);\n"
7564 #: ../src/guestfs-actions.pod:2180 ../fish/guestfish-actions.pod:1469
7565 msgid "This calls the external C<grep -i> program and returns the matching lines."
7569 #: ../src/guestfs-actions.pod:2192
7570 msgid "guestfs_grub_install"
7574 #: ../src/guestfs-actions.pod:2194
7578 " guestfs_grub_install (guestfs_h *g,\n"
7579 " const char *root,\n"
7580 " const char *device);\n"
7585 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1479
7587 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7588 "the root directory being C<root>."
7592 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1482
7594 "Note: If grub-install reports the error \"No suitable drive was found in the "
7595 "generated device map.\" it may be that you need to create a "
7596 "C</boot/grub/device.map> file first that contains the mapping between grub "
7597 "device names and Linux device names. It is usually sufficient to create a "
7602 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1489
7610 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1491
7611 msgid "replacing C</dev/vda> with the name of the installation device."
7615 #: ../src/guestfs-actions.pod:2215
7616 msgid "(Added in 1.0.17)"
7620 #: ../src/guestfs-actions.pod:2217
7621 msgid "guestfs_head"
7625 #: ../src/guestfs-actions.pod:2219
7629 " guestfs_head (guestfs_h *g,\n"
7630 " const char *path);\n"
7635 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1497
7637 "This command returns up to the first 10 lines of a file as a list of "
7642 #: ../src/guestfs-actions.pod:2235
7643 msgid "guestfs_head_n"
7647 #: ../src/guestfs-actions.pod:2237
7651 " guestfs_head_n (guestfs_h *g,\n"
7653 " const char *path);\n"
7658 #: ../src/guestfs-actions.pod:2242 ../fish/guestfish-actions.pod:1507
7660 "If the parameter C<nrlines> is a positive number, this returns the first "
7661 "C<nrlines> lines of the file C<path>."
7665 #: ../src/guestfs-actions.pod:2245 ../fish/guestfish-actions.pod:1510
7667 "If the parameter C<nrlines> is a negative number, this returns lines from "
7668 "the file C<path>, excluding the last C<nrlines> lines."
7672 #: ../src/guestfs-actions.pod:2248 ../src/guestfs-actions.pod:5938 ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:3941
7673 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7677 #: ../src/guestfs-actions.pod:2259
7678 msgid "guestfs_hexdump"
7682 #: ../src/guestfs-actions.pod:2261
7686 " guestfs_hexdump (guestfs_h *g,\n"
7687 " const char *path);\n"
7692 #: ../src/guestfs-actions.pod:2265 ../fish/guestfish-actions.pod:1522
7694 "This runs C<hexdump -C> on the given C<path>. The result is the "
7695 "human-readable, canonical hex dump of the file."
7699 #: ../src/guestfs-actions.pod:2274 ../src/guestfs-actions.pod:5722 ../src/guestfs-actions.pod:5777
7700 msgid "(Added in 1.0.22)"
7704 #: ../src/guestfs-actions.pod:2276
7705 msgid "guestfs_initrd_cat"
7709 #: ../src/guestfs-actions.pod:2278
7713 " guestfs_initrd_cat (guestfs_h *g,\n"
7714 " const char *initrdpath,\n"
7715 " const char *filename,\n"
7716 " size_t *size_r);\n"
7721 #: ../src/guestfs-actions.pod:2284 ../fish/guestfish-actions.pod:1532
7723 "This command unpacks the file C<filename> from the initrd file called "
7724 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7729 #: ../src/guestfs-actions.pod:2288 ../fish/guestfish-actions.pod:1536
7731 "For example, in guestfish you could use the following command to examine the "
7732 "boot script (usually called C</init>) contained in a Linux initrd or "
7737 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1540
7740 " initrd-cat /boot/initrd-<version>.img init\n"
7745 #: ../src/guestfs-actions.pod:2294
7746 msgid "See also C<guestfs_initrd_list>."
7750 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:4657 ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:4864
7752 "This function returns a buffer, or NULL on error. The size of the returned "
7753 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
7758 #: ../src/guestfs-actions.pod:2305
7759 msgid "guestfs_initrd_list"
7763 #: ../src/guestfs-actions.pod:2307
7767 " guestfs_initrd_list (guestfs_h *g,\n"
7768 " const char *path);\n"
7773 #: ../src/guestfs-actions.pod:2311 ../fish/guestfish-actions.pod:1551
7774 msgid "This command lists out files contained in an initrd."
7778 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1553
7780 "The files are listed without any initial C</> character. The files are "
7781 "listed in the order they appear (not necessarily alphabetical). Directory "
7782 "names are listed as separate items."
7786 #: ../src/guestfs-actions.pod:2317 ../fish/guestfish-actions.pod:1557
7788 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7789 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7794 #: ../src/guestfs-actions.pod:2327
7795 msgid "guestfs_inotify_add_watch"
7799 #: ../src/guestfs-actions.pod:2329
7803 " guestfs_inotify_add_watch (guestfs_h *g,\n"
7804 " const char *path,\n"
7810 #: ../src/guestfs-actions.pod:2334 ../fish/guestfish-actions.pod:1565
7811 msgid "Watch C<path> for the events listed in C<mask>."
7815 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1567
7817 "Note that if C<path> is a directory then events within that directory are "
7818 "watched, but this does I<not> happen recursively (in subdirectories)."
7822 #: ../src/guestfs-actions.pod:2340 ../fish/guestfish-actions.pod:1571
7824 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7825 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7829 #: ../src/guestfs-actions.pod:2348
7830 msgid "guestfs_inotify_close"
7834 #: ../src/guestfs-actions.pod:2350
7838 " guestfs_inotify_close (guestfs_h *g);\n"
7843 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1579
7845 "This closes the inotify handle which was previously opened by inotify_init. "
7846 "It removes all watches, throws away any pending events, and deallocates all "
7851 #: ../src/guestfs-actions.pod:2361
7852 msgid "guestfs_inotify_files"
7856 #: ../src/guestfs-actions.pod:2363
7860 " guestfs_inotify_files (guestfs_h *g);\n"
7865 #: ../src/guestfs-actions.pod:2366
7867 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
7868 "returns a list of pathnames of objects that were touched. The returned "
7869 "pathnames are sorted and deduplicated."
7873 #: ../src/guestfs-actions.pod:2376
7874 msgid "guestfs_inotify_init"
7878 #: ../src/guestfs-actions.pod:2378
7882 " guestfs_inotify_init (guestfs_h *g,\n"
7883 " int maxevents);\n"
7888 #: ../src/guestfs-actions.pod:2382 ../fish/guestfish-actions.pod:1595
7890 "This command creates a new inotify handle. The inotify subsystem can be "
7891 "used to notify events which happen to objects in the guest filesystem."
7895 #: ../src/guestfs-actions.pod:2386
7897 "C<maxevents> is the maximum number of events which will be queued up between "
7898 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
7899 "passed as C<0>, then the kernel (or previously set) default is used. For "
7900 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
7901 "throws away events, but records the fact that it threw them away by setting "
7902 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
7903 "C<guestfs_inotify_read>)."
7907 #: ../src/guestfs-actions.pod:2396
7909 "Before any events are generated, you have to add some watches to the "
7910 "internal watch list. See: C<guestfs_inotify_add_watch>, "
7911 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
7915 #: ../src/guestfs-actions.pod:2402
7917 "Queued up events should be read periodically by calling "
7918 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
7919 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
7920 "often enough then you risk the internal queue overflowing."
7924 #: ../src/guestfs-actions.pod:2409
7926 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
7927 "This also removes any watches automatically."
7931 #: ../src/guestfs-actions.pod:2413 ../fish/guestfish-actions.pod:1626
7933 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7934 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7935 "that there is one global inotify handle per libguestfs instance."
7939 #: ../src/guestfs-actions.pod:2422
7940 msgid "guestfs_inotify_read"
7944 #: ../src/guestfs-actions.pod:2424
7947 " struct guestfs_inotify_event_list *\n"
7948 " guestfs_inotify_read (guestfs_h *g);\n"
7953 #: ../src/guestfs-actions.pod:2427 ../fish/guestfish-actions.pod:1635
7955 "Return the complete queue of events that have happened since the previous "
7960 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1638
7961 msgid "If no events have happened, this returns an empty list."
7965 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1640
7967 "I<Note>: In order to make sure that all events have been read, you must call "
7968 "this function repeatedly until it returns an empty list. The reason is that "
7969 "the call will read events up to the maximum appliance-to-host message size "
7970 "and leave remaining events in the queue."
7974 #: ../src/guestfs-actions.pod:2438
7976 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
7977 "there was an error. I<The caller must call "
7978 "C<guestfs_free_inotify_event_list> after use>."
7982 #: ../src/guestfs-actions.pod:2444
7983 msgid "guestfs_inotify_rm_watch"
7987 #: ../src/guestfs-actions.pod:2446
7991 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
7997 #: ../src/guestfs-actions.pod:2450
7999 "Remove a previously defined inotify watch. See "
8000 "C<guestfs_inotify_add_watch>."
8004 #: ../src/guestfs-actions.pod:2457
8005 msgid "guestfs_inspect_get_arch"
8009 #: ../src/guestfs-actions.pod:2459
8013 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8014 " const char *root);\n"
8019 #: ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:2486 ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2585 ../src/guestfs-actions.pod:2612 ../src/guestfs-actions.pod:2633 ../src/guestfs-actions.pod:2666 ../src/guestfs-actions.pod:2708 ../src/guestfs-actions.pod:2746
8021 "This function should only be called with a root device string as returned by "
8022 "C<guestfs_inspect_os>."
8026 #: ../src/guestfs-actions.pod:2466
8028 "This returns the architecture of the inspected operating system. The "
8029 "possible return values are listed under C<guestfs_file_architecture>."
8033 #: ../src/guestfs-actions.pod:2470 ../fish/guestfish-actions.pod:1664
8035 "If the architecture could not be determined, then the string C<unknown> is "
8040 #: ../src/guestfs-actions.pod:2473 ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:2600 ../src/guestfs-actions.pod:2677 ../src/guestfs-actions.pod:2696 ../src/guestfs-actions.pod:2733 ../src/guestfs-actions.pod:2756 ../src/guestfs-actions.pod:2796 ../fish/guestfish-actions.pod:1667 ../fish/guestfish-actions.pod:1733 ../fish/guestfish-actions.pod:1772 ../fish/guestfish-actions.pod:1827 ../fish/guestfish-actions.pod:1840 ../fish/guestfish-actions.pod:1871 ../fish/guestfish-actions.pod:1887 ../fish/guestfish-actions.pod:1921
8041 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8045 #: ../src/guestfs-actions.pod:2480
8046 msgid "guestfs_inspect_get_distro"
8050 #: ../src/guestfs-actions.pod:2482
8054 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8055 " const char *root);\n"
8060 #: ../src/guestfs-actions.pod:2489 ../fish/guestfish-actions.pod:1676
8061 msgid "This returns the distro (distribution) of the inspected operating system."
8065 #: ../src/guestfs-actions.pod:2492 ../fish/guestfish-actions.pod:1679
8066 msgid "Currently defined distros are:"
8070 #: ../src/guestfs-actions.pod:2496 ../fish/guestfish-actions.pod:1683
8071 msgid "\"archlinux\""
8075 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1685
8080 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1687
8085 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1689
8086 msgid "Debian or a Debian-derived distro such as Ubuntu."
8090 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1691
8095 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1693
8100 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1695
8105 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1697
8110 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1699
8115 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1701
8120 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1703
8125 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1705
8130 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1707
8131 msgid "\"redhat-based\""
8135 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1709
8136 msgid "Some Red Hat-derived distro."
8140 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1711
8145 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1713
8146 msgid "Red Hat Enterprise Linux and some derivatives."
8150 #: ../src/guestfs-actions.pod:2528 ../src/guestfs-actions.pod:2720 ../fish/guestfish-actions.pod:1715 ../fish/guestfish-actions.pod:1858
8155 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1717
8157 "Windows does not have distributions. This string is returned if the OS type "
8162 #: ../src/guestfs-actions.pod:2533 ../fish/guestfish-actions.pod:1720
8167 #: ../src/guestfs-actions.pod:2535 ../fish/guestfish-actions.pod:1722
8172 #: ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2724 ../fish/guestfish-actions.pod:1724 ../fish/guestfish-actions.pod:1862
8177 #: ../src/guestfs-actions.pod:2539 ../fish/guestfish-actions.pod:1726
8178 msgid "The distro could not be determined."
8182 #: ../src/guestfs-actions.pod:2543 ../src/guestfs-actions.pod:2730 ../fish/guestfish-actions.pod:1730 ../fish/guestfish-actions.pod:1868
8184 "Future versions of libguestfs may return other strings here. The caller "
8185 "should be prepared to handle any string."
8189 #: ../src/guestfs-actions.pod:2553
8190 msgid "guestfs_inspect_get_filesystems"
8194 #: ../src/guestfs-actions.pod:2555
8198 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8199 " const char *root);\n"
8204 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1742
8206 "This returns a list of all the filesystems that we think are associated with "
8207 "this operating system. This includes the root filesystem, other ordinary "
8208 "filesystems, and non-mounted devices like swap partitions."
8212 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:1747
8214 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8215 "to be shared between operating systems."
8219 #: ../src/guestfs-actions.pod:2570
8221 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8222 "C<guestfs_inspect_get_mountpoints>."
8226 #: ../src/guestfs-actions.pod:2579
8227 msgid "guestfs_inspect_get_major_version"
8231 #: ../src/guestfs-actions.pod:2581
8235 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
8236 " const char *root);\n"
8241 #: ../src/guestfs-actions.pod:2588 ../fish/guestfish-actions.pod:1760
8242 msgid "This returns the major version number of the inspected operating system."
8246 #: ../src/guestfs-actions.pod:2591 ../fish/guestfish-actions.pod:1763
8248 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8249 "popular public names used by the operating system. Notably the operating "
8250 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8251 "1). You can find out the real versions corresponding to releases of Windows "
8252 "by consulting Wikipedia or MSDN."
8256 #: ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2618 ../fish/guestfish-actions.pod:1770 ../fish/guestfish-actions.pod:1784
8257 msgid "If the version could not be determined, then C<0> is returned."
8261 #: ../src/guestfs-actions.pod:2606
8262 msgid "guestfs_inspect_get_minor_version"
8266 #: ../src/guestfs-actions.pod:2608
8270 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
8271 " const char *root);\n"
8276 #: ../src/guestfs-actions.pod:2615 ../fish/guestfish-actions.pod:1781
8277 msgid "This returns the minor version number of the inspected operating system."
8281 #: ../src/guestfs-actions.pod:2620
8283 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8284 "C<guestfs_inspect_get_major_version>."
8288 #: ../src/guestfs-actions.pod:2627
8289 msgid "guestfs_inspect_get_mountpoints"
8293 #: ../src/guestfs-actions.pod:2629
8297 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
8298 " const char *root);\n"
8303 #: ../src/guestfs-actions.pod:2636 ../fish/guestfish-actions.pod:1796
8305 "This returns a hash of where we think the filesystems associated with this "
8306 "operating system should be mounted. Callers should note that this is at "
8307 "best an educated guess made by reading configuration files such as "
8312 #: ../src/guestfs-actions.pod:2641 ../fish/guestfish-actions.pod:1801
8314 "Each element in the returned hashtable has a key which is the path of the "
8315 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8316 "mounted there (eg. C</dev/sda1>)."
8320 #: ../src/guestfs-actions.pod:2646 ../fish/guestfish-actions.pod:1806
8321 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
8325 #: ../src/guestfs-actions.pod:2649
8327 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8328 "C<guestfs_inspect_get_filesystems>."
8332 #: ../src/guestfs-actions.pod:2652 ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:4223 ../src/guestfs-actions.pod:6079
8334 "This function returns a NULL-terminated array of strings, or NULL if there "
8335 "was an error. The array of strings will always have length C<2n+1>, where "
8336 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
8337 "caller must free the strings and the array after use>."
8341 #: ../src/guestfs-actions.pod:2660
8342 msgid "guestfs_inspect_get_product_name"
8346 #: ../src/guestfs-actions.pod:2662
8350 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
8351 " const char *root);\n"
8356 #: ../src/guestfs-actions.pod:2669 ../fish/guestfish-actions.pod:1819
8358 "This returns the product name of the inspected operating system. The "
8359 "product name is generally some freeform string which can be displayed to the "
8360 "user, but should not be parsed by programs."
8364 #: ../src/guestfs-actions.pod:2674 ../fish/guestfish-actions.pod:1824
8366 "If the product name could not be determined, then the string C<unknown> is "
8371 #: ../src/guestfs-actions.pod:2684
8372 msgid "guestfs_inspect_get_roots"
8376 #: ../src/guestfs-actions.pod:2686
8380 " guestfs_inspect_get_roots (guestfs_h *g);\n"
8385 #: ../src/guestfs-actions.pod:2689
8387 "This function is a convenient way to get the list of root devices, as "
8388 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
8389 "the whole inspection process."
8393 #: ../src/guestfs-actions.pod:2693
8395 "This returns an empty list if either no root devices were found or the "
8396 "caller has not called C<guestfs_inspect_os>."
8400 #: ../src/guestfs-actions.pod:2702
8401 msgid "guestfs_inspect_get_type"
8405 #: ../src/guestfs-actions.pod:2704
8409 " guestfs_inspect_get_type (guestfs_h *g,\n"
8410 " const char *root);\n"
8415 #: ../src/guestfs-actions.pod:2711 ../fish/guestfish-actions.pod:1849
8417 "This returns the type of the inspected operating system. Currently defined "
8422 #: ../src/guestfs-actions.pod:2716 ../fish/guestfish-actions.pod:1854
8427 #: ../src/guestfs-actions.pod:2718 ../fish/guestfish-actions.pod:1856
8428 msgid "Any Linux-based operating system."
8432 #: ../src/guestfs-actions.pod:2722 ../fish/guestfish-actions.pod:1860
8433 msgid "Any Microsoft Windows operating system."
8437 #: ../src/guestfs-actions.pod:2726 ../fish/guestfish-actions.pod:1864
8438 msgid "The operating system type could not be determined."
8442 #: ../src/guestfs-actions.pod:2740
8443 msgid "guestfs_inspect_get_windows_systemroot"
8447 #: ../src/guestfs-actions.pod:2742
8451 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
8452 " const char *root);\n"
8457 #: ../src/guestfs-actions.pod:2749 ../fish/guestfish-actions.pod:1880
8459 "This returns the Windows systemroot of the inspected guest. The systemroot "
8460 "is a directory path such as C</WINDOWS>."
8464 #: ../src/guestfs-actions.pod:2752 ../fish/guestfish-actions.pod:1883
8466 "This call assumes that the guest is Windows and that the systemroot could be "
8467 "determined by inspection. If this is not the case then an error is "
8472 #: ../src/guestfs-actions.pod:2761
8473 msgid "(Added in 1.5.25)"
8477 #: ../src/guestfs-actions.pod:2763
8478 msgid "guestfs_inspect_os"
8482 #: ../src/guestfs-actions.pod:2765
8486 " guestfs_inspect_os (guestfs_h *g);\n"
8491 #: ../src/guestfs-actions.pod:2768 ../fish/guestfish-actions.pod:1893
8493 "This function uses other libguestfs functions and certain heuristics to "
8494 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8495 "for operating systems."
8499 #: ../src/guestfs-actions.pod:2772 ../fish/guestfish-actions.pod:1897
8500 msgid "The list returned is empty if no operating systems were found."
8504 #: ../src/guestfs-actions.pod:2774 ../fish/guestfish-actions.pod:1899
8506 "If one operating system was found, then this returns a list with a single "
8507 "element, which is the name of the root filesystem of this operating system. "
8508 "It is also possible for this function to return a list containing more than "
8509 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8510 "element being the root filesystem of one of the operating systems."
8514 #: ../src/guestfs-actions.pod:2781
8516 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
8517 "functions in order to query further information about each operating system, "
8518 "such as the name and version."
8522 #: ../src/guestfs-actions.pod:2786
8524 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
8525 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
8526 "the contents. This should be called with no disks currently mounted. The "
8527 "function may also use Augeas, so any existing Augeas handle will be closed."
8531 #: ../src/guestfs-actions.pod:2792 ../fish/guestfish-actions.pod:1917
8533 "This function cannot decrypt encrypted disks. The caller must do that first "
8534 "(supplying the necessary keys) if the disk is encrypted."
8538 #: ../src/guestfs-actions.pod:2798 ../src/guestfs-actions.pod:3053 ../src/guestfs-actions.pod:3115
8539 msgid "See also C<guestfs_list_filesystems>."
8543 #: ../src/guestfs-actions.pod:2806
8544 msgid "guestfs_is_blockdev"
8548 #: ../src/guestfs-actions.pod:2808
8552 " guestfs_is_blockdev (guestfs_h *g,\n"
8553 " const char *path);\n"
8558 #: ../src/guestfs-actions.pod:2812 ../fish/guestfish-actions.pod:1929
8560 "This returns C<true> if and only if there is a block device with the given "
8565 #: ../src/guestfs-actions.pod:2815 ../src/guestfs-actions.pod:2844 ../src/guestfs-actions.pod:2874 ../src/guestfs-actions.pod:2889 ../src/guestfs-actions.pod:2905 ../src/guestfs-actions.pod:2961 ../src/guestfs-actions.pod:2976
8566 msgid "See also C<guestfs_stat>."
8570 #: ../src/guestfs-actions.pod:2819 ../src/guestfs-actions.pod:2848 ../src/guestfs-actions.pod:2893 ../src/guestfs-actions.pod:2965 ../src/guestfs-actions.pod:2980
8571 msgid "(Added in 1.5.10)"
8575 #: ../src/guestfs-actions.pod:2821
8576 msgid "guestfs_is_busy"
8580 #: ../src/guestfs-actions.pod:2823
8584 " guestfs_is_busy (guestfs_h *g);\n"
8589 #: ../src/guestfs-actions.pod:2826 ../fish/guestfish-actions.pod:1938
8591 "This returns true iff this handle is busy processing a command (in the "
8596 #: ../src/guestfs-actions.pod:2835
8597 msgid "guestfs_is_chardev"
8601 #: ../src/guestfs-actions.pod:2837
8605 " guestfs_is_chardev (guestfs_h *g,\n"
8606 " const char *path);\n"
8611 #: ../src/guestfs-actions.pod:2841 ../fish/guestfish-actions.pod:1947
8613 "This returns C<true> if and only if there is a character device with the "
8614 "given C<path> name."
8618 #: ../src/guestfs-actions.pod:2850
8619 msgid "guestfs_is_config"
8623 #: ../src/guestfs-actions.pod:2852
8627 " guestfs_is_config (guestfs_h *g);\n"
8632 #: ../src/guestfs-actions.pod:2855 ../fish/guestfish-actions.pod:1956
8634 "This returns true iff this handle is being configured (in the C<CONFIG> "
8639 #: ../src/guestfs-actions.pod:2864
8640 msgid "guestfs_is_dir"
8644 #: ../src/guestfs-actions.pod:2866
8648 " guestfs_is_dir (guestfs_h *g,\n"
8649 " const char *path);\n"
8654 #: ../src/guestfs-actions.pod:2870 ../fish/guestfish-actions.pod:1965
8656 "This returns C<true> if and only if there is a directory with the given "
8657 "C<path> name. Note that it returns false for other objects like files."
8661 #: ../src/guestfs-actions.pod:2880
8662 msgid "guestfs_is_fifo"
8666 #: ../src/guestfs-actions.pod:2882
8670 " guestfs_is_fifo (guestfs_h *g,\n"
8671 " const char *path);\n"
8676 #: ../src/guestfs-actions.pod:2886 ../fish/guestfish-actions.pod:1975
8678 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8679 "given C<path> name."
8683 #: ../src/guestfs-actions.pod:2895
8684 msgid "guestfs_is_file"
8688 #: ../src/guestfs-actions.pod:2897
8692 " guestfs_is_file (guestfs_h *g,\n"
8693 " const char *path);\n"
8698 #: ../src/guestfs-actions.pod:2901 ../fish/guestfish-actions.pod:1984
8700 "This returns C<true> if and only if there is a regular file with the given "
8701 "C<path> name. Note that it returns false for other objects like "
8706 #: ../src/guestfs-actions.pod:2911
8707 msgid "guestfs_is_launching"
8711 #: ../src/guestfs-actions.pod:2913
8715 " guestfs_is_launching (guestfs_h *g);\n"
8720 #: ../src/guestfs-actions.pod:2916 ../fish/guestfish-actions.pod:1994
8722 "This returns true iff this handle is launching the subprocess (in the "
8723 "C<LAUNCHING> state)."
8727 #: ../src/guestfs-actions.pod:2925
8728 msgid "guestfs_is_lv"
8732 #: ../src/guestfs-actions.pod:2927
8736 " guestfs_is_lv (guestfs_h *g,\n"
8737 " const char *device);\n"
8742 #: ../src/guestfs-actions.pod:2931 ../fish/guestfish-actions.pod:2003
8744 "This command tests whether C<device> is a logical volume, and returns true "
8745 "iff this is the case."
8749 #: ../src/guestfs-actions.pod:2938
8750 msgid "guestfs_is_ready"
8754 #: ../src/guestfs-actions.pod:2940
8758 " guestfs_is_ready (guestfs_h *g);\n"
8763 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2010
8765 "This returns true iff this handle is ready to accept commands (in the "
8770 #: ../src/guestfs-actions.pod:2952
8771 msgid "guestfs_is_socket"
8775 #: ../src/guestfs-actions.pod:2954
8779 " guestfs_is_socket (guestfs_h *g,\n"
8780 " const char *path);\n"
8785 #: ../src/guestfs-actions.pod:2958 ../fish/guestfish-actions.pod:2019
8787 "This returns C<true> if and only if there is a Unix domain socket with the "
8788 "given C<path> name."
8792 #: ../src/guestfs-actions.pod:2967
8793 msgid "guestfs_is_symlink"
8797 #: ../src/guestfs-actions.pod:2969
8801 " guestfs_is_symlink (guestfs_h *g,\n"
8802 " const char *path);\n"
8807 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2028
8809 "This returns C<true> if and only if there is a symbolic link with the given "
8814 #: ../src/guestfs-actions.pod:2982
8815 msgid "guestfs_kill_subprocess"
8819 #: ../src/guestfs-actions.pod:2984
8823 " guestfs_kill_subprocess (guestfs_h *g);\n"
8828 #: ../src/guestfs-actions.pod:2987 ../fish/guestfish-actions.pod:2037
8829 msgid "This kills the qemu subprocess. You should never need to call this."
8833 #: ../src/guestfs-actions.pod:2993
8834 msgid "guestfs_launch"
8838 #: ../src/guestfs-actions.pod:2995
8842 " guestfs_launch (guestfs_h *g);\n"
8847 #: ../src/guestfs-actions.pod:2998 ../fish/guestfish-actions.pod:2045
8849 "Internally libguestfs is implemented by running a virtual machine using "
8854 #: ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:2048
8856 "You should call this after configuring the handle (eg. adding drives) but "
8857 "before performing any actions."
8861 #: ../src/guestfs-actions.pod:3008
8862 msgid "guestfs_lchown"
8866 #: ../src/guestfs-actions.pod:3010
8870 " guestfs_lchown (guestfs_h *g,\n"
8873 " const char *path);\n"
8878 #: ../src/guestfs-actions.pod:3016
8880 "Change the file owner to C<owner> and group to C<group>. This is like "
8881 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8882 "changed, not the target."
8886 #: ../src/guestfs-actions.pod:3028
8887 msgid "guestfs_lgetxattrs"
8891 #: ../src/guestfs-actions.pod:3030
8894 " struct guestfs_xattr_list *\n"
8895 " guestfs_lgetxattrs (guestfs_h *g,\n"
8896 " const char *path);\n"
8901 #: ../src/guestfs-actions.pod:3034
8903 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8904 "then it returns the extended attributes of the link itself."
8908 #: ../src/guestfs-actions.pod:3044
8909 msgid "guestfs_list_devices"
8913 #: ../src/guestfs-actions.pod:3046
8917 " guestfs_list_devices (guestfs_h *g);\n"
8922 #: ../src/guestfs-actions.pod:3049 ../fish/guestfish-actions.pod:2075
8923 msgid "List all the block devices."
8927 #: ../src/guestfs-actions.pod:3051 ../fish/guestfish-actions.pod:2077
8928 msgid "The full block device names are returned, eg. C</dev/sda>."
8932 #: ../src/guestfs-actions.pod:3061
8933 msgid "guestfs_list_filesystems"
8937 #: ../src/guestfs-actions.pod:3063
8941 " guestfs_list_filesystems (guestfs_h *g);\n"
8946 #: ../src/guestfs-actions.pod:3066 ../fish/guestfish-actions.pod:2085
8948 "This inspection command looks for filesystems on partitions, block devices "
8949 "and logical volumes, returning a list of devices containing filesystems and "
8954 #: ../src/guestfs-actions.pod:3070 ../fish/guestfish-actions.pod:2089
8956 "The return value is a hash, where the keys are the devices containing "
8957 "filesystems, and the values are the filesystem types. For example:"
8961 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2093
8964 " \"/dev/sda1\" => \"ntfs\"\n"
8965 " \"/dev/sda2\" => \"ext2\"\n"
8966 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8967 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8972 #: ../src/guestfs-actions.pod:3079 ../fish/guestfish-actions.pod:2098
8974 "The value can have the special value \"unknown\", meaning the content of the "
8975 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8979 #: ../src/guestfs-actions.pod:3083
8981 "This command runs other libguestfs commands, which might include "
8982 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8983 "soon after launch and only when nothing is mounted."
8987 #: ../src/guestfs-actions.pod:3087
8989 "Not all of the filesystems returned will be mountable. In particular, swap "
8990 "partitions are returned in the list. Also this command does not check that "
8991 "each filesystem found is valid and mountable, and some filesystems might be "
8992 "mountable but require special options. Filesystems may not all belong to a "
8993 "single logical operating system (use C<guestfs_inspect_os> to look for "
8998 #: ../src/guestfs-actions.pod:3101 ../src/guestfs-actions.pod:4624
8999 msgid "(Added in 1.5.15)"
9003 #: ../src/guestfs-actions.pod:3103
9004 msgid "guestfs_list_partitions"
9008 #: ../src/guestfs-actions.pod:3105
9012 " guestfs_list_partitions (guestfs_h *g);\n"
9017 #: ../src/guestfs-actions.pod:3108 ../fish/guestfish-actions.pod:2118
9018 msgid "List all the partitions detected on all block devices."
9022 #: ../src/guestfs-actions.pod:3110 ../fish/guestfish-actions.pod:2120
9023 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9027 #: ../src/guestfs-actions.pod:3112
9029 "This does not return logical volumes. For that you will need to call "
9034 #: ../src/guestfs-actions.pod:3123
9039 #: ../src/guestfs-actions.pod:3125
9043 " guestfs_ll (guestfs_h *g,\n"
9044 " const char *directory);\n"
9049 #: ../src/guestfs-actions.pod:3129 ../fish/guestfish-actions.pod:2131
9051 "List the files in C<directory> (relative to the root directory, there is no "
9052 "cwd) in the format of 'ls -la'."
9056 #: ../src/guestfs-actions.pod:3132 ../fish/guestfish-actions.pod:2134
9058 "This command is mostly useful for interactive sessions. It is I<not> "
9059 "intended that you try to parse the output string."
9063 #: ../src/guestfs-actions.pod:3140
9068 #: ../src/guestfs-actions.pod:3142
9072 " guestfs_ln (guestfs_h *g,\n"
9073 " const char *target,\n"
9074 " const char *linkname);\n"
9079 #: ../src/guestfs-actions.pod:3147 ../fish/guestfish-actions.pod:2141
9080 msgid "This command creates a hard link using the C<ln> command."
9084 #: ../src/guestfs-actions.pod:3153
9085 msgid "guestfs_ln_f"
9089 #: ../src/guestfs-actions.pod:3155
9093 " guestfs_ln_f (guestfs_h *g,\n"
9094 " const char *target,\n"
9095 " const char *linkname);\n"
9100 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2147
9102 "This command creates a hard link using the C<ln -f> command. The C<-f> "
9103 "option removes the link (C<linkname>) if it exists already."
9107 #: ../src/guestfs-actions.pod:3167
9108 msgid "guestfs_ln_s"
9112 #: ../src/guestfs-actions.pod:3169
9116 " guestfs_ln_s (guestfs_h *g,\n"
9117 " const char *target,\n"
9118 " const char *linkname);\n"
9123 #: ../src/guestfs-actions.pod:3174 ../fish/guestfish-actions.pod:2154
9124 msgid "This command creates a symbolic link using the C<ln -s> command."
9128 #: ../src/guestfs-actions.pod:3180
9129 msgid "guestfs_ln_sf"
9133 #: ../src/guestfs-actions.pod:3182
9137 " guestfs_ln_sf (guestfs_h *g,\n"
9138 " const char *target,\n"
9139 " const char *linkname);\n"
9144 #: ../src/guestfs-actions.pod:3187 ../fish/guestfish-actions.pod:2160
9146 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
9147 "option removes the link (C<linkname>) if it exists already."
9151 #: ../src/guestfs-actions.pod:3194
9152 msgid "guestfs_lremovexattr"
9156 #: ../src/guestfs-actions.pod:3196
9160 " guestfs_lremovexattr (guestfs_h *g,\n"
9161 " const char *xattr,\n"
9162 " const char *path);\n"
9167 #: ../src/guestfs-actions.pod:3201
9169 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
9170 "link, then it removes an extended attribute of the link itself."
9174 #: ../src/guestfs-actions.pod:3209
9179 #: ../src/guestfs-actions.pod:3211
9183 " guestfs_ls (guestfs_h *g,\n"
9184 " const char *directory);\n"
9189 #: ../src/guestfs-actions.pod:3215 ../fish/guestfish-actions.pod:2175
9191 "List the files in C<directory> (relative to the root directory, there is no "
9192 "cwd). The '.' and '..' entries are not returned, but hidden files are "
9197 #: ../src/guestfs-actions.pod:3219
9199 "This command is mostly useful for interactive sessions. Programs should "
9200 "probably use C<guestfs_readdir> instead."
9204 #: ../src/guestfs-actions.pod:3228
9205 msgid "guestfs_lsetxattr"
9209 #: ../src/guestfs-actions.pod:3230
9213 " guestfs_lsetxattr (guestfs_h *g,\n"
9214 " const char *xattr,\n"
9215 " const char *val,\n"
9217 " const char *path);\n"
9222 #: ../src/guestfs-actions.pod:3237
9224 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
9225 "then it sets an extended attribute of the link itself."
9229 #: ../src/guestfs-actions.pod:3245
9230 msgid "guestfs_lstat"
9234 #: ../src/guestfs-actions.pod:3247
9237 " struct guestfs_stat *\n"
9238 " guestfs_lstat (guestfs_h *g,\n"
9239 " const char *path);\n"
9244 #: ../src/guestfs-actions.pod:3251 ../src/guestfs-actions.pod:5678 ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:3776
9245 msgid "Returns file information for the given C<path>."
9249 #: ../src/guestfs-actions.pod:3253
9251 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
9252 "link, then the link is stat-ed, not the file it refers to."
9256 #: ../src/guestfs-actions.pod:3257 ../fish/guestfish-actions.pod:2200
9257 msgid "This is the same as the C<lstat(2)> system call."
9261 #: ../src/guestfs-actions.pod:3259 ../src/guestfs-actions.pod:5682
9263 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
9264 "error. I<The caller must call C<guestfs_free_stat> after use>."
9268 #: ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:5686 ../src/guestfs-actions.pod:5704 ../src/guestfs-actions.pod:6085
9269 msgid "(Added in 0.9.2)"
9273 #: ../src/guestfs-actions.pod:3265
9274 msgid "guestfs_lstatlist"
9278 #: ../src/guestfs-actions.pod:3267
9281 " struct guestfs_stat_list *\n"
9282 " guestfs_lstatlist (guestfs_h *g,\n"
9283 " const char *path,\n"
9284 " char *const *names);\n"
9289 #: ../src/guestfs-actions.pod:3272
9291 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
9292 "files, where all files are in the directory C<path>. C<names> is the list "
9293 "of files from this directory."
9297 #: ../src/guestfs-actions.pod:3276 ../fish/guestfish-actions.pod:2210
9299 "On return you get a list of stat structs, with a one-to-one correspondence "
9300 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9301 "then the C<ino> field of that structure is set to C<-1>."
9305 #: ../src/guestfs-actions.pod:3281
9307 "This call is intended for programs that want to efficiently list a directory "
9308 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
9309 "for a similarly efficient call for getting extended attributes. Very long "
9310 "directory listings might cause the protocol message size to be exceeded, "
9311 "causing this call to fail. The caller must split up such requests into "
9312 "smaller groups of names."
9316 #: ../src/guestfs-actions.pod:3289
9318 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
9319 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
9323 #: ../src/guestfs-actions.pod:3295
9324 msgid "guestfs_luks_add_key"
9328 #: ../src/guestfs-actions.pod:3297
9332 " guestfs_luks_add_key (guestfs_h *g,\n"
9333 " const char *device,\n"
9334 " const char *key,\n"
9335 " const char *newkey,\n"
9341 #: ../src/guestfs-actions.pod:3304 ../fish/guestfish-actions.pod:2227
9343 "This command adds a new key on LUKS device C<device>. C<key> is any "
9344 "existing key, and is used to access the device. C<newkey> is the new key to "
9345 "add. C<keyslot> is the key slot that will be replaced."
9349 #: ../src/guestfs-actions.pod:3309
9351 "Note that if C<keyslot> already contains a key, then this command will "
9352 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
9356 #: ../src/guestfs-actions.pod:3315 ../src/guestfs-actions.pod:3355 ../src/guestfs-actions.pod:3378 ../src/guestfs-actions.pod:3398 ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3449
9358 "This function takes a key or passphrase parameter which could contain "
9359 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
9364 #: ../src/guestfs-actions.pod:3319 ../src/guestfs-actions.pod:3359 ../src/guestfs-actions.pod:3382 ../src/guestfs-actions.pod:3402
9365 msgid "(Added in 1.5.2)"
9369 #: ../src/guestfs-actions.pod:3321
9370 msgid "guestfs_luks_close"
9374 #: ../src/guestfs-actions.pod:3323
9378 " guestfs_luks_close (guestfs_h *g,\n"
9379 " const char *device);\n"
9384 #: ../src/guestfs-actions.pod:3327
9386 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
9387 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
9388 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9389 "underlying block device."
9393 #: ../src/guestfs-actions.pod:3335 ../src/guestfs-actions.pod:3434 ../src/guestfs-actions.pod:3453 ../src/guestfs-actions.pod:3503 ../src/guestfs-actions.pod:3551
9394 msgid "(Added in 1.5.1)"
9398 #: ../src/guestfs-actions.pod:3337
9399 msgid "guestfs_luks_format"
9403 #: ../src/guestfs-actions.pod:3339
9407 " guestfs_luks_format (guestfs_h *g,\n"
9408 " const char *device,\n"
9409 " const char *key,\n"
9415 #: ../src/guestfs-actions.pod:3345 ../fish/guestfish-actions.pod:2253
9417 "This command erases existing data on C<device> and formats the device as a "
9418 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9419 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9423 #: ../src/guestfs-actions.pod:3352 ../src/guestfs-actions.pod:3375 ../src/guestfs-actions.pod:3515 ../src/guestfs-actions.pod:4375 ../src/guestfs-actions.pod:5138 ../src/guestfs-actions.pod:5513 ../src/guestfs-actions.pod:5536 ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:6712 ../fish/guestfish-actions.pod:2261 ../fish/guestfish-actions.pod:2274 ../fish/guestfish-actions.pod:2358 ../fish/guestfish-actions.pod:2888 ../fish/guestfish-actions.pod:3395 ../fish/guestfish-actions.pod:3675 ../fish/guestfish-actions.pod:3691 ../fish/guestfish-actions.pod:3706 ../fish/guestfish-actions.pod:4421
9425 "B<This command is dangerous. Without careful use you can easily destroy all "
9430 #: ../src/guestfs-actions.pod:3361
9431 msgid "guestfs_luks_format_cipher"
9435 #: ../src/guestfs-actions.pod:3363
9439 " guestfs_luks_format_cipher (guestfs_h *g,\n"
9440 " const char *device,\n"
9441 " const char *key,\n"
9443 " const char *cipher);\n"
9448 #: ../src/guestfs-actions.pod:3370
9450 "This command is the same as C<guestfs_luks_format> but it also allows you to "
9451 "set the C<cipher> used."
9455 #: ../src/guestfs-actions.pod:3384
9456 msgid "guestfs_luks_kill_slot"
9460 #: ../src/guestfs-actions.pod:3386
9464 " guestfs_luks_kill_slot (guestfs_h *g,\n"
9465 " const char *device,\n"
9466 " const char *key,\n"
9472 #: ../src/guestfs-actions.pod:3392 ../fish/guestfish-actions.pod:2281
9474 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9475 "device C<device>. C<key> must be one of the I<other> keys."
9479 #: ../src/guestfs-actions.pod:3404
9480 msgid "guestfs_luks_open"
9484 #: ../src/guestfs-actions.pod:3406
9488 " guestfs_luks_open (guestfs_h *g,\n"
9489 " const char *device,\n"
9490 " const char *key,\n"
9491 " const char *mapname);\n"
9496 #: ../src/guestfs-actions.pod:3412 ../fish/guestfish-actions.pod:2292
9498 "This command opens a block device which has been encrypted according to the "
9499 "Linux Unified Key Setup (LUKS) standard."
9503 #: ../src/guestfs-actions.pod:3415 ../fish/guestfish-actions.pod:2295
9504 msgid "C<device> is the encrypted block device or partition."
9508 #: ../src/guestfs-actions.pod:3417 ../fish/guestfish-actions.pod:2297
9510 "The caller must supply one of the keys associated with the LUKS block "
9511 "device, in the C<key> parameter."
9515 #: ../src/guestfs-actions.pod:3420 ../fish/guestfish-actions.pod:2300
9517 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9518 "writes to this block device are decrypted from and encrypted to the "
9519 "underlying C<device> respectively."
9523 #: ../src/guestfs-actions.pod:3424
9525 "If this block device contains LVM volume groups, then calling "
9526 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
9531 #: ../src/guestfs-actions.pod:3436
9532 msgid "guestfs_luks_open_ro"
9536 #: ../src/guestfs-actions.pod:3438
9540 " guestfs_luks_open_ro (guestfs_h *g,\n"
9541 " const char *device,\n"
9542 " const char *key,\n"
9543 " const char *mapname);\n"
9548 #: ../src/guestfs-actions.pod:3444
9550 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
9555 #: ../src/guestfs-actions.pod:3455
9556 msgid "guestfs_lvcreate"
9560 #: ../src/guestfs-actions.pod:3457
9564 " guestfs_lvcreate (guestfs_h *g,\n"
9565 " const char *logvol,\n"
9566 " const char *volgroup,\n"
9572 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2325
9574 "This creates an LVM logical volume called C<logvol> on the volume group "
9575 "C<volgroup>, with C<size> megabytes."
9579 #: ../src/guestfs-actions.pod:3470
9580 msgid "guestfs_lvm_canonical_lv_name"
9584 #: ../src/guestfs-actions.pod:3472
9588 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
9589 " const char *lvname);\n"
9594 #: ../src/guestfs-actions.pod:3476 ../fish/guestfish-actions.pod:2332
9596 "This converts alternative naming schemes for LVs that you might find to the "
9597 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
9602 #: ../src/guestfs-actions.pod:3480 ../fish/guestfish-actions.pod:2336
9604 "This command returns an error if the C<lvname> parameter does not refer to a "
9609 #: ../src/guestfs-actions.pod:3483
9610 msgid "See also C<guestfs_is_lv>."
9614 #: ../src/guestfs-actions.pod:3488
9615 msgid "(Added in 1.5.24)"
9619 #: ../src/guestfs-actions.pod:3490
9620 msgid "guestfs_lvm_clear_filter"
9624 #: ../src/guestfs-actions.pod:3492
9628 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
9633 #: ../src/guestfs-actions.pod:3495
9635 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
9636 "see every block device."
9640 #: ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3540 ../fish/guestfish-actions.pod:2348 ../fish/guestfish-actions.pod:2379
9641 msgid "This command also clears the LVM cache and performs a volume group scan."
9645 #: ../src/guestfs-actions.pod:3505
9646 msgid "guestfs_lvm_remove_all"
9650 #: ../src/guestfs-actions.pod:3507
9654 " guestfs_lvm_remove_all (guestfs_h *g);\n"
9659 #: ../src/guestfs-actions.pod:3510 ../fish/guestfish-actions.pod:2355
9661 "This command removes all LVM logical volumes, volume groups and physical "
9666 #: ../src/guestfs-actions.pod:3520
9667 msgid "guestfs_lvm_set_filter"
9671 #: ../src/guestfs-actions.pod:3522
9675 " guestfs_lvm_set_filter (guestfs_h *g,\n"
9676 " char *const *devices);\n"
9681 #: ../src/guestfs-actions.pod:3526 ../fish/guestfish-actions.pod:2365
9683 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9684 "block devices in the list C<devices>, and will ignore all other attached "
9689 #: ../src/guestfs-actions.pod:3530 ../fish/guestfish-actions.pod:2369
9691 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9692 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9693 "there are two types of duplication possible: either cloned PVs/VGs which "
9694 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9695 "same name. In normal operation you cannot create this situation, but you "
9696 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9697 "inside the LVM metadata."
9701 #: ../src/guestfs-actions.pod:3543 ../fish/guestfish-actions.pod:2382
9702 msgid "You can filter whole block devices or individual partitions."
9706 #: ../src/guestfs-actions.pod:3545 ../fish/guestfish-actions.pod:2384
9708 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9709 "filesystem), even if you are not filtering out that VG."
9713 #: ../src/guestfs-actions.pod:3553
9714 msgid "guestfs_lvremove"
9718 #: ../src/guestfs-actions.pod:3555
9722 " guestfs_lvremove (guestfs_h *g,\n"
9723 " const char *device);\n"
9728 #: ../src/guestfs-actions.pod:3559 ../fish/guestfish-actions.pod:2392
9730 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9731 "LV, such as C</dev/VG/LV>."
9735 #: ../src/guestfs-actions.pod:3562 ../fish/guestfish-actions.pod:2395
9737 "You can also remove all LVs in a volume group by specifying the VG name, "
9742 #: ../src/guestfs-actions.pod:3567 ../src/guestfs-actions.pod:4721 ../src/guestfs-actions.pod:6451
9743 msgid "(Added in 1.0.13)"
9747 #: ../src/guestfs-actions.pod:3569
9748 msgid "guestfs_lvrename"
9752 #: ../src/guestfs-actions.pod:3571
9756 " guestfs_lvrename (guestfs_h *g,\n"
9757 " const char *logvol,\n"
9758 " const char *newlogvol);\n"
9763 #: ../src/guestfs-actions.pod:3576 ../fish/guestfish-actions.pod:2402
9764 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9768 #: ../src/guestfs-actions.pod:3580 ../src/guestfs-actions.pod:6464
9769 msgid "(Added in 1.0.83)"
9773 #: ../src/guestfs-actions.pod:3582
9774 msgid "guestfs_lvresize"
9778 #: ../src/guestfs-actions.pod:3584
9782 " guestfs_lvresize (guestfs_h *g,\n"
9783 " const char *device,\n"
9789 #: ../src/guestfs-actions.pod:3589 ../fish/guestfish-actions.pod:2408
9791 "This resizes (expands or shrinks) an existing LVM logical volume to "
9792 "C<mbytes>. When reducing, data in the reduced part is lost."
9796 #: ../src/guestfs-actions.pod:3597
9797 msgid "guestfs_lvresize_free"
9801 #: ../src/guestfs-actions.pod:3599
9805 " guestfs_lvresize_free (guestfs_h *g,\n"
9806 " const char *lv,\n"
9812 #: ../src/guestfs-actions.pod:3604 ../fish/guestfish-actions.pod:2416
9814 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9815 "remaining free space in the volume group. Commonly you would call this with "
9816 "pc = 100 which expands the logical volume as much as possible, using all "
9817 "remaining free space in the volume group."
9821 #: ../src/guestfs-actions.pod:3612
9822 msgid "(Added in 1.3.3)"
9826 #: ../src/guestfs-actions.pod:3614
9831 #: ../src/guestfs-actions.pod:3616
9835 " guestfs_lvs (guestfs_h *g);\n"
9840 #: ../src/guestfs-actions.pod:3619 ../fish/guestfish-actions.pod:2426
9842 "List all the logical volumes detected. This is the equivalent of the "
9843 "L<lvs(8)> command."
9847 #: ../src/guestfs-actions.pod:3622 ../fish/guestfish-actions.pod:2429
9849 "This returns a list of the logical volume device names "
9850 "(eg. C</dev/VolGroup00/LogVol00>)."
9854 #: ../src/guestfs-actions.pod:3625
9855 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
9859 #: ../src/guestfs-actions.pod:3633
9860 msgid "guestfs_lvs_full"
9864 #: ../src/guestfs-actions.pod:3635
9867 " struct guestfs_lvm_lv_list *\n"
9868 " guestfs_lvs_full (guestfs_h *g);\n"
9873 #: ../src/guestfs-actions.pod:3638 ../fish/guestfish-actions.pod:2438
9875 "List all the logical volumes detected. This is the equivalent of the "
9876 "L<lvs(8)> command. The \"full\" version includes all fields."
9880 #: ../src/guestfs-actions.pod:3641
9882 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
9883 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
9888 #: ../src/guestfs-actions.pod:3647
9889 msgid "guestfs_lvuuid"
9893 #: ../src/guestfs-actions.pod:3649
9897 " guestfs_lvuuid (guestfs_h *g,\n"
9898 " const char *device);\n"
9903 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2445
9904 msgid "This command returns the UUID of the LVM LV C<device>."
9908 #: ../src/guestfs-actions.pod:3660
9909 msgid "guestfs_lxattrlist"
9913 #: ../src/guestfs-actions.pod:3662
9916 " struct guestfs_xattr_list *\n"
9917 " guestfs_lxattrlist (guestfs_h *g,\n"
9918 " const char *path,\n"
9919 " char *const *names);\n"
9924 #: ../src/guestfs-actions.pod:3667 ../fish/guestfish-actions.pod:2451
9926 "This call allows you to get the extended attributes of multiple files, where "
9927 "all files are in the directory C<path>. C<names> is the list of files from "
9932 #: ../src/guestfs-actions.pod:3671 ../fish/guestfish-actions.pod:2455
9934 "On return you get a flat list of xattr structs which must be interpreted "
9935 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9936 "C<attrval> in this struct is zero-length to indicate there was an error "
9937 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9938 "number (the number of following attributes for this file, which could be "
9939 "C<\"0\">). Then after the first xattr struct are the zero or more "
9940 "attributes for the first named file. This repeats for the second and "
9945 #: ../src/guestfs-actions.pod:3681
9947 "This call is intended for programs that want to efficiently list a directory "
9948 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9949 "a similarly efficient call for getting standard stats. Very long directory "
9950 "listings might cause the protocol message size to be exceeded, causing this "
9951 "call to fail. The caller must split up such requests into smaller groups of "
9956 #: ../src/guestfs-actions.pod:3695
9957 msgid "guestfs_mkdir"
9961 #: ../src/guestfs-actions.pod:3697
9965 " guestfs_mkdir (guestfs_h *g,\n"
9966 " const char *path);\n"
9971 #: ../src/guestfs-actions.pod:3701 ../fish/guestfish-actions.pod:2477
9972 msgid "Create a directory named C<path>."
9976 #: ../src/guestfs-actions.pod:3707
9977 msgid "guestfs_mkdir_mode"
9981 #: ../src/guestfs-actions.pod:3709
9985 " guestfs_mkdir_mode (guestfs_h *g,\n"
9986 " const char *path,\n"
9992 #: ../src/guestfs-actions.pod:3714 ../fish/guestfish-actions.pod:2483
9994 "This command creates a directory, setting the initial permissions of the "
9995 "directory to C<mode>."
9999 #: ../src/guestfs-actions.pod:3717 ../fish/guestfish-actions.pod:2486
10001 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10002 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10007 #: ../src/guestfs-actions.pod:3721
10008 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
10012 #: ../src/guestfs-actions.pod:3727
10013 msgid "guestfs_mkdir_p"
10017 #: ../src/guestfs-actions.pod:3729
10021 " guestfs_mkdir_p (guestfs_h *g,\n"
10022 " const char *path);\n"
10027 #: ../src/guestfs-actions.pod:3733 ../fish/guestfish-actions.pod:2496
10029 "Create a directory named C<path>, creating any parent directories as "
10030 "necessary. This is like the C<mkdir -p> shell command."
10034 #: ../src/guestfs-actions.pod:3740
10035 msgid "guestfs_mkdtemp"
10039 #: ../src/guestfs-actions.pod:3742
10043 " guestfs_mkdtemp (guestfs_h *g,\n"
10044 " const char *template);\n"
10049 #: ../src/guestfs-actions.pod:3746 ../fish/guestfish-actions.pod:2503
10051 "This command creates a temporary directory. The C<template> parameter "
10052 "should be a full pathname for the temporary directory name with the final "
10053 "six characters being \"XXXXXX\"."
10057 #: ../src/guestfs-actions.pod:3751 ../fish/guestfish-actions.pod:2508
10059 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10060 "being suitable for Windows filesystems."
10064 #: ../src/guestfs-actions.pod:3754 ../fish/guestfish-actions.pod:2511
10065 msgid "The name of the temporary directory that was created is returned."
10069 #: ../src/guestfs-actions.pod:3757 ../fish/guestfish-actions.pod:2514
10070 msgid "The temporary directory is created with mode 0700 and is owned by root."
10074 #: ../src/guestfs-actions.pod:3760 ../fish/guestfish-actions.pod:2517
10076 "The caller is responsible for deleting the temporary directory and its "
10077 "contents after use."
10081 #: ../src/guestfs-actions.pod:3763 ../fish/guestfish-actions.pod:2520
10082 msgid "See also: L<mkdtemp(3)>"
10086 #: ../src/guestfs-actions.pod:3770
10087 msgid "guestfs_mke2fs_J"
10091 #: ../src/guestfs-actions.pod:3772
10095 " guestfs_mke2fs_J (guestfs_h *g,\n"
10096 " const char *fstype,\n"
10097 " int blocksize,\n"
10098 " const char *device,\n"
10099 " const char *journal);\n"
10104 #: ../src/guestfs-actions.pod:3779 ../fish/guestfish-actions.pod:2526
10106 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10107 "C<journal>. It is equivalent to the command:"
10111 #: ../src/guestfs-actions.pod:3783 ../fish/guestfish-actions.pod:2530
10114 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10119 #: ../src/guestfs-actions.pod:3785
10120 msgid "See also C<guestfs_mke2journal>."
10124 #: ../src/guestfs-actions.pod:3789 ../src/guestfs-actions.pod:3807 ../src/guestfs-actions.pod:3825 ../src/guestfs-actions.pod:3841 ../src/guestfs-actions.pod:3855 ../src/guestfs-actions.pod:3869 ../src/guestfs-actions.pod:3921 ../src/guestfs-actions.pod:4111
10125 msgid "(Added in 1.0.68)"
10129 #: ../src/guestfs-actions.pod:3791
10130 msgid "guestfs_mke2fs_JL"
10134 #: ../src/guestfs-actions.pod:3793
10138 " guestfs_mke2fs_JL (guestfs_h *g,\n"
10139 " const char *fstype,\n"
10140 " int blocksize,\n"
10141 " const char *device,\n"
10142 " const char *label);\n"
10147 #: ../src/guestfs-actions.pod:3800 ../fish/guestfish-actions.pod:2538
10149 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10150 "the journal labeled C<label>."
10154 #: ../src/guestfs-actions.pod:3803
10155 msgid "See also C<guestfs_mke2journal_L>."
10159 #: ../src/guestfs-actions.pod:3809
10160 msgid "guestfs_mke2fs_JU"
10164 #: ../src/guestfs-actions.pod:3811
10168 " guestfs_mke2fs_JU (guestfs_h *g,\n"
10169 " const char *fstype,\n"
10170 " int blocksize,\n"
10171 " const char *device,\n"
10172 " const char *uuid);\n"
10177 #: ../src/guestfs-actions.pod:3818 ../fish/guestfish-actions.pod:2547
10179 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10180 "the journal with UUID C<uuid>."
10184 #: ../src/guestfs-actions.pod:3821
10185 msgid "See also C<guestfs_mke2journal_U>."
10189 #: ../src/guestfs-actions.pod:3827
10190 msgid "guestfs_mke2journal"
10194 #: ../src/guestfs-actions.pod:3829
10198 " guestfs_mke2journal (guestfs_h *g,\n"
10199 " int blocksize,\n"
10200 " const char *device);\n"
10205 #: ../src/guestfs-actions.pod:3834 ../fish/guestfish-actions.pod:2556
10207 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10212 #: ../src/guestfs-actions.pod:3837 ../fish/guestfish-actions.pod:2559
10215 " mke2fs -O journal_dev -b blocksize device\n"
10220 #: ../src/guestfs-actions.pod:3843
10221 msgid "guestfs_mke2journal_L"
10225 #: ../src/guestfs-actions.pod:3845
10229 " guestfs_mke2journal_L (guestfs_h *g,\n"
10230 " int blocksize,\n"
10231 " const char *label,\n"
10232 " const char *device);\n"
10237 #: ../src/guestfs-actions.pod:3851 ../fish/guestfish-actions.pod:2565
10238 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10242 #: ../src/guestfs-actions.pod:3857
10243 msgid "guestfs_mke2journal_U"
10247 #: ../src/guestfs-actions.pod:3859
10251 " guestfs_mke2journal_U (guestfs_h *g,\n"
10252 " int blocksize,\n"
10253 " const char *uuid,\n"
10254 " const char *device);\n"
10259 #: ../src/guestfs-actions.pod:3865 ../fish/guestfish-actions.pod:2571
10260 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10264 #: ../src/guestfs-actions.pod:3871
10265 msgid "guestfs_mkfifo"
10269 #: ../src/guestfs-actions.pod:3873
10273 " guestfs_mkfifo (guestfs_h *g,\n"
10275 " const char *path);\n"
10280 #: ../src/guestfs-actions.pod:3878
10282 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10283 "is just a convenient wrapper around C<guestfs_mknod>."
10287 #: ../src/guestfs-actions.pod:3888
10288 msgid "guestfs_mkfs"
10292 #: ../src/guestfs-actions.pod:3890
10296 " guestfs_mkfs (guestfs_h *g,\n"
10297 " const char *fstype,\n"
10298 " const char *device);\n"
10303 #: ../src/guestfs-actions.pod:3895 ../fish/guestfish-actions.pod:2587
10305 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10306 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10310 #: ../src/guestfs-actions.pod:3903
10311 msgid "guestfs_mkfs_b"
10315 #: ../src/guestfs-actions.pod:3905
10319 " guestfs_mkfs_b (guestfs_h *g,\n"
10320 " const char *fstype,\n"
10321 " int blocksize,\n"
10322 " const char *device);\n"
10327 #: ../src/guestfs-actions.pod:3911
10329 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
10330 "block size of the resulting filesystem. Supported block sizes depend on the "
10331 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10335 #: ../src/guestfs-actions.pod:3916 ../fish/guestfish-actions.pod:2600
10337 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10342 #: ../src/guestfs-actions.pod:3923
10343 msgid "guestfs_mkmountpoint"
10347 #: ../src/guestfs-actions.pod:3925
10351 " guestfs_mkmountpoint (guestfs_h *g,\n"
10352 " const char *exemptpath);\n"
10357 #: ../src/guestfs-actions.pod:3929
10359 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
10360 "that can be used to create extra mountpoints before mounting the first "
10365 #: ../src/guestfs-actions.pod:3933 ../fish/guestfish-actions.pod:2611
10367 "These calls are I<only> necessary in some very limited circumstances, mainly "
10368 "the case where you want to mount a mix of unrelated and/or read-only "
10369 "filesystems together."
10373 #: ../src/guestfs-actions.pod:3937 ../fish/guestfish-actions.pod:2615
10375 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10376 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10377 "inside that. You can unpack this as follows in guestfish:"
10381 #: ../src/guestfs-actions.pod:3942 ../fish/guestfish-actions.pod:2620
10384 " add-ro Fedora-11-i686-Live.iso\n"
10386 " mkmountpoint /cd\n"
10387 " mkmountpoint /sqsh\n"
10388 " mkmountpoint /ext3fs\n"
10389 " mount /dev/sda /cd\n"
10390 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10391 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10396 #: ../src/guestfs-actions.pod:3951 ../fish/guestfish-actions.pod:2629
10397 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10401 #: ../src/guestfs-actions.pod:3953
10403 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
10404 "may get unexpected errors if you try to mix these calls. It is safest to "
10405 "manually unmount filesystems and remove mountpoints after use."
10409 #: ../src/guestfs-actions.pod:3957
10411 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
10412 "first, so for this to work for manual mountpoints, you must ensure that the "
10413 "innermost mountpoints have the longest pathnames, as in the example code "
10418 #: ../src/guestfs-actions.pod:3962 ../fish/guestfish-actions.pod:2640
10419 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10423 #: ../src/guestfs-actions.pod:3964
10425 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
10426 "means that C<guestfs_umount_all> is called when the handle is closed which "
10427 "can also trigger these issues."
10431 #: ../src/guestfs-actions.pod:3970 ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:5122
10432 msgid "(Added in 1.0.62)"
10436 #: ../src/guestfs-actions.pod:3972
10437 msgid "guestfs_mknod"
10441 #: ../src/guestfs-actions.pod:3974
10445 " guestfs_mknod (guestfs_h *g,\n"
10449 " const char *path);\n"
10454 #: ../src/guestfs-actions.pod:3981 ../fish/guestfish-actions.pod:2650
10456 "This call creates block or character special devices, or named pipes "
10461 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:2653
10463 "The C<mode> parameter should be the mode, using the standard constants. "
10464 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10465 "used when creating block and character special devices."
10469 #: ../src/guestfs-actions.pod:3989
10471 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10472 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10473 "regular file). These constants are available in the standard Linux header "
10474 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
10475 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
10476 "the appropriate constant for you."
10480 #: ../src/guestfs-actions.pod:4003
10481 msgid "guestfs_mknod_b"
10485 #: ../src/guestfs-actions.pod:4005
10489 " guestfs_mknod_b (guestfs_h *g,\n"
10493 " const char *path);\n"
10498 #: ../src/guestfs-actions.pod:4012
10500 "This call creates a block device node called C<path> with mode C<mode> and "
10501 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10502 "wrapper around C<guestfs_mknod>."
10506 #: ../src/guestfs-actions.pod:4022
10507 msgid "guestfs_mknod_c"
10511 #: ../src/guestfs-actions.pod:4024
10515 " guestfs_mknod_c (guestfs_h *g,\n"
10519 " const char *path);\n"
10524 #: ../src/guestfs-actions.pod:4031
10526 "This call creates a char device node called C<path> with mode C<mode> and "
10527 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10528 "wrapper around C<guestfs_mknod>."
10532 #: ../src/guestfs-actions.pod:4041
10533 msgid "guestfs_mkswap"
10537 #: ../src/guestfs-actions.pod:4043
10541 " guestfs_mkswap (guestfs_h *g,\n"
10542 " const char *device);\n"
10547 #: ../src/guestfs-actions.pod:4047 ../fish/guestfish-actions.pod:2692
10548 msgid "Create a swap partition on C<device>."
10552 #: ../src/guestfs-actions.pod:4053
10553 msgid "guestfs_mkswap_L"
10557 #: ../src/guestfs-actions.pod:4055
10561 " guestfs_mkswap_L (guestfs_h *g,\n"
10562 " const char *label,\n"
10563 " const char *device);\n"
10568 #: ../src/guestfs-actions.pod:4060 ../fish/guestfish-actions.pod:2698
10569 msgid "Create a swap partition on C<device> with label C<label>."
10573 #: ../src/guestfs-actions.pod:4062 ../fish/guestfish-actions.pod:2700
10575 "Note that you cannot attach a swap label to a block device "
10576 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
10577 "the kernel or swap tools."
10581 #: ../src/guestfs-actions.pod:4070
10582 msgid "guestfs_mkswap_U"
10586 #: ../src/guestfs-actions.pod:4072
10590 " guestfs_mkswap_U (guestfs_h *g,\n"
10591 " const char *uuid,\n"
10592 " const char *device);\n"
10597 #: ../src/guestfs-actions.pod:4077 ../fish/guestfish-actions.pod:2708
10598 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10602 #: ../src/guestfs-actions.pod:4083
10603 msgid "guestfs_mkswap_file"
10607 #: ../src/guestfs-actions.pod:4085
10611 " guestfs_mkswap_file (guestfs_h *g,\n"
10612 " const char *path);\n"
10617 #: ../src/guestfs-actions.pod:4089 ../fish/guestfish-actions.pod:2714
10618 msgid "Create a swap file."
10622 #: ../src/guestfs-actions.pod:4091
10624 "This command just writes a swap file signature to an existing file. To "
10625 "create the file itself, use something like C<guestfs_fallocate>."
10629 #: ../src/guestfs-actions.pod:4098
10630 msgid "guestfs_modprobe"
10634 #: ../src/guestfs-actions.pod:4100
10638 " guestfs_modprobe (guestfs_h *g,\n"
10639 " const char *modulename);\n"
10644 #: ../src/guestfs-actions.pod:4104 ../fish/guestfish-actions.pod:2723
10645 msgid "This loads a kernel module in the appliance."
10649 #: ../src/guestfs-actions.pod:4106 ../fish/guestfish-actions.pod:2725
10651 "The kernel module must have been whitelisted when libguestfs was built (see "
10652 "C<appliance/kmod.whitelist.in> in the source)."
10656 #: ../src/guestfs-actions.pod:4113
10657 msgid "guestfs_mount"
10661 #: ../src/guestfs-actions.pod:4115
10665 " guestfs_mount (guestfs_h *g,\n"
10666 " const char *device,\n"
10667 " const char *mountpoint);\n"
10672 #: ../src/guestfs-actions.pod:4120 ../fish/guestfish-actions.pod:2732
10674 "Mount a guest disk at a position in the filesystem. Block devices are named "
10675 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10676 "those block devices contain partitions, they will have the usual names "
10677 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10681 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2738
10683 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10684 "mounted on C</> before others can be mounted. Other filesystems can only be "
10685 "mounted on directories which already exist."
10689 #: ../src/guestfs-actions.pod:4131 ../fish/guestfish-actions.pod:2743
10691 "The mounted filesystem is writable, if we have sufficient permissions on the "
10692 "underlying device."
10696 #: ../src/guestfs-actions.pod:4134
10698 "B<Important note:> When you use this call, the filesystem options C<sync> "
10699 "and C<noatime> are set implicitly. This was originally done because we "
10700 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10701 "very large negative performance impact and negligible effect on "
10702 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
10703 "in any code that needs performance, and instead use C<guestfs_mount_options> "
10704 "(use an empty string for the first parameter if you don't want any options)."
10708 #: ../src/guestfs-actions.pod:4148
10709 msgid "guestfs_mount_loop"
10713 #: ../src/guestfs-actions.pod:4150
10717 " guestfs_mount_loop (guestfs_h *g,\n"
10718 " const char *file,\n"
10719 " const char *mountpoint);\n"
10724 #: ../src/guestfs-actions.pod:4155 ../fish/guestfish-actions.pod:2760
10726 "This command lets you mount C<file> (a filesystem image in a file) on a "
10727 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10732 #: ../src/guestfs-actions.pod:4163
10733 msgid "guestfs_mount_options"
10737 #: ../src/guestfs-actions.pod:4165
10741 " guestfs_mount_options (guestfs_h *g,\n"
10742 " const char *options,\n"
10743 " const char *device,\n"
10744 " const char *mountpoint);\n"
10749 #: ../src/guestfs-actions.pod:4171
10751 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10752 "the mount options as for the L<mount(8)> I<-o> flag."
10756 #: ../src/guestfs-actions.pod:4175 ../fish/guestfish-actions.pod:2772
10758 "If the C<options> parameter is an empty string, then no options are passed "
10759 "(all options default to whatever the filesystem uses)."
10763 #: ../src/guestfs-actions.pod:4181 ../src/guestfs-actions.pod:4195 ../src/guestfs-actions.pod:4212
10764 msgid "(Added in 1.0.10)"
10768 #: ../src/guestfs-actions.pod:4183
10769 msgid "guestfs_mount_ro"
10773 #: ../src/guestfs-actions.pod:4185
10777 " guestfs_mount_ro (guestfs_h *g,\n"
10778 " const char *device,\n"
10779 " const char *mountpoint);\n"
10784 #: ../src/guestfs-actions.pod:4190
10786 "This is the same as the C<guestfs_mount> command, but it mounts the "
10787 "filesystem with the read-only (I<-o ro>) flag."
10791 #: ../src/guestfs-actions.pod:4197
10792 msgid "guestfs_mount_vfs"
10796 #: ../src/guestfs-actions.pod:4199
10800 " guestfs_mount_vfs (guestfs_h *g,\n"
10801 " const char *options,\n"
10802 " const char *vfstype,\n"
10803 " const char *device,\n"
10804 " const char *mountpoint);\n"
10809 #: ../src/guestfs-actions.pod:4206
10811 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10812 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
10817 #: ../src/guestfs-actions.pod:4214
10818 msgid "guestfs_mountpoints"
10822 #: ../src/guestfs-actions.pod:4216
10826 " guestfs_mountpoints (guestfs_h *g);\n"
10831 #: ../src/guestfs-actions.pod:4219
10833 "This call is similar to C<guestfs_mounts>. That call returns a list of "
10834 "devices. This one returns a hash table (map) of device name to directory "
10835 "where the device is mounted."
10839 #: ../src/guestfs-actions.pod:4231
10840 msgid "guestfs_mounts"
10844 #: ../src/guestfs-actions.pod:4233
10848 " guestfs_mounts (guestfs_h *g);\n"
10853 #: ../src/guestfs-actions.pod:4236 ../fish/guestfish-actions.pod:2803
10855 "This returns the list of currently mounted filesystems. It returns the list "
10856 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10860 #: ../src/guestfs-actions.pod:4239 ../fish/guestfish-actions.pod:2806
10861 msgid "Some internal mounts are not shown."
10865 #: ../src/guestfs-actions.pod:4241
10866 msgid "See also: C<guestfs_mountpoints>"
10870 #: ../src/guestfs-actions.pod:4249
10875 #: ../src/guestfs-actions.pod:4251
10879 " guestfs_mv (guestfs_h *g,\n"
10880 " const char *src,\n"
10881 " const char *dest);\n"
10886 #: ../src/guestfs-actions.pod:4256 ../fish/guestfish-actions.pod:2814
10888 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10889 "destination filename or destination directory."
10893 #: ../src/guestfs-actions.pod:4263
10894 msgid "guestfs_ntfs_3g_probe"
10898 #: ../src/guestfs-actions.pod:4265
10902 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
10904 " const char *device);\n"
10909 #: ../src/guestfs-actions.pod:4270 ../fish/guestfish-actions.pod:2821
10911 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10912 "C<device> for mountability. (Not all NTFS volumes can be mounted "
10913 "read-write, and some cannot be mounted at all)."
10917 #: ../src/guestfs-actions.pod:4274 ../fish/guestfish-actions.pod:2825
10919 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10920 "can be mounted read-write. Set it to false if you want to test if the "
10921 "volume can be mounted read-only."
10925 #: ../src/guestfs-actions.pod:4278 ../fish/guestfish-actions.pod:2829
10927 "The return value is an integer which C<0> if the operation would succeed, or "
10928 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10932 #: ../src/guestfs-actions.pod:4284
10933 msgid "(Added in 1.0.43)"
10937 #: ../src/guestfs-actions.pod:4286
10938 msgid "guestfs_ntfsresize"
10942 #: ../src/guestfs-actions.pod:4288
10946 " guestfs_ntfsresize (guestfs_h *g,\n"
10947 " const char *device);\n"
10952 #: ../src/guestfs-actions.pod:4292 ../fish/guestfish-actions.pod:2837
10954 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10955 "size of the underlying device. See also L<ntfsresize(8)>."
10959 #: ../src/guestfs-actions.pod:4300
10960 msgid "guestfs_ntfsresize_size"
10964 #: ../src/guestfs-actions.pod:4302
10968 " guestfs_ntfsresize_size (guestfs_h *g,\n"
10969 " const char *device,\n"
10970 " int64_t size);\n"
10975 #: ../src/guestfs-actions.pod:4307
10977 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10978 "to specify the new size (in bytes) explicitly."
10982 #: ../src/guestfs-actions.pod:4312 ../src/guestfs-actions.pod:4748 ../src/guestfs-actions.pod:4821 ../src/guestfs-actions.pod:5070
10983 msgid "(Added in 1.3.14)"
10987 #: ../src/guestfs-actions.pod:4314
10988 msgid "guestfs_part_add"
10992 #: ../src/guestfs-actions.pod:4316
10996 " guestfs_part_add (guestfs_h *g,\n"
10997 " const char *device,\n"
10998 " const char *prlogex,\n"
10999 " int64_t startsect,\n"
11000 " int64_t endsect);\n"
11005 #: ../src/guestfs-actions.pod:4323
11007 "This command adds a partition to C<device>. If there is no partition table "
11008 "on the device, call C<guestfs_part_init> first."
11012 #: ../src/guestfs-actions.pod:4326 ../fish/guestfish-actions.pod:2855
11014 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11015 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11016 "C<logical>) and C<e> (or C<extended>) partition types."
11020 #: ../src/guestfs-actions.pod:4331 ../fish/guestfish-actions.pod:2860
11022 "C<startsect> and C<endsect> are the start and end of the partition in "
11023 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11024 "from the end of the disk (C<-1> is the last sector)."
11028 #: ../src/guestfs-actions.pod:4335
11030 "Creating a partition which covers the whole disk is not so easy. Use "
11031 "C<guestfs_part_disk> to do that."
11035 #: ../src/guestfs-actions.pod:4340 ../src/guestfs-actions.pod:4378 ../src/guestfs-actions.pod:4431 ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4547 ../src/guestfs-actions.pod:4566 ../src/guestfs-actions.pod:4606
11036 msgid "(Added in 1.0.78)"
11040 #: ../src/guestfs-actions.pod:4342
11041 msgid "guestfs_part_del"
11045 #: ../src/guestfs-actions.pod:4344
11049 " guestfs_part_del (guestfs_h *g,\n"
11050 " const char *device,\n"
11056 #: ../src/guestfs-actions.pod:4349 ../fish/guestfish-actions.pod:2871
11057 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11061 #: ../src/guestfs-actions.pod:4351 ../fish/guestfish-actions.pod:2873
11063 "Note that in the case of MBR partitioning, deleting an extended partition "
11064 "also deletes any logical partitions it contains."
11068 #: ../src/guestfs-actions.pod:4359
11069 msgid "guestfs_part_disk"
11073 #: ../src/guestfs-actions.pod:4361
11077 " guestfs_part_disk (guestfs_h *g,\n"
11078 " const char *device,\n"
11079 " const char *parttype);\n"
11084 #: ../src/guestfs-actions.pod:4366
11086 "This command is simply a combination of C<guestfs_part_init> followed by "
11087 "C<guestfs_part_add> to create a single primary partition covering the whole "
11092 #: ../src/guestfs-actions.pod:4370
11094 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11095 "possible values are described in C<guestfs_part_init>."
11099 #: ../src/guestfs-actions.pod:4380
11100 msgid "guestfs_part_get_bootable"
11104 #: ../src/guestfs-actions.pod:4382
11108 " guestfs_part_get_bootable (guestfs_h *g,\n"
11109 " const char *device,\n"
11115 #: ../src/guestfs-actions.pod:4387 ../fish/guestfish-actions.pod:2895
11117 "This command returns true if the partition C<partnum> on C<device> has the "
11118 "bootable flag set."
11122 #: ../src/guestfs-actions.pod:4390
11123 msgid "See also C<guestfs_part_set_bootable>."
11127 #: ../src/guestfs-actions.pod:4396
11128 msgid "guestfs_part_get_mbr_id"
11132 #: ../src/guestfs-actions.pod:4398
11136 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
11137 " const char *device,\n"
11143 #: ../src/guestfs-actions.pod:4403 ../fish/guestfish-actions.pod:2904
11145 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11146 "partition C<partnum>."
11150 #: ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4582
11152 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11153 "undefined results for other partition table types (see "
11154 "C<guestfs_part_get_parttype>)."
11158 #: ../src/guestfs-actions.pod:4414
11159 msgid "guestfs_part_get_parttype"
11163 #: ../src/guestfs-actions.pod:4416
11167 " guestfs_part_get_parttype (guestfs_h *g,\n"
11168 " const char *device);\n"
11173 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:2915
11175 "This command examines the partition table on C<device> and returns the "
11176 "partition table type (format) being used."
11180 #: ../src/guestfs-actions.pod:4423
11182 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11183 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11184 "possible, although unusual. See C<guestfs_part_init> for a full list."
11188 #: ../src/guestfs-actions.pod:4433
11189 msgid "guestfs_part_init"
11193 #: ../src/guestfs-actions.pod:4435
11197 " guestfs_part_init (guestfs_h *g,\n"
11198 " const char *device,\n"
11199 " const char *parttype);\n"
11204 #: ../src/guestfs-actions.pod:4440 ../fish/guestfish-actions.pod:2927
11206 "This creates an empty partition table on C<device> of one of the partition "
11207 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11208 "(for large disks)."
11212 #: ../src/guestfs-actions.pod:4444
11214 "Initially there are no partitions. Following this, you should call "
11215 "C<guestfs_part_add> for each partition required."
11219 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:2934
11220 msgid "Possible values for C<parttype> are:"
11224 #: ../src/guestfs-actions.pod:4451 ../fish/guestfish-actions.pod:2938
11225 msgid "B<efi> | B<gpt>"
11229 #: ../src/guestfs-actions.pod:4453 ../fish/guestfish-actions.pod:2940
11230 msgid "Intel EFI / GPT partition table."
11234 #: ../src/guestfs-actions.pod:4455 ../fish/guestfish-actions.pod:2942
11236 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11237 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11238 "the C<mbr> format."
11242 #: ../src/guestfs-actions.pod:4459 ../fish/guestfish-actions.pod:2946
11243 msgid "B<mbr> | B<msdos>"
11247 #: ../src/guestfs-actions.pod:4461 ../fish/guestfish-actions.pod:2948
11249 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11250 "Windows. This partition type will B<only> work for device sizes up to 2 "
11251 "TB. For large disks we recommend using C<gpt>."
11255 #: ../src/guestfs-actions.pod:4468 ../fish/guestfish-actions.pod:2955
11256 msgid "Other partition table types that may work but are not supported include:"
11260 #: ../src/guestfs-actions.pod:4473 ../fish/guestfish-actions.pod:2960
11265 #: ../src/guestfs-actions.pod:4475 ../fish/guestfish-actions.pod:2962
11266 msgid "AIX disk labels."
11270 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:2964
11271 msgid "B<amiga> | B<rdb>"
11275 #: ../src/guestfs-actions.pod:4479 ../fish/guestfish-actions.pod:2966
11276 msgid "Amiga \"Rigid Disk Block\" format."
11280 #: ../src/guestfs-actions.pod:4481 ../fish/guestfish-actions.pod:2968
11285 #: ../src/guestfs-actions.pod:4483 ../fish/guestfish-actions.pod:2970
11286 msgid "BSD disk labels."
11290 #: ../src/guestfs-actions.pod:4485 ../fish/guestfish-actions.pod:2972
11295 #: ../src/guestfs-actions.pod:4487 ../fish/guestfish-actions.pod:2974
11296 msgid "DASD, used on IBM mainframes."
11300 #: ../src/guestfs-actions.pod:4489 ../fish/guestfish-actions.pod:2976
11305 #: ../src/guestfs-actions.pod:4491 ../fish/guestfish-actions.pod:2978
11306 msgid "MIPS/SGI volumes."
11310 #: ../src/guestfs-actions.pod:4493 ../fish/guestfish-actions.pod:2980
11315 #: ../src/guestfs-actions.pod:4495 ../fish/guestfish-actions.pod:2982
11316 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11320 #: ../src/guestfs-actions.pod:4497 ../fish/guestfish-actions.pod:2984
11325 #: ../src/guestfs-actions.pod:4499 ../fish/guestfish-actions.pod:2986
11326 msgid "NEC PC-98 format, common in Japan apparently."
11330 #: ../src/guestfs-actions.pod:4501 ../fish/guestfish-actions.pod:2988
11335 #: ../src/guestfs-actions.pod:4503 ../fish/guestfish-actions.pod:2990
11336 msgid "Sun disk labels."
11340 #: ../src/guestfs-actions.pod:4511
11341 msgid "guestfs_part_list"
11345 #: ../src/guestfs-actions.pod:4513
11348 " struct guestfs_partition_list *\n"
11349 " guestfs_part_list (guestfs_h *g,\n"
11350 " const char *device);\n"
11355 #: ../src/guestfs-actions.pod:4517 ../fish/guestfish-actions.pod:2998
11357 "This command parses the partition table on C<device> and returns the list of "
11358 "partitions found."
11362 #: ../src/guestfs-actions.pod:4520 ../fish/guestfish-actions.pod:3001
11363 msgid "The fields in the returned structure are:"
11367 #: ../src/guestfs-actions.pod:4524 ../fish/guestfish-actions.pod:3005
11368 msgid "B<part_num>"
11372 #: ../src/guestfs-actions.pod:4526 ../fish/guestfish-actions.pod:3007
11373 msgid "Partition number, counting from 1."
11377 #: ../src/guestfs-actions.pod:4528 ../fish/guestfish-actions.pod:3009
11378 msgid "B<part_start>"
11382 #: ../src/guestfs-actions.pod:4530
11384 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11385 "the device's sector size, see C<guestfs_blockdev_getss>."
11389 #: ../src/guestfs-actions.pod:4533 ../fish/guestfish-actions.pod:3014
11390 msgid "B<part_end>"
11394 #: ../src/guestfs-actions.pod:4535 ../fish/guestfish-actions.pod:3016
11395 msgid "End of the partition in bytes."
11399 #: ../src/guestfs-actions.pod:4537 ../fish/guestfish-actions.pod:3018
11400 msgid "B<part_size>"
11404 #: ../src/guestfs-actions.pod:4539 ../fish/guestfish-actions.pod:3020
11405 msgid "Size of the partition in bytes."
11409 #: ../src/guestfs-actions.pod:4543
11411 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
11412 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
11417 #: ../src/guestfs-actions.pod:4549
11418 msgid "guestfs_part_set_bootable"
11422 #: ../src/guestfs-actions.pod:4551
11426 " guestfs_part_set_bootable (guestfs_h *g,\n"
11427 " const char *device,\n"
11429 " int bootable);\n"
11434 #: ../src/guestfs-actions.pod:4557 ../fish/guestfish-actions.pod:3028
11436 "This sets the bootable flag on partition numbered C<partnum> on device "
11437 "C<device>. Note that partitions are numbered from 1."
11441 #: ../src/guestfs-actions.pod:4560 ../fish/guestfish-actions.pod:3031
11443 "The bootable flag is used by some operating systems (notably Windows) to "
11444 "determine which partition to boot from. It is by no means universally "
11449 #: ../src/guestfs-actions.pod:4568
11450 msgid "guestfs_part_set_mbr_id"
11454 #: ../src/guestfs-actions.pod:4570
11458 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
11459 " const char *device,\n"
11466 #: ../src/guestfs-actions.pod:4576 ../fish/guestfish-actions.pod:3039
11468 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11469 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11470 "documentation are in fact hexadecimal numbers, but usually documented "
11471 "without any leading \"0x\" which might be confusing."
11475 #: ../src/guestfs-actions.pod:4590
11476 msgid "guestfs_part_set_name"
11480 #: ../src/guestfs-actions.pod:4592
11484 " guestfs_part_set_name (guestfs_h *g,\n"
11485 " const char *device,\n"
11487 " const char *name);\n"
11492 #: ../src/guestfs-actions.pod:4598 ../fish/guestfish-actions.pod:3053
11494 "This sets the partition name on partition numbered C<partnum> on device "
11495 "C<device>. Note that partitions are numbered from 1."
11499 #: ../src/guestfs-actions.pod:4601 ../fish/guestfish-actions.pod:3056
11501 "The partition name can only be set on certain types of partition table. "
11502 "This works on C<gpt> but not on C<mbr> partitions."
11506 #: ../src/guestfs-actions.pod:4608
11507 msgid "guestfs_part_to_dev"
11511 #: ../src/guestfs-actions.pod:4610
11515 " guestfs_part_to_dev (guestfs_h *g,\n"
11516 " const char *partition);\n"
11521 #: ../src/guestfs-actions.pod:4614 ../fish/guestfish-actions.pod:3063
11523 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11524 "partition number, returning the device name (eg. \"/dev/sdb\")."
11528 #: ../src/guestfs-actions.pod:4618
11530 "The named partition must exist, for example as a string returned from "
11531 "C<guestfs_list_partitions>."
11535 #: ../src/guestfs-actions.pod:4626
11536 msgid "guestfs_ping_daemon"
11540 #: ../src/guestfs-actions.pod:4628
11544 " guestfs_ping_daemon (guestfs_h *g);\n"
11549 #: ../src/guestfs-actions.pod:4631 ../fish/guestfish-actions.pod:3074
11551 "This is a test probe into the guestfs daemon running inside the qemu "
11552 "subprocess. Calling this function checks that the daemon responds to the "
11553 "ping message, without affecting the daemon or attached block device(s) in "
11558 #: ../src/guestfs-actions.pod:4640
11559 msgid "guestfs_pread"
11563 #: ../src/guestfs-actions.pod:4642
11567 " guestfs_pread (guestfs_h *g,\n"
11568 " const char *path,\n"
11570 " int64_t offset,\n"
11571 " size_t *size_r);\n"
11576 #: ../src/guestfs-actions.pod:4649 ../fish/guestfish-actions.pod:3083
11578 "This command lets you read part of a file. It reads C<count> bytes of the "
11579 "file, starting at C<offset>, from file C<path>."
11583 #: ../src/guestfs-actions.pod:4652 ../src/guestfs-actions.pod:4678 ../fish/guestfish-actions.pod:3086 ../fish/guestfish-actions.pod:3101
11585 "This may read fewer bytes than requested. For further details see the "
11586 "L<pread(2)> system call."
11590 #: ../src/guestfs-actions.pod:4655
11591 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
11595 #: ../src/guestfs-actions.pod:4666
11596 msgid "guestfs_pread_device"
11600 #: ../src/guestfs-actions.pod:4668
11604 " guestfs_pread_device (guestfs_h *g,\n"
11605 " const char *device,\n"
11607 " int64_t offset,\n"
11608 " size_t *size_r);\n"
11613 #: ../src/guestfs-actions.pod:4675 ../fish/guestfish-actions.pod:3098
11615 "This command lets you read part of a file. It reads C<count> bytes of "
11616 "C<device>, starting at C<offset>."
11620 #: ../src/guestfs-actions.pod:4681
11621 msgid "See also C<guestfs_pread>."
11625 #: ../src/guestfs-actions.pod:4690
11626 msgid "(Added in 1.5.21)"
11630 #: ../src/guestfs-actions.pod:4692
11631 msgid "guestfs_pvcreate"
11635 #: ../src/guestfs-actions.pod:4694
11639 " guestfs_pvcreate (guestfs_h *g,\n"
11640 " const char *device);\n"
11645 #: ../src/guestfs-actions.pod:4698 ../fish/guestfish-actions.pod:3113
11647 "This creates an LVM physical volume on the named C<device>, where C<device> "
11648 "should usually be a partition name such as C</dev/sda1>."
11652 #: ../src/guestfs-actions.pod:4706
11653 msgid "guestfs_pvremove"
11657 #: ../src/guestfs-actions.pod:4708
11661 " guestfs_pvremove (guestfs_h *g,\n"
11662 " const char *device);\n"
11667 #: ../src/guestfs-actions.pod:4712 ../fish/guestfish-actions.pod:3121
11669 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11674 #: ../src/guestfs-actions.pod:4715 ../fish/guestfish-actions.pod:3124
11676 "The implementation uses the C<pvremove> command which refuses to wipe "
11677 "physical volumes that contain any volume groups, so you have to remove those "
11682 #: ../src/guestfs-actions.pod:4723
11683 msgid "guestfs_pvresize"
11687 #: ../src/guestfs-actions.pod:4725
11691 " guestfs_pvresize (guestfs_h *g,\n"
11692 " const char *device);\n"
11697 #: ../src/guestfs-actions.pod:4729 ../fish/guestfish-actions.pod:3132
11699 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11700 "the new size of the underlying device."
11704 #: ../src/guestfs-actions.pod:4736
11705 msgid "guestfs_pvresize_size"
11709 #: ../src/guestfs-actions.pod:4738
11713 " guestfs_pvresize_size (guestfs_h *g,\n"
11714 " const char *device,\n"
11715 " int64_t size);\n"
11720 #: ../src/guestfs-actions.pod:4743
11722 "This command is the same as C<guestfs_pvresize> except that it allows you to "
11723 "specify the new size (in bytes) explicitly."
11727 #: ../src/guestfs-actions.pod:4750
11728 msgid "guestfs_pvs"
11732 #: ../src/guestfs-actions.pod:4752
11736 " guestfs_pvs (guestfs_h *g);\n"
11741 #: ../src/guestfs-actions.pod:4755 ../fish/guestfish-actions.pod:3146
11743 "List all the physical volumes detected. This is the equivalent of the "
11744 "L<pvs(8)> command."
11748 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3149
11750 "This returns a list of just the device names that contain PVs "
11751 "(eg. C</dev/sda2>)."
11755 #: ../src/guestfs-actions.pod:4761
11756 msgid "See also C<guestfs_pvs_full>."
11760 #: ../src/guestfs-actions.pod:4769
11761 msgid "guestfs_pvs_full"
11765 #: ../src/guestfs-actions.pod:4771
11768 " struct guestfs_lvm_pv_list *\n"
11769 " guestfs_pvs_full (guestfs_h *g);\n"
11774 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3158
11776 "List all the physical volumes detected. This is the equivalent of the "
11777 "L<pvs(8)> command. The \"full\" version includes all fields."
11781 #: ../src/guestfs-actions.pod:4777
11783 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
11784 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
11789 #: ../src/guestfs-actions.pod:4783
11790 msgid "guestfs_pvuuid"
11794 #: ../src/guestfs-actions.pod:4785
11798 " guestfs_pvuuid (guestfs_h *g,\n"
11799 " const char *device);\n"
11804 #: ../src/guestfs-actions.pod:4789 ../fish/guestfish-actions.pod:3165
11805 msgid "This command returns the UUID of the LVM PV C<device>."
11809 #: ../src/guestfs-actions.pod:4796
11810 msgid "guestfs_pwrite"
11814 #: ../src/guestfs-actions.pod:4798
11818 " guestfs_pwrite (guestfs_h *g,\n"
11819 " const char *path,\n"
11820 " const char *content,\n"
11821 " size_t content_size,\n"
11822 " int64_t offset);\n"
11827 #: ../src/guestfs-actions.pod:4805 ../fish/guestfish-actions.pod:3171
11829 "This command writes to part of a file. It writes the data buffer C<content> "
11830 "to the file C<path> starting at offset C<offset>."
11834 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3174
11836 "This command implements the L<pwrite(2)> system call, and like that system "
11837 "call it may not write the full data requested. The return value is the "
11838 "number of bytes that were actually written to the file. This could even be "
11839 "0, although short writes are unlikely for regular files in ordinary "
11844 #: ../src/guestfs-actions.pod:4814
11845 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
11849 #: ../src/guestfs-actions.pod:4823
11850 msgid "guestfs_pwrite_device"
11854 #: ../src/guestfs-actions.pod:4825
11858 " guestfs_pwrite_device (guestfs_h *g,\n"
11859 " const char *device,\n"
11860 " const char *content,\n"
11861 " size_t content_size,\n"
11862 " int64_t offset);\n"
11867 #: ../src/guestfs-actions.pod:4832 ../fish/guestfish-actions.pod:3189
11869 "This command writes to part of a device. It writes the data buffer "
11870 "C<content> to C<device> starting at offset C<offset>."
11874 #: ../src/guestfs-actions.pod:4835 ../fish/guestfish-actions.pod:3192
11876 "This command implements the L<pwrite(2)> system call, and like that system "
11877 "call it may not write the full data requested (although short writes to disk "
11878 "devices and partitions are probably impossible with standard Linux kernels)."
11882 #: ../src/guestfs-actions.pod:4840
11883 msgid "See also C<guestfs_pwrite>."
11887 #: ../src/guestfs-actions.pod:4847
11888 msgid "(Added in 1.5.20)"
11892 #: ../src/guestfs-actions.pod:4849
11893 msgid "guestfs_read_file"
11897 #: ../src/guestfs-actions.pod:4851
11901 " guestfs_read_file (guestfs_h *g,\n"
11902 " const char *path,\n"
11903 " size_t *size_r);\n"
11908 #: ../src/guestfs-actions.pod:4856 ../fish/guestfish-actions.pod:3206
11909 msgid "This calls returns the contents of the file C<path> as a buffer."
11913 #: ../src/guestfs-actions.pod:4859
11915 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
11916 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
11917 "function is limited in the total size of file that can be handled."
11921 #: ../src/guestfs-actions.pod:4871
11922 msgid "(Added in 1.0.63)"
11926 #: ../src/guestfs-actions.pod:4873
11927 msgid "guestfs_read_lines"
11931 #: ../src/guestfs-actions.pod:4875
11935 " guestfs_read_lines (guestfs_h *g,\n"
11936 " const char *path);\n"
11941 #: ../src/guestfs-actions.pod:4881 ../fish/guestfish-actions.pod:3223
11943 "The file contents are returned as a list of lines. Trailing C<LF> and "
11944 "C<CRLF> character sequences are I<not> returned."
11948 #: ../src/guestfs-actions.pod:4884
11950 "Note that this function cannot correctly handle binary files (specifically, "
11951 "files containing C<\\0> character which is treated as end of line). For "
11952 "those you need to use the C<guestfs_read_file> function which has a more "
11953 "complex interface."
11957 #: ../src/guestfs-actions.pod:4895
11958 msgid "guestfs_readdir"
11962 #: ../src/guestfs-actions.pod:4897
11965 " struct guestfs_dirent_list *\n"
11966 " guestfs_readdir (guestfs_h *g,\n"
11967 " const char *dir);\n"
11972 #: ../src/guestfs-actions.pod:4901 ../fish/guestfish-actions.pod:3235
11973 msgid "This returns the list of directory entries in directory C<dir>."
11977 #: ../src/guestfs-actions.pod:4903 ../fish/guestfish-actions.pod:3237
11979 "All entries in the directory are returned, including C<.> and C<..>. The "
11980 "entries are I<not> sorted, but returned in the same order as the underlying "
11985 #: ../src/guestfs-actions.pod:4907 ../fish/guestfish-actions.pod:3241
11987 "Also this call returns basic file type information about each file. The "
11988 "C<ftyp> field will contain one of the following characters:"
11992 #: ../src/guestfs-actions.pod:4912 ../fish/guestfish-actions.pod:3246
11997 #: ../src/guestfs-actions.pod:4914 ../fish/guestfish-actions.pod:3248
11998 msgid "Block special"
12002 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3250
12007 #: ../src/guestfs-actions.pod:4918 ../fish/guestfish-actions.pod:3252
12008 msgid "Char special"
12012 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3254
12017 #: ../src/guestfs-actions.pod:4922 ../fish/guestfish-actions.pod:3256
12022 #: ../src/guestfs-actions.pod:4924 ../fish/guestfish-actions.pod:3258
12027 #: ../src/guestfs-actions.pod:4926 ../fish/guestfish-actions.pod:3260
12028 msgid "FIFO (named pipe)"
12032 #: ../src/guestfs-actions.pod:4928 ../fish/guestfish-actions.pod:3262
12037 #: ../src/guestfs-actions.pod:4930 ../fish/guestfish-actions.pod:3264
12038 msgid "Symbolic link"
12042 #: ../src/guestfs-actions.pod:4932 ../fish/guestfish-actions.pod:3266
12047 #: ../src/guestfs-actions.pod:4934 ../fish/guestfish-actions.pod:3268
12048 msgid "Regular file"
12052 #: ../src/guestfs-actions.pod:4936 ../fish/guestfish-actions.pod:3270
12057 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3272
12062 #: ../src/guestfs-actions.pod:4940 ../fish/guestfish-actions.pod:3274
12067 #: ../src/guestfs-actions.pod:4942 ../fish/guestfish-actions.pod:3276
12068 msgid "Unknown file type"
12072 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3278
12077 #: ../src/guestfs-actions.pod:4946 ../fish/guestfish-actions.pod:3280
12078 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12082 #: ../src/guestfs-actions.pod:4951
12084 "This function is primarily intended for use by programs. To get a simple "
12085 "list of names, use C<guestfs_ls>. To get a printable directory for human "
12086 "consumption, use C<guestfs_ll>."
12090 #: ../src/guestfs-actions.pod:4955
12092 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
12093 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
12098 #: ../src/guestfs-actions.pod:4961
12099 msgid "guestfs_readlink"
12103 #: ../src/guestfs-actions.pod:4963
12107 " guestfs_readlink (guestfs_h *g,\n"
12108 " const char *path);\n"
12113 #: ../src/guestfs-actions.pod:4967 ../fish/guestfish-actions.pod:3293
12114 msgid "This command reads the target of a symbolic link."
12118 #: ../src/guestfs-actions.pod:4974
12119 msgid "guestfs_readlinklist"
12123 #: ../src/guestfs-actions.pod:4976
12127 " guestfs_readlinklist (guestfs_h *g,\n"
12128 " const char *path,\n"
12129 " char *const *names);\n"
12134 #: ../src/guestfs-actions.pod:4981 ../fish/guestfish-actions.pod:3299
12136 "This call allows you to do a C<readlink> operation on multiple files, where "
12137 "all files are in the directory C<path>. C<names> is the list of files from "
12142 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3303
12144 "On return you get a list of strings, with a one-to-one correspondence to the "
12145 "C<names> list. Each string is the value of the symbolic link."
12149 #: ../src/guestfs-actions.pod:4989 ../fish/guestfish-actions.pod:3307
12151 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12152 "result string is the empty string C<\"\">. However the whole operation is "
12153 "completed even if there were C<readlink(2)> errors, and so you can call this "
12154 "function with names where you don't know if they are symbolic links already "
12155 "(albeit slightly less efficient)."
12159 #: ../src/guestfs-actions.pod:4996 ../fish/guestfish-actions.pod:3314
12161 "This call is intended for programs that want to efficiently list a directory "
12162 "contents without making many round-trips. Very long directory listings "
12163 "might cause the protocol message size to be exceeded, causing this call to "
12164 "fail. The caller must split up such requests into smaller groups of names."
12168 #: ../src/guestfs-actions.pod:5009
12169 msgid "guestfs_realpath"
12173 #: ../src/guestfs-actions.pod:5011
12177 " guestfs_realpath (guestfs_h *g,\n"
12178 " const char *path);\n"
12183 #: ../src/guestfs-actions.pod:5015 ../fish/guestfish-actions.pod:3325
12185 "Return the canonicalized absolute pathname of C<path>. The returned path "
12186 "has no C<.>, C<..> or symbolic link path elements."
12190 #: ../src/guestfs-actions.pod:5023
12191 msgid "guestfs_removexattr"
12195 #: ../src/guestfs-actions.pod:5025
12199 " guestfs_removexattr (guestfs_h *g,\n"
12200 " const char *xattr,\n"
12201 " const char *path);\n"
12206 #: ../src/guestfs-actions.pod:5030 ../fish/guestfish-actions.pod:3332
12207 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
12211 #: ../src/guestfs-actions.pod:5033
12212 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
12216 #: ../src/guestfs-actions.pod:5039
12217 msgid "guestfs_resize2fs"
12221 #: ../src/guestfs-actions.pod:5041
12225 " guestfs_resize2fs (guestfs_h *g,\n"
12226 " const char *device);\n"
12231 #: ../src/guestfs-actions.pod:5045 ../fish/guestfish-actions.pod:3341
12233 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12234 "underlying device."
12238 #: ../src/guestfs-actions.pod:5048
12240 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
12241 "C<device> before calling this command. For unknown reasons C<resize2fs> "
12242 "sometimes gives an error about this and sometimes not. In any case, it is "
12243 "always safe to call C<guestfs_e2fsck_f> before calling this function."
12247 #: ../src/guestfs-actions.pod:5058
12248 msgid "guestfs_resize2fs_size"
12252 #: ../src/guestfs-actions.pod:5060
12256 " guestfs_resize2fs_size (guestfs_h *g,\n"
12257 " const char *device,\n"
12258 " int64_t size);\n"
12263 #: ../src/guestfs-actions.pod:5065
12265 "This command is the same as C<guestfs_resize2fs> except that it allows you "
12266 "to specify the new size (in bytes) explicitly."
12270 #: ../src/guestfs-actions.pod:5072
12275 #: ../src/guestfs-actions.pod:5074
12279 " guestfs_rm (guestfs_h *g,\n"
12280 " const char *path);\n"
12285 #: ../src/guestfs-actions.pod:5078 ../fish/guestfish-actions.pod:3361
12286 msgid "Remove the single file C<path>."
12290 #: ../src/guestfs-actions.pod:5084
12291 msgid "guestfs_rm_rf"
12295 #: ../src/guestfs-actions.pod:5086
12299 " guestfs_rm_rf (guestfs_h *g,\n"
12300 " const char *path);\n"
12305 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3367
12307 "Remove the file or directory C<path>, recursively removing the contents if "
12308 "its a directory. This is like the C<rm -rf> shell command."
12312 #: ../src/guestfs-actions.pod:5098
12313 msgid "guestfs_rmdir"
12317 #: ../src/guestfs-actions.pod:5100
12321 " guestfs_rmdir (guestfs_h *g,\n"
12322 " const char *path);\n"
12327 #: ../src/guestfs-actions.pod:5104 ../fish/guestfish-actions.pod:3375
12328 msgid "Remove the single directory C<path>."
12332 #: ../src/guestfs-actions.pod:5110
12333 msgid "guestfs_rmmountpoint"
12337 #: ../src/guestfs-actions.pod:5112
12341 " guestfs_rmmountpoint (guestfs_h *g,\n"
12342 " const char *exemptpath);\n"
12347 #: ../src/guestfs-actions.pod:5116
12349 "This calls removes a mountpoint that was previously created with "
12350 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
12354 #: ../src/guestfs-actions.pod:5124
12355 msgid "guestfs_scrub_device"
12359 #: ../src/guestfs-actions.pod:5126
12363 " guestfs_scrub_device (guestfs_h *g,\n"
12364 " const char *device);\n"
12369 #: ../src/guestfs-actions.pod:5130 ../fish/guestfish-actions.pod:3389
12371 "This command writes patterns over C<device> to make data retrieval more "
12376 #: ../src/guestfs-actions.pod:5133 ../src/guestfs-actions.pod:5154 ../src/guestfs-actions.pod:5173 ../fish/guestfish-actions.pod:3392 ../fish/guestfish-actions.pod:3407 ../fish/guestfish-actions.pod:3420
12378 "It is an interface to the L<scrub(1)> program. See that manual page for "
12383 #: ../src/guestfs-actions.pod:5141 ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:5178
12384 msgid "(Added in 1.0.52)"
12388 #: ../src/guestfs-actions.pod:5143
12389 msgid "guestfs_scrub_file"
12393 #: ../src/guestfs-actions.pod:5145
12397 " guestfs_scrub_file (guestfs_h *g,\n"
12398 " const char *file);\n"
12403 #: ../src/guestfs-actions.pod:5149 ../fish/guestfish-actions.pod:3402
12405 "This command writes patterns over a file to make data retrieval more "
12410 #: ../src/guestfs-actions.pod:5152 ../fish/guestfish-actions.pod:3405
12411 msgid "The file is I<removed> after scrubbing."
12415 #: ../src/guestfs-actions.pod:5161
12416 msgid "guestfs_scrub_freespace"
12420 #: ../src/guestfs-actions.pod:5163
12424 " guestfs_scrub_freespace (guestfs_h *g,\n"
12425 " const char *dir);\n"
12430 #: ../src/guestfs-actions.pod:5167
12432 "This command creates the directory C<dir> and then fills it with files until "
12433 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
12434 "and deletes them. The intention is to scrub any free space on the partition "
12435 "containing C<dir>."
12439 #: ../src/guestfs-actions.pod:5180
12440 msgid "guestfs_set_append"
12444 #: ../src/guestfs-actions.pod:5182
12448 " guestfs_set_append (guestfs_h *g,\n"
12449 " const char *append);\n"
12454 #: ../src/guestfs-actions.pod:5186 ../fish/guestfish-actions.pod:3429
12456 "This function is used to add additional options to the guest kernel command "
12461 #: ../src/guestfs-actions.pod:5189 ../fish/guestfish-actions.pod:3432
12463 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12464 "environment variable."
12468 #: ../src/guestfs-actions.pod:5192 ../fish/guestfish-actions.pod:3435
12470 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12471 "(libguestfs always adds a few of its own)."
12475 #: ../src/guestfs-actions.pod:5199
12476 msgid "guestfs_set_autosync"
12480 #: ../src/guestfs-actions.pod:5201
12484 " guestfs_set_autosync (guestfs_h *g,\n"
12485 " int autosync);\n"
12490 #: ../src/guestfs-actions.pod:5205
12492 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12493 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
12494 "the handle is closed (also if the program exits without closing handles)."
12498 #: ../src/guestfs-actions.pod:5210 ../fish/guestfish-actions.pod:3449
12500 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12501 "disabled by default)."
12505 #: ../src/guestfs-actions.pod:5217
12506 msgid "guestfs_set_direct"
12510 #: ../src/guestfs-actions.pod:5219
12514 " guestfs_set_direct (guestfs_h *g,\n"
12520 #: ../src/guestfs-actions.pod:5223 ../fish/guestfish-actions.pod:3458
12522 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12523 "passed directly through to the appliance once it is launched."
12527 #: ../src/guestfs-actions.pod:5227
12529 "One consequence of this is that log messages aren't caught by the library "
12530 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
12535 #: ../src/guestfs-actions.pod:5231 ../fish/guestfish-actions.pod:3466
12536 msgid "You probably don't want to use this unless you know what you are doing."
12540 #: ../src/guestfs-actions.pod:5234 ../fish/guestfish-actions.pod:3469
12541 msgid "The default is disabled."
12545 #: ../src/guestfs-actions.pod:5240
12546 msgid "guestfs_set_e2label"
12550 #: ../src/guestfs-actions.pod:5242
12554 " guestfs_set_e2label (guestfs_h *g,\n"
12555 " const char *device,\n"
12556 " const char *label);\n"
12561 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:3475
12563 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12564 "C<label>. Filesystem labels are limited to 16 characters."
12568 #: ../src/guestfs-actions.pod:5251
12570 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
12571 "the existing label on a filesystem."
12575 #: ../src/guestfs-actions.pod:5258
12576 msgid "guestfs_set_e2uuid"
12580 #: ../src/guestfs-actions.pod:5260
12584 " guestfs_set_e2uuid (guestfs_h *g,\n"
12585 " const char *device,\n"
12586 " const char *uuid);\n"
12591 #: ../src/guestfs-actions.pod:5265 ../fish/guestfish-actions.pod:3486
12593 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12594 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12595 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12599 #: ../src/guestfs-actions.pod:5270
12601 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
12602 "the existing UUID of a filesystem."
12606 #: ../src/guestfs-actions.pod:5277
12607 msgid "guestfs_set_memsize"
12611 #: ../src/guestfs-actions.pod:5279
12615 " guestfs_set_memsize (guestfs_h *g,\n"
12621 #: ../src/guestfs-actions.pod:5283
12623 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12624 "This only has any effect if called before C<guestfs_launch>."
12628 #: ../src/guestfs-actions.pod:5287 ../fish/guestfish-actions.pod:3504
12630 "You can also change this by setting the environment variable "
12631 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12635 #: ../src/guestfs-actions.pod:5298
12636 msgid "guestfs_set_network"
12640 #: ../src/guestfs-actions.pod:5300
12644 " guestfs_set_network (guestfs_h *g,\n"
12650 #: ../src/guestfs-actions.pod:5304 ../fish/guestfish-actions.pod:3517
12652 "If C<network> is true, then the network is enabled in the libguestfs "
12653 "appliance. The default is false."
12657 #: ../src/guestfs-actions.pod:5307 ../fish/guestfish-actions.pod:3520
12659 "This affects whether commands are able to access the network (see "
12660 "L<guestfs(3)/RUNNING COMMANDS>)."
12664 #: ../src/guestfs-actions.pod:5310
12666 "You must call this before calling C<guestfs_launch>, otherwise it has no "
12671 #: ../src/guestfs-actions.pod:5317
12672 msgid "guestfs_set_path"
12676 #: ../src/guestfs-actions.pod:5319
12680 " guestfs_set_path (guestfs_h *g,\n"
12681 " const char *searchpath);\n"
12686 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:3532
12687 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12691 #: ../src/guestfs-actions.pod:5325 ../fish/guestfish-actions.pod:3534
12693 "The default is C<$libdir/guestfs> unless overridden by setting "
12694 "C<LIBGUESTFS_PATH> environment variable."
12698 #: ../src/guestfs-actions.pod:5328 ../fish/guestfish-actions.pod:3537
12699 msgid "Setting C<path> to C<NULL> restores the default path."
12703 #: ../src/guestfs-actions.pod:5334
12704 msgid "guestfs_set_qemu"
12708 #: ../src/guestfs-actions.pod:5336
12712 " guestfs_set_qemu (guestfs_h *g,\n"
12713 " const char *qemu);\n"
12718 #: ../src/guestfs-actions.pod:5340 ../fish/guestfish-actions.pod:3545
12719 msgid "Set the qemu binary that we will use."
12723 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3547
12724 msgid "The default is chosen when the library was compiled by the configure script."
12728 #: ../src/guestfs-actions.pod:5345 ../fish/guestfish-actions.pod:3550
12730 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12735 #: ../src/guestfs-actions.pod:5348 ../fish/guestfish-actions.pod:3553
12736 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12740 #: ../src/guestfs-actions.pod:5350 ../fish/guestfish-actions.pod:3555
12742 "Note that you should call this function as early as possible after creating "
12743 "the handle. This is because some pre-launch operations depend on testing "
12744 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12745 "don't retest features, and so you might see inconsistent results. Using the "
12746 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12747 "the qemu binary at the same time as the handle is created."
12751 #: ../src/guestfs-actions.pod:5362
12752 msgid "guestfs_set_recovery_proc"
12756 #: ../src/guestfs-actions.pod:5364
12760 " guestfs_set_recovery_proc (guestfs_h *g,\n"
12761 " int recoveryproc);\n"
12766 #: ../src/guestfs-actions.pod:5368
12768 "If this is called with the parameter C<false> then C<guestfs_launch> does "
12769 "not create a recovery process. The purpose of the recovery process is to "
12770 "stop runaway qemu processes in the case where the main program aborts "
12775 #: ../src/guestfs-actions.pod:5373
12777 "This only has any effect if called before C<guestfs_launch>, and the default "
12782 #: ../src/guestfs-actions.pod:5376 ../fish/guestfish-actions.pod:3577
12784 "About the only time when you would want to disable this is if the main "
12785 "process will fork itself into the background (\"daemonize\" itself). In "
12786 "this case the recovery process thinks that the main program has disappeared "
12787 "and so kills qemu, which is not very helpful."
12791 #: ../src/guestfs-actions.pod:5386
12792 msgid "guestfs_set_selinux"
12796 #: ../src/guestfs-actions.pod:5388
12800 " guestfs_set_selinux (guestfs_h *g,\n"
12806 #: ../src/guestfs-actions.pod:5392 ../fish/guestfish-actions.pod:3589
12808 "This sets the selinux flag that is passed to the appliance at boot time. "
12809 "The default is C<selinux=0> (disabled)."
12813 #: ../src/guestfs-actions.pod:5395 ../fish/guestfish-actions.pod:3592
12815 "Note that if SELinux is enabled, it is always in Permissive mode "
12816 "(C<enforcing=0>)."
12820 #: ../src/guestfs-actions.pod:5405
12821 msgid "guestfs_set_trace"
12825 #: ../src/guestfs-actions.pod:5407
12829 " guestfs_set_trace (guestfs_h *g,\n"
12835 #: ../src/guestfs-actions.pod:5411 ../fish/guestfish-actions.pod:3604
12837 "If the command trace flag is set to 1, then commands are printed on stderr "
12838 "before they are executed in a format which is very similar to the one used "
12839 "by guestfish. In other words, you can run a program with this enabled, and "
12840 "you will get out a script which you can feed to guestfish to perform the "
12841 "same set of actions."
12845 #: ../src/guestfs-actions.pod:5418 ../fish/guestfish-actions.pod:3611
12847 "If you want to trace C API calls into libguestfs (and other libraries) then "
12848 "possibly a better way is to use the external ltrace(1) command."
12852 #: ../src/guestfs-actions.pod:5422 ../fish/guestfish-actions.pod:3615
12854 "Command traces are disabled unless the environment variable "
12855 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12859 #: ../src/guestfs-actions.pod:5429
12860 msgid "guestfs_set_verbose"
12864 #: ../src/guestfs-actions.pod:5431
12868 " guestfs_set_verbose (guestfs_h *g,\n"
12874 #: ../src/guestfs-actions.pod:5435 ../fish/guestfish-actions.pod:3624
12875 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
12879 #: ../src/guestfs-actions.pod:5437 ../fish/guestfish-actions.pod:3626
12881 "Verbose messages are disabled unless the environment variable "
12882 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12886 #: ../src/guestfs-actions.pod:5444
12887 msgid "guestfs_setcon"
12891 #: ../src/guestfs-actions.pod:5446
12895 " guestfs_setcon (guestfs_h *g,\n"
12896 " const char *context);\n"
12901 #: ../src/guestfs-actions.pod:5450 ../fish/guestfish-actions.pod:3633
12903 "This sets the SELinux security context of the daemon to the string "
12908 #: ../src/guestfs-actions.pod:5453 ../fish/guestfish-actions.pod:3636
12909 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12913 #: ../src/guestfs-actions.pod:5459
12914 msgid "guestfs_setxattr"
12918 #: ../src/guestfs-actions.pod:5461
12922 " guestfs_setxattr (guestfs_h *g,\n"
12923 " const char *xattr,\n"
12924 " const char *val,\n"
12926 " const char *path);\n"
12931 #: ../src/guestfs-actions.pod:5468 ../fish/guestfish-actions.pod:3642
12933 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12934 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12938 #: ../src/guestfs-actions.pod:5472
12939 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
12943 #: ../src/guestfs-actions.pod:5478
12944 msgid "guestfs_sfdisk"
12948 #: ../src/guestfs-actions.pod:5480
12952 " guestfs_sfdisk (guestfs_h *g,\n"
12953 " const char *device,\n"
12957 " char *const *lines);\n"
12962 #: ../src/guestfs-actions.pod:5488 ../fish/guestfish-actions.pod:3652
12964 "This is a direct interface to the L<sfdisk(8)> program for creating "
12965 "partitions on block devices."
12969 #: ../src/guestfs-actions.pod:5491 ../fish/guestfish-actions.pod:3655
12970 msgid "C<device> should be a block device, for example C</dev/sda>."
12974 #: ../src/guestfs-actions.pod:5493 ../fish/guestfish-actions.pod:3657
12976 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12977 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
12978 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12979 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12980 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12981 "the kernel) cannot work out the right geometry and you will need to tell it."
12985 #: ../src/guestfs-actions.pod:5501 ../fish/guestfish-actions.pod:3665
12987 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12988 "refer to the L<sfdisk(8)> manpage."
12992 #: ../src/guestfs-actions.pod:5504 ../fish/guestfish-actions.pod:3668
12994 "To create a single partition occupying the whole disk, you would pass "
12995 "C<lines> as a single element list, when the single element being the string "
13000 #: ../src/guestfs-actions.pod:5508
13001 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
13005 #: ../src/guestfs-actions.pod:5518
13006 msgid "guestfs_sfdiskM"
13010 #: ../src/guestfs-actions.pod:5520
13014 " guestfs_sfdiskM (guestfs_h *g,\n"
13015 " const char *device,\n"
13016 " char *const *lines);\n"
13021 #: ../src/guestfs-actions.pod:5525
13023 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
13024 "partition sizes are specified in megabytes only (rounded to the nearest "
13025 "cylinder) and you don't need to specify the cyls, heads and sectors "
13026 "parameters which were rarely if ever used anyway."
13030 #: ../src/guestfs-actions.pod:5531
13032 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
13033 "C<guestfs_part_disk>"
13037 #: ../src/guestfs-actions.pod:5541
13038 msgid "guestfs_sfdisk_N"
13042 #: ../src/guestfs-actions.pod:5543
13046 " guestfs_sfdisk_N (guestfs_h *g,\n"
13047 " const char *device,\n"
13052 " const char *line);\n"
13057 #: ../src/guestfs-actions.pod:5552 ../fish/guestfish-actions.pod:3698
13059 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13060 "(note: C<n> counts from 1)."
13064 #: ../src/guestfs-actions.pod:5555
13066 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
13067 "for the cyls/heads/sectors parameters."
13071 #: ../src/guestfs-actions.pod:5558
13072 msgid "See also: C<guestfs_part_add>"
13076 #: ../src/guestfs-actions.pod:5567
13077 msgid "guestfs_sfdisk_disk_geometry"
13081 #: ../src/guestfs-actions.pod:5569
13085 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
13086 " const char *device);\n"
13091 #: ../src/guestfs-actions.pod:5573
13093 "This displays the disk geometry of C<device> read from the partition table. "
13094 "Especially in the case where the underlying block device has been resized, "
13095 "this can be different from the kernel's idea of the geometry (see "
13096 "C<guestfs_sfdisk_kernel_geometry>)."
13100 #: ../src/guestfs-actions.pod:5578 ../src/guestfs-actions.pod:5594 ../fish/guestfish-actions.pod:3718 ../fish/guestfish-actions.pod:3727
13101 msgid "The result is in human-readable format, and not designed to be parsed."
13105 #: ../src/guestfs-actions.pod:5586
13106 msgid "guestfs_sfdisk_kernel_geometry"
13110 #: ../src/guestfs-actions.pod:5588
13114 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
13115 " const char *device);\n"
13120 #: ../src/guestfs-actions.pod:5592 ../fish/guestfish-actions.pod:3725
13121 msgid "This displays the kernel's idea of the geometry of C<device>."
13125 #: ../src/guestfs-actions.pod:5602
13126 msgid "guestfs_sfdisk_l"
13130 #: ../src/guestfs-actions.pod:5604
13134 " guestfs_sfdisk_l (guestfs_h *g,\n"
13135 " const char *device);\n"
13140 #: ../src/guestfs-actions.pod:5608 ../fish/guestfish-actions.pod:3734
13142 "This displays the partition table on C<device>, in the human-readable output "
13143 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13147 #: ../src/guestfs-actions.pod:5612
13148 msgid "See also: C<guestfs_part_list>"
13152 #: ../src/guestfs-actions.pod:5619
13157 #: ../src/guestfs-actions.pod:5621
13161 " guestfs_sh (guestfs_h *g,\n"
13162 " const char *command);\n"
13167 #: ../src/guestfs-actions.pod:5625 ../fish/guestfish-actions.pod:3744
13169 "This call runs a command from the guest filesystem via the guest's "
13174 #: ../src/guestfs-actions.pod:5628
13175 msgid "This is like C<guestfs_command>, but passes the command to:"
13179 #: ../src/guestfs-actions.pod:5630 ../fish/guestfish-actions.pod:3749
13182 " /bin/sh -c \"command\"\n"
13187 #: ../src/guestfs-actions.pod:5632 ../fish/guestfish-actions.pod:3751
13189 "Depending on the guest's shell, this usually results in wildcards being "
13190 "expanded, shell expressions being interpolated and so on."
13194 #: ../src/guestfs-actions.pod:5636
13195 msgid "All the provisos about C<guestfs_command> apply to this call."
13199 #: ../src/guestfs-actions.pod:5643
13200 msgid "guestfs_sh_lines"
13204 #: ../src/guestfs-actions.pod:5645
13208 " guestfs_sh_lines (guestfs_h *g,\n"
13209 " const char *command);\n"
13214 #: ../src/guestfs-actions.pod:5649
13216 "This is the same as C<guestfs_sh>, but splits the result into a list of "
13221 #: ../src/guestfs-actions.pod:5652
13222 msgid "See also: C<guestfs_command_lines>"
13226 #: ../src/guestfs-actions.pod:5660
13227 msgid "guestfs_sleep"
13231 #: ../src/guestfs-actions.pod:5662
13235 " guestfs_sleep (guestfs_h *g,\n"
13241 #: ../src/guestfs-actions.pod:5666 ../fish/guestfish-actions.pod:3770
13242 msgid "Sleep for C<secs> seconds."
13246 #: ../src/guestfs-actions.pod:5670
13247 msgid "(Added in 1.0.41)"
13251 #: ../src/guestfs-actions.pod:5672 ../src/guestfs-structs.pod:109
13252 msgid "guestfs_stat"
13256 #: ../src/guestfs-actions.pod:5674
13259 " struct guestfs_stat *\n"
13260 " guestfs_stat (guestfs_h *g,\n"
13261 " const char *path);\n"
13266 #: ../src/guestfs-actions.pod:5680 ../fish/guestfish-actions.pod:3778
13267 msgid "This is the same as the C<stat(2)> system call."
13271 #: ../src/guestfs-actions.pod:5688 ../src/guestfs-structs.pod:135
13272 msgid "guestfs_statvfs"
13276 #: ../src/guestfs-actions.pod:5690
13279 " struct guestfs_statvfs *\n"
13280 " guestfs_statvfs (guestfs_h *g,\n"
13281 " const char *path);\n"
13286 #: ../src/guestfs-actions.pod:5694 ../fish/guestfish-actions.pod:3784
13288 "Returns file system statistics for any mounted file system. C<path> should "
13289 "be a file or directory in the mounted file system (typically it is the mount "
13290 "point itself, but it doesn't need to be)."
13294 #: ../src/guestfs-actions.pod:5698 ../fish/guestfish-actions.pod:3788
13295 msgid "This is the same as the C<statvfs(2)> system call."
13299 #: ../src/guestfs-actions.pod:5700
13301 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
13302 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
13306 #: ../src/guestfs-actions.pod:5706
13307 msgid "guestfs_strings"
13311 #: ../src/guestfs-actions.pod:5708
13315 " guestfs_strings (guestfs_h *g,\n"
13316 " const char *path);\n"
13321 #: ../src/guestfs-actions.pod:5712 ../fish/guestfish-actions.pod:3794
13323 "This runs the L<strings(1)> command on a file and returns the list of "
13324 "printable strings found."
13328 #: ../src/guestfs-actions.pod:5724
13329 msgid "guestfs_strings_e"
13333 #: ../src/guestfs-actions.pod:5726
13337 " guestfs_strings_e (guestfs_h *g,\n"
13338 " const char *encoding,\n"
13339 " const char *path);\n"
13344 #: ../src/guestfs-actions.pod:5731
13346 "This is like the C<guestfs_strings> command, but allows you to specify the "
13347 "encoding of strings that are looked for in the source file C<path>."
13351 #: ../src/guestfs-actions.pod:5735 ../fish/guestfish-actions.pod:3808
13352 msgid "Allowed encodings are:"
13356 #: ../src/guestfs-actions.pod:5739 ../fish/guestfish-actions.pod:3812
13361 #: ../src/guestfs-actions.pod:5741
13363 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13364 "ISO-8859-X (this is what C<guestfs_strings> uses)."
13368 #: ../src/guestfs-actions.pod:5744 ../fish/guestfish-actions.pod:3817
13373 #: ../src/guestfs-actions.pod:5746 ../fish/guestfish-actions.pod:3819
13374 msgid "Single 8-bit-byte characters."
13378 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:3821
13383 #: ../src/guestfs-actions.pod:5750 ../fish/guestfish-actions.pod:3823
13384 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13388 #: ../src/guestfs-actions.pod:5753 ../fish/guestfish-actions.pod:3826
13389 msgid "l (lower case letter L)"
13393 #: ../src/guestfs-actions.pod:5755 ../fish/guestfish-actions.pod:3828
13395 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13396 "examining binaries in Windows guests."
13400 #: ../src/guestfs-actions.pod:5758 ../fish/guestfish-actions.pod:3831
13405 #: ../src/guestfs-actions.pod:5760 ../fish/guestfish-actions.pod:3833
13406 msgid "32-bit big endian such as UCS-4BE."
13410 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3835
13415 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:3837
13416 msgid "32-bit little endian such as UCS-4LE."
13420 #: ../src/guestfs-actions.pod:5768 ../fish/guestfish-actions.pod:3841
13421 msgid "The returned strings are transcoded to UTF-8."
13425 #: ../src/guestfs-actions.pod:5779
13426 msgid "guestfs_swapoff_device"
13430 #: ../src/guestfs-actions.pod:5781
13434 " guestfs_swapoff_device (guestfs_h *g,\n"
13435 " const char *device);\n"
13440 #: ../src/guestfs-actions.pod:5785
13442 "This command disables the libguestfs appliance swap device or partition "
13443 "named C<device>. See C<guestfs_swapon_device>."
13447 #: ../src/guestfs-actions.pod:5793
13448 msgid "guestfs_swapoff_file"
13452 #: ../src/guestfs-actions.pod:5795
13456 " guestfs_swapoff_file (guestfs_h *g,\n"
13457 " const char *file);\n"
13462 #: ../src/guestfs-actions.pod:5799 ../fish/guestfish-actions.pod:3858
13463 msgid "This command disables the libguestfs appliance swap on file."
13467 #: ../src/guestfs-actions.pod:5805
13468 msgid "guestfs_swapoff_label"
13472 #: ../src/guestfs-actions.pod:5807
13476 " guestfs_swapoff_label (guestfs_h *g,\n"
13477 " const char *label);\n"
13482 #: ../src/guestfs-actions.pod:5811 ../fish/guestfish-actions.pod:3864
13484 "This command disables the libguestfs appliance swap on labeled swap "
13489 #: ../src/guestfs-actions.pod:5818
13490 msgid "guestfs_swapoff_uuid"
13494 #: ../src/guestfs-actions.pod:5820
13498 " guestfs_swapoff_uuid (guestfs_h *g,\n"
13499 " const char *uuid);\n"
13504 #: ../src/guestfs-actions.pod:5824 ../fish/guestfish-actions.pod:3871
13506 "This command disables the libguestfs appliance swap partition with the given "
13511 #: ../src/guestfs-actions.pod:5831
13512 msgid "guestfs_swapon_device"
13516 #: ../src/guestfs-actions.pod:5833
13520 " guestfs_swapon_device (guestfs_h *g,\n"
13521 " const char *device);\n"
13526 #: ../src/guestfs-actions.pod:5837
13528 "This command enables the libguestfs appliance to use the swap device or "
13529 "partition named C<device>. The increased memory is made available for all "
13530 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
13534 #: ../src/guestfs-actions.pod:5842 ../fish/guestfish-actions.pod:3883
13536 "Note that you should not swap to existing guest swap partitions unless you "
13537 "know what you are doing. They may contain hibernation information, or other "
13538 "information that the guest doesn't want you to trash. You also risk leaking "
13539 "information about the host to the guest this way. Instead, attach a new "
13540 "host device to the guest and swap on that."
13544 #: ../src/guestfs-actions.pod:5853
13545 msgid "guestfs_swapon_file"
13549 #: ../src/guestfs-actions.pod:5855
13553 " guestfs_swapon_file (guestfs_h *g,\n"
13554 " const char *file);\n"
13559 #: ../src/guestfs-actions.pod:5859
13561 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
13566 #: ../src/guestfs-actions.pod:5866
13567 msgid "guestfs_swapon_label"
13571 #: ../src/guestfs-actions.pod:5868
13575 " guestfs_swapon_label (guestfs_h *g,\n"
13576 " const char *label);\n"
13581 #: ../src/guestfs-actions.pod:5872
13583 "This command enables swap to a labeled swap partition. See "
13584 "C<guestfs_swapon_device> for other notes."
13588 #: ../src/guestfs-actions.pod:5879
13589 msgid "guestfs_swapon_uuid"
13593 #: ../src/guestfs-actions.pod:5881
13597 " guestfs_swapon_uuid (guestfs_h *g,\n"
13598 " const char *uuid);\n"
13603 #: ../src/guestfs-actions.pod:5885
13605 "This command enables swap to a swap partition with the given UUID. See "
13606 "C<guestfs_swapon_device> for other notes."
13610 #: ../src/guestfs-actions.pod:5892
13611 msgid "guestfs_sync"
13615 #: ../src/guestfs-actions.pod:5894
13619 " guestfs_sync (guestfs_h *g);\n"
13624 #: ../src/guestfs-actions.pod:5897 ../fish/guestfish-actions.pod:3915
13626 "This syncs the disk, so that any writes are flushed through to the "
13627 "underlying disk image."
13631 #: ../src/guestfs-actions.pod:5900 ../fish/guestfish-actions.pod:3918
13633 "You should always call this if you have modified a disk image, before "
13634 "closing the handle."
13638 #: ../src/guestfs-actions.pod:5907
13639 msgid "guestfs_tail"
13643 #: ../src/guestfs-actions.pod:5909
13647 " guestfs_tail (guestfs_h *g,\n"
13648 " const char *path);\n"
13653 #: ../src/guestfs-actions.pod:5913 ../fish/guestfish-actions.pod:3925
13654 msgid "This command returns up to the last 10 lines of a file as a list of strings."
13658 #: ../src/guestfs-actions.pod:5925
13659 msgid "guestfs_tail_n"
13663 #: ../src/guestfs-actions.pod:5927
13667 " guestfs_tail_n (guestfs_h *g,\n"
13669 " const char *path);\n"
13674 #: ../src/guestfs-actions.pod:5932 ../fish/guestfish-actions.pod:3935
13676 "If the parameter C<nrlines> is a positive number, this returns the last "
13677 "C<nrlines> lines of the file C<path>."
13681 #: ../src/guestfs-actions.pod:5935 ../fish/guestfish-actions.pod:3938
13683 "If the parameter C<nrlines> is a negative number, this returns lines from "
13684 "the file C<path>, starting with the C<-nrlines>th line."
13688 #: ../src/guestfs-actions.pod:5949
13689 msgid "guestfs_tar_in"
13693 #: ../src/guestfs-actions.pod:5951
13697 " guestfs_tar_in (guestfs_h *g,\n"
13698 " const char *tarfile,\n"
13699 " const char *directory);\n"
13704 #: ../src/guestfs-actions.pod:5956 ../fish/guestfish-actions.pod:3950
13706 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13707 "tar file) into C<directory>."
13711 #: ../src/guestfs-actions.pod:5959
13712 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
13716 #: ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:5981 ../src/guestfs-actions.pod:5997 ../src/guestfs-actions.pod:6013
13717 msgid "(Added in 1.0.3)"
13721 #: ../src/guestfs-actions.pod:5966
13722 msgid "guestfs_tar_out"
13726 #: ../src/guestfs-actions.pod:5968
13730 " guestfs_tar_out (guestfs_h *g,\n"
13731 " const char *directory,\n"
13732 " const char *tarfile);\n"
13737 #: ../src/guestfs-actions.pod:5973 ../fish/guestfish-actions.pod:3962
13739 "This command packs the contents of C<directory> and downloads it to local "
13744 #: ../src/guestfs-actions.pod:5976
13746 "To download a compressed tarball, use C<guestfs_tgz_out> or "
13747 "C<guestfs_txz_out>."
13751 #: ../src/guestfs-actions.pod:5983
13752 msgid "guestfs_tgz_in"
13756 #: ../src/guestfs-actions.pod:5985
13760 " guestfs_tgz_in (guestfs_h *g,\n"
13761 " const char *tarball,\n"
13762 " const char *directory);\n"
13767 #: ../src/guestfs-actions.pod:5990 ../fish/guestfish-actions.pod:3974
13769 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13770 "tar file) into C<directory>."
13774 #: ../src/guestfs-actions.pod:5993
13775 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
13779 #: ../src/guestfs-actions.pod:5999
13780 msgid "guestfs_tgz_out"
13784 #: ../src/guestfs-actions.pod:6001
13788 " guestfs_tgz_out (guestfs_h *g,\n"
13789 " const char *directory,\n"
13790 " const char *tarball);\n"
13795 #: ../src/guestfs-actions.pod:6006 ../fish/guestfish-actions.pod:3985
13797 "This command packs the contents of C<directory> and downloads it to local "
13802 #: ../src/guestfs-actions.pod:6009
13803 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
13807 #: ../src/guestfs-actions.pod:6015
13808 msgid "guestfs_touch"
13812 #: ../src/guestfs-actions.pod:6017
13816 " guestfs_touch (guestfs_h *g,\n"
13817 " const char *path);\n"
13822 #: ../src/guestfs-actions.pod:6021 ../fish/guestfish-actions.pod:3996
13824 "Touch acts like the L<touch(1)> command. It can be used to update the "
13825 "timestamps on a file, or, if the file does not exist, to create a new "
13826 "zero-length file."
13830 #: ../src/guestfs-actions.pod:6025 ../fish/guestfish-actions.pod:4000
13832 "This command only works on regular files, and will fail on other file types "
13833 "such as directories, symbolic links, block special etc."
13837 #: ../src/guestfs-actions.pod:6032
13838 msgid "guestfs_truncate"
13842 #: ../src/guestfs-actions.pod:6034
13846 " guestfs_truncate (guestfs_h *g,\n"
13847 " const char *path);\n"
13852 #: ../src/guestfs-actions.pod:6038 ../fish/guestfish-actions.pod:4007
13854 "This command truncates C<path> to a zero-length file. The file must exist "
13859 #: ../src/guestfs-actions.pod:6045
13860 msgid "guestfs_truncate_size"
13864 #: ../src/guestfs-actions.pod:6047
13868 " guestfs_truncate_size (guestfs_h *g,\n"
13869 " const char *path,\n"
13870 " int64_t size);\n"
13875 #: ../src/guestfs-actions.pod:6052 ../fish/guestfish-actions.pod:4014
13877 "This command truncates C<path> to size C<size> bytes. The file must exist "
13882 #: ../src/guestfs-actions.pod:6055
13884 "If the current file size is less than C<size> then the file is extended to "
13885 "the required size with zero bytes. This creates a sparse file (ie. disk "
13886 "blocks are not allocated for the file until you write to it). To create a "
13887 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
13891 #: ../src/guestfs-actions.pod:6065
13892 msgid "guestfs_tune2fs_l"
13896 #: ../src/guestfs-actions.pod:6067
13900 " guestfs_tune2fs_l (guestfs_h *g,\n"
13901 " const char *device);\n"
13906 #: ../src/guestfs-actions.pod:6071 ../fish/guestfish-actions.pod:4027
13908 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13913 #: ../src/guestfs-actions.pod:6074 ../fish/guestfish-actions.pod:4030
13915 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13916 "for more details. The list of fields returned isn't clearly defined, and "
13917 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13918 "and the filesystem itself."
13922 #: ../src/guestfs-actions.pod:6087
13923 msgid "guestfs_txz_in"
13927 #: ../src/guestfs-actions.pod:6089
13931 " guestfs_txz_in (guestfs_h *g,\n"
13932 " const char *tarball,\n"
13933 " const char *directory);\n"
13938 #: ../src/guestfs-actions.pod:6094 ../fish/guestfish-actions.pod:4039
13940 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13941 "tar file) into C<directory>."
13945 #: ../src/guestfs-actions.pod:6101
13946 msgid "guestfs_txz_out"
13950 #: ../src/guestfs-actions.pod:6103
13954 " guestfs_txz_out (guestfs_h *g,\n"
13955 " const char *directory,\n"
13956 " const char *tarball);\n"
13961 #: ../src/guestfs-actions.pod:6108 ../fish/guestfish-actions.pod:4048
13963 "This command packs the contents of C<directory> and downloads it to local "
13964 "file C<tarball> (as an xz compressed tar archive)."
13968 #: ../src/guestfs-actions.pod:6115
13969 msgid "guestfs_umask"
13973 #: ../src/guestfs-actions.pod:6117
13977 " guestfs_umask (guestfs_h *g,\n"
13983 #: ../src/guestfs-actions.pod:6121 ../fish/guestfish-actions.pod:4057
13985 "This function sets the mask used for creating new files and device nodes to "
13990 #: ../src/guestfs-actions.pod:6124 ../fish/guestfish-actions.pod:4060
13992 "Typical umask values would be C<022> which creates new files with "
13993 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13994 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13998 #: ../src/guestfs-actions.pod:6129 ../fish/guestfish-actions.pod:4065
14000 "The default umask is C<022>. This is important because it means that "
14001 "directories and device nodes will be created with C<0644> or C<0755> mode "
14002 "even if you specify C<0777>."
14006 #: ../src/guestfs-actions.pod:6133
14008 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
14009 "C<guestfs_mkdir>."
14013 #: ../src/guestfs-actions.pod:6136 ../fish/guestfish-actions.pod:4072
14014 msgid "This call returns the previous umask."
14018 #: ../src/guestfs-actions.pod:6142
14019 msgid "guestfs_umount"
14023 #: ../src/guestfs-actions.pod:6144
14027 " guestfs_umount (guestfs_h *g,\n"
14028 " const char *pathordevice);\n"
14033 #: ../src/guestfs-actions.pod:6148 ../fish/guestfish-actions.pod:4080
14035 "This unmounts the given filesystem. The filesystem may be specified either "
14036 "by its mountpoint (path) or the device which contains the filesystem."
14040 #: ../src/guestfs-actions.pod:6156
14041 msgid "guestfs_umount_all"
14045 #: ../src/guestfs-actions.pod:6158
14049 " guestfs_umount_all (guestfs_h *g);\n"
14054 #: ../src/guestfs-actions.pod:6161 ../fish/guestfish-actions.pod:4090
14055 msgid "This unmounts all mounted filesystems."
14059 #: ../src/guestfs-actions.pod:6163 ../fish/guestfish-actions.pod:4092
14060 msgid "Some internal mounts are not unmounted by this call."
14064 #: ../src/guestfs-actions.pod:6169
14065 msgid "guestfs_upload"
14069 #: ../src/guestfs-actions.pod:6171
14073 " guestfs_upload (guestfs_h *g,\n"
14074 " const char *filename,\n"
14075 " const char *remotefilename);\n"
14080 #: ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6195 ../fish/guestfish-actions.pod:4098 ../fish/guestfish-actions.pod:4111
14081 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14085 #: ../src/guestfs-actions.pod:6181
14086 msgid "See also C<guestfs_download>."
14090 #: ../src/guestfs-actions.pod:6187
14091 msgid "guestfs_upload_offset"
14095 #: ../src/guestfs-actions.pod:6189
14099 " guestfs_upload_offset (guestfs_h *g,\n"
14100 " const char *filename,\n"
14101 " const char *remotefilename,\n"
14102 " int64_t offset);\n"
14107 #: ../src/guestfs-actions.pod:6198 ../fish/guestfish-actions.pod:4114
14109 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14110 "The intention is to overwrite parts of existing files or devices, although "
14111 "if a non-existant file is specified then it is created with a \"hole\" "
14112 "before C<offset>. The size of the data written is implicit in the size of "
14113 "the source C<filename>."
14117 #: ../src/guestfs-actions.pod:6205
14119 "Note that there is no limit on the amount of data that can be uploaded with "
14120 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
14121 "full amount unless an error occurs."
14125 #: ../src/guestfs-actions.pod:6210
14126 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
14130 #: ../src/guestfs-actions.pod:6216
14131 msgid "guestfs_utimens"
14135 #: ../src/guestfs-actions.pod:6218
14139 " guestfs_utimens (guestfs_h *g,\n"
14140 " const char *path,\n"
14141 " int64_t atsecs,\n"
14142 " int64_t atnsecs,\n"
14143 " int64_t mtsecs,\n"
14144 " int64_t mtnsecs);\n"
14149 #: ../src/guestfs-actions.pod:6226 ../fish/guestfish-actions.pod:4134
14150 msgid "This command sets the timestamps of a file with nanosecond precision."
14154 #: ../src/guestfs-actions.pod:6229 ../fish/guestfish-actions.pod:4137
14156 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14161 #: ../src/guestfs-actions.pod:6232 ../fish/guestfish-actions.pod:4140
14163 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14164 "nanoseconds from the epoch."
14168 #: ../src/guestfs-actions.pod:6235 ../fish/guestfish-actions.pod:4143
14170 "If the C<*nsecs> field contains the special value C<-1> then the "
14171 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14172 "ignored in this case)."
14176 #: ../src/guestfs-actions.pod:6239 ../fish/guestfish-actions.pod:4147
14178 "If the C<*nsecs> field contains the special value C<-2> then the "
14179 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14184 #: ../src/guestfs-actions.pod:6247 ../src/guestfs-structs.pod:175
14185 msgid "guestfs_version"
14189 #: ../src/guestfs-actions.pod:6249
14192 " struct guestfs_version *\n"
14193 " guestfs_version (guestfs_h *g);\n"
14198 #: ../src/guestfs-actions.pod:6252 ../fish/guestfish-actions.pod:4155
14199 msgid "Return the libguestfs version number that the program is linked against."
14203 #: ../src/guestfs-actions.pod:6255 ../fish/guestfish-actions.pod:4158
14205 "Note that because of dynamic linking this is not necessarily the version of "
14206 "libguestfs that you compiled against. You can compile the program, and then "
14207 "at runtime dynamically link against a completely different C<libguestfs.so> "
14212 #: ../src/guestfs-actions.pod:6260 ../fish/guestfish-actions.pod:4163
14214 "This call was added in version C<1.0.58>. In previous versions of "
14215 "libguestfs there was no way to get the version number. From C code you can "
14216 "use dynamic linker functions to find out if this symbol exists (if it "
14217 "doesn't, then it's an earlier version)."
14221 #: ../src/guestfs-actions.pod:6266 ../fish/guestfish-actions.pod:4169
14223 "The call returns a structure with four elements. The first three (C<major>, "
14224 "C<minor> and C<release>) are numbers and correspond to the usual version "
14225 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14226 "but may be used for distro-specific information."
14230 #: ../src/guestfs-actions.pod:6272 ../fish/guestfish-actions.pod:4175
14231 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
14235 #: ../src/guestfs-actions.pod:6275 ../fish/guestfish-actions.pod:4178
14236 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14240 #: ../src/guestfs-actions.pod:6277
14242 "I<Note:> Don't use this call to test for availability of features. In "
14243 "enterprise distributions we backport features from later versions into "
14244 "earlier versions, making this an unreliable way to test for features. Use "
14245 "C<guestfs_available> instead."
14249 #: ../src/guestfs-actions.pod:6283
14251 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
14252 "error. I<The caller must call C<guestfs_free_version> after use>."
14256 #: ../src/guestfs-actions.pod:6287
14257 msgid "(Added in 1.0.58)"
14261 #: ../src/guestfs-actions.pod:6289
14262 msgid "guestfs_vfs_label"
14266 #: ../src/guestfs-actions.pod:6291
14270 " guestfs_vfs_label (guestfs_h *g,\n"
14271 " const char *device);\n"
14276 #: ../src/guestfs-actions.pod:6295 ../fish/guestfish-actions.pod:4190
14277 msgid "This returns the filesystem label of the filesystem on C<device>."
14281 #: ../src/guestfs-actions.pod:6298 ../fish/guestfish-actions.pod:4193
14282 msgid "If the filesystem is unlabeled, this returns the empty string."
14286 #: ../src/guestfs-actions.pod:6300
14287 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
14291 #: ../src/guestfs-actions.pod:6305 ../src/guestfs-actions.pod:6342
14292 msgid "(Added in 1.3.18)"
14296 #: ../src/guestfs-actions.pod:6307
14297 msgid "guestfs_vfs_type"
14301 #: ../src/guestfs-actions.pod:6309
14305 " guestfs_vfs_type (guestfs_h *g,\n"
14306 " const char *device);\n"
14311 #: ../src/guestfs-actions.pod:6313 ../fish/guestfish-actions.pod:4201
14313 "This command gets the filesystem type corresponding to the filesystem on "
14318 #: ../src/guestfs-actions.pod:6316 ../fish/guestfish-actions.pod:4204
14320 "For most filesystems, the result is the name of the Linux VFS module which "
14321 "would be used to mount this filesystem if you mounted it without specifying "
14322 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14326 #: ../src/guestfs-actions.pod:6326
14327 msgid "guestfs_vfs_uuid"
14331 #: ../src/guestfs-actions.pod:6328
14335 " guestfs_vfs_uuid (guestfs_h *g,\n"
14336 " const char *device);\n"
14341 #: ../src/guestfs-actions.pod:6332 ../fish/guestfish-actions.pod:4213
14342 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14346 #: ../src/guestfs-actions.pod:6335 ../fish/guestfish-actions.pod:4216
14347 msgid "If the filesystem does not have a UUID, this returns the empty string."
14351 #: ../src/guestfs-actions.pod:6337
14352 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
14356 #: ../src/guestfs-actions.pod:6344
14357 msgid "guestfs_vg_activate"
14361 #: ../src/guestfs-actions.pod:6346
14365 " guestfs_vg_activate (guestfs_h *g,\n"
14367 " char *const *volgroups);\n"
14372 #: ../src/guestfs-actions.pod:6351 ../fish/guestfish-actions.pod:4224
14374 "This command activates or (if C<activate> is false) deactivates all logical "
14375 "volumes in the listed volume groups C<volgroups>. If activated, then they "
14376 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
14377 "deactivated, then those devices disappear."
14381 #: ../src/guestfs-actions.pod:6357 ../fish/guestfish-actions.pod:4230
14382 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14386 #: ../src/guestfs-actions.pod:6359 ../fish/guestfish-actions.pod:4232
14388 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14389 "activated or deactivated."
14393 #: ../src/guestfs-actions.pod:6366
14394 msgid "guestfs_vg_activate_all"
14398 #: ../src/guestfs-actions.pod:6368
14402 " guestfs_vg_activate_all (guestfs_h *g,\n"
14403 " int activate);\n"
14408 #: ../src/guestfs-actions.pod:6372 ../fish/guestfish-actions.pod:4239
14410 "This command activates or (if C<activate> is false) deactivates all logical "
14411 "volumes in all volume groups. If activated, then they are made known to the "
14412 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
14413 "those devices disappear."
14417 #: ../src/guestfs-actions.pod:6378 ../fish/guestfish-actions.pod:4245
14418 msgid "This command is the same as running C<vgchange -a y|n>"
14422 #: ../src/guestfs-actions.pod:6384
14423 msgid "guestfs_vgcreate"
14427 #: ../src/guestfs-actions.pod:6386
14431 " guestfs_vgcreate (guestfs_h *g,\n"
14432 " const char *volgroup,\n"
14433 " char *const *physvols);\n"
14438 #: ../src/guestfs-actions.pod:6391 ../fish/guestfish-actions.pod:4251
14440 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14441 "of physical volumes C<physvols>."
14445 #: ../src/guestfs-actions.pod:6398
14446 msgid "guestfs_vglvuuids"
14450 #: ../src/guestfs-actions.pod:6400
14454 " guestfs_vglvuuids (guestfs_h *g,\n"
14455 " const char *vgname);\n"
14460 #: ../src/guestfs-actions.pod:6404 ../fish/guestfish-actions.pod:4258
14462 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14463 "volumes created in this volume group."
14467 #: ../src/guestfs-actions.pod:6407
14469 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
14470 "associate logical volumes and volume groups."
14474 #: ../src/guestfs-actions.pod:6410
14475 msgid "See also C<guestfs_vgpvuuids>."
14479 #: ../src/guestfs-actions.pod:6418
14480 msgid "guestfs_vgpvuuids"
14484 #: ../src/guestfs-actions.pod:6420
14488 " guestfs_vgpvuuids (guestfs_h *g,\n"
14489 " const char *vgname);\n"
14494 #: ../src/guestfs-actions.pod:6424 ../fish/guestfish-actions.pod:4270
14496 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14497 "volumes that this volume group resides on."
14501 #: ../src/guestfs-actions.pod:6427
14503 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
14504 "associate physical volumes and volume groups."
14508 #: ../src/guestfs-actions.pod:6430
14509 msgid "See also C<guestfs_vglvuuids>."
14513 #: ../src/guestfs-actions.pod:6438
14514 msgid "guestfs_vgremove"
14518 #: ../src/guestfs-actions.pod:6440
14522 " guestfs_vgremove (guestfs_h *g,\n"
14523 " const char *vgname);\n"
14528 #: ../src/guestfs-actions.pod:6444 ../fish/guestfish-actions.pod:4282
14529 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14533 #: ../src/guestfs-actions.pod:6446 ../fish/guestfish-actions.pod:4284
14534 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
14538 #: ../src/guestfs-actions.pod:6453
14539 msgid "guestfs_vgrename"
14543 #: ../src/guestfs-actions.pod:6455
14547 " guestfs_vgrename (guestfs_h *g,\n"
14548 " const char *volgroup,\n"
14549 " const char *newvolgroup);\n"
14554 #: ../src/guestfs-actions.pod:6460 ../fish/guestfish-actions.pod:4291
14555 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14559 #: ../src/guestfs-actions.pod:6466
14560 msgid "guestfs_vgs"
14564 #: ../src/guestfs-actions.pod:6468
14568 " guestfs_vgs (guestfs_h *g);\n"
14573 #: ../src/guestfs-actions.pod:6471 ../fish/guestfish-actions.pod:4297
14575 "List all the volumes groups detected. This is the equivalent of the "
14576 "L<vgs(8)> command."
14580 #: ../src/guestfs-actions.pod:6474 ../fish/guestfish-actions.pod:4300
14582 "This returns a list of just the volume group names that were detected "
14583 "(eg. C<VolGroup00>)."
14587 #: ../src/guestfs-actions.pod:6477
14588 msgid "See also C<guestfs_vgs_full>."
14592 #: ../src/guestfs-actions.pod:6485
14593 msgid "guestfs_vgs_full"
14597 #: ../src/guestfs-actions.pod:6487
14600 " struct guestfs_lvm_vg_list *\n"
14601 " guestfs_vgs_full (guestfs_h *g);\n"
14606 #: ../src/guestfs-actions.pod:6490 ../fish/guestfish-actions.pod:4309
14608 "List all the volumes groups detected. This is the equivalent of the "
14609 "L<vgs(8)> command. The \"full\" version includes all fields."
14613 #: ../src/guestfs-actions.pod:6493
14615 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
14616 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
14621 #: ../src/guestfs-actions.pod:6499
14622 msgid "guestfs_vgscan"
14626 #: ../src/guestfs-actions.pod:6501
14630 " guestfs_vgscan (guestfs_h *g);\n"
14635 #: ../src/guestfs-actions.pod:6504 ../fish/guestfish-actions.pod:4316
14637 "This rescans all block devices and rebuilds the list of LVM physical "
14638 "volumes, volume groups and logical volumes."
14642 #: ../src/guestfs-actions.pod:6511
14643 msgid "guestfs_vguuid"
14647 #: ../src/guestfs-actions.pod:6513
14651 " guestfs_vguuid (guestfs_h *g,\n"
14652 " const char *vgname);\n"
14657 #: ../src/guestfs-actions.pod:6517 ../fish/guestfish-actions.pod:4323
14658 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14662 #: ../src/guestfs-actions.pod:6524
14663 msgid "guestfs_wait_ready"
14667 #: ../src/guestfs-actions.pod:6526
14671 " guestfs_wait_ready (guestfs_h *g);\n"
14676 #: ../src/guestfs-actions.pod:6529
14677 msgid "This function is a no op."
14681 #: ../src/guestfs-actions.pod:6531
14683 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
14684 "calling C<guestfs_launch> to wait for the launch to complete. However this "
14685 "is no longer necessary because C<guestfs_launch> now does the waiting."
14689 #: ../src/guestfs-actions.pod:6536
14691 "If you see any calls to this function in code then you can just remove them, "
14692 "unless you want to retain compatibility with older versions of the API."
14696 #: ../src/guestfs-actions.pod:6544
14697 msgid "guestfs_wc_c"
14701 #: ../src/guestfs-actions.pod:6546
14705 " guestfs_wc_c (guestfs_h *g,\n"
14706 " const char *path);\n"
14711 #: ../src/guestfs-actions.pod:6550 ../fish/guestfish-actions.pod:4329
14713 "This command counts the characters in a file, using the C<wc -c> external "
14718 #: ../src/guestfs-actions.pod:6557
14719 msgid "guestfs_wc_l"
14723 #: ../src/guestfs-actions.pod:6559
14727 " guestfs_wc_l (guestfs_h *g,\n"
14728 " const char *path);\n"
14733 #: ../src/guestfs-actions.pod:6563 ../fish/guestfish-actions.pod:4336
14735 "This command counts the lines in a file, using the C<wc -l> external "
14740 #: ../src/guestfs-actions.pod:6570
14741 msgid "guestfs_wc_w"
14745 #: ../src/guestfs-actions.pod:6572
14749 " guestfs_wc_w (guestfs_h *g,\n"
14750 " const char *path);\n"
14755 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4343
14757 "This command counts the words in a file, using the C<wc -w> external "
14762 #: ../src/guestfs-actions.pod:6583
14763 msgid "guestfs_write"
14767 #: ../src/guestfs-actions.pod:6585
14771 " guestfs_write (guestfs_h *g,\n"
14772 " const char *path,\n"
14773 " const char *content,\n"
14774 " size_t content_size);\n"
14779 #: ../src/guestfs-actions.pod:6591 ../fish/guestfish-actions.pod:4350
14781 "This call creates a file called C<path>. The content of the file is the "
14782 "string C<content> (which can contain any 8 bit data)."
14786 #: ../src/guestfs-actions.pod:6601
14787 msgid "guestfs_write_file"
14791 #: ../src/guestfs-actions.pod:6603
14795 " guestfs_write_file (guestfs_h *g,\n"
14796 " const char *path,\n"
14797 " const char *content,\n"
14803 #: ../src/guestfs-actions.pod:6609 ../fish/guestfish-actions.pod:4360
14805 "This call creates a file called C<path>. The contents of the file is the "
14806 "string C<content> (which can contain any 8 bit data), with length C<size>."
14810 #: ../src/guestfs-actions.pod:6613 ../fish/guestfish-actions.pod:4364
14812 "As a special case, if C<size> is C<0> then the length is calculated using "
14813 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14817 #: ../src/guestfs-actions.pod:6617 ../fish/guestfish-actions.pod:4368
14819 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14820 "I<not> work, even if the length is specified."
14824 #: ../src/guestfs-actions.pod:6625 ../fish/guestfish-actions.pod:4374
14825 msgid "This function is deprecated. In new code, use the C<write> call instead."
14829 #: ../src/guestfs-actions.pod:6634
14830 msgid "guestfs_zegrep"
14834 #: ../src/guestfs-actions.pod:6636
14838 " guestfs_zegrep (guestfs_h *g,\n"
14839 " const char *regex,\n"
14840 " const char *path);\n"
14845 #: ../src/guestfs-actions.pod:6641 ../fish/guestfish-actions.pod:4385
14846 msgid "This calls the external C<zegrep> program and returns the matching lines."
14850 #: ../src/guestfs-actions.pod:6653
14851 msgid "guestfs_zegrepi"
14855 #: ../src/guestfs-actions.pod:6655
14859 " guestfs_zegrepi (guestfs_h *g,\n"
14860 " const char *regex,\n"
14861 " const char *path);\n"
14866 #: ../src/guestfs-actions.pod:6660 ../fish/guestfish-actions.pod:4395
14867 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
14871 #: ../src/guestfs-actions.pod:6672
14872 msgid "guestfs_zero"
14876 #: ../src/guestfs-actions.pod:6674
14880 " guestfs_zero (guestfs_h *g,\n"
14881 " const char *device);\n"
14886 #: ../src/guestfs-actions.pod:6678 ../fish/guestfish-actions.pod:4405
14887 msgid "This command writes zeroes over the first few blocks of C<device>."
14891 #: ../src/guestfs-actions.pod:6680 ../fish/guestfish-actions.pod:4407
14893 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14894 "securely wipe the device). It should be sufficient to remove any partition "
14895 "tables, filesystem superblocks and so on."
14899 #: ../src/guestfs-actions.pod:6684
14900 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
14904 #: ../src/guestfs-actions.pod:6695
14905 msgid "guestfs_zero_device"
14909 #: ../src/guestfs-actions.pod:6697
14913 " guestfs_zero_device (guestfs_h *g,\n"
14914 " const char *device);\n"
14919 #: ../src/guestfs-actions.pod:6701
14921 "This command writes zeroes over the entire C<device>. Compare with "
14922 "C<guestfs_zero> which just zeroes the first few blocks of a device."
14926 #: ../src/guestfs-actions.pod:6715
14927 msgid "(Added in 1.3.1)"
14931 #: ../src/guestfs-actions.pod:6717
14932 msgid "guestfs_zerofree"
14936 #: ../src/guestfs-actions.pod:6719
14940 " guestfs_zerofree (guestfs_h *g,\n"
14941 " const char *device);\n"
14946 #: ../src/guestfs-actions.pod:6723 ../fish/guestfish-actions.pod:4428
14948 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14949 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14950 "possible to compress the filesystem more effectively."
14954 #: ../src/guestfs-actions.pod:6728 ../fish/guestfish-actions.pod:4433
14955 msgid "You should B<not> run this program if the filesystem is mounted."
14959 #: ../src/guestfs-actions.pod:6731 ../fish/guestfish-actions.pod:4436
14961 "It is possible that using this program can damage the filesystem or data on "
14966 #: ../src/guestfs-actions.pod:6738
14967 msgid "guestfs_zfgrep"
14971 #: ../src/guestfs-actions.pod:6740
14975 " guestfs_zfgrep (guestfs_h *g,\n"
14976 " const char *pattern,\n"
14977 " const char *path);\n"
14982 #: ../src/guestfs-actions.pod:6745 ../fish/guestfish-actions.pod:4443
14983 msgid "This calls the external C<zfgrep> program and returns the matching lines."
14987 #: ../src/guestfs-actions.pod:6757
14988 msgid "guestfs_zfgrepi"
14992 #: ../src/guestfs-actions.pod:6759
14996 " guestfs_zfgrepi (guestfs_h *g,\n"
14997 " const char *pattern,\n"
14998 " const char *path);\n"
15003 #: ../src/guestfs-actions.pod:6764 ../fish/guestfish-actions.pod:4453
15004 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
15008 #: ../src/guestfs-actions.pod:6776
15009 msgid "guestfs_zfile"
15013 #: ../src/guestfs-actions.pod:6778
15017 " guestfs_zfile (guestfs_h *g,\n"
15018 " const char *meth,\n"
15019 " const char *path);\n"
15024 #: ../src/guestfs-actions.pod:6783 ../fish/guestfish-actions.pod:4463
15025 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
15029 #: ../src/guestfs-actions.pod:6786 ../fish/guestfish-actions.pod:4466
15030 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15034 #: ../src/guestfs-actions.pod:6788
15036 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
15041 #: ../src/guestfs-actions.pod:6794 ../fish/guestfish-actions.pod:4471
15042 msgid "This function is deprecated. In new code, use the C<file> call instead."
15046 #: ../src/guestfs-actions.pod:6803
15047 msgid "guestfs_zgrep"
15051 #: ../src/guestfs-actions.pod:6805
15055 " guestfs_zgrep (guestfs_h *g,\n"
15056 " const char *regex,\n"
15057 " const char *path);\n"
15062 #: ../src/guestfs-actions.pod:6810 ../fish/guestfish-actions.pod:4482
15063 msgid "This calls the external C<zgrep> program and returns the matching lines."
15067 #: ../src/guestfs-actions.pod:6822
15068 msgid "guestfs_zgrepi"
15072 #: ../src/guestfs-actions.pod:6824
15076 " guestfs_zgrepi (guestfs_h *g,\n"
15077 " const char *regex,\n"
15078 " const char *path);\n"
15083 #: ../src/guestfs-actions.pod:6829 ../fish/guestfish-actions.pod:4492
15084 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
15088 #: ../src/guestfs-availability.pod:3
15093 #: ../src/guestfs-availability.pod:5
15095 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
15096 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
15097 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
15098 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
15099 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
15103 #: ../src/guestfs-availability.pod:21
15108 #: ../src/guestfs-availability.pod:23
15110 "The following functions: L</guestfs_inotify_add_watch> "
15111 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
15112 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
15116 #: ../src/guestfs-availability.pod:31
15117 msgid "B<linuxfsuuid>"
15121 #: ../src/guestfs-availability.pod:33
15123 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
15124 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
15128 #: ../src/guestfs-availability.pod:40
15129 msgid "B<linuxmodules>"
15133 #: ../src/guestfs-availability.pod:42
15134 msgid "The following functions: L</guestfs_modprobe>"
15138 #: ../src/guestfs-availability.pod:45
15139 msgid "B<linuxxattrs>"
15143 #: ../src/guestfs-availability.pod:47
15145 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> "
15146 "L</guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> "
15147 "L</guestfs_removexattr> L</guestfs_setxattr>"
15151 #: ../src/guestfs-availability.pod:56
15156 #: ../src/guestfs-availability.pod:58
15158 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
15159 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
15160 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
15164 #: ../src/guestfs-availability.pod:67
15169 #: ../src/guestfs-availability.pod:69
15171 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
15172 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
15173 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
15174 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
15175 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
15176 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
15177 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
15178 "L</guestfs_vgs_full>"
15182 #: ../src/guestfs-availability.pod:92
15187 #: ../src/guestfs-availability.pod:94
15189 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
15190 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
15194 #: ../src/guestfs-availability.pod:100
15199 #: ../src/guestfs-availability.pod:102
15200 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
15204 #: ../src/guestfs-availability.pod:105
15205 msgid "B<ntfsprogs>"
15209 #: ../src/guestfs-availability.pod:107
15210 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
15214 #: ../src/guestfs-availability.pod:111
15215 msgid "B<realpath>"
15219 #: ../src/guestfs-availability.pod:113
15220 msgid "The following functions: L</guestfs_realpath>"
15224 #: ../src/guestfs-availability.pod:116
15229 #: ../src/guestfs-availability.pod:118
15231 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
15232 "L</guestfs_scrub_freespace>"
15236 #: ../src/guestfs-availability.pod:123
15241 #: ../src/guestfs-availability.pod:125
15242 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
15246 #: ../src/guestfs-availability.pod:129
15251 #: ../src/guestfs-availability.pod:131
15252 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
15256 #: ../src/guestfs-availability.pod:135
15257 msgid "B<zerofree>"
15261 #: ../src/guestfs-availability.pod:137
15262 msgid "The following functions: L</guestfs_zerofree>"
15266 #: ../src/guestfs-structs.pod:1
15267 msgid "guestfs_int_bool"
15271 #: ../src/guestfs-structs.pod:3
15274 " struct guestfs_int_bool {\n"
15282 #: ../src/guestfs-structs.pod:8
15285 " struct guestfs_int_bool_list {\n"
15286 " uint32_t len; /* Number of elements in list. */\n"
15287 " struct guestfs_int_bool *val; /* Elements. */\n"
15293 #: ../src/guestfs-structs.pod:13
15296 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
15297 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
15302 #: ../src/guestfs-structs.pod:16
15303 msgid "guestfs_lvm_pv"
15307 #: ../src/guestfs-structs.pod:18
15310 " struct guestfs_lvm_pv {\n"
15311 " char *pv_name;\n"
15312 " /* The next field is NOT nul-terminated, be careful when printing it: "
15314 " char pv_uuid[32];\n"
15316 " uint64_t pv_size;\n"
15317 " uint64_t dev_size;\n"
15318 " uint64_t pv_free;\n"
15319 " uint64_t pv_used;\n"
15320 " char *pv_attr;\n"
15321 " int64_t pv_pe_count;\n"
15322 " int64_t pv_pe_alloc_count;\n"
15323 " char *pv_tags;\n"
15324 " uint64_t pe_start;\n"
15325 " int64_t pv_mda_count;\n"
15326 " uint64_t pv_mda_free;\n"
15332 #: ../src/guestfs-structs.pod:36
15335 " struct guestfs_lvm_pv_list {\n"
15336 " uint32_t len; /* Number of elements in list. */\n"
15337 " struct guestfs_lvm_pv *val; /* Elements. */\n"
15343 #: ../src/guestfs-structs.pod:41
15346 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
15347 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
15352 #: ../src/guestfs-structs.pod:44
15353 msgid "guestfs_lvm_vg"
15357 #: ../src/guestfs-structs.pod:46
15360 " struct guestfs_lvm_vg {\n"
15361 " char *vg_name;\n"
15362 " /* The next field is NOT nul-terminated, be careful when printing it: "
15364 " char vg_uuid[32];\n"
15366 " char *vg_attr;\n"
15367 " uint64_t vg_size;\n"
15368 " uint64_t vg_free;\n"
15369 " char *vg_sysid;\n"
15370 " uint64_t vg_extent_size;\n"
15371 " int64_t vg_extent_count;\n"
15372 " int64_t vg_free_count;\n"
15373 " int64_t max_lv;\n"
15374 " int64_t max_pv;\n"
15375 " int64_t pv_count;\n"
15376 " int64_t lv_count;\n"
15377 " int64_t snap_count;\n"
15378 " int64_t vg_seqno;\n"
15379 " char *vg_tags;\n"
15380 " int64_t vg_mda_count;\n"
15381 " uint64_t vg_mda_free;\n"
15387 #: ../src/guestfs-structs.pod:69
15390 " struct guestfs_lvm_vg_list {\n"
15391 " uint32_t len; /* Number of elements in list. */\n"
15392 " struct guestfs_lvm_vg *val; /* Elements. */\n"
15398 #: ../src/guestfs-structs.pod:74
15401 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
15402 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
15407 #: ../src/guestfs-structs.pod:77
15408 msgid "guestfs_lvm_lv"
15412 #: ../src/guestfs-structs.pod:79
15415 " struct guestfs_lvm_lv {\n"
15416 " char *lv_name;\n"
15417 " /* The next field is NOT nul-terminated, be careful when printing it: "
15419 " char lv_uuid[32];\n"
15420 " char *lv_attr;\n"
15421 " int64_t lv_major;\n"
15422 " int64_t lv_minor;\n"
15423 " int64_t lv_kernel_major;\n"
15424 " int64_t lv_kernel_minor;\n"
15425 " uint64_t lv_size;\n"
15426 " int64_t seg_count;\n"
15428 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
15429 " float snap_percent;\n"
15430 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
15431 " float copy_percent;\n"
15432 " char *move_pv;\n"
15433 " char *lv_tags;\n"
15434 " char *mirror_log;\n"
15435 " char *modules;\n"
15441 #: ../src/guestfs-structs.pod:101
15444 " struct guestfs_lvm_lv_list {\n"
15445 " uint32_t len; /* Number of elements in list. */\n"
15446 " struct guestfs_lvm_lv *val; /* Elements. */\n"
15452 #: ../src/guestfs-structs.pod:106
15455 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
15456 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
15461 #: ../src/guestfs-structs.pod:111
15464 " struct guestfs_stat {\n"
15468 " int64_t nlink;\n"
15473 " int64_t blksize;\n"
15474 " int64_t blocks;\n"
15475 " int64_t atime;\n"
15476 " int64_t mtime;\n"
15477 " int64_t ctime;\n"
15483 #: ../src/guestfs-structs.pod:127
15486 " struct guestfs_stat_list {\n"
15487 " uint32_t len; /* Number of elements in list. */\n"
15488 " struct guestfs_stat *val; /* Elements. */\n"
15494 #: ../src/guestfs-structs.pod:132
15497 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
15498 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
15503 #: ../src/guestfs-structs.pod:137
15506 " struct guestfs_statvfs {\n"
15507 " int64_t bsize;\n"
15508 " int64_t frsize;\n"
15509 " int64_t blocks;\n"
15510 " int64_t bfree;\n"
15511 " int64_t bavail;\n"
15512 " int64_t files;\n"
15513 " int64_t ffree;\n"
15514 " int64_t favail;\n"
15517 " int64_t namemax;\n"
15523 #: ../src/guestfs-structs.pod:151
15526 " struct guestfs_statvfs_list {\n"
15527 " uint32_t len; /* Number of elements in list. */\n"
15528 " struct guestfs_statvfs *val; /* Elements. */\n"
15534 #: ../src/guestfs-structs.pod:156
15537 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
15538 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
15543 #: ../src/guestfs-structs.pod:159
15544 msgid "guestfs_dirent"
15548 #: ../src/guestfs-structs.pod:161
15551 " struct guestfs_dirent {\n"
15560 #: ../src/guestfs-structs.pod:167
15563 " struct guestfs_dirent_list {\n"
15564 " uint32_t len; /* Number of elements in list. */\n"
15565 " struct guestfs_dirent *val; /* Elements. */\n"
15571 #: ../src/guestfs-structs.pod:172
15574 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
15575 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
15580 #: ../src/guestfs-structs.pod:177
15583 " struct guestfs_version {\n"
15584 " int64_t major;\n"
15585 " int64_t minor;\n"
15586 " int64_t release;\n"
15593 #: ../src/guestfs-structs.pod:184
15596 " struct guestfs_version_list {\n"
15597 " uint32_t len; /* Number of elements in list. */\n"
15598 " struct guestfs_version *val; /* Elements. */\n"
15604 #: ../src/guestfs-structs.pod:189
15607 " void guestfs_free_version (struct guestfs_free_version *);\n"
15608 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
15613 #: ../src/guestfs-structs.pod:192
15614 msgid "guestfs_xattr"
15618 #: ../src/guestfs-structs.pod:194
15621 " struct guestfs_xattr {\n"
15622 " char *attrname;\n"
15623 " /* The next two fields describe a byte array. */\n"
15624 " uint32_t attrval_len;\n"
15625 " char *attrval;\n"
15631 #: ../src/guestfs-structs.pod:201
15634 " struct guestfs_xattr_list {\n"
15635 " uint32_t len; /* Number of elements in list. */\n"
15636 " struct guestfs_xattr *val; /* Elements. */\n"
15642 #: ../src/guestfs-structs.pod:206
15645 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
15646 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
15651 #: ../src/guestfs-structs.pod:209
15652 msgid "guestfs_inotify_event"
15656 #: ../src/guestfs-structs.pod:211
15659 " struct guestfs_inotify_event {\n"
15660 " int64_t in_wd;\n"
15661 " uint32_t in_mask;\n"
15662 " uint32_t in_cookie;\n"
15663 " char *in_name;\n"
15669 #: ../src/guestfs-structs.pod:218
15672 " struct guestfs_inotify_event_list {\n"
15673 " uint32_t len; /* Number of elements in list. */\n"
15674 " struct guestfs_inotify_event *val; /* Elements. */\n"
15680 #: ../src/guestfs-structs.pod:223
15683 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
15684 " void guestfs_free_inotify_event_list (struct "
15685 "guestfs_free_inotify_event_list *);\n"
15690 #: ../src/guestfs-structs.pod:226
15691 msgid "guestfs_partition"
15695 #: ../src/guestfs-structs.pod:228
15698 " struct guestfs_partition {\n"
15699 " int32_t part_num;\n"
15700 " uint64_t part_start;\n"
15701 " uint64_t part_end;\n"
15702 " uint64_t part_size;\n"
15708 #: ../src/guestfs-structs.pod:235
15711 " struct guestfs_partition_list {\n"
15712 " uint32_t len; /* Number of elements in list. */\n"
15713 " struct guestfs_partition *val; /* Elements. */\n"
15719 #: ../src/guestfs-structs.pod:240
15722 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
15723 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
15728 #: ../fish/guestfish.pod:5
15729 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15733 #: ../fish/guestfish.pod:9
15736 " guestfish [--options] [commands]\n"
15741 #: ../fish/guestfish.pod:11
15749 #: ../fish/guestfish.pod:13
15752 " guestfish [--ro|--rw] -a disk.img\n"
15757 #: ../fish/guestfish.pod:15
15760 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
15765 #: ../fish/guestfish.pod:17
15768 " guestfish -d libvirt-domain\n"
15773 #: ../fish/guestfish.pod:19
15776 " guestfish [--ro|--rw] -a disk.img -i\n"
15781 #: ../fish/guestfish.pod:21
15784 " guestfish -d libvirt-domain -i\n"
15789 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44 ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59 ../tools/virt-rescue.pl:41
15794 #: ../fish/guestfish.pod:25
15796 "Using guestfish in read/write mode on live virtual machines can be "
15797 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15798 "option to use guestfish safely if the disk image or virtual machine might be "
15803 #: ../fish/guestfish.pod:32
15805 "Guestfish is a shell and command-line tool for examining and modifying "
15806 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15807 "functionality of the guestfs API, see L<guestfs(3)>."
15811 #: ../fish/guestfish.pod:36
15813 "Guestfish gives you structured access to the libguestfs API, from shell "
15814 "scripts or the command line or interactively. If you want to rescue a "
15815 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15820 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:846 ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58 ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:45
15825 #: ../fish/guestfish.pod:43
15826 msgid "As an interactive shell"
15830 #: ../fish/guestfish.pod:45
15838 #: ../fish/guestfish.pod:47
15841 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15842 " editing virtual machine filesystems.\n"
15847 #: ../fish/guestfish.pod:50
15850 " Type: 'help' for a list of commands\n"
15851 " 'man' to read the manual\n"
15852 " 'quit' to quit the shell\n"
15857 #: ../fish/guestfish.pod:54
15860 " ><fs> add-ro disk.img\n"
15862 " ><fs> list-filesystems\n"
15863 " /dev/sda1: ext4\n"
15864 " /dev/vg_guest/lv_root: ext4\n"
15865 " /dev/vg_guest/lv_swap: swap\n"
15866 " ><fs> mount /dev/vg_guest/lv_root /\n"
15867 " ><fs> cat /etc/fstab\n"
15869 " # Created by anaconda\n"
15876 #: ../fish/guestfish.pod:67
15877 msgid "From shell scripts"
15881 #: ../fish/guestfish.pod:69
15882 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15886 #: ../fish/guestfish.pod:71
15889 " guestfish <<_EOF_\n"
15892 " mount /dev/vg_guest/lv_root /\n"
15893 " write /etc/motd \"Welcome, new users\"\n"
15899 #: ../fish/guestfish.pod:78
15900 msgid "List the LVM logical volumes in a disk image:"
15904 #: ../fish/guestfish.pod:80
15907 " guestfish -a disk.img --ro <<_EOF_\n"
15915 #: ../fish/guestfish.pod:85
15916 msgid "List all the filesystems in a disk image:"
15920 #: ../fish/guestfish.pod:87
15923 " guestfish -a disk.img --ro <<_EOF_\n"
15925 " list-filesystems\n"
15931 #: ../fish/guestfish.pod:92
15932 msgid "On one command line"
15936 #: ../fish/guestfish.pod:94
15937 msgid "Update C</etc/resolv.conf> in a guest:"
15941 #: ../fish/guestfish.pod:96
15945 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15946 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15951 #: ../fish/guestfish.pod:100
15952 msgid "Edit C</boot/grub/grub.conf> interactively:"
15956 #: ../fish/guestfish.pod:102
15959 " guestfish --rw --add disk.img \\\n"
15960 " --mount /dev/vg_guest/lv_root \\\n"
15961 " --mount /dev/sda1:/boot \\\n"
15962 " edit /boot/grub/grub.conf\n"
15967 #: ../fish/guestfish.pod:107
15968 msgid "Mount disks automatically"
15972 #: ../fish/guestfish.pod:109
15974 "Use the I<-i> option to automatically mount the disks from a virtual "
15979 #: ../fish/guestfish.pod:112
15982 " guestfish --ro -a disk.img -i cat /etc/group\n"
15987 #: ../fish/guestfish.pod:114
15990 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15995 #: ../fish/guestfish.pod:116
15996 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16000 #: ../fish/guestfish.pod:118
16003 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16008 #: ../fish/guestfish.pod:120
16009 msgid "As a script interpreter"
16013 #: ../fish/guestfish.pod:122
16014 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16018 #: ../fish/guestfish.pod:124
16021 " #!/usr/bin/guestfish -f\n"
16022 " sparse test1.img 100M\n"
16024 " part-disk /dev/sda mbr\n"
16025 " mkfs ext2 /dev/sda1\n"
16030 #: ../fish/guestfish.pod:130
16031 msgid "Start with a prepared disk"
16035 #: ../fish/guestfish.pod:132
16037 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16038 "single ext2-formatted partition:"
16042 #: ../fish/guestfish.pod:135
16045 " guestfish -N fs\n"
16050 #: ../fish/guestfish.pod:137
16051 msgid "To list what is available do:"
16055 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:837
16058 " guestfish -N help | less\n"
16063 #: ../fish/guestfish.pod:141
16064 msgid "Remote control"
16068 #: ../fish/guestfish.pod:143
16071 " eval \"`guestfish --listen`\"\n"
16072 " guestfish --remote add-ro disk.img\n"
16073 " guestfish --remote run\n"
16074 " guestfish --remote lvs\n"
16079 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68 ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171 ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257 ../tools/virt-list-filesystems.pl:50 ../tools/virt-tar.pl:98 ../tools/virt-rescue.pl:103 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
16084 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131 ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86 ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58 ../tools/virt-tar.pl:106 ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:59
16089 #: ../fish/guestfish.pod:154
16090 msgid "Displays general help on options."
16094 #: ../fish/guestfish.pod:156
16095 msgid "B<-h> | B<--cmd-help>"
16099 #: ../fish/guestfish.pod:158
16100 msgid "Lists all available guestfish commands."
16104 #: ../fish/guestfish.pod:160
16105 msgid "B<-h cmd> | B<--cmd-help cmd>"
16109 #: ../fish/guestfish.pod:162
16110 msgid "Displays detailed help on a single command C<cmd>."
16114 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
16115 msgid "B<-a image> | B<--add image>"
16119 #: ../fish/guestfish.pod:166
16120 msgid "Add a block device or virtual machine image to the shell."
16124 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
16126 "The format of the disk image is auto-detected. To override this and force a "
16127 "particular format use the I<--format=..> option."
16131 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
16132 msgid "B<-c URI> | B<--connect URI>"
16136 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
16138 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16139 "URI to use. The default is to use the default libvirt connection."
16143 #: ../fish/guestfish.pod:177
16148 #: ../fish/guestfish.pod:179
16150 "If using the I<--listen> option and a csh-like shell, use this option. See "
16151 "section L</REMOTE CONTROL AND CSH> below."
16155 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
16156 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
16160 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
16162 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16163 "used, then any libvirt domain can be used. However in write mode, only "
16164 "libvirt domains which are shut down can be named here."
16168 #: ../fish/guestfish.pod:188
16169 msgid "B<-D> | B<--no-dest-paths>"
16173 #: ../fish/guestfish.pod:190
16175 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16176 "to hit the tab key to complete paths on the guest filesystem, but this "
16177 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16178 "allow this feature to be disabled."
16182 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
16183 msgid "B<--echo-keys>"
16187 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
16189 "When prompting for keys and passphrases, guestfish normally turns echoing "
16190 "off so you cannot see what you are typing. If you are not worried about "
16191 "Tempest attacks and there is no one else in the room you can specify this "
16192 "flag to see what you are typing."
16196 #: ../fish/guestfish.pod:202
16197 msgid "B<-f file> | B<--file file>"
16201 #: ../fish/guestfish.pod:204
16202 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16206 #: ../fish/guestfish.pod:207
16209 " #!/usr/bin/guestfish -f\n"
16214 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
16215 msgid "B<--format=raw|qcow2|..> | B<--format>"
16219 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
16221 "The default for the I<-a> option is to auto-detect the format of the disk "
16222 "image. Using this forces the disk format for I<-a> options which follow on "
16223 "the command line. Using I<--format> with no argument switches back to "
16224 "auto-detection for subsequent I<-a> options."
16228 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:543 ../inspector/virt-inspector.pl:549
16229 msgid "For example:"
16233 #: ../fish/guestfish.pod:218
16236 " guestfish --format=raw -a disk.img\n"
16241 #: ../fish/guestfish.pod:220
16242 msgid "forces raw format (no auto-detection) for C<disk.img>."
16246 #: ../fish/guestfish.pod:222
16249 " guestfish --format=raw -a disk.img --format -a another.img\n"
16254 #: ../fish/guestfish.pod:224
16256 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
16257 "auto-detection for C<another.img>."
16261 #: ../fish/guestfish.pod:227
16263 "If you have untrusted raw-format guest disk images, you should use this "
16264 "option to specify the disk format. This avoids a possible security problem "
16265 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
16269 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
16270 msgid "B<-i> | B<--inspector>"
16274 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
16276 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
16277 "system and mount filesystems as they would be mounted on the real virtual "
16282 #: ../fish/guestfish.pod:238
16283 msgid "Typical usage is either:"
16287 #: ../fish/guestfish.pod:240
16290 " guestfish -d myguest -i\n"
16295 #: ../fish/guestfish.pod:242
16296 msgid "(for an inactive libvirt domain called I<myguest>), or:"
16300 #: ../fish/guestfish.pod:244
16303 " guestfish --ro -d myguest -i\n"
16308 #: ../fish/guestfish.pod:246
16309 msgid "(for active domains, readonly), or specify the block device directly:"
16313 #: ../fish/guestfish.pod:248
16316 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16321 #: ../fish/guestfish.pod:250
16323 "Note that the command line syntax changed slightly over older versions of "
16324 "guestfish. You can still use the old syntax:"
16328 #: ../fish/guestfish.pod:253
16331 " guestfish [--ro] -i disk.img\n"
16336 #: ../fish/guestfish.pod:255
16339 " guestfish [--ro] -i libvirt-domain\n"
16344 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
16345 msgid "B<--keys-from-stdin>"
16349 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
16351 "Read key or passphrase parameters from stdin. The default is to try to read "
16352 "passphrases from the user by opening C</dev/tty>."
16356 #: ../fish/guestfish.pod:262
16357 msgid "B<--listen>"
16361 #: ../fish/guestfish.pod:264
16363 "Fork into the background and listen for remote commands. See section "
16364 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16368 #: ../fish/guestfish.pod:267
16369 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
16373 #: ../fish/guestfish.pod:269
16374 msgid "Mount the named partition or logical volume on the given mountpoint."
16378 #: ../fish/guestfish.pod:271
16379 msgid "If the mountpoint is omitted, it defaults to C</>."
16383 #: ../fish/guestfish.pod:273
16384 msgid "You have to mount something on C</> before most commands will work."
16388 #: ../fish/guestfish.pod:275
16390 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16395 #: ../fish/guestfish.pod:278
16397 "If you don't know what filesystems a disk image contains, you can either run "
16398 "guestfish without this option, then list the partitions and LVs available "
16399 "(see L</list-partitions> and L</lvs> commands), or you can use the "
16400 "L<virt-list-filesystems(1)> program."
16404 #: ../fish/guestfish.pod:283 ../fuse/guestmount.pod:154
16405 msgid "B<-n> | B<--no-sync>"
16409 #: ../fish/guestfish.pod:285
16411 "Disable autosync. This is enabled by default. See the discussion of "
16412 "autosync in the L<guestfs(3)> manpage."
16416 #: ../fish/guestfish.pod:288
16417 msgid "B<-N type> | B<--new type> | B<-N help>"
16421 #: ../fish/guestfish.pod:290
16423 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16424 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16425 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16430 #: ../fish/guestfish.pod:295
16431 msgid "B<--progress-bars>"
16435 #: ../fish/guestfish.pod:297
16436 msgid "Enable progress bars, even when guestfish is used non-interactively."
16440 #: ../fish/guestfish.pod:299
16442 "Progress bars are enabled by default when guestfish is used as an "
16443 "interactive shell."
16447 #: ../fish/guestfish.pod:302
16448 msgid "B<--no-progress-bars>"
16452 #: ../fish/guestfish.pod:304
16453 msgid "Disable progress bars."
16457 #: ../fish/guestfish.pod:306
16458 msgid "B<--remote[=pid]>"
16462 #: ../fish/guestfish.pod:308
16464 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16465 "CONTROL GUESTFISH OVER A SOCKET> below."
16469 #: ../fish/guestfish.pod:311 ../fuse/guestmount.pod:196
16470 msgid "B<-r> | B<--ro>"
16474 #: ../fish/guestfish.pod:313
16476 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
16477 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
16481 #: ../fish/guestfish.pod:316 ../tools/virt-rescue.pl:187
16483 "The option must always be used if the disk image or virtual machine might be "
16484 "running, and is generally recommended in cases where you don't need write "
16485 "access to the disk."
16489 #: ../fish/guestfish.pod:320
16491 "Note that prepared disk images created with I<-N> are not affected by the "
16496 #: ../fish/guestfish.pod:323
16497 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16501 #: ../fish/guestfish.pod:325 ../fuse/guestmount.pod:208 ../tools/virt-rescue.pl:195
16502 msgid "B<--selinux>"
16506 #: ../fish/guestfish.pod:327
16507 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16511 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:212
16512 msgid "B<-v> | B<--verbose>"
16516 #: ../fish/guestfish.pod:331
16518 "Enable very verbose messages. This is particularly useful if you find a "
16523 #: ../fish/guestfish.pod:334 ../fuse/guestmount.pod:216
16524 msgid "B<-V> | B<--version>"
16528 #: ../fish/guestfish.pod:336
16529 msgid "Display the guestfish / libguestfs version number and exit."
16533 #: ../fish/guestfish.pod:338 ../fuse/guestmount.pod:220
16534 msgid "B<-w> | B<--rw>"
16538 #: ../fish/guestfish.pod:340
16540 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
16545 #: ../fish/guestfish.pod:343
16550 #: ../fish/guestfish.pod:345
16551 msgid "Echo each command before executing it."
16555 #: ../fish/guestfish.pod:349
16556 msgid "COMMANDS ON COMMAND LINE"
16560 #: ../fish/guestfish.pod:351
16561 msgid "Any additional (non-option) arguments are treated as commands to execute."
16565 #: ../fish/guestfish.pod:354
16567 "Commands to execute should be separated by a colon (C<:>), where the colon "
16568 "is a separate parameter. Thus:"
16572 #: ../fish/guestfish.pod:357
16575 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16580 #: ../fish/guestfish.pod:359
16582 "If there are no additional arguments, then we enter a shell, either an "
16583 "interactive shell with a prompt (if the input is a terminal) or a "
16584 "non-interactive shell."
16588 #: ../fish/guestfish.pod:363
16590 "In either command line mode or non-interactive shell, the first command that "
16591 "gives an error causes the whole shell to exit. In interactive mode (with a "
16592 "prompt) if a command fails, you can continue to enter commands."
16596 #: ../fish/guestfish.pod:368
16597 msgid "USING launch (OR run)"
16601 #: ../fish/guestfish.pod:370
16603 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16604 "then launch it, then mount any disks you need, and finally issue "
16605 "actions/commands. So the general order of the day is:"
16609 #: ../fish/guestfish.pod:378
16610 msgid "add or -a/--add"
16614 #: ../fish/guestfish.pod:382
16615 msgid "launch (aka run)"
16619 #: ../fish/guestfish.pod:386
16620 msgid "mount or -m/--mount"
16624 #: ../fish/guestfish.pod:390
16625 msgid "any other commands"
16629 #: ../fish/guestfish.pod:394
16631 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16632 "guest before mounting or performing any other commands."
16636 #: ../fish/guestfish.pod:397
16638 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16639 "I<--new> options were given then C<run> is done automatically, simply "
16640 "because guestfish can't perform the action you asked for without doing this."
16644 #: ../fish/guestfish.pod:402
16645 msgid "OPENING DISKS FOR READ AND WRITE"
16649 #: ../fish/guestfish.pod:404
16651 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
16652 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
16653 "open disk images read-only or for writing."
16657 #: ../fish/guestfish.pod:408
16659 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
16660 "disk images supplied on the command line for write. To open a disk image "
16661 "read-only you have to do I<-a image --ro>."
16665 #: ../fish/guestfish.pod:412
16667 "This matters: If you accidentally open a live VM disk image writable then "
16668 "you will cause irreversible disk corruption."
16672 #: ../fish/guestfish.pod:415
16674 "By libguestfs 1.8 we intend to change the default the other way. Disk "
16675 "images will be opened read-only. You will have to either specify "
16676 "I<guestfish --rw> or change a configuration file in order to get write "
16677 "access for disk images specified by those other command line options."
16681 #: ../fish/guestfish.pod:420
16683 "This version of guestfish has a I<--rw> option which does nothing (it is "
16684 "already the default). However it is highly recommended that you use this "
16685 "option to indicate that guestfish needs write access, and to prepare your "
16686 "scripts for the day when this option will be required for write access."
16690 #: ../fish/guestfish.pod:426
16692 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16693 "other libguestfs program apart from guestfish and guestmount."
16697 #: ../fish/guestfish.pod:429
16702 #: ../fish/guestfish.pod:431
16704 "You can quote ordinary parameters using either single or double quotes. For "
16709 #: ../fish/guestfish.pod:434
16712 " add \"file with a space.img\"\n"
16717 #: ../fish/guestfish.pod:436
16720 " rm '/file name'\n"
16725 #: ../fish/guestfish.pod:438
16733 #: ../fish/guestfish.pod:440
16735 "A few commands require a list of strings to be passed. For these, use a "
16736 "whitespace-separated list, enclosed in quotes. Strings containing "
16737 "whitespace to be passed through must be enclosed in single quotes. A "
16738 "literal single quote must be escaped with a backslash."
16742 #: ../fish/guestfish.pod:445
16745 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16746 " command \"/bin/echo 'foo bar'\"\n"
16747 " command \"/bin/echo \\'foo\\'\"\n"
16752 #: ../fish/guestfish.pod:449
16753 msgid "OPTIONAL ARGUMENTS"
16757 #: ../fish/guestfish.pod:451
16759 "Some commands take optional arguments. These arguments appear in this "
16760 "documentation as C<[argname:..]>. You can use them as in these examples:"
16764 #: ../fish/guestfish.pod:455
16767 " add-drive-opts filename\n"
16772 #: ../fish/guestfish.pod:457
16775 " add-drive-opts filename readonly:true\n"
16780 #: ../fish/guestfish.pod:459
16783 " add-drive-opts filename format:qcow2 readonly:false\n"
16788 #: ../fish/guestfish.pod:461
16790 "Each optional argument can appear at most once. All optional arguments must "
16791 "appear after the required ones."
16795 #: ../fish/guestfish.pod:464
16800 #: ../fish/guestfish.pod:466
16801 msgid "This section applies to all commands which can take integers as parameters."
16805 #: ../fish/guestfish.pod:469
16806 msgid "SIZE SUFFIX"
16810 #: ../fish/guestfish.pod:471
16812 "When the command takes a parameter measured in bytes, you can use one of the "
16813 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16817 #: ../fish/guestfish.pod:477
16818 msgid "B<k> or B<K> or B<KiB>"
16822 #: ../fish/guestfish.pod:479
16823 msgid "The size in kilobytes (multiplied by 1024)."
16827 #: ../fish/guestfish.pod:481
16832 #: ../fish/guestfish.pod:483
16833 msgid "The size in SI 1000 byte units."
16837 #: ../fish/guestfish.pod:485
16838 msgid "B<M> or B<MiB>"
16842 #: ../fish/guestfish.pod:487
16843 msgid "The size in megabytes (multiplied by 1048576)."
16847 #: ../fish/guestfish.pod:489
16852 #: ../fish/guestfish.pod:491
16853 msgid "The size in SI 1000000 byte units."
16857 #: ../fish/guestfish.pod:493
16858 msgid "B<G> or B<GiB>"
16862 #: ../fish/guestfish.pod:495
16863 msgid "The size in gigabytes (multiplied by 2**30)."
16867 #: ../fish/guestfish.pod:497
16872 #: ../fish/guestfish.pod:499
16873 msgid "The size in SI 10**9 byte units."
16877 #: ../fish/guestfish.pod:501
16878 msgid "B<T> or B<TiB>"
16882 #: ../fish/guestfish.pod:503
16883 msgid "The size in terabytes (multiplied by 2**40)."
16887 #: ../fish/guestfish.pod:505
16892 #: ../fish/guestfish.pod:507
16893 msgid "The size in SI 10**12 byte units."
16897 #: ../fish/guestfish.pod:509
16898 msgid "B<P> or B<PiB>"
16902 #: ../fish/guestfish.pod:511
16903 msgid "The size in petabytes (multiplied by 2**50)."
16907 #: ../fish/guestfish.pod:513
16912 #: ../fish/guestfish.pod:515
16913 msgid "The size in SI 10**15 byte units."
16917 #: ../fish/guestfish.pod:517
16918 msgid "B<E> or B<EiB>"
16922 #: ../fish/guestfish.pod:519
16923 msgid "The size in exabytes (multiplied by 2**60)."
16927 #: ../fish/guestfish.pod:521
16932 #: ../fish/guestfish.pod:523
16933 msgid "The size in SI 10**18 byte units."
16937 #: ../fish/guestfish.pod:525
16938 msgid "B<Z> or B<ZiB>"
16942 #: ../fish/guestfish.pod:527
16943 msgid "The size in zettabytes (multiplied by 2**70)."
16947 #: ../fish/guestfish.pod:529
16952 #: ../fish/guestfish.pod:531
16953 msgid "The size in SI 10**21 byte units."
16957 #: ../fish/guestfish.pod:533
16958 msgid "B<Y> or B<YiB>"
16962 #: ../fish/guestfish.pod:535
16963 msgid "The size in yottabytes (multiplied by 2**80)."
16967 #: ../fish/guestfish.pod:537
16972 #: ../fish/guestfish.pod:539
16973 msgid "The size in SI 10**24 byte units."
16977 #: ../fish/guestfish.pod:545
16980 " truncate-size /file 1G\n"
16985 #: ../fish/guestfish.pod:547
16986 msgid "would truncate the file to 1 gigabyte."
16990 #: ../fish/guestfish.pod:549
16992 "Be careful because a few commands take sizes in kilobytes or megabytes "
16993 "(eg. the parameter to L</memsize> is specified in megabytes already). "
16994 "Adding a suffix will probably not do what you expect."
16998 #: ../fish/guestfish.pod:553
16999 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17003 #: ../fish/guestfish.pod:555
17005 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17006 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17010 #: ../fish/guestfish.pod:558
17013 " 1234 decimal number 1234\n"
17014 " 02322 octal number, equivalent to decimal 1234\n"
17015 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17020 #: ../fish/guestfish.pod:562
17022 "When using the C<chmod> command, you almost always want to specify an octal "
17023 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17024 "L<chmod(1)> program):"
17028 #: ../fish/guestfish.pod:566
17031 " chmod 0777 /public # OK\n"
17032 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17037 #: ../fish/guestfish.pod:569
17039 "Commands that return numbers usually print them in decimal, but some "
17040 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17041 "octal, preceeded by C<0>)."
17045 #: ../fish/guestfish.pod:573
17046 msgid "WILDCARDS AND GLOBBING"
17050 #: ../fish/guestfish.pod:575
17052 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17053 "(globbing) by default. So for example the following will not do what you "
17058 #: ../fish/guestfish.pod:579
17066 #: ../fish/guestfish.pod:581
17068 "Assuming you don't have a directory called literally C</home/*> then the "
17069 "above command will return an error."
17073 #: ../fish/guestfish.pod:584
17074 msgid "To perform wildcard expansion, use the C<glob> command."
17078 #: ../fish/guestfish.pod:586
17081 " glob rm-rf /home/*\n"
17086 #: ../fish/guestfish.pod:588
17088 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17089 "many times), equivalent to:"
17093 #: ../fish/guestfish.pod:591
17096 " rm-rf /home/jim\n"
17097 " rm-rf /home/joe\n"
17098 " rm-rf /home/mary\n"
17103 #: ../fish/guestfish.pod:595
17104 msgid "C<glob> only works on simple guest paths and not on device names."
17108 #: ../fish/guestfish.pod:597
17110 "If you have several parameters, each containing a wildcard, then glob will "
17111 "perform a Cartesian product."
17115 #: ../fish/guestfish.pod:600
17120 #: ../fish/guestfish.pod:602
17122 "Any line which starts with a I<#> character is treated as a comment and "
17123 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17124 "a command. For example:"
17128 #: ../fish/guestfish.pod:606
17131 " # this is a comment\n"
17132 " # this is a comment\n"
17133 " foo # NOT a comment\n"
17138 #: ../fish/guestfish.pod:610
17139 msgid "Blank lines are also ignored."
17143 #: ../fish/guestfish.pod:612
17144 msgid "RUNNING COMMANDS LOCALLY"
17148 #: ../fish/guestfish.pod:614
17150 "Any line which starts with a I<!> character is treated as a command sent to "
17151 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17155 #: ../fish/guestfish.pod:618
17159 " tgz-out /remote local/remote-data.tar.gz\n"
17164 #: ../fish/guestfish.pod:621
17166 "will create a directory C<local> on the host, and then export the contents "
17167 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17168 "(See C<tgz-out>)."
17172 #: ../fish/guestfish.pod:625
17174 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17175 "effect, due to the way that subprocesses work in Unix."
17179 #: ../fish/guestfish.pod:628
17184 #: ../fish/guestfish.pod:630
17186 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17187 "command (a guestfish command) to the second command (any host command). For "
17192 #: ../fish/guestfish.pod:634
17195 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17200 #: ../fish/guestfish.pod:636
17202 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17203 "program). The above command would list all accounts in the guest filesystem "
17204 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17208 #: ../fish/guestfish.pod:641
17211 " hexdump /bin/ls | head\n"
17212 " list-devices | tail -1\n"
17213 " tgz-out / - | tar ztf -\n"
17218 #: ../fish/guestfish.pod:645
17220 "The space before the pipe symbol is required, any space after the pipe "
17221 "symbol is optional. Everything after the pipe symbol is just passed "
17222 "straight to the host shell, so it can contain redirections, globs and "
17223 "anything else that makes sense on the host side."
17227 #: ../fish/guestfish.pod:650
17229 "To use a literal argument which begins with a pipe symbol, you have to quote "
17234 #: ../fish/guestfish.pod:653
17242 #: ../fish/guestfish.pod:655
17243 msgid "HOME DIRECTORIES"
17247 #: ../fish/guestfish.pod:657
17249 "If a parameter starts with the character C<~> then the tilde may be expanded "
17250 "as a home directory path (either C<~> for the current user's home directory, "
17251 "or C<~user> for another user)."
17255 #: ../fish/guestfish.pod:661
17257 "Note that home directory expansion happens for users known I<on the host>, "
17258 "not in the guest filesystem."
17262 #: ../fish/guestfish.pod:664
17264 "To use a literal argument which begins with a tilde, you have to quote it, "
17269 #: ../fish/guestfish.pod:667
17277 #: ../fish/guestfish.pod:671
17279 "Libguestfs has some support for Linux guests encrypted according to the "
17280 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17281 "disk encryption systems used by modern Linux guests. Currently only "
17282 "LVM-on-LUKS is supported."
17286 #: ../fish/guestfish.pod:676
17287 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17291 #: ../fish/guestfish.pod:678
17294 " ><fs> vfs-type /dev/sda2\n"
17300 #: ../fish/guestfish.pod:681
17302 "Then open those devices using L</luks-open>. This creates a device-mapper "
17303 "device called C</dev/mapper/luksdev>."
17307 #: ../fish/guestfish.pod:684
17310 " ><fs> luks-open /dev/sda2 luksdev\n"
17311 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17316 #: ../fish/guestfish.pod:687
17318 "Finally you have to tell LVM to scan for volume groups on the newly created "
17323 #: ../fish/guestfish.pod:690
17327 " vg-activate-all true\n"
17332 #: ../fish/guestfish.pod:693
17333 msgid "The logical volume(s) can now be mounted in the usual way."
17337 #: ../fish/guestfish.pod:695
17339 "Before closing a LUKS device you must unmount any logical volumes on it and "
17340 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17341 "one. Then you can close the mapper device:"
17345 #: ../fish/guestfish.pod:699
17348 " vg-activate false /dev/VG\n"
17349 " luks-close /dev/mapper/luksdev\n"
17354 #: ../fish/guestfish.pod:702
17355 msgid "WINDOWS PATHS"
17359 #: ../fish/guestfish.pod:704
17361 "If a path is prefixed with C<win:> then you can use Windows-style paths "
17362 "(with some limitations). The following commands are equivalent:"
17366 #: ../fish/guestfish.pod:707
17369 " file /WINDOWS/system32/config/system.LOG\n"
17374 #: ../fish/guestfish.pod:709
17377 " file win:/windows/system32/config/system.log\n"
17382 #: ../fish/guestfish.pod:711
17385 " file win:\\windows\\system32\\config\\system.log\n"
17390 #: ../fish/guestfish.pod:713
17393 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
17398 #: ../fish/guestfish.pod:715
17400 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
17401 "handles case insensitivity like Windows would. This only works in argument "
17402 "positions that expect a path."
17406 #: ../fish/guestfish.pod:719
17407 msgid "UPLOADING AND DOWNLOADING FILES"
17411 #: ../fish/guestfish.pod:721
17413 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17414 "others which upload from or download to a local file, you can use the "
17415 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17419 #: ../fish/guestfish.pod:725
17427 #: ../fish/guestfish.pod:727
17428 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
17432 #: ../fish/guestfish.pod:730
17435 " tar-out /etc - | tar tf -\n"
17440 #: ../fish/guestfish.pod:732
17442 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17443 "command (see L</PIPES>)."
17447 #: ../fish/guestfish.pod:735
17449 "When using C<-> to read from stdin, the input is read up to the end of "
17450 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17451 "some arbitrary end marker:"
17455 #: ../fish/guestfish.pod:739
17458 " upload -<<END /foo\n"
17467 #: ../fish/guestfish.pod:745
17469 "Any string of characters can be used instead of C<END>. The end marker must "
17470 "appear on a line of its own, without any preceeding or following characters "
17471 "(not even spaces)."
17475 #: ../fish/guestfish.pod:749
17477 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17478 "upload local files (so-called \"FileIn\" parameters in the generator)."
17482 #: ../fish/guestfish.pod:752
17483 msgid "EXIT ON ERROR BEHAVIOUR"
17487 #: ../fish/guestfish.pod:754
17489 "By default, guestfish will ignore any errors when in interactive mode "
17490 "(ie. taking commands from a human over a tty), and will exit on the first "
17491 "error in non-interactive mode (scripts, commands given on the command line)."
17495 #: ../fish/guestfish.pod:759
17497 "If you prefix a command with a I<-> character, then that command will not "
17498 "cause guestfish to exit, even if that (one) command returns an error."
17502 #: ../fish/guestfish.pod:763
17503 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
17507 #: ../fish/guestfish.pod:765
17509 "Guestfish can be remote-controlled over a socket. This is useful "
17510 "particularly in shell scripts where you want to make several different "
17511 "changes to a filesystem, but you don't want the overhead of starting up a "
17512 "guestfish process each time."
17516 #: ../fish/guestfish.pod:770
17517 msgid "Start a guestfish server process using:"
17521 #: ../fish/guestfish.pod:772
17524 " eval \"`guestfish --listen`\"\n"
17529 #: ../fish/guestfish.pod:774
17530 msgid "and then send it commands by doing:"
17534 #: ../fish/guestfish.pod:776
17537 " guestfish --remote cmd [...]\n"
17542 #: ../fish/guestfish.pod:778
17543 msgid "To cause the server to exit, send it the exit command:"
17547 #: ../fish/guestfish.pod:780
17550 " guestfish --remote exit\n"
17555 #: ../fish/guestfish.pod:782
17557 "Note that the server will normally exit if there is an error in a command. "
17558 "You can change this in the usual way. See section L</EXIT ON ERROR "
17563 #: ../fish/guestfish.pod:786
17564 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
17568 #: ../fish/guestfish.pod:788
17570 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
17571 "is how the I<--remote> option knows where to send the commands. You can "
17572 "have several guestfish listener processes running using:"
17576 #: ../fish/guestfish.pod:792
17579 " eval \"`guestfish --listen`\"\n"
17580 " pid1=$GUESTFISH_PID\n"
17581 " eval \"`guestfish --listen`\"\n"
17582 " pid2=$GUESTFISH_PID\n"
17584 " guestfish --remote=$pid1 cmd\n"
17585 " guestfish --remote=$pid2 cmd\n"
17590 #: ../fish/guestfish.pod:800
17591 msgid "REMOTE CONTROL AND CSH"
17595 #: ../fish/guestfish.pod:802
17597 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
17602 #: ../fish/guestfish.pod:805
17605 " eval \"`guestfish --listen --csh`\"\n"
17610 #: ../fish/guestfish.pod:807
17611 msgid "REMOTE CONTROL DETAILS"
17615 #: ../fish/guestfish.pod:809
17617 "Remote control happens over a Unix domain socket called "
17618 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
17619 "of the process, and C<$PID> is the process ID of the server."
17623 #: ../fish/guestfish.pod:813
17624 msgid "Guestfish client and server versions must match exactly."
17628 #: ../fish/guestfish.pod:815
17629 msgid "PREPARED DISK IMAGES"
17633 #: ../fish/guestfish.pod:817
17635 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17636 "preformatted disk images that guestfish can make for you to save typing. "
17637 "This is particularly useful for testing purposes. This option is used "
17638 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17639 "can be mixed with I<-a>)."
17643 #: ../fish/guestfish.pod:823
17645 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17646 "the second and so on. Existing files in the current directory are "
17651 #: ../fish/guestfish.pod:827
17653 "The type briefly describes how the disk should be sized, partitioned, how "
17654 "filesystem(s) should be created, and how content should be added. "
17655 "Optionally the type can be followed by extra parameters, separated by C<:> "
17656 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
17657 "sparsely-allocated disk, containing a single partition, with the partition "
17658 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
17659 "on a 1GB disk instead."
17663 #: ../fish/guestfish.pod:835
17664 msgid "To list the available types and any extra parameters they take, run:"
17668 #: ../fish/guestfish.pod:839
17670 "Note that the prepared filesystem is not mounted. You would usually have to "
17671 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17675 #: ../fish/guestfish.pod:843
17677 "If any I<-N> or I<--new> options are given, the guest is automatically "
17682 #: ../fish/guestfish.pod:848
17683 msgid "Create a 100MB disk with an ext4-formatted partition:"
17687 #: ../fish/guestfish.pod:850
17690 " guestfish -N fs:ext4\n"
17695 #: ../fish/guestfish.pod:852
17696 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17700 #: ../fish/guestfish.pod:854
17703 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17708 #: ../fish/guestfish.pod:856
17709 msgid "Create a blank 200MB disk:"
17713 #: ../fish/guestfish.pod:858
17716 " guestfish -N disk:200M\n"
17721 #: ../fish/guestfish.pod:860
17722 msgid "PROGRESS BARS"
17726 #: ../fish/guestfish.pod:862
17728 "Some (not all) long-running commands send progress notification messages as "
17729 "they are running. Guestfish turns these messages into progress bars."
17733 #: ../fish/guestfish.pod:866
17735 "When a command that supports progress bars takes longer than two seconds to "
17736 "run, and if progress bars are enabled, then you will see one appearing below "
17741 #: ../fish/guestfish.pod:870
17744 " ><fs> copy-size /large-file /another-file 2048M\n"
17745 " / 10% [#####-----------------------------------------] 00:30\n"
17750 #: ../fish/guestfish.pod:873
17752 "The spinner on the left hand side moves round once for every progress "
17753 "notification received from the backend. This is a (reasonably) golden "
17754 "assurance that the command is \"doing something\" even if the progress bar "
17755 "is not moving, because the command is able to send the progress "
17756 "notifications. When the bar reaches 100% and the command finishes, the "
17757 "spinner disappears."
17761 #: ../fish/guestfish.pod:880
17763 "Progress bars are enabled by default when guestfish is used interactively. "
17764 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17765 "and you can disable them completely using I<--no-progress-bars>."
17769 #: ../fish/guestfish.pod:885
17770 msgid "GUESTFISH COMMANDS"
17774 #: ../fish/guestfish.pod:887
17776 "The commands in this section are guestfish convenience commands, in other "
17777 "words, they are not part of the L<guestfs(3)> API."
17781 #: ../fish/guestfish.pod:890
17786 #: ../fish/guestfish.pod:892
17795 #: ../fish/guestfish.pod:895
17796 msgid "Without any parameter, this provides general help."
17800 #: ../fish/guestfish.pod:897
17801 msgid "With a C<cmd> parameter, this displays detailed help for that command."
17805 #: ../fish/guestfish.pod:899
17806 msgid "quit | exit"
17810 #: ../fish/guestfish.pod:901
17811 msgid "This exits guestfish. You can also use C<^D> key."
17815 #: ../fish/guestfish.pod:903
17816 msgid "@FISH_COMMANDS@"
17820 #: ../fish/guestfish.pod:905
17825 #: ../fish/guestfish.pod:909 ../test-tool/libguestfs-test-tool.pod:83
17830 #: ../fish/guestfish.pod:911
17832 "guestfish returns 0 if the commands completed without error, or 1 if there "
17837 #: ../fish/guestfish.pod:918
17842 #: ../fish/guestfish.pod:920
17844 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17849 #: ../fish/guestfish.pod:923
17850 msgid "GUESTFISH_PID"
17854 #: ../fish/guestfish.pod:925
17856 "Used with the I<--remote> option to specify the remote guestfish process to "
17857 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17861 #: ../fish/guestfish.pod:929
17866 #: ../fish/guestfish.pod:931
17868 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17869 "not specified, the external L<hexedit(1)> program is used."
17873 #: ../fish/guestfish.pod:935
17878 #: ../fish/guestfish.pod:937
17880 "If compiled with GNU readline support, various files in the home directory "
17881 "can be used. See L</FILES>."
17885 #: ../fish/guestfish.pod:946
17887 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17888 "effect as using the B<-v> option."
17892 #: ../fish/guestfish.pod:958
17894 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17895 "the discussion of paths in L<guestfs(3)>."
17899 #: ../fish/guestfish.pod:969
17900 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17904 #: ../fish/guestfish.pod:971
17909 #: ../fish/guestfish.pod:973
17911 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17916 #: ../fish/guestfish.pod:988 ../test-tool/libguestfs-test-tool.pod:88
17921 #: ../fish/guestfish.pod:992
17922 msgid "$HOME/.guestfish"
17926 #: ../fish/guestfish.pod:994
17928 "If compiled with GNU readline support, then the command history is saved in "
17933 #: ../fish/guestfish.pod:997
17934 msgid "$HOME/.inputrc"
17938 #: ../fish/guestfish.pod:999
17939 msgid "/etc/inputrc"
17943 #: ../fish/guestfish.pod:1001
17945 "If compiled with GNU readline support, then these files can be used to "
17946 "configure readline. For further information, please see "
17947 "L<readline(3)/INITIALIZATION FILE>."
17951 #: ../fish/guestfish.pod:1005
17952 msgid "To write rules which only apply to guestfish, use:"
17956 #: ../fish/guestfish.pod:1007
17966 #: ../fish/guestfish.pod:1011
17968 "Variables that you can set in inputrc that change the behaviour of guestfish "
17969 "in useful ways include:"
17973 #: ../fish/guestfish.pod:1016
17974 msgid "completion-ignore-case (default: on)"
17978 #: ../fish/guestfish.pod:1018
17980 "By default, guestfish will ignore case when tab-completing paths on the "
17985 #: ../fish/guestfish.pod:1021
17988 " set completion-ignore-case off\n"
17993 #: ../fish/guestfish.pod:1023
17994 msgid "to make guestfish case sensitive."
17998 #: ../fish/guestfish.pod:1027
18003 #: ../fish/guestfish.pod:1029
18004 msgid "test2.img (etc)"
18008 #: ../fish/guestfish.pod:1031
18010 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
18011 "will be created in the file C<test1.img> in the current directory. The "
18012 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
18013 "the same name will be overwritten."
18017 #: ../fish/guestfish.pod:1040
18019 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
18020 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
18021 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
18022 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
18026 #: ../fish/guestfish.pod:1064 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:253 ../inspector/virt-inspector.pl:598 ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518 ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251 ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:300 ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:273
18028 "This program is free software; you can redistribute it and/or modify it "
18029 "under the terms of the GNU General Public License as published by the Free "
18030 "Software Foundation; either version 2 of the License, or (at your option) "
18031 "any later version."
18035 #: ../fish/guestfish.pod:1069 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:258 ../inspector/virt-inspector.pl:603 ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523 ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256 ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211 ../tools/virt-tar.pl:305 ../tools/virt-rescue.pl:290 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:278
18037 "This program is distributed in the hope that it will be useful, but WITHOUT "
18038 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
18039 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
18044 #: ../fish/guestfish.pod:1074 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pl:608 ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528 ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261 ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216 ../tools/virt-tar.pl:310 ../tools/virt-rescue.pl:295 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:283
18046 "You should have received a copy of the GNU General Public License along with "
18047 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
18048 "Ave, Cambridge, MA 02139, USA."
18052 #: ../fish/guestfish-actions.pod:1
18057 #: ../fish/guestfish-actions.pod:3
18060 " add-cdrom filename\n"
18065 #: ../fish/guestfish-actions.pod:15
18067 "This call checks for the existence of C<filename>. This stops you from "
18068 "specifying other types of drive which are supported by qemu such as C<nbd:> "
18069 "and C<http:> URLs. To specify those, use the general L</config> call "
18074 #: ../fish/guestfish-actions.pod:22
18076 "If you just want to add an ISO file (often you use this as an efficient way "
18077 "to transfer large files into the guest), then you should probably use "
18078 "L</add-drive-ro> instead."
18082 #: ../fish/guestfish-actions.pod:35
18087 #: ../fish/guestfish-actions.pod:37
18092 #: ../fish/guestfish-actions.pod:39
18095 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
18100 #: ../fish/guestfish-actions.pod:41
18102 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
18103 "It works by connecting to libvirt, requesting the domain and domain XML from "
18104 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
18108 #: ../fish/guestfish-actions.pod:58
18110 "The optional C<libvirturi> parameter sets the libvirt URI (see "
18111 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
18112 "default libvirt URI (or one set through an environment variable, see the "
18113 "libvirt documentation for full details). If you are using the C API "
18114 "directly then it is more flexible to create the libvirt connection object "
18115 "yourself, get the domain object, and call L</add-libvirt-dom>."
18119 #: ../fish/guestfish-actions.pod:66
18121 "The other optional parameters are passed directly through to "
18122 "L</add-drive-opts>."
18126 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
18128 "This command has one or more optional arguments. See L</OPTIONAL "
18133 #: ../fish/guestfish-actions.pod:71
18138 #: ../fish/guestfish-actions.pod:73
18141 " add-drive filename\n"
18146 #: ../fish/guestfish-actions.pod:75
18148 "This function is the equivalent of calling L</add-drive-opts> with no "
18149 "optional parameters, so the disk is added writable, with the format being "
18150 "detected automatically."
18154 #: ../fish/guestfish-actions.pod:79
18156 "Automatic detection of the format opens you up to a potential security hole "
18157 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
18158 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
18159 "you should think about replacing calls to this function with calls to "
18160 "L</add-drive-opts>, and specifying the format."
18164 #: ../fish/guestfish-actions.pod:86
18165 msgid "add-drive-opts"
18169 #: ../fish/guestfish-actions.pod:88
18174 #: ../fish/guestfish-actions.pod:90
18177 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
18182 #: ../fish/guestfish-actions.pod:117
18184 "This forces the image format. If you omit this (or use L</add-drive> or "
18185 "L</add-drive-ro>) then the format is automatically detected. Possible "
18186 "formats include C<raw> and C<qcow2>."
18190 #: ../fish/guestfish-actions.pod:128
18192 "This rarely-used option lets you emulate the behaviour of the deprecated "
18193 "L</add-drive-with-if> call (q.v.)"
18197 #: ../fish/guestfish-actions.pod:135
18198 msgid "add-drive-ro"
18202 #: ../fish/guestfish-actions.pod:137
18207 #: ../fish/guestfish-actions.pod:139
18210 " add-drive-ro filename\n"
18215 #: ../fish/guestfish-actions.pod:141
18217 "This function is the equivalent of calling L</add-drive-opts> with the "
18218 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
18219 "is added read-only, with the format being detected automatically."
18223 #: ../fish/guestfish-actions.pod:146
18224 msgid "add-drive-ro-with-if"
18228 #: ../fish/guestfish-actions.pod:148
18231 " add-drive-ro-with-if filename iface\n"
18236 #: ../fish/guestfish-actions.pod:150
18238 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
18239 "interface emulation to use at run time."
18243 #: ../fish/guestfish-actions.pod:160
18244 msgid "add-drive-with-if"
18248 #: ../fish/guestfish-actions.pod:162
18251 " add-drive-with-if filename iface\n"
18256 #: ../fish/guestfish-actions.pod:164
18258 "This is the same as L</add-drive> but it allows you to specify the QEMU "
18259 "interface emulation to use at run time."
18263 #: ../fish/guestfish-actions.pod:174
18268 #: ../fish/guestfish-actions.pod:176
18271 " aug-clear augpath\n"
18276 #: ../fish/guestfish-actions.pod:181
18281 #: ../fish/guestfish-actions.pod:183
18289 #: ../fish/guestfish-actions.pod:185
18291 "Close the current Augeas handle and free up any resources used by it. After "
18292 "calling this, you have to call L</aug-init> again before you can use any "
18293 "other Augeas functions."
18297 #: ../fish/guestfish-actions.pod:190
18298 msgid "aug-defnode"
18302 #: ../fish/guestfish-actions.pod:192
18305 " aug-defnode name expr val\n"
18310 #: ../fish/guestfish-actions.pod:197
18312 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
18313 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
18314 "containing that single node."
18318 #: ../fish/guestfish-actions.pod:205
18323 #: ../fish/guestfish-actions.pod:207
18326 " aug-defvar name expr\n"
18331 #: ../fish/guestfish-actions.pod:216
18336 #: ../fish/guestfish-actions.pod:218
18339 " aug-get augpath\n"
18344 #: ../fish/guestfish-actions.pod:223
18349 #: ../fish/guestfish-actions.pod:225
18352 " aug-init root flags\n"
18357 #: ../fish/guestfish-actions.pod:231
18358 msgid "You must call this before using any other L</aug-*> commands."
18362 #: ../fish/guestfish-actions.pod:266
18363 msgid "Do not load the tree in L</aug-init>."
18367 #: ../fish/guestfish-actions.pod:270
18368 msgid "To close the handle, you can call L</aug-close>."
18372 #: ../fish/guestfish-actions.pod:274
18377 #: ../fish/guestfish-actions.pod:276
18380 " aug-insert augpath label true|false\n"
18385 #: ../fish/guestfish-actions.pod:286
18390 #: ../fish/guestfish-actions.pod:288
18398 #: ../fish/guestfish-actions.pod:295
18403 #: ../fish/guestfish-actions.pod:297
18406 " aug-ls augpath\n"
18411 #: ../fish/guestfish-actions.pod:299
18413 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
18414 "resulting nodes into alphabetical order."
18418 #: ../fish/guestfish-actions.pod:302
18423 #: ../fish/guestfish-actions.pod:304
18426 " aug-match augpath\n"
18431 #: ../fish/guestfish-actions.pod:310
18436 #: ../fish/guestfish-actions.pod:312
18439 " aug-mv src dest\n"
18444 #: ../fish/guestfish-actions.pod:317
18449 #: ../fish/guestfish-actions.pod:319
18452 " aug-rm augpath\n"
18457 #: ../fish/guestfish-actions.pod:325
18462 #: ../fish/guestfish-actions.pod:327
18470 #: ../fish/guestfish-actions.pod:331
18472 "The flags which were passed to L</aug-init> affect exactly how files are "
18477 #: ../fish/guestfish-actions.pod:334
18482 #: ../fish/guestfish-actions.pod:336
18485 " aug-set augpath val\n"
18490 #: ../fish/guestfish-actions.pod:340
18492 "In the Augeas API, it is possible to clear a node by setting the value to "
18493 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
18494 "this call. Instead you must use the L</aug-clear> call."
18498 #: ../fish/guestfish-actions.pod:345
18503 #: ../fish/guestfish-actions.pod:347
18506 " available 'groups ...'\n"
18511 #: ../fish/guestfish-actions.pod:353
18513 "The libguestfs groups, and the functions that those groups correspond to, "
18514 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
18515 "runtime by calling L</available-all-groups>."
18519 #: ../fish/guestfish-actions.pod:377
18520 msgid "You must call L</launch> before calling this function."
18524 #: ../fish/guestfish-actions.pod:399
18526 "This call was added in version C<1.0.80>. In previous versions of "
18527 "libguestfs all you could do would be to speculatively execute a command to "
18528 "find out if the daemon implemented it. See also L</version>."
18532 #: ../fish/guestfish-actions.pod:406
18533 msgid "available-all-groups"
18537 #: ../fish/guestfish-actions.pod:408
18540 " available-all-groups\n"
18545 #: ../fish/guestfish-actions.pod:410
18547 "This command returns a list of all optional groups that this daemon knows "
18548 "about. Note this returns both supported and unsupported groups. To find "
18549 "out which ones the daemon can actually support you have to call "
18550 "L</available> on each member of the returned list."
18554 #: ../fish/guestfish-actions.pod:416
18555 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
18559 #: ../fish/guestfish-actions.pod:418
18564 #: ../fish/guestfish-actions.pod:420
18567 " base64-in (base64file|-) filename\n"
18572 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434 ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827 ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223 ../fish/guestfish-actions.pod:3956 ../fish/guestfish-actions.pod:3968 ../fish/guestfish-actions.pod:3979 ../fish/guestfish-actions.pod:3990 ../fish/guestfish-actions.pod:4042 ../fish/guestfish-actions.pod:4051 ../fish/guestfish-actions.pod:4105 ../fish/guestfish-actions.pod:4128
18573 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
18577 #: ../fish/guestfish-actions.pod:427
18582 #: ../fish/guestfish-actions.pod:429
18585 " base64-out filename (base64file|-)\n"
18590 #: ../fish/guestfish-actions.pod:436
18591 msgid "blockdev-flushbufs"
18595 #: ../fish/guestfish-actions.pod:438
18598 " blockdev-flushbufs device\n"
18603 #: ../fish/guestfish-actions.pod:445
18604 msgid "blockdev-getbsz"
18608 #: ../fish/guestfish-actions.pod:447
18611 " blockdev-getbsz device\n"
18616 #: ../fish/guestfish-actions.pod:456
18617 msgid "blockdev-getro"
18621 #: ../fish/guestfish-actions.pod:458
18624 " blockdev-getro device\n"
18629 #: ../fish/guestfish-actions.pod:465
18630 msgid "blockdev-getsize64"
18634 #: ../fish/guestfish-actions.pod:467
18637 " blockdev-getsize64 device\n"
18642 #: ../fish/guestfish-actions.pod:471
18643 msgid "See also L</blockdev-getsz>."
18647 #: ../fish/guestfish-actions.pod:475
18648 msgid "blockdev-getss"
18652 #: ../fish/guestfish-actions.pod:477
18655 " blockdev-getss device\n"
18660 #: ../fish/guestfish-actions.pod:482
18661 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
18665 #: ../fish/guestfish-actions.pod:487
18666 msgid "blockdev-getsz"
18670 #: ../fish/guestfish-actions.pod:489
18673 " blockdev-getsz device\n"
18678 #: ../fish/guestfish-actions.pod:494
18680 "See also L</blockdev-getss> for the real sector size of the device, and "
18681 "L</blockdev-getsize64> for the more useful I<size in bytes>."
18685 #: ../fish/guestfish-actions.pod:500
18686 msgid "blockdev-rereadpt"
18690 #: ../fish/guestfish-actions.pod:502
18693 " blockdev-rereadpt device\n"
18698 #: ../fish/guestfish-actions.pod:508
18699 msgid "blockdev-setbsz"
18703 #: ../fish/guestfish-actions.pod:510
18706 " blockdev-setbsz device blocksize\n"
18711 #: ../fish/guestfish-actions.pod:519
18712 msgid "blockdev-setro"
18716 #: ../fish/guestfish-actions.pod:521
18719 " blockdev-setro device\n"
18724 #: ../fish/guestfish-actions.pod:527
18725 msgid "blockdev-setrw"
18729 #: ../fish/guestfish-actions.pod:529
18732 " blockdev-setrw device\n"
18737 #: ../fish/guestfish-actions.pod:535
18738 msgid "case-sensitive-path"
18742 #: ../fish/guestfish-actions.pod:537
18745 " case-sensitive-path path\n"
18750 #: ../fish/guestfish-actions.pod:561
18752 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
18753 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
18754 "how the directories were originally created under Windows)."
18758 #: ../fish/guestfish-actions.pod:569
18759 msgid "See also L</realpath>."
18763 #: ../fish/guestfish-actions.pod:571
18768 #: ../fish/guestfish-actions.pod:573
18776 #: ../fish/guestfish-actions.pod:577
18778 "Note that this function cannot correctly handle binary files (specifically, "
18779 "files containing C<\\0> character which is treated as end of string). For "
18780 "those you need to use the L</read-file> or L</download> functions which have "
18781 "a more complex interface."
18785 #: ../fish/guestfish-actions.pod:585
18790 #: ../fish/guestfish-actions.pod:587
18793 " checksum csumtype path\n"
18798 #: ../fish/guestfish-actions.pod:630
18799 msgid "To get the checksum for a device, use L</checksum-device>."
18803 #: ../fish/guestfish-actions.pod:632
18804 msgid "To get the checksums for many files, use L</checksums-out>."
18808 #: ../fish/guestfish-actions.pod:634
18809 msgid "checksum-device"
18813 #: ../fish/guestfish-actions.pod:636
18816 " checksum-device csumtype device\n"
18821 #: ../fish/guestfish-actions.pod:638
18823 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
18824 "device named C<device>. For the types of checksums supported see the "
18825 "L</checksum> command."
18829 #: ../fish/guestfish-actions.pod:642
18830 msgid "checksums-out"
18834 #: ../fish/guestfish-actions.pod:644
18837 " checksums-out csumtype directory (sumsfile|-)\n"
18842 #: ../fish/guestfish-actions.pod:660
18847 #: ../fish/guestfish-actions.pod:662
18850 " chmod mode path\n"
18855 #: ../fish/guestfish-actions.pod:673
18860 #: ../fish/guestfish-actions.pod:675
18863 " chown owner group path\n"
18868 #: ../fish/guestfish-actions.pod:683
18873 #: ../fish/guestfish-actions.pod:685
18876 " command 'arguments ...'\n"
18881 #: ../fish/guestfish-actions.pod:692
18883 "The single parameter is an argv-style list of arguments. The first element "
18884 "is the name of the program to run. Subsequent elements are parameters. The "
18885 "list must be non-empty (ie. must contain a program name). Note that the "
18886 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
18890 #: ../fish/guestfish-actions.pod:720
18891 msgid "command-lines"
18895 #: ../fish/guestfish-actions.pod:722
18898 " command-lines 'arguments ...'\n"
18903 #: ../fish/guestfish-actions.pod:724
18904 msgid "This is the same as L</command>, but splits the result into a list of lines."
18908 #: ../fish/guestfish-actions.pod:727
18909 msgid "See also: L</sh-lines>"
18913 #: ../fish/guestfish-actions.pod:732
18918 #: ../fish/guestfish-actions.pod:734
18921 " config qemuparam qemuvalue\n"
18926 #: ../fish/guestfish-actions.pod:745
18931 #: ../fish/guestfish-actions.pod:747
18934 " copy-size src dest size\n"
18939 #: ../fish/guestfish-actions.pod:755
18944 #: ../fish/guestfish-actions.pod:757
18952 #: ../fish/guestfish-actions.pod:762
18957 #: ../fish/guestfish-actions.pod:764
18965 #: ../fish/guestfish-actions.pod:769
18970 #: ../fish/guestfish-actions.pod:771
18978 #: ../fish/guestfish-actions.pod:778
18980 "If the destination is a device, it must be as large or larger than the "
18981 "source file or device, otherwise the copy will fail. This command cannot do "
18982 "partial copies (see L</copy-size>)."
18986 #: ../fish/guestfish-actions.pod:782
18991 #: ../fish/guestfish-actions.pod:784
18999 #: ../fish/guestfish-actions.pod:792
19004 #: ../fish/guestfish-actions.pod:794
19012 #: ../fish/guestfish-actions.pod:803
19017 #: ../fish/guestfish-actions.pod:805
19025 #: ../fish/guestfish-actions.pod:811
19027 "Another way to get the same information is to enable verbose messages with "
19028 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
19029 "before running the program."
19033 #: ../fish/guestfish-actions.pod:816
19038 #: ../fish/guestfish-actions.pod:818
19041 " download remotefilename (filename|-)\n"
19046 #: ../fish/guestfish-actions.pod:825
19047 msgid "See also L</upload>, L</cat>."
19051 #: ../fish/guestfish-actions.pod:829
19052 msgid "download-offset"
19056 #: ../fish/guestfish-actions.pod:831
19059 " download-offset remotefilename (filename|-) offset size\n"
19064 #: ../fish/guestfish-actions.pod:839
19066 "Note that there is no limit on the amount of data that can be downloaded "
19067 "with this call, unlike with L</pread>, and this call always reads the full "
19068 "amount unless an error occurs."
19072 #: ../fish/guestfish-actions.pod:844
19073 msgid "See also L</download>, L</pread>."
19077 #: ../fish/guestfish-actions.pod:848
19078 msgid "drop-caches"
19082 #: ../fish/guestfish-actions.pod:850
19085 " drop-caches whattodrop\n"
19090 #: ../fish/guestfish-actions.pod:862
19095 #: ../fish/guestfish-actions.pod:864
19103 #: ../fish/guestfish-actions.pod:876
19108 #: ../fish/guestfish-actions.pod:878
19111 " e2fsck-f device\n"
19116 #: ../fish/guestfish-actions.pod:884
19118 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
19119 "should use L</fsck>."
19123 #: ../fish/guestfish-actions.pod:887
19124 msgid "echo-daemon"
19128 #: ../fish/guestfish-actions.pod:889
19131 " echo-daemon 'words ...'\n"
19136 #: ../fish/guestfish-actions.pod:896
19137 msgid "See also L</ping-daemon>."
19141 #: ../fish/guestfish-actions.pod:898
19146 #: ../fish/guestfish-actions.pod:900
19149 " egrep regex path\n"
19154 #: ../fish/guestfish-actions.pod:908
19159 #: ../fish/guestfish-actions.pod:910
19162 " egrepi regex path\n"
19167 #: ../fish/guestfish-actions.pod:918
19172 #: ../fish/guestfish-actions.pod:920
19175 " equal file1 file2\n"
19180 #: ../fish/guestfish-actions.pod:927
19185 #: ../fish/guestfish-actions.pod:929
19193 #: ../fish/guestfish-actions.pod:934
19194 msgid "See also L</is-file>, L</is-dir>, L</stat>."
19198 #: ../fish/guestfish-actions.pod:936
19203 #: ../fish/guestfish-actions.pod:938
19206 " fallocate path len\n"
19211 #: ../fish/guestfish-actions.pod:955
19212 msgid "fallocate64"
19216 #: ../fish/guestfish-actions.pod:957
19219 " fallocate64 path len\n"
19224 #: ../fish/guestfish-actions.pod:963
19226 "Note that this call allocates disk blocks for the file. To create a sparse "
19227 "file use L</truncate-size> instead."
19231 #: ../fish/guestfish-actions.pod:966
19233 "The deprecated call L</fallocate> does the same, but owing to an oversight "
19234 "it only allowed 30 bit lengths to be specified, effectively limiting the "
19235 "maximum size of files created through that call to 1GB."
19239 #: ../fish/guestfish-actions.pod:975
19244 #: ../fish/guestfish-actions.pod:977
19247 " fgrep pattern path\n"
19252 #: ../fish/guestfish-actions.pod:985
19257 #: ../fish/guestfish-actions.pod:987
19260 " fgrepi pattern path\n"
19265 #: ../fish/guestfish-actions.pod:995
19270 #: ../fish/guestfish-actions.pod:997
19278 #: ../fish/guestfish-actions.pod:1009
19280 "This command can also be used on C</dev/> devices (and partitions, LV "
19281 "names). You can for example use this to determine if a device contains a "
19282 "filesystem, although it's usually better to use L</vfs-type>."
19286 #: ../fish/guestfish-actions.pod:1019
19287 msgid "file-architecture"
19291 #: ../fish/guestfish-actions.pod:1021
19294 " file-architecture filename\n"
19299 #: ../fish/guestfish-actions.pod:1124
19304 #: ../fish/guestfish-actions.pod:1126
19312 #: ../fish/guestfish-actions.pod:1130
19314 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
19315 "L</is-file> etc. To get the size of block devices, use "
19316 "L</blockdev-getsize64>."
19320 #: ../fish/guestfish-actions.pod:1134
19325 #: ../fish/guestfish-actions.pod:1136
19328 " fill c len path\n"
19333 #: ../fish/guestfish-actions.pod:1142
19335 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
19336 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
19337 "L</fill-pattern>."
19341 #: ../fish/guestfish-actions.pod:1147
19342 msgid "fill-pattern"
19346 #: ../fish/guestfish-actions.pod:1149
19349 " fill-pattern pattern len path\n"
19354 #: ../fish/guestfish-actions.pod:1151
19356 "This function is like L</fill> except that it creates a new file of length "
19357 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
19358 "is truncated if necessary to ensure the length of the file is exactly C<len> "
19363 #: ../fish/guestfish-actions.pod:1156
19368 #: ../fish/guestfish-actions.pod:1158
19371 " find directory\n"
19376 #: ../fish/guestfish-actions.pod:1172
19377 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
19381 #: ../fish/guestfish-actions.pod:1185
19382 msgid "See also L</find0>."
19386 #: ../fish/guestfish-actions.pod:1190
19391 #: ../fish/guestfish-actions.pod:1192
19394 " find0 directory (files|-)\n"
19399 #: ../fish/guestfish-actions.pod:1198
19400 msgid "This command works the same way as L</find> with the following exceptions:"
19404 #: ../fish/guestfish-actions.pod:1225
19405 msgid "findfs-label"
19409 #: ../fish/guestfish-actions.pod:1227
19412 " findfs-label label\n"
19417 #: ../fish/guestfish-actions.pod:1233
19418 msgid "To find the label of a filesystem, use L</vfs-label>."
19422 #: ../fish/guestfish-actions.pod:1235
19423 msgid "findfs-uuid"
19427 #: ../fish/guestfish-actions.pod:1237
19430 " findfs-uuid uuid\n"
19435 #: ../fish/guestfish-actions.pod:1243
19436 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
19440 #: ../fish/guestfish-actions.pod:1245
19445 #: ../fish/guestfish-actions.pod:1247
19448 " fsck fstype device\n"
19453 #: ../fish/guestfish-actions.pod:1277
19458 #: ../fish/guestfish-actions.pod:1279
19466 #: ../fish/guestfish-actions.pod:1286
19467 msgid "get-autosync"
19471 #: ../fish/guestfish-actions.pod:1288
19479 #: ../fish/guestfish-actions.pod:1292
19484 #: ../fish/guestfish-actions.pod:1294
19492 #: ../fish/guestfish-actions.pod:1298
19493 msgid "get-e2label"
19497 #: ../fish/guestfish-actions.pod:1300
19500 " get-e2label device\n"
19505 #: ../fish/guestfish-actions.pod:1312
19510 #: ../fish/guestfish-actions.pod:1314
19513 " get-e2uuid device\n"
19518 #: ../fish/guestfish-actions.pod:1326
19519 msgid "get-memsize"
19523 #: ../fish/guestfish-actions.pod:1328
19531 #: ../fish/guestfish-actions.pod:1333
19533 "If L</set-memsize> was not called on this handle, and if "
19534 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
19535 "value for memsize."
19539 #: ../fish/guestfish-actions.pod:1340
19540 msgid "get-network"
19544 #: ../fish/guestfish-actions.pod:1342
19552 #: ../fish/guestfish-actions.pod:1346
19557 #: ../fish/guestfish-actions.pod:1348
19565 #: ../fish/guestfish-actions.pod:1355
19570 #: ../fish/guestfish-actions.pod:1357
19575 #: ../fish/guestfish-actions.pod:1359
19583 #: ../fish/guestfish-actions.pod:1366
19588 #: ../fish/guestfish-actions.pod:1368
19596 #: ../fish/guestfish-actions.pod:1375
19597 msgid "get-recovery-proc"
19601 #: ../fish/guestfish-actions.pod:1377
19604 " get-recovery-proc\n"
19609 #: ../fish/guestfish-actions.pod:1381
19610 msgid "get-selinux"
19614 #: ../fish/guestfish-actions.pod:1383
19622 #: ../fish/guestfish-actions.pod:1385
19624 "This returns the current setting of the selinux flag which is passed to the "
19625 "appliance at boot time. See L</set-selinux>."
19629 #: ../fish/guestfish-actions.pod:1391
19634 #: ../fish/guestfish-actions.pod:1393
19642 #: ../fish/guestfish-actions.pod:1400
19647 #: ../fish/guestfish-actions.pod:1402
19655 #: ../fish/guestfish-actions.pod:1406
19660 #: ../fish/guestfish-actions.pod:1408
19668 #: ../fish/guestfish-actions.pod:1410
19670 "Return the current umask. By default the umask is C<022> unless it has been "
19671 "set by calling L</umask>."
19675 #: ../fish/guestfish-actions.pod:1413
19676 msgid "get-verbose"
19680 #: ../fish/guestfish-actions.pod:1415
19688 #: ../fish/guestfish-actions.pod:1419
19693 #: ../fish/guestfish-actions.pod:1421
19701 #: ../fish/guestfish-actions.pod:1425
19702 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
19706 #: ../fish/guestfish-actions.pod:1428
19711 #: ../fish/guestfish-actions.pod:1430
19714 " getxattrs path\n"
19719 #: ../fish/guestfish-actions.pod:1438
19720 msgid "See also: L</lgetxattrs>, L<attr(5)>."
19724 #: ../fish/guestfish-actions.pod:1440
19725 msgid "glob-expand"
19729 #: ../fish/guestfish-actions.pod:1442
19732 " glob-expand pattern\n"
19737 #: ../fish/guestfish-actions.pod:1455
19742 #: ../fish/guestfish-actions.pod:1457
19745 " grep regex path\n"
19750 #: ../fish/guestfish-actions.pod:1465
19755 #: ../fish/guestfish-actions.pod:1467
19758 " grepi regex path\n"
19763 #: ../fish/guestfish-actions.pod:1475
19764 msgid "grub-install"
19768 #: ../fish/guestfish-actions.pod:1477
19771 " grub-install root device\n"
19776 #: ../fish/guestfish-actions.pod:1493
19781 #: ../fish/guestfish-actions.pod:1495
19789 #: ../fish/guestfish-actions.pod:1503
19794 #: ../fish/guestfish-actions.pod:1505
19797 " head-n nrlines path\n"
19802 #: ../fish/guestfish-actions.pod:1518
19807 #: ../fish/guestfish-actions.pod:1520
19815 #: ../fish/guestfish-actions.pod:1528
19820 #: ../fish/guestfish-actions.pod:1530
19823 " initrd-cat initrdpath filename\n"
19828 #: ../fish/guestfish-actions.pod:1542
19829 msgid "See also L</initrd-list>."
19833 #: ../fish/guestfish-actions.pod:1547
19834 msgid "initrd-list"
19838 #: ../fish/guestfish-actions.pod:1549
19841 " initrd-list path\n"
19846 #: ../fish/guestfish-actions.pod:1561
19847 msgid "inotify-add-watch"
19851 #: ../fish/guestfish-actions.pod:1563
19854 " inotify-add-watch path mask\n"
19859 #: ../fish/guestfish-actions.pod:1575
19860 msgid "inotify-close"
19864 #: ../fish/guestfish-actions.pod:1577
19872 #: ../fish/guestfish-actions.pod:1583
19873 msgid "inotify-files"
19877 #: ../fish/guestfish-actions.pod:1585
19885 #: ../fish/guestfish-actions.pod:1587
19887 "This function is a helpful wrapper around L</inotify-read> which just "
19888 "returns a list of pathnames of objects that were touched. The returned "
19889 "pathnames are sorted and deduplicated."
19893 #: ../fish/guestfish-actions.pod:1591
19894 msgid "inotify-init"
19898 #: ../fish/guestfish-actions.pod:1593
19901 " inotify-init maxevents\n"
19906 #: ../fish/guestfish-actions.pod:1599
19908 "C<maxevents> is the maximum number of events which will be queued up between "
19909 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
19910 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
19911 "default was 16384 events. Beyond this limit, the kernel throws away events, "
19912 "but records the fact that it threw them away by setting a flag "
19913 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
19917 #: ../fish/guestfish-actions.pod:1609
19919 "Before any events are generated, you have to add some watches to the "
19920 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
19921 "L</inotify-watch-all>."
19925 #: ../fish/guestfish-actions.pod:1615
19927 "Queued up events should be read periodically by calling L</inotify-read> (or "
19928 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
19929 "If you don't read the events out often enough then you risk the internal "
19930 "queue overflowing."
19934 #: ../fish/guestfish-actions.pod:1622
19936 "The handle should be closed after use by calling L</inotify-close>. This "
19937 "also removes any watches automatically."
19941 #: ../fish/guestfish-actions.pod:1631
19942 msgid "inotify-read"
19946 #: ../fish/guestfish-actions.pod:1633
19954 #: ../fish/guestfish-actions.pod:1646
19955 msgid "inotify-rm-watch"
19959 #: ../fish/guestfish-actions.pod:1648
19962 " inotify-rm-watch wd\n"
19967 #: ../fish/guestfish-actions.pod:1650
19968 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
19972 #: ../fish/guestfish-actions.pod:1653
19973 msgid "inspect-get-arch"
19977 #: ../fish/guestfish-actions.pod:1655
19980 " inspect-get-arch root\n"
19985 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673 ../fish/guestfish-actions.pod:1739 ../fish/guestfish-actions.pod:1757 ../fish/guestfish-actions.pod:1778 ../fish/guestfish-actions.pod:1793 ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1846 ../fish/guestfish-actions.pod:1877
19987 "This function should only be called with a root device string as returned by "
19992 #: ../fish/guestfish-actions.pod:1660
19994 "This returns the architecture of the inspected operating system. The "
19995 "possible return values are listed under L</file-architecture>."
19999 #: ../fish/guestfish-actions.pod:1669
20000 msgid "inspect-get-distro"
20004 #: ../fish/guestfish-actions.pod:1671
20007 " inspect-get-distro root\n"
20012 #: ../fish/guestfish-actions.pod:1735
20013 msgid "inspect-get-filesystems"
20017 #: ../fish/guestfish-actions.pod:1737
20020 " inspect-get-filesystems root\n"
20025 #: ../fish/guestfish-actions.pod:1750
20027 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
20028 "L</inspect-get-mountpoints>."
20032 #: ../fish/guestfish-actions.pod:1753
20033 msgid "inspect-get-major-version"
20037 #: ../fish/guestfish-actions.pod:1755
20040 " inspect-get-major-version root\n"
20045 #: ../fish/guestfish-actions.pod:1774
20046 msgid "inspect-get-minor-version"
20050 #: ../fish/guestfish-actions.pod:1776
20053 " inspect-get-minor-version root\n"
20058 #: ../fish/guestfish-actions.pod:1786
20060 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
20061 "L</inspect-get-major-version>."
20065 #: ../fish/guestfish-actions.pod:1789
20066 msgid "inspect-get-mountpoints"
20070 #: ../fish/guestfish-actions.pod:1791
20073 " inspect-get-mountpoints root\n"
20078 #: ../fish/guestfish-actions.pod:1809
20080 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
20081 "L</inspect-get-filesystems>."
20085 #: ../fish/guestfish-actions.pod:1812
20086 msgid "inspect-get-product-name"
20090 #: ../fish/guestfish-actions.pod:1814
20093 " inspect-get-product-name root\n"
20098 #: ../fish/guestfish-actions.pod:1829
20099 msgid "inspect-get-roots"
20103 #: ../fish/guestfish-actions.pod:1831
20106 " inspect-get-roots\n"
20111 #: ../fish/guestfish-actions.pod:1833
20113 "This function is a convenient way to get the list of root devices, as "
20114 "returned from a previous call to L</inspect-os>, but without redoing the "
20115 "whole inspection process."
20119 #: ../fish/guestfish-actions.pod:1837
20121 "This returns an empty list if either no root devices were found or the "
20122 "caller has not called L</inspect-os>."
20126 #: ../fish/guestfish-actions.pod:1842
20127 msgid "inspect-get-type"
20131 #: ../fish/guestfish-actions.pod:1844
20134 " inspect-get-type root\n"
20139 #: ../fish/guestfish-actions.pod:1873
20140 msgid "inspect-get-windows-systemroot"
20144 #: ../fish/guestfish-actions.pod:1875
20147 " inspect-get-windows-systemroot root\n"
20152 #: ../fish/guestfish-actions.pod:1889
20157 #: ../fish/guestfish-actions.pod:1891
20165 #: ../fish/guestfish-actions.pod:1906
20167 "You can pass the root string(s) returned to other L</inspect-get-*> "
20168 "functions in order to query further information about each operating system, "
20169 "such as the name and version."
20173 #: ../fish/guestfish-actions.pod:1911
20175 "This function uses other libguestfs features such as L</mount-ro> and "
20176 "L</umount-all> in order to mount and unmount filesystems and look at the "
20177 "contents. This should be called with no disks currently mounted. The "
20178 "function may also use Augeas, so any existing Augeas handle will be closed."
20182 #: ../fish/guestfish-actions.pod:1923 ../fish/guestfish-actions.pod:2079 ../fish/guestfish-actions.pod:2125
20183 msgid "See also L</list-filesystems>."
20187 #: ../fish/guestfish-actions.pod:1925
20188 msgid "is-blockdev"
20192 #: ../fish/guestfish-actions.pod:1927
20195 " is-blockdev path\n"
20200 #: ../fish/guestfish-actions.pod:1932 ../fish/guestfish-actions.pod:1950 ../fish/guestfish-actions.pod:1969 ../fish/guestfish-actions.pod:1978 ../fish/guestfish-actions.pod:1988 ../fish/guestfish-actions.pod:2022 ../fish/guestfish-actions.pod:2031
20201 msgid "See also L</stat>."
20205 #: ../fish/guestfish-actions.pod:1934
20210 #: ../fish/guestfish-actions.pod:1936
20218 #: ../fish/guestfish-actions.pod:1943
20223 #: ../fish/guestfish-actions.pod:1945
20226 " is-chardev path\n"
20231 #: ../fish/guestfish-actions.pod:1952
20236 #: ../fish/guestfish-actions.pod:1954
20244 #: ../fish/guestfish-actions.pod:1961
20249 #: ../fish/guestfish-actions.pod:1963
20257 #: ../fish/guestfish-actions.pod:1971
20262 #: ../fish/guestfish-actions.pod:1973
20270 #: ../fish/guestfish-actions.pod:1980
20275 #: ../fish/guestfish-actions.pod:1982
20283 #: ../fish/guestfish-actions.pod:1990
20284 msgid "is-launching"
20288 #: ../fish/guestfish-actions.pod:1992
20296 #: ../fish/guestfish-actions.pod:1999
20301 #: ../fish/guestfish-actions.pod:2001
20309 #: ../fish/guestfish-actions.pod:2006
20314 #: ../fish/guestfish-actions.pod:2008
20322 #: ../fish/guestfish-actions.pod:2015
20327 #: ../fish/guestfish-actions.pod:2017
20330 " is-socket path\n"
20335 #: ../fish/guestfish-actions.pod:2024
20340 #: ../fish/guestfish-actions.pod:2026
20343 " is-symlink path\n"
20348 #: ../fish/guestfish-actions.pod:2033
20349 msgid "kill-subprocess"
20353 #: ../fish/guestfish-actions.pod:2035
20356 " kill-subprocess\n"
20361 #: ../fish/guestfish-actions.pod:2039
20366 #: ../fish/guestfish-actions.pod:2041
20371 #: ../fish/guestfish-actions.pod:2043
20379 #: ../fish/guestfish-actions.pod:2051
20384 #: ../fish/guestfish-actions.pod:2053
20387 " lchown owner group path\n"
20392 #: ../fish/guestfish-actions.pod:2055
20394 "Change the file owner to C<owner> and group to C<group>. This is like "
20395 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
20400 #: ../fish/guestfish-actions.pod:2063
20405 #: ../fish/guestfish-actions.pod:2065
20408 " lgetxattrs path\n"
20413 #: ../fish/guestfish-actions.pod:2067
20415 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
20416 "it returns the extended attributes of the link itself."
20420 #: ../fish/guestfish-actions.pod:2071
20421 msgid "list-devices"
20425 #: ../fish/guestfish-actions.pod:2073
20433 #: ../fish/guestfish-actions.pod:2081
20434 msgid "list-filesystems"
20438 #: ../fish/guestfish-actions.pod:2083
20441 " list-filesystems\n"
20446 #: ../fish/guestfish-actions.pod:2102
20448 "This command runs other libguestfs commands, which might include L</mount> "
20449 "and L</umount>, and therefore you should use this soon after launch and only "
20450 "when nothing is mounted."
20454 #: ../fish/guestfish-actions.pod:2106
20456 "Not all of the filesystems returned will be mountable. In particular, swap "
20457 "partitions are returned in the list. Also this command does not check that "
20458 "each filesystem found is valid and mountable, and some filesystems might be "
20459 "mountable but require special options. Filesystems may not all belong to a "
20460 "single logical operating system (use L</inspect-os> to look for OSes)."
20464 #: ../fish/guestfish-actions.pod:2114
20465 msgid "list-partitions"
20469 #: ../fish/guestfish-actions.pod:2116
20472 " list-partitions\n"
20477 #: ../fish/guestfish-actions.pod:2122
20479 "This does not return logical volumes. For that you will need to call "
20484 #: ../fish/guestfish-actions.pod:2127
20489 #: ../fish/guestfish-actions.pod:2129
20497 #: ../fish/guestfish-actions.pod:2137
20502 #: ../fish/guestfish-actions.pod:2139
20505 " ln target linkname\n"
20510 #: ../fish/guestfish-actions.pod:2143
20515 #: ../fish/guestfish-actions.pod:2145
20518 " ln-f target linkname\n"
20523 #: ../fish/guestfish-actions.pod:2150
20528 #: ../fish/guestfish-actions.pod:2152
20531 " ln-s target linkname\n"
20536 #: ../fish/guestfish-actions.pod:2156
20541 #: ../fish/guestfish-actions.pod:2158
20544 " ln-sf target linkname\n"
20549 #: ../fish/guestfish-actions.pod:2163
20550 msgid "lremovexattr"
20554 #: ../fish/guestfish-actions.pod:2165
20557 " lremovexattr xattr path\n"
20562 #: ../fish/guestfish-actions.pod:2167
20564 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
20565 "it removes an extended attribute of the link itself."
20569 #: ../fish/guestfish-actions.pod:2171
20574 #: ../fish/guestfish-actions.pod:2173
20582 #: ../fish/guestfish-actions.pod:2179
20584 "This command is mostly useful for interactive sessions. Programs should "
20585 "probably use L</readdir> instead."
20589 #: ../fish/guestfish-actions.pod:2182
20594 #: ../fish/guestfish-actions.pod:2184
20597 " lsetxattr xattr val vallen path\n"
20602 #: ../fish/guestfish-actions.pod:2186
20604 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
20605 "sets an extended attribute of the link itself."
20609 #: ../fish/guestfish-actions.pod:2190
20614 #: ../fish/guestfish-actions.pod:2192
20622 #: ../fish/guestfish-actions.pod:2196
20624 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
20625 "the link is stat-ed, not the file it refers to."
20629 #: ../fish/guestfish-actions.pod:2202
20634 #: ../fish/guestfish-actions.pod:2204
20637 " lstatlist path 'names ...'\n"
20642 #: ../fish/guestfish-actions.pod:2206
20644 "This call allows you to perform the L</lstat> operation on multiple files, "
20645 "where all files are in the directory C<path>. C<names> is the list of files "
20646 "from this directory."
20650 #: ../fish/guestfish-actions.pod:2215
20652 "This call is intended for programs that want to efficiently list a directory "
20653 "contents without making many round-trips. See also L</lxattrlist> for a "
20654 "similarly efficient call for getting extended attributes. Very long "
20655 "directory listings might cause the protocol message size to be exceeded, "
20656 "causing this call to fail. The caller must split up such requests into "
20657 "smaller groups of names."
20661 #: ../fish/guestfish-actions.pod:2223
20662 msgid "luks-add-key"
20666 #: ../fish/guestfish-actions.pod:2225
20669 " luks-add-key device keyslot\n"
20674 #: ../fish/guestfish-actions.pod:2232
20676 "Note that if C<keyslot> already contains a key, then this command will "
20677 "fail. You have to use L</luks-kill-slot> first to remove that key."
20681 #: ../fish/guestfish-actions.pod:2236 ../fish/guestfish-actions.pod:2258 ../fish/guestfish-actions.pod:2271 ../fish/guestfish-actions.pod:2285 ../fish/guestfish-actions.pod:2308 ../fish/guestfish-actions.pod:2318
20683 "This command has one or more key or passphrase parameters. Guestfish will "
20684 "prompt for these separately."
20688 #: ../fish/guestfish-actions.pod:2239
20693 #: ../fish/guestfish-actions.pod:2241
20696 " luks-close device\n"
20701 #: ../fish/guestfish-actions.pod:2243
20703 "This closes a LUKS device that was created earlier by L</luks-open> or "
20704 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
20705 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
20706 "underlying block device."
20710 #: ../fish/guestfish-actions.pod:2249
20711 msgid "luks-format"
20715 #: ../fish/guestfish-actions.pod:2251
20718 " luks-format device keyslot\n"
20723 #: ../fish/guestfish-actions.pod:2264
20724 msgid "luks-format-cipher"
20728 #: ../fish/guestfish-actions.pod:2266
20731 " luks-format-cipher device keyslot cipher\n"
20736 #: ../fish/guestfish-actions.pod:2268
20738 "This command is the same as L</luks-format> but it also allows you to set "
20739 "the C<cipher> used."
20743 #: ../fish/guestfish-actions.pod:2277
20744 msgid "luks-kill-slot"
20748 #: ../fish/guestfish-actions.pod:2279
20751 " luks-kill-slot device keyslot\n"
20756 #: ../fish/guestfish-actions.pod:2288
20761 #: ../fish/guestfish-actions.pod:2290
20764 " luks-open device mapname\n"
20769 #: ../fish/guestfish-actions.pod:2304
20771 "If this block device contains LVM volume groups, then calling L</vgscan> "
20772 "followed by L</vg-activate-all> will make them visible."
20776 #: ../fish/guestfish-actions.pod:2311
20777 msgid "luks-open-ro"
20781 #: ../fish/guestfish-actions.pod:2313
20784 " luks-open-ro device mapname\n"
20789 #: ../fish/guestfish-actions.pod:2315
20791 "This is the same as L</luks-open> except that a read-only mapping is "
20796 #: ../fish/guestfish-actions.pod:2321
20801 #: ../fish/guestfish-actions.pod:2323
20804 " lvcreate logvol volgroup mbytes\n"
20809 #: ../fish/guestfish-actions.pod:2328
20810 msgid "lvm-canonical-lv-name"
20814 #: ../fish/guestfish-actions.pod:2330
20817 " lvm-canonical-lv-name lvname\n"
20822 #: ../fish/guestfish-actions.pod:2339
20823 msgid "See also L</is-lv>."
20827 #: ../fish/guestfish-actions.pod:2341
20828 msgid "lvm-clear-filter"
20832 #: ../fish/guestfish-actions.pod:2343
20835 " lvm-clear-filter\n"
20840 #: ../fish/guestfish-actions.pod:2345
20842 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
20847 #: ../fish/guestfish-actions.pod:2351
20848 msgid "lvm-remove-all"
20852 #: ../fish/guestfish-actions.pod:2353
20855 " lvm-remove-all\n"
20860 #: ../fish/guestfish-actions.pod:2361
20861 msgid "lvm-set-filter"
20865 #: ../fish/guestfish-actions.pod:2363
20868 " lvm-set-filter 'devices ...'\n"
20873 #: ../fish/guestfish-actions.pod:2388
20878 #: ../fish/guestfish-actions.pod:2390
20881 " lvremove device\n"
20886 #: ../fish/guestfish-actions.pod:2398
20891 #: ../fish/guestfish-actions.pod:2400
20894 " lvrename logvol newlogvol\n"
20899 #: ../fish/guestfish-actions.pod:2404
20904 #: ../fish/guestfish-actions.pod:2406
20907 " lvresize device mbytes\n"
20912 #: ../fish/guestfish-actions.pod:2412
20913 msgid "lvresize-free"
20917 #: ../fish/guestfish-actions.pod:2414
20920 " lvresize-free lv percent\n"
20925 #: ../fish/guestfish-actions.pod:2422
20930 #: ../fish/guestfish-actions.pod:2424
20938 #: ../fish/guestfish-actions.pod:2432
20939 msgid "See also L</lvs-full>, L</list-filesystems>."
20943 #: ../fish/guestfish-actions.pod:2434
20948 #: ../fish/guestfish-actions.pod:2436
20956 #: ../fish/guestfish-actions.pod:2441
20961 #: ../fish/guestfish-actions.pod:2443
20969 #: ../fish/guestfish-actions.pod:2447
20974 #: ../fish/guestfish-actions.pod:2449
20977 " lxattrlist path 'names ...'\n"
20982 #: ../fish/guestfish-actions.pod:2465
20984 "This call is intended for programs that want to efficiently list a directory "
20985 "contents without making many round-trips. See also L</lstatlist> for a "
20986 "similarly efficient call for getting standard stats. Very long directory "
20987 "listings might cause the protocol message size to be exceeded, causing this "
20988 "call to fail. The caller must split up such requests into smaller groups of "
20993 #: ../fish/guestfish-actions.pod:2473
20998 #: ../fish/guestfish-actions.pod:2475
21006 #: ../fish/guestfish-actions.pod:2479
21011 #: ../fish/guestfish-actions.pod:2481
21014 " mkdir-mode path mode\n"
21019 #: ../fish/guestfish-actions.pod:2490
21020 msgid "See also L</mkdir>, L</umask>"
21024 #: ../fish/guestfish-actions.pod:2492
21029 #: ../fish/guestfish-actions.pod:2494
21037 #: ../fish/guestfish-actions.pod:2499
21042 #: ../fish/guestfish-actions.pod:2501
21045 " mkdtemp template\n"
21050 #: ../fish/guestfish-actions.pod:2522
21055 #: ../fish/guestfish-actions.pod:2524
21058 " mke2fs-J fstype blocksize device journal\n"
21063 #: ../fish/guestfish-actions.pod:2532
21064 msgid "See also L</mke2journal>."
21068 #: ../fish/guestfish-actions.pod:2534
21073 #: ../fish/guestfish-actions.pod:2536
21076 " mke2fs-JL fstype blocksize device label\n"
21081 #: ../fish/guestfish-actions.pod:2541
21082 msgid "See also L</mke2journal-L>."
21086 #: ../fish/guestfish-actions.pod:2543
21091 #: ../fish/guestfish-actions.pod:2545
21094 " mke2fs-JU fstype blocksize device uuid\n"
21099 #: ../fish/guestfish-actions.pod:2550
21100 msgid "See also L</mke2journal-U>."
21104 #: ../fish/guestfish-actions.pod:2552
21105 msgid "mke2journal"
21109 #: ../fish/guestfish-actions.pod:2554
21112 " mke2journal blocksize device\n"
21117 #: ../fish/guestfish-actions.pod:2561
21118 msgid "mke2journal-L"
21122 #: ../fish/guestfish-actions.pod:2563
21125 " mke2journal-L blocksize label device\n"
21130 #: ../fish/guestfish-actions.pod:2567
21131 msgid "mke2journal-U"
21135 #: ../fish/guestfish-actions.pod:2569
21138 " mke2journal-U blocksize uuid device\n"
21143 #: ../fish/guestfish-actions.pod:2573
21148 #: ../fish/guestfish-actions.pod:2575
21151 " mkfifo mode path\n"
21156 #: ../fish/guestfish-actions.pod:2577
21158 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
21159 "is just a convenient wrapper around L</mknod>."
21163 #: ../fish/guestfish-actions.pod:2583
21168 #: ../fish/guestfish-actions.pod:2585
21171 " mkfs fstype device\n"
21176 #: ../fish/guestfish-actions.pod:2591
21181 #: ../fish/guestfish-actions.pod:2593
21184 " mkfs-b fstype blocksize device\n"
21189 #: ../fish/guestfish-actions.pod:2595
21191 "This call is similar to L</mkfs>, but it allows you to control the block "
21192 "size of the resulting filesystem. Supported block sizes depend on the "
21193 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
21197 #: ../fish/guestfish-actions.pod:2603
21198 msgid "mkmountpoint"
21202 #: ../fish/guestfish-actions.pod:2605
21205 " mkmountpoint exemptpath\n"
21210 #: ../fish/guestfish-actions.pod:2607
21212 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
21213 "to create extra mountpoints before mounting the first filesystem."
21217 #: ../fish/guestfish-actions.pod:2631
21219 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
21220 "unexpected errors if you try to mix these calls. It is safest to manually "
21221 "unmount filesystems and remove mountpoints after use."
21225 #: ../fish/guestfish-actions.pod:2635
21227 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
21228 "for this to work for manual mountpoints, you must ensure that the innermost "
21229 "mountpoints have the longest pathnames, as in the example code above."
21233 #: ../fish/guestfish-actions.pod:2642
21235 "Autosync [see L</set-autosync>, this is set by default on handles] means "
21236 "that L</umount-all> is called when the handle is closed which can also "
21237 "trigger these issues."
21241 #: ../fish/guestfish-actions.pod:2646
21246 #: ../fish/guestfish-actions.pod:2648
21249 " mknod mode devmajor devminor path\n"
21254 #: ../fish/guestfish-actions.pod:2658
21256 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
21257 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
21258 "regular file). These constants are available in the standard Linux header "
21259 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
21260 "wrappers around this command which bitwise OR in the appropriate constant "
21265 #: ../fish/guestfish-actions.pod:2668
21270 #: ../fish/guestfish-actions.pod:2670
21273 " mknod-b mode devmajor devminor path\n"
21278 #: ../fish/guestfish-actions.pod:2672
21280 "This call creates a block device node called C<path> with mode C<mode> and "
21281 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
21282 "wrapper around L</mknod>."
21286 #: ../fish/guestfish-actions.pod:2678
21291 #: ../fish/guestfish-actions.pod:2680
21294 " mknod-c mode devmajor devminor path\n"
21299 #: ../fish/guestfish-actions.pod:2682
21301 "This call creates a char device node called C<path> with mode C<mode> and "
21302 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
21303 "wrapper around L</mknod>."
21307 #: ../fish/guestfish-actions.pod:2688
21312 #: ../fish/guestfish-actions.pod:2690
21320 #: ../fish/guestfish-actions.pod:2694
21325 #: ../fish/guestfish-actions.pod:2696
21328 " mkswap-L label device\n"
21333 #: ../fish/guestfish-actions.pod:2704
21338 #: ../fish/guestfish-actions.pod:2706
21341 " mkswap-U uuid device\n"
21346 #: ../fish/guestfish-actions.pod:2710
21347 msgid "mkswap-file"
21351 #: ../fish/guestfish-actions.pod:2712
21354 " mkswap-file path\n"
21359 #: ../fish/guestfish-actions.pod:2716
21361 "This command just writes a swap file signature to an existing file. To "
21362 "create the file itself, use something like L</fallocate>."
21366 #: ../fish/guestfish-actions.pod:2719
21371 #: ../fish/guestfish-actions.pod:2721
21374 " modprobe modulename\n"
21379 #: ../fish/guestfish-actions.pod:2728
21384 #: ../fish/guestfish-actions.pod:2730
21387 " mount device mountpoint\n"
21392 #: ../fish/guestfish-actions.pod:2746
21394 "B<Important note:> When you use this call, the filesystem options C<sync> "
21395 "and C<noatime> are set implicitly. This was originally done because we "
21396 "thought it would improve reliability, but it turns out that I<-o sync> has a "
21397 "very large negative performance impact and negligible effect on "
21398 "reliability. Therefore we recommend that you avoid using L</mount> in any "
21399 "code that needs performance, and instead use L</mount-options> (use an empty "
21400 "string for the first parameter if you don't want any options)."
21404 #: ../fish/guestfish-actions.pod:2756
21409 #: ../fish/guestfish-actions.pod:2758
21412 " mount-loop file mountpoint\n"
21417 #: ../fish/guestfish-actions.pod:2764
21418 msgid "mount-options"
21422 #: ../fish/guestfish-actions.pod:2766
21425 " mount-options options device mountpoint\n"
21430 #: ../fish/guestfish-actions.pod:2768
21432 "This is the same as the L</mount> command, but it allows you to set the "
21433 "mount options as for the L<mount(8)> I<-o> flag."
21437 #: ../fish/guestfish-actions.pod:2776
21442 #: ../fish/guestfish-actions.pod:2778
21445 " mount-ro device mountpoint\n"
21450 #: ../fish/guestfish-actions.pod:2780
21452 "This is the same as the L</mount> command, but it mounts the filesystem with "
21453 "the read-only (I<-o ro>) flag."
21457 #: ../fish/guestfish-actions.pod:2783
21462 #: ../fish/guestfish-actions.pod:2785
21465 " mount-vfs options vfstype device mountpoint\n"
21470 #: ../fish/guestfish-actions.pod:2787
21472 "This is the same as the L</mount> command, but it allows you to set both the "
21473 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
21477 #: ../fish/guestfish-actions.pod:2791
21478 msgid "mountpoints"
21482 #: ../fish/guestfish-actions.pod:2793
21490 #: ../fish/guestfish-actions.pod:2795
21492 "This call is similar to L</mounts>. That call returns a list of devices. "
21493 "This one returns a hash table (map) of device name to directory where the "
21494 "device is mounted."
21498 #: ../fish/guestfish-actions.pod:2799
21503 #: ../fish/guestfish-actions.pod:2801
21511 #: ../fish/guestfish-actions.pod:2808
21512 msgid "See also: L</mountpoints>"
21516 #: ../fish/guestfish-actions.pod:2810
21521 #: ../fish/guestfish-actions.pod:2812
21529 #: ../fish/guestfish-actions.pod:2817
21530 msgid "ntfs-3g-probe"
21534 #: ../fish/guestfish-actions.pod:2819
21537 " ntfs-3g-probe true|false device\n"
21542 #: ../fish/guestfish-actions.pod:2833
21547 #: ../fish/guestfish-actions.pod:2835
21550 " ntfsresize device\n"
21555 #: ../fish/guestfish-actions.pod:2841
21556 msgid "ntfsresize-size"
21560 #: ../fish/guestfish-actions.pod:2843
21563 " ntfsresize-size device size\n"
21568 #: ../fish/guestfish-actions.pod:2845
21570 "This command is the same as L</ntfsresize> except that it allows you to "
21571 "specify the new size (in bytes) explicitly."
21575 #: ../fish/guestfish-actions.pod:2848
21580 #: ../fish/guestfish-actions.pod:2850
21583 " part-add device prlogex startsect endsect\n"
21588 #: ../fish/guestfish-actions.pod:2852
21590 "This command adds a partition to C<device>. If there is no partition table "
21591 "on the device, call L</part-init> first."
21595 #: ../fish/guestfish-actions.pod:2864
21597 "Creating a partition which covers the whole disk is not so easy. Use "
21598 "L</part-disk> to do that."
21602 #: ../fish/guestfish-actions.pod:2867
21607 #: ../fish/guestfish-actions.pod:2869
21610 " part-del device partnum\n"
21615 #: ../fish/guestfish-actions.pod:2877
21620 #: ../fish/guestfish-actions.pod:2879
21623 " part-disk device parttype\n"
21628 #: ../fish/guestfish-actions.pod:2881
21630 "This command is simply a combination of L</part-init> followed by "
21631 "L</part-add> to create a single primary partition covering the whole disk."
21635 #: ../fish/guestfish-actions.pod:2885
21637 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
21638 "possible values are described in L</part-init>."
21642 #: ../fish/guestfish-actions.pod:2891
21643 msgid "part-get-bootable"
21647 #: ../fish/guestfish-actions.pod:2893
21650 " part-get-bootable device partnum\n"
21655 #: ../fish/guestfish-actions.pod:2898
21656 msgid "See also L</part-set-bootable>."
21660 #: ../fish/guestfish-actions.pod:2900
21661 msgid "part-get-mbr-id"
21665 #: ../fish/guestfish-actions.pod:2902
21668 " part-get-mbr-id device partnum\n"
21673 #: ../fish/guestfish-actions.pod:2907 ../fish/guestfish-actions.pod:3045
21675 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
21676 "undefined results for other partition table types (see "
21677 "L</part-get-parttype>)."
21681 #: ../fish/guestfish-actions.pod:2911
21682 msgid "part-get-parttype"
21686 #: ../fish/guestfish-actions.pod:2913
21689 " part-get-parttype device\n"
21694 #: ../fish/guestfish-actions.pod:2918
21696 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
21697 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
21698 "possible, although unusual. See L</part-init> for a full list."
21702 #: ../fish/guestfish-actions.pod:2923
21707 #: ../fish/guestfish-actions.pod:2925
21710 " part-init device parttype\n"
21715 #: ../fish/guestfish-actions.pod:2931
21717 "Initially there are no partitions. Following this, you should call "
21718 "L</part-add> for each partition required."
21722 #: ../fish/guestfish-actions.pod:2994
21727 #: ../fish/guestfish-actions.pod:2996
21730 " part-list device\n"
21735 #: ../fish/guestfish-actions.pod:3011
21737 "Start of the partition I<in bytes>. To get sectors you have to divide by "
21738 "the device's sector size, see L</blockdev-getss>."
21742 #: ../fish/guestfish-actions.pod:3024
21743 msgid "part-set-bootable"
21747 #: ../fish/guestfish-actions.pod:3026
21750 " part-set-bootable device partnum true|false\n"
21755 #: ../fish/guestfish-actions.pod:3035
21756 msgid "part-set-mbr-id"
21760 #: ../fish/guestfish-actions.pod:3037
21763 " part-set-mbr-id device partnum idbyte\n"
21768 #: ../fish/guestfish-actions.pod:3049
21769 msgid "part-set-name"
21773 #: ../fish/guestfish-actions.pod:3051
21776 " part-set-name device partnum name\n"
21781 #: ../fish/guestfish-actions.pod:3059
21782 msgid "part-to-dev"
21786 #: ../fish/guestfish-actions.pod:3061
21789 " part-to-dev partition\n"
21794 #: ../fish/guestfish-actions.pod:3067
21796 "The named partition must exist, for example as a string returned from "
21797 "L</list-partitions>."
21801 #: ../fish/guestfish-actions.pod:3070
21802 msgid "ping-daemon"
21806 #: ../fish/guestfish-actions.pod:3072
21814 #: ../fish/guestfish-actions.pod:3079
21819 #: ../fish/guestfish-actions.pod:3081
21822 " pread path count offset\n"
21827 #: ../fish/guestfish-actions.pod:3089
21828 msgid "See also L</pwrite>, L</pread-device>."
21832 #: ../fish/guestfish-actions.pod:3094
21833 msgid "pread-device"
21837 #: ../fish/guestfish-actions.pod:3096
21840 " pread-device device count offset\n"
21845 #: ../fish/guestfish-actions.pod:3104
21846 msgid "See also L</pread>."
21850 #: ../fish/guestfish-actions.pod:3109
21855 #: ../fish/guestfish-actions.pod:3111
21858 " pvcreate device\n"
21863 #: ../fish/guestfish-actions.pod:3117
21868 #: ../fish/guestfish-actions.pod:3119
21871 " pvremove device\n"
21876 #: ../fish/guestfish-actions.pod:3128
21881 #: ../fish/guestfish-actions.pod:3130
21884 " pvresize device\n"
21889 #: ../fish/guestfish-actions.pod:3135
21890 msgid "pvresize-size"
21894 #: ../fish/guestfish-actions.pod:3137
21897 " pvresize-size device size\n"
21902 #: ../fish/guestfish-actions.pod:3139
21904 "This command is the same as L</pvresize> except that it allows you to "
21905 "specify the new size (in bytes) explicitly."
21909 #: ../fish/guestfish-actions.pod:3142
21914 #: ../fish/guestfish-actions.pod:3144
21922 #: ../fish/guestfish-actions.pod:3152
21923 msgid "See also L</pvs-full>."
21927 #: ../fish/guestfish-actions.pod:3154
21932 #: ../fish/guestfish-actions.pod:3156
21940 #: ../fish/guestfish-actions.pod:3161
21945 #: ../fish/guestfish-actions.pod:3163
21953 #: ../fish/guestfish-actions.pod:3167
21958 #: ../fish/guestfish-actions.pod:3169
21961 " pwrite path content offset\n"
21966 #: ../fish/guestfish-actions.pod:3180
21967 msgid "See also L</pread>, L</pwrite-device>."
21971 #: ../fish/guestfish-actions.pod:3185
21972 msgid "pwrite-device"
21976 #: ../fish/guestfish-actions.pod:3187
21979 " pwrite-device device content offset\n"
21984 #: ../fish/guestfish-actions.pod:3197
21985 msgid "See also L</pwrite>."
21989 #: ../fish/guestfish-actions.pod:3202
21994 #: ../fish/guestfish-actions.pod:3204
21997 " read-file path\n"
22002 #: ../fish/guestfish-actions.pod:3209
22004 "Unlike L</cat>, this function can correctly handle files that contain "
22005 "embedded ASCII NUL characters. However unlike L</download>, this function "
22006 "is limited in the total size of file that can be handled."
22010 #: ../fish/guestfish-actions.pod:3217
22015 #: ../fish/guestfish-actions.pod:3219
22018 " read-lines path\n"
22023 #: ../fish/guestfish-actions.pod:3226
22025 "Note that this function cannot correctly handle binary files (specifically, "
22026 "files containing C<\\0> character which is treated as end of line). For "
22027 "those you need to use the L</read-file> function which has a more complex "
22032 #: ../fish/guestfish-actions.pod:3231
22037 #: ../fish/guestfish-actions.pod:3233
22045 #: ../fish/guestfish-actions.pod:3285
22047 "This function is primarily intended for use by programs. To get a simple "
22048 "list of names, use L</ls>. To get a printable directory for human "
22049 "consumption, use L</ll>."
22053 #: ../fish/guestfish-actions.pod:3289
22058 #: ../fish/guestfish-actions.pod:3291
22066 #: ../fish/guestfish-actions.pod:3295
22067 msgid "readlinklist"
22071 #: ../fish/guestfish-actions.pod:3297
22074 " readlinklist path 'names ...'\n"
22079 #: ../fish/guestfish-actions.pod:3321
22084 #: ../fish/guestfish-actions.pod:3323
22092 #: ../fish/guestfish-actions.pod:3328
22093 msgid "removexattr"
22097 #: ../fish/guestfish-actions.pod:3330
22100 " removexattr xattr path\n"
22105 #: ../fish/guestfish-actions.pod:3335
22106 msgid "See also: L</lremovexattr>, L<attr(5)>."
22110 #: ../fish/guestfish-actions.pod:3337
22115 #: ../fish/guestfish-actions.pod:3339
22118 " resize2fs device\n"
22123 #: ../fish/guestfish-actions.pod:3344
22125 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
22126 "before calling this command. For unknown reasons C<resize2fs> sometimes "
22127 "gives an error about this and sometimes not. In any case, it is always safe "
22128 "to call L</e2fsck-f> before calling this function."
22132 #: ../fish/guestfish-actions.pod:3350
22133 msgid "resize2fs-size"
22137 #: ../fish/guestfish-actions.pod:3352
22140 " resize2fs-size device size\n"
22145 #: ../fish/guestfish-actions.pod:3354
22147 "This command is the same as L</resize2fs> except that it allows you to "
22148 "specify the new size (in bytes) explicitly."
22152 #: ../fish/guestfish-actions.pod:3357
22157 #: ../fish/guestfish-actions.pod:3359
22165 #: ../fish/guestfish-actions.pod:3363
22170 #: ../fish/guestfish-actions.pod:3365
22178 #: ../fish/guestfish-actions.pod:3371
22183 #: ../fish/guestfish-actions.pod:3373
22191 #: ../fish/guestfish-actions.pod:3377
22192 msgid "rmmountpoint"
22196 #: ../fish/guestfish-actions.pod:3379
22199 " rmmountpoint exemptpath\n"
22204 #: ../fish/guestfish-actions.pod:3381
22206 "This calls removes a mountpoint that was previously created with "
22207 "L</mkmountpoint>. See L</mkmountpoint> for full details."
22211 #: ../fish/guestfish-actions.pod:3385
22212 msgid "scrub-device"
22216 #: ../fish/guestfish-actions.pod:3387
22219 " scrub-device device\n"
22224 #: ../fish/guestfish-actions.pod:3398
22229 #: ../fish/guestfish-actions.pod:3400
22232 " scrub-file file\n"
22237 #: ../fish/guestfish-actions.pod:3410
22238 msgid "scrub-freespace"
22242 #: ../fish/guestfish-actions.pod:3412
22245 " scrub-freespace dir\n"
22250 #: ../fish/guestfish-actions.pod:3414
22252 "This command creates the directory C<dir> and then fills it with files until "
22253 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
22254 "deletes them. The intention is to scrub any free space on the partition "
22255 "containing C<dir>."
22259 #: ../fish/guestfish-actions.pod:3423
22264 #: ../fish/guestfish-actions.pod:3425
22269 #: ../fish/guestfish-actions.pod:3427
22272 " set-append append\n"
22277 #: ../fish/guestfish-actions.pod:3438
22278 msgid "set-autosync"
22282 #: ../fish/guestfish-actions.pod:3440
22287 #: ../fish/guestfish-actions.pod:3442
22290 " set-autosync true|false\n"
22295 #: ../fish/guestfish-actions.pod:3444
22297 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
22298 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
22299 "closed (also if the program exits without closing handles)."
22303 #: ../fish/guestfish-actions.pod:3452
22308 #: ../fish/guestfish-actions.pod:3454
22313 #: ../fish/guestfish-actions.pod:3456
22316 " set-direct true|false\n"
22321 #: ../fish/guestfish-actions.pod:3462
22323 "One consequence of this is that log messages aren't caught by the library "
22324 "and handled by L</set-log-message-callback>, but go straight to stdout."
22328 #: ../fish/guestfish-actions.pod:3471
22329 msgid "set-e2label"
22333 #: ../fish/guestfish-actions.pod:3473
22336 " set-e2label device label\n"
22341 #: ../fish/guestfish-actions.pod:3479
22343 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
22344 "label on a filesystem."
22348 #: ../fish/guestfish-actions.pod:3482
22353 #: ../fish/guestfish-actions.pod:3484
22356 " set-e2uuid device uuid\n"
22361 #: ../fish/guestfish-actions.pod:3491
22363 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
22364 "UUID of a filesystem."
22368 #: ../fish/guestfish-actions.pod:3494
22369 msgid "set-memsize"
22373 #: ../fish/guestfish-actions.pod:3496
22378 #: ../fish/guestfish-actions.pod:3498
22381 " set-memsize memsize\n"
22386 #: ../fish/guestfish-actions.pod:3500
22388 "This sets the memory size in megabytes allocated to the qemu subprocess. "
22389 "This only has any effect if called before L</launch>."
22393 #: ../fish/guestfish-actions.pod:3511
22394 msgid "set-network"
22398 #: ../fish/guestfish-actions.pod:3513
22403 #: ../fish/guestfish-actions.pod:3515
22406 " set-network true|false\n"
22411 #: ../fish/guestfish-actions.pod:3523
22412 msgid "You must call this before calling L</launch>, otherwise it has no effect."
22416 #: ../fish/guestfish-actions.pod:3526
22421 #: ../fish/guestfish-actions.pod:3528
22426 #: ../fish/guestfish-actions.pod:3530
22429 " set-path searchpath\n"
22434 #: ../fish/guestfish-actions.pod:3539
22439 #: ../fish/guestfish-actions.pod:3541
22444 #: ../fish/guestfish-actions.pod:3543
22452 #: ../fish/guestfish-actions.pod:3563
22453 msgid "set-recovery-proc"
22457 #: ../fish/guestfish-actions.pod:3565
22458 msgid "recovery-proc"
22462 #: ../fish/guestfish-actions.pod:3567
22465 " set-recovery-proc true|false\n"
22470 #: ../fish/guestfish-actions.pod:3569
22472 "If this is called with the parameter C<false> then L</launch> does not "
22473 "create a recovery process. The purpose of the recovery process is to stop "
22474 "runaway qemu processes in the case where the main program aborts abruptly."
22478 #: ../fish/guestfish-actions.pod:3574
22480 "This only has any effect if called before L</launch>, and the default is "
22485 #: ../fish/guestfish-actions.pod:3583
22486 msgid "set-selinux"
22490 #: ../fish/guestfish-actions.pod:3585
22495 #: ../fish/guestfish-actions.pod:3587
22498 " set-selinux true|false\n"
22503 #: ../fish/guestfish-actions.pod:3598
22508 #: ../fish/guestfish-actions.pod:3600
22513 #: ../fish/guestfish-actions.pod:3602
22516 " set-trace true|false\n"
22521 #: ../fish/guestfish-actions.pod:3618
22522 msgid "set-verbose"
22526 #: ../fish/guestfish-actions.pod:3620
22531 #: ../fish/guestfish-actions.pod:3622
22534 " set-verbose true|false\n"
22539 #: ../fish/guestfish-actions.pod:3629
22544 #: ../fish/guestfish-actions.pod:3631
22547 " setcon context\n"
22552 #: ../fish/guestfish-actions.pod:3638
22557 #: ../fish/guestfish-actions.pod:3640
22560 " setxattr xattr val vallen path\n"
22565 #: ../fish/guestfish-actions.pod:3646
22566 msgid "See also: L</lsetxattr>, L<attr(5)>."
22570 #: ../fish/guestfish-actions.pod:3648
22575 #: ../fish/guestfish-actions.pod:3650
22578 " sfdisk device cyls heads sectors 'lines ...'\n"
22583 #: ../fish/guestfish-actions.pod:3672
22584 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
22588 #: ../fish/guestfish-actions.pod:3678
22593 #: ../fish/guestfish-actions.pod:3680
22596 " sfdiskM device 'lines ...'\n"
22601 #: ../fish/guestfish-actions.pod:3682
22603 "This is a simplified interface to the L</sfdisk> command, where partition "
22604 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
22605 "you don't need to specify the cyls, heads and sectors parameters which were "
22606 "rarely if ever used anyway."
22610 #: ../fish/guestfish-actions.pod:3688
22611 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
22615 #: ../fish/guestfish-actions.pod:3694
22620 #: ../fish/guestfish-actions.pod:3696
22623 " sfdisk-N device partnum cyls heads sectors line\n"
22628 #: ../fish/guestfish-actions.pod:3701
22630 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
22631 "cyls/heads/sectors parameters."
22635 #: ../fish/guestfish-actions.pod:3704
22636 msgid "See also: L</part-add>"
22640 #: ../fish/guestfish-actions.pod:3709
22641 msgid "sfdisk-disk-geometry"
22645 #: ../fish/guestfish-actions.pod:3711
22648 " sfdisk-disk-geometry device\n"
22653 #: ../fish/guestfish-actions.pod:3713
22655 "This displays the disk geometry of C<device> read from the partition table. "
22656 "Especially in the case where the underlying block device has been resized, "
22657 "this can be different from the kernel's idea of the geometry (see "
22658 "L</sfdisk-kernel-geometry>)."
22662 #: ../fish/guestfish-actions.pod:3721
22663 msgid "sfdisk-kernel-geometry"
22667 #: ../fish/guestfish-actions.pod:3723
22670 " sfdisk-kernel-geometry device\n"
22675 #: ../fish/guestfish-actions.pod:3730
22680 #: ../fish/guestfish-actions.pod:3732
22683 " sfdisk-l device\n"
22688 #: ../fish/guestfish-actions.pod:3738
22689 msgid "See also: L</part-list>"
22693 #: ../fish/guestfish-actions.pod:3740
22698 #: ../fish/guestfish-actions.pod:3742
22706 #: ../fish/guestfish-actions.pod:3747
22707 msgid "This is like L</command>, but passes the command to:"
22711 #: ../fish/guestfish-actions.pod:3755
22712 msgid "All the provisos about L</command> apply to this call."
22716 #: ../fish/guestfish-actions.pod:3757
22721 #: ../fish/guestfish-actions.pod:3759
22724 " sh-lines command\n"
22729 #: ../fish/guestfish-actions.pod:3761
22730 msgid "This is the same as L</sh>, but splits the result into a list of lines."
22734 #: ../fish/guestfish-actions.pod:3764
22735 msgid "See also: L</command-lines>"
22739 #: ../fish/guestfish-actions.pod:3766
22744 #: ../fish/guestfish-actions.pod:3768
22752 #: ../fish/guestfish-actions.pod:3772
22757 #: ../fish/guestfish-actions.pod:3774
22765 #: ../fish/guestfish-actions.pod:3780
22770 #: ../fish/guestfish-actions.pod:3782
22778 #: ../fish/guestfish-actions.pod:3790
22783 #: ../fish/guestfish-actions.pod:3792
22791 #: ../fish/guestfish-actions.pod:3800
22796 #: ../fish/guestfish-actions.pod:3802
22799 " strings-e encoding path\n"
22804 #: ../fish/guestfish-actions.pod:3804
22806 "This is like the L</strings> command, but allows you to specify the encoding "
22807 "of strings that are looked for in the source file C<path>."
22811 #: ../fish/guestfish-actions.pod:3814
22813 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
22814 "ISO-8859-X (this is what L</strings> uses)."
22818 #: ../fish/guestfish-actions.pod:3846
22819 msgid "swapoff-device"
22823 #: ../fish/guestfish-actions.pod:3848
22826 " swapoff-device device\n"
22831 #: ../fish/guestfish-actions.pod:3850
22833 "This command disables the libguestfs appliance swap device or partition "
22834 "named C<device>. See L</swapon-device>."
22838 #: ../fish/guestfish-actions.pod:3854
22839 msgid "swapoff-file"
22843 #: ../fish/guestfish-actions.pod:3856
22846 " swapoff-file file\n"
22851 #: ../fish/guestfish-actions.pod:3860
22852 msgid "swapoff-label"
22856 #: ../fish/guestfish-actions.pod:3862
22859 " swapoff-label label\n"
22864 #: ../fish/guestfish-actions.pod:3867
22865 msgid "swapoff-uuid"
22869 #: ../fish/guestfish-actions.pod:3869
22872 " swapoff-uuid uuid\n"
22877 #: ../fish/guestfish-actions.pod:3874
22878 msgid "swapon-device"
22882 #: ../fish/guestfish-actions.pod:3876
22885 " swapon-device device\n"
22890 #: ../fish/guestfish-actions.pod:3878
22892 "This command enables the libguestfs appliance to use the swap device or "
22893 "partition named C<device>. The increased memory is made available for all "
22894 "commands, for example those run using L</command> or L</sh>."
22898 #: ../fish/guestfish-actions.pod:3890
22899 msgid "swapon-file"
22903 #: ../fish/guestfish-actions.pod:3892
22906 " swapon-file file\n"
22911 #: ../fish/guestfish-actions.pod:3894
22912 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
22916 #: ../fish/guestfish-actions.pod:3897
22917 msgid "swapon-label"
22921 #: ../fish/guestfish-actions.pod:3899
22924 " swapon-label label\n"
22929 #: ../fish/guestfish-actions.pod:3901
22931 "This command enables swap to a labeled swap partition. See "
22932 "L</swapon-device> for other notes."
22936 #: ../fish/guestfish-actions.pod:3904
22937 msgid "swapon-uuid"
22941 #: ../fish/guestfish-actions.pod:3906
22944 " swapon-uuid uuid\n"
22949 #: ../fish/guestfish-actions.pod:3908
22951 "This command enables swap to a swap partition with the given UUID. See "
22952 "L</swapon-device> for other notes."
22956 #: ../fish/guestfish-actions.pod:3911
22961 #: ../fish/guestfish-actions.pod:3913
22969 #: ../fish/guestfish-actions.pod:3921
22974 #: ../fish/guestfish-actions.pod:3923
22982 #: ../fish/guestfish-actions.pod:3931
22987 #: ../fish/guestfish-actions.pod:3933
22990 " tail-n nrlines path\n"
22995 #: ../fish/guestfish-actions.pod:3946
23000 #: ../fish/guestfish-actions.pod:3948
23003 " tar-in (tarfile|-) directory\n"
23008 #: ../fish/guestfish-actions.pod:3953
23009 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
23013 #: ../fish/guestfish-actions.pod:3958
23018 #: ../fish/guestfish-actions.pod:3960
23021 " tar-out directory (tarfile|-)\n"
23026 #: ../fish/guestfish-actions.pod:3965
23027 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
23031 #: ../fish/guestfish-actions.pod:3970
23036 #: ../fish/guestfish-actions.pod:3972
23039 " tgz-in (tarball|-) directory\n"
23044 #: ../fish/guestfish-actions.pod:3977
23045 msgid "To upload an uncompressed tarball, use L</tar-in>."
23049 #: ../fish/guestfish-actions.pod:3981
23054 #: ../fish/guestfish-actions.pod:3983
23057 " tgz-out directory (tarball|-)\n"
23062 #: ../fish/guestfish-actions.pod:3988
23063 msgid "To download an uncompressed tarball, use L</tar-out>."
23067 #: ../fish/guestfish-actions.pod:3992
23072 #: ../fish/guestfish-actions.pod:3994
23080 #: ../fish/guestfish-actions.pod:4003
23085 #: ../fish/guestfish-actions.pod:4005
23093 #: ../fish/guestfish-actions.pod:4010
23094 msgid "truncate-size"
23098 #: ../fish/guestfish-actions.pod:4012
23101 " truncate-size path size\n"
23106 #: ../fish/guestfish-actions.pod:4017
23108 "If the current file size is less than C<size> then the file is extended to "
23109 "the required size with zero bytes. This creates a sparse file (ie. disk "
23110 "blocks are not allocated for the file until you write to it). To create a "
23111 "non-sparse file of zeroes, use L</fallocate64> instead."
23115 #: ../fish/guestfish-actions.pod:4023
23120 #: ../fish/guestfish-actions.pod:4025
23123 " tune2fs-l device\n"
23128 #: ../fish/guestfish-actions.pod:4035
23133 #: ../fish/guestfish-actions.pod:4037
23136 " txz-in (tarball|-) directory\n"
23141 #: ../fish/guestfish-actions.pod:4044
23146 #: ../fish/guestfish-actions.pod:4046
23149 " txz-out directory (tarball|-)\n"
23154 #: ../fish/guestfish-actions.pod:4053
23159 #: ../fish/guestfish-actions.pod:4055
23167 #: ../fish/guestfish-actions.pod:4069
23168 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
23172 #: ../fish/guestfish-actions.pod:4074
23177 #: ../fish/guestfish-actions.pod:4076
23182 #: ../fish/guestfish-actions.pod:4078
23185 " umount pathordevice\n"
23190 #: ../fish/guestfish-actions.pod:4084
23195 #: ../fish/guestfish-actions.pod:4086
23196 msgid "unmount-all"
23200 #: ../fish/guestfish-actions.pod:4088
23208 #: ../fish/guestfish-actions.pod:4094
23213 #: ../fish/guestfish-actions.pod:4096
23216 " upload (filename|-) remotefilename\n"
23221 #: ../fish/guestfish-actions.pod:4103
23222 msgid "See also L</download>."
23226 #: ../fish/guestfish-actions.pod:4107
23227 msgid "upload-offset"
23231 #: ../fish/guestfish-actions.pod:4109
23234 " upload-offset (filename|-) remotefilename offset\n"
23239 #: ../fish/guestfish-actions.pod:4121
23241 "Note that there is no limit on the amount of data that can be uploaded with "
23242 "this call, unlike with L</pwrite>, and this call always writes the full "
23243 "amount unless an error occurs."
23247 #: ../fish/guestfish-actions.pod:4126
23248 msgid "See also L</upload>, L</pwrite>."
23252 #: ../fish/guestfish-actions.pod:4130
23257 #: ../fish/guestfish-actions.pod:4132
23260 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
23265 #: ../fish/guestfish-actions.pod:4151
23270 #: ../fish/guestfish-actions.pod:4153
23278 #: ../fish/guestfish-actions.pod:4180
23280 "I<Note:> Don't use this call to test for availability of features. In "
23281 "enterprise distributions we backport features from later versions into "
23282 "earlier versions, making this an unreliable way to test for features. Use "
23283 "L</available> instead."
23287 #: ../fish/guestfish-actions.pod:4186
23292 #: ../fish/guestfish-actions.pod:4188
23295 " vfs-label device\n"
23300 #: ../fish/guestfish-actions.pod:4195
23301 msgid "To find a filesystem from the label, use L</findfs-label>."
23305 #: ../fish/guestfish-actions.pod:4197
23310 #: ../fish/guestfish-actions.pod:4199
23313 " vfs-type device\n"
23318 #: ../fish/guestfish-actions.pod:4209
23323 #: ../fish/guestfish-actions.pod:4211
23326 " vfs-uuid device\n"
23331 #: ../fish/guestfish-actions.pod:4218
23332 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
23336 #: ../fish/guestfish-actions.pod:4220
23337 msgid "vg-activate"
23341 #: ../fish/guestfish-actions.pod:4222
23344 " vg-activate true|false 'volgroups ...'\n"
23349 #: ../fish/guestfish-actions.pod:4235
23350 msgid "vg-activate-all"
23354 #: ../fish/guestfish-actions.pod:4237
23357 " vg-activate-all true|false\n"
23362 #: ../fish/guestfish-actions.pod:4247
23367 #: ../fish/guestfish-actions.pod:4249
23370 " vgcreate volgroup 'physvols ...'\n"
23375 #: ../fish/guestfish-actions.pod:4254
23380 #: ../fish/guestfish-actions.pod:4256
23383 " vglvuuids vgname\n"
23388 #: ../fish/guestfish-actions.pod:4261
23390 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
23391 "logical volumes and volume groups."
23395 #: ../fish/guestfish-actions.pod:4264
23396 msgid "See also L</vgpvuuids>."
23400 #: ../fish/guestfish-actions.pod:4266
23405 #: ../fish/guestfish-actions.pod:4268
23408 " vgpvuuids vgname\n"
23413 #: ../fish/guestfish-actions.pod:4273
23415 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
23416 "physical volumes and volume groups."
23420 #: ../fish/guestfish-actions.pod:4276
23421 msgid "See also L</vglvuuids>."
23425 #: ../fish/guestfish-actions.pod:4278
23430 #: ../fish/guestfish-actions.pod:4280
23433 " vgremove vgname\n"
23438 #: ../fish/guestfish-actions.pod:4287
23443 #: ../fish/guestfish-actions.pod:4289
23446 " vgrename volgroup newvolgroup\n"
23451 #: ../fish/guestfish-actions.pod:4293
23456 #: ../fish/guestfish-actions.pod:4295
23464 #: ../fish/guestfish-actions.pod:4303
23465 msgid "See also L</vgs-full>."
23469 #: ../fish/guestfish-actions.pod:4305
23474 #: ../fish/guestfish-actions.pod:4307
23482 #: ../fish/guestfish-actions.pod:4312
23487 #: ../fish/guestfish-actions.pod:4314
23495 #: ../fish/guestfish-actions.pod:4319
23500 #: ../fish/guestfish-actions.pod:4321
23508 #: ../fish/guestfish-actions.pod:4325
23513 #: ../fish/guestfish-actions.pod:4327
23521 #: ../fish/guestfish-actions.pod:4332
23526 #: ../fish/guestfish-actions.pod:4334
23534 #: ../fish/guestfish-actions.pod:4339
23539 #: ../fish/guestfish-actions.pod:4341
23547 #: ../fish/guestfish-actions.pod:4346
23552 #: ../fish/guestfish-actions.pod:4348
23555 " write path content\n"
23560 #: ../fish/guestfish-actions.pod:4356
23565 #: ../fish/guestfish-actions.pod:4358
23568 " write-file path content size\n"
23573 #: ../fish/guestfish-actions.pod:4381
23578 #: ../fish/guestfish-actions.pod:4383
23581 " zegrep regex path\n"
23586 #: ../fish/guestfish-actions.pod:4391
23591 #: ../fish/guestfish-actions.pod:4393
23594 " zegrepi regex path\n"
23599 #: ../fish/guestfish-actions.pod:4401
23604 #: ../fish/guestfish-actions.pod:4403
23612 #: ../fish/guestfish-actions.pod:4411
23613 msgid "See also: L</zero-device>, L</scrub-device>."
23617 #: ../fish/guestfish-actions.pod:4413
23618 msgid "zero-device"
23622 #: ../fish/guestfish-actions.pod:4415
23625 " zero-device device\n"
23630 #: ../fish/guestfish-actions.pod:4417
23632 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
23633 "which just zeroes the first few blocks of a device."
23637 #: ../fish/guestfish-actions.pod:4424
23642 #: ../fish/guestfish-actions.pod:4426
23645 " zerofree device\n"
23650 #: ../fish/guestfish-actions.pod:4439
23655 #: ../fish/guestfish-actions.pod:4441
23658 " zfgrep pattern path\n"
23663 #: ../fish/guestfish-actions.pod:4449
23668 #: ../fish/guestfish-actions.pod:4451
23671 " zfgrepi pattern path\n"
23676 #: ../fish/guestfish-actions.pod:4459
23681 #: ../fish/guestfish-actions.pod:4461
23684 " zfile meth path\n"
23689 #: ../fish/guestfish-actions.pod:4468
23690 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
23694 #: ../fish/guestfish-actions.pod:4478
23699 #: ../fish/guestfish-actions.pod:4480
23702 " zgrep regex path\n"
23707 #: ../fish/guestfish-actions.pod:4488
23712 #: ../fish/guestfish-actions.pod:4490
23715 " zgrepi regex path\n"
23720 #: ../fish/guestfish-commands.pod:1
23725 #: ../fish/guestfish-commands.pod:3
23730 #: ../fish/guestfish-commands.pod:5
23733 " alloc filename size\n"
23738 #: ../fish/guestfish-commands.pod:7
23740 "This creates an empty (zeroed) file of the given size, and then adds so it "
23741 "can be further examined."
23745 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
23746 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
23750 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
23751 msgid "Size can be specified using standard suffixes, eg. C<1M>."
23755 #: ../fish/guestfish-commands.pod:14
23757 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
23758 "image, see L</PREPARED DISK IMAGES>."
23762 #: ../fish/guestfish-commands.pod:17
23767 #: ../fish/guestfish-commands.pod:19
23770 " copy-in local [local ...] /remotedir\n"
23775 #: ../fish/guestfish-commands.pod:21
23777 "C<copy-in> copies local files or directories recursively into the disk "
23778 "image, placing them in the directory called C</remotedir> (which must "
23779 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
23780 "other commands as necessary."
23784 #: ../fish/guestfish-commands.pod:26
23786 "Multiple local files and directories can be specified, but the last "
23787 "parameter must always be a remote directory. Wildcards cannot be used."
23791 #: ../fish/guestfish-commands.pod:30
23796 #: ../fish/guestfish-commands.pod:32
23799 " copy-out remote [remote ...] localdir\n"
23804 #: ../fish/guestfish-commands.pod:34
23806 "C<copy-out> copies remote files or directories recursively out of the disk "
23807 "image, placing them on the host disk in a local directory called C<localdir> "
23808 "(which must exist). This guestfish meta-command turns into a sequence of "
23809 "L</download>, L</tar-out> and other commands as necessary."
23813 #: ../fish/guestfish-commands.pod:40
23815 "Multiple remote files and directories can be specified, but the last "
23816 "parameter must always be a local directory. To download to the current "
23817 "directory, use C<.> as in:"
23821 #: ../fish/guestfish-commands.pod:44
23824 " copy-out /home .\n"
23829 #: ../fish/guestfish-commands.pod:46
23831 "Wildcards cannot be used in the ordinary command, but you can use them with "
23832 "the help of L</glob> like this:"
23836 #: ../fish/guestfish-commands.pod:49
23839 " glob copy-out /home/* .\n"
23844 #: ../fish/guestfish-commands.pod:51
23849 #: ../fish/guestfish-commands.pod:53
23852 " echo [params ...]\n"
23857 #: ../fish/guestfish-commands.pod:55
23858 msgid "This echos the parameters to the terminal."
23862 #: ../fish/guestfish-commands.pod:57
23867 #: ../fish/guestfish-commands.pod:59
23872 #: ../fish/guestfish-commands.pod:61
23877 #: ../fish/guestfish-commands.pod:63
23885 #: ../fish/guestfish-commands.pod:65
23887 "This is used to edit a file. It downloads the file, edits it locally using "
23888 "your editor, then uploads the result."
23892 #: ../fish/guestfish-commands.pod:68
23894 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
23895 "or C<emacs> you will get those corresponding editors."
23899 #: ../fish/guestfish-commands.pod:72
23904 #: ../fish/guestfish-commands.pod:74
23907 " glob command args...\n"
23912 #: ../fish/guestfish-commands.pod:76
23914 "Expand wildcards in any paths in the args list, and run C<command> "
23915 "repeatedly on each matching path."
23919 #: ../fish/guestfish-commands.pod:79
23920 msgid "See L</WILDCARDS AND GLOBBING>."
23924 #: ../fish/guestfish-commands.pod:81
23929 #: ../fish/guestfish-commands.pod:83
23932 " hexedit <filename|device>\n"
23933 " hexedit <filename|device> <max>\n"
23934 " hexedit <filename|device> <start> <max>\n"
23939 #: ../fish/guestfish-commands.pod:87
23941 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
23946 #: ../fish/guestfish-commands.pod:90
23948 "This command works by downloading potentially the whole file or device, "
23949 "editing it locally, then uploading it. If the file or device is large, you "
23950 "have to specify which part you wish to edit by using C<max> and/or C<start> "
23951 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
23952 "usual modifiers allowed such as C<1M> (1 megabyte)."
23956 #: ../fish/guestfish-commands.pod:97
23957 msgid "For example to edit the first few sectors of a disk you might do:"
23961 #: ../fish/guestfish-commands.pod:100
23964 " hexedit /dev/sda 1M\n"
23969 #: ../fish/guestfish-commands.pod:102
23971 "which would allow you to edit anywhere within the first megabyte of the "
23976 #: ../fish/guestfish-commands.pod:105
23977 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
23981 #: ../fish/guestfish-commands.pod:107
23984 " hexedit /dev/sda1 0x400 0x400\n"
23989 #: ../fish/guestfish-commands.pod:109
23990 msgid "(assuming the superblock is in the standard location)."
23994 #: ../fish/guestfish-commands.pod:111
23996 "This command requires the external L<hexedit(1)> program. You can specify "
23997 "another program to use by setting the C<HEXEDITOR> environment variable."
24001 #: ../fish/guestfish-commands.pod:115
24002 msgid "See also L</hexdump>."
24006 #: ../fish/guestfish-commands.pod:117
24011 #: ../fish/guestfish-commands.pod:119
24019 #: ../fish/guestfish-commands.pod:121
24020 msgid "Change the local directory, ie. the current directory of guestfish itself."
24024 #: ../fish/guestfish-commands.pod:124
24025 msgid "Note that C<!cd> won't do what you might expect."
24029 #: ../fish/guestfish-commands.pod:126
24034 #: ../fish/guestfish-commands.pod:128
24039 #: ../fish/guestfish-commands.pod:130
24047 #: ../fish/guestfish-commands.pod:132
24048 msgid "Opens the manual page for guestfish."
24052 #: ../fish/guestfish-commands.pod:134
24057 #: ../fish/guestfish-commands.pod:136
24062 #: ../fish/guestfish-commands.pod:138
24070 #: ../fish/guestfish-commands.pod:140
24078 #: ../fish/guestfish-commands.pod:142
24079 msgid "This is used to view a file."
24083 #: ../fish/guestfish-commands.pod:144
24085 "The default viewer is C<$PAGER>. However if you use the alternate command "
24086 "C<less> you will get the C<less> command specifically."
24090 #: ../fish/guestfish-commands.pod:147
24095 #: ../fish/guestfish-commands.pod:149
24103 #: ../fish/guestfish-commands.pod:151
24105 "Close and reopen the libguestfs handle. It is not necessary to use this "
24106 "normally, because the handle is closed properly when guestfish exits. "
24107 "However this is occasionally useful for testing."
24111 #: ../fish/guestfish-commands.pod:155
24116 #: ../fish/guestfish-commands.pod:157
24119 " sparse filename size\n"
24124 #: ../fish/guestfish-commands.pod:159
24126 "This creates an empty sparse file of the given size, and then adds so it can "
24127 "be further examined."
24131 #: ../fish/guestfish-commands.pod:162
24133 "In all respects it works the same as the L</alloc> command, except that the "
24134 "image file is allocated sparsely, which means that disk blocks are not "
24135 "assigned to the file until they are needed. Sparse disk files only use "
24136 "space when written to, but they are slower and there is a danger you could "
24137 "run out of real disk space during a write operation."
24141 #: ../fish/guestfish-commands.pod:172
24146 #: ../fish/guestfish-commands.pod:174
24154 #: ../fish/guestfish-commands.pod:176
24156 "This command returns a list of the optional groups known to the daemon, and "
24157 "indicates which ones are supported by this build of the libguestfs "
24162 #: ../fish/guestfish-commands.pod:180
24163 msgid "See also L<guestfs(3)/AVAILABILITY>."
24167 #: ../fish/guestfish-commands.pod:182
24172 #: ../fish/guestfish-commands.pod:184
24175 " time command args...\n"
24180 #: ../fish/guestfish-commands.pod:186
24182 "Run the command as usual, but print the elapsed time afterwards. This can "
24183 "be useful for benchmarking operations."
24187 #: ../test-tool/libguestfs-test-tool.pod:5
24188 msgid "libguestfs-test-tool - End user tests for libguestfs"
24192 #: ../test-tool/libguestfs-test-tool.pod:9
24195 " libguestfs-test-tool [--options]\n"
24200 #: ../test-tool/libguestfs-test-tool.pod:13
24202 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
24203 "and developers, to allow them to check basic libguestfs functionality is "
24204 "working. This is needed because libguestfs occasionally breaks for reasons "
24205 "beyond our control: usually because of changes in the underlying qemu or "
24206 "kernel packages, or the host environment."
24210 #: ../test-tool/libguestfs-test-tool.pod:20
24211 msgid "If you suspect a problem in libguestfs, then just run:"
24215 #: ../test-tool/libguestfs-test-tool.pod:22
24218 " libguestfs-test-tool\n"
24223 #: ../test-tool/libguestfs-test-tool.pod:24
24224 msgid "It will print lots of diagnostic messages."
24228 #: ../test-tool/libguestfs-test-tool.pod:26
24229 msgid "If it runs to completion successfully, you will see this near the end:"
24233 #: ../test-tool/libguestfs-test-tool.pod:28
24236 " ===== TEST FINISHED OK =====\n"
24241 #: ../test-tool/libguestfs-test-tool.pod:30
24242 msgid "and the test tool will exit with code 0."
24246 #: ../test-tool/libguestfs-test-tool.pod:32
24248 "If it fails (and/or exits with non-zero error code), please paste the "
24249 "B<complete, unedited> output of the test tool into a bug report. More "
24250 "information about reporting bugs can be found on the "
24251 "L<http://libguestfs.org/> website."
24255 #: ../test-tool/libguestfs-test-tool.pod:41
24260 #: ../test-tool/libguestfs-test-tool.pod:43
24261 msgid "Display short usage information and exit."
24265 #: ../test-tool/libguestfs-test-tool.pod:45
24266 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
24270 #: ../test-tool/libguestfs-test-tool.pod:47
24272 "Pass an alternate name for the helper program. libguestfs-test-tool will "
24273 "normally look in the C<$libexec> directory that was configured when the tool "
24278 #: ../test-tool/libguestfs-test-tool.pod:51
24279 msgid "I<--qemu qemu_binary>"
24283 #: ../test-tool/libguestfs-test-tool.pod:53
24285 "If you have downloaded another qemu binary, point this option at the full "
24286 "path of the binary to try it."
24290 #: ../test-tool/libguestfs-test-tool.pod:56
24291 msgid "I<--qemudir qemu_source_dir>"
24295 #: ../test-tool/libguestfs-test-tool.pod:58
24297 "If you have compiled qemu from source, point this option at the source "
24298 "directory to try it."
24302 #: ../test-tool/libguestfs-test-tool.pod:61
24303 msgid "I<--timeout N>"
24307 #: ../test-tool/libguestfs-test-tool.pod:63
24309 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
24310 "does not usually need to be adjusted unless your machine is very slow."
24314 #: ../test-tool/libguestfs-test-tool.pod:69
24315 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
24319 #: ../test-tool/libguestfs-test-tool.pod:71
24321 "If you have compiled another version of qemu from source and would like to "
24322 "try that, then you can use the I<--qemudir> option to point to the qemu "
24323 "source directory."
24327 #: ../test-tool/libguestfs-test-tool.pod:75
24329 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
24330 "option to point to the binary."
24334 #: ../test-tool/libguestfs-test-tool.pod:78
24336 "When using an alternate qemu with libguestfs, usually you would need to "
24337 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
24338 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
24339 "when you use either of the I<--qemudir> or I<--qemu> options."
24343 #: ../test-tool/libguestfs-test-tool.pod:85
24345 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
24346 "I<1> if there was an error."
24350 #: ../test-tool/libguestfs-test-tool.pod:92
24351 msgid "/usr/libexec/libguestfs-test-tool-helper"
24355 #: ../test-tool/libguestfs-test-tool.pod:94
24357 "This helper program is run inside the appliance and provides additional "
24362 #: ../test-tool/libguestfs-test-tool.pod:97
24363 msgid "/usr/bin/mkisofs"
24367 #: ../test-tool/libguestfs-test-tool.pod:99
24369 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
24370 "which is used as part of the tests."
24374 #: ../test-tool/libguestfs-test-tool.pod:106
24376 "For the full list of environment variables which may affect libguestfs, "
24377 "please see the L<guestfs(3)> manual page."
24381 #: ../test-tool/libguestfs-test-tool.pod:111
24382 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
24386 #: ../test-tool/libguestfs-test-tool.pod:121
24387 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
24391 #: ../fuse/guestmount.pod:5
24392 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
24396 #: ../fuse/guestmount.pod:9
24399 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
24404 #: ../fuse/guestmount.pod:11
24407 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
24412 #: ../fuse/guestmount.pod:13
24415 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
24420 #: ../fuse/guestmount.pod:17
24422 "You must I<not> use C<guestmount> in read-write mode on live virtual "
24423 "machines. If you do this, you risk disk corruption in the VM."
24427 #: ../fuse/guestmount.pod:22
24429 "The guestmount program can be used to mount virtual machine filesystems and "
24430 "other disk images on the host. It uses libguestfs for access to the guest "
24431 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
24432 "a mountable device."
24436 #: ../fuse/guestmount.pod:27
24438 "Along with other options, you have to give at least one device (I<-a> "
24439 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
24440 "option) or use the I<-i> inspection option. How this works is better "
24441 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
24446 #: ../fuse/guestmount.pod:33
24448 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
24449 "by you, and the filesystem will not be visible to any other users unless you "
24450 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
24451 "the filesystem, use the C<fusermount -u> command."
24455 #: ../fuse/guestmount.pod:41
24457 "For a typical Windows guest which has its main filesystem on the first "
24462 #: ../fuse/guestmount.pod:44
24465 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
24470 #: ../fuse/guestmount.pod:46
24472 "For a typical Linux guest which has a /boot filesystem on the first "
24473 "partition, and the root filesystem on a logical volume:"
24477 #: ../fuse/guestmount.pod:49
24480 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
24485 #: ../fuse/guestmount.pod:51
24486 msgid "To get libguestfs to detect guest mountpoints for you:"
24490 #: ../fuse/guestmount.pod:53
24493 " guestmount -a guest.img -i --ro /mnt\n"
24498 #: ../fuse/guestmount.pod:55
24499 msgid "For a libvirt guest called \"Guest\" you could do:"
24503 #: ../fuse/guestmount.pod:57
24506 " guestmount -d Guest -i --ro /mnt\n"
24511 #: ../fuse/guestmount.pod:59
24513 "If you don't know what filesystems are contained in a guest or disk image, "
24514 "use L<virt-list-filesystems(1)> first:"
24518 #: ../fuse/guestmount.pod:62
24521 " virt-list-filesystems MyGuest\n"
24526 #: ../fuse/guestmount.pod:64
24528 "If you want to trace the libguestfs calls but without excessive debugging "
24529 "information, we recommend:"
24533 #: ../fuse/guestmount.pod:67
24536 " guestmount [...] --trace /mnt\n"
24541 #: ../fuse/guestmount.pod:69
24542 msgid "If you want to debug the program, we recommend:"
24546 #: ../fuse/guestmount.pod:71
24549 " guestmount [...] --trace --verbose /mnt\n"
24554 #: ../fuse/guestmount.pod:79
24555 msgid "Add a block device or virtual machine image."
24559 #: ../fuse/guestmount.pod:96
24560 msgid "B<--dir-cache-timeout N>"
24564 #: ../fuse/guestmount.pod:98
24566 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
24567 "seconds. The readdir cache [actually, there are several semi-independent "
24568 "caches] is populated after a readdir(2) call with the stat and extended "
24569 "attributes of the files in the directory, in anticipation that they will be "
24570 "requested soon after."
24574 #: ../fuse/guestmount.pod:104
24576 "There is also a different attribute cache implemented by FUSE (see the FUSE "
24577 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
24578 "requests, only cache existing ones."
24582 #: ../fuse/guestmount.pod:122
24584 "If you have untrusted raw-format guest disk images, you should use this "
24585 "option to specify the disk format. This avoids a possible security problem "
24586 "with malicious guests (CVE-2010-3851). See also "
24587 "L<guestfs(3)/guestfs_add_drive_opts>."
24591 #: ../fuse/guestmount.pod:127
24592 msgid "B<--fuse-help>"
24596 #: ../fuse/guestmount.pod:129
24597 msgid "Display help on special FUSE options (see I<-o> below)."
24601 #: ../fuse/guestmount.pod:133
24602 msgid "Display brief help and exit."
24606 #: ../fuse/guestmount.pod:146
24607 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
24611 #: ../fuse/guestmount.pod:148
24613 "Mount the named partition or logical volume on the given mountpoint B<in the "
24614 "guest> (this has nothing to do with mountpoints in the host)."
24618 #: ../fuse/guestmount.pod:151
24620 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
24621 "something on C</>."
24625 #: ../fuse/guestmount.pod:156
24627 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
24628 "unmounted. If you specify this option, then we don't attempt to sync the "
24629 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
24633 #: ../fuse/guestmount.pod:161
24634 msgid "B<-o option> | B<--option option>"
24638 #: ../fuse/guestmount.pod:163
24639 msgid "Pass extra options to FUSE."
24643 #: ../fuse/guestmount.pod:165
24645 "To get a list of all the extra options supported by FUSE, use the command "
24646 "below. Note that only the FUSE I<-o> options can be passed, and only some "
24647 "of them are a good idea."
24651 #: ../fuse/guestmount.pod:169
24654 " guestmount --fuse-help\n"
24659 #: ../fuse/guestmount.pod:171
24660 msgid "Some potentially useful FUSE options:"
24664 #: ../fuse/guestmount.pod:175
24665 msgid "B<-o allow_other>"
24669 #: ../fuse/guestmount.pod:177
24670 msgid "Allow other users to see the filesystem."
24674 #: ../fuse/guestmount.pod:179
24675 msgid "B<-o attr_timeout=N>"
24679 #: ../fuse/guestmount.pod:181
24680 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
24684 #: ../fuse/guestmount.pod:183
24685 msgid "B<-o kernel_cache>"
24689 #: ../fuse/guestmount.pod:185
24691 "Allow the kernel to cache files (reduces the number of reads that have to go "
24692 "through the L<guestfs(3)> API). This is generally a good idea if you can "
24693 "afford the extra memory usage."
24697 #: ../fuse/guestmount.pod:189
24698 msgid "B<-o uid=N> B<-o gid=N>"
24702 #: ../fuse/guestmount.pod:191
24704 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
24705 "the chosen values."
24709 #: ../fuse/guestmount.pod:198
24711 "Add devices and mount everything read-only. Also disallow writes and make "
24712 "the disk appear read-only to FUSE."
24716 #: ../fuse/guestmount.pod:201
24718 "This is highly recommended if you are not going to edit the guest disk. If "
24719 "the guest is running and this option is I<not> supplied, then there is a "
24720 "strong risk of disk corruption in the guest. We try to prevent this from "
24721 "happening, but it is not always possible."
24725 #: ../fuse/guestmount.pod:206
24726 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
24730 #: ../fuse/guestmount.pod:210
24731 msgid "Enable SELinux support for the guest."
24735 #: ../fuse/guestmount.pod:214
24736 msgid "Enable verbose messages from underlying libguestfs."
24740 #: ../fuse/guestmount.pod:218
24741 msgid "Display the program version and exit."
24745 #: ../fuse/guestmount.pod:222
24747 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
24748 "FOR READ AND WRITE>."
24752 #: ../fuse/guestmount.pod:225
24753 msgid "B<-x> | B<--trace>"
24757 #: ../fuse/guestmount.pod:227
24758 msgid "Trace libguestfs calls."
24762 #: ../fuse/guestmount.pod:229
24763 msgid "This also stops the daemon from forking into the background."
24767 #: ../fuse/guestmount.pod:235
24769 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
24770 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
24771 "L<http://fuse.sf.net/>."
24775 #: ../inspector/virt-inspector.pl:35
24777 "virt-inspector - Display operating system version and other information "
24778 "about a virtual machine"
24782 #: ../inspector/virt-inspector.pl:39
24785 " virt-inspector [--connect URI] domname\n"
24790 #: ../inspector/virt-inspector.pl:41
24793 " virt-inspector guest.img [guest.img ...]\n"
24798 #: ../inspector/virt-inspector.pl:45
24800 "B<virt-inspector> examines a virtual machine or disk image and tries to "
24801 "determine the version of the operating system and other information about "
24802 "the virtual machine."
24806 #: ../inspector/virt-inspector.pl:49
24807 msgid "Virt-inspector produces XML output for feeding into other programs."
24811 #: ../inspector/virt-inspector.pl:51
24813 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
24814 "libvirt domain (see: C<virsh list --all>)."
24818 #: ../inspector/virt-inspector.pl:54
24820 "You can also run virt-inspector directly on disk images from a single "
24821 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
24822 "has several block devices, in which case you should list them one after "
24823 "another, with the first corresponding to the guest's C</dev/sda>, the second "
24824 "to the guest's C</dev/sdb> and so on."
24828 #: ../inspector/virt-inspector.pl:60
24830 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
24831 "inspect several virtual machines, you have to run virt-inspector several "
24832 "times (for example, from a shell script for-loop)."
24836 #: ../inspector/virt-inspector.pl:65
24838 "Because virt-inspector needs direct access to guest images, it won't "
24839 "normally work over remote libvirt connections."
24843 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88 ../tools/virt-list-filesystems.pl:60 ../tools/virt-tar.pl:108 ../tools/virt-rescue.pl:113 ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:61
24844 msgid "Display brief help."
24848 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94 ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66 ../tools/virt-tar.pl:114 ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:67
24849 msgid "B<--version>"
24853 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96 ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68 ../tools/virt-tar.pl:116 ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:69
24854 msgid "Display version number and exit."
24858 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102 ../tools/virt-list-filesystems.pl:74 ../tools/virt-tar.pl:122 ../tools/virt-rescue.pl:135 ../tools/virt-list-partitions.pl:75
24859 msgid "B<--connect URI> | B<-c URI>"
24863 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104 ../tools/virt-list-filesystems.pl:76 ../tools/virt-tar.pl:124 ../tools/virt-rescue.pl:137 ../tools/virt-list-partitions.pl:77
24865 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
24866 "to the default libvirt hypervisor."
24870 #: ../inspector/virt-inspector.pl:97
24872 "Libvirt is only used if you specify a C<domname> on the command line. If "
24873 "you specify guest block devices directly, then libvirt is not used at all."
24877 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117 ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523 ../tools/virt-list-filesystems.pl:86 ../tools/virt-tar.pl:134 ../tools/virt-rescue.pl:147 ../tools/virt-list-partitions.pl:87
24878 msgid "B<--format> raw"
24882 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119 ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88 ../tools/virt-tar.pl:136 ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
24884 "Specify the format of disk images given on the command line. If this is "
24885 "omitted then the format is autodetected from the content of the disk image."
24889 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123 ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92 ../tools/virt-tar.pl:140 ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
24891 "If disk images are requested from libvirt, then this program asks libvirt "
24892 "for this information. In this case, the value of the format parameter is "
24897 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127 ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528 ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96 ../tools/virt-tar.pl:144 ../tools/virt-rescue.pl:157 ../tools/virt-list-partitions.pl:97
24899 "If working with untrusted raw-format guest disk images, you should ensure "
24900 "the format is always specified."
24904 #: ../inspector/virt-inspector.pl:149
24909 #: ../inspector/virt-inspector.pl:151
24911 "The virt-inspector XML is described precisely in a RELAX NG schema which is "
24912 "supplied with libguestfs. This section is just an overview."
24916 #: ../inspector/virt-inspector.pl:154
24918 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
24919 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
24920 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
24921 "which is vanishingly rare in real world VMs."
24925 #: ../inspector/virt-inspector.pl:159
24926 msgid "E<lt>operatingsystemE<gt>"
24930 #: ../inspector/virt-inspector.pl:161
24932 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
24933 "describe the operating system, its architecture, the descriptive \"product "
24934 "name\" string, the type of OS and so on, as in this example:"
24938 #: ../inspector/virt-inspector.pl:165
24941 " <operatingsystems>\n"
24942 " <operatingsystem>\n"
24943 " <root>/dev/sda2</root>\n"
24944 " <name>windows</name>\n"
24945 " <arch>i386</arch>\n"
24946 " <distro>windows</distro>\n"
24947 " <product_name>Windows 7 Enterprise</product_name>\n"
24948 " <major_version>6</major_version>\n"
24949 " <minor_version>1</minor_version>\n"
24950 " <windows_systemroot>/Windows</windows_systemroot>\n"
24955 #: ../inspector/virt-inspector.pl:176
24957 "These fields are derived from the libguestfs inspection API, and you can "
24958 "find more details in L<guestfs(3)/INSPECTION>."
24962 #: ../inspector/virt-inspector.pl:179
24964 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
24965 "of view of libguestfs (block devices may have completely different names "
24966 "inside the VM itself)."
24970 #: ../inspector/virt-inspector.pl:240
24971 msgid "E<lt>mountpointsE<gt>"
24975 #: ../inspector/virt-inspector.pl:242
24977 "Un*x-like guests typically have multiple filesystems which are mounted at "
24978 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
24979 "element which looks like this:"
24983 #: ../inspector/virt-inspector.pl:246
24986 " <operatingsystems>\n"
24987 " <operatingsystem>\n"
24990 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
24991 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
24992 " </mountpoints>\n"
24997 #: ../inspector/virt-inspector.pl:254
24999 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
25000 "and may have completely different names inside the guest. Only mountable "
25001 "filesystems appear in this list, not things like swap devices."
25005 #: ../inspector/virt-inspector.pl:276
25006 msgid "E<lt>filesystemsE<gt>"
25010 #: ../inspector/virt-inspector.pl:278
25012 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
25013 "filesystems belonging to the guest, including swap and empty partitions. "
25014 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
25015 "this OS or shared by this OS and other OSes)."
25019 #: ../inspector/virt-inspector.pl:283
25020 msgid "You might see something like this:"
25024 #: ../inspector/virt-inspector.pl:285
25027 " <operatingsystems>\n"
25028 " <operatingsystem>\n"
25031 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
25032 " <type>ext4</type>\n"
25033 " <label>Fedora-13-x86_64</label>\n"
25034 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
25040 #: ../inspector/virt-inspector.pl:295
25042 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
25043 "the label, and the UUID."
25047 #: ../inspector/virt-inspector.pl:337
25048 msgid "E<lt>applicationsE<gt>"
25052 #: ../inspector/virt-inspector.pl:339
25054 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
25055 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
25056 "machine. At the moment we are only able to list RPMs and Debian packages "
25057 "installed, but in future we will support other Linux distros and Windows."
25061 #: ../inspector/virt-inspector.pl:345
25063 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
25064 "Typical values would be C<rpm> and C<deb>."
25068 #: ../inspector/virt-inspector.pl:348
25070 "E<lt>package_managementE<gt>, if present, describes the package manager. "
25071 "Typical values include C<yum>, C<up2date> and C<apt>"
25075 #: ../inspector/virt-inspector.pl:351
25076 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
25080 #: ../inspector/virt-inspector.pl:354
25083 " <operatingsystems>\n"
25084 " <operatingsystem>\n"
25086 " <applications>\n"
25088 " <name>coreutils</name>\n"
25089 " <version>8.5</version>\n"
25090 " <release>1</release>\n"
25091 " </application>\n"
25096 #: ../inspector/virt-inspector.pl:364
25098 "(The version and release fields may not be available for some package "
25103 #: ../inspector/virt-inspector.pl:544
25104 msgid "USING XPATH"
25108 #: ../inspector/virt-inspector.pl:546
25110 "You can use the XPath query language, and/or the xpath tool, in order to "
25111 "select parts of the XML."
25115 #: ../inspector/virt-inspector.pl:551
25118 " $ virt-inspector Guest | xpath //filesystems\n"
25119 " Found 1 nodes:\n"
25122 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
25123 " <type>ext4</type>\n"
25129 #: ../inspector/virt-inspector.pl:559
25132 " $ virt-inspector Guest | \\\n"
25133 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
25134 " Query didn't return a nodeset. Value: ext4\n"
25139 #: ../inspector/virt-inspector.pl:563 ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477 ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225 ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179 ../tools/virt-tar.pl:274 ../tools/virt-rescue.pl:260 ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:247
25140 msgid "SHELL QUOTING"
25144 #: ../inspector/virt-inspector.pl:565 ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635 ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481 ../tools/virt-list-filesystems.pl:181 ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:262 ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
25146 "Libvirt guest names can contain arbitrary characters, some of which have "
25147 "meaning to the shell such as C<#> and space. You may need to quote or "
25148 "escape these characters on the command line. See the shell manual page "
25149 "L<sh(1)> for details."
25153 #: ../inspector/virt-inspector.pl:572
25155 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
25156 "L<Sys::Virt(3)>, L<http://www.w3.org/TR/xpath/>, L<http://libguestfs.org/>."
25160 #: ../inspector/virt-inspector.pl:586 ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651 ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510 ../tools/virt-list-filesystems.pl:200 ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:279 ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
25161 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
25165 #: ../inspector/virt-inspector.pl:590
25166 msgid "Matthew Booth L<mbooth@redhat.com>"
25170 #: ../inspector/virt-inspector.pl:596 ../tools/virt-win-reg.pl:516 ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
25171 msgid "Copyright (C) 2010 Red Hat Inc."
25175 #: ../tools/virt-edit.pl:34
25176 msgid "virt-edit - Edit a file in a virtual machine"
25180 #: ../tools/virt-edit.pl:38
25183 " virt-edit [--options] domname file\n"
25188 #: ../tools/virt-edit.pl:40
25191 " virt-edit [--options] disk.img [disk.img ...] file\n"
25196 #: ../tools/virt-edit.pl:42
25199 " virt-edit [domname|disk.img] file -e 'expr'\n"
25204 #: ../tools/virt-edit.pl:46
25206 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
25207 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
25208 "doing this, but doesn't catch all cases."
25212 #: ../tools/virt-edit.pl:52
25214 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
25215 "the named virtual machine (or disk image)."
25219 #: ../tools/virt-edit.pl:55
25221 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
25222 "you should look at the L<guestfish(1)> tool."
25226 #: ../tools/virt-edit.pl:60
25227 msgid "Edit the named files interactively:"
25231 #: ../tools/virt-edit.pl:62
25234 " virt-edit mydomain /boot/grub/grub.conf\n"
25239 #: ../tools/virt-edit.pl:64
25242 " virt-edit mydomain /etc/passwd\n"
25247 #: ../tools/virt-edit.pl:66
25249 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
25250 "below). To change the init default level to 5:"
25254 #: ../tools/virt-edit.pl:70
25257 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
25262 #: ../tools/virt-edit.pl:96
25263 msgid "B<--backup extension> | B<-b extension>"
25267 #: ../tools/virt-edit.pl:98
25269 "Create a backup of the original file I<in the guest disk image>. The backup "
25270 "has the original filename with C<extension> added."
25274 #: ../tools/virt-edit.pl:101
25276 "Usually the first character of C<extension> would be a dot C<.> so you would "
25281 #: ../tools/virt-edit.pl:104
25284 " virt-edit -b .orig [etc]\n"
25289 #: ../tools/virt-edit.pl:106
25290 msgid "By default, no backup file is made."
25294 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208 ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107 ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:127 ../tools/virt-rescue.pl:140 ../tools/virt-list-partitions.pl:80
25296 "If you specify guest block devices directly, then libvirt is not used at "
25301 #: ../tools/virt-edit.pl:141
25302 msgid "B<--expr EXPR> | B<-e EXPR>"
25306 #: ../tools/virt-edit.pl:143
25308 "Instead of launching the external editor, non-interactively apply the Perl "
25309 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
25314 #: ../tools/virt-edit.pl:147
25316 "Be careful to properly quote the expression to prevent it from being altered "
25321 #: ../tools/virt-edit.pl:268
25322 msgid "NON-INTERACTIVE EDITING"
25326 #: ../tools/virt-edit.pl:270
25328 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
25329 "administrator can interactively edit the file."
25333 #: ../tools/virt-edit.pl:273
25335 "There are two ways also to use C<virt-edit> from scripts in order to make "
25336 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
25337 "like this, it's less error-prone to write scripts directly using the "
25338 "libguestfs API and Augeas for configuration file editing.)"
25342 #: ../tools/virt-edit.pl:279
25344 "The first method is to temporarily set C<$EDITOR> to any script or program "
25345 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
25346 "update C<tmpfile> in place however it likes."
25350 #: ../tools/virt-edit.pl:283
25352 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
25353 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
25354 "instances of C<foo> with C<bar> in a file:"
25358 #: ../tools/virt-edit.pl:287
25361 " virt-edit domname filename -e 's/foo/bar/'\n"
25366 #: ../tools/virt-edit.pl:289
25368 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
25369 "For example to delete root's password you could do:"
25373 #: ../tools/virt-edit.pl:292
25376 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
25381 #: ../tools/virt-edit.pl:294
25383 "What really happens is that the snippet is evaluated as a Perl expression "
25384 "for each line of the file. The line, including the final C<\\n>, is passed "
25385 "in C<$_> and the expression should update C<$_> or leave it unchanged."
25389 #: ../tools/virt-edit.pl:299
25391 "To delete a line, set C<$_> to the empty string. For example, to delete the "
25392 "C<apache> user account from the password file you can do:"
25396 #: ../tools/virt-edit.pl:302
25399 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
25404 #: ../tools/virt-edit.pl:304
25406 "To insert a line, prepend or append it to C<$_>. However appending lines to "
25407 "the end of the file is rather difficult this way since there is no concept "
25408 "of \"last line of the file\" - your expression just doesn't get called "
25409 "again. You might want to use the first method (setting C<$EDITOR>) if you "
25414 #: ../tools/virt-edit.pl:310
25416 "The variable C<$lineno> contains the current line number. As is "
25417 "traditional, the first line in the file is number C<1>."
25421 #: ../tools/virt-edit.pl:313
25423 "The return value from the expression is ignored, but the expression may call "
25424 "C<die> in order to abort the whole program, leaving the original file "
25429 #: ../tools/virt-edit.pl:317
25431 "Remember when matching the end of a line that C<$_> may contain the final "
25432 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
25433 "newline then neither of these. Thus to match or substitute some text at the "
25434 "end of a line, use this regular expression:"
25438 #: ../tools/virt-edit.pl:322
25441 " /some text(\\r?\\n)?$/\n"
25446 #: ../tools/virt-edit.pl:324
25448 "Alternately, use the perl C<chomp> function, being careful not to chomp "
25449 "C<$_> itself (since that would remove all newlines from the file):"
25453 #: ../tools/virt-edit.pl:328
25456 " my $m = $_; chomp $m; $m =~ /some text$/\n"
25461 #: ../tools/virt-edit.pl:334
25466 #: ../tools/virt-edit.pl:336
25468 "If set, this string is used as the editor. It may contain arguments, "
25469 "eg. C<\"emacs -nw\">"
25473 #: ../tools/virt-edit.pl:339
25474 msgid "If not set, C<vi> is used."
25478 #: ../tools/virt-edit.pl:352
25480 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
25481 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, "
25482 "L<perl(1)>, L<perlre(1)>."
25486 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510 ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243 ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198 ../tools/virt-tar.pl:292 ../tools/virt-rescue.pl:277 ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:265
25491 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655 ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
25492 msgid "Copyright (C) 2009-2010 Red Hat Inc."
25496 #: ../tools/virt-win-reg.pl:37
25498 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
25503 #: ../tools/virt-win-reg.pl:41
25506 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
25511 #: ../tools/virt-win-reg.pl:43
25514 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
25519 #: ../tools/virt-win-reg.pl:45
25522 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
25527 #: ../tools/virt-win-reg.pl:47
25530 " virt-win-reg --merge domname [input.reg ...]\n"
25535 #: ../tools/virt-win-reg.pl:49
25538 " virt-win-reg [--options] disk.img ... # instead of domname\n"
25543 #: ../tools/virt-win-reg.pl:53
25545 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
25546 "virtual machines. If you do this, you I<will> get irreversible disk "
25547 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
25548 "but doesn't catch all cases."
25552 #: ../tools/virt-win-reg.pl:58
25554 "Modifying the Windows Registry is an inherently risky operation. The format "
25555 "is deliberately obscure and undocumented, and Registry changes can leave the "
25556 "system unbootable. Therefore when using the C<--merge> option, make sure "
25557 "you have a reliable backup first."
25561 #: ../tools/virt-win-reg.pl:65
25563 "This program can export and merge Windows Registry entries from a Windows "
25568 #: ../tools/virt-win-reg.pl:68
25570 "The first parameter is the libvirt guest name or the raw disk image of a "
25575 #: ../tools/virt-win-reg.pl:71
25577 "If C<--merge> is I<not> specified, then the chosen registry key is "
25578 "displayed/exported (recursively). For example:"
25582 #: ../tools/virt-win-reg.pl:74
25585 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
25590 #: ../tools/virt-win-reg.pl:76
25591 msgid "You can also display single values from within registry keys, for example:"
25595 #: ../tools/virt-win-reg.pl:79
25598 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
25599 " $ virt-win-reg Windows7 $cvkey ProductName\n"
25600 " Windows 7 Enterprise\n"
25605 #: ../tools/virt-win-reg.pl:83
25607 "With C<--merge>, you can merge a textual regedit file into the Windows "
25612 #: ../tools/virt-win-reg.pl:86
25615 " $ virt-win-reg --merge Windows7 changes.reg\n"
25620 #: ../tools/virt-win-reg.pl:88
25621 msgid "SUPPORTED SYSTEMS"
25625 #: ../tools/virt-win-reg.pl:90
25627 "The program currently supports Windows NT-derived guests starting with "
25628 "Windows XP through to at least Windows 7."
25632 #: ../tools/virt-win-reg.pl:93
25634 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
25635 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
25636 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
25640 #: ../tools/virt-win-reg.pl:97
25642 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
25647 #: ../tools/virt-win-reg.pl:100
25649 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
25654 #: ../tools/virt-win-reg.pl:103
25659 #: ../tools/virt-win-reg.pl:105
25661 "This program is only meant for simple access to the registry. If you want "
25662 "to do complicated things with the registry, we suggest you download the "
25663 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
25664 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
25665 "L<hivexregedit(1)>."
25669 #: ../tools/virt-win-reg.pl:111
25674 #: ../tools/virt-win-reg.pl:113
25676 "C<virt-win-reg> expects that regedit files have already been reencoded in "
25677 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
25678 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
25679 "with Windows-style line endings, you may need to reencode the whole file "
25680 "before or after processing."
25684 #: ../tools/virt-win-reg.pl:119
25686 "To reencode a file from Windows format to Linux (before processing it with "
25687 "the C<--merge> option), you would do something like this:"
25691 #: ../tools/virt-win-reg.pl:122
25694 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
25699 #: ../tools/virt-win-reg.pl:124
25701 "To go in the opposite direction, after exporting and before sending the file "
25702 "to a Windows user, do something like this:"
25706 #: ../tools/virt-win-reg.pl:127
25709 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
25714 #: ../tools/virt-win-reg.pl:129
25715 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
25719 #: ../tools/virt-win-reg.pl:131
25721 "If you are unsure about the current encoding, use the L<file(1)> command. "
25722 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
25723 "Windows-style (CRLF) line endings, like this:"
25727 #: ../tools/virt-win-reg.pl:135
25730 " $ file software.reg\n"
25731 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
25732 " with CRLF line terminators\n"
25737 #: ../tools/virt-win-reg.pl:139
25738 msgid "This file would need conversion before you could C<--merge> it."
25742 #: ../tools/virt-win-reg.pl:143
25744 "Be careful when passing parameters containing C<\\> (backslash) in the "
25745 "shell. Usually you will have to use 'single quotes' or double backslashes "
25746 "(but not both) to protect them from the shell."
25750 #: ../tools/virt-win-reg.pl:147
25751 msgid "Paths and value names are case-insensitive."
25755 #: ../tools/virt-win-reg.pl:149
25756 msgid "CurrentControlSet etc."
25760 #: ../tools/virt-win-reg.pl:151
25762 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
25763 "Registry at the level of the hive file, and therefore you cannot modify "
25768 #: ../tools/virt-win-reg.pl:155
25770 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
25771 "circumstances it might refer to another control set. The way to find out is "
25772 "to look at the C<HKLM\\SYSTEM\\Select> key:"
25776 #: ../tools/virt-win-reg.pl:159
25779 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
25780 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
25781 " \"Current\"=dword:00000001\n"
25782 " \"Default\"=dword:00000001\n"
25783 " \"Failed\"=dword:00000000\n"
25784 " \"LastKnownGood\"=dword:00000002\n"
25789 #: ../tools/virt-win-reg.pl:166
25790 msgid "\"Current\" is the one which Windows will choose when it boots."
25794 #: ../tools/virt-win-reg.pl:168
25795 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
25799 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
25804 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
25805 msgid "Enable debugging messages."
25809 #: ../tools/virt-win-reg.pl:232
25814 #: ../tools/virt-win-reg.pl:234
25816 "In merge mode, this merges a textual regedit file into the Windows Registry "
25817 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
25818 "displays or exports Registry entries instead."
25822 #: ../tools/virt-win-reg.pl:238
25824 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
25825 "result in disk corruption. However exporting (without this flag) is always "
25830 #: ../tools/virt-win-reg.pl:246
25831 msgid "B<--encoding> UTF-16LE|ASCII"
25835 #: ../tools/virt-win-reg.pl:248
25837 "When merging (only), you may need to specify the encoding for strings to be "
25838 "used in the hive file. This is explained in detail in "
25839 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
25843 #: ../tools/virt-win-reg.pl:252
25845 "The default is to use UTF-16LE, which should work with recent versions of "
25850 #: ../tools/virt-win-reg.pl:486
25852 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
25853 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
25854 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
25855 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25859 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
25861 "When reporting bugs, please enable debugging and capture the I<complete> "
25866 #: ../tools/virt-win-reg.pl:504
25869 " export LIBGUESTFS_DEBUG=1\n"
25870 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
25875 #: ../tools/virt-win-reg.pl:507
25877 "Attach /tmp/virt-win-reg.log to a new bug report at "
25878 "L<https://bugzilla.redhat.com/>"
25882 #: ../tools/virt-df.pl:36
25883 msgid "virt-df - Display free space on virtual filesystems"
25887 #: ../tools/virt-df.pl:40
25890 " virt-df [--options]\n"
25895 #: ../tools/virt-df.pl:42
25898 " virt-df [--options] domname\n"
25903 #: ../tools/virt-df.pl:44
25906 " virt-df [--options] disk.img [disk.img ...]\n"
25911 #: ../tools/virt-df.pl:48
25913 "C<virt-df> is a command line tool to display free space on virtual machine "
25914 "filesystems. Unlike other tools, it doesn't just display the amount of "
25915 "space allocated to a virtual machine, but can look inside the virtual "
25916 "machine to see how much space is really being used."
25920 #: ../tools/virt-df.pl:53
25922 "It is like the L<df(1)> command, but for virtual machines, except that it "
25923 "also works for Windows virtual machines."
25927 #: ../tools/virt-df.pl:56
25929 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
25930 "of all active and inactive guests, and performs a C<df>-type operation on "
25931 "each one in turn, printing out the results."
25935 #: ../tools/virt-df.pl:60
25937 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
25938 "either the single named libvirt domain, or on the disk image(s) listed on "
25939 "the command line (which must all belong to a single VM). In this mode (with "
25940 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
25941 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
25945 #: ../tools/virt-df.pl:67
25947 "Use the C<--csv> option to get a format which can be easily parsed by other "
25948 "programs. Other options are mostly similar to standard C<df> options. See "
25949 "below for the complete list."
25953 #: ../tools/virt-df.pl:107
25958 #: ../tools/virt-df.pl:109
25960 "Write out the results in CSV format (comma-separated values). This format "
25961 "can be imported easily into databases and spreadsheets, but read L</NOTE "
25962 "ABOUT CSV FORMAT> below."
25966 #: ../tools/virt-df.pl:134
25967 msgid "B<--human-readable> | B<-h>"
25971 #: ../tools/virt-df.pl:136
25972 msgid "Print sizes in human-readable format."
25976 #: ../tools/virt-df.pl:138
25977 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
25981 #: ../tools/virt-df.pl:144
25982 msgid "B<--inodes> | B<-i>"
25986 #: ../tools/virt-df.pl:146
25987 msgid "Print inodes instead of blocks."
25991 #: ../tools/virt-df.pl:152
25992 msgid "B<--one-per-guest>"
25996 #: ../tools/virt-df.pl:154
25998 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
25999 "disks from several guests to a single libguestfs appliance."
26003 #: ../tools/virt-df.pl:157
26004 msgid "You might use this option in the following circumstances:"
26008 #: ../tools/virt-df.pl:163
26010 "If you think an untrusted guest might actively try to exploit the libguestfs "
26011 "appliance kernel, then this prevents one guest from interfering with the "
26012 "stats printed for another guest."
26016 #: ../tools/virt-df.pl:169
26018 "If the kernel has a bug which stops it from accessing a filesystem in one "
26019 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
26020 "and report stats for further guests."
26024 #: ../tools/virt-df.pl:180
26029 #: ../tools/virt-df.pl:182
26031 "Print UUIDs instead of names. This is useful for following a guest even "
26032 "when the guest is migrated or renamed, or when two guests happen to have the "
26037 #: ../tools/virt-df.pl:186
26039 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
26040 "images, we still print the disk image name even when this option is "
26045 #: ../tools/virt-df.pl:609
26046 msgid "NOTE ABOUT CSV FORMAT"
26050 #: ../tools/virt-df.pl:611
26052 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
26053 "should be easy to parse, but it is definitely not easy to parse."
26057 #: ../tools/virt-df.pl:614
26059 "Myth: Just split fields at commas. Reality: This does I<not> work "
26060 "reliably. This example has two columns:"
26064 #: ../tools/virt-df.pl:617
26067 " \"foo,bar\",baz\n"
26072 #: ../tools/virt-df.pl:619
26074 "Myth: Read the file one line at a time. Reality: This does I<not> work "
26075 "reliably. This example has one row:"
26079 #: ../tools/virt-df.pl:622
26088 #: ../tools/virt-df.pl:625
26090 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
26091 "packaged in major Linux distributions)."
26095 #: ../tools/virt-df.pl:628
26097 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
26098 "or Python's built-in csv library)."
26102 #: ../tools/virt-df.pl:631
26103 msgid "Most spreadsheets and databases can import CSV directly."
26107 #: ../tools/virt-df.pl:642
26109 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
26110 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26114 #: ../tools/virt-ls.pl:34
26115 msgid "virt-ls - List files in a virtual machine"
26119 #: ../tools/virt-ls.pl:38
26122 " virt-ls [--options] domname directory\n"
26127 #: ../tools/virt-ls.pl:40
26130 " virt-ls [--options] disk.img [disk.img ...] directory\n"
26135 #: ../tools/virt-ls.pl:44
26137 "C<virt-ls> is a command line tool to list the names of files in a directory "
26138 "inside a virtual machine or disk image."
26142 #: ../tools/virt-ls.pl:47
26144 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
26145 "For more complex cases you should look at the L<guestfish(1)> tool."
26149 #: ../tools/virt-ls.pl:51
26151 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
26152 "simple listing is like the ordinary L<ls(1)> command:"
26156 #: ../tools/virt-ls.pl:54
26159 " $ virt-ls myguest /\n"
26167 #: ../tools/virt-ls.pl:59
26168 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
26172 #: ../tools/virt-ls.pl:61
26175 " $ virt-ls -l myguest /\n"
26177 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
26178 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
26184 #: ../tools/virt-ls.pl:67
26186 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
26187 "and directories recursively:"
26191 #: ../tools/virt-ls.pl:70
26194 " $ virt-ls -R myguest /tmp\n"
26202 #: ../tools/virt-ls.pl:75
26204 "You I<cannot> combine these options. To do more complicated things, use "
26209 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103 ../tools/virt-list-partitions.pl:112
26210 msgid "B<-l> | B<--long>"
26214 #: ../tools/virt-ls.pl:133
26215 msgid "B<-R> | B<--recursive>"
26219 #: ../tools/virt-ls.pl:135
26221 "Select the mode. With neither of these options, C<virt-ls> produces a "
26222 "simple, flat list of the files in the named directory."
26226 #: ../tools/virt-ls.pl:138
26228 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
26229 "like the plain C<ls -l> command)."
26233 #: ../tools/virt-ls.pl:141
26235 "C<virt-ls -R> produces a recursive list of files starting at the named "
26236 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
26241 #: ../tools/virt-ls.pl:145
26242 msgid "You cannot combine these options."
26246 #: ../tools/virt-ls.pl:234
26248 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
26249 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
26250 "L<http://libguestfs.org/>."
26254 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204 ../tools/virt-tar.pl:298
26255 msgid "Copyright (C) 2009 Red Hat Inc."
26259 #: ../tools/virt-resize.pl:42
26260 msgid "virt-resize - Resize a virtual machine disk"
26264 #: ../tools/virt-resize.pl:46
26267 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
26268 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
26269 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
26274 #: ../tools/virt-resize.pl:52
26276 "Virt-resize is a tool which can resize a virtual machine disk, making it "
26277 "larger or smaller overall, and resizing or deleting any partitions contained "
26282 #: ../tools/virt-resize.pl:56
26284 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
26285 "not> be used on live virtual machines - for consistent results, shut the "
26286 "virtual machine down before resizing it."
26290 #: ../tools/virt-resize.pl:60
26292 "If you are not familiar with the associated tools: "
26293 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)> and L<virt-df(1)>, "
26294 "we recommend you go and read those manual pages first."
26298 #: ../tools/virt-resize.pl:68
26300 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
26301 "fill the extra 5GB of space."
26305 #: ../tools/virt-resize.pl:71
26308 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
26309 " virt-list-partitions -lht olddisk\n"
26310 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
26311 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
26316 #: ../tools/virt-resize.pl:76
26318 "As above, but make the /boot partition 200MB bigger, while giving the "
26319 "remaining space to /dev/sda2:"
26323 #: ../tools/virt-resize.pl:79
26326 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
26331 #: ../tools/virt-resize.pl:81
26332 msgid "As above, but the output format will be uncompressed qcow2:"
26336 #: ../tools/virt-resize.pl:83
26339 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
26340 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
26345 #: ../tools/virt-resize.pl:86
26346 msgid "DETAILED USAGE"
26350 #: ../tools/virt-resize.pl:88
26351 msgid "EXPANDING A VIRTUAL MACHINE DISK"
26355 #: ../tools/virt-resize.pl:92
26356 msgid "1. Shut down the virtual machine"
26360 #: ../tools/virt-resize.pl:94
26361 msgid "2. Locate input disk image"
26365 #: ../tools/virt-resize.pl:96
26367 "Locate the input disk image (ie. the file or device on the host containing "
26368 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
26369 "dumpxml> like this to find the disk image name:"
26373 #: ../tools/virt-resize.pl:100
26376 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
26377 " Found 1 nodes:\n"
26379 " <source dev=\"/dev/vg/lv_guest\" />\n"
26384 #: ../tools/virt-resize.pl:105
26385 msgid "3. Look at current sizing"
26389 #: ../tools/virt-resize.pl:107
26390 msgid "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
26394 #: ../tools/virt-resize.pl:110
26397 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
26398 " /dev/sda1 ext3 101.9M\n"
26399 " /dev/sda2 pv 7.9G\n"
26400 " /dev/sda device 8.0G\n"
26405 #: ../tools/virt-resize.pl:115
26407 "(This example is a virtual machine with an 8 GB disk which we would like to "
26408 "expand up to 10 GB)."
26412 #: ../tools/virt-resize.pl:118
26413 msgid "4. Create output disk"
26417 #: ../tools/virt-resize.pl:120
26419 "Virt-resize cannot do in-place disk modifications. You have to have space "
26420 "to store the resized output disk."
26424 #: ../tools/virt-resize.pl:123
26425 msgid "To store the resized disk image in a file, create a file of a suitable size:"
26429 #: ../tools/virt-resize.pl:126
26432 " # rm -f outdisk\n"
26433 " # truncate -s 10G outdisk\n"
26438 #: ../tools/virt-resize.pl:129
26439 msgid "Or use L<lvcreate(1)> to create a logical volume:"
26443 #: ../tools/virt-resize.pl:131
26446 " # lvcreate -L 10G -n lv_name vg_name\n"
26451 #: ../tools/virt-resize.pl:133
26452 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
26456 #: ../tools/virt-resize.pl:135
26459 " # virsh pool-list\n"
26460 " # virsh vol-create-as poolname newvol 10G\n"
26465 #: ../tools/virt-resize.pl:138
26470 #: ../tools/virt-resize.pl:140
26472 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
26473 "file) and the output disk. The output disk is the one created in the "
26478 #: ../tools/virt-resize.pl:144
26481 " # virt-resize indisk outdisk\n"
26486 #: ../tools/virt-resize.pl:146
26488 "This command just copies disk image C<indisk> to disk image C<outdisk> "
26489 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
26490 "larger, then an extra, empty partition is created at the end of the disk "
26491 "covering the extra space. If C<outdisk> is smaller, then it will give an "
26496 #: ../tools/virt-resize.pl:152
26498 "More realistically you'd want to expand existing partitions in the disk "
26499 "image by passing extra options (for the full list see the L</OPTIONS> "
26504 #: ../tools/virt-resize.pl:156
26506 "L</--expand> is the most useful option. It expands the named partition "
26507 "within the disk to fill any extra space:"
26511 #: ../tools/virt-resize.pl:159
26514 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
26519 #: ../tools/virt-resize.pl:161
26521 "(In this case, an extra partition is I<not> created at the end of the disk, "
26522 "because there will be no unused space)."
26526 #: ../tools/virt-resize.pl:164
26528 "L</--resize> is the other commonly used option. The following would "
26529 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
26530 "rest of the available space:"
26534 #: ../tools/virt-resize.pl:168
26537 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
26538 " indisk outdisk\n"
26543 #: ../tools/virt-resize.pl:171
26545 "If the expanded partition in the image contains a filesystem or LVM PV, then "
26546 "if virt-resize knows how, it will resize the contents, the equivalent of "
26547 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
26548 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
26549 "filesystems, so you would have to online resize them after booting the "
26550 "guest. And virt-resize also does not resize anything inside an LVM PV, it "
26551 "just resizes the PV itself and leaves the user to resize any LVs inside that "
26556 #: ../tools/virt-resize.pl:180
26557 msgid "Other options are covered below."
26561 #: ../tools/virt-resize.pl:182
26566 #: ../tools/virt-resize.pl:184
26567 msgid "Thoroughly test the new disk image I<before> discarding the old one."
26571 #: ../tools/virt-resize.pl:186
26572 msgid "If you are using libvirt, edit the XML to point at the new disk:"
26576 #: ../tools/virt-resize.pl:188
26579 " # virsh edit guestname\n"
26584 #: ../tools/virt-resize.pl:190
26586 "Change E<lt>source ...E<gt>, see "
26587 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
26591 #: ../tools/virt-resize.pl:193
26592 msgid "Then start up the domain with the new, resized disk:"
26596 #: ../tools/virt-resize.pl:195
26599 " # virsh start guestname\n"
26604 #: ../tools/virt-resize.pl:197
26606 "and check that it still works. See also the L</NOTES> section below for "
26607 "additional information."
26611 #: ../tools/virt-resize.pl:200
26612 msgid "7. Resize LVs etc inside the guest"
26616 #: ../tools/virt-resize.pl:202
26617 msgid "(This can also be done offline using L<guestfish(1)>)"
26621 #: ../tools/virt-resize.pl:204
26623 "Once the guest has booted you should see the new space available, at least "
26624 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
26625 "may need to resize LVs inside PVs, and also resize filesystem types that "
26626 "virt-resize does not know how to expand."
26630 #: ../tools/virt-resize.pl:211
26631 msgid "SHRINKING A VIRTUAL MACHINE DISK"
26635 #: ../tools/virt-resize.pl:213
26637 "Shrinking is somewhat more complex than expanding, and only an overview is "
26642 #: ../tools/virt-resize.pl:216
26644 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
26645 "filesystems). The user has to shrink content before passing the disk image "
26646 "to virt-resize, and virt-resize will check that the content has been shrunk "
26651 #: ../tools/virt-resize.pl:221
26652 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
26656 #: ../tools/virt-resize.pl:223
26658 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
26659 "steps 3 and 4 above to allocate a new disk image."
26663 #: ../tools/virt-resize.pl:226
26664 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
26668 #: ../tools/virt-resize.pl:229
26669 msgid "IGNORING OR DELETING PARTITIONS"
26673 #: ../tools/virt-resize.pl:231
26675 "virt-resize also gives a convenient way to ignore or delete partitions when "
26676 "copying from the input disk to the output disk. Ignoring a partition speeds "
26677 "up the copy where you don't care about the existing contents of a "
26678 "partition. Deleting a partition removes it completely, but note that it "
26679 "also renumbers any partitions after the one which is deleted, which can "
26680 "leave some guests unbootable."
26684 #: ../tools/virt-resize.pl:238
26685 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
26689 #: ../tools/virt-resize.pl:240
26691 "If the input disk is in qcow2 format, then you may prefer that the output is "
26692 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
26693 "the fly. The output format is simply determined by the format of the empty "
26694 "output container that you provide. Thus to create qcow2 output, use:"
26698 #: ../tools/virt-resize.pl:246
26701 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
26706 #: ../tools/virt-resize.pl:248
26707 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
26711 #: ../tools/virt-resize.pl:250
26712 msgid "Similarly, to get non-sparse raw output use:"
26716 #: ../tools/virt-resize.pl:252
26719 " fallocate -l size outdisk\n"
26724 #: ../tools/virt-resize.pl:254
26726 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
26727 "if=/dev/zero of=outdisk bs=1M count=..>)"
26731 #: ../tools/virt-resize.pl:267
26732 msgid "Display help."
26736 #: ../tools/virt-resize.pl:281
26737 msgid "B<--resize part=size>"
26741 #: ../tools/virt-resize.pl:283
26743 "Resize the named partition (expanding or shrinking it) so that it has the "
26748 #: ../tools/virt-resize.pl:286
26750 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
26751 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
26752 "Exabytes; or as a percentage of the current size; or as a relative number or "
26753 "percentage. For example:"
26757 #: ../tools/virt-resize.pl:291
26760 " --resize /dev/sda2=10G\n"
26765 #: ../tools/virt-resize.pl:293
26768 " --resize /dev/sda4=90%\n"
26773 #: ../tools/virt-resize.pl:295
26776 " --resize /dev/sda2=+1G\n"
26781 #: ../tools/virt-resize.pl:297
26784 " --resize /dev/sda2=-200M\n"
26789 #: ../tools/virt-resize.pl:299
26792 " --resize /dev/sda1=+128K\n"
26797 #: ../tools/virt-resize.pl:301
26800 " --resize /dev/sda1=+10%\n"
26805 #: ../tools/virt-resize.pl:303
26808 " --resize /dev/sda1=-10%\n"
26813 #: ../tools/virt-resize.pl:305
26815 "You can increase the size of any partition. Virt-resize will expand the "
26816 "direct content of the partition if it knows how (see C<--expand> below)."
26820 #: ../tools/virt-resize.pl:309
26822 "You can only I<decrease> the size of partitions that contain filesystems or "
26823 "PVs which have already been shrunk. Virt-resize will check this has been "
26824 "done before proceeding, or else will print an error (see also "
26825 "C<--resize-force>)."
26829 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406 ../tools/virt-resize.pl:423
26830 msgid "You can give this option multiple times."
26834 #: ../tools/virt-resize.pl:320
26835 msgid "B<--resize-force part=size>"
26839 #: ../tools/virt-resize.pl:322
26841 "This is the same as C<--resize> except that it will let you decrease the "
26842 "size of any partition. Generally this means you will lose any data which "
26843 "was at the end of the partition you shrink, but you may not care about that "
26844 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
26845 "as a swap partition)."
26849 #: ../tools/virt-resize.pl:328
26850 msgid "See also the C<--ignore> option."
26854 #: ../tools/virt-resize.pl:334
26855 msgid "B<--expand part>"
26859 #: ../tools/virt-resize.pl:336
26861 "Expand the named partition so it uses up all extra space (space left over "
26862 "after any other resize changes that you request have been done)."
26866 #: ../tools/virt-resize.pl:339
26868 "If virt-resize knows how, it will expand the direct content of the "
26869 "partition. For example, if the partition is an LVM PV, it will expand the "
26870 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
26871 "content it doesn't know about alone."
26875 #: ../tools/virt-resize.pl:344
26876 msgid "Currently virt-resize can resize:"
26880 #: ../tools/virt-resize.pl:350
26882 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
26887 #: ../tools/virt-resize.pl:355
26889 "NTFS filesystems contained directly in a partition, if libguestfs was "
26890 "compiled with support for NTFS."
26894 #: ../tools/virt-resize.pl:358
26896 "The filesystem must have been shut down consistently last time it was used. "
26897 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
26898 "consistency check, so at the first boot after resizing Windows will check "
26903 #: ../tools/virt-resize.pl:365
26905 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
26906 "inside the PV. The user will have to resize LVs as desired."
26910 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
26911 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
26915 #: ../tools/virt-resize.pl:377
26916 msgid "B<--shrink part>"
26920 #: ../tools/virt-resize.pl:379
26922 "Shrink the named partition until the overall disk image fits in the "
26923 "destination. The named partition B<must> contain a filesystem or PV which "
26924 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
26925 "online tools). Virt-resize will check this and give an error if it has not "
26930 #: ../tools/virt-resize.pl:385
26932 "The amount by which the overall disk must be shrunk (after carrying out all "
26933 "other operations requested by the user) is called the \"deficit\". For "
26934 "example, a straight copy (assume no other operations) from a 5GB disk image "
26935 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
26936 "would give an error unless the user specified a partition to shrink and that "
26937 "partition had more than a gigabyte of free space."
26941 #: ../tools/virt-resize.pl:399
26942 msgid "B<--ignore part>"
26946 #: ../tools/virt-resize.pl:401
26948 "Ignore the named partition. Effectively this means the partition is "
26949 "allocated on the destination disk, but the content is not copied across from "
26950 "the source disk. The content of the partition will be blank (all zero "
26955 #: ../tools/virt-resize.pl:412
26956 msgid "B<--delete part>"
26960 #: ../tools/virt-resize.pl:414
26962 "Delete the named partition. It would be more accurate to describe this as "
26963 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
26964 "the original disk image is left intact."
26968 #: ../tools/virt-resize.pl:418
26970 "Note that when you delete a partition, then anything contained in the "
26971 "partition is also deleted. Furthermore, this causes any partitions that "
26972 "come after to be I<renumbered>, which can easily make your guest unbootable."
26976 #: ../tools/virt-resize.pl:429
26977 msgid "B<--LV-expand logvol>"
26981 #: ../tools/virt-resize.pl:431
26983 "This takes the logical volume and, as a final step, expands it to fill all "
26984 "the space available in its volume group. A typical usage, assuming a Linux "
26985 "guest with a single PV C</dev/sda2> and a root device called "
26986 "C</dev/vg_guest/lv_root> would be:"
26990 #: ../tools/virt-resize.pl:436
26993 " virt-resize indisk outdisk \\\n"
26994 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
26999 #: ../tools/virt-resize.pl:439
27001 "This would first expand the partition (and PV), and then expand the root "
27002 "device to fill the extra space in the PV."
27006 #: ../tools/virt-resize.pl:442
27008 "The contents of the LV are also resized if virt-resize knows how to do "
27009 "that. You can stop virt-resize from trying to expand the content by using "
27010 "the option C<--no-expand-content>."
27014 #: ../tools/virt-resize.pl:446
27015 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
27019 #: ../tools/virt-resize.pl:449
27021 "You can give this option multiple times, I<but> it doesn't make sense to do "
27022 "this unless the logical volumes you specify are all in different volume "
27027 #: ../tools/virt-resize.pl:457
27028 msgid "B<--no-copy-boot-loader>"
27032 #: ../tools/virt-resize.pl:459
27034 "By default, virt-resize copies over some sectors at the start of the disk "
27035 "(up to the beginning of the first partition). Commonly these sectors "
27036 "contain the Master Boot Record (MBR) and the boot loader, and are required "
27037 "in order for the guest to boot correctly."
27041 #: ../tools/virt-resize.pl:464
27043 "If you specify this flag, then this initial copy is not done. You may need "
27044 "to reinstall the boot loader in this case."
27048 #: ../tools/virt-resize.pl:472
27049 msgid "B<--no-extra-partition>"
27053 #: ../tools/virt-resize.pl:474
27055 "By default, virt-resize creates an extra partition if there is any extra, "
27056 "unused space after all resizing has happened. Use this option to prevent "
27057 "the extra partition from being created. If you do this then the extra space "
27058 "will be inaccessible until you run fdisk, parted, or some other partitioning "
27059 "tool in the guest."
27063 #: ../tools/virt-resize.pl:480
27065 "Note that if the surplus space is smaller than 10 MB, no extra partition "
27070 #: ../tools/virt-resize.pl:487
27071 msgid "B<--no-expand-content>"
27075 #: ../tools/virt-resize.pl:489
27077 "By default, virt-resize will try to expand the direct contents of "
27078 "partitions, if it knows how (see C<--expand> option above)."
27082 #: ../tools/virt-resize.pl:492
27084 "If you give the C<--no-expand-content> option then virt-resize will not "
27089 #: ../tools/virt-resize.pl:499
27090 msgid "B<-d> | B<--debug>"
27094 #: ../tools/virt-resize.pl:507
27095 msgid "B<-n> | B<--dryrun>"
27099 #: ../tools/virt-resize.pl:509
27100 msgid "Print a summary of what would be done, but don't do anything."
27104 #: ../tools/virt-resize.pl:515
27105 msgid "B<-q> | B<--quiet>"
27109 #: ../tools/virt-resize.pl:517
27110 msgid "Don't print the summary."
27114 #: ../tools/virt-resize.pl:525
27116 "Specify the format of the input disk image. If this flag is not given then "
27117 "it is auto-detected from the image itself."
27121 #: ../tools/virt-resize.pl:531
27123 "Note that this option I<does not> affect the output format. See L</QCOW2 "
27124 "AND NON-SPARSE RAW FORMATS>."
27128 #: ../tools/virt-resize.pl:538
27129 msgid "B<--output-format> raw"
27133 #: ../tools/virt-resize.pl:540
27135 "Specify the format of the output disk image. If this flag is not given then "
27136 "it is auto-detected from the image itself."
27140 #: ../tools/virt-resize.pl:546
27142 "Note that you still need to create the output disk with the right format. "
27143 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
27147 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
27152 #: ../tools/virt-resize.pl:1424
27153 msgid "\"Partition 1 does not end on cylinder boundary.\""
27157 #: ../tools/virt-resize.pl:1426
27159 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
27160 "means the partitions will not be aligned to the ancient CHS geometry. "
27161 "However CHS geometry is meaningless for disks manufactured since the early "
27162 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
27163 "cylinders is not required by any modern operating system."
27167 #: ../tools/virt-resize.pl:1433
27168 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
27172 #: ../tools/virt-resize.pl:1435
27174 "In Windows Vista and later versions, Microsoft switched to using a separate "
27175 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
27176 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
27177 "the boot partition. Doing so seems to break the guest completely. However "
27178 "expanding the second partition (ie. C: drive) should work."
27182 #: ../tools/virt-resize.pl:1442
27184 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
27185 "NTFS partitions have been expanded. This is just a safety check and (unless "
27186 "it find errors) is nothing to worry about."
27190 #: ../tools/virt-resize.pl:1446
27191 msgid "GUEST BOOT STUCK AT \"GRUB\""
27195 #: ../tools/virt-resize.pl:1448
27197 "If a Linux guest does not boot after resizing, and the boot is stuck after "
27198 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
27199 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
27200 "although we think is to do with partition alignment."
27204 #: ../tools/virt-resize.pl:1453
27207 " guestfish -i -a newdisk\n"
27208 " ><fs> cat /boot/grub/device.map\n"
27209 " # check the contents of this file are sensible or\n"
27210 " # edit the file if necessary\n"
27211 " ><fs> grub-install / /dev/vda\n"
27217 #: ../tools/virt-resize.pl:1460
27219 "For more flexible guest reconfiguration, including if you need to specify "
27220 "other parameters to grub-install, use L<virt-rescue(1)>."
27224 #: ../tools/virt-resize.pl:1463
27225 msgid "ALTERNATIVE TOOLS"
27229 #: ../tools/virt-resize.pl:1465
27231 "There are several proprietary tools for resizing partitions. We won't "
27232 "mention any here."
27236 #: ../tools/virt-resize.pl:1468
27238 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
27239 "operations on disk images. They can resize and move partitions, but I don't "
27240 "think they can do anything with the contents, and they certainly don't "
27245 #: ../tools/virt-resize.pl:1473
27247 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
27248 "but at a much lower level. You will probably end up hand-calculating sector "
27249 "offsets, which is something that virt-resize was designed to avoid. If you "
27250 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
27255 #: ../tools/virt-resize.pl:1488
27257 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
27258 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
27259 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, "
27260 "L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, "
27261 "L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
27265 #: ../tools/virt-list-filesystems.pl:32
27266 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
27270 #: ../tools/virt-list-filesystems.pl:36
27273 " virt-list-filesystems [--options] domname\n"
27278 #: ../tools/virt-list-filesystems.pl:38
27281 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
27286 #: ../tools/virt-list-filesystems.pl:42
27288 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
27289 "are contained in a virtual machine or disk image."
27293 #: ../tools/virt-list-filesystems.pl:46
27295 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
27296 "functionality. For more complex cases you should look at the "
27297 "L<guestfish(1)> tool."
27301 #: ../tools/virt-list-filesystems.pl:105
27303 "With this option, C<virt-list-filesystems> displays the type of each "
27304 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
27308 #: ../tools/virt-list-filesystems.pl:112
27309 msgid "B<-a> | B<--all>"
27313 #: ../tools/virt-list-filesystems.pl:114
27315 "Normally we only show mountable filesystems. If this option is given then "
27316 "swap devices are shown too."
27320 #: ../tools/virt-list-filesystems.pl:188
27322 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
27323 "L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27324 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27328 #: ../tools/virt-tar.pl:33
27329 msgid "virt-tar - Extract or upload files to a virtual machine"
27333 #: ../tools/virt-tar.pl:37
27336 " virt-tar [--options] -x domname directory tarball\n"
27341 #: ../tools/virt-tar.pl:39
27344 " virt-tar [--options] -u domname tarball directory\n"
27349 #: ../tools/virt-tar.pl:41
27352 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
27357 #: ../tools/virt-tar.pl:43
27360 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
27365 #: ../tools/virt-tar.pl:47
27366 msgid "Download C</home> from the VM into a local tarball:"
27370 #: ../tools/virt-tar.pl:49
27373 " virt-tar -x domname /home home.tar\n"
27378 #: ../tools/virt-tar.pl:51
27381 " virt-tar -zx domname /home home.tar.gz\n"
27386 #: ../tools/virt-tar.pl:53
27387 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
27391 #: ../tools/virt-tar.pl:55
27394 " virt-tar -u domname uploadstuff.tar /tmp\n"
27399 #: ../tools/virt-tar.pl:57
27402 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
27407 #: ../tools/virt-tar.pl:61
27409 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
27410 "virtual machines. If you do this, you risk disk corruption in the VM. "
27411 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
27415 #: ../tools/virt-tar.pl:66
27417 "You can use C<-x> (extract) on live virtual machines, but you might get "
27418 "inconsistent results or errors if there is filesystem activity inside the "
27419 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
27420 "work, but the only way to guarantee consistent results is if the virtual "
27421 "machine is shut down."
27425 #: ../tools/virt-tar.pl:74
27427 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
27428 "parts of a guest filesystem. There are many possibilities: making backups, "
27429 "uploading data files, snooping on guest activity, fixing or customizing "
27434 #: ../tools/virt-tar.pl:79
27436 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
27437 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
27438 "should look at the L<guestfish(1)> tool."
27442 #: ../tools/virt-tar.pl:83
27444 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
27445 "its contents (recursively) from the virtual machine into a local tarball. "
27446 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
27447 "virtual machine. You cannot use these two options together."
27451 #: ../tools/virt-tar.pl:89
27453 "In addition, you may need to use the C<-z> (gZip) option to enable "
27454 "compression. When uploading, you have to specify C<-z> if the upload file "
27455 "is compressed because virt-tar won't detect this on its own."
27459 #: ../tools/virt-tar.pl:93
27461 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
27462 "example it cannot do PKZip files or bzip2 compression. If you want that "
27463 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
27464 "the L<libguestfs(3)> API)."
27468 #: ../tools/virt-tar.pl:151
27469 msgid "B<-x> | B<--extract> | B<--download>"
27473 #: ../tools/virt-tar.pl:153
27474 msgid "B<-u> | B<--upload>"
27478 #: ../tools/virt-tar.pl:155
27480 "Use C<-x> to extract (download) a directory from a virtual machine to a "
27485 #: ../tools/virt-tar.pl:158
27487 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
27488 "Please read the L</WARNING> section above before using this option."
27492 #: ../tools/virt-tar.pl:162
27493 msgid "You must specify exactly one of these options."
27497 #: ../tools/virt-tar.pl:168
27498 msgid "B<-z> | B<--gzip>"
27502 #: ../tools/virt-tar.pl:170
27503 msgid "Specify that the input or output tarball is gzip-compressed."
27507 #: ../tools/virt-tar.pl:283
27509 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
27510 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
27511 "L<http://libguestfs.org/>."
27515 #: ../tools/virt-rescue.pl:33
27516 msgid "virt-rescue - Run a rescue shell on a virtual machine"
27520 #: ../tools/virt-rescue.pl:37
27523 " virt-rescue [--options] domname\n"
27528 #: ../tools/virt-rescue.pl:39
27531 " virt-rescue [--options] disk.img [disk.img ...]\n"
27536 #: ../tools/virt-rescue.pl:43
27538 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
27539 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
27540 "you from doing this, but doesn't catch all cases."
27544 #: ../tools/virt-rescue.pl:47
27546 "However if you use the I<--ro> (read only) option, then you can attach a "
27547 "shell to a live virtual machine. The results might be strange or "
27548 "inconsistent at times but you won't get disk corruption."
27552 #: ../tools/virt-rescue.pl:53
27554 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
27555 "need for a CD. virt-rescue gives you a rescue shell and some simple "
27556 "recovery tools which you can use to examine or rescue a virtual machine or "
27561 #: ../tools/virt-rescue.pl:58
27563 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
27564 "on disk image(s):"
27568 #: ../tools/virt-rescue.pl:61
27571 " virt-rescue GuestName\n"
27576 #: ../tools/virt-rescue.pl:63
27579 " virt-rescue --ro /path/to/disk.img\n"
27584 #: ../tools/virt-rescue.pl:65
27587 " virt-rescue /dev/sdc\n"
27592 #: ../tools/virt-rescue.pl:67
27593 msgid "For live VMs you I<must> use the --ro option."
27597 #: ../tools/virt-rescue.pl:69
27599 "When you run virt-rescue on a virtual machine or disk image, you are placed "
27600 "in an interactive bash shell where you can use many ordinary Linux "
27601 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
27602 "appliance. You must mount the virtual machine's filesystems by hand. There "
27603 "is an empty directory called C</sysroot> where you can mount filesystems."
27607 #: ../tools/virt-rescue.pl:76
27609 "In the example below, we list logical volumes, then choose one to mount "
27610 "under C</sysroot>:"
27614 #: ../tools/virt-rescue.pl:79
27618 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
27619 " lv_root vg_f11x64 -wi-a- 8.83G\n"
27620 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
27621 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
27622 " ><rescue> ls /sysroot\n"
27627 #: ../tools/virt-rescue.pl:86
27629 "If you don't know what filesystems are available on the virtual machine then "
27630 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
27634 #: ../tools/virt-rescue.pl:92
27636 "Virt-rescue can be used on I<any> disk image file or device, not just a "
27637 "virtual machine. For example you can use it on a blank file if you want to "
27638 "partition that file (although we would recommend using L<guestfish(1)> "
27639 "instead as it is more suitable for this purpose). You can even use "
27640 "virt-rescue on things like SD cards."
27644 #: ../tools/virt-rescue.pl:98
27646 "This tool is just designed for quick interactive hacking on a virtual "
27647 "machine. For more structured access to a virtual machine disk image, you "
27648 "should use L<guestfs(3)>. To get a structured shell that you can use to "
27649 "make scripted changes to guests, use L<guestfish(1)>."
27653 #: ../tools/virt-rescue.pl:127
27654 msgid "B<--append kernelopts>"
27658 #: ../tools/virt-rescue.pl:129
27659 msgid "Pass additional options to the rescue kernel."
27663 #: ../tools/virt-rescue.pl:164
27664 msgid "B<--memsize MB> | B<-m MB>"
27668 #: ../tools/virt-rescue.pl:166
27670 "Change the amount of memory allocated to the rescue system. The default is "
27671 "set by libguestfs and is small but adequate for running system tools. The "
27672 "occasional program might need more memory. The parameter is specified in "
27677 #: ../tools/virt-rescue.pl:175
27678 msgid "B<--network MB>"
27682 #: ../tools/virt-rescue.pl:177
27683 msgid "Enable QEMU user networking in the guest."
27687 #: ../tools/virt-rescue.pl:183
27688 msgid "B<--ro> | B<-r>"
27692 #: ../tools/virt-rescue.pl:185
27693 msgid "Open the image read-only."
27697 #: ../tools/virt-rescue.pl:197
27699 "Enable SELinux in the rescue appliance. You should read "
27700 "L<guestfs(3)/SELINUX> before using this option."
27704 #: ../tools/virt-rescue.pl:257
27706 "Several environment variables affect virt-rescue. See "
27707 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
27711 #: ../tools/virt-rescue.pl:269
27713 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
27714 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27718 #: ../tools/virt-make-fs.pl:37
27719 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
27723 #: ../tools/virt-make-fs.pl:41
27726 " virt-make-fs [--options] input.tar output.img\n"
27731 #: ../tools/virt-make-fs.pl:43
27734 " virt-make-fs [--options] input.tar.gz output.img\n"
27739 #: ../tools/virt-make-fs.pl:45
27742 " virt-make-fs [--options] directory output.img\n"
27747 #: ../tools/virt-make-fs.pl:49
27749 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
27750 "archive or some files in a directory. It is similar to tools like "
27751 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
27752 "it can create common filesystem types like ext2/3 or NTFS, which can be "
27753 "useful if you want to attach these filesystems to existing virtual machines "
27754 "(eg. to import large amounts of read-only data to a VM)."
27758 #: ../tools/virt-make-fs.pl:57
27759 msgid "Basic usage is:"
27763 #: ../tools/virt-make-fs.pl:59
27766 " virt-make-fs input output\n"
27771 #: ../tools/virt-make-fs.pl:61
27773 "where C<input> is either a directory containing files that you want to add, "
27774 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
27775 "C<output> is a disk image. The input type is detected automatically. The "
27776 "output disk image defaults to a raw ext2 image unless you specify extra "
27777 "flags (see L</OPTIONS> below)."
27781 #: ../tools/virt-make-fs.pl:67
27782 msgid "EXTRA SPACE"
27786 #: ../tools/virt-make-fs.pl:69
27788 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
27789 "the files that it contains, but might have extra space. Depending on how "
27790 "you are going to use the output, you might think this extra space is wasted "
27791 "and want to minimize it, or you might want to leave space so that more files "
27792 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
27793 "but you can use the C<--size> flag to leave space in the filesystem if you "
27798 #: ../tools/virt-make-fs.pl:77
27800 "An alternative way to leave extra space but not make the output image any "
27801 "bigger is to use an alternative disk image format (instead of the default "
27802 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
27803 "image format (check your hypervisor supports this before using it). This "
27804 "allows you to choose a large C<--size> but the extra space won't actually be "
27805 "allocated in the image until you try to store something in it."
27809 #: ../tools/virt-make-fs.pl:85
27811 "Don't forget that you can also use local commands including L<resize2fs(8)> "
27812 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
27813 "virt-make-resize to build another image from scratch."
27817 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
27822 #: ../tools/virt-make-fs.pl:91
27825 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
27830 #: ../tools/virt-make-fs.pl:93
27831 msgid "FILESYSTEM TYPE"
27835 #: ../tools/virt-make-fs.pl:95
27837 "The default filesystem type is C<ext2>. Just about any filesystem type that "
27838 "libguestfs supports can be used (but I<not> read-only formats like "
27839 "ISO9660). Here are some of the more common choices:"
27843 #: ../tools/virt-make-fs.pl:101
27848 #: ../tools/virt-make-fs.pl:103
27850 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
27851 "you are not going to use the filesystem in a way that requires the journal, "
27852 "then this is just wasted overhead."
27856 #: ../tools/virt-make-fs.pl:107
27857 msgid "I<ntfs> or I<vfat>"
27861 #: ../tools/virt-make-fs.pl:109
27862 msgid "Useful if exporting data to a Windows guest."
27866 #: ../tools/virt-make-fs.pl:111
27868 "I<Note for vfat>: The tar archive or local directory must only contain files "
27869 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
27870 "program running within libguestfs is unable to change the ownership of "
27871 "non-root files, since vfat itself does not support this."
27875 #: ../tools/virt-make-fs.pl:116
27880 #: ../tools/virt-make-fs.pl:118
27882 "Lower overhead than C<ext2>, but certain limitations on filename length and "
27883 "total filesystem size."
27887 #: ../tools/virt-make-fs.pl:125
27890 " virt-make-fs --type=minix input minixfs.img\n"
27895 #: ../tools/virt-make-fs.pl:127
27896 msgid "TO PARTITION OR NOT TO PARTITION"
27900 #: ../tools/virt-make-fs.pl:129
27901 msgid "Optionally virt-make-fs can add a partition table to the output disk."
27905 #: ../tools/virt-make-fs.pl:131
27907 "Adding a partition can make the disk image more compatible with certain "
27908 "virtualized operating systems which don't expect to see a filesystem "
27909 "directly located on a block device (Linux doesn't care and will happily "
27910 "handle both types)."
27914 #: ../tools/virt-make-fs.pl:136
27916 "On the other hand, if you have a partition table then the output image is no "
27917 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
27918 "directly on a partitioned disk image. (However libguestfs tools such as "
27919 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
27923 #: ../tools/virt-make-fs.pl:144
27924 msgid "Add an MBR partition:"
27928 #: ../tools/virt-make-fs.pl:146
27931 " virt-make-fs --partition -- input disk.img\n"
27936 #: ../tools/virt-make-fs.pl:148
27938 "If the output disk image could be terabyte-sized or larger, it's better to "
27939 "use an EFI/GPT-compatible partition table:"
27943 #: ../tools/virt-make-fs.pl:151
27946 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
27951 #: ../tools/virt-make-fs.pl:179
27952 msgid "Enable debugging information."
27956 #: ../tools/virt-make-fs.pl:185
27957 msgid "B<--size=E<lt>NE<gt>>"
27961 #: ../tools/virt-make-fs.pl:187
27962 msgid "B<--size=+E<lt>NE<gt>>"
27966 #: ../tools/virt-make-fs.pl:189
27967 msgid "B<-s E<lt>NE<gt>>"
27971 #: ../tools/virt-make-fs.pl:191
27972 msgid "B<-s +E<lt>NE<gt>>"
27976 #: ../tools/virt-make-fs.pl:193
27977 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
27981 #: ../tools/virt-make-fs.pl:196
27983 "If this option is I<not> given, then the output image will be just large "
27984 "enough to contain all the files, with not much wasted space."
27988 #: ../tools/virt-make-fs.pl:199
27990 "To choose a fixed size output disk, specify an absolute number followed by "
27991 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
27992 "Petabytes or Exabytes. This must be large enough to contain all the input "
27993 "files, else you will get an error."
27997 #: ../tools/virt-make-fs.pl:204
27999 "To leave extra space, specify C<+> (plus sign) and a number followed by "
28000 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28001 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
28002 "the input files, and (approximately) an extra 200 MB free space."
28006 #: ../tools/virt-make-fs.pl:210
28008 "Note that virt-make-fs estimates free space, and therefore will not produce "
28009 "filesystems containing precisely the free space requested. (It is much more "
28010 "expensive and time-consuming to produce a filesystem which has precisely the "
28011 "desired free space)."
28015 #: ../tools/virt-make-fs.pl:219
28016 msgid "B<--format=E<lt>fmtE<gt>>"
28020 #: ../tools/virt-make-fs.pl:221
28021 msgid "B<-F E<lt>fmtE<gt>>"
28025 #: ../tools/virt-make-fs.pl:223
28026 msgid "Choose the output disk image format."
28030 #: ../tools/virt-make-fs.pl:225
28031 msgid "The default is C<raw> (raw disk image)."
28035 #: ../tools/virt-make-fs.pl:227
28037 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
28038 "that would really make sense here is C<qcow2>."
28042 #: ../tools/virt-make-fs.pl:234
28043 msgid "B<--type=E<lt>fsE<gt>>"
28047 #: ../tools/virt-make-fs.pl:236
28048 msgid "B<-t E<lt>fsE<gt>>"
28052 #: ../tools/virt-make-fs.pl:238
28053 msgid "Choose the output filesystem type."
28057 #: ../tools/virt-make-fs.pl:240
28058 msgid "The default is C<ext2>."
28062 #: ../tools/virt-make-fs.pl:242
28063 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
28067 #: ../tools/virt-make-fs.pl:249
28068 msgid "B<--partition>"
28072 #: ../tools/virt-make-fs.pl:251
28073 msgid "B<--partition=E<lt>parttypeE<gt>>"
28077 #: ../tools/virt-make-fs.pl:253
28079 "If specified, this flag adds an MBR partition table to the output disk "
28084 #: ../tools/virt-make-fs.pl:256
28086 "You can change the partition table type, eg. C<--partition=gpt> for large "
28091 #: ../tools/virt-make-fs.pl:259
28093 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
28094 "might consider the next parameter to be the partition type. For example:"
28098 #: ../tools/virt-make-fs.pl:263
28101 " virt-make-fs --partition input.tar ...\n"
28106 #: ../tools/virt-make-fs.pl:265
28108 "would cause virt-make-fs to think you wanted to use a partition type of "
28109 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
28110 "dash) between options and the input file argument:"
28114 #: ../tools/virt-make-fs.pl:269
28117 " virt-make-fs --partition -- input.tar ...\n"
28122 #: ../tools/virt-make-fs.pl:536
28124 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
28125 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
28126 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28130 #: ../tools/virt-make-fs.pl:553
28133 " export LIBGUESTFS_DEBUG=1\n"
28134 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
28139 #: ../tools/virt-make-fs.pl:556
28141 "Attach /tmp/virt-make-fs.log to a new bug report at "
28142 "L<https://bugzilla.redhat.com/>"
28146 #: ../tools/virt-list-partitions.pl:32
28147 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
28151 #: ../tools/virt-list-partitions.pl:36
28154 " virt-list-partitions [--options] domname\n"
28159 #: ../tools/virt-list-partitions.pl:38
28162 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
28167 #: ../tools/virt-list-partitions.pl:42
28169 "C<virt-list-partitions> is a command line tool to list the partitions that "
28170 "are contained in a virtual machine or disk image. It is mainly useful as a "
28171 "first step to using L<virt-resize(1)>."
28175 #: ../tools/virt-list-partitions.pl:47
28177 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
28178 "functionality. For more complex cases you should look at the "
28179 "L<guestfish(1)> tool."
28183 #: ../tools/virt-list-partitions.pl:104
28184 msgid "B<-h> | B<--human-readable>"
28188 #: ../tools/virt-list-partitions.pl:106
28189 msgid "Show sizes in human-readable form (eg. \"1G\")."
28193 #: ../tools/virt-list-partitions.pl:114
28195 "With this option, C<virt-list-partitions> displays the type and size of each "
28196 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
28200 #: ../tools/virt-list-partitions.pl:121
28201 msgid "B<-t> | B<--total>"
28205 #: ../tools/virt-list-partitions.pl:123
28206 msgid "Display the total size of each block device (as a separate row or rows)."
28210 #: ../tools/virt-list-partitions.pl:256
28212 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, "
28213 "L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
28214 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."