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.5.19\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2010-09-22 21:43+0200\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:36 ../tools/virt-cat.pl:30 ../tools/virt-df.pl:32 ../tools/virt-edit.pl:31 ../tools/virt-list-filesystems.pl:28 ../tools/virt-list-partitions.pl:28 ../tools/virt-ls.pl:31 ../tools/virt-make-fs.pl:33 ../tools/virt-rescue.pl:29 ../tools/virt-resize.pl:38 ../tools/virt-tar.pl:30 ../tools/virt-win-reg.pl:34
25 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pl:38 ../tools/virt-cat.pl:32 ../tools/virt-df.pl:34 ../tools/virt-edit.pl:33 ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30 ../tools/virt-ls.pl:33 ../tools/virt-make-fs.pl:35 ../tools/virt-rescue.pl:31 ../tools/virt-resize.pl:40 ../tools/virt-tar.pl:32 ../tools/virt-win-reg.pl:36
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:42 ../tools/virt-cat.pl:36 ../tools/virt-df.pl:38 ../tools/virt-edit.pl:37 ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34 ../tools/virt-ls.pl:37 ../tools/virt-make-fs.pl:39 ../tools/virt-rescue.pl:35 ../tools/virt-resize.pl:44 ../tools/virt-tar.pl:36 ../tools/virt-win-reg.pl:40
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:115 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:16 ../inspector/virt-inspector.pl:48 ../tools/virt-cat.pl:42 ../tools/virt-df.pl:46 ../tools/virt-edit.pl:51 ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40 ../tools/virt-ls.pl:43 ../tools/virt-make-fs.pl:47 ../tools/virt-rescue.pl:51 ../tools/virt-resize.pl:50 ../tools/virt-tar.pl:73 ../tools/virt-win-reg.pl:64
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 "You can add a disk read-only using L</guestfs_add_drive_ro>, in which case "
276 "libguestfs won't modify the file."
280 #: ../src/guestfs.pod:130
282 "Be extremely cautious if the disk image is in use, eg. if it is being used "
283 "by a virtual machine. Adding it read-write will almost certainly cause disk "
284 "corruption, but adding it read-only is safe."
288 #: ../src/guestfs.pod:134
290 "You must add at least one disk image, and you may add multiple disk images. "
291 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
292 "first one you added), C</dev/sdb> (for the second one you added), etc."
296 #: ../src/guestfs.pod:139
298 "Once L</guestfs_launch> has been called you cannot add any more images. You "
299 "can call L</guestfs_list_devices> to get a list of the device names, in the "
300 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
304 #: ../src/guestfs.pod:144
309 #: ../src/guestfs.pod:146
311 "Before you can read or write files, create directories and so on in a disk "
312 "image that contains filesystems, you have to mount those filesystems using "
313 "L</guestfs_mount>. If you already know that a disk image contains (for "
314 "example) one partition with a filesystem on that partition, then you can "
319 #: ../src/guestfs.pod:152
322 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
327 #: ../src/guestfs.pod:154
329 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
330 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
331 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
335 #: ../src/guestfs.pod:158
337 "If you are given a disk image and you don't know what it contains then you "
338 "have to find out. Libguestfs can do that too: use "
339 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
340 "and LVs, and either try mounting each to see what is mountable, or else "
341 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also "
342 "has a set of APIs for inspection of disk images (see L</INSPECTION> below). "
343 "But you might find it easier to look at higher level programs built on top "
344 "of libguestfs, in particular L<virt-inspector(1)>."
348 #: ../src/guestfs.pod:168
350 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
351 "several other variations of the C<guestfs_mount_*> call."
355 #: ../src/guestfs.pod:171
356 msgid "FILESYSTEM ACCESS AND MODIFICATION"
360 #: ../src/guestfs.pod:173
362 "The majority of the libguestfs API consists of fairly low-level calls for "
363 "accessing and modifying the files, directories, symlinks etc on mounted "
364 "filesystems. There are over a hundred such calls which you can find listed "
365 "in detail below in this man page, and we don't even pretend to cover them "
366 "all in this overview."
370 #: ../src/guestfs.pod:179
372 "Specify filenames as full paths, starting with C<\"/\"> and including the "
377 #: ../src/guestfs.pod:182
379 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
380 "the file called C<\"etc/passwd\"> then you could do:"
384 #: ../src/guestfs.pod:185
387 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
392 #: ../src/guestfs.pod:187
394 "This would return C<data> as a newly allocated buffer containing the full "
395 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
396 "or C<NULL> if there was an error."
400 #: ../src/guestfs.pod:191
402 "As another example, to create a top-level directory on that filesystem "
403 "called C<\"var\"> you would do:"
407 #: ../src/guestfs.pod:194
410 " guestfs_mkdir (g, \"/var\");\n"
415 #: ../src/guestfs.pod:196
416 msgid "To create a symlink you could do:"
420 #: ../src/guestfs.pod:198
423 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
424 " \"/etc/rc3.d/S30portmap\");\n"
429 #: ../src/guestfs.pod:201
431 "Libguestfs will reject attempts to use relative paths and there is no "
432 "concept of a current working directory."
436 #: ../src/guestfs.pod:204
438 "Libguestfs can return errors in many situations: for example if the "
439 "filesystem isn't writable, or if a file or directory that you requested "
440 "doesn't exist. If you are using the C API (documented here) you have to "
441 "check for those error conditions after each call. (Other language bindings "
442 "turn these errors into exceptions)."
446 #: ../src/guestfs.pod:210
448 "File writes are affected by the per-handle umask, set by calling "
449 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
453 #: ../src/guestfs.pod:213
458 #: ../src/guestfs.pod:215
460 "Libguestfs contains API calls to read, create and modify partition tables on "
465 #: ../src/guestfs.pod:218
467 "In the common case where you want to create a single partition covering the "
468 "whole disk, you should use the L</guestfs_part_disk> call:"
472 #: ../src/guestfs.pod:222
475 " const char *parttype = \"mbr\";\n"
476 " if (disk_is_larger_than_2TB)\n"
477 " parttype = \"gpt\";\n"
478 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
483 #: ../src/guestfs.pod:227
485 "Obviously this effectively wipes anything that was on that disk image "
490 #: ../src/guestfs.pod:230
495 #: ../src/guestfs.pod:232
497 "Libguestfs provides access to a large part of the LVM2 API, such as "
498 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
499 "unless you familiarize yourself with the concepts of physical volumes, "
500 "volume groups and logical volumes."
504 #: ../src/guestfs.pod:237
506 "This author strongly recommends reading the LVM HOWTO, online at "
507 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
511 #: ../src/guestfs.pod:240
516 #: ../src/guestfs.pod:242
518 "Use L</guestfs_cat> to download small, text only files. This call is "
519 "limited to files which are less than 2 MB and which cannot contain any ASCII "
520 "NUL (C<\\0>) characters. However it has a very simple to use API."
524 #: ../src/guestfs.pod:247
526 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
527 "bit data, since it returns a (pointer, size) pair. However it is still "
528 "limited to \"small\" files, less than 2 MB."
532 #: ../src/guestfs.pod:251
534 "L</guestfs_download> can be used to download any file, with no limits on "
535 "content or size (even files larger than 4 GB)."
539 #: ../src/guestfs.pod:254
540 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
544 #: ../src/guestfs.pod:257
549 #: ../src/guestfs.pod:259
551 "It's often the case that you want to write a file or files to the disk "
556 #: ../src/guestfs.pod:262
558 "To write a small file with fixed content, use L</guestfs_write>. To create "
559 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
560 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
561 "variety of other functions for creating test files, for example "
562 "L</guestfs_fill> and L</guestfs_fill_pattern>."
566 #: ../src/guestfs.pod:268
568 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
569 "file content or size (even files larger than 4 GB)."
573 #: ../src/guestfs.pod:271
574 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
578 #: ../src/guestfs.pod:273
580 "However the fastest way to upload I<large numbers of arbitrary files> is to "
581 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
582 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
583 "the drive in a predictable way (eg. adding it last after all other drives) "
584 "then you can get the device name from L</guestfs_list_devices> and mount it "
585 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
586 "sometimes non-portable between kernel versions, and they don't support "
587 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
588 "using a label or UUID, use an ISO image instead."
592 #: ../src/guestfs.pod:284
597 #: ../src/guestfs.pod:286
599 "There are various different commands for copying between files and devices "
600 "and in and out of the guest filesystem. These are summarised in the table "
605 #: ../src/guestfs.pod:292
606 msgid "B<file> to B<file>"
610 #: ../src/guestfs.pod:294
612 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
613 "directories recursively."
617 #: ../src/guestfs.pod:297
618 msgid "B<file or device> to B<file or device>"
622 #: ../src/guestfs.pod:299
624 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
625 "devices in the guest."
629 #: ../src/guestfs.pod:302
630 msgid "Example: duplicate the contents of an LV:"
634 #: ../src/guestfs.pod:304
637 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
642 #: ../src/guestfs.pod:306
644 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
645 "(C</dev/VG/Original>). To copy less than the whole source device, use "
646 "L</guestfs_copy_size>."
650 #: ../src/guestfs.pod:310
651 msgid "B<file on the host> to B<file or device>"
655 #: ../src/guestfs.pod:312
656 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
660 #: ../src/guestfs.pod:314
661 msgid "B<file or device> to B<file on the host>"
665 #: ../src/guestfs.pod:316
666 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
670 #: ../src/guestfs.pod:320
671 msgid "LISTING FILES"
675 #: ../src/guestfs.pod:322
677 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
678 "L<guestfish(1)>-equivalent command C<ll>)."
682 #: ../src/guestfs.pod:325
684 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
685 "programs, as a flat list of strings."
689 #: ../src/guestfs.pod:328
691 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
692 "directory, plus additional information about each one. It is more "
693 "equivalent to using the L<readdir(3)> call on a local filesystem."
697 #: ../src/guestfs.pod:332
699 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
704 #: ../src/guestfs.pod:335
705 msgid "RUNNING COMMANDS"
709 #: ../src/guestfs.pod:337
711 "Although libguestfs is primarily an API for manipulating files inside guest "
712 "images, we also provide some limited facilities for running commands inside "
717 #: ../src/guestfs.pod:341
718 msgid "There are many limitations to this:"
722 #: ../src/guestfs.pod:345 ../src/guestfs.pod:350 ../src/guestfs.pod:355 ../src/guestfs.pod:359 ../src/guestfs.pod:364 ../src/guestfs.pod:368 ../src/guestfs.pod:373 ../src/guestfs.pod:1223 ../src/guestfs.pod:1228 ../src/guestfs.pod:1232 ../src/guestfs.pod:1334 ../src/guestfs.pod:1338 ../src/guestfs.pod:1342 ../src/guestfs.pod:1347 ../src/guestfs.pod:1355 ../src/guestfs.pod:1374 ../src/guestfs.pod:1382 ../src/guestfs.pod:1612 ../src/guestfs.pod:1618 ../src/guestfs.pod:1623 ../src/guestfs.pod:1629 ../src/guestfs.pod:1736 ../src/guestfs.pod:1740 ../src/guestfs.pod:1744 ../src/guestfs.pod:1748 ../src/guestfs-actions.pod:14 ../src/guestfs-actions.pod:21 ../src/guestfs-actions.pod:372 ../src/guestfs-actions.pod:380 ../src/guestfs-actions.pod:387 ../src/guestfs-actions.pod:394 ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1293 ../src/guestfs-actions.pod:1297 ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:1313 ../src/guestfs-actions.pod:1323 ../src/guestfs-actions.pod:1327 ../src/guestfs-actions.pod:1331 ../src/guestfs-actions.pod:1454 ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:1463 ../src/guestfs-actions.pod:1468 ../src/guestfs-actions.pod:1520 ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1529 ../fish/guestfish.pod:316 ../fish/guestfish.pod:320 ../fish/guestfish.pod:324 ../fish/guestfish.pod:328 ../fish/guestfish-actions.pod:15 ../fish/guestfish-actions.pod:22 ../fish/guestfish-actions.pod:306 ../fish/guestfish-actions.pod:314 ../fish/guestfish-actions.pod:321 ../fish/guestfish-actions.pod:328 ../fish/guestfish-actions.pod:1023 ../fish/guestfish-actions.pod:1027 ../fish/guestfish-actions.pod:1031 ../fish/guestfish-actions.pod:1035 ../fish/guestfish-actions.pod:1043 ../fish/guestfish-actions.pod:1047 ../fish/guestfish-actions.pod:1051 ../fish/guestfish-actions.pod:1061 ../fish/guestfish-actions.pod:1065 ../fish/guestfish-actions.pod:1069 ../fish/guestfish-actions.pod:1159 ../fish/guestfish-actions.pod:1163 ../fish/guestfish-actions.pod:1168 ../fish/guestfish-actions.pod:1173 ../fish/guestfish-actions.pod:1215 ../fish/guestfish-actions.pod:1219 ../fish/guestfish-actions.pod:1224 ../tools/virt-df.pl:144 ../tools/virt-df.pl:150 ../tools/virt-resize.pl:324 ../tools/virt-resize.pl:329 ../tools/virt-resize.pl:339
727 #: ../src/guestfs.pod:347
729 "The kernel version that the command runs under will be different from what "
734 #: ../src/guestfs.pod:352
736 "If the command needs to communicate with daemons, then most likely they "
741 #: ../src/guestfs.pod:357
742 msgid "The command will be running in limited memory."
746 #: ../src/guestfs.pod:361
748 "The network may not be available unless you enable it (see "
749 "L</guestfs_set_network>)."
753 #: ../src/guestfs.pod:366
754 msgid "Only supports Linux guests (not Windows, BSD, etc)."
758 #: ../src/guestfs.pod:370
759 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
763 #: ../src/guestfs.pod:375
765 "For SELinux guests, you may need to enable SELinux and load policy first. "
766 "See L</SELINUX> in this manpage."
770 #: ../src/guestfs.pod:380
772 "The two main API calls to run commands are L</guestfs_command> and "
773 "L</guestfs_sh> (there are also variations)."
777 #: ../src/guestfs.pod:383
779 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
780 "shell globs, redirections, etc will work."
784 #: ../src/guestfs.pod:386
785 msgid "CONFIGURATION FILES"
789 #: ../src/guestfs.pod:388
791 "To read and write configuration files in Linux guest filesystems, we "
792 "strongly recommend using Augeas. For example, Augeas understands how to "
793 "read and write, say, a Linux shadow password file or X.org configuration "
794 "file, and so avoids you having to write that code."
798 #: ../src/guestfs.pod:393
800 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
801 "document Augeas itself here because there is excellent documentation on the "
802 "L<http://augeas.net/> website."
806 #: ../src/guestfs.pod:397
808 "If you don't want to use Augeas (you fool!) then try calling "
809 "L</guestfs_read_lines> to get the file as a list of lines which you can "
814 #: ../src/guestfs.pod:401
819 #: ../src/guestfs.pod:403
821 "We support SELinux guests. To ensure that labeling happens correctly in "
822 "SELinux guests, you need to enable SELinux and load the guest's policy:"
826 #: ../src/guestfs.pod:409
831 #: ../src/guestfs.pod:411
832 msgid "Before launching, do:"
836 #: ../src/guestfs.pod:413
839 " guestfs_set_selinux (g, 1);\n"
844 #: ../src/guestfs.pod:415
849 #: ../src/guestfs.pod:417
851 "After mounting the guest's filesystem(s), load the policy. This is best "
852 "done by running the L<load_policy(8)> command in the guest itself:"
856 #: ../src/guestfs.pod:421
859 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
864 #: ../src/guestfs.pod:423
866 "(Older versions of C<load_policy> require you to specify the name of the "
871 #: ../src/guestfs.pod:426
876 #: ../src/guestfs.pod:428
878 "Optionally, set the security context for the API. The correct security "
879 "context to use can only be known by inspecting the guest. As an example:"
883 #: ../src/guestfs.pod:432
886 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
891 #: ../src/guestfs.pod:436
892 msgid "This will work for running commands and editing existing files."
896 #: ../src/guestfs.pod:438
898 "When new files are created, you may need to label them explicitly, for "
899 "example by running the external command C<restorecon pathname>."
903 #: ../src/guestfs.pod:442
908 #: ../src/guestfs.pod:444
910 "Certain calls are affected by the current file mode creation mask (the "
911 "\"umask\"). In particular ones which create files or directories, such as "
912 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
913 "either the default mode that the file is created with or modifies the mode "
918 #: ../src/guestfs.pod:450
920 "The default umask is C<022>, so files are created with modes such as C<0644> "
921 "and directories with C<0755>."
925 #: ../src/guestfs.pod:453
927 "There are two ways to avoid being affected by umask. Either set umask to 0 "
928 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
929 "L</guestfs_chmod> after creating each file or directory."
933 #: ../src/guestfs.pod:457
934 msgid "For more information about umask, see L<umask(2)>."
938 #: ../src/guestfs.pod:459 ../fish/guestfish.pod:566
939 msgid "ENCRYPTED DISKS"
943 #: ../src/guestfs.pod:461
945 "Libguestfs allows you to access Linux guests which have been encrypted using "
946 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
947 "standard. This includes nearly all whole disk encryption systems used by "
948 "modern Linux guests."
952 #: ../src/guestfs.pod:467
954 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
955 "returns the string C<crypto_LUKS>)."
959 #: ../src/guestfs.pod:470
961 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
962 "will require the passphrase!"
966 #: ../src/guestfs.pod:473
968 "Opening a LUKS device creates a new device mapper device called "
969 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
970 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
971 "decrypted from and encrypted to the underlying block device respectively."
975 #: ../src/guestfs.pod:479
977 "LVM volume groups on the device can be made visible by calling "
978 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
979 "volume(s) can now be mounted in the usual way."
983 #: ../src/guestfs.pod:483
985 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
986 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
987 "[\"/dev/VG\"])>. Then close the mapper device by calling "
988 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
989 "underlying encrypted block device)."
993 #: ../src/guestfs.pod:490
998 #: ../src/guestfs.pod:492
1000 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1001 "contains operating systems. (These APIs used to be in a separate Perl-only "
1002 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1003 "frequently used part of this library has been rewritten in C and moved into "
1008 #: ../src/guestfs.pod:498
1010 "Add all disks belonging to the unknown virtual machine and call "
1011 "L</guestfs_launch> in the usual way."
1015 #: ../src/guestfs.pod:501
1017 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1018 "and certain heuristics, and returns a list of operating systems that were "
1019 "found. An empty list means none were found. A single element is the root "
1020 "filesystem of the operating system. For dual- or multi-boot guests, "
1021 "multiple roots can be returned, each one corresponding to a separate "
1022 "operating system. (Multi-boot virtual machines are extremely rare in the "
1023 "world of virtualization, but since this scenario can happen, we have built "
1024 "libguestfs to deal with it.)"
1028 #: ../src/guestfs.pod:510
1030 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1031 "to get additional details about that operating system. For example, call "
1032 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1033 "Windows and Linux-based operating systems respectively."
1037 #: ../src/guestfs.pod:516
1039 "Un*x-like and Linux-based operating systems usually consist of several "
1040 "filesystems which are mounted at boot time (for example, a separate boot "
1041 "partition mounted on C</boot>). The inspection rules are able to detect how "
1042 "filesystems correspond to mount points. Call "
1043 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1044 "hash table like this example:"
1048 #: ../src/guestfs.pod:523
1051 " /boot => /dev/sda1\n"
1052 " / => /dev/vg_guest/lv_root\n"
1053 " /usr => /dev/vg_guest/lv_usr\n"
1058 #: ../src/guestfs.pod:527
1060 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1061 "filesystems as suggested."
1065 #: ../src/guestfs.pod:530
1067 "Be careful to mount filesystems in the right order (eg. C</> before "
1068 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1073 #: ../src/guestfs.pod:534
1075 "Inspection currently only works for some common operating systems. "
1076 "Contributors are welcome to send patches for other operating systems that we "
1077 "currently cannot detect."
1081 #: ../src/guestfs.pod:538
1083 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1084 "for more details. The L</guestfs_inspect_os> function just ignores any "
1085 "encrypted devices."
1089 #: ../src/guestfs.pod:542
1091 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1092 "inspection and caches the results in the guest handle. Subsequent calls to "
1093 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1094 "re-read the disks. If you change the content of the guest disks, you can "
1095 "redo inspection by calling L</guestfs_inspect_os> again."
1099 #: ../src/guestfs.pod:549
1100 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1104 #: ../src/guestfs.pod:551
1106 "Libguestfs can mount NTFS partitions. It does this using the "
1107 "L<http://www.ntfs-3g.org/> driver."
1111 #: ../src/guestfs.pod:554
1113 "DOS and Windows still use drive letters, and the filesystems are always "
1114 "treated as case insensitive by Windows itself, and therefore you might find "
1115 "a Windows configuration file referring to a path like "
1116 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1117 "that directory might be referred to as C</WINDOWS/System32>."
1121 #: ../src/guestfs.pod:560
1123 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1124 "libguestfs to read the appropriate Windows Registry and configuration files, "
1125 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1126 "L<virt-inspector(1)>)."
1130 #: ../src/guestfs.pod:565
1132 "Replacing backslash characters with forward slash characters is also outside "
1133 "the scope of libguestfs, but something that you can easily do."
1137 #: ../src/guestfs.pod:568
1139 "Where we can help is in resolving the case insensitivity of paths. For "
1140 "this, call L</guestfs_case_sensitive_path>."
1144 #: ../src/guestfs.pod:571
1146 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1147 "files, through the library C<hivex> which is part of the libguestfs project "
1148 "although ships as a separate tarball. You have to locate and download the "
1149 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1150 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1151 "L<virt-win-reg(1)> for more help on this issue."
1155 #: ../src/guestfs.pod:579
1156 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1160 #: ../src/guestfs.pod:581
1162 "Although we don't want to discourage you from using the C API, we will "
1163 "mention here that the same API is also available in other languages."
1167 #: ../src/guestfs.pod:584
1169 "The API is broadly identical in all supported languages. This means that "
1170 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, "
1171 "C<g.mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1172 "words, a straightforward, predictable isomorphism between each language."
1176 #: ../src/guestfs.pod:590
1178 "Error messages are automatically transformed into exceptions if the language "
1183 #: ../src/guestfs.pod:593
1185 "We don't try to \"object orientify\" parts of the API in OO languages, "
1186 "although contributors are welcome to write higher level APIs above what we "
1187 "provide in their favourite languages if they wish."
1191 #: ../src/guestfs.pod:599
1196 #: ../src/guestfs.pod:601
1198 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1199 "identical to the C API. C++ classes and exceptions are not used."
1203 #: ../src/guestfs.pod:605
1208 #: ../src/guestfs.pod:607
1210 "The C# bindings are highly experimental. Please read the warnings at the "
1211 "top of C<csharp/Libguestfs.cs>."
1215 #: ../src/guestfs.pod:610
1220 #: ../src/guestfs.pod:612
1222 "This is the only language binding that is working but incomplete. Only "
1223 "calls which return simple integers have been bound in Haskell, and we are "
1224 "looking for help to complete this binding."
1228 #: ../src/guestfs.pod:616
1233 #: ../src/guestfs.pod:618
1235 "Full documentation is contained in the Javadoc which is distributed with "
1240 #: ../src/guestfs.pod:621
1245 #: ../src/guestfs.pod:623
1246 msgid "For documentation see the file C<guestfs.mli>."
1250 #: ../src/guestfs.pod:625
1255 #: ../src/guestfs.pod:627
1256 msgid "For documentation see L<Sys::Guestfs(3)>."
1260 #: ../src/guestfs.pod:629
1265 #: ../src/guestfs.pod:631
1267 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1268 "the php-libguestfs package for your distribution."
1272 #: ../src/guestfs.pod:634
1273 msgid "The PHP binding only works correctly on 64 bit machines."
1277 #: ../src/guestfs.pod:636
1282 #: ../src/guestfs.pod:638
1283 msgid "For documentation do:"
1287 #: ../src/guestfs.pod:640
1291 " >>> import guestfs\n"
1292 " >>> help (guestfs)\n"
1297 #: ../src/guestfs.pod:644
1302 #: ../src/guestfs.pod:646
1304 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1305 "can find examples written in Ruby in the libguestfs source."
1309 #: ../src/guestfs.pod:649
1310 msgid "B<shell scripts>"
1314 #: ../src/guestfs.pod:651
1315 msgid "For documentation see L<guestfish(1)>."
1319 #: ../src/guestfs.pod:655
1320 msgid "LIBGUESTFS GOTCHAS"
1324 #: ../src/guestfs.pod:657
1326 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1327 "system [...] that works in the way it is documented but is counterintuitive "
1328 "and almost invites mistakes.\""
1332 #: ../src/guestfs.pod:661
1334 "Since we developed libguestfs and the associated tools, there are several "
1335 "things we would have designed differently, but are now stuck with for "
1336 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1337 "release, you can expect these to change. Beware of them."
1341 #: ../src/guestfs.pod:669
1342 msgid "Autosync / forgetting to sync."
1346 #: ../src/guestfs.pod:671
1348 "When modifying a filesystem from C or another language, you B<must> unmount "
1349 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1350 "libguestfs handle. You can also call:"
1354 #: ../src/guestfs.pod:675
1357 " guestfs_set_autosync (g, 1);\n"
1362 #: ../src/guestfs.pod:677
1364 "to have the unmount/sync done automatically for you when the handle 'g' is "
1365 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1370 #: ../src/guestfs.pod:681
1372 "If you forget to do this, then it is entirely possible that your changes "
1373 "won't be written out, or will be partially written, or (very rarely) that "
1374 "you'll get disk corruption."
1378 #: ../src/guestfs.pod:685
1380 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1381 "guestfish scripts that forget to sync will work just fine, which can make "
1382 "this very puzzling if you are trying to debug a problem."
1386 #: ../src/guestfs.pod:689
1387 msgid "Mount option C<-o sync> should not be the default."
1391 #: ../src/guestfs.pod:691
1393 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1394 "However C<-o sync> does not add any reliability benefit, but does have a "
1395 "very large performance impact."
1399 #: ../src/guestfs.pod:695
1401 "The work around is to use L</guestfs_mount_options> and set the mount "
1402 "options that you actually want to use."
1406 #: ../src/guestfs.pod:698
1407 msgid "Read-only should be the default."
1411 #: ../src/guestfs.pod:700
1413 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1414 "specify I<--rw> if you want to make changes to the image."
1418 #: ../src/guestfs.pod:703
1419 msgid "This would reduce the potential to corrupt live VM images."
1423 #: ../src/guestfs.pod:705
1425 "Note that many filesystems change the disk when you just mount and unmount, "
1426 "even if you didn't perform any writes. You need to use "
1427 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1431 #: ../src/guestfs.pod:709
1432 msgid "guestfish command line is hard to use."
1436 #: ../src/guestfs.pod:711
1438 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1439 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1440 "exist, so it fails. In earlier versions of guestfish the error message was "
1441 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1442 "we should have used C<guestfish -c command> to run commands."
1446 #: ../src/guestfs.pod:718
1447 msgid "guestfish megabyte modifiers don't work right on all commands"
1451 #: ../src/guestfs.pod:720
1453 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1454 "other modifiers). What guestfish actually does is to multiply the number "
1455 "part by the modifier part and pass the result to the C API. However this "
1456 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1457 "expecting some other unit (eg. megabytes)."
1461 #: ../src/guestfs.pod:727
1462 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1466 #: ../src/guestfs.pod:729
1469 " lvcreate LV VG 100M\n"
1474 #: ../src/guestfs.pod:731
1476 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1477 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1478 "megabytes * megabytes) logical volume. The error message you get from this "
1479 "is also a little obscure."
1483 #: ../src/guestfs.pod:736
1485 "This could be fixed in the generator by specially marking parameters and "
1486 "return values which take bytes or other units."
1490 #: ../src/guestfs.pod:739
1491 msgid "Library should return errno with error messages."
1495 #: ../src/guestfs.pod:741
1497 "It would be a nice-to-have to be able to get the original value of 'errno' "
1498 "from inside the appliance along error paths (where set). Currently "
1499 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1500 "string into an errno, see the function error() in fuse/guestmount.c."
1504 #: ../src/guestfs.pod:747
1506 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1507 "sent back from the daemon."
1511 #: ../src/guestfs.pod:752
1512 msgid "PROTOCOL LIMITS"
1516 #: ../src/guestfs.pod:754
1518 "Internally libguestfs uses a message-based protocol to pass API calls and "
1519 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1520 "plenty more detail about this). The maximum message size used by the "
1521 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1522 "aware of this limit. The API calls which may be affected are individually "
1523 "documented, with a link back to this section of the documentation."
1527 #: ../src/guestfs.pod:762
1529 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1530 "a simple string. Because this string is at some point internally encoded as "
1531 "a message, the maximum size that it can return is slightly under 4 MB. If "
1532 "the requested file is larger than this then you will get an error."
1536 #: ../src/guestfs.pod:768
1538 "In order to transfer large files into and out of the guest filesystem, you "
1539 "need to use particular calls that support this. The sections L</UPLOADING> "
1540 "and L</DOWNLOADING> document how to do this."
1544 #: ../src/guestfs.pod:772
1546 "You might also consider mounting the disk image using our FUSE filesystem "
1547 "support (L<guestmount(1)>)."
1551 #: ../src/guestfs.pod:775
1552 msgid "KEYS AND PASSPHRASES"
1556 #: ../src/guestfs.pod:777
1558 "Certain libguestfs calls take a parameter that contains sensitive key "
1559 "material, passed in as a C string."
1563 #: ../src/guestfs.pod:780
1565 "In the future we would hope to change the libguestfs implementation so that "
1566 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1567 "swap. However this is I<not> done at the moment, because of the complexity "
1568 "of such an implementation."
1572 #: ../src/guestfs.pod:785
1574 "Therefore you should be aware that any key parameter you pass to libguestfs "
1575 "might end up being written out to the swap partition. If this is a concern, "
1576 "scrub the swap partition or don't use libguestfs on encrypted devices."
1580 #: ../src/guestfs.pod:790
1581 msgid "CONNECTION MANAGEMENT"
1585 #: ../src/guestfs.pod:792
1590 #: ../src/guestfs.pod:794
1592 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1593 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1594 "handle and release all resources used."
1598 #: ../src/guestfs.pod:798
1600 "For information on using multiple handles and threads, see the section "
1601 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1605 #: ../src/guestfs.pod:801
1606 msgid "guestfs_create"
1610 #: ../src/guestfs.pod:803
1613 " guestfs_h *guestfs_create (void);\n"
1618 #: ../src/guestfs.pod:805
1619 msgid "Create a connection handle."
1623 #: ../src/guestfs.pod:807
1624 msgid "You have to call L</guestfs_add_drive> on the handle at least once."
1628 #: ../src/guestfs.pod:809
1630 "This function returns a non-NULL pointer to a handle on success or NULL on "
1635 #: ../src/guestfs.pod:812
1636 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1640 #: ../src/guestfs.pod:814
1642 "You may also want to configure error handling for the handle. See L</ERROR "
1643 "HANDLING> section below."
1647 #: ../src/guestfs.pod:817
1648 msgid "guestfs_close"
1652 #: ../src/guestfs.pod:819
1655 " void guestfs_close (guestfs_h *g);\n"
1660 #: ../src/guestfs.pod:821
1661 msgid "This closes the connection handle and frees up all resources used."
1665 #: ../src/guestfs.pod:823
1666 msgid "ERROR HANDLING"
1670 #: ../src/guestfs.pod:825
1672 "The convention in all functions that return C<int> is that they return C<-1> "
1673 "to indicate an error. You can get additional information on errors by "
1674 "calling L</guestfs_last_error> and/or by setting up an error handler with "
1675 "L</guestfs_set_error_handler>."
1679 #: ../src/guestfs.pod:830
1680 msgid "The default error handler prints the information string to C<stderr>."
1684 #: ../src/guestfs.pod:832
1686 "Out of memory errors are handled differently. The default action is to call "
1687 "L<abort(3)>. If this is undesirable, then you can set a handler using "
1688 "L</guestfs_set_out_of_memory_handler>."
1692 #: ../src/guestfs.pod:836
1693 msgid "guestfs_last_error"
1697 #: ../src/guestfs.pod:838
1700 " const char *guestfs_last_error (guestfs_h *g);\n"
1705 #: ../src/guestfs.pod:840
1707 "This returns the last error message that happened on C<g>. If there has not "
1708 "been an error since the handle was created, then this returns C<NULL>."
1712 #: ../src/guestfs.pod:844
1714 "The lifetime of the returned string is until the next error occurs, or "
1715 "L</guestfs_close> is called."
1719 #: ../src/guestfs.pod:847
1721 "The error string is not localized (ie. is always in English), because this "
1722 "makes searching for error messages in search engines give the largest number "
1727 #: ../src/guestfs.pod:851
1728 msgid "guestfs_set_error_handler"
1732 #: ../src/guestfs.pod:853
1735 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1737 " const char *msg);\n"
1738 " void guestfs_set_error_handler (guestfs_h *g,\n"
1739 " guestfs_error_handler_cb cb,\n"
1745 #: ../src/guestfs.pod:860
1747 "The callback C<cb> will be called if there is an error. The parameters "
1748 "passed to the callback are an opaque data pointer and the error message "
1753 #: ../src/guestfs.pod:864
1755 "Note that the message string C<msg> is freed as soon as the callback "
1756 "function returns, so if you want to stash it somewhere you must make your "
1761 #: ../src/guestfs.pod:868
1762 msgid "The default handler prints messages on C<stderr>."
1766 #: ../src/guestfs.pod:870
1767 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1771 #: ../src/guestfs.pod:872
1772 msgid "guestfs_get_error_handler"
1776 #: ../src/guestfs.pod:874
1779 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1780 " void **opaque_rtn);\n"
1785 #: ../src/guestfs.pod:877
1786 msgid "Returns the current error handler callback."
1790 #: ../src/guestfs.pod:879
1791 msgid "guestfs_set_out_of_memory_handler"
1795 #: ../src/guestfs.pod:881
1798 " typedef void (*guestfs_abort_cb) (void);\n"
1799 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1800 " guestfs_abort_cb);\n"
1805 #: ../src/guestfs.pod:885
1807 "The callback C<cb> will be called if there is an out of memory situation. "
1808 "I<Note this callback must not return>."
1812 #: ../src/guestfs.pod:888
1813 msgid "The default is to call L<abort(3)>."
1817 #: ../src/guestfs.pod:890
1818 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
1822 #: ../src/guestfs.pod:893
1823 msgid "guestfs_get_out_of_memory_handler"
1827 #: ../src/guestfs.pod:895
1830 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
1835 #: ../src/guestfs.pod:897
1836 msgid "This returns the current out of memory handler."
1840 #: ../src/guestfs.pod:899
1845 #: ../src/guestfs.pod:901
1847 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1852 #: ../src/guestfs.pod:904
1854 "By default it looks for these in the directory C<$libdir/guestfs> "
1855 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1859 #: ../src/guestfs.pod:907
1861 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1862 "to change the directories that libguestfs will search in. The value is a "
1863 "colon-separated list of paths. The current directory is I<not> searched "
1864 "unless the path contains an empty element or C<.>. For example "
1865 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1866 "then C</usr/lib/guestfs>."
1870 #: ../src/guestfs.pod:914
1871 msgid "HIGH-LEVEL API ACTIONS"
1875 #: ../src/guestfs.pod:916
1876 msgid "ABI GUARANTEE"
1880 #: ../src/guestfs.pod:918
1882 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1883 "actions as outlined in this section. Although we will deprecate some "
1884 "actions, for example if they get replaced by newer calls, we will keep the "
1885 "old actions forever. This allows you the developer to program in confidence "
1886 "against the libguestfs API."
1890 #: ../src/guestfs.pod:924 ../fish/guestfish.pod:796
1895 #: ../src/guestfs.pod:926
1900 #: ../src/guestfs.pod:928
1905 #: ../src/guestfs.pod:930
1906 msgid "AVAILABILITY"
1910 #: ../src/guestfs.pod:932
1911 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
1915 #: ../src/guestfs.pod:934
1917 "Using L</guestfs_available> you can test availability of the following "
1918 "groups of functions. This test queries the appliance to see if the "
1919 "appliance you are currently using supports the functionality."
1923 #: ../src/guestfs.pod:939
1924 msgid "@AVAILABILITY@"
1928 #: ../src/guestfs.pod:941
1929 msgid "GUESTFISH supported COMMAND"
1933 #: ../src/guestfs.pod:943
1935 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
1936 "prints out the available groups and whether they are supported by this build "
1937 "of libguestfs. Note however that you have to do C<run> first."
1941 #: ../src/guestfs.pod:948
1942 msgid "SINGLE CALLS AT COMPILE TIME"
1946 #: ../src/guestfs.pod:950
1948 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
1949 "function, such as:"
1953 #: ../src/guestfs.pod:953
1956 " #define LIBGUESTFS_HAVE_DD 1\n"
1961 #: ../src/guestfs.pod:955
1962 msgid "if L</guestfs_dd> is available."
1966 #: ../src/guestfs.pod:957
1968 "Before version 1.5.8, if you needed to test whether a single libguestfs "
1969 "function is available at compile time, we recommended using build tools such "
1970 "as autoconf or cmake. For example in autotools you could use:"
1974 #: ../src/guestfs.pod:962
1977 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
1978 " AC_CHECK_FUNCS([guestfs_dd])\n"
1983 #: ../src/guestfs.pod:965
1985 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
1990 #: ../src/guestfs.pod:968
1991 msgid "SINGLE CALLS AT RUN TIME"
1995 #: ../src/guestfs.pod:970
1997 "Testing at compile time doesn't guarantee that a function really exists in "
1998 "the library. The reason is that you might be dynamically linked against a "
1999 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2000 "This situation unfortunately results in a segmentation fault, which is a "
2001 "shortcoming of the C dynamic linking system itself."
2005 #: ../src/guestfs.pod:977
2007 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2008 "in this example program (note that you still need the compile time check as "
2013 #: ../src/guestfs.pod:981
2016 " #include <stdio.h>\n"
2017 " #include <stdlib.h>\n"
2018 " #include <unistd.h>\n"
2019 " #include <dlfcn.h>\n"
2020 " #include <guestfs.h>\n"
2025 #: ../src/guestfs.pod:987
2030 " #ifdef LIBGUESTFS_HAVE_DD\n"
2032 " int has_function;\n"
2037 #: ../src/guestfs.pod:993
2040 " /* Test if the function guestfs_dd is really available. */\n"
2041 " dl = dlopen (NULL, RTLD_LAZY);\n"
2043 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2044 " exit (EXIT_FAILURE);\n"
2046 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2052 #: ../src/guestfs.pod:1002
2055 " if (!has_function)\n"
2056 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2058 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2059 " /* Now it's safe to call\n"
2060 " guestfs_dd (g, \"foo\", \"bar\");\n"
2064 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2071 #: ../src/guestfs.pod:1015
2073 "You may think the above is an awful lot of hassle, and it is. There are "
2074 "other ways outside of the C linking system to ensure that this kind of "
2075 "incompatibility never arises, such as using package versioning:"
2079 #: ../src/guestfs.pod:1020
2082 " Requires: libguestfs >= 1.0.80\n"
2087 #: ../src/guestfs.pod:1022 ../src/guestfs.pod:1027
2092 #: ../src/guestfs.pod:1024
2094 "<!-- old anchor for the next section --> <a "
2095 "name=\"state_machine_and_low_level_event_api\"/>"
2099 #: ../src/guestfs.pod:1029
2100 msgid "ARCHITECTURE"
2104 #: ../src/guestfs.pod:1031
2106 "Internally, libguestfs is implemented by running an appliance (a special "
2107 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2108 "process of the main program."
2112 #: ../src/guestfs.pod:1035
2115 " ___________________\n"
2117 " | main program |\n"
2119 " | | child process / appliance\n"
2120 " | | __________________________\n"
2122 " +-------------------+ RPC | +-----------------+ |\n"
2123 " | libguestfs <--------------------> guestfsd | |\n"
2124 " | | | +-----------------+ |\n"
2125 " \\___________________/ | | Linux kernel | |\n"
2126 " | +--^--------------+ |\n"
2127 " \\_________|________________/\n"
2133 " \\______________/\n"
2138 #: ../src/guestfs.pod:1055
2140 "The library, linked to the main program, creates the child process and hence "
2141 "the appliance in the L</guestfs_launch> function."
2145 #: ../src/guestfs.pod:1058
2147 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2148 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2149 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2150 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2151 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2152 "attached to the qemu process which translates device access by the "
2153 "appliance's Linux kernel into accesses to the image."
2157 #: ../src/guestfs.pod:1067
2159 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2160 "Although the disk image you are attached to might also be used by some "
2161 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2162 "care if both libguestfs's qemu process and your virtual machine are trying "
2163 "to update the disk image at the same time, since these usually results in "
2164 "massive disk corruption)."
2168 #: ../src/guestfs.pod:1074
2169 msgid "STATE MACHINE"
2173 #: ../src/guestfs.pod:1076
2174 msgid "libguestfs uses a state machine to model the child process:"
2178 #: ../src/guestfs.pod:1078
2190 " / | \\ \\ guestfs_launch\n"
2191 " / | _\\__V______\n"
2193 " / | | LAUNCHING |\n"
2194 " / | \\___________/\n"
2196 " / | guestfs_launch\n"
2198 " ______ / __|____V\n"
2199 " / \\ ------> / \\\n"
2200 " | BUSY | | READY |\n"
2201 " \\______/ <------ \\________/\n"
2206 #: ../src/guestfs.pod:1100
2208 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2209 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2210 "(3) alternating between READY and BUSY as commands are issued to, and "
2211 "carried out by, the child process."
2215 #: ../src/guestfs.pod:1105
2217 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2218 "asynchronously at any time (eg. due to some internal error), and that causes "
2219 "the state to transition back to CONFIG."
2223 #: ../src/guestfs.pod:1109
2225 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2226 "issued when in the CONFIG state."
2230 #: ../src/guestfs.pod:1112
2232 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2233 "L</guestfs_launch> blocks until the child process is READY to accept "
2234 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2235 "moves the state from CONFIG to LAUNCHING while it is running."
2239 #: ../src/guestfs.pod:1118
2241 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2242 "state. These API calls block waiting for the command to be carried out "
2243 "(ie. the state to transition to BUSY and then back to READY). There are no "
2244 "non-blocking versions, and no way to issue more than one command per handle "
2249 #: ../src/guestfs.pod:1124
2251 "Finally, the child process sends asynchronous messages back to the main "
2252 "program, such as kernel log messages. You can register a callback to "
2253 "receive these messages."
2257 #: ../src/guestfs.pod:1128
2258 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2262 #: ../src/guestfs.pod:1130
2264 "The child process generates events in some situations. Current events "
2265 "include: receiving a log message, the child process exits."
2269 #: ../src/guestfs.pod:1133
2271 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2276 #: ../src/guestfs.pod:1136
2278 "Only I<one callback of each type> can be registered for each handle. "
2279 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2280 "that type. Cancel all callbacks of this type by calling this function with "
2281 "C<cb> set to C<NULL>."
2285 #: ../src/guestfs.pod:1141
2286 msgid "guestfs_set_log_message_callback"
2290 #: ../src/guestfs.pod:1143
2293 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2294 " char *buf, int len);\n"
2295 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2296 " guestfs_log_message_cb cb,\n"
2302 #: ../src/guestfs.pod:1149
2304 "The callback function C<cb> will be called whenever qemu or the guest writes "
2305 "anything to the console."
2309 #: ../src/guestfs.pod:1152
2310 msgid "Use this function to capture kernel messages and similar."
2314 #: ../src/guestfs.pod:1154
2316 "Normally there is no log message handler, and log messages are just "
2321 #: ../src/guestfs.pod:1157
2322 msgid "guestfs_set_subprocess_quit_callback"
2326 #: ../src/guestfs.pod:1159
2329 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2330 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2331 " guestfs_subprocess_quit_cb cb,\n"
2337 #: ../src/guestfs.pod:1164
2339 "The callback function C<cb> will be called when the child process quits, "
2340 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2341 "corresponds to a transition from any state to the CONFIG state)."
2345 #: ../src/guestfs.pod:1169
2346 msgid "guestfs_set_launch_done_callback"
2350 #: ../src/guestfs.pod:1171
2353 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2354 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2355 " guestfs_launch_done_cb cb,\n"
2361 #: ../src/guestfs.pod:1176
2363 "The callback function C<cb> will be called when the child process becomes "
2364 "ready first time after it has been launched. (This corresponds to a "
2365 "transition from LAUNCHING to the READY state)."
2369 #: ../src/guestfs.pod:1180
2370 msgid "guestfs_set_close_callback"
2374 #: ../src/guestfs.pod:1182
2377 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2378 " void guestfs_set_close_callback (guestfs_h *g,\n"
2379 " guestfs_close_cb cb,\n"
2385 #: ../src/guestfs.pod:1187
2387 "The callback function C<cb> will be called while the handle is being closed "
2388 "(synchronously from L</guestfs_close>)."
2392 #: ../src/guestfs.pod:1190
2394 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2395 "handles that are open when the program exits. This means that this callback "
2396 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2397 "problems in higher-level languages (eg. if your HLL interpreter has already "
2398 "been cleaned up by the time this is called, and if your callback then jumps "
2399 "into some HLL function)."
2403 #: ../src/guestfs.pod:1198
2404 msgid "guestfs_set_progress_callback"
2408 #: ../src/guestfs.pod:1200
2411 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2412 " int proc_nr, int serial,\n"
2413 " uint64_t position, uint64_t total);\n"
2414 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2415 " guestfs_progress_cb cb,\n"
2421 #: ../src/guestfs.pod:1207
2423 "Some long-running operations can generate progress messages. If this "
2424 "callback is registered, then it will be called each time a progress message "
2425 "is generated (usually two seconds after the operation started, and three "
2426 "times per second thereafter until it completes, although the frequency may "
2427 "change in future versions)."
2431 #: ../src/guestfs.pod:1213
2433 "The callback receives two numbers: C<position> and C<total>. The units of "
2434 "C<total> are not defined, although for some operations C<total> may relate "
2435 "in some way to the amount of data to be transferred (eg. in bytes or "
2436 "megabytes), and C<position> may be the portion which has been transferred."
2440 #: ../src/guestfs.pod:1219
2441 msgid "The only defined and stable parts of the API are:"
2445 #: ../src/guestfs.pod:1225
2447 "The callback can display to the user some type of progress bar or indicator "
2448 "which shows the ratio of C<position>:C<total>."
2452 #: ../src/guestfs.pod:1230
2453 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2457 #: ../src/guestfs.pod:1234
2459 "If any progress notification is sent during a call, then a final progress "
2460 "notification is always sent when C<position> = C<total>."
2464 #: ../src/guestfs.pod:1237
2466 "This is to simplify caller code, so callers can easily set the progress "
2467 "indicator to \"100%\" at the end of the operation, without requiring special "
2468 "code to detect this case."
2472 #: ../src/guestfs.pod:1243
2474 "The callback also receives the procedure number and serial number of the "
2475 "call. These are only useful for debugging protocol issues, and the callback "
2476 "can normally ignore them. The callback may want to print these numbers in "
2477 "error messages or debugging messages."
2481 #: ../src/guestfs.pod:1248
2482 msgid "PRIVATE DATA AREA"
2486 #: ../src/guestfs.pod:1250
2488 "You can attach named pieces of private data to the libguestfs handle, and "
2489 "fetch them by name for the lifetime of the handle. This is called the "
2490 "private data area and is only available from the C API."
2494 #: ../src/guestfs.pod:1254
2495 msgid "To attach a named piece of data, use the following call:"
2499 #: ../src/guestfs.pod:1256
2502 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2507 #: ../src/guestfs.pod:1258
2509 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2510 "pointer (which can be C<NULL>). Any previous item with the same name is "
2515 #: ../src/guestfs.pod:1262
2517 "You can use any C<key> you want, but names beginning with an underscore "
2518 "character are reserved for internal libguestfs purposes (for implementing "
2519 "language bindings). It is recommended to prefix the name with some unique "
2520 "string to avoid collisions with other users."
2524 #: ../src/guestfs.pod:1267
2525 msgid "To retrieve the pointer, use:"
2529 #: ../src/guestfs.pod:1269
2532 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2537 #: ../src/guestfs.pod:1271
2539 "This function returns C<NULL> if either no data is found associated with "
2540 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2545 #: ../src/guestfs.pod:1275
2547 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2548 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2549 "all. In particular, libguestfs does I<not> try to free the data when the "
2550 "handle is closed. If the data must be freed, then the caller must either "
2551 "free it before calling L</guestfs_close> or must set up a close callback to "
2552 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2553 "can be registered for a handle)."
2557 #: ../src/guestfs.pod:1283
2559 "The private data area is implemented using a hash table, and should be "
2560 "reasonably efficient for moderate numbers of keys."
2564 #: ../src/guestfs.pod:1286
2565 msgid "BLOCK DEVICE NAMING"
2569 #: ../src/guestfs.pod:1288
2571 "In the kernel there is now quite a profusion of schemata for naming block "
2572 "devices (in this context, by I<block device> I mean a physical or virtual "
2573 "hard drive). The original Linux IDE driver used names starting with "
2574 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
2575 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
2576 "replacement for the old IDE driver (particularly for SATA devices) those "
2577 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
2578 "machines with paravirtualized drivers. This has created several different "
2579 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
2584 #: ../src/guestfs.pod:1300
2586 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2587 "Linux kernel to access block devices. We can run a variety of appliances "
2588 "based on a variety of Linux kernels."
2592 #: ../src/guestfs.pod:1304
2594 "This causes a problem for libguestfs because many API calls use device or "
2595 "partition names. Working scripts and the recipe (example) scripts that we "
2596 "make available over the internet could fail if the naming scheme changes."
2600 #: ../src/guestfs.pod:1309
2602 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2603 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2604 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2605 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2609 #: ../src/guestfs.pod:1315
2611 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2612 "L</guestfs_list_partitions> and similar calls return the true names of the "
2613 "devices and partitions as known to the appliance."
2617 #: ../src/guestfs.pod:1320
2618 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2622 #: ../src/guestfs.pod:1322
2624 "Usually this translation is transparent. However in some (very rare) cases "
2625 "you may need to know the exact algorithm. Such cases include where you use "
2626 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
2627 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
2632 #: ../src/guestfs.pod:1328
2634 "The algorithm is applied only to I<parameters> which are known to be either "
2635 "device or partition names. Return values from functions such as "
2636 "L</guestfs_list_devices> are never changed."
2640 #: ../src/guestfs.pod:1336
2641 msgid "Is the string a parameter which is a device or partition name?"
2645 #: ../src/guestfs.pod:1340
2646 msgid "Does the string begin with C</dev/sd>?"
2650 #: ../src/guestfs.pod:1344
2652 "Does the named device exist? If so, we use that device. However if I<not> "
2653 "then we continue with this algorithm."
2657 #: ../src/guestfs.pod:1349
2658 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2662 #: ../src/guestfs.pod:1351
2663 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2667 #: ../src/guestfs.pod:1353
2668 msgid "If that named device exists, use it. If not, continue."
2672 #: ../src/guestfs.pod:1357
2673 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2677 #: ../src/guestfs.pod:1359
2678 msgid "If that named device exists, use it. If not, return an error."
2682 #: ../src/guestfs.pod:1363
2683 msgid "PORTABILITY CONCERNS"
2687 #: ../src/guestfs.pod:1365
2689 "Although the standard naming scheme and automatic translation is useful for "
2690 "simple programs and guestfish scripts, for larger programs it is best not to "
2691 "rely on this mechanism."
2695 #: ../src/guestfs.pod:1369
2697 "Where possible for maximum future portability programs using libguestfs "
2698 "should use these future-proof techniques:"
2702 #: ../src/guestfs.pod:1376
2704 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2705 "device names, and then use those names directly."
2709 #: ../src/guestfs.pod:1379
2710 msgid "Since those device names exist by definition, they will never be translated."
2714 #: ../src/guestfs.pod:1384
2716 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2717 "filesystem labels."
2721 #: ../src/guestfs.pod:1389
2726 #: ../src/guestfs.pod:1391
2727 msgid "COMMUNICATION PROTOCOL"
2731 #: ../src/guestfs.pod:1393
2733 "Don't rely on using this protocol directly. This section documents how it "
2734 "currently works, but it may change at any time."
2738 #: ../src/guestfs.pod:1396
2740 "The protocol used to talk between the library and the daemon running inside "
2741 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
2742 "1014, RFC 1832, RFC 4506)."
2746 #: ../src/guestfs.pod:1400
2748 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
2749 "this file is automatically generated)."
2753 #: ../src/guestfs.pod:1403
2755 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
2756 "and C<FileOut> parameters, which are handled with very simple request/reply "
2757 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
2758 "parameters, which use the same request and reply messages, but they may also "
2759 "be followed by files sent using a chunked encoding."
2763 #: ../src/guestfs.pod:1410
2764 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
2768 #: ../src/guestfs.pod:1412
2769 msgid "For ordinary functions, the request message is:"
2773 #: ../src/guestfs.pod:1414
2776 " total length (header + arguments,\n"
2777 " but not including the length word itself)\n"
2778 " struct guestfs_message_header (encoded as XDR)\n"
2779 " struct guestfs_<foo>_args (encoded as XDR)\n"
2784 #: ../src/guestfs.pod:1419
2786 "The total length field allows the daemon to allocate a fixed size buffer "
2787 "into which it slurps the rest of the message. As a result, the total length "
2788 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
2789 "effective size of any request is limited to somewhere under this size."
2793 #: ../src/guestfs.pod:1425
2795 "Note also that many functions don't take any arguments, in which case the "
2796 "C<guestfs_I<foo>_args> is completely omitted."
2800 #: ../src/guestfs.pod:1428
2802 "The header contains the procedure number (C<guestfs_proc>) which is how the "
2803 "receiver knows what type of args structure to expect, or none at all."
2807 #: ../src/guestfs.pod:1432
2808 msgid "The reply message for ordinary functions is:"
2812 #: ../src/guestfs.pod:1434
2815 " total length (header + ret,\n"
2816 " but not including the length word itself)\n"
2817 " struct guestfs_message_header (encoded as XDR)\n"
2818 " struct guestfs_<foo>_ret (encoded as XDR)\n"
2823 #: ../src/guestfs.pod:1439
2825 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
2826 "functions that return no formal return values."
2830 #: ../src/guestfs.pod:1442
2831 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
2835 #: ../src/guestfs.pod:1445
2837 "In the case of an error, a flag is set in the header, and the reply message "
2838 "is slightly changed:"
2842 #: ../src/guestfs.pod:1448
2845 " total length (header + error,\n"
2846 " but not including the length word itself)\n"
2847 " struct guestfs_message_header (encoded as XDR)\n"
2848 " struct guestfs_message_error (encoded as XDR)\n"
2853 #: ../src/guestfs.pod:1453
2855 "The C<guestfs_message_error> structure contains the error message as a "
2860 #: ../src/guestfs.pod:1456
2861 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
2865 #: ../src/guestfs.pod:1458
2867 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
2868 "The normal request message is sent (see above). However this is followed by "
2869 "a sequence of file chunks."
2873 #: ../src/guestfs.pod:1462
2876 " total length (header + arguments,\n"
2877 " but not including the length word itself,\n"
2878 " and not including the chunks)\n"
2879 " struct guestfs_message_header (encoded as XDR)\n"
2880 " struct guestfs_<foo>_args (encoded as XDR)\n"
2881 " sequence of chunks for FileIn param #0\n"
2882 " sequence of chunks for FileIn param #1 etc.\n"
2887 #: ../src/guestfs.pod:1470
2888 msgid "The \"sequence of chunks\" is:"
2892 #: ../src/guestfs.pod:1472
2895 " length of chunk (not including length word itself)\n"
2896 " struct guestfs_chunk (encoded as XDR)\n"
2897 " length of chunk\n"
2898 " struct guestfs_chunk (encoded as XDR)\n"
2900 " length of chunk\n"
2901 " struct guestfs_chunk (with data.data_len == 0)\n"
2906 #: ../src/guestfs.pod:1480
2908 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
2909 "is set in the final chunk to indicate either successful completion or early "
2914 #: ../src/guestfs.pod:1484
2916 "At time of writing there are no functions that have more than one FileIn "
2917 "parameter. However this is (theoretically) supported, by sending the "
2918 "sequence of chunks for each FileIn parameter one after another (from left to "
2923 #: ../src/guestfs.pod:1489
2925 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
2926 "transfer. The library does this by sending a chunk with a special flag set "
2927 "to indicate cancellation. When the daemon sees this, it cancels the whole "
2928 "RPC, does I<not> send any reply, and goes back to reading the next request."
2932 #: ../src/guestfs.pod:1495
2934 "The daemon may also cancel. It does this by writing a special word "
2935 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
2936 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
2937 "cancel chunk). The special word is chosen so that even if cancellation "
2938 "happens right at the end of the transfer (after the library has finished "
2939 "writing and has started listening for the reply), the \"spurious\" cancel "
2940 "flag will not be confused with the reply message."
2944 #: ../src/guestfs.pod:1504
2946 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
2947 "limit), and also files where the size is not known in advance (eg. from "
2948 "pipes or sockets). However the chunks are rather small "
2949 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
2950 "to keep much in memory."
2954 #: ../src/guestfs.pod:1510
2955 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
2959 #: ../src/guestfs.pod:1512
2961 "The protocol for FileOut parameters is exactly the same as for FileIn "
2962 "parameters, but with the roles of daemon and library reversed."
2966 #: ../src/guestfs.pod:1515
2969 " total length (header + ret,\n"
2970 " but not including the length word itself,\n"
2971 " and not including the chunks)\n"
2972 " struct guestfs_message_header (encoded as XDR)\n"
2973 " struct guestfs_<foo>_ret (encoded as XDR)\n"
2974 " sequence of chunks for FileOut param #0\n"
2975 " sequence of chunks for FileOut param #1 etc.\n"
2980 #: ../src/guestfs.pod:1523
2981 msgid "INITIAL MESSAGE"
2985 #: ../src/guestfs.pod:1525
2987 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
2988 "which indicates that the guest and daemon is alive. This is what "
2989 "L</guestfs_launch> waits for."
2993 #: ../src/guestfs.pod:1529
2994 msgid "PROGRESS NOTIFICATION MESSAGES"
2998 #: ../src/guestfs.pod:1531
3000 "The daemon may send progress notification messages at any time. These are "
3001 "distinguished by the normal length word being replaced by "
3002 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3006 #: ../src/guestfs.pod:1535
3008 "The library turns them into progress callbacks (see "
3009 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3010 "discards them if not."
3014 #: ../src/guestfs.pod:1539
3016 "The daemon self-limits the frequency of progress messages it sends (see "
3017 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3022 #: ../src/guestfs.pod:1543
3023 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3027 #: ../src/guestfs.pod:1545
3029 "All high-level libguestfs actions are synchronous. If you want to use "
3030 "libguestfs asynchronously then you must create a thread."
3034 #: ../src/guestfs.pod:1548
3036 "Only use the handle from a single thread. Either use the handle exclusively "
3037 "from one thread, or provide your own mutex so that two threads cannot issue "
3038 "calls on the same handle at the same time."
3042 #: ../src/guestfs.pod:1552
3044 "See the graphical program guestfs-browser for one possible architecture for "
3045 "multithreaded programs using libvirt and libguestfs."
3049 #: ../src/guestfs.pod:1555
3050 msgid "QEMU WRAPPERS"
3054 #: ../src/guestfs.pod:1557
3056 "If you want to compile your own qemu, run qemu from a non-standard location, "
3057 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3062 #: ../src/guestfs.pod:1561
3064 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3065 "last command in the shell script (so that qemu replaces the shell and "
3066 "becomes the direct child of the libguestfs-using program). If you don't do "
3067 "this, then the qemu process won't be cleaned up correctly."
3071 #: ../src/guestfs.pod:1566
3073 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3078 #: ../src/guestfs.pod:1569
3082 " qemudir=/home/rjones/d/qemu\n"
3083 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
3089 #: ../src/guestfs.pod:1573
3091 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3092 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3097 #: ../src/guestfs.pod:1577
3100 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3105 #: ../src/guestfs.pod:1579
3107 "Note that libguestfs also calls qemu with the -help and -version options in "
3108 "order to determine features."
3112 #: ../src/guestfs.pod:1582
3113 msgid "LIBGUESTFS VERSION NUMBERS"
3117 #: ../src/guestfs.pod:1584
3119 "Since April 2010, libguestfs has started to make separate development and "
3120 "stable releases, along with corresponding branches in our git repository. "
3121 "These separate releases can be identified by version number:"
3125 #: ../src/guestfs.pod:1589
3128 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3129 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3135 " | `-------- sub-version\n"
3137 " `------ always '1' because we don't change the ABI\n"
3142 #: ../src/guestfs.pod:1600
3143 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3147 #: ../src/guestfs.pod:1602
3149 "As time passes we cherry pick fixes from the development branch and backport "
3150 "those into the stable branch, the effect being that the stable branch should "
3151 "get more stable and less buggy over time. So the stable releases are ideal "
3152 "for people who don't need new features but would just like the software to "
3157 #: ../src/guestfs.pod:1608
3158 msgid "Our criteria for backporting changes are:"
3162 #: ../src/guestfs.pod:1614
3164 "Documentation changes which don't affect any code are backported unless the "
3165 "documentation refers to a future feature which is not in stable."
3169 #: ../src/guestfs.pod:1620
3171 "Bug fixes which are not controversial, fix obvious problems, and have been "
3172 "well tested are backported."
3176 #: ../src/guestfs.pod:1625
3178 "Simple rearrangements of code which shouldn't affect how it works get "
3179 "backported. This is so that the code in the two branches doesn't get too "
3180 "far out of step, allowing us to backport future fixes more easily."
3184 #: ../src/guestfs.pod:1631
3186 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3187 "exceptional case: the new feature is required in order to implement an "
3188 "important bug fix."
3192 #: ../src/guestfs.pod:1637
3194 "A new stable branch starts when we think the new features in development are "
3195 "substantial and compelling enough over the current stable branch to warrant "
3196 "it. When that happens we create new stable and development versions 1.N.0 "
3197 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3198 "stable at this point, but by backporting fixes from development, that branch "
3199 "will stabilize over time."
3203 #: ../src/guestfs.pod:1645 ../fish/guestfish.pod:803 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:312 ../tools/virt-rescue.pl:226
3204 msgid "ENVIRONMENT VARIABLES"
3208 #: ../src/guestfs.pod:1649 ../fish/guestfish.pod:829
3209 msgid "LIBGUESTFS_APPEND"
3213 #: ../src/guestfs.pod:1651 ../fish/guestfish.pod:831
3214 msgid "Pass additional options to the guest kernel."
3218 #: ../src/guestfs.pod:1653 ../fish/guestfish.pod:833
3219 msgid "LIBGUESTFS_DEBUG"
3223 #: ../src/guestfs.pod:1655
3225 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3226 "effect as calling C<guestfs_set_verbose (g, 1)>."
3230 #: ../src/guestfs.pod:1658 ../fish/guestfish.pod:838
3231 msgid "LIBGUESTFS_MEMSIZE"
3235 #: ../src/guestfs.pod:1660 ../fish/guestfish.pod:840
3236 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
3240 #: ../src/guestfs.pod:1663 ../fish/guestfish.pod:843
3243 " LIBGUESTFS_MEMSIZE=700\n"
3248 #: ../src/guestfs.pod:1665 ../fish/guestfish.pod:845
3249 msgid "LIBGUESTFS_PATH"
3253 #: ../src/guestfs.pod:1667
3255 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3256 "the discussion of paths in section PATH above."
3260 #: ../src/guestfs.pod:1670 ../fish/guestfish.pod:850
3261 msgid "LIBGUESTFS_QEMU"
3265 #: ../src/guestfs.pod:1672 ../fish/guestfish.pod:852
3267 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3268 "which was found at compile time by the configure script is used."
3272 #: ../src/guestfs.pod:1676
3273 msgid "See also L</QEMU WRAPPERS> above."
3277 #: ../src/guestfs.pod:1678 ../fish/guestfish.pod:856
3278 msgid "LIBGUESTFS_TRACE"
3282 #: ../src/guestfs.pod:1680
3284 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3285 "effect as calling C<guestfs_set_trace (g, 1)>."
3289 #: ../src/guestfs.pod:1683 ../fish/guestfish.pod:865
3294 #: ../src/guestfs.pod:1685 ../fish/guestfish.pod:867
3295 msgid "Location of temporary directory, defaults to C</tmp>."
3299 #: ../src/guestfs.pod:1687 ../fish/guestfish.pod:869
3301 "If libguestfs was compiled to use the supermin appliance then each handle "
3302 "will require rather a large amount of space in this directory for short "
3303 "periods of time (~ 80 MB). You can use C<$TMPDIR> to configure another "
3304 "directory to use in case C</tmp> is not large enough."
3308 #: ../src/guestfs.pod:1695 ../fish/guestfish.pod:927 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:178 ../inspector/virt-inspector.pl:846 ../tools/virt-cat.pl:163 ../tools/virt-df.pl:536 ../tools/virt-edit.pl:325 ../tools/virt-list-filesystems.pl:191 ../tools/virt-list-partitions.pl:229 ../tools/virt-ls.pl:210 ../tools/virt-make-fs.pl:527 ../tools/virt-rescue.pl:231 ../tools/virt-resize.pl:1390 ../tools/virt-tar.pl:257 ../tools/virt-win-reg.pl:461
3313 #: ../src/guestfs.pod:1697
3315 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
3316 "L<virt-edit(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
3317 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
3318 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
3319 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
3323 #: ../src/guestfs.pod:1715
3325 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
3326 "L<lvm(8)>, L<disktype(1)>."
3330 #: ../src/guestfs.pod:1722 ../tools/virt-make-fs.pl:541 ../tools/virt-win-reg.pl:476
3335 #: ../src/guestfs.pod:1724
3336 msgid "To get a list of bugs against libguestfs use this link:"
3340 #: ../src/guestfs.pod:1726
3341 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
3345 #: ../src/guestfs.pod:1728
3346 msgid "To report a new bug against libguestfs use this link:"
3350 #: ../src/guestfs.pod:1730
3351 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
3355 #: ../src/guestfs.pod:1732
3356 msgid "When reporting a bug, please check:"
3360 #: ../src/guestfs.pod:1738
3361 msgid "That the bug hasn't been reported already."
3365 #: ../src/guestfs.pod:1742
3366 msgid "That you are testing a recent version."
3370 #: ../src/guestfs.pod:1746
3371 msgid "Describe the bug accurately, and give a way to reproduce it."
3375 #: ../src/guestfs.pod:1750
3377 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3382 #: ../src/guestfs.pod:1755 ../fish/guestfish.pod:944 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:189 ../inspector/virt-inspector.pl:855
3387 #: ../src/guestfs.pod:1757 ../fish/guestfish.pod:946 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:191
3388 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3392 #: ../src/guestfs.pod:1759 ../fish/guestfish.pod:948 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:193 ../inspector/virt-inspector.pl:861 ../tools/virt-cat.pl:177 ../tools/virt-df.pl:549 ../tools/virt-edit.pl:341 ../tools/virt-list-filesystems.pl:207 ../tools/virt-list-partitions.pl:244 ../tools/virt-ls.pl:225 ../tools/virt-make-fs.pl:556 ../tools/virt-rescue.pl:245 ../tools/virt-resize.pl:1411 ../tools/virt-tar.pl:272 ../tools/virt-win-reg.pl:491
3397 #: ../src/guestfs.pod:1761 ../fish/guestfish.pod:950
3398 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3402 #: ../src/guestfs.pod:1764
3404 "This library is free software; you can redistribute it and/or modify it "
3405 "under the terms of the GNU Lesser General Public License as published by the "
3406 "Free Software Foundation; either version 2 of the License, or (at your "
3407 "option) any later version."
3411 #: ../src/guestfs.pod:1769
3413 "This library is distributed in the hope that it will be useful, but WITHOUT "
3414 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3415 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3420 #: ../src/guestfs.pod:1774
3422 "You should have received a copy of the GNU Lesser General Public License "
3423 "along with this library; if not, write to the Free Software Foundation, "
3424 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3428 #: ../src/guestfs-actions.pod:1
3429 msgid "guestfs_add_cdrom"
3433 #: ../src/guestfs-actions.pod:3
3436 " int guestfs_add_cdrom (guestfs_h *g,\n"
3437 "\t\tconst char *filename);\n"
3442 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:7
3443 msgid "This function adds a virtual CD-ROM disk image to the guest."
3447 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:9
3448 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3452 #: ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:1516 ../fish/guestfish-actions.pod:11 ../fish/guestfish-actions.pod:1211
3457 #: ../src/guestfs-actions.pod:16
3459 "This call checks for the existence of C<filename>. This stops you from "
3460 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3461 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3466 #: ../src/guestfs-actions.pod:23
3468 "If you just want to add an ISO file (often you use this as an efficient way "
3469 "to transfer large files into the guest), then you should probably use "
3470 "C<guestfs_add_drive_ro> instead."
3474 #: ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:63 ../src/guestfs-actions.pod:92 ../src/guestfs-actions.pod:103 ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:124 ../src/guestfs-actions.pod:135 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:324 ../src/guestfs-actions.pod:339 ../src/guestfs-actions.pod:403 ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:441 ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:549 ../src/guestfs-actions.pod:560 ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:824 ../src/guestfs-actions.pod:839 ../src/guestfs-actions.pod:855 ../src/guestfs-actions.pod:866 ../src/guestfs-actions.pod:883 ../src/guestfs-actions.pod:916 ../src/guestfs-actions.pod:974 ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:1055 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1393 ../src/guestfs-actions.pod:1474 ../src/guestfs-actions.pod:1822 ../src/guestfs-actions.pod:1945 ../src/guestfs-actions.pod:2000 ../src/guestfs-actions.pod:2030 ../src/guestfs-actions.pod:2439 ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2576 ../src/guestfs-actions.pod:2587 ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:2620 ../src/guestfs-actions.pod:2650 ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2731 ../src/guestfs-actions.pod:2745 ../src/guestfs-actions.pod:2765 ../src/guestfs-actions.pod:2785 ../src/guestfs-actions.pod:2814 ../src/guestfs-actions.pod:2830 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2858 ../src/guestfs-actions.pod:2867 ../src/guestfs-actions.pod:2900 ../src/guestfs-actions.pod:2913 ../src/guestfs-actions.pod:2923 ../src/guestfs-actions.pod:2935 ../src/guestfs-actions.pod:2949 ../src/guestfs-actions.pod:3029 ../src/guestfs-actions.pod:3046 ../src/guestfs-actions.pod:3056 ../src/guestfs-actions.pod:3101 ../src/guestfs-actions.pod:3116 ../src/guestfs-actions.pod:3131 ../src/guestfs-actions.pod:3144 ../src/guestfs-actions.pod:3155 ../src/guestfs-actions.pod:3166 ../src/guestfs-actions.pod:3180 ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3240 ../src/guestfs-actions.pod:3268 ../src/guestfs-actions.pod:3284 ../src/guestfs-actions.pod:3300 ../src/guestfs-actions.pod:3309 ../src/guestfs-actions.pod:3323 ../src/guestfs-actions.pod:3333 ../src/guestfs-actions.pod:3345 ../src/guestfs-actions.pod:3357 ../src/guestfs-actions.pod:3389 ../src/guestfs-actions.pod:3401 ../src/guestfs-actions.pod:3418 ../src/guestfs-actions.pod:3429 ../src/guestfs-actions.pod:3443 ../src/guestfs-actions.pod:3483 ../src/guestfs-actions.pod:3514 ../src/guestfs-actions.pod:3525 ../src/guestfs-actions.pod:3550 ../src/guestfs-actions.pod:3564 ../src/guestfs-actions.pod:3579 ../src/guestfs-actions.pod:3701 ../src/guestfs-actions.pod:3753 ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:3787 ../src/guestfs-actions.pod:3813 ../src/guestfs-actions.pod:3847 ../src/guestfs-actions.pod:3861 ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:3882 ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4130 ../src/guestfs-actions.pod:4141 ../src/guestfs-actions.pod:4150 ../src/guestfs-actions.pod:4161 ../src/guestfs-actions.pod:4170 ../src/guestfs-actions.pod:4181 ../src/guestfs-actions.pod:4194 ../src/guestfs-actions.pod:4212 ../src/guestfs-actions.pod:4228 ../src/guestfs-actions.pod:4244 ../src/guestfs-actions.pod:4259 ../src/guestfs-actions.pod:4279 ../src/guestfs-actions.pod:4294 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4328 ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:4383 ../src/guestfs-actions.pod:4404 ../src/guestfs-actions.pod:4420 ../src/guestfs-actions.pod:4441 ../src/guestfs-actions.pod:4453 ../src/guestfs-actions.pod:4465 ../src/guestfs-actions.pod:4481 ../src/guestfs-actions.pod:4515 ../src/guestfs-actions.pod:4535 ../src/guestfs-actions.pod:4558 ../src/guestfs-actions.pod:4648 ../src/guestfs-actions.pod:4754 ../src/guestfs-actions.pod:4763 ../src/guestfs-actions.pod:4773 ../src/guestfs-actions.pod:4783 ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:4812 ../src/guestfs-actions.pod:4822 ../src/guestfs-actions.pod:4832 ../src/guestfs-actions.pod:4844 ../src/guestfs-actions.pod:4894 ../src/guestfs-actions.pod:4908 ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:4934 ../src/guestfs-actions.pod:4948 ../src/guestfs-actions.pod:4958 ../src/guestfs-actions.pod:4975 ../src/guestfs-actions.pod:5005 ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:5051 ../src/guestfs-actions.pod:5061 ../src/guestfs-actions.pod:5076 ../src/guestfs-actions.pod:5102 ../src/guestfs-actions.pod:5130 ../src/guestfs-actions.pod:5234 ../src/guestfs-actions.pod:5249 ../src/guestfs-actions.pod:5260 ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:5380 ../src/guestfs-actions.pod:5422 ../src/guestfs-actions.pod:5445 ../src/guestfs-actions.pod:5502 ../src/guestfs-actions.pod:5518 ../src/guestfs-actions.pod:5544
3475 msgid "This function returns 0 on success or -1 on error."
3479 #: ../src/guestfs-actions.pod:31
3480 msgid "guestfs_add_drive"
3484 #: ../src/guestfs-actions.pod:33
3487 " int guestfs_add_drive (guestfs_h *g,\n"
3488 "\t\tconst char *filename);\n"
3493 #: ../src/guestfs-actions.pod:36 ../fish/guestfish-actions.pod:36
3495 "This function adds a virtual machine disk image C<filename> to the guest. "
3496 "The first time you call this function, the disk appears as IDE disk 0 "
3497 "(C</dev/sda>) in the guest, the second time as C</dev/sdb>, and so on."
3501 #: ../src/guestfs-actions.pod:41 ../fish/guestfish-actions.pod:41
3503 "You don't necessarily need to be root when using libguestfs. However you "
3504 "obviously do need sufficient permissions to access the filename for whatever "
3505 "operations you want to perform (ie. read access if you just want to read the "
3506 "image or write access if you want to modify the image)."
3510 #: ../src/guestfs-actions.pod:47 ../fish/guestfish-actions.pod:47
3512 "This is equivalent to the qemu parameter C<-drive "
3513 "file=filename,cache=off,if=...>."
3517 #: ../src/guestfs-actions.pod:50 ../fish/guestfish-actions.pod:50
3519 "C<cache=off> is omitted in cases where it is not supported by the underlying "
3524 #: ../src/guestfs-actions.pod:53 ../src/guestfs-actions.pod:82
3526 "C<if=...> is set at compile time by the configuration option C<./configure "
3527 "--with-drive-if=...>. In the rare case where you might need to change this "
3528 "at run time, use C<guestfs_add_drive_with_if> or "
3529 "C<guestfs_add_drive_ro_with_if>."
3533 #: ../src/guestfs-actions.pod:58 ../src/guestfs-actions.pod:87
3535 "Note that this call checks for the existence of C<filename>. This stops you "
3536 "from specifying other types of drive which are supported by qemu such as "
3537 "C<nbd:> and C<http:> URLs. To specify those, use the general "
3538 "C<guestfs_config> call instead."
3542 #: ../src/guestfs-actions.pod:65
3543 msgid "guestfs_add_drive_ro"
3547 #: ../src/guestfs-actions.pod:67
3550 " int guestfs_add_drive_ro (guestfs_h *g,\n"
3551 "\t\tconst char *filename);\n"
3556 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:69
3557 msgid "This adds a drive in snapshot mode, making it effectively read-only."
3561 #: ../src/guestfs-actions.pod:73 ../fish/guestfish-actions.pod:72
3563 "Note that writes to the device are allowed, and will be seen for the "
3564 "duration of the guestfs handle, but they are written to a temporary file "
3565 "which is discarded as soon as the guestfs handle is closed. We don't "
3566 "currently have any method to enable changes to be committed, although qemu "
3571 #: ../src/guestfs-actions.pod:79 ../fish/guestfish-actions.pod:78
3573 "This is equivalent to the qemu parameter C<-drive "
3574 "file=filename,snapshot=on,if=...>."
3578 #: ../src/guestfs-actions.pod:94
3579 msgid "guestfs_add_drive_ro_with_if"
3583 #: ../src/guestfs-actions.pod:96
3586 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
3587 "\t\tconst char *filename,\n"
3588 "\t\tconst char *iface);\n"
3593 #: ../src/guestfs-actions.pod:100
3595 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
3596 "QEMU interface emulation to use at run time."
3600 #: ../src/guestfs-actions.pod:105
3601 msgid "guestfs_add_drive_with_if"
3605 #: ../src/guestfs-actions.pod:107
3608 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
3609 "\t\tconst char *filename,\n"
3610 "\t\tconst char *iface);\n"
3615 #: ../src/guestfs-actions.pod:111
3617 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
3618 "QEMU interface emulation to use at run time."
3622 #: ../src/guestfs-actions.pod:116
3623 msgid "guestfs_aug_clear"
3627 #: ../src/guestfs-actions.pod:118
3630 " int guestfs_aug_clear (guestfs_h *g,\n"
3631 "\t\tconst char *augpath);\n"
3636 #: ../src/guestfs-actions.pod:121 ../fish/guestfish-actions.pod:109
3638 "Set the value associated with C<path> to C<NULL>. This is the same as the "
3639 "L<augtool(1)> C<clear> command."
3643 #: ../src/guestfs-actions.pod:126
3644 msgid "guestfs_aug_close"
3648 #: ../src/guestfs-actions.pod:128
3651 " int guestfs_aug_close (guestfs_h *g);\n"
3656 #: ../src/guestfs-actions.pod:130
3658 "Close the current Augeas handle and free up any resources used by it. After "
3659 "calling this, you have to call C<guestfs_aug_init> again before you can use "
3660 "any other Augeas functions."
3664 #: ../src/guestfs-actions.pod:137
3665 msgid "guestfs_aug_defnode"
3669 #: ../src/guestfs-actions.pod:139
3672 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
3673 "\t\tconst char *name,\n"
3674 "\t\tconst char *expr,\n"
3675 "\t\tconst char *val);\n"
3680 #: ../src/guestfs-actions.pod:144 ../fish/guestfish-actions.pod:125
3681 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
3685 #: ../src/guestfs-actions.pod:147
3687 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
3688 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
3689 "containing that single node."
3693 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:132
3695 "On success this returns a pair containing the number of nodes in the "
3696 "nodeset, and a boolean flag if a node was created."
3700 #: ../src/guestfs-actions.pod:155
3702 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
3703 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
3707 #: ../src/guestfs-actions.pod:159
3708 msgid "guestfs_aug_defvar"
3712 #: ../src/guestfs-actions.pod:161
3715 " int guestfs_aug_defvar (guestfs_h *g,\n"
3716 "\t\tconst char *name,\n"
3717 "\t\tconst char *expr);\n"
3722 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:140
3724 "Defines an Augeas variable C<name> whose value is the result of evaluating "
3725 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
3729 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:144
3731 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
3732 "evaluates to something which is not a nodeset."
3736 #: ../src/guestfs-actions.pod:172 ../src/guestfs-actions.pod:313 ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:492 ../src/guestfs-actions.pod:507 ../src/guestfs-actions.pod:523 ../src/guestfs-actions.pod:1041 ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:1650 ../src/guestfs-actions.pod:1693 ../src/guestfs-actions.pod:1710 ../src/guestfs-actions.pod:1935 ../src/guestfs-actions.pod:2147 ../src/guestfs-actions.pod:2165 ../src/guestfs-actions.pod:3503 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:3941 ../src/guestfs-actions.pod:5040 ../src/guestfs-actions.pod:5390 ../src/guestfs-actions.pod:5400 ../src/guestfs-actions.pod:5410
3737 msgid "On error this function returns -1."
3741 #: ../src/guestfs-actions.pod:174
3742 msgid "guestfs_aug_get"
3746 #: ../src/guestfs-actions.pod:176
3749 " char *guestfs_aug_get (guestfs_h *g,\n"
3750 "\t\tconst char *augpath);\n"
3755 #: ../src/guestfs-actions.pod:179 ../fish/guestfish-actions.pod:151
3757 "Look up the value associated with C<path>. If C<path> matches exactly one "
3758 "node, the C<value> is returned."
3762 #: ../src/guestfs-actions.pod:182 ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:682 ../src/guestfs-actions.pod:695 ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:899 ../src/guestfs-actions.pod:928 ../src/guestfs-actions.pod:942 ../src/guestfs-actions.pod:958 ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1487 ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1577 ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1729 ../src/guestfs-actions.pod:1868 ../src/guestfs-actions.pod:2049 ../src/guestfs-actions.pod:2099 ../src/guestfs-actions.pod:2215 ../src/guestfs-actions.pod:2250 ../src/guestfs-actions.pod:2565 ../src/guestfs-actions.pod:2986 ../src/guestfs-actions.pod:3082 ../src/guestfs-actions.pod:3625 ../src/guestfs-actions.pod:3801 ../src/guestfs-actions.pod:3919 ../src/guestfs-actions.pod:4057 ../src/guestfs-actions.pod:4100 ../src/guestfs-actions.pod:4576 ../src/guestfs-actions.pod:4589 ../src/guestfs-actions.pod:4603 ../src/guestfs-actions.pod:4624 ../src/guestfs-actions.pod:5183 ../src/guestfs-actions.pod:5199 ../src/guestfs-actions.pod:5214 ../src/guestfs-actions.pod:5362 ../src/guestfs-actions.pod:5592
3764 "This function returns a string, or NULL on error. I<The caller must free "
3765 "the returned string after use>."
3769 #: ../src/guestfs-actions.pod:185
3770 msgid "guestfs_aug_init"
3774 #: ../src/guestfs-actions.pod:187
3777 " int guestfs_aug_init (guestfs_h *g,\n"
3778 "\t\tconst char *root,\n"
3784 #: ../src/guestfs-actions.pod:191 ../fish/guestfish-actions.pod:158
3786 "Create a new Augeas handle for editing configuration files. If there was "
3787 "any previous Augeas handle associated with this guestfs session, then it is "
3792 #: ../src/guestfs-actions.pod:195
3793 msgid "You must call this before using any other C<guestfs_aug_*> commands."
3797 #: ../src/guestfs-actions.pod:198 ../fish/guestfish-actions.pod:165
3798 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
3802 #: ../src/guestfs-actions.pod:201 ../fish/guestfish-actions.pod:168
3804 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
3805 "logical I<or> of the following integers:"
3809 #: ../src/guestfs-actions.pod:207 ../fish/guestfish-actions.pod:174
3810 msgid "C<AUG_SAVE_BACKUP> = 1"
3814 #: ../src/guestfs-actions.pod:209 ../fish/guestfish-actions.pod:176
3815 msgid "Keep the original file with a C<.augsave> extension."
3819 #: ../src/guestfs-actions.pod:211 ../fish/guestfish-actions.pod:178
3820 msgid "C<AUG_SAVE_NEWFILE> = 2"
3824 #: ../src/guestfs-actions.pod:213 ../fish/guestfish-actions.pod:180
3826 "Save changes into a file with extension C<.augnew>, and do not overwrite "
3827 "original. Overrides C<AUG_SAVE_BACKUP>."
3831 #: ../src/guestfs-actions.pod:216 ../fish/guestfish-actions.pod:183
3832 msgid "C<AUG_TYPE_CHECK> = 4"
3836 #: ../src/guestfs-actions.pod:218 ../fish/guestfish-actions.pod:185
3837 msgid "Typecheck lenses (can be expensive)."
3841 #: ../src/guestfs-actions.pod:220 ../fish/guestfish-actions.pod:187
3842 msgid "C<AUG_NO_STDINC> = 8"
3846 #: ../src/guestfs-actions.pod:222 ../fish/guestfish-actions.pod:189
3847 msgid "Do not use standard load path for modules."
3851 #: ../src/guestfs-actions.pod:224 ../fish/guestfish-actions.pod:191
3852 msgid "C<AUG_SAVE_NOOP> = 16"
3856 #: ../src/guestfs-actions.pod:226 ../fish/guestfish-actions.pod:193
3857 msgid "Make save a no-op, just record what would have been changed."
3861 #: ../src/guestfs-actions.pod:228 ../fish/guestfish-actions.pod:195
3862 msgid "C<AUG_NO_LOAD> = 32"
3866 #: ../src/guestfs-actions.pod:230
3867 msgid "Do not load the tree in C<guestfs_aug_init>."
3871 #: ../src/guestfs-actions.pod:234
3872 msgid "To close the handle, you can call C<guestfs_aug_close>."
3876 #: ../src/guestfs-actions.pod:236 ../fish/guestfish-actions.pod:203
3877 msgid "To find out more about Augeas, see L<http://augeas.net/>."
3881 #: ../src/guestfs-actions.pod:240
3882 msgid "guestfs_aug_insert"
3886 #: ../src/guestfs-actions.pod:242
3889 " int guestfs_aug_insert (guestfs_h *g,\n"
3890 "\t\tconst char *augpath,\n"
3891 "\t\tconst char *label,\n"
3892 "\t\tint before);\n"
3897 #: ../src/guestfs-actions.pod:247 ../fish/guestfish-actions.pod:209
3899 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
3900 "or after C<path> (depending on the boolean flag C<before>)."
3904 #: ../src/guestfs-actions.pod:251 ../fish/guestfish-actions.pod:213
3906 "C<path> must match exactly one existing node in the tree, and C<label> must "
3907 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
3911 #: ../src/guestfs-actions.pod:257
3912 msgid "guestfs_aug_load"
3916 #: ../src/guestfs-actions.pod:259
3919 " int guestfs_aug_load (guestfs_h *g);\n"
3924 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:221
3925 msgid "Load files into the tree."
3929 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:223
3930 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
3934 #: ../src/guestfs-actions.pod:268
3935 msgid "guestfs_aug_ls"
3939 #: ../src/guestfs-actions.pod:270
3942 " char **guestfs_aug_ls (guestfs_h *g,\n"
3943 "\t\tconst char *augpath);\n"
3948 #: ../src/guestfs-actions.pod:273
3950 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
3951 "sorting the resulting nodes into alphabetical order."
3955 #: ../src/guestfs-actions.pod:276 ../src/guestfs-actions.pod:289 ../src/guestfs-actions.pod:417 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:1081 ../src/guestfs-actions.pod:1097 ../src/guestfs-actions.pod:1185 ../src/guestfs-actions.pod:1201 ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1766 ../src/guestfs-actions.pod:1779 ../src/guestfs-actions.pod:1795 ../src/guestfs-actions.pod:1832 ../src/guestfs-actions.pod:1853 ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1955 ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:2289 ../src/guestfs-actions.pod:2494 ../src/guestfs-actions.pod:2550 ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2963 ../src/guestfs-actions.pod:3470 ../src/guestfs-actions.pod:3896 ../src/guestfs-actions.pod:3982 ../src/guestfs-actions.pod:4088 ../src/guestfs-actions.pod:4637 ../src/guestfs-actions.pod:4686 ../src/guestfs-actions.pod:4738 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:4875 ../src/guestfs-actions.pod:5275 ../src/guestfs-actions.pod:5292 ../src/guestfs-actions.pod:5330 ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5555 ../src/guestfs-actions.pod:5571 ../src/guestfs-actions.pod:5611 ../src/guestfs-actions.pod:5627
3957 "This function returns a NULL-terminated array of strings (like "
3958 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
3959 "strings and the array after use>."
3963 #: ../src/guestfs-actions.pod:280
3964 msgid "guestfs_aug_match"
3968 #: ../src/guestfs-actions.pod:282
3971 " char **guestfs_aug_match (guestfs_h *g,\n"
3972 "\t\tconst char *augpath);\n"
3977 #: ../src/guestfs-actions.pod:285 ../fish/guestfish-actions.pod:237
3979 "Returns a list of paths which match the path expression C<path>. The "
3980 "returned paths are sufficiently qualified so that they match exactly one "
3981 "node in the current tree."
3985 #: ../src/guestfs-actions.pod:293
3986 msgid "guestfs_aug_mv"
3990 #: ../src/guestfs-actions.pod:295
3993 " int guestfs_aug_mv (guestfs_h *g,\n"
3994 "\t\tconst char *src,\n"
3995 "\t\tconst char *dest);\n"
4000 #: ../src/guestfs-actions.pod:299 ../fish/guestfish-actions.pod:245
4002 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4003 "C<dest> is overwritten if it exists."
4007 #: ../src/guestfs-actions.pod:304
4008 msgid "guestfs_aug_rm"
4012 #: ../src/guestfs-actions.pod:306
4015 " int guestfs_aug_rm (guestfs_h *g,\n"
4016 "\t\tconst char *augpath);\n"
4021 #: ../src/guestfs-actions.pod:309 ../fish/guestfish-actions.pod:252
4022 msgid "Remove C<path> and all of its children."
4026 #: ../src/guestfs-actions.pod:311 ../fish/guestfish-actions.pod:254
4027 msgid "On success this returns the number of entries which were removed."
4031 #: ../src/guestfs-actions.pod:315
4032 msgid "guestfs_aug_save"
4036 #: ../src/guestfs-actions.pod:317
4039 " int guestfs_aug_save (guestfs_h *g);\n"
4044 #: ../src/guestfs-actions.pod:319 ../fish/guestfish-actions.pod:260
4045 msgid "This writes all pending changes to disk."
4049 #: ../src/guestfs-actions.pod:321
4051 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4056 #: ../src/guestfs-actions.pod:326
4057 msgid "guestfs_aug_set"
4061 #: ../src/guestfs-actions.pod:328
4064 " int guestfs_aug_set (guestfs_h *g,\n"
4065 "\t\tconst char *augpath,\n"
4066 "\t\tconst char *val);\n"
4071 #: ../src/guestfs-actions.pod:332 ../fish/guestfish-actions.pod:269
4072 msgid "Set the value associated with C<path> to C<val>."
4076 #: ../src/guestfs-actions.pod:334
4078 "In the Augeas API, it is possible to clear a node by setting the value to "
4079 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4080 "this call. Instead you must use the C<guestfs_aug_clear> call."
4084 #: ../src/guestfs-actions.pod:341
4085 msgid "guestfs_available"
4089 #: ../src/guestfs-actions.pod:343
4092 " int guestfs_available (guestfs_h *g,\n"
4093 "\t\tchar *const *groups);\n"
4098 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:280
4100 "This command is used to check the availability of some groups of "
4101 "functionality in the appliance, which not all builds of the libguestfs "
4102 "appliance will be able to provide."
4106 #: ../src/guestfs-actions.pod:350
4108 "The libguestfs groups, and the functions that those groups correspond to, "
4109 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4110 "runtime by calling C<guestfs_available_all_groups>."
4114 #: ../src/guestfs-actions.pod:355 ../fish/guestfish-actions.pod:289
4116 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4117 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4118 "and Augeas (configuration file editing) functions."
4122 #: ../src/guestfs-actions.pod:360 ../fish/guestfish-actions.pod:294
4123 msgid "The command returns no error if I<all> requested groups are available."
4127 #: ../src/guestfs-actions.pod:362 ../fish/guestfish-actions.pod:296
4129 "It fails with an error if one or more of the requested groups is unavailable "
4134 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:299
4136 "If an unknown group name is included in the list of groups then an error is "
4141 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:302
4146 #: ../src/guestfs-actions.pod:374
4147 msgid "You must call C<guestfs_launch> before calling this function."
4151 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:310
4153 "The reason is because we don't know what groups are supported by the "
4154 "appliance/daemon until it is running and can be queried."
4158 #: ../src/guestfs-actions.pod:382 ../fish/guestfish-actions.pod:316
4160 "If a group of functions is available, this does not necessarily mean that "
4161 "they will work. You still have to check for errors when calling individual "
4162 "API functions even if they are available."
4166 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:323
4168 "It is usually the job of distro packagers to build complete functionality "
4169 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4170 "with all requirements satisfied, will support everything."
4174 #: ../src/guestfs-actions.pod:396
4176 "This call was added in version C<1.0.80>. In previous versions of "
4177 "libguestfs all you could do would be to speculatively execute a command to "
4178 "find out if the daemon implemented it. See also C<guestfs_version>."
4182 #: ../src/guestfs-actions.pod:405
4183 msgid "guestfs_available_all_groups"
4187 #: ../src/guestfs-actions.pod:407
4190 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4195 #: ../src/guestfs-actions.pod:409
4197 "This command returns a list of all optional groups that this daemon knows "
4198 "about. Note this returns both supported and unsupported groups. To find "
4199 "out which ones the daemon can actually support you have to call "
4200 "C<guestfs_available> on each member of the returned list."
4204 #: ../src/guestfs-actions.pod:415
4205 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4209 #: ../src/guestfs-actions.pod:421
4210 msgid "guestfs_base64_in"
4214 #: ../src/guestfs-actions.pod:423
4217 " int guestfs_base64_in (guestfs_h *g,\n"
4218 "\t\tconst char *base64file,\n"
4219 "\t\tconst char *filename);\n"
4224 #: ../src/guestfs-actions.pod:427 ../fish/guestfish-actions.pod:353
4225 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4229 #: ../src/guestfs-actions.pod:432
4230 msgid "guestfs_base64_out"
4234 #: ../src/guestfs-actions.pod:434
4237 " int guestfs_base64_out (guestfs_h *g,\n"
4238 "\t\tconst char *filename,\n"
4239 "\t\tconst char *base64file);\n"
4244 #: ../src/guestfs-actions.pod:438 ../fish/guestfish-actions.pod:362
4246 "This command downloads the contents of C<filename>, writing it out to local "
4247 "file C<base64file> encoded as base64."
4251 #: ../src/guestfs-actions.pod:443
4252 msgid "guestfs_blockdev_flushbufs"
4256 #: ../src/guestfs-actions.pod:445
4259 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4260 "\t\tconst char *device);\n"
4265 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:371
4266 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4270 #: ../src/guestfs-actions.pod:451 ../src/guestfs-actions.pod:465 ../src/guestfs-actions.pod:477 ../src/guestfs-actions.pod:490 ../src/guestfs-actions.pod:505 ../src/guestfs-actions.pod:521 ../src/guestfs-actions.pod:532 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:569 ../fish/guestfish-actions.pod:374 ../fish/guestfish-actions.pod:385 ../fish/guestfish-actions.pod:394 ../fish/guestfish-actions.pod:404 ../fish/guestfish-actions.pod:416 ../fish/guestfish-actions.pod:429 ../fish/guestfish-actions.pod:437 ../fish/guestfish-actions.pod:448 ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:464
4271 msgid "This uses the L<blockdev(8)> command."
4275 #: ../src/guestfs-actions.pod:455
4276 msgid "guestfs_blockdev_getbsz"
4280 #: ../src/guestfs-actions.pod:457
4283 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4284 "\t\tconst char *device);\n"
4289 #: ../src/guestfs-actions.pod:460 ../fish/guestfish-actions.pod:380
4290 msgid "This returns the block size of a device."
4294 #: ../src/guestfs-actions.pod:462 ../src/guestfs-actions.pod:544 ../fish/guestfish-actions.pod:382 ../fish/guestfish-actions.pod:445
4296 "(Note this is different from both I<size in blocks> and I<filesystem block "
4301 #: ../src/guestfs-actions.pod:469
4302 msgid "guestfs_blockdev_getro"
4306 #: ../src/guestfs-actions.pod:471
4309 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4310 "\t\tconst char *device);\n"
4315 #: ../src/guestfs-actions.pod:474 ../fish/guestfish-actions.pod:391
4317 "Returns a boolean indicating if the block device is read-only (true if "
4318 "read-only, false if not)."
4322 #: ../src/guestfs-actions.pod:479 ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:1127 ../src/guestfs-actions.pod:1559 ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:1627 ../src/guestfs-actions.pod:1670 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1718 ../src/guestfs-actions.pod:2303 ../src/guestfs-actions.pod:2314 ../src/guestfs-actions.pod:2326 ../src/guestfs-actions.pod:2337 ../src/guestfs-actions.pod:2350 ../src/guestfs-actions.pod:2362 ../src/guestfs-actions.pod:2375 ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:2396 ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:2419 ../src/guestfs-actions.pod:2431 ../src/guestfs-actions.pod:3595
4323 msgid "This function returns a C truth value on success or -1 on error."
4327 #: ../src/guestfs-actions.pod:481
4328 msgid "guestfs_blockdev_getsize64"
4332 #: ../src/guestfs-actions.pod:483
4335 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
4336 "\t\tconst char *device);\n"
4341 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:400
4342 msgid "This returns the size of the device in bytes."
4346 #: ../src/guestfs-actions.pod:488
4347 msgid "See also C<guestfs_blockdev_getsz>."
4351 #: ../src/guestfs-actions.pod:494
4352 msgid "guestfs_blockdev_getss"
4356 #: ../src/guestfs-actions.pod:496
4359 " int guestfs_blockdev_getss (guestfs_h *g,\n"
4360 "\t\tconst char *device);\n"
4365 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:410
4367 "This returns the size of sectors on a block device. Usually 512, but can be "
4368 "larger for modern devices."
4372 #: ../src/guestfs-actions.pod:502
4374 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
4379 #: ../src/guestfs-actions.pod:509
4380 msgid "guestfs_blockdev_getsz"
4384 #: ../src/guestfs-actions.pod:511
4387 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
4388 "\t\tconst char *device);\n"
4393 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:422
4395 "This returns the size of the device in units of 512-byte sectors (even if "
4396 "the sectorsize isn't 512 bytes ... weird)."
4400 #: ../src/guestfs-actions.pod:517
4402 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
4403 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
4407 #: ../src/guestfs-actions.pod:525
4408 msgid "guestfs_blockdev_rereadpt"
4412 #: ../src/guestfs-actions.pod:527
4415 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
4416 "\t\tconst char *device);\n"
4421 #: ../src/guestfs-actions.pod:530 ../fish/guestfish-actions.pod:435
4422 msgid "Reread the partition table on C<device>."
4426 #: ../src/guestfs-actions.pod:536
4427 msgid "guestfs_blockdev_setbsz"
4431 #: ../src/guestfs-actions.pod:538
4434 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
4435 "\t\tconst char *device,\n"
4436 "\t\tint blocksize);\n"
4441 #: ../src/guestfs-actions.pod:542 ../fish/guestfish-actions.pod:443
4442 msgid "This sets the block size of a device."
4446 #: ../src/guestfs-actions.pod:551
4447 msgid "guestfs_blockdev_setro"
4451 #: ../src/guestfs-actions.pod:553
4454 " int guestfs_blockdev_setro (guestfs_h *g,\n"
4455 "\t\tconst char *device);\n"
4460 #: ../src/guestfs-actions.pod:556 ../fish/guestfish-actions.pod:454
4461 msgid "Sets the block device named C<device> to read-only."
4465 #: ../src/guestfs-actions.pod:562
4466 msgid "guestfs_blockdev_setrw"
4470 #: ../src/guestfs-actions.pod:564
4473 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
4474 "\t\tconst char *device);\n"
4479 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:462
4480 msgid "Sets the block device named C<device> to read-write."
4484 #: ../src/guestfs-actions.pod:573
4485 msgid "guestfs_case_sensitive_path"
4489 #: ../src/guestfs-actions.pod:575
4492 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
4493 "\t\tconst char *path);\n"
4498 #: ../src/guestfs-actions.pod:578 ../fish/guestfish-actions.pod:470
4500 "This can be used to resolve case insensitive paths on a filesystem which is "
4501 "case sensitive. The use case is to resolve paths which you have read from "
4502 "Windows configuration files or the Windows Registry, to the true path."
4506 #: ../src/guestfs-actions.pod:583 ../fish/guestfish-actions.pod:475
4508 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4509 "(and probably others), which is that although the underlying filesystem is "
4510 "case-insensitive, the driver exports the filesystem to Linux as "
4515 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:480
4517 "One consequence of this is that special directories such as C<c:\\windows> "
4518 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4519 "precise details of how they were created. In Windows itself this would not "
4524 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:486
4526 "Bug or feature? You decide: "
4527 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4531 #: ../src/guestfs-actions.pod:597 ../fish/guestfish-actions.pod:489
4533 "This function resolves the true case of each element in the path and returns "
4534 "the case-sensitive path."
4538 #: ../src/guestfs-actions.pod:600
4540 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
4541 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4542 "how the directories were originally created under Windows)."
4546 #: ../src/guestfs-actions.pod:605 ../fish/guestfish-actions.pod:497
4547 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4551 #: ../src/guestfs-actions.pod:608
4552 msgid "See also C<guestfs_realpath>."
4556 #: ../src/guestfs-actions.pod:613
4561 #: ../src/guestfs-actions.pod:615
4564 " char *guestfs_cat (guestfs_h *g,\n"
4565 "\t\tconst char *path);\n"
4570 #: ../src/guestfs-actions.pod:618 ../src/guestfs-actions.pod:3972 ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:3068
4571 msgid "Return the contents of the file named C<path>."
4575 #: ../src/guestfs-actions.pod:620
4577 "Note that this function cannot correctly handle binary files (specifically, "
4578 "files containing C<\\0> character which is treated as end of string). For "
4579 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
4580 "functions which have a more complex interface."
4584 #: ../src/guestfs-actions.pod:628 ../src/guestfs-actions.pod:789 ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:1085 ../src/guestfs-actions.pod:1101 ../src/guestfs-actions.pod:1189 ../src/guestfs-actions.pod:1205 ../src/guestfs-actions.pod:1436 ../src/guestfs-actions.pod:1783 ../src/guestfs-actions.pod:1799 ../src/guestfs-actions.pod:1836 ../src/guestfs-actions.pod:1857 ../src/guestfs-actions.pod:1871 ../src/guestfs-actions.pod:1897 ../src/guestfs-actions.pod:3835 ../src/guestfs-actions.pod:3943 ../src/guestfs-actions.pod:3964 ../src/guestfs-actions.pod:4690 ../src/guestfs-actions.pod:4742 ../src/guestfs-actions.pod:4858 ../src/guestfs-actions.pod:4879 ../src/guestfs-actions.pod:5424 ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5470 ../src/guestfs-actions.pod:5486 ../src/guestfs-actions.pod:5559 ../src/guestfs-actions.pod:5575 ../src/guestfs-actions.pod:5615 ../src/guestfs-actions.pod:5631 ../fish/guestfish-actions.pod:513 ../fish/guestfish-actions.pod:648 ../fish/guestfish-actions.pod:660 ../fish/guestfish-actions.pod:861 ../fish/guestfish-actions.pod:871 ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:948 ../fish/guestfish-actions.pod:1143 ../fish/guestfish-actions.pod:1418 ../fish/guestfish-actions.pod:1428 ../fish/guestfish-actions.pod:1456 ../fish/guestfish-actions.pod:1471 ../fish/guestfish-actions.pod:1481 ../fish/guestfish-actions.pod:1500 ../fish/guestfish-actions.pod:2970 ../fish/guestfish-actions.pod:3046 ../fish/guestfish-actions.pod:3061 ../fish/guestfish-actions.pod:3644 ../fish/guestfish-actions.pod:3690 ../fish/guestfish-actions.pod:3775 ../fish/guestfish-actions.pod:3790 ../fish/guestfish-actions.pod:4200 ../fish/guestfish-actions.pod:4218 ../fish/guestfish-actions.pod:4235 ../fish/guestfish-actions.pod:4245 ../fish/guestfish-actions.pod:4293 ../fish/guestfish-actions.pod:4303 ../fish/guestfish-actions.pod:4332 ../fish/guestfish-actions.pod:4342
4586 "Because of the message protocol, there is a transfer limit of somewhere "
4587 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4591 #: ../src/guestfs-actions.pod:631
4592 msgid "guestfs_checksum"
4596 #: ../src/guestfs-actions.pod:633
4599 " char *guestfs_checksum (guestfs_h *g,\n"
4600 "\t\tconst char *csumtype,\n"
4601 "\t\tconst char *path);\n"
4606 #: ../src/guestfs-actions.pod:637 ../fish/guestfish-actions.pod:520
4607 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4611 #: ../src/guestfs-actions.pod:640 ../fish/guestfish-actions.pod:523
4613 "The type of checksum to compute is given by the C<csumtype> parameter which "
4614 "must have one of the following values:"
4618 #: ../src/guestfs-actions.pod:645 ../fish/guestfish-actions.pod:528
4623 #: ../src/guestfs-actions.pod:647 ../fish/guestfish-actions.pod:530
4625 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
4630 #: ../src/guestfs-actions.pod:650 ../fish/guestfish-actions.pod:533
4635 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:535
4636 msgid "Compute the MD5 hash (using the C<md5sum> program)."
4640 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:537
4645 #: ../src/guestfs-actions.pod:656 ../fish/guestfish-actions.pod:539
4646 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
4650 #: ../src/guestfs-actions.pod:658 ../fish/guestfish-actions.pod:541
4655 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:543
4656 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
4660 #: ../src/guestfs-actions.pod:662 ../fish/guestfish-actions.pod:545
4665 #: ../src/guestfs-actions.pod:664 ../fish/guestfish-actions.pod:547
4666 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
4670 #: ../src/guestfs-actions.pod:666 ../fish/guestfish-actions.pod:549
4675 #: ../src/guestfs-actions.pod:668 ../fish/guestfish-actions.pod:551
4676 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
4680 #: ../src/guestfs-actions.pod:670 ../fish/guestfish-actions.pod:553
4685 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:555
4686 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
4690 #: ../src/guestfs-actions.pod:676 ../fish/guestfish-actions.pod:559
4691 msgid "The checksum is returned as a printable string."
4695 #: ../src/guestfs-actions.pod:678
4696 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
4700 #: ../src/guestfs-actions.pod:680
4701 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
4705 #: ../src/guestfs-actions.pod:685
4706 msgid "guestfs_checksum_device"
4710 #: ../src/guestfs-actions.pod:687
4713 " char *guestfs_checksum_device (guestfs_h *g,\n"
4714 "\t\tconst char *csumtype,\n"
4715 "\t\tconst char *device);\n"
4720 #: ../src/guestfs-actions.pod:691
4722 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
4723 "device named C<device>. For the types of checksums supported see the "
4724 "C<guestfs_checksum> command."
4728 #: ../src/guestfs-actions.pod:698
4729 msgid "guestfs_checksums_out"
4733 #: ../src/guestfs-actions.pod:700
4736 " int guestfs_checksums_out (guestfs_h *g,\n"
4737 "\t\tconst char *csumtype,\n"
4738 "\t\tconst char *directory,\n"
4739 "\t\tconst char *sumsfile);\n"
4744 #: ../src/guestfs-actions.pod:705 ../fish/guestfish-actions.pod:577
4746 "This command computes the checksums of all regular files in C<directory> and "
4747 "then emits a list of those checksums to the local output file C<sumsfile>."
4751 #: ../src/guestfs-actions.pod:709 ../fish/guestfish-actions.pod:581
4753 "This can be used for verifying the integrity of a virtual machine. However "
4754 "to be properly secure you should pay attention to the output of the checksum "
4755 "command (it uses the ones from GNU coreutils). In particular when the "
4756 "filename is not printable, coreutils uses a special backslash syntax. For "
4757 "more information, see the GNU coreutils info file."
4761 #: ../src/guestfs-actions.pod:719
4762 msgid "guestfs_chmod"
4766 #: ../src/guestfs-actions.pod:721
4769 " int guestfs_chmod (guestfs_h *g,\n"
4771 "\t\tconst char *path);\n"
4776 #: ../src/guestfs-actions.pod:725 ../fish/guestfish-actions.pod:595
4778 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
4783 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:598
4785 "I<Note>: When using this command from guestfish, C<mode> by default would be "
4786 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
4791 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3266 ../src/guestfs-actions.pod:3282 ../src/guestfs-actions.pod:3298 ../fish/guestfish-actions.pod:602 ../fish/guestfish-actions.pod:2475 ../fish/guestfish-actions.pod:2545 ../fish/guestfish-actions.pod:2555 ../fish/guestfish-actions.pod:2565
4792 msgid "The mode actually set is affected by the umask."
4796 #: ../src/guestfs-actions.pod:736
4797 msgid "guestfs_chown"
4801 #: ../src/guestfs-actions.pod:738
4804 " int guestfs_chown (guestfs_h *g,\n"
4807 "\t\tconst char *path);\n"
4812 #: ../src/guestfs-actions.pod:743 ../fish/guestfish-actions.pod:608
4813 msgid "Change the file owner to C<owner> and group to C<group>."
4817 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:2464 ../fish/guestfish-actions.pod:610 ../fish/guestfish-actions.pod:1966
4819 "Only numeric uid and gid are supported. If you want to use names, you will "
4820 "need to locate and parse the password file yourself (Augeas support makes "
4821 "this relatively easy)."
4825 #: ../src/guestfs-actions.pod:751
4826 msgid "guestfs_command"
4830 #: ../src/guestfs-actions.pod:753
4833 " char *guestfs_command (guestfs_h *g,\n"
4834 "\t\tchar *const *arguments);\n"
4839 #: ../src/guestfs-actions.pod:756 ../fish/guestfish-actions.pod:618
4841 "This call runs a command from the guest filesystem. The filesystem must be "
4842 "mounted, and must contain a compatible operating system (ie. something "
4843 "Linux, with the same or compatible processor architecture)."
4847 #: ../src/guestfs-actions.pod:761
4849 "The single parameter is an argv-style list of arguments. The first element "
4850 "is the name of the program to run. Subsequent elements are parameters. The "
4851 "list must be non-empty (ie. must contain a program name). Note that the "
4852 "command runs directly, and is I<not> invoked via the shell (see "
4857 #: ../src/guestfs-actions.pod:768 ../fish/guestfish-actions.pod:630
4858 msgid "The return value is anything printed to I<stdout> by the command."
4862 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:633
4864 "If the command returns a non-zero exit status, then this function returns an "
4865 "error message. The error message string is the content of I<stderr> from "
4870 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:637
4872 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
4873 "C</bin>. If you require a program from another location, you should provide "
4874 "the full path in the first parameter."
4878 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:642
4880 "Shared libraries and data files required by the program must be available on "
4881 "filesystems which are mounted in the correct places. It is the caller's "
4882 "responsibility to ensure all filesystems that are needed are mounted at the "
4887 #: ../src/guestfs-actions.pod:792
4888 msgid "guestfs_command_lines"
4892 #: ../src/guestfs-actions.pod:794
4895 " char **guestfs_command_lines (guestfs_h *g,\n"
4896 "\t\tchar *const *arguments);\n"
4901 #: ../src/guestfs-actions.pod:797
4903 "This is the same as C<guestfs_command>, but splits the result into a list of "
4908 #: ../src/guestfs-actions.pod:800
4909 msgid "See also: C<guestfs_sh_lines>"
4913 #: ../src/guestfs-actions.pod:809
4914 msgid "guestfs_config"
4918 #: ../src/guestfs-actions.pod:811
4921 " int guestfs_config (guestfs_h *g,\n"
4922 "\t\tconst char *qemuparam,\n"
4923 "\t\tconst char *qemuvalue);\n"
4928 #: ../src/guestfs-actions.pod:815 ../fish/guestfish-actions.pod:667
4930 "This can be used to add arbitrary qemu command line parameters of the form "
4931 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
4932 "setting some parameters which would interfere with parameters that we use."
4936 #: ../src/guestfs-actions.pod:820 ../fish/guestfish-actions.pod:672
4937 msgid "The first character of C<param> string must be a C<-> (dash)."
4941 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:674
4942 msgid "C<value> can be NULL."
4946 #: ../src/guestfs-actions.pod:826
4947 msgid "guestfs_copy_size"
4951 #: ../src/guestfs-actions.pod:828
4954 " int guestfs_copy_size (guestfs_h *g,\n"
4955 "\t\tconst char *src,\n"
4956 "\t\tconst char *dest,\n"
4957 "\t\tint64_t size);\n"
4962 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:680
4964 "This command copies exactly C<size> bytes from one source device or file "
4965 "C<src> to another destination device or file C<dest>."
4969 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:683
4971 "Note this will fail if the source is too short or if the destination is not "
4976 #: ../src/guestfs-actions.pod:841 ../src/guestfs-actions.pod:976 ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:1376 ../src/guestfs-actions.pod:1395 ../src/guestfs-actions.pod:5504 ../src/guestfs-actions.pod:5520
4978 "This long-running command can generate progress notification messages so "
4979 "that the caller can display a progress bar or indicator. To receive these "
4980 "messages, the caller must register a progress callback. See "
4981 "L<guestfs(3)/guestfs_set_progress_callback>."
4985 #: ../src/guestfs-actions.pod:846
4990 #: ../src/guestfs-actions.pod:848
4993 " int guestfs_cp (guestfs_h *g,\n"
4994 "\t\tconst char *src,\n"
4995 "\t\tconst char *dest);\n"
5000 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:690
5002 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5003 "destination filename or destination directory."
5007 #: ../src/guestfs-actions.pod:857
5008 msgid "guestfs_cp_a"
5012 #: ../src/guestfs-actions.pod:859
5015 " int guestfs_cp_a (guestfs_h *g,\n"
5016 "\t\tconst char *src,\n"
5017 "\t\tconst char *dest);\n"
5022 #: ../src/guestfs-actions.pod:863 ../fish/guestfish-actions.pod:697
5024 "This copies a file or directory from C<src> to C<dest> recursively using the "
5029 #: ../src/guestfs-actions.pod:868
5034 #: ../src/guestfs-actions.pod:870
5037 " int guestfs_dd (guestfs_h *g,\n"
5038 "\t\tconst char *src,\n"
5039 "\t\tconst char *dest);\n"
5044 #: ../src/guestfs-actions.pod:874 ../fish/guestfish-actions.pod:704
5046 "This command copies from one source device or file C<src> to another "
5047 "destination device or file C<dest>. Normally you would use this to copy to "
5048 "or from a device or partition, for example to duplicate a filesystem."
5052 #: ../src/guestfs-actions.pod:879
5054 "If the destination is a device, it must be as large or larger than the "
5055 "source file or device, otherwise the copy will fail. This command cannot do "
5056 "partial copies (see C<guestfs_copy_size>)."
5060 #: ../src/guestfs-actions.pod:885
5061 msgid "guestfs_debug"
5065 #: ../src/guestfs-actions.pod:887
5068 " char *guestfs_debug (guestfs_h *g,\n"
5069 "\t\tconst char *subcmd,\n"
5070 "\t\tchar *const *extraargs);\n"
5075 #: ../src/guestfs-actions.pod:891
5077 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5078 "guestfs daemon) that runs inside the qemu subprocess."
5082 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:721
5084 "There is no comprehensive help for this command. You have to look at the "
5085 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5089 #: ../src/guestfs-actions.pod:902
5090 msgid "guestfs_debug_upload"
5094 #: ../src/guestfs-actions.pod:904
5097 " int guestfs_debug_upload (guestfs_h *g,\n"
5098 "\t\tconst char *filename,\n"
5099 "\t\tconst char *tmpname,\n"
5105 #: ../src/guestfs-actions.pod:909
5107 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5112 #: ../src/guestfs-actions.pod:912 ../fish/guestfish-actions.pod:732
5114 "There is no comprehensive help for this command. You have to look at the "
5115 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5119 #: ../src/guestfs-actions.pod:918
5124 #: ../src/guestfs-actions.pod:920
5127 " char *guestfs_df (guestfs_h *g);\n"
5132 #: ../src/guestfs-actions.pod:922 ../fish/guestfish-actions.pod:742
5133 msgid "This command runs the C<df> command to report disk space used."
5137 #: ../src/guestfs-actions.pod:924 ../src/guestfs-actions.pod:938 ../fish/guestfish-actions.pod:744 ../fish/guestfish-actions.pod:755
5139 "This command is mostly useful for interactive sessions. It is I<not> "
5140 "intended that you try to parse the output string. Use C<statvfs> from "
5145 #: ../src/guestfs-actions.pod:931
5146 msgid "guestfs_df_h"
5150 #: ../src/guestfs-actions.pod:933
5153 " char *guestfs_df_h (guestfs_h *g);\n"
5158 #: ../src/guestfs-actions.pod:935 ../fish/guestfish-actions.pod:752
5160 "This command runs the C<df -h> command to report disk space used in "
5161 "human-readable format."
5165 #: ../src/guestfs-actions.pod:945
5166 msgid "guestfs_dmesg"
5170 #: ../src/guestfs-actions.pod:947
5173 " char *guestfs_dmesg (guestfs_h *g);\n"
5178 #: ../src/guestfs-actions.pod:949 ../fish/guestfish-actions.pod:763
5180 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5181 "This is sometimes useful for extended debugging of problems."
5185 #: ../src/guestfs-actions.pod:953
5187 "Another way to get the same information is to enable verbose messages with "
5188 "C<guestfs_set_verbose> or by setting the environment variable "
5189 "C<LIBGUESTFS_DEBUG=1> before running the program."
5193 #: ../src/guestfs-actions.pod:961
5194 msgid "guestfs_download"
5198 #: ../src/guestfs-actions.pod:963
5201 " int guestfs_download (guestfs_h *g,\n"
5202 "\t\tconst char *remotefilename,\n"
5203 "\t\tconst char *filename);\n"
5208 #: ../src/guestfs-actions.pod:967 ../src/guestfs-actions.pod:989 ../fish/guestfish-actions.pod:776 ../fish/guestfish-actions.pod:789
5210 "Download file C<remotefilename> and save it as C<filename> on the local "
5215 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:779 ../fish/guestfish-actions.pod:3948
5216 msgid "C<filename> can also be a named pipe."
5220 #: ../src/guestfs-actions.pod:972
5221 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5225 #: ../src/guestfs-actions.pod:981
5226 msgid "guestfs_download_offset"
5230 #: ../src/guestfs-actions.pod:983
5233 " int guestfs_download_offset (guestfs_h *g,\n"
5234 "\t\tconst char *remotefilename,\n"
5235 "\t\tconst char *filename,\n"
5236 "\t\tint64_t offset,\n"
5237 "\t\tint64_t size);\n"
5242 #: ../src/guestfs-actions.pod:992 ../fish/guestfish-actions.pod:792
5244 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5245 "region must be within the file or device)."
5249 #: ../src/guestfs-actions.pod:995
5251 "Note that there is no limit on the amount of data that can be downloaded "
5252 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
5253 "full amount unless an error occurs."
5257 #: ../src/guestfs-actions.pod:1000
5258 msgid "See also C<guestfs_download>, C<guestfs_pread>."
5262 #: ../src/guestfs-actions.pod:1009
5263 msgid "guestfs_drop_caches"
5267 #: ../src/guestfs-actions.pod:1011
5270 " int guestfs_drop_caches (guestfs_h *g,\n"
5271 "\t\tint whattodrop);\n"
5276 #: ../src/guestfs-actions.pod:1014 ../fish/guestfish-actions.pod:808
5278 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5279 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5280 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5284 #: ../src/guestfs-actions.pod:1019 ../fish/guestfish-actions.pod:813
5285 msgid "Setting C<whattodrop> to 3 should drop everything."
5289 #: ../src/guestfs-actions.pod:1021 ../fish/guestfish-actions.pod:815
5291 "This automatically calls L<sync(2)> before the operation, so that the "
5292 "maximum guest memory is freed."
5296 #: ../src/guestfs-actions.pod:1026
5301 #: ../src/guestfs-actions.pod:1028
5304 " int64_t guestfs_du (guestfs_h *g,\n"
5305 "\t\tconst char *path);\n"
5310 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:822
5312 "This command runs the C<du -s> command to estimate file space usage for "
5317 #: ../src/guestfs-actions.pod:1034 ../fish/guestfish-actions.pod:825
5319 "C<path> can be a file or a directory. If C<path> is a directory then the "
5320 "estimate includes the contents of the directory and all subdirectories "
5325 #: ../src/guestfs-actions.pod:1038 ../fish/guestfish-actions.pod:829
5326 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5330 #: ../src/guestfs-actions.pod:1043
5331 msgid "guestfs_e2fsck_f"
5335 #: ../src/guestfs-actions.pod:1045
5338 " int guestfs_e2fsck_f (guestfs_h *g,\n"
5339 "\t\tconst char *device);\n"
5344 #: ../src/guestfs-actions.pod:1048 ../fish/guestfish-actions.pod:836
5346 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5347 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
5352 #: ../src/guestfs-actions.pod:1052
5354 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
5355 "Normally you should use C<guestfs_fsck>."
5359 #: ../src/guestfs-actions.pod:1057
5360 msgid "guestfs_echo_daemon"
5364 #: ../src/guestfs-actions.pod:1059
5367 " char *guestfs_echo_daemon (guestfs_h *g,\n"
5368 "\t\tchar *const *words);\n"
5373 #: ../src/guestfs-actions.pod:1062 ../fish/guestfish-actions.pod:847
5375 "This command concatenates the list of C<words> passed with single spaces "
5376 "between them and returns the resulting string."
5380 #: ../src/guestfs-actions.pod:1065 ../fish/guestfish-actions.pod:850
5381 msgid "You can use this command to test the connection through to the daemon."
5385 #: ../src/guestfs-actions.pod:1067
5386 msgid "See also C<guestfs_ping_daemon>."
5390 #: ../src/guestfs-actions.pod:1072
5391 msgid "guestfs_egrep"
5395 #: ../src/guestfs-actions.pod:1074
5398 " char **guestfs_egrep (guestfs_h *g,\n"
5399 "\t\tconst char *regex,\n"
5400 "\t\tconst char *path);\n"
5405 #: ../src/guestfs-actions.pod:1078 ../fish/guestfish-actions.pod:858
5406 msgid "This calls the external C<egrep> program and returns the matching lines."
5410 #: ../src/guestfs-actions.pod:1088
5411 msgid "guestfs_egrepi"
5415 #: ../src/guestfs-actions.pod:1090
5418 " char **guestfs_egrepi (guestfs_h *g,\n"
5419 "\t\tconst char *regex,\n"
5420 "\t\tconst char *path);\n"
5425 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:868
5426 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5430 #: ../src/guestfs-actions.pod:1104
5431 msgid "guestfs_equal"
5435 #: ../src/guestfs-actions.pod:1106
5438 " int guestfs_equal (guestfs_h *g,\n"
5439 "\t\tconst char *file1,\n"
5440 "\t\tconst char *file2);\n"
5445 #: ../src/guestfs-actions.pod:1110 ../fish/guestfish-actions.pod:878
5447 "This compares the two files C<file1> and C<file2> and returns true if their "
5448 "content is exactly equal, or false otherwise."
5452 #: ../src/guestfs-actions.pod:1113 ../fish/guestfish-actions.pod:881
5453 msgid "The external L<cmp(1)> program is used for the comparison."
5457 #: ../src/guestfs-actions.pod:1117
5458 msgid "guestfs_exists"
5462 #: ../src/guestfs-actions.pod:1119
5465 " int guestfs_exists (guestfs_h *g,\n"
5466 "\t\tconst char *path);\n"
5471 #: ../src/guestfs-actions.pod:1122 ../fish/guestfish-actions.pod:887
5473 "This returns C<true> if and only if there is a file, directory (or anything) "
5474 "with the given C<path> name."
5478 #: ../src/guestfs-actions.pod:1125
5479 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
5483 #: ../src/guestfs-actions.pod:1129
5484 msgid "guestfs_fallocate"
5488 #: ../src/guestfs-actions.pod:1131
5491 " int guestfs_fallocate (guestfs_h *g,\n"
5492 "\t\tconst char *path,\n"
5498 #: ../src/guestfs-actions.pod:1135 ../src/guestfs-actions.pod:1158 ../fish/guestfish-actions.pod:896 ../fish/guestfish-actions.pod:915
5500 "This command preallocates a file (containing zero bytes) named C<path> of "
5501 "size C<len> bytes. If the file exists already, it is overwritten."
5505 #: ../src/guestfs-actions.pod:1139 ../fish/guestfish-actions.pod:900
5507 "Do not confuse this with the guestfish-specific C<alloc> command which "
5508 "allocates a file in the host and attaches it as a device."
5512 #: ../src/guestfs-actions.pod:1145 ../fish/guestfish-actions.pod:904
5514 "This function is deprecated. In new code, use the C<fallocate64> call "
5519 #: ../src/guestfs-actions.pod:1148 ../src/guestfs-actions.pod:1583 ../src/guestfs-actions.pod:1601 ../src/guestfs-actions.pod:5453 ../src/guestfs-actions.pod:5598 ../fish/guestfish-actions.pod:907 ../fish/guestfish-actions.pod:1264 ../fish/guestfish-actions.pod:1278 ../fish/guestfish-actions.pod:4224 ../fish/guestfish-actions.pod:4321
5521 "Deprecated functions will not be removed from the API, but the fact that "
5522 "they are deprecated indicates that there are problems with correct use of "
5527 #: ../src/guestfs-actions.pod:1152
5528 msgid "guestfs_fallocate64"
5532 #: ../src/guestfs-actions.pod:1154
5535 " int guestfs_fallocate64 (guestfs_h *g,\n"
5536 "\t\tconst char *path,\n"
5537 "\t\tint64_t len);\n"
5542 #: ../src/guestfs-actions.pod:1162
5544 "Note that this call allocates disk blocks for the file. To create a sparse "
5545 "file use C<guestfs_truncate_size> instead."
5549 #: ../src/guestfs-actions.pod:1165
5551 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
5552 "oversight it only allowed 30 bit lengths to be specified, effectively "
5553 "limiting the maximum size of files created through that call to 1GB."
5557 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:927
5559 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5560 "commands which create a file in the host and attach it as a device."
5564 #: ../src/guestfs-actions.pod:1176
5565 msgid "guestfs_fgrep"
5569 #: ../src/guestfs-actions.pod:1178
5572 " char **guestfs_fgrep (guestfs_h *g,\n"
5573 "\t\tconst char *pattern,\n"
5574 "\t\tconst char *path);\n"
5579 #: ../src/guestfs-actions.pod:1182 ../fish/guestfish-actions.pod:935
5580 msgid "This calls the external C<fgrep> program and returns the matching lines."
5584 #: ../src/guestfs-actions.pod:1192
5585 msgid "guestfs_fgrepi"
5589 #: ../src/guestfs-actions.pod:1194
5592 " char **guestfs_fgrepi (guestfs_h *g,\n"
5593 "\t\tconst char *pattern,\n"
5594 "\t\tconst char *path);\n"
5599 #: ../src/guestfs-actions.pod:1198 ../fish/guestfish-actions.pod:945
5600 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
5604 #: ../src/guestfs-actions.pod:1208
5605 msgid "guestfs_file"
5609 #: ../src/guestfs-actions.pod:1210
5612 " char *guestfs_file (guestfs_h *g,\n"
5613 "\t\tconst char *path);\n"
5618 #: ../src/guestfs-actions.pod:1213 ../fish/guestfish-actions.pod:955
5620 "This call uses the standard L<file(1)> command to determine the type or "
5621 "contents of the file."
5625 #: ../src/guestfs-actions.pod:1216 ../fish/guestfish-actions.pod:958
5627 "This call will also transparently look inside various types of compressed "
5632 #: ../src/guestfs-actions.pod:1219 ../fish/guestfish-actions.pod:961
5634 "The exact command which runs is C<file -zb path>. Note in particular that "
5635 "the filename is not prepended to the output (the C<-b> option)."
5639 #: ../src/guestfs-actions.pod:1223
5641 "This command can also be used on C</dev/> devices (and partitions, LV "
5642 "names). You can for example use this to determine if a device contains a "
5643 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
5647 #: ../src/guestfs-actions.pod:1228 ../fish/guestfish-actions.pod:970
5649 "If the C<path> does not begin with C</dev/> then this command only works for "
5650 "the content of regular files. For other file types (directory, symbolic "
5651 "link etc) it will just return the string C<directory> etc."
5655 #: ../src/guestfs-actions.pod:1236
5656 msgid "guestfs_file_architecture"
5660 #: ../src/guestfs-actions.pod:1238
5663 " char *guestfs_file_architecture (guestfs_h *g,\n"
5664 "\t\tconst char *filename);\n"
5669 #: ../src/guestfs-actions.pod:1241 ../fish/guestfish-actions.pod:979
5671 "This detects the architecture of the binary C<filename>, and returns it if "
5676 #: ../src/guestfs-actions.pod:1244 ../fish/guestfish-actions.pod:982
5677 msgid "Currently defined architectures are:"
5681 #: ../src/guestfs-actions.pod:1248 ../fish/guestfish-actions.pod:986
5686 #: ../src/guestfs-actions.pod:1250 ../fish/guestfish-actions.pod:988
5688 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5689 "irrespective of the precise processor requirements of the binary."
5693 #: ../src/guestfs-actions.pod:1253 ../fish/guestfish-actions.pod:991
5698 #: ../src/guestfs-actions.pod:1255 ../fish/guestfish-actions.pod:993
5699 msgid "64 bit x86-64."
5703 #: ../src/guestfs-actions.pod:1257 ../fish/guestfish-actions.pod:995
5708 #: ../src/guestfs-actions.pod:1259 ../fish/guestfish-actions.pod:997
5709 msgid "32 bit SPARC."
5713 #: ../src/guestfs-actions.pod:1261 ../fish/guestfish-actions.pod:999
5718 #: ../src/guestfs-actions.pod:1263 ../fish/guestfish-actions.pod:1001
5719 msgid "64 bit SPARC V9 and above."
5723 #: ../src/guestfs-actions.pod:1265 ../fish/guestfish-actions.pod:1003
5728 #: ../src/guestfs-actions.pod:1267 ../fish/guestfish-actions.pod:1005
5729 msgid "Intel Itanium."
5733 #: ../src/guestfs-actions.pod:1269 ../fish/guestfish-actions.pod:1007
5738 #: ../src/guestfs-actions.pod:1271 ../fish/guestfish-actions.pod:1009
5739 msgid "32 bit Power PC."
5743 #: ../src/guestfs-actions.pod:1273 ../fish/guestfish-actions.pod:1011
5748 #: ../src/guestfs-actions.pod:1275 ../fish/guestfish-actions.pod:1013
5749 msgid "64 bit Power PC."
5753 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:1017
5754 msgid "Libguestfs may return other architecture strings in future."
5758 #: ../src/guestfs-actions.pod:1281 ../fish/guestfish-actions.pod:1019
5759 msgid "The function works on at least the following types of files:"
5763 #: ../src/guestfs-actions.pod:1287 ../fish/guestfish-actions.pod:1025
5764 msgid "many types of Un*x and Linux binary"
5768 #: ../src/guestfs-actions.pod:1291 ../fish/guestfish-actions.pod:1029
5769 msgid "many types of Un*x and Linux shared library"
5773 #: ../src/guestfs-actions.pod:1295 ../fish/guestfish-actions.pod:1033
5774 msgid "Windows Win32 and Win64 binaries"
5778 #: ../src/guestfs-actions.pod:1299 ../fish/guestfish-actions.pod:1037
5779 msgid "Windows Win32 and Win64 DLLs"
5783 #: ../src/guestfs-actions.pod:1301 ../fish/guestfish-actions.pod:1039
5784 msgid "Win32 binaries and DLLs return C<i386>."
5788 #: ../src/guestfs-actions.pod:1303 ../fish/guestfish-actions.pod:1041
5789 msgid "Win64 binaries and DLLs return C<x86_64>."
5793 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1045
5794 msgid "Linux kernel modules"
5798 #: ../src/guestfs-actions.pod:1311 ../fish/guestfish-actions.pod:1049
5799 msgid "Linux new-style initrd images"
5803 #: ../src/guestfs-actions.pod:1315 ../fish/guestfish-actions.pod:1053
5804 msgid "some non-x86 Linux vmlinuz kernels"
5808 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:1057
5809 msgid "What it can't do currently:"
5813 #: ../src/guestfs-actions.pod:1325 ../fish/guestfish-actions.pod:1063
5814 msgid "static libraries (libfoo.a)"
5818 #: ../src/guestfs-actions.pod:1329 ../fish/guestfish-actions.pod:1067
5819 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
5823 #: ../src/guestfs-actions.pod:1333 ../fish/guestfish-actions.pod:1071
5824 msgid "x86 Linux vmlinuz kernels"
5828 #: ../src/guestfs-actions.pod:1335 ../fish/guestfish-actions.pod:1073
5830 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
5831 "compressed code, and are horribly hard to unpack. If you want to find the "
5832 "architecture of a kernel, use the architecture of the associated initrd or "
5833 "kernel module(s) instead."
5837 #: ../src/guestfs-actions.pod:1345
5838 msgid "guestfs_filesize"
5842 #: ../src/guestfs-actions.pod:1347
5845 " int64_t guestfs_filesize (guestfs_h *g,\n"
5846 "\t\tconst char *file);\n"
5851 #: ../src/guestfs-actions.pod:1350 ../fish/guestfish-actions.pod:1084
5852 msgid "This command returns the size of C<file> in bytes."
5856 #: ../src/guestfs-actions.pod:1352
5858 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
5859 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
5860 "devices, use C<guestfs_blockdev_getsize64>."
5864 #: ../src/guestfs-actions.pod:1358
5865 msgid "guestfs_fill"
5869 #: ../src/guestfs-actions.pod:1360
5872 " int guestfs_fill (guestfs_h *g,\n"
5875 "\t\tconst char *path);\n"
5880 #: ../src/guestfs-actions.pod:1365 ../fish/guestfish-actions.pod:1094
5882 "This command creates a new file called C<path>. The initial content of the "
5883 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
5888 #: ../src/guestfs-actions.pod:1369
5890 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
5891 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
5892 "bytes use C<guestfs_fill_pattern>."
5896 #: ../src/guestfs-actions.pod:1381
5897 msgid "guestfs_fill_pattern"
5901 #: ../src/guestfs-actions.pod:1383
5904 " int guestfs_fill_pattern (guestfs_h *g,\n"
5905 "\t\tconst char *pattern,\n"
5907 "\t\tconst char *path);\n"
5912 #: ../src/guestfs-actions.pod:1388
5914 "This function is like C<guestfs_fill> except that it creates a new file of "
5915 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
5916 "pattern is truncated if necessary to ensure the length of the file is "
5917 "exactly C<len> bytes."
5921 #: ../src/guestfs-actions.pod:1400
5922 msgid "guestfs_find"
5926 #: ../src/guestfs-actions.pod:1402
5929 " char **guestfs_find (guestfs_h *g,\n"
5930 "\t\tconst char *directory);\n"
5935 #: ../src/guestfs-actions.pod:1405 ../fish/guestfish-actions.pod:1116
5937 "This command lists out all files and directories, recursively, starting at "
5938 "C<directory>. It is essentially equivalent to running the shell command "
5939 "C<find directory -print> but some post-processing happens on the output, "
5944 #: ../src/guestfs-actions.pod:1410 ../fish/guestfish-actions.pod:1121
5946 "This returns a list of strings I<without any prefix>. Thus if the directory "
5951 #: ../src/guestfs-actions.pod:1413 ../fish/guestfish-actions.pod:1124
5961 #: ../src/guestfs-actions.pod:1417
5962 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
5966 #: ../src/guestfs-actions.pod:1420 ../fish/guestfish-actions.pod:1131
5977 #: ../src/guestfs-actions.pod:1425 ../fish/guestfish-actions.pod:1136
5978 msgid "If C<directory> is not a directory, then this command returns an error."
5982 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:1139
5983 msgid "The returned list is sorted."
5987 #: ../src/guestfs-actions.pod:1430
5988 msgid "See also C<guestfs_find0>."
5992 #: ../src/guestfs-actions.pod:1439
5993 msgid "guestfs_find0"
5997 #: ../src/guestfs-actions.pod:1441
6000 " int guestfs_find0 (guestfs_h *g,\n"
6001 "\t\tconst char *directory,\n"
6002 "\t\tconst char *files);\n"
6007 #: ../src/guestfs-actions.pod:1445 ../fish/guestfish-actions.pod:1150
6009 "This command lists out all files and directories, recursively, starting at "
6010 "C<directory>, placing the resulting list in the external file called "
6015 #: ../src/guestfs-actions.pod:1449
6017 "This command works the same way as C<guestfs_find> with the following "
6022 #: ../src/guestfs-actions.pod:1456 ../fish/guestfish-actions.pod:1161
6023 msgid "The resulting list is written to an external file."
6027 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:1165
6029 "Items (filenames) in the result are separated by C<\\0> characters. See "
6030 "L<find(1)> option I<-print0>."
6034 #: ../src/guestfs-actions.pod:1465 ../fish/guestfish-actions.pod:1170
6035 msgid "This command is not limited in the number of names that it can return."
6039 #: ../src/guestfs-actions.pod:1470 ../fish/guestfish-actions.pod:1175
6040 msgid "The result list is not sorted."
6044 #: ../src/guestfs-actions.pod:1476
6045 msgid "guestfs_findfs_label"
6049 #: ../src/guestfs-actions.pod:1478
6052 " char *guestfs_findfs_label (guestfs_h *g,\n"
6053 "\t\tconst char *label);\n"
6058 #: ../src/guestfs-actions.pod:1481 ../fish/guestfish-actions.pod:1185
6060 "This command searches the filesystems and returns the one which has the "
6061 "given label. An error is returned if no such filesystem can be found."
6065 #: ../src/guestfs-actions.pod:1485
6066 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6070 #: ../src/guestfs-actions.pod:1490
6071 msgid "guestfs_findfs_uuid"
6075 #: ../src/guestfs-actions.pod:1492
6078 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6079 "\t\tconst char *uuid);\n"
6084 #: ../src/guestfs-actions.pod:1495 ../fish/guestfish-actions.pod:1195
6086 "This command searches the filesystems and returns the one which has the "
6087 "given UUID. An error is returned if no such filesystem can be found."
6091 #: ../src/guestfs-actions.pod:1499
6092 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6096 #: ../src/guestfs-actions.pod:1504
6097 msgid "guestfs_fsck"
6101 #: ../src/guestfs-actions.pod:1506
6104 " int guestfs_fsck (guestfs_h *g,\n"
6105 "\t\tconst char *fstype,\n"
6106 "\t\tconst char *device);\n"
6111 #: ../src/guestfs-actions.pod:1510 ../fish/guestfish-actions.pod:1205
6113 "This runs the filesystem checker (fsck) on C<device> which should have "
6114 "filesystem type C<fstype>."
6118 #: ../src/guestfs-actions.pod:1513 ../fish/guestfish-actions.pod:1208
6120 "The returned integer is the status. See L<fsck(8)> for the list of status "
6121 "codes from C<fsck>."
6125 #: ../src/guestfs-actions.pod:1522 ../fish/guestfish-actions.pod:1217
6126 msgid "Multiple status codes can be summed together."
6130 #: ../src/guestfs-actions.pod:1526 ../fish/guestfish-actions.pod:1221
6132 "A non-zero return code can mean \"success\", for example if errors have been "
6133 "corrected on the filesystem."
6137 #: ../src/guestfs-actions.pod:1531 ../fish/guestfish-actions.pod:1226
6138 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6142 #: ../src/guestfs-actions.pod:1536 ../fish/guestfish-actions.pod:1231
6143 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6147 #: ../src/guestfs-actions.pod:1540
6148 msgid "guestfs_get_append"
6152 #: ../src/guestfs-actions.pod:1542
6155 " const char *guestfs_get_append (guestfs_h *g);\n"
6160 #: ../src/guestfs-actions.pod:1544 ../fish/guestfish-actions.pod:1237
6162 "Return the additional kernel options which are added to the guest kernel "
6167 #: ../src/guestfs-actions.pod:1547 ../fish/guestfish-actions.pod:1240
6168 msgid "If C<NULL> then no options are added."
6172 #: ../src/guestfs-actions.pod:1549
6174 "This function returns a string which may be NULL. There is no way to return "
6175 "an error from this function. The string is owned by the guest handle and "
6176 "must I<not> be freed."
6180 #: ../src/guestfs-actions.pod:1553
6181 msgid "guestfs_get_autosync"
6185 #: ../src/guestfs-actions.pod:1555
6188 " int guestfs_get_autosync (guestfs_h *g);\n"
6193 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1246
6194 msgid "Get the autosync flag."
6198 #: ../src/guestfs-actions.pod:1561
6199 msgid "guestfs_get_direct"
6203 #: ../src/guestfs-actions.pod:1563
6206 " int guestfs_get_direct (guestfs_h *g);\n"
6211 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1252
6212 msgid "Return the direct appliance mode flag."
6216 #: ../src/guestfs-actions.pod:1569
6217 msgid "guestfs_get_e2label"
6221 #: ../src/guestfs-actions.pod:1571
6224 " char *guestfs_get_e2label (guestfs_h *g,\n"
6225 "\t\tconst char *device);\n"
6230 #: ../src/guestfs-actions.pod:1574 ../fish/guestfish-actions.pod:1258
6231 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6235 #: ../src/guestfs-actions.pod:1580 ../fish/guestfish-actions.pod:1261
6237 "This function is deprecated. In new code, use the C<vfs_label> call "
6242 #: ../src/guestfs-actions.pod:1587
6243 msgid "guestfs_get_e2uuid"
6247 #: ../src/guestfs-actions.pod:1589
6250 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6251 "\t\tconst char *device);\n"
6256 #: ../src/guestfs-actions.pod:1592 ../fish/guestfish-actions.pod:1272
6257 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6261 #: ../src/guestfs-actions.pod:1598 ../fish/guestfish-actions.pod:1275
6262 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6266 #: ../src/guestfs-actions.pod:1605
6267 msgid "guestfs_get_memsize"
6271 #: ../src/guestfs-actions.pod:1607
6274 " int guestfs_get_memsize (guestfs_h *g);\n"
6279 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1286
6280 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6284 #: ../src/guestfs-actions.pod:1612
6286 "If C<guestfs_set_memsize> was not called on this handle, and if "
6287 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6288 "value for memsize."
6292 #: ../src/guestfs-actions.pod:1616 ../src/guestfs-actions.pod:1679 ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4417 ../fish/guestfish-actions.pod:1293 ../fish/guestfish-actions.pod:1344 ../fish/guestfish-actions.pod:3355 ../fish/guestfish-actions.pod:3442
6293 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6297 #: ../src/guestfs-actions.pod:1621
6298 msgid "guestfs_get_network"
6302 #: ../src/guestfs-actions.pod:1623
6305 " int guestfs_get_network (guestfs_h *g);\n"
6310 #: ../src/guestfs-actions.pod:1625 ../fish/guestfish-actions.pod:1300
6311 msgid "This returns the enable network flag."
6315 #: ../src/guestfs-actions.pod:1629
6316 msgid "guestfs_get_path"
6320 #: ../src/guestfs-actions.pod:1631
6323 " const char *guestfs_get_path (guestfs_h *g);\n"
6328 #: ../src/guestfs-actions.pod:1633 ../fish/guestfish-actions.pod:1306
6329 msgid "Return the current search path."
6333 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1308
6335 "This is always non-NULL. If it wasn't set already, then this will return "
6340 #: ../src/guestfs-actions.pod:1638 ../src/guestfs-actions.pod:1661
6342 "This function returns a string, or NULL on error. The string is owned by "
6343 "the guest handle and must I<not> be freed."
6347 #: ../src/guestfs-actions.pod:1641
6348 msgid "guestfs_get_pid"
6352 #: ../src/guestfs-actions.pod:1643
6355 " int guestfs_get_pid (guestfs_h *g);\n"
6360 #: ../src/guestfs-actions.pod:1645 ../fish/guestfish-actions.pod:1317
6362 "Return the process ID of the qemu subprocess. If there is no qemu "
6363 "subprocess, then this will return an error."
6367 #: ../src/guestfs-actions.pod:1648 ../fish/guestfish-actions.pod:1320
6368 msgid "This is an internal call used for debugging and testing."
6372 #: ../src/guestfs-actions.pod:1652
6373 msgid "guestfs_get_qemu"
6377 #: ../src/guestfs-actions.pod:1654
6380 " const char *guestfs_get_qemu (guestfs_h *g);\n"
6385 #: ../src/guestfs-actions.pod:1656 ../fish/guestfish-actions.pod:1326
6386 msgid "Return the current qemu binary."
6390 #: ../src/guestfs-actions.pod:1658 ../fish/guestfish-actions.pod:1328
6392 "This is always non-NULL. If it wasn't set already, then this will return "
6393 "the default qemu binary name."
6397 #: ../src/guestfs-actions.pod:1664
6398 msgid "guestfs_get_recovery_proc"
6402 #: ../src/guestfs-actions.pod:1666
6405 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
6410 #: ../src/guestfs-actions.pod:1668 ../fish/guestfish-actions.pod:1335
6411 msgid "Return the recovery process enabled flag."
6415 #: ../src/guestfs-actions.pod:1672
6416 msgid "guestfs_get_selinux"
6420 #: ../src/guestfs-actions.pod:1674
6423 " int guestfs_get_selinux (guestfs_h *g);\n"
6428 #: ../src/guestfs-actions.pod:1676
6430 "This returns the current setting of the selinux flag which is passed to the "
6431 "appliance at boot time. See C<guestfs_set_selinux>."
6435 #: ../src/guestfs-actions.pod:1684
6436 msgid "guestfs_get_state"
6440 #: ../src/guestfs-actions.pod:1686
6443 " int guestfs_get_state (guestfs_h *g);\n"
6448 #: ../src/guestfs-actions.pod:1688 ../fish/guestfish-actions.pod:1351
6450 "This returns the current state as an opaque integer. This is only useful "
6451 "for printing debug and internal error messages."
6455 #: ../src/guestfs-actions.pod:1691 ../src/guestfs-actions.pod:2312 ../src/guestfs-actions.pod:2335 ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:2405 ../fish/guestfish-actions.pod:1354 ../fish/guestfish-actions.pod:1848 ../fish/guestfish-actions.pod:1866 ../fish/guestfish-actions.pod:1904 ../fish/guestfish-actions.pod:1920
6456 msgid "For more information on states, see L<guestfs(3)>."
6460 #: ../src/guestfs-actions.pod:1695
6461 msgid "guestfs_get_trace"
6465 #: ../src/guestfs-actions.pod:1697
6468 " int guestfs_get_trace (guestfs_h *g);\n"
6473 #: ../src/guestfs-actions.pod:1699 ../fish/guestfish-actions.pod:1360
6474 msgid "Return the command trace flag."
6478 #: ../src/guestfs-actions.pod:1703
6479 msgid "guestfs_get_umask"
6483 #: ../src/guestfs-actions.pod:1705
6486 " int guestfs_get_umask (guestfs_h *g);\n"
6491 #: ../src/guestfs-actions.pod:1707
6493 "Return the current umask. By default the umask is C<022> unless it has been "
6494 "set by calling C<guestfs_umask>."
6498 #: ../src/guestfs-actions.pod:1712
6499 msgid "guestfs_get_verbose"
6503 #: ../src/guestfs-actions.pod:1714
6506 " int guestfs_get_verbose (guestfs_h *g);\n"
6511 #: ../src/guestfs-actions.pod:1716 ../fish/guestfish-actions.pod:1373
6512 msgid "This returns the verbose messages flag."
6516 #: ../src/guestfs-actions.pod:1720
6517 msgid "guestfs_getcon"
6521 #: ../src/guestfs-actions.pod:1722
6524 " char *guestfs_getcon (guestfs_h *g);\n"
6529 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1379
6530 msgid "This gets the SELinux security context of the daemon."
6534 #: ../src/guestfs-actions.pod:1726
6535 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
6539 #: ../src/guestfs-actions.pod:1732
6540 msgid "guestfs_getxattrs"
6544 #: ../src/guestfs-actions.pod:1734
6547 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
6548 "\t\tconst char *path);\n"
6553 #: ../src/guestfs-actions.pod:1737 ../fish/guestfish-actions.pod:1388
6554 msgid "This call lists the extended attributes of the file or directory C<path>."
6558 #: ../src/guestfs-actions.pod:1740 ../fish/guestfish-actions.pod:1391
6560 "At the system call level, this is a combination of the L<listxattr(2)> and "
6561 "L<getxattr(2)> calls."
6565 #: ../src/guestfs-actions.pod:1743
6566 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
6570 #: ../src/guestfs-actions.pod:1745 ../src/guestfs-actions.pod:2479 ../src/guestfs-actions.pod:3017
6572 "This function returns a C<struct guestfs_xattr_list *> (see "
6573 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
6574 "must call C<guestfs_free_xattr_list> after use>."
6578 #: ../src/guestfs-actions.pod:1750
6579 msgid "guestfs_glob_expand"
6583 #: ../src/guestfs-actions.pod:1752
6586 " char **guestfs_glob_expand (guestfs_h *g,\n"
6587 "\t\tconst char *pattern);\n"
6592 #: ../src/guestfs-actions.pod:1755 ../fish/guestfish-actions.pod:1400
6594 "This command searches for all the pathnames matching C<pattern> according to "
6595 "the wildcard expansion rules used by the shell."
6599 #: ../src/guestfs-actions.pod:1759 ../fish/guestfish-actions.pod:1404
6600 msgid "If no paths match, then this returns an empty list (note: not an error)."
6604 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1407
6606 "It is just a wrapper around the C L<glob(3)> function with flags "
6607 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
6611 #: ../src/guestfs-actions.pod:1770
6612 msgid "guestfs_grep"
6616 #: ../src/guestfs-actions.pod:1772
6619 " char **guestfs_grep (guestfs_h *g,\n"
6620 "\t\tconst char *regex,\n"
6621 "\t\tconst char *path);\n"
6626 #: ../src/guestfs-actions.pod:1776 ../fish/guestfish-actions.pod:1415
6627 msgid "This calls the external C<grep> program and returns the matching lines."
6631 #: ../src/guestfs-actions.pod:1786
6632 msgid "guestfs_grepi"
6636 #: ../src/guestfs-actions.pod:1788
6639 " char **guestfs_grepi (guestfs_h *g,\n"
6640 "\t\tconst char *regex,\n"
6641 "\t\tconst char *path);\n"
6646 #: ../src/guestfs-actions.pod:1792 ../fish/guestfish-actions.pod:1425
6647 msgid "This calls the external C<grep -i> program and returns the matching lines."
6651 #: ../src/guestfs-actions.pod:1802
6652 msgid "guestfs_grub_install"
6656 #: ../src/guestfs-actions.pod:1804
6659 " int guestfs_grub_install (guestfs_h *g,\n"
6660 "\t\tconst char *root,\n"
6661 "\t\tconst char *device);\n"
6666 #: ../src/guestfs-actions.pod:1808 ../fish/guestfish-actions.pod:1435
6668 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
6669 "the root directory being C<root>."
6673 #: ../src/guestfs-actions.pod:1811 ../fish/guestfish-actions.pod:1438
6675 "Note: If grub-install reports the error \"No suitable drive was found in the "
6676 "generated device map.\" it may be that you need to create a "
6677 "C</boot/grub/device.map> file first that contains the mapping between grub "
6678 "device names and Linux device names. It is usually sufficient to create a "
6683 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1445
6691 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1447
6692 msgid "replacing C</dev/vda> with the name of the installation device."
6696 #: ../src/guestfs-actions.pod:1824
6697 msgid "guestfs_head"
6701 #: ../src/guestfs-actions.pod:1826
6704 " char **guestfs_head (guestfs_h *g,\n"
6705 "\t\tconst char *path);\n"
6710 #: ../src/guestfs-actions.pod:1829 ../fish/guestfish-actions.pod:1453
6712 "This command returns up to the first 10 lines of a file as a list of "
6717 #: ../src/guestfs-actions.pod:1839
6718 msgid "guestfs_head_n"
6722 #: ../src/guestfs-actions.pod:1841
6725 " char **guestfs_head_n (guestfs_h *g,\n"
6726 "\t\tint nrlines,\n"
6727 "\t\tconst char *path);\n"
6732 #: ../src/guestfs-actions.pod:1845 ../fish/guestfish-actions.pod:1463
6734 "If the parameter C<nrlines> is a positive number, this returns the first "
6735 "C<nrlines> lines of the file C<path>."
6739 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1466
6741 "If the parameter C<nrlines> is a negative number, this returns lines from "
6742 "the file C<path>, excluding the last C<nrlines> lines."
6746 #: ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:4873 ../fish/guestfish-actions.pod:1469 ../fish/guestfish-actions.pod:3788
6747 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
6751 #: ../src/guestfs-actions.pod:1860
6752 msgid "guestfs_hexdump"
6756 #: ../src/guestfs-actions.pod:1862
6759 " char *guestfs_hexdump (guestfs_h *g,\n"
6760 "\t\tconst char *path);\n"
6765 #: ../src/guestfs-actions.pod:1865 ../fish/guestfish-actions.pod:1478
6767 "This runs C<hexdump -C> on the given C<path>. The result is the "
6768 "human-readable, canonical hex dump of the file."
6772 #: ../src/guestfs-actions.pod:1874
6773 msgid "guestfs_initrd_cat"
6777 #: ../src/guestfs-actions.pod:1876
6780 " char *guestfs_initrd_cat (guestfs_h *g,\n"
6781 "\t\tconst char *initrdpath,\n"
6782 "\t\tconst char *filename,\n"
6783 "\t\tsize_t *size_r);\n"
6788 #: ../src/guestfs-actions.pod:1881 ../fish/guestfish-actions.pod:1488
6790 "This command unpacks the file C<filename> from the initrd file called "
6791 "C<initrdpath>. The filename must be given I<without> the initial C</> "
6796 #: ../src/guestfs-actions.pod:1885 ../fish/guestfish-actions.pod:1492
6798 "For example, in guestfish you could use the following command to examine the "
6799 "boot script (usually called C</init>) contained in a Linux initrd or "
6804 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1496
6807 " initrd-cat /boot/initrd-<version>.img init\n"
6812 #: ../src/guestfs-actions.pod:1891
6813 msgid "See also C<guestfs_initrd_list>."
6817 #: ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:3831 ../src/guestfs-actions.pod:3960
6819 "This function returns a buffer, or NULL on error. The size of the returned "
6820 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
6825 #: ../src/guestfs-actions.pod:1900
6826 msgid "guestfs_initrd_list"
6830 #: ../src/guestfs-actions.pod:1902
6833 " char **guestfs_initrd_list (guestfs_h *g,\n"
6834 "\t\tconst char *path);\n"
6839 #: ../src/guestfs-actions.pod:1905 ../fish/guestfish-actions.pod:1507
6840 msgid "This command lists out files contained in an initrd."
6844 #: ../src/guestfs-actions.pod:1907 ../fish/guestfish-actions.pod:1509
6846 "The files are listed without any initial C</> character. The files are "
6847 "listed in the order they appear (not necessarily alphabetical). Directory "
6848 "names are listed as separate items."
6852 #: ../src/guestfs-actions.pod:1911 ../fish/guestfish-actions.pod:1513
6854 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
6855 "initrd. We I<only> support the newer initramfs format (compressed cpio "
6860 #: ../src/guestfs-actions.pod:1919
6861 msgid "guestfs_inotify_add_watch"
6865 #: ../src/guestfs-actions.pod:1921
6868 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
6869 "\t\tconst char *path,\n"
6875 #: ../src/guestfs-actions.pod:1925 ../fish/guestfish-actions.pod:1521
6876 msgid "Watch C<path> for the events listed in C<mask>."
6880 #: ../src/guestfs-actions.pod:1927 ../fish/guestfish-actions.pod:1523
6882 "Note that if C<path> is a directory then events within that directory are "
6883 "watched, but this does I<not> happen recursively (in subdirectories)."
6887 #: ../src/guestfs-actions.pod:1931 ../fish/guestfish-actions.pod:1527
6889 "Note for non-C or non-Linux callers: the inotify events are defined by the "
6890 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
6894 #: ../src/guestfs-actions.pod:1937
6895 msgid "guestfs_inotify_close"
6899 #: ../src/guestfs-actions.pod:1939
6902 " int guestfs_inotify_close (guestfs_h *g);\n"
6907 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1535
6909 "This closes the inotify handle which was previously opened by inotify_init. "
6910 "It removes all watches, throws away any pending events, and deallocates all "
6915 #: ../src/guestfs-actions.pod:1947
6916 msgid "guestfs_inotify_files"
6920 #: ../src/guestfs-actions.pod:1949
6923 " char **guestfs_inotify_files (guestfs_h *g);\n"
6928 #: ../src/guestfs-actions.pod:1951
6930 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
6931 "returns a list of pathnames of objects that were touched. The returned "
6932 "pathnames are sorted and deduplicated."
6936 #: ../src/guestfs-actions.pod:1959
6937 msgid "guestfs_inotify_init"
6941 #: ../src/guestfs-actions.pod:1961
6944 " int guestfs_inotify_init (guestfs_h *g,\n"
6945 "\t\tint maxevents);\n"
6950 #: ../src/guestfs-actions.pod:1964 ../fish/guestfish-actions.pod:1551
6952 "This command creates a new inotify handle. The inotify subsystem can be "
6953 "used to notify events which happen to objects in the guest filesystem."
6957 #: ../src/guestfs-actions.pod:1968
6959 "C<maxevents> is the maximum number of events which will be queued up between "
6960 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
6961 "passed as C<0>, then the kernel (or previously set) default is used. For "
6962 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
6963 "throws away events, but records the fact that it threw them away by setting "
6964 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
6965 "C<guestfs_inotify_read>)."
6969 #: ../src/guestfs-actions.pod:1978
6971 "Before any events are generated, you have to add some watches to the "
6972 "internal watch list. See: C<guestfs_inotify_add_watch>, "
6973 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
6977 #: ../src/guestfs-actions.pod:1984
6979 "Queued up events should be read periodically by calling "
6980 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
6981 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
6982 "often enough then you risk the internal queue overflowing."
6986 #: ../src/guestfs-actions.pod:1991
6988 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
6989 "This also removes any watches automatically."
6993 #: ../src/guestfs-actions.pod:1995 ../fish/guestfish-actions.pod:1582
6995 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
6996 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
6997 "that there is one global inotify handle per libguestfs instance."
7001 #: ../src/guestfs-actions.pod:2002
7002 msgid "guestfs_inotify_read"
7006 #: ../src/guestfs-actions.pod:2004
7009 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
7014 #: ../src/guestfs-actions.pod:2006 ../fish/guestfish-actions.pod:1591
7016 "Return the complete queue of events that have happened since the previous "
7021 #: ../src/guestfs-actions.pod:2009 ../fish/guestfish-actions.pod:1594
7022 msgid "If no events have happened, this returns an empty list."
7026 #: ../src/guestfs-actions.pod:2011 ../fish/guestfish-actions.pod:1596
7028 "I<Note>: In order to make sure that all events have been read, you must call "
7029 "this function repeatedly until it returns an empty list. The reason is that "
7030 "the call will read events up to the maximum appliance-to-host message size "
7031 "and leave remaining events in the queue."
7035 #: ../src/guestfs-actions.pod:2017
7037 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7038 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7039 "must call C<guestfs_free_inotify_event_list> after use>."
7043 #: ../src/guestfs-actions.pod:2022
7044 msgid "guestfs_inotify_rm_watch"
7048 #: ../src/guestfs-actions.pod:2024
7051 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7057 #: ../src/guestfs-actions.pod:2027
7059 "Remove a previously defined inotify watch. See "
7060 "C<guestfs_inotify_add_watch>."
7064 #: ../src/guestfs-actions.pod:2032
7065 msgid "guestfs_inspect_get_arch"
7069 #: ../src/guestfs-actions.pod:2034
7072 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7073 "\t\tconst char *root);\n"
7078 #: ../src/guestfs-actions.pod:2037 ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:2130 ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:2172 ../src/guestfs-actions.pod:2202 ../src/guestfs-actions.pod:2223
7080 "This function should only be called with a root device string as returned by "
7081 "C<guestfs_inspect_os>."
7085 #: ../src/guestfs-actions.pod:2040
7087 "This returns the architecture of the inspected operating system. The "
7088 "possible return values are listed under C<guestfs_file_architecture>."
7092 #: ../src/guestfs-actions.pod:2044 ../fish/guestfish-actions.pod:1620
7094 "If the architecture could not be determined, then the string C<unknown> is "
7099 #: ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2097 ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:2213 ../src/guestfs-actions.pod:2248 ../src/guestfs-actions.pod:2285 ../fish/guestfish-actions.pod:1623 ../fish/guestfish-actions.pod:1669 ../fish/guestfish-actions.pod:1708 ../fish/guestfish-actions.pod:1763 ../fish/guestfish-actions.pod:1794 ../fish/guestfish-actions.pod:1828
7100 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7104 #: ../src/guestfs-actions.pod:2052
7105 msgid "guestfs_inspect_get_distro"
7109 #: ../src/guestfs-actions.pod:2054
7112 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7113 "\t\tconst char *root);\n"
7118 #: ../src/guestfs-actions.pod:2060 ../fish/guestfish-actions.pod:1632
7119 msgid "This returns the distro (distribution) of the inspected operating system."
7123 #: ../src/guestfs-actions.pod:2063 ../fish/guestfish-actions.pod:1635
7124 msgid "Currently defined distros are:"
7128 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1639
7133 #: ../src/guestfs-actions.pod:2069 ../fish/guestfish-actions.pod:1641
7134 msgid "Debian or a Debian-derived distro such as Ubuntu."
7138 #: ../src/guestfs-actions.pod:2071 ../fish/guestfish-actions.pod:1643
7143 #: ../src/guestfs-actions.pod:2073 ../fish/guestfish-actions.pod:1645
7148 #: ../src/guestfs-actions.pod:2075 ../fish/guestfish-actions.pod:1647
7149 msgid "\"redhat-based\""
7153 #: ../src/guestfs-actions.pod:2077 ../fish/guestfish-actions.pod:1649
7154 msgid "Some Red Hat-derived distro."
7158 #: ../src/guestfs-actions.pod:2079 ../fish/guestfish-actions.pod:1651
7163 #: ../src/guestfs-actions.pod:2081 ../fish/guestfish-actions.pod:1653
7164 msgid "Red Hat Enterprise Linux and some derivatives."
7168 #: ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2235 ../fish/guestfish-actions.pod:1655 ../fish/guestfish-actions.pod:1781
7173 #: ../src/guestfs-actions.pod:2085 ../fish/guestfish-actions.pod:1657
7175 "Windows does not have distributions. This string is returned if the OS type "
7180 #: ../src/guestfs-actions.pod:2088 ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1660 ../fish/guestfish-actions.pod:1785
7185 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1662
7186 msgid "The distro could not be determined."
7190 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:2245 ../fish/guestfish-actions.pod:1666 ../fish/guestfish-actions.pod:1791
7192 "Future versions of libguestfs may return other strings here. The caller "
7193 "should be prepared to handle any string."
7197 #: ../src/guestfs-actions.pod:2102
7198 msgid "guestfs_inspect_get_filesystems"
7202 #: ../src/guestfs-actions.pod:2104
7205 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7206 "\t\tconst char *root);\n"
7211 #: ../src/guestfs-actions.pod:2110 ../fish/guestfish-actions.pod:1678
7213 "This returns a list of all the filesystems that we think are associated with "
7214 "this operating system. This includes the root filesystem, other ordinary "
7215 "filesystems, and non-mounted devices like swap partitions."
7219 #: ../src/guestfs-actions.pod:2115 ../fish/guestfish-actions.pod:1683
7221 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7222 "to be shared between operating systems."
7226 #: ../src/guestfs-actions.pod:2118
7228 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7229 "C<guestfs_inspect_get_mountpoints>."
7233 #: ../src/guestfs-actions.pod:2125
7234 msgid "guestfs_inspect_get_major_version"
7238 #: ../src/guestfs-actions.pod:2127
7241 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
7242 "\t\tconst char *root);\n"
7247 #: ../src/guestfs-actions.pod:2133 ../fish/guestfish-actions.pod:1696
7248 msgid "This returns the major version number of the inspected operating system."
7252 #: ../src/guestfs-actions.pod:2136 ../fish/guestfish-actions.pod:1699
7254 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7255 "popular public names used by the operating system. Notably the operating "
7256 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7257 "1). You can find out the real versions corresponding to releases of Windows "
7258 "by consulting Wikipedia or MSDN."
7262 #: ../src/guestfs-actions.pod:2143 ../src/guestfs-actions.pod:2160 ../fish/guestfish-actions.pod:1706 ../fish/guestfish-actions.pod:1720
7263 msgid "If the version could not be determined, then C<0> is returned."
7267 #: ../src/guestfs-actions.pod:2149
7268 msgid "guestfs_inspect_get_minor_version"
7272 #: ../src/guestfs-actions.pod:2151
7275 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
7276 "\t\tconst char *root);\n"
7281 #: ../src/guestfs-actions.pod:2157 ../fish/guestfish-actions.pod:1717
7282 msgid "This returns the minor version number of the inspected operating system."
7286 #: ../src/guestfs-actions.pod:2162
7288 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7289 "C<guestfs_inspect_get_major_version>."
7293 #: ../src/guestfs-actions.pod:2167
7294 msgid "guestfs_inspect_get_mountpoints"
7298 #: ../src/guestfs-actions.pod:2169
7301 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
7302 "\t\tconst char *root);\n"
7307 #: ../src/guestfs-actions.pod:2175 ../fish/guestfish-actions.pod:1732
7309 "This returns a hash of where we think the filesystems associated with this "
7310 "operating system should be mounted. Callers should note that this is at "
7311 "best an educated guess made by reading configuration files such as "
7316 #: ../src/guestfs-actions.pod:2180 ../fish/guestfish-actions.pod:1737
7318 "Each element in the returned hashtable has a key which is the path of the "
7319 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7320 "mounted there (eg. C</dev/sda1>)."
7324 #: ../src/guestfs-actions.pod:2185 ../fish/guestfish-actions.pod:1742
7325 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7329 #: ../src/guestfs-actions.pod:2188
7331 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7332 "C<guestfs_inspect_get_filesystems>."
7336 #: ../src/guestfs-actions.pod:2191 ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:3453 ../src/guestfs-actions.pod:4990
7338 "This function returns a NULL-terminated array of strings, or NULL if there "
7339 "was an error. The array of strings will always have length C<2n+1>, where "
7340 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
7341 "caller must free the strings and the array after use>."
7345 #: ../src/guestfs-actions.pod:2197
7346 msgid "guestfs_inspect_get_product_name"
7350 #: ../src/guestfs-actions.pod:2199
7353 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
7354 "\t\tconst char *root);\n"
7359 #: ../src/guestfs-actions.pod:2205 ../fish/guestfish-actions.pod:1755
7361 "This returns the product name of the inspected operating system. The "
7362 "product name is generally some freeform string which can be displayed to the "
7363 "user, but should not be parsed by programs."
7367 #: ../src/guestfs-actions.pod:2210 ../fish/guestfish-actions.pod:1760
7369 "If the product name could not be determined, then the string C<unknown> is "
7374 #: ../src/guestfs-actions.pod:2218
7375 msgid "guestfs_inspect_get_type"
7379 #: ../src/guestfs-actions.pod:2220
7382 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
7383 "\t\tconst char *root);\n"
7388 #: ../src/guestfs-actions.pod:2226 ../fish/guestfish-actions.pod:1772
7390 "This returns the type of the inspected operating system. Currently defined "
7395 #: ../src/guestfs-actions.pod:2231 ../fish/guestfish-actions.pod:1777
7400 #: ../src/guestfs-actions.pod:2233 ../fish/guestfish-actions.pod:1779
7401 msgid "Any Linux-based operating system."
7405 #: ../src/guestfs-actions.pod:2237 ../fish/guestfish-actions.pod:1783
7406 msgid "Any Microsoft Windows operating system."
7410 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1787
7411 msgid "The operating system type could not be determined."
7415 #: ../src/guestfs-actions.pod:2253
7416 msgid "guestfs_inspect_os"
7420 #: ../src/guestfs-actions.pod:2255
7423 " char **guestfs_inspect_os (guestfs_h *g);\n"
7428 #: ../src/guestfs-actions.pod:2257 ../fish/guestfish-actions.pod:1800
7430 "This function uses other libguestfs functions and certain heuristics to "
7431 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
7432 "for operating systems."
7436 #: ../src/guestfs-actions.pod:2261 ../fish/guestfish-actions.pod:1804
7437 msgid "The list returned is empty if no operating systems were found."
7441 #: ../src/guestfs-actions.pod:2263 ../fish/guestfish-actions.pod:1806
7443 "If one operating system was found, then this returns a list with a single "
7444 "element, which is the name of the root filesystem of this operating system. "
7445 "It is also possible for this function to return a list containing more than "
7446 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
7447 "element being the root filesystem of one of the operating systems."
7451 #: ../src/guestfs-actions.pod:2270
7453 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
7454 "functions in order to query further information about each operating system, "
7455 "such as the name and version."
7459 #: ../src/guestfs-actions.pod:2275
7461 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
7462 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
7463 "the contents. This should be called with no disks currently mounted. The "
7464 "function may also use Augeas, so any existing Augeas handle will be closed."
7468 #: ../src/guestfs-actions.pod:2281 ../fish/guestfish-actions.pod:1824
7470 "This function cannot decrypt encrypted disks. The caller must do that first "
7471 "(supplying the necessary keys) if the disk is encrypted."
7475 #: ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:2492 ../src/guestfs-actions.pod:2548
7476 msgid "See also C<guestfs_list_filesystems>."
7480 #: ../src/guestfs-actions.pod:2293
7481 msgid "guestfs_is_blockdev"
7485 #: ../src/guestfs-actions.pod:2295
7488 " int guestfs_is_blockdev (guestfs_h *g,\n"
7489 "\t\tconst char *path);\n"
7494 #: ../src/guestfs-actions.pod:2298 ../fish/guestfish-actions.pod:1836
7496 "This returns C<true> if and only if there is a block device with the given "
7501 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2324 ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:2360 ../src/guestfs-actions.pod:2373 ../src/guestfs-actions.pod:2417 ../src/guestfs-actions.pod:2429
7502 msgid "See also C<guestfs_stat>."
7506 #: ../src/guestfs-actions.pod:2305
7507 msgid "guestfs_is_busy"
7511 #: ../src/guestfs-actions.pod:2307
7514 " int guestfs_is_busy (guestfs_h *g);\n"
7519 #: ../src/guestfs-actions.pod:2309 ../fish/guestfish-actions.pod:1845
7521 "This returns true iff this handle is busy processing a command (in the "
7526 #: ../src/guestfs-actions.pod:2316
7527 msgid "guestfs_is_chardev"
7531 #: ../src/guestfs-actions.pod:2318
7534 " int guestfs_is_chardev (guestfs_h *g,\n"
7535 "\t\tconst char *path);\n"
7540 #: ../src/guestfs-actions.pod:2321 ../fish/guestfish-actions.pod:1854
7542 "This returns C<true> if and only if there is a character device with the "
7543 "given C<path> name."
7547 #: ../src/guestfs-actions.pod:2328
7548 msgid "guestfs_is_config"
7552 #: ../src/guestfs-actions.pod:2330
7555 " int guestfs_is_config (guestfs_h *g);\n"
7560 #: ../src/guestfs-actions.pod:2332 ../fish/guestfish-actions.pod:1863
7562 "This returns true iff this handle is being configured (in the C<CONFIG> "
7567 #: ../src/guestfs-actions.pod:2339
7568 msgid "guestfs_is_dir"
7572 #: ../src/guestfs-actions.pod:2341
7575 " int guestfs_is_dir (guestfs_h *g,\n"
7576 "\t\tconst char *path);\n"
7581 #: ../src/guestfs-actions.pod:2344 ../fish/guestfish-actions.pod:1872
7583 "This returns C<true> if and only if there is a directory with the given "
7584 "C<path> name. Note that it returns false for other objects like files."
7588 #: ../src/guestfs-actions.pod:2352
7589 msgid "guestfs_is_fifo"
7593 #: ../src/guestfs-actions.pod:2354
7596 " int guestfs_is_fifo (guestfs_h *g,\n"
7597 "\t\tconst char *path);\n"
7602 #: ../src/guestfs-actions.pod:2357 ../fish/guestfish-actions.pod:1882
7604 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
7605 "given C<path> name."
7609 #: ../src/guestfs-actions.pod:2364
7610 msgid "guestfs_is_file"
7614 #: ../src/guestfs-actions.pod:2366
7617 " int guestfs_is_file (guestfs_h *g,\n"
7618 "\t\tconst char *path);\n"
7623 #: ../src/guestfs-actions.pod:2369 ../fish/guestfish-actions.pod:1891
7625 "This returns C<true> if and only if there is a regular file with the given "
7626 "C<path> name. Note that it returns false for other objects like "
7631 #: ../src/guestfs-actions.pod:2377
7632 msgid "guestfs_is_launching"
7636 #: ../src/guestfs-actions.pod:2379
7639 " int guestfs_is_launching (guestfs_h *g);\n"
7644 #: ../src/guestfs-actions.pod:2381 ../fish/guestfish-actions.pod:1901
7646 "This returns true iff this handle is launching the subprocess (in the "
7647 "C<LAUNCHING> state)."
7651 #: ../src/guestfs-actions.pod:2388
7652 msgid "guestfs_is_lv"
7656 #: ../src/guestfs-actions.pod:2390
7659 " int guestfs_is_lv (guestfs_h *g,\n"
7660 "\t\tconst char *device);\n"
7665 #: ../src/guestfs-actions.pod:2393 ../fish/guestfish-actions.pod:1910
7667 "This command tests whether C<device> is a logical volume, and returns true "
7668 "iff this is the case."
7672 #: ../src/guestfs-actions.pod:2398
7673 msgid "guestfs_is_ready"
7677 #: ../src/guestfs-actions.pod:2400
7680 " int guestfs_is_ready (guestfs_h *g);\n"
7685 #: ../src/guestfs-actions.pod:2402 ../fish/guestfish-actions.pod:1917
7687 "This returns true iff this handle is ready to accept commands (in the "
7692 #: ../src/guestfs-actions.pod:2409
7693 msgid "guestfs_is_socket"
7697 #: ../src/guestfs-actions.pod:2411
7700 " int guestfs_is_socket (guestfs_h *g,\n"
7701 "\t\tconst char *path);\n"
7706 #: ../src/guestfs-actions.pod:2414 ../fish/guestfish-actions.pod:1926
7708 "This returns C<true> if and only if there is a Unix domain socket with the "
7709 "given C<path> name."
7713 #: ../src/guestfs-actions.pod:2421
7714 msgid "guestfs_is_symlink"
7718 #: ../src/guestfs-actions.pod:2423
7721 " int guestfs_is_symlink (guestfs_h *g,\n"
7722 "\t\tconst char *path);\n"
7727 #: ../src/guestfs-actions.pod:2426 ../fish/guestfish-actions.pod:1935
7729 "This returns C<true> if and only if there is a symbolic link with the given "
7734 #: ../src/guestfs-actions.pod:2433
7735 msgid "guestfs_kill_subprocess"
7739 #: ../src/guestfs-actions.pod:2435
7742 " int guestfs_kill_subprocess (guestfs_h *g);\n"
7747 #: ../src/guestfs-actions.pod:2437 ../fish/guestfish-actions.pod:1944
7748 msgid "This kills the qemu subprocess. You should never need to call this."
7752 #: ../src/guestfs-actions.pod:2441
7753 msgid "guestfs_launch"
7757 #: ../src/guestfs-actions.pod:2443
7760 " int guestfs_launch (guestfs_h *g);\n"
7765 #: ../src/guestfs-actions.pod:2445 ../fish/guestfish-actions.pod:1952
7767 "Internally libguestfs is implemented by running a virtual machine using "
7772 #: ../src/guestfs-actions.pod:2448 ../fish/guestfish-actions.pod:1955
7774 "You should call this after configuring the handle (eg. adding drives) but "
7775 "before performing any actions."
7779 #: ../src/guestfs-actions.pod:2453
7780 msgid "guestfs_lchown"
7784 #: ../src/guestfs-actions.pod:2455
7787 " int guestfs_lchown (guestfs_h *g,\n"
7790 "\t\tconst char *path);\n"
7795 #: ../src/guestfs-actions.pod:2460
7797 "Change the file owner to C<owner> and group to C<group>. This is like "
7798 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
7799 "changed, not the target."
7803 #: ../src/guestfs-actions.pod:2470
7804 msgid "guestfs_lgetxattrs"
7808 #: ../src/guestfs-actions.pod:2472
7811 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
7812 "\t\tconst char *path);\n"
7817 #: ../src/guestfs-actions.pod:2475
7819 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
7820 "then it returns the extended attributes of the link itself."
7824 #: ../src/guestfs-actions.pod:2484
7825 msgid "guestfs_list_devices"
7829 #: ../src/guestfs-actions.pod:2486
7832 " char **guestfs_list_devices (guestfs_h *g);\n"
7837 #: ../src/guestfs-actions.pod:2488 ../fish/guestfish-actions.pod:1982
7838 msgid "List all the block devices."
7842 #: ../src/guestfs-actions.pod:2490 ../fish/guestfish-actions.pod:1984
7843 msgid "The full block device names are returned, eg. C</dev/sda>."
7847 #: ../src/guestfs-actions.pod:2498
7848 msgid "guestfs_list_filesystems"
7852 #: ../src/guestfs-actions.pod:2500
7855 " char **guestfs_list_filesystems (guestfs_h *g);\n"
7860 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1992
7862 "This inspection command looks for filesystems on partitions, block devices "
7863 "and logical volumes, returning a list of devices containing filesystems and "
7868 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1996
7870 "The return value is a hash, where the keys are the devices containing "
7871 "filesystems, and the values are the filesystem types. For example:"
7875 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:2000
7878 " \"/dev/sda1\" => \"ntfs\"\n"
7879 " \"/dev/sda2\" => \"ext2\"\n"
7880 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
7881 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
7886 #: ../src/guestfs-actions.pod:2515 ../fish/guestfish-actions.pod:2005
7888 "The value can have the special value \"unknown\", meaning the content of the "
7889 "device is undetermined or empty. \"swap\" means a Linux swap partition."
7893 #: ../src/guestfs-actions.pod:2519
7895 "This command runs other libguestfs commands, which might include "
7896 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
7897 "soon after launch and only when nothing is mounted."
7901 #: ../src/guestfs-actions.pod:2523
7903 "Not all of the filesystems returned will be mountable. In particular, swap "
7904 "partitions are returned in the list. Also this command does not check that "
7905 "each filesystem found is valid and mountable, and some filesystems might be "
7906 "mountable but require special options. Filesystems may not all belong to a "
7907 "single logical operating system (use C<guestfs_inspect_os> to look for "
7912 #: ../src/guestfs-actions.pod:2537
7913 msgid "guestfs_list_partitions"
7917 #: ../src/guestfs-actions.pod:2539
7920 " char **guestfs_list_partitions (guestfs_h *g);\n"
7925 #: ../src/guestfs-actions.pod:2541 ../fish/guestfish-actions.pod:2025
7926 msgid "List all the partitions detected on all block devices."
7930 #: ../src/guestfs-actions.pod:2543 ../fish/guestfish-actions.pod:2027
7931 msgid "The full partition device names are returned, eg. C</dev/sda1>"
7935 #: ../src/guestfs-actions.pod:2545
7937 "This does not return logical volumes. For that you will need to call "
7942 #: ../src/guestfs-actions.pod:2554
7947 #: ../src/guestfs-actions.pod:2556
7950 " char *guestfs_ll (guestfs_h *g,\n"
7951 "\t\tconst char *directory);\n"
7956 #: ../src/guestfs-actions.pod:2559 ../fish/guestfish-actions.pod:2038
7958 "List the files in C<directory> (relative to the root directory, there is no "
7959 "cwd) in the format of 'ls -la'."
7963 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:2041
7965 "This command is mostly useful for interactive sessions. It is I<not> "
7966 "intended that you try to parse the output string."
7970 #: ../src/guestfs-actions.pod:2568
7975 #: ../src/guestfs-actions.pod:2570
7978 " int guestfs_ln (guestfs_h *g,\n"
7979 "\t\tconst char *target,\n"
7980 "\t\tconst char *linkname);\n"
7985 #: ../src/guestfs-actions.pod:2574 ../fish/guestfish-actions.pod:2048
7986 msgid "This command creates a hard link using the C<ln> command."
7990 #: ../src/guestfs-actions.pod:2578
7991 msgid "guestfs_ln_f"
7995 #: ../src/guestfs-actions.pod:2580
7998 " int guestfs_ln_f (guestfs_h *g,\n"
7999 "\t\tconst char *target,\n"
8000 "\t\tconst char *linkname);\n"
8005 #: ../src/guestfs-actions.pod:2584 ../fish/guestfish-actions.pod:2054
8007 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8008 "option removes the link (C<linkname>) if it exists already."
8012 #: ../src/guestfs-actions.pod:2589
8013 msgid "guestfs_ln_s"
8017 #: ../src/guestfs-actions.pod:2591
8020 " int guestfs_ln_s (guestfs_h *g,\n"
8021 "\t\tconst char *target,\n"
8022 "\t\tconst char *linkname);\n"
8027 #: ../src/guestfs-actions.pod:2595 ../fish/guestfish-actions.pod:2061
8028 msgid "This command creates a symbolic link using the C<ln -s> command."
8032 #: ../src/guestfs-actions.pod:2599
8033 msgid "guestfs_ln_sf"
8037 #: ../src/guestfs-actions.pod:2601
8040 " int guestfs_ln_sf (guestfs_h *g,\n"
8041 "\t\tconst char *target,\n"
8042 "\t\tconst char *linkname);\n"
8047 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:2067
8049 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8050 "option removes the link (C<linkname>) if it exists already."
8054 #: ../src/guestfs-actions.pod:2610
8055 msgid "guestfs_lremovexattr"
8059 #: ../src/guestfs-actions.pod:2612
8062 " int guestfs_lremovexattr (guestfs_h *g,\n"
8063 "\t\tconst char *xattr,\n"
8064 "\t\tconst char *path);\n"
8069 #: ../src/guestfs-actions.pod:2616
8071 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8072 "link, then it removes an extended attribute of the link itself."
8076 #: ../src/guestfs-actions.pod:2622
8081 #: ../src/guestfs-actions.pod:2624
8084 " char **guestfs_ls (guestfs_h *g,\n"
8085 "\t\tconst char *directory);\n"
8090 #: ../src/guestfs-actions.pod:2627 ../fish/guestfish-actions.pod:2082
8092 "List the files in C<directory> (relative to the root directory, there is no "
8093 "cwd). The '.' and '..' entries are not returned, but hidden files are "
8098 #: ../src/guestfs-actions.pod:2631
8100 "This command is mostly useful for interactive sessions. Programs should "
8101 "probably use C<guestfs_readdir> instead."
8105 #: ../src/guestfs-actions.pod:2638
8106 msgid "guestfs_lsetxattr"
8110 #: ../src/guestfs-actions.pod:2640
8113 " int guestfs_lsetxattr (guestfs_h *g,\n"
8114 "\t\tconst char *xattr,\n"
8115 "\t\tconst char *val,\n"
8117 "\t\tconst char *path);\n"
8122 #: ../src/guestfs-actions.pod:2646
8124 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8125 "then it sets an extended attribute of the link itself."
8129 #: ../src/guestfs-actions.pod:2652
8130 msgid "guestfs_lstat"
8134 #: ../src/guestfs-actions.pod:2654
8137 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8138 "\t\tconst char *path);\n"
8143 #: ../src/guestfs-actions.pod:2657 ../src/guestfs-actions.pod:4655 ../fish/guestfish-actions.pod:2101 ../fish/guestfish-actions.pod:3623
8144 msgid "Returns file information for the given C<path>."
8148 #: ../src/guestfs-actions.pod:2659
8150 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8151 "link, then the link is stat-ed, not the file it refers to."
8155 #: ../src/guestfs-actions.pod:2663 ../fish/guestfish-actions.pod:2107
8156 msgid "This is the same as the C<lstat(2)> system call."
8160 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:4659
8162 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8163 "error. I<The caller must call C<guestfs_free_stat> after use>."
8167 #: ../src/guestfs-actions.pod:2669
8168 msgid "guestfs_lstatlist"
8172 #: ../src/guestfs-actions.pod:2671
8175 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8176 "\t\tconst char *path,\n"
8177 "\t\tchar *const *names);\n"
8182 #: ../src/guestfs-actions.pod:2675
8184 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8185 "files, where all files are in the directory C<path>. C<names> is the list "
8186 "of files from this directory."
8190 #: ../src/guestfs-actions.pod:2679 ../fish/guestfish-actions.pod:2117
8192 "On return you get a list of stat structs, with a one-to-one correspondence "
8193 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8194 "then the C<ino> field of that structure is set to C<-1>."
8198 #: ../src/guestfs-actions.pod:2684
8200 "This call is intended for programs that want to efficiently list a directory "
8201 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8202 "for a similarly efficient call for getting extended attributes. Very long "
8203 "directory listings might cause the protocol message size to be exceeded, "
8204 "causing this call to fail. The caller must split up such requests into "
8205 "smaller groups of names."
8209 #: ../src/guestfs-actions.pod:2692
8211 "This function returns a C<struct guestfs_stat_list *> (see "
8212 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
8213 "must call C<guestfs_free_stat_list> after use>."
8217 #: ../src/guestfs-actions.pod:2697
8218 msgid "guestfs_luks_add_key"
8222 #: ../src/guestfs-actions.pod:2699
8225 " int guestfs_luks_add_key (guestfs_h *g,\n"
8226 "\t\tconst char *device,\n"
8227 "\t\tconst char *key,\n"
8228 "\t\tconst char *newkey,\n"
8229 "\t\tint keyslot);\n"
8234 #: ../src/guestfs-actions.pod:2705 ../fish/guestfish-actions.pod:2134
8236 "This command adds a new key on LUKS device C<device>. C<key> is any "
8237 "existing key, and is used to access the device. C<newkey> is the new key to "
8238 "add. C<keyslot> is the key slot that will be replaced."
8242 #: ../src/guestfs-actions.pod:2710
8244 "Note that if C<keyslot> already contains a key, then this command will "
8245 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8249 #: ../src/guestfs-actions.pod:2716 ../src/guestfs-actions.pod:2750 ../src/guestfs-actions.pod:2770 ../src/guestfs-actions.pod:2787 ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2832
8251 "This function takes a key or passphrase parameter which could contain "
8252 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8257 #: ../src/guestfs-actions.pod:2720
8258 msgid "guestfs_luks_close"
8262 #: ../src/guestfs-actions.pod:2722
8265 " int guestfs_luks_close (guestfs_h *g,\n"
8266 "\t\tconst char *device);\n"
8271 #: ../src/guestfs-actions.pod:2725
8273 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8274 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8275 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8276 "underlying block device."
8280 #: ../src/guestfs-actions.pod:2733
8281 msgid "guestfs_luks_format"
8285 #: ../src/guestfs-actions.pod:2735
8288 " int guestfs_luks_format (guestfs_h *g,\n"
8289 "\t\tconst char *device,\n"
8290 "\t\tconst char *key,\n"
8291 "\t\tint keyslot);\n"
8296 #: ../src/guestfs-actions.pod:2740 ../fish/guestfish-actions.pod:2160
8298 "This command erases existing data on C<device> and formats the device as a "
8299 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8300 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8304 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2767 ../src/guestfs-actions.pod:2869 ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:4196 ../src/guestfs-actions.pod:4517 ../src/guestfs-actions.pod:4537 ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:5525 ../fish/guestfish-actions.pod:2168 ../fish/guestfish-actions.pod:2181 ../fish/guestfish-actions.pod:2252 ../fish/guestfish-actions.pod:2767 ../fish/guestfish-actions.pod:3242 ../fish/guestfish-actions.pod:3522 ../fish/guestfish-actions.pod:3538 ../fish/guestfish-actions.pod:3553 ../fish/guestfish-actions.pod:4268
8306 "B<This command is dangerous. Without careful use you can easily destroy all "
8311 #: ../src/guestfs-actions.pod:2754
8312 msgid "guestfs_luks_format_cipher"
8316 #: ../src/guestfs-actions.pod:2756
8319 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8320 "\t\tconst char *device,\n"
8321 "\t\tconst char *key,\n"
8322 "\t\tint keyslot,\n"
8323 "\t\tconst char *cipher);\n"
8328 #: ../src/guestfs-actions.pod:2762
8330 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8331 "set the C<cipher> used."
8335 #: ../src/guestfs-actions.pod:2774
8336 msgid "guestfs_luks_kill_slot"
8340 #: ../src/guestfs-actions.pod:2776
8343 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8344 "\t\tconst char *device,\n"
8345 "\t\tconst char *key,\n"
8346 "\t\tint keyslot);\n"
8351 #: ../src/guestfs-actions.pod:2781 ../fish/guestfish-actions.pod:2188
8353 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8354 "device C<device>. C<key> must be one of the I<other> keys."
8358 #: ../src/guestfs-actions.pod:2791
8359 msgid "guestfs_luks_open"
8363 #: ../src/guestfs-actions.pod:2793
8366 " int guestfs_luks_open (guestfs_h *g,\n"
8367 "\t\tconst char *device,\n"
8368 "\t\tconst char *key,\n"
8369 "\t\tconst char *mapname);\n"
8374 #: ../src/guestfs-actions.pod:2798 ../fish/guestfish-actions.pod:2199
8376 "This command opens a block device which has been encrypted according to the "
8377 "Linux Unified Key Setup (LUKS) standard."
8381 #: ../src/guestfs-actions.pod:2801 ../fish/guestfish-actions.pod:2202
8382 msgid "C<device> is the encrypted block device or partition."
8386 #: ../src/guestfs-actions.pod:2803 ../fish/guestfish-actions.pod:2204
8388 "The caller must supply one of the keys associated with the LUKS block "
8389 "device, in the C<key> parameter."
8393 #: ../src/guestfs-actions.pod:2806 ../fish/guestfish-actions.pod:2207
8395 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8396 "writes to this block device are decrypted from and encrypted to the "
8397 "underlying C<device> respectively."
8401 #: ../src/guestfs-actions.pod:2810
8403 "If this block device contains LVM volume groups, then calling "
8404 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8409 #: ../src/guestfs-actions.pod:2820
8410 msgid "guestfs_luks_open_ro"
8414 #: ../src/guestfs-actions.pod:2822
8417 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8418 "\t\tconst char *device,\n"
8419 "\t\tconst char *key,\n"
8420 "\t\tconst char *mapname);\n"
8425 #: ../src/guestfs-actions.pod:2827
8427 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8432 #: ../src/guestfs-actions.pod:2836
8433 msgid "guestfs_lvcreate"
8437 #: ../src/guestfs-actions.pod:2838
8440 " int guestfs_lvcreate (guestfs_h *g,\n"
8441 "\t\tconst char *logvol,\n"
8442 "\t\tconst char *volgroup,\n"
8443 "\t\tint mbytes);\n"
8448 #: ../src/guestfs-actions.pod:2843 ../fish/guestfish-actions.pod:2232
8450 "This creates an LVM logical volume called C<logvol> on the volume group "
8451 "C<volgroup>, with C<size> megabytes."
8455 #: ../src/guestfs-actions.pod:2848
8456 msgid "guestfs_lvm_clear_filter"
8460 #: ../src/guestfs-actions.pod:2850
8463 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8468 #: ../src/guestfs-actions.pod:2852
8470 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8471 "see every block device."
8475 #: ../src/guestfs-actions.pod:2855 ../src/guestfs-actions.pod:2891 ../fish/guestfish-actions.pod:2242 ../fish/guestfish-actions.pod:2273
8476 msgid "This command also clears the LVM cache and performs a volume group scan."
8480 #: ../src/guestfs-actions.pod:2860
8481 msgid "guestfs_lvm_remove_all"
8485 #: ../src/guestfs-actions.pod:2862
8488 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8493 #: ../src/guestfs-actions.pod:2864 ../fish/guestfish-actions.pod:2249
8495 "This command removes all LVM logical volumes, volume groups and physical "
8500 #: ../src/guestfs-actions.pod:2872
8501 msgid "guestfs_lvm_set_filter"
8505 #: ../src/guestfs-actions.pod:2874
8508 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8509 "\t\tchar *const *devices);\n"
8514 #: ../src/guestfs-actions.pod:2877 ../fish/guestfish-actions.pod:2259
8516 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
8517 "block devices in the list C<devices>, and will ignore all other attached "
8522 #: ../src/guestfs-actions.pod:2881 ../fish/guestfish-actions.pod:2263
8524 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
8525 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
8526 "there are two types of duplication possible: either cloned PVs/VGs which "
8527 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
8528 "same name. In normal operation you cannot create this situation, but you "
8529 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
8530 "inside the LVM metadata."
8534 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:2276
8535 msgid "You can filter whole block devices or individual partitions."
8539 #: ../src/guestfs-actions.pod:2896 ../fish/guestfish-actions.pod:2278
8541 "You cannot use this if any VG is currently in use (eg. contains a mounted "
8542 "filesystem), even if you are not filtering out that VG."
8546 #: ../src/guestfs-actions.pod:2902
8547 msgid "guestfs_lvremove"
8551 #: ../src/guestfs-actions.pod:2904
8554 " int guestfs_lvremove (guestfs_h *g,\n"
8555 "\t\tconst char *device);\n"
8560 #: ../src/guestfs-actions.pod:2907 ../fish/guestfish-actions.pod:2286
8562 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
8563 "LV, such as C</dev/VG/LV>."
8567 #: ../src/guestfs-actions.pod:2910 ../fish/guestfish-actions.pod:2289
8569 "You can also remove all LVs in a volume group by specifying the VG name, "
8574 #: ../src/guestfs-actions.pod:2915
8575 msgid "guestfs_lvrename"
8579 #: ../src/guestfs-actions.pod:2917
8582 " int guestfs_lvrename (guestfs_h *g,\n"
8583 "\t\tconst char *logvol,\n"
8584 "\t\tconst char *newlogvol);\n"
8589 #: ../src/guestfs-actions.pod:2921 ../fish/guestfish-actions.pod:2296
8590 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
8594 #: ../src/guestfs-actions.pod:2925
8595 msgid "guestfs_lvresize"
8599 #: ../src/guestfs-actions.pod:2927
8602 " int guestfs_lvresize (guestfs_h *g,\n"
8603 "\t\tconst char *device,\n"
8604 "\t\tint mbytes);\n"
8609 #: ../src/guestfs-actions.pod:2931 ../fish/guestfish-actions.pod:2302
8611 "This resizes (expands or shrinks) an existing LVM logical volume to "
8612 "C<mbytes>. When reducing, data in the reduced part is lost."
8616 #: ../src/guestfs-actions.pod:2937
8617 msgid "guestfs_lvresize_free"
8621 #: ../src/guestfs-actions.pod:2939
8624 " int guestfs_lvresize_free (guestfs_h *g,\n"
8625 "\t\tconst char *lv,\n"
8626 "\t\tint percent);\n"
8631 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2310
8633 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
8634 "remaining free space in the volume group. Commonly you would call this with "
8635 "pc = 100 which expands the logical volume as much as possible, using all "
8636 "remaining free space in the volume group."
8640 #: ../src/guestfs-actions.pod:2951
8645 #: ../src/guestfs-actions.pod:2953
8648 " char **guestfs_lvs (guestfs_h *g);\n"
8653 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2320
8655 "List all the logical volumes detected. This is the equivalent of the "
8656 "L<lvs(8)> command."
8660 #: ../src/guestfs-actions.pod:2958 ../fish/guestfish-actions.pod:2323
8662 "This returns a list of the logical volume device names "
8663 "(eg. C</dev/VolGroup00/LogVol00>)."
8667 #: ../src/guestfs-actions.pod:2961
8668 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
8672 #: ../src/guestfs-actions.pod:2967
8673 msgid "guestfs_lvs_full"
8677 #: ../src/guestfs-actions.pod:2969
8680 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
8685 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2332
8687 "List all the logical volumes detected. This is the equivalent of the "
8688 "L<lvs(8)> command. The \"full\" version includes all fields."
8692 #: ../src/guestfs-actions.pod:2974
8694 "This function returns a C<struct guestfs_lvm_lv_list *> (see "
8695 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
8696 "must call C<guestfs_free_lvm_lv_list> after use>."
8700 #: ../src/guestfs-actions.pod:2979
8701 msgid "guestfs_lvuuid"
8705 #: ../src/guestfs-actions.pod:2981
8708 " char *guestfs_lvuuid (guestfs_h *g,\n"
8709 "\t\tconst char *device);\n"
8714 #: ../src/guestfs-actions.pod:2984 ../fish/guestfish-actions.pod:2339
8715 msgid "This command returns the UUID of the LVM LV C<device>."
8719 #: ../src/guestfs-actions.pod:2989
8720 msgid "guestfs_lxattrlist"
8724 #: ../src/guestfs-actions.pod:2991
8727 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
8728 "\t\tconst char *path,\n"
8729 "\t\tchar *const *names);\n"
8734 #: ../src/guestfs-actions.pod:2995 ../fish/guestfish-actions.pod:2345
8736 "This call allows you to get the extended attributes of multiple files, where "
8737 "all files are in the directory C<path>. C<names> is the list of files from "
8742 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2349
8744 "On return you get a flat list of xattr structs which must be interpreted "
8745 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
8746 "C<attrval> in this struct is zero-length to indicate there was an error "
8747 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
8748 "number (the number of following attributes for this file, which could be "
8749 "C<\"0\">). Then after the first xattr struct are the zero or more "
8750 "attributes for the first named file. This repeats for the second and "
8755 #: ../src/guestfs-actions.pod:3009
8757 "This call is intended for programs that want to efficiently list a directory "
8758 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
8759 "a similarly efficient call for getting standard stats. Very long directory "
8760 "listings might cause the protocol message size to be exceeded, causing this "
8761 "call to fail. The caller must split up such requests into smaller groups of "
8766 #: ../src/guestfs-actions.pod:3022
8767 msgid "guestfs_mkdir"
8771 #: ../src/guestfs-actions.pod:3024
8774 " int guestfs_mkdir (guestfs_h *g,\n"
8775 "\t\tconst char *path);\n"
8780 #: ../src/guestfs-actions.pod:3027 ../fish/guestfish-actions.pod:2371
8781 msgid "Create a directory named C<path>."
8785 #: ../src/guestfs-actions.pod:3031
8786 msgid "guestfs_mkdir_mode"
8790 #: ../src/guestfs-actions.pod:3033
8793 " int guestfs_mkdir_mode (guestfs_h *g,\n"
8794 "\t\tconst char *path,\n"
8800 #: ../src/guestfs-actions.pod:3037 ../fish/guestfish-actions.pod:2377
8802 "This command creates a directory, setting the initial permissions of the "
8803 "directory to C<mode>."
8807 #: ../src/guestfs-actions.pod:3040 ../fish/guestfish-actions.pod:2380
8809 "For common Linux filesystems, the actual mode which is set will be C<mode & "
8810 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
8815 #: ../src/guestfs-actions.pod:3044
8816 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
8820 #: ../src/guestfs-actions.pod:3048
8821 msgid "guestfs_mkdir_p"
8825 #: ../src/guestfs-actions.pod:3050
8828 " int guestfs_mkdir_p (guestfs_h *g,\n"
8829 "\t\tconst char *path);\n"
8834 #: ../src/guestfs-actions.pod:3053 ../fish/guestfish-actions.pod:2390
8836 "Create a directory named C<path>, creating any parent directories as "
8837 "necessary. This is like the C<mkdir -p> shell command."
8841 #: ../src/guestfs-actions.pod:3058
8842 msgid "guestfs_mkdtemp"
8846 #: ../src/guestfs-actions.pod:3060
8849 " char *guestfs_mkdtemp (guestfs_h *g,\n"
8850 "\t\tconst char *template);\n"
8855 #: ../src/guestfs-actions.pod:3063 ../fish/guestfish-actions.pod:2397
8857 "This command creates a temporary directory. The C<template> parameter "
8858 "should be a full pathname for the temporary directory name with the final "
8859 "six characters being \"XXXXXX\"."
8863 #: ../src/guestfs-actions.pod:3068 ../fish/guestfish-actions.pod:2402
8865 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
8866 "being suitable for Windows filesystems."
8870 #: ../src/guestfs-actions.pod:3071 ../fish/guestfish-actions.pod:2405
8871 msgid "The name of the temporary directory that was created is returned."
8875 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2408
8876 msgid "The temporary directory is created with mode 0700 and is owned by root."
8880 #: ../src/guestfs-actions.pod:3077 ../fish/guestfish-actions.pod:2411
8882 "The caller is responsible for deleting the temporary directory and its "
8883 "contents after use."
8887 #: ../src/guestfs-actions.pod:3080 ../fish/guestfish-actions.pod:2414
8888 msgid "See also: L<mkdtemp(3)>"
8892 #: ../src/guestfs-actions.pod:3085
8893 msgid "guestfs_mke2fs_J"
8897 #: ../src/guestfs-actions.pod:3087
8900 " int guestfs_mke2fs_J (guestfs_h *g,\n"
8901 "\t\tconst char *fstype,\n"
8902 "\t\tint blocksize,\n"
8903 "\t\tconst char *device,\n"
8904 "\t\tconst char *journal);\n"
8909 #: ../src/guestfs-actions.pod:3093 ../fish/guestfish-actions.pod:2420
8911 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
8912 "C<journal>. It is equivalent to the command:"
8916 #: ../src/guestfs-actions.pod:3097 ../fish/guestfish-actions.pod:2424
8919 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
8924 #: ../src/guestfs-actions.pod:3099
8925 msgid "See also C<guestfs_mke2journal>."
8929 #: ../src/guestfs-actions.pod:3103
8930 msgid "guestfs_mke2fs_JL"
8934 #: ../src/guestfs-actions.pod:3105
8937 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
8938 "\t\tconst char *fstype,\n"
8939 "\t\tint blocksize,\n"
8940 "\t\tconst char *device,\n"
8941 "\t\tconst char *label);\n"
8946 #: ../src/guestfs-actions.pod:3111 ../fish/guestfish-actions.pod:2432
8948 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
8949 "the journal labeled C<label>."
8953 #: ../src/guestfs-actions.pod:3114
8954 msgid "See also C<guestfs_mke2journal_L>."
8958 #: ../src/guestfs-actions.pod:3118
8959 msgid "guestfs_mke2fs_JU"
8963 #: ../src/guestfs-actions.pod:3120
8966 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
8967 "\t\tconst char *fstype,\n"
8968 "\t\tint blocksize,\n"
8969 "\t\tconst char *device,\n"
8970 "\t\tconst char *uuid);\n"
8975 #: ../src/guestfs-actions.pod:3126 ../fish/guestfish-actions.pod:2441
8977 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
8978 "the journal with UUID C<uuid>."
8982 #: ../src/guestfs-actions.pod:3129
8983 msgid "See also C<guestfs_mke2journal_U>."
8987 #: ../src/guestfs-actions.pod:3133
8988 msgid "guestfs_mke2journal"
8992 #: ../src/guestfs-actions.pod:3135
8995 " int guestfs_mke2journal (guestfs_h *g,\n"
8996 "\t\tint blocksize,\n"
8997 "\t\tconst char *device);\n"
9002 #: ../src/guestfs-actions.pod:3139 ../fish/guestfish-actions.pod:2450
9004 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9009 #: ../src/guestfs-actions.pod:3142 ../fish/guestfish-actions.pod:2453
9012 " mke2fs -O journal_dev -b blocksize device\n"
9017 #: ../src/guestfs-actions.pod:3146
9018 msgid "guestfs_mke2journal_L"
9022 #: ../src/guestfs-actions.pod:3148
9025 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9026 "\t\tint blocksize,\n"
9027 "\t\tconst char *label,\n"
9028 "\t\tconst char *device);\n"
9033 #: ../src/guestfs-actions.pod:3153 ../fish/guestfish-actions.pod:2459
9034 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9038 #: ../src/guestfs-actions.pod:3157
9039 msgid "guestfs_mke2journal_U"
9043 #: ../src/guestfs-actions.pod:3159
9046 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9047 "\t\tint blocksize,\n"
9048 "\t\tconst char *uuid,\n"
9049 "\t\tconst char *device);\n"
9054 #: ../src/guestfs-actions.pod:3164 ../fish/guestfish-actions.pod:2465
9055 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9059 #: ../src/guestfs-actions.pod:3168
9060 msgid "guestfs_mkfifo"
9064 #: ../src/guestfs-actions.pod:3170
9067 " int guestfs_mkfifo (guestfs_h *g,\n"
9069 "\t\tconst char *path);\n"
9074 #: ../src/guestfs-actions.pod:3174
9076 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9077 "is just a convenient wrapper around C<guestfs_mknod>."
9081 #: ../src/guestfs-actions.pod:3182
9082 msgid "guestfs_mkfs"
9086 #: ../src/guestfs-actions.pod:3184
9089 " int guestfs_mkfs (guestfs_h *g,\n"
9090 "\t\tconst char *fstype,\n"
9091 "\t\tconst char *device);\n"
9096 #: ../src/guestfs-actions.pod:3188 ../fish/guestfish-actions.pod:2481
9098 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9099 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9103 #: ../src/guestfs-actions.pod:3194
9104 msgid "guestfs_mkfs_b"
9108 #: ../src/guestfs-actions.pod:3196
9111 " int guestfs_mkfs_b (guestfs_h *g,\n"
9112 "\t\tconst char *fstype,\n"
9113 "\t\tint blocksize,\n"
9114 "\t\tconst char *device);\n"
9119 #: ../src/guestfs-actions.pod:3201
9121 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9122 "block size of the resulting filesystem. Supported block sizes depend on the "
9123 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9127 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2494
9129 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9134 #: ../src/guestfs-actions.pod:3211
9135 msgid "guestfs_mkmountpoint"
9139 #: ../src/guestfs-actions.pod:3213
9142 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9143 "\t\tconst char *exemptpath);\n"
9148 #: ../src/guestfs-actions.pod:3216
9150 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9151 "that can be used to create extra mountpoints before mounting the first "
9156 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2505
9158 "These calls are I<only> necessary in some very limited circumstances, mainly "
9159 "the case where you want to mount a mix of unrelated and/or read-only "
9160 "filesystems together."
9164 #: ../src/guestfs-actions.pod:3224 ../fish/guestfish-actions.pod:2509
9166 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9167 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9168 "inside that. You can unpack this as follows in guestfish:"
9172 #: ../src/guestfs-actions.pod:3229 ../fish/guestfish-actions.pod:2514
9175 " add-ro Fedora-11-i686-Live.iso\n"
9177 " mkmountpoint /cd\n"
9178 " mkmountpoint /squash\n"
9179 " mkmountpoint /ext3\n"
9180 " mount /dev/sda /cd\n"
9181 " mount-loop /cd/LiveOS/squashfs.img /squash\n"
9182 " mount-loop /squash/LiveOS/ext3fs.img /ext3\n"
9187 #: ../src/guestfs-actions.pod:3238 ../fish/guestfish-actions.pod:2523
9188 msgid "The inner filesystem is now unpacked under the /ext3 mountpoint."
9192 #: ../src/guestfs-actions.pod:3242
9193 msgid "guestfs_mknod"
9197 #: ../src/guestfs-actions.pod:3244
9200 " int guestfs_mknod (guestfs_h *g,\n"
9202 "\t\tint devmajor,\n"
9203 "\t\tint devminor,\n"
9204 "\t\tconst char *path);\n"
9209 #: ../src/guestfs-actions.pod:3250 ../fish/guestfish-actions.pod:2529
9211 "This call creates block or character special devices, or named pipes "
9216 #: ../src/guestfs-actions.pod:3253 ../fish/guestfish-actions.pod:2532
9218 "The C<mode> parameter should be the mode, using the standard constants. "
9219 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9220 "used when creating block and character special devices."
9224 #: ../src/guestfs-actions.pod:3258
9226 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9227 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9228 "regular file). These constants are available in the standard Linux header "
9229 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9230 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9231 "the appropriate constant for you."
9235 #: ../src/guestfs-actions.pod:3270
9236 msgid "guestfs_mknod_b"
9240 #: ../src/guestfs-actions.pod:3272
9243 " int guestfs_mknod_b (guestfs_h *g,\n"
9245 "\t\tint devmajor,\n"
9246 "\t\tint devminor,\n"
9247 "\t\tconst char *path);\n"
9252 #: ../src/guestfs-actions.pod:3278
9254 "This call creates a block device node called C<path> with mode C<mode> and "
9255 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9256 "wrapper around C<guestfs_mknod>."
9260 #: ../src/guestfs-actions.pod:3286
9261 msgid "guestfs_mknod_c"
9265 #: ../src/guestfs-actions.pod:3288
9268 " int guestfs_mknod_c (guestfs_h *g,\n"
9270 "\t\tint devmajor,\n"
9271 "\t\tint devminor,\n"
9272 "\t\tconst char *path);\n"
9277 #: ../src/guestfs-actions.pod:3294
9279 "This call creates a char device node called C<path> with mode C<mode> and "
9280 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9281 "wrapper around C<guestfs_mknod>."
9285 #: ../src/guestfs-actions.pod:3302
9286 msgid "guestfs_mkswap"
9290 #: ../src/guestfs-actions.pod:3304
9293 " int guestfs_mkswap (guestfs_h *g,\n"
9294 "\t\tconst char *device);\n"
9299 #: ../src/guestfs-actions.pod:3307 ../fish/guestfish-actions.pod:2571
9300 msgid "Create a swap partition on C<device>."
9304 #: ../src/guestfs-actions.pod:3311
9305 msgid "guestfs_mkswap_L"
9309 #: ../src/guestfs-actions.pod:3313
9312 " int guestfs_mkswap_L (guestfs_h *g,\n"
9313 "\t\tconst char *label,\n"
9314 "\t\tconst char *device);\n"
9319 #: ../src/guestfs-actions.pod:3317 ../fish/guestfish-actions.pod:2577
9320 msgid "Create a swap partition on C<device> with label C<label>."
9324 #: ../src/guestfs-actions.pod:3319 ../fish/guestfish-actions.pod:2579
9326 "Note that you cannot attach a swap label to a block device "
9327 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
9328 "the kernel or swap tools."
9332 #: ../src/guestfs-actions.pod:3325
9333 msgid "guestfs_mkswap_U"
9337 #: ../src/guestfs-actions.pod:3327
9340 " int guestfs_mkswap_U (guestfs_h *g,\n"
9341 "\t\tconst char *uuid,\n"
9342 "\t\tconst char *device);\n"
9347 #: ../src/guestfs-actions.pod:3331 ../fish/guestfish-actions.pod:2587
9348 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9352 #: ../src/guestfs-actions.pod:3335
9353 msgid "guestfs_mkswap_file"
9357 #: ../src/guestfs-actions.pod:3337
9360 " int guestfs_mkswap_file (guestfs_h *g,\n"
9361 "\t\tconst char *path);\n"
9366 #: ../src/guestfs-actions.pod:3340 ../fish/guestfish-actions.pod:2593
9367 msgid "Create a swap file."
9371 #: ../src/guestfs-actions.pod:3342
9373 "This command just writes a swap file signature to an existing file. To "
9374 "create the file itself, use something like C<guestfs_fallocate>."
9378 #: ../src/guestfs-actions.pod:3347
9379 msgid "guestfs_modprobe"
9383 #: ../src/guestfs-actions.pod:3349
9386 " int guestfs_modprobe (guestfs_h *g,\n"
9387 "\t\tconst char *modulename);\n"
9392 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2602
9393 msgid "This loads a kernel module in the appliance."
9397 #: ../src/guestfs-actions.pod:3354 ../fish/guestfish-actions.pod:2604
9399 "The kernel module must have been whitelisted when libguestfs was built (see "
9400 "C<appliance/kmod.whitelist.in> in the source)."
9404 #: ../src/guestfs-actions.pod:3359
9405 msgid "guestfs_mount"
9409 #: ../src/guestfs-actions.pod:3361
9412 " int guestfs_mount (guestfs_h *g,\n"
9413 "\t\tconst char *device,\n"
9414 "\t\tconst char *mountpoint);\n"
9419 #: ../src/guestfs-actions.pod:3365 ../fish/guestfish-actions.pod:2611
9421 "Mount a guest disk at a position in the filesystem. Block devices are named "
9422 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9423 "those block devices contain partitions, they will have the usual names "
9424 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9428 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2617
9430 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9431 "mounted on C</> before others can be mounted. Other filesystems can only be "
9432 "mounted on directories which already exist."
9436 #: ../src/guestfs-actions.pod:3376 ../fish/guestfish-actions.pod:2622
9438 "The mounted filesystem is writable, if we have sufficient permissions on the "
9439 "underlying device."
9443 #: ../src/guestfs-actions.pod:3379
9445 "B<Important note:> When you use this call, the filesystem options C<sync> "
9446 "and C<noatime> are set implicitly. This was originally done because we "
9447 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9448 "very large negative performance impact and negligible effect on "
9449 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9450 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9451 "(use an empty string for the first parameter if you don't want any options)."
9455 #: ../src/guestfs-actions.pod:3391
9456 msgid "guestfs_mount_loop"
9460 #: ../src/guestfs-actions.pod:3393
9463 " int guestfs_mount_loop (guestfs_h *g,\n"
9464 "\t\tconst char *file,\n"
9465 "\t\tconst char *mountpoint);\n"
9470 #: ../src/guestfs-actions.pod:3397 ../fish/guestfish-actions.pod:2639
9472 "This command lets you mount C<file> (a filesystem image in a file) on a "
9473 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9478 #: ../src/guestfs-actions.pod:3403
9479 msgid "guestfs_mount_options"
9483 #: ../src/guestfs-actions.pod:3405
9486 " int guestfs_mount_options (guestfs_h *g,\n"
9487 "\t\tconst char *options,\n"
9488 "\t\tconst char *device,\n"
9489 "\t\tconst char *mountpoint);\n"
9494 #: ../src/guestfs-actions.pod:3410
9496 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9497 "the mount options as for the L<mount(8)> I<-o> flag."
9501 #: ../src/guestfs-actions.pod:3414 ../fish/guestfish-actions.pod:2651
9503 "If the C<options> parameter is an empty string, then no options are passed "
9504 "(all options default to whatever the filesystem uses)."
9508 #: ../src/guestfs-actions.pod:3420
9509 msgid "guestfs_mount_ro"
9513 #: ../src/guestfs-actions.pod:3422
9516 " int guestfs_mount_ro (guestfs_h *g,\n"
9517 "\t\tconst char *device,\n"
9518 "\t\tconst char *mountpoint);\n"
9523 #: ../src/guestfs-actions.pod:3426
9525 "This is the same as the C<guestfs_mount> command, but it mounts the "
9526 "filesystem with the read-only (I<-o ro>) flag."
9530 #: ../src/guestfs-actions.pod:3431
9531 msgid "guestfs_mount_vfs"
9535 #: ../src/guestfs-actions.pod:3433
9538 " int guestfs_mount_vfs (guestfs_h *g,\n"
9539 "\t\tconst char *options,\n"
9540 "\t\tconst char *vfstype,\n"
9541 "\t\tconst char *device,\n"
9542 "\t\tconst char *mountpoint);\n"
9547 #: ../src/guestfs-actions.pod:3439
9549 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9550 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
9555 #: ../src/guestfs-actions.pod:3445
9556 msgid "guestfs_mountpoints"
9560 #: ../src/guestfs-actions.pod:3447
9563 " char **guestfs_mountpoints (guestfs_h *g);\n"
9568 #: ../src/guestfs-actions.pod:3449
9570 "This call is similar to C<guestfs_mounts>. That call returns a list of "
9571 "devices. This one returns a hash table (map) of device name to directory "
9572 "where the device is mounted."
9576 #: ../src/guestfs-actions.pod:3459
9577 msgid "guestfs_mounts"
9581 #: ../src/guestfs-actions.pod:3461
9584 " char **guestfs_mounts (guestfs_h *g);\n"
9589 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2682
9591 "This returns the list of currently mounted filesystems. It returns the list "
9592 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
9596 #: ../src/guestfs-actions.pod:3466 ../fish/guestfish-actions.pod:2685
9597 msgid "Some internal mounts are not shown."
9601 #: ../src/guestfs-actions.pod:3468
9602 msgid "See also: C<guestfs_mountpoints>"
9606 #: ../src/guestfs-actions.pod:3474
9611 #: ../src/guestfs-actions.pod:3476
9614 " int guestfs_mv (guestfs_h *g,\n"
9615 "\t\tconst char *src,\n"
9616 "\t\tconst char *dest);\n"
9621 #: ../src/guestfs-actions.pod:3480 ../fish/guestfish-actions.pod:2693
9623 "This moves a file from C<src> to C<dest> where C<dest> is either a "
9624 "destination filename or destination directory."
9628 #: ../src/guestfs-actions.pod:3485
9629 msgid "guestfs_ntfs_3g_probe"
9633 #: ../src/guestfs-actions.pod:3487
9636 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
9638 "\t\tconst char *device);\n"
9643 #: ../src/guestfs-actions.pod:3491 ../fish/guestfish-actions.pod:2700
9645 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
9646 "C<device> for mountability. (Not all NTFS volumes can be mounted "
9647 "read-write, and some cannot be mounted at all)."
9651 #: ../src/guestfs-actions.pod:3495 ../fish/guestfish-actions.pod:2704
9653 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
9654 "can be mounted read-write. Set it to false if you want to test if the "
9655 "volume can be mounted read-only."
9659 #: ../src/guestfs-actions.pod:3499 ../fish/guestfish-actions.pod:2708
9661 "The return value is an integer which C<0> if the operation would succeed, or "
9662 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
9666 #: ../src/guestfs-actions.pod:3505
9667 msgid "guestfs_ntfsresize"
9671 #: ../src/guestfs-actions.pod:3507
9674 " int guestfs_ntfsresize (guestfs_h *g,\n"
9675 "\t\tconst char *device);\n"
9680 #: ../src/guestfs-actions.pod:3510 ../fish/guestfish-actions.pod:2716
9682 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
9683 "size of the underlying device. See also L<ntfsresize(8)>."
9687 #: ../src/guestfs-actions.pod:3516
9688 msgid "guestfs_ntfsresize_size"
9692 #: ../src/guestfs-actions.pod:3518
9695 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
9696 "\t\tconst char *device,\n"
9697 "\t\tint64_t size);\n"
9702 #: ../src/guestfs-actions.pod:3522
9704 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
9705 "to specify the new size (in bytes) explicitly."
9709 #: ../src/guestfs-actions.pod:3527
9710 msgid "guestfs_part_add"
9714 #: ../src/guestfs-actions.pod:3529
9717 " int guestfs_part_add (guestfs_h *g,\n"
9718 "\t\tconst char *device,\n"
9719 "\t\tconst char *prlogex,\n"
9720 "\t\tint64_t startsect,\n"
9721 "\t\tint64_t endsect);\n"
9726 #: ../src/guestfs-actions.pod:3535
9728 "This command adds a partition to C<device>. If there is no partition table "
9729 "on the device, call C<guestfs_part_init> first."
9733 #: ../src/guestfs-actions.pod:3538 ../fish/guestfish-actions.pod:2734
9735 "The C<prlogex> parameter is the type of partition. Normally you should pass "
9736 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
9737 "C<logical>) and C<e> (or C<extended>) partition types."
9741 #: ../src/guestfs-actions.pod:3543 ../fish/guestfish-actions.pod:2739
9743 "C<startsect> and C<endsect> are the start and end of the partition in "
9744 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
9745 "from the end of the disk (C<-1> is the last sector)."
9749 #: ../src/guestfs-actions.pod:3547
9751 "Creating a partition which covers the whole disk is not so easy. Use "
9752 "C<guestfs_part_disk> to do that."
9756 #: ../src/guestfs-actions.pod:3552
9757 msgid "guestfs_part_del"
9761 #: ../src/guestfs-actions.pod:3554
9764 " int guestfs_part_del (guestfs_h *g,\n"
9765 "\t\tconst char *device,\n"
9766 "\t\tint partnum);\n"
9771 #: ../src/guestfs-actions.pod:3558 ../fish/guestfish-actions.pod:2750
9772 msgid "This command deletes the partition numbered C<partnum> on C<device>."
9776 #: ../src/guestfs-actions.pod:3560 ../fish/guestfish-actions.pod:2752
9778 "Note that in the case of MBR partitioning, deleting an extended partition "
9779 "also deletes any logical partitions it contains."
9783 #: ../src/guestfs-actions.pod:3566
9784 msgid "guestfs_part_disk"
9788 #: ../src/guestfs-actions.pod:3568
9791 " int guestfs_part_disk (guestfs_h *g,\n"
9792 "\t\tconst char *device,\n"
9793 "\t\tconst char *parttype);\n"
9798 #: ../src/guestfs-actions.pod:3572
9800 "This command is simply a combination of C<guestfs_part_init> followed by "
9801 "C<guestfs_part_add> to create a single primary partition covering the whole "
9806 #: ../src/guestfs-actions.pod:3576
9808 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
9809 "possible values are described in C<guestfs_part_init>."
9813 #: ../src/guestfs-actions.pod:3584
9814 msgid "guestfs_part_get_bootable"
9818 #: ../src/guestfs-actions.pod:3586
9821 " int guestfs_part_get_bootable (guestfs_h *g,\n"
9822 "\t\tconst char *device,\n"
9823 "\t\tint partnum);\n"
9828 #: ../src/guestfs-actions.pod:3590 ../fish/guestfish-actions.pod:2774
9830 "This command returns true if the partition C<partnum> on C<device> has the "
9831 "bootable flag set."
9835 #: ../src/guestfs-actions.pod:3593
9836 msgid "See also C<guestfs_part_set_bootable>."
9840 #: ../src/guestfs-actions.pod:3597
9841 msgid "guestfs_part_get_mbr_id"
9845 #: ../src/guestfs-actions.pod:3599
9848 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
9849 "\t\tconst char *device,\n"
9850 "\t\tint partnum);\n"
9855 #: ../src/guestfs-actions.pod:3603 ../fish/guestfish-actions.pod:2783
9857 "Returns the MBR type byte (also known as the ID byte) from the numbered "
9858 "partition C<partnum>."
9862 #: ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:3768
9864 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
9865 "undefined results for other partition table types (see "
9866 "C<guestfs_part_get_parttype>)."
9870 #: ../src/guestfs-actions.pod:3612
9871 msgid "guestfs_part_get_parttype"
9875 #: ../src/guestfs-actions.pod:3614
9878 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
9879 "\t\tconst char *device);\n"
9884 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2794
9886 "This command examines the partition table on C<device> and returns the "
9887 "partition table type (format) being used."
9891 #: ../src/guestfs-actions.pod:3620
9893 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
9894 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
9895 "possible, although unusual. See C<guestfs_part_init> for a full list."
9899 #: ../src/guestfs-actions.pod:3628
9900 msgid "guestfs_part_init"
9904 #: ../src/guestfs-actions.pod:3630
9907 " int guestfs_part_init (guestfs_h *g,\n"
9908 "\t\tconst char *device,\n"
9909 "\t\tconst char *parttype);\n"
9914 #: ../src/guestfs-actions.pod:3634 ../fish/guestfish-actions.pod:2806
9916 "This creates an empty partition table on C<device> of one of the partition "
9917 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
9918 "(for large disks)."
9922 #: ../src/guestfs-actions.pod:3638
9924 "Initially there are no partitions. Following this, you should call "
9925 "C<guestfs_part_add> for each partition required."
9929 #: ../src/guestfs-actions.pod:3641 ../fish/guestfish-actions.pod:2813
9930 msgid "Possible values for C<parttype> are:"
9934 #: ../src/guestfs-actions.pod:3645 ../fish/guestfish-actions.pod:2817
9935 msgid "B<efi> | B<gpt>"
9939 #: ../src/guestfs-actions.pod:3647 ../fish/guestfish-actions.pod:2819
9940 msgid "Intel EFI / GPT partition table."
9944 #: ../src/guestfs-actions.pod:3649 ../fish/guestfish-actions.pod:2821
9946 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
9947 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
9948 "the C<mbr> format."
9952 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2825
9953 msgid "B<mbr> | B<msdos>"
9957 #: ../src/guestfs-actions.pod:3655 ../fish/guestfish-actions.pod:2827
9959 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
9960 "Windows. This partition type will B<only> work for device sizes up to 2 "
9961 "TB. For large disks we recommend using C<gpt>."
9965 #: ../src/guestfs-actions.pod:3662 ../fish/guestfish-actions.pod:2834
9966 msgid "Other partition table types that may work but are not supported include:"
9970 #: ../src/guestfs-actions.pod:3667 ../fish/guestfish-actions.pod:2839
9975 #: ../src/guestfs-actions.pod:3669 ../fish/guestfish-actions.pod:2841
9976 msgid "AIX disk labels."
9980 #: ../src/guestfs-actions.pod:3671 ../fish/guestfish-actions.pod:2843
9981 msgid "B<amiga> | B<rdb>"
9985 #: ../src/guestfs-actions.pod:3673 ../fish/guestfish-actions.pod:2845
9986 msgid "Amiga \"Rigid Disk Block\" format."
9990 #: ../src/guestfs-actions.pod:3675 ../fish/guestfish-actions.pod:2847
9995 #: ../src/guestfs-actions.pod:3677 ../fish/guestfish-actions.pod:2849
9996 msgid "BSD disk labels."
10000 #: ../src/guestfs-actions.pod:3679 ../fish/guestfish-actions.pod:2851
10005 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2853
10006 msgid "DASD, used on IBM mainframes."
10010 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2855
10015 #: ../src/guestfs-actions.pod:3685 ../fish/guestfish-actions.pod:2857
10016 msgid "MIPS/SGI volumes."
10020 #: ../src/guestfs-actions.pod:3687 ../fish/guestfish-actions.pod:2859
10025 #: ../src/guestfs-actions.pod:3689 ../fish/guestfish-actions.pod:2861
10026 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10030 #: ../src/guestfs-actions.pod:3691 ../fish/guestfish-actions.pod:2863
10035 #: ../src/guestfs-actions.pod:3693 ../fish/guestfish-actions.pod:2865
10036 msgid "NEC PC-98 format, common in Japan apparently."
10040 #: ../src/guestfs-actions.pod:3695 ../fish/guestfish-actions.pod:2867
10045 #: ../src/guestfs-actions.pod:3697 ../fish/guestfish-actions.pod:2869
10046 msgid "Sun disk labels."
10050 #: ../src/guestfs-actions.pod:3703
10051 msgid "guestfs_part_list"
10055 #: ../src/guestfs-actions.pod:3705
10058 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10059 "\t\tconst char *device);\n"
10064 #: ../src/guestfs-actions.pod:3708 ../fish/guestfish-actions.pod:2877
10066 "This command parses the partition table on C<device> and returns the list of "
10067 "partitions found."
10071 #: ../src/guestfs-actions.pod:3711 ../fish/guestfish-actions.pod:2880
10072 msgid "The fields in the returned structure are:"
10076 #: ../src/guestfs-actions.pod:3715 ../fish/guestfish-actions.pod:2884
10077 msgid "B<part_num>"
10081 #: ../src/guestfs-actions.pod:3717 ../fish/guestfish-actions.pod:2886
10082 msgid "Partition number, counting from 1."
10086 #: ../src/guestfs-actions.pod:3719 ../fish/guestfish-actions.pod:2888
10087 msgid "B<part_start>"
10091 #: ../src/guestfs-actions.pod:3721
10093 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10094 "the device's sector size, see C<guestfs_blockdev_getss>."
10098 #: ../src/guestfs-actions.pod:3724 ../fish/guestfish-actions.pod:2893
10099 msgid "B<part_end>"
10103 #: ../src/guestfs-actions.pod:3726 ../fish/guestfish-actions.pod:2895
10104 msgid "End of the partition in bytes."
10108 #: ../src/guestfs-actions.pod:3728 ../fish/guestfish-actions.pod:2897
10109 msgid "B<part_size>"
10113 #: ../src/guestfs-actions.pod:3730 ../fish/guestfish-actions.pod:2899
10114 msgid "Size of the partition in bytes."
10118 #: ../src/guestfs-actions.pod:3734
10120 "This function returns a C<struct guestfs_partition_list *> (see "
10121 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10122 "must call C<guestfs_free_partition_list> after use>."
10126 #: ../src/guestfs-actions.pod:3739
10127 msgid "guestfs_part_set_bootable"
10131 #: ../src/guestfs-actions.pod:3741
10134 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10135 "\t\tconst char *device,\n"
10136 "\t\tint partnum,\n"
10137 "\t\tint bootable);\n"
10142 #: ../src/guestfs-actions.pod:3746 ../fish/guestfish-actions.pod:2907
10144 "This sets the bootable flag on partition numbered C<partnum> on device "
10145 "C<device>. Note that partitions are numbered from 1."
10149 #: ../src/guestfs-actions.pod:3749 ../fish/guestfish-actions.pod:2910
10151 "The bootable flag is used by some operating systems (notably Windows) to "
10152 "determine which partition to boot from. It is by no means universally "
10157 #: ../src/guestfs-actions.pod:3755
10158 msgid "guestfs_part_set_mbr_id"
10162 #: ../src/guestfs-actions.pod:3757
10165 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10166 "\t\tconst char *device,\n"
10167 "\t\tint partnum,\n"
10168 "\t\tint idbyte);\n"
10173 #: ../src/guestfs-actions.pod:3762 ../fish/guestfish-actions.pod:2918
10175 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10176 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10177 "documentation are in fact hexadecimal numbers, but usually documented "
10178 "without any leading \"0x\" which might be confusing."
10182 #: ../src/guestfs-actions.pod:3774
10183 msgid "guestfs_part_set_name"
10187 #: ../src/guestfs-actions.pod:3776
10190 " int guestfs_part_set_name (guestfs_h *g,\n"
10191 "\t\tconst char *device,\n"
10192 "\t\tint partnum,\n"
10193 "\t\tconst char *name);\n"
10198 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2932
10200 "This sets the partition name on partition numbered C<partnum> on device "
10201 "C<device>. Note that partitions are numbered from 1."
10205 #: ../src/guestfs-actions.pod:3784 ../fish/guestfish-actions.pod:2935
10207 "The partition name can only be set on certain types of partition table. "
10208 "This works on C<gpt> but not on C<mbr> partitions."
10212 #: ../src/guestfs-actions.pod:3789
10213 msgid "guestfs_part_to_dev"
10217 #: ../src/guestfs-actions.pod:3791
10220 " char *guestfs_part_to_dev (guestfs_h *g,\n"
10221 "\t\tconst char *partition);\n"
10226 #: ../src/guestfs-actions.pod:3794 ../fish/guestfish-actions.pod:2942
10228 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
10229 "partition number, returning the device name (eg. \"/dev/sdb\")."
10233 #: ../src/guestfs-actions.pod:3798
10235 "The named partition must exist, for example as a string returned from "
10236 "C<guestfs_list_partitions>."
10240 #: ../src/guestfs-actions.pod:3804
10241 msgid "guestfs_ping_daemon"
10245 #: ../src/guestfs-actions.pod:3806
10248 " int guestfs_ping_daemon (guestfs_h *g);\n"
10253 #: ../src/guestfs-actions.pod:3808 ../fish/guestfish-actions.pod:2953
10255 "This is a test probe into the guestfs daemon running inside the qemu "
10256 "subprocess. Calling this function checks that the daemon responds to the "
10257 "ping message, without affecting the daemon or attached block device(s) in "
10262 #: ../src/guestfs-actions.pod:3815
10263 msgid "guestfs_pread"
10267 #: ../src/guestfs-actions.pod:3817
10270 " char *guestfs_pread (guestfs_h *g,\n"
10271 "\t\tconst char *path,\n"
10273 "\t\tint64_t offset,\n"
10274 "\t\tsize_t *size_r);\n"
10279 #: ../src/guestfs-actions.pod:3823 ../fish/guestfish-actions.pod:2962
10281 "This command lets you read part of a file. It reads C<count> bytes of the "
10282 "file, starting at C<offset>, from file C<path>."
10286 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2965
10288 "This may read fewer bytes than requested. For further details see the "
10289 "L<pread(2)> system call."
10293 #: ../src/guestfs-actions.pod:3829
10294 msgid "See also C<guestfs_pwrite>."
10298 #: ../src/guestfs-actions.pod:3838
10299 msgid "guestfs_pvcreate"
10303 #: ../src/guestfs-actions.pod:3840
10306 " int guestfs_pvcreate (guestfs_h *g,\n"
10307 "\t\tconst char *device);\n"
10312 #: ../src/guestfs-actions.pod:3843 ../fish/guestfish-actions.pod:2977
10314 "This creates an LVM physical volume on the named C<device>, where C<device> "
10315 "should usually be a partition name such as C</dev/sda1>."
10319 #: ../src/guestfs-actions.pod:3849
10320 msgid "guestfs_pvremove"
10324 #: ../src/guestfs-actions.pod:3851
10327 " int guestfs_pvremove (guestfs_h *g,\n"
10328 "\t\tconst char *device);\n"
10333 #: ../src/guestfs-actions.pod:3854 ../fish/guestfish-actions.pod:2985
10335 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10340 #: ../src/guestfs-actions.pod:3857 ../fish/guestfish-actions.pod:2988
10342 "The implementation uses the C<pvremove> command which refuses to wipe "
10343 "physical volumes that contain any volume groups, so you have to remove those "
10348 #: ../src/guestfs-actions.pod:3863
10349 msgid "guestfs_pvresize"
10353 #: ../src/guestfs-actions.pod:3865
10356 " int guestfs_pvresize (guestfs_h *g,\n"
10357 "\t\tconst char *device);\n"
10362 #: ../src/guestfs-actions.pod:3868 ../fish/guestfish-actions.pod:2996
10364 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10365 "the new size of the underlying device."
10369 #: ../src/guestfs-actions.pod:3873
10370 msgid "guestfs_pvresize_size"
10374 #: ../src/guestfs-actions.pod:3875
10377 " int guestfs_pvresize_size (guestfs_h *g,\n"
10378 "\t\tconst char *device,\n"
10379 "\t\tint64_t size);\n"
10384 #: ../src/guestfs-actions.pod:3879
10386 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10387 "specify the new size (in bytes) explicitly."
10391 #: ../src/guestfs-actions.pod:3884
10392 msgid "guestfs_pvs"
10396 #: ../src/guestfs-actions.pod:3886
10399 " char **guestfs_pvs (guestfs_h *g);\n"
10404 #: ../src/guestfs-actions.pod:3888 ../fish/guestfish-actions.pod:3010
10406 "List all the physical volumes detected. This is the equivalent of the "
10407 "L<pvs(8)> command."
10411 #: ../src/guestfs-actions.pod:3891 ../fish/guestfish-actions.pod:3013
10413 "This returns a list of just the device names that contain PVs "
10414 "(eg. C</dev/sda2>)."
10418 #: ../src/guestfs-actions.pod:3894
10419 msgid "See also C<guestfs_pvs_full>."
10423 #: ../src/guestfs-actions.pod:3900
10424 msgid "guestfs_pvs_full"
10428 #: ../src/guestfs-actions.pod:3902
10431 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10436 #: ../src/guestfs-actions.pod:3904 ../fish/guestfish-actions.pod:3022
10438 "List all the physical volumes detected. This is the equivalent of the "
10439 "L<pvs(8)> command. The \"full\" version includes all fields."
10443 #: ../src/guestfs-actions.pod:3907
10445 "This function returns a C<struct guestfs_lvm_pv_list *> (see "
10446 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10447 "must call C<guestfs_free_lvm_pv_list> after use>."
10451 #: ../src/guestfs-actions.pod:3912
10452 msgid "guestfs_pvuuid"
10456 #: ../src/guestfs-actions.pod:3914
10459 " char *guestfs_pvuuid (guestfs_h *g,\n"
10460 "\t\tconst char *device);\n"
10465 #: ../src/guestfs-actions.pod:3917 ../fish/guestfish-actions.pod:3029
10466 msgid "This command returns the UUID of the LVM PV C<device>."
10470 #: ../src/guestfs-actions.pod:3922
10471 msgid "guestfs_pwrite"
10475 #: ../src/guestfs-actions.pod:3924
10478 " int guestfs_pwrite (guestfs_h *g,\n"
10479 "\t\tconst char *path,\n"
10480 "\t\tconst char *content,\n"
10481 "\t\tsize_t content_size,\n"
10482 "\t\tint64_t offset);\n"
10487 #: ../src/guestfs-actions.pod:3930 ../fish/guestfish-actions.pod:3035
10489 "This command writes to part of a file. It writes the data buffer C<content> "
10490 "to the file C<path> starting at offset C<offset>."
10494 #: ../src/guestfs-actions.pod:3933 ../fish/guestfish-actions.pod:3038
10496 "This command implements the L<pwrite(2)> system call, and like that system "
10497 "call it may not write the full data requested. The return value is the "
10498 "number of bytes that were actually written to the file. This could even be "
10499 "0, although short writes are unlikely for regular files in ordinary "
10504 #: ../src/guestfs-actions.pod:3939
10505 msgid "See also C<guestfs_pread>."
10509 #: ../src/guestfs-actions.pod:3946
10510 msgid "guestfs_read_file"
10514 #: ../src/guestfs-actions.pod:3948
10517 " char *guestfs_read_file (guestfs_h *g,\n"
10518 "\t\tconst char *path,\n"
10519 "\t\tsize_t *size_r);\n"
10524 #: ../src/guestfs-actions.pod:3952 ../fish/guestfish-actions.pod:3053
10525 msgid "This calls returns the contents of the file C<path> as a buffer."
10529 #: ../src/guestfs-actions.pod:3955
10531 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
10532 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
10533 "function is limited in the total size of file that can be handled."
10537 #: ../src/guestfs-actions.pod:3967
10538 msgid "guestfs_read_lines"
10542 #: ../src/guestfs-actions.pod:3969
10545 " char **guestfs_read_lines (guestfs_h *g,\n"
10546 "\t\tconst char *path);\n"
10551 #: ../src/guestfs-actions.pod:3974 ../fish/guestfish-actions.pod:3070
10553 "The file contents are returned as a list of lines. Trailing C<LF> and "
10554 "C<CRLF> character sequences are I<not> returned."
10558 #: ../src/guestfs-actions.pod:3977
10560 "Note that this function cannot correctly handle binary files (specifically, "
10561 "files containing C<\\0> character which is treated as end of line). For "
10562 "those you need to use the C<guestfs_read_file> function which has a more "
10563 "complex interface."
10567 #: ../src/guestfs-actions.pod:3986
10568 msgid "guestfs_readdir"
10572 #: ../src/guestfs-actions.pod:3988
10575 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
10576 "\t\tconst char *dir);\n"
10581 #: ../src/guestfs-actions.pod:3991 ../fish/guestfish-actions.pod:3082
10582 msgid "This returns the list of directory entries in directory C<dir>."
10586 #: ../src/guestfs-actions.pod:3993 ../fish/guestfish-actions.pod:3084
10588 "All entries in the directory are returned, including C<.> and C<..>. The "
10589 "entries are I<not> sorted, but returned in the same order as the underlying "
10594 #: ../src/guestfs-actions.pod:3997 ../fish/guestfish-actions.pod:3088
10596 "Also this call returns basic file type information about each file. The "
10597 "C<ftyp> field will contain one of the following characters:"
10601 #: ../src/guestfs-actions.pod:4002 ../fish/guestfish-actions.pod:3093
10606 #: ../src/guestfs-actions.pod:4004 ../fish/guestfish-actions.pod:3095
10607 msgid "Block special"
10611 #: ../src/guestfs-actions.pod:4006 ../fish/guestfish-actions.pod:3097
10616 #: ../src/guestfs-actions.pod:4008 ../fish/guestfish-actions.pod:3099
10617 msgid "Char special"
10621 #: ../src/guestfs-actions.pod:4010 ../fish/guestfish-actions.pod:3101
10626 #: ../src/guestfs-actions.pod:4012 ../fish/guestfish-actions.pod:3103
10631 #: ../src/guestfs-actions.pod:4014 ../fish/guestfish-actions.pod:3105
10636 #: ../src/guestfs-actions.pod:4016 ../fish/guestfish-actions.pod:3107
10637 msgid "FIFO (named pipe)"
10641 #: ../src/guestfs-actions.pod:4018 ../fish/guestfish-actions.pod:3109
10646 #: ../src/guestfs-actions.pod:4020 ../fish/guestfish-actions.pod:3111
10647 msgid "Symbolic link"
10651 #: ../src/guestfs-actions.pod:4022 ../fish/guestfish-actions.pod:3113
10656 #: ../src/guestfs-actions.pod:4024 ../fish/guestfish-actions.pod:3115
10657 msgid "Regular file"
10661 #: ../src/guestfs-actions.pod:4026 ../fish/guestfish-actions.pod:3117
10666 #: ../src/guestfs-actions.pod:4028 ../fish/guestfish-actions.pod:3119
10671 #: ../src/guestfs-actions.pod:4030 ../fish/guestfish-actions.pod:3121
10676 #: ../src/guestfs-actions.pod:4032 ../fish/guestfish-actions.pod:3123
10677 msgid "Unknown file type"
10681 #: ../src/guestfs-actions.pod:4034 ../fish/guestfish-actions.pod:3125
10686 #: ../src/guestfs-actions.pod:4036 ../fish/guestfish-actions.pod:3127
10687 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
10691 #: ../src/guestfs-actions.pod:4041
10693 "This function is primarily intended for use by programs. To get a simple "
10694 "list of names, use C<guestfs_ls>. To get a printable directory for human "
10695 "consumption, use C<guestfs_ll>."
10699 #: ../src/guestfs-actions.pod:4045
10701 "This function returns a C<struct guestfs_dirent_list *> (see "
10702 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10703 "must call C<guestfs_free_dirent_list> after use>."
10707 #: ../src/guestfs-actions.pod:4050
10708 msgid "guestfs_readlink"
10712 #: ../src/guestfs-actions.pod:4052
10715 " char *guestfs_readlink (guestfs_h *g,\n"
10716 "\t\tconst char *path);\n"
10721 #: ../src/guestfs-actions.pod:4055 ../fish/guestfish-actions.pod:3140
10722 msgid "This command reads the target of a symbolic link."
10726 #: ../src/guestfs-actions.pod:4060
10727 msgid "guestfs_readlinklist"
10731 #: ../src/guestfs-actions.pod:4062
10734 " char **guestfs_readlinklist (guestfs_h *g,\n"
10735 "\t\tconst char *path,\n"
10736 "\t\tchar *const *names);\n"
10741 #: ../src/guestfs-actions.pod:4066 ../fish/guestfish-actions.pod:3146
10743 "This call allows you to do a C<readlink> operation on multiple files, where "
10744 "all files are in the directory C<path>. C<names> is the list of files from "
10749 #: ../src/guestfs-actions.pod:4070 ../fish/guestfish-actions.pod:3150
10751 "On return you get a list of strings, with a one-to-one correspondence to the "
10752 "C<names> list. Each string is the value of the symbolic link."
10756 #: ../src/guestfs-actions.pod:4074 ../fish/guestfish-actions.pod:3154
10758 "If the C<readlink(2)> operation fails on any name, then the corresponding "
10759 "result string is the empty string C<\"\">. However the whole operation is "
10760 "completed even if there were C<readlink(2)> errors, and so you can call this "
10761 "function with names where you don't know if they are symbolic links already "
10762 "(albeit slightly less efficient)."
10766 #: ../src/guestfs-actions.pod:4081 ../fish/guestfish-actions.pod:3161
10768 "This call is intended for programs that want to efficiently list a directory "
10769 "contents without making many round-trips. Very long directory listings "
10770 "might cause the protocol message size to be exceeded, causing this call to "
10771 "fail. The caller must split up such requests into smaller groups of names."
10775 #: ../src/guestfs-actions.pod:4092
10776 msgid "guestfs_realpath"
10780 #: ../src/guestfs-actions.pod:4094
10783 " char *guestfs_realpath (guestfs_h *g,\n"
10784 "\t\tconst char *path);\n"
10789 #: ../src/guestfs-actions.pod:4097 ../fish/guestfish-actions.pod:3172
10791 "Return the canonicalized absolute pathname of C<path>. The returned path "
10792 "has no C<.>, C<..> or symbolic link path elements."
10796 #: ../src/guestfs-actions.pod:4103
10797 msgid "guestfs_removexattr"
10801 #: ../src/guestfs-actions.pod:4105
10804 " int guestfs_removexattr (guestfs_h *g,\n"
10805 "\t\tconst char *xattr,\n"
10806 "\t\tconst char *path);\n"
10811 #: ../src/guestfs-actions.pod:4109 ../fish/guestfish-actions.pod:3179
10812 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
10816 #: ../src/guestfs-actions.pod:4112
10817 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
10821 #: ../src/guestfs-actions.pod:4116
10822 msgid "guestfs_resize2fs"
10826 #: ../src/guestfs-actions.pod:4118
10829 " int guestfs_resize2fs (guestfs_h *g,\n"
10830 "\t\tconst char *device);\n"
10835 #: ../src/guestfs-actions.pod:4121 ../fish/guestfish-actions.pod:3188
10837 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
10838 "underlying device."
10842 #: ../src/guestfs-actions.pod:4124
10844 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
10845 "C<device> before calling this command. For unknown reasons C<resize2fs> "
10846 "sometimes gives an error about this and sometimes not. In any case, it is "
10847 "always safe to call C<guestfs_e2fsck_f> before calling this function."
10851 #: ../src/guestfs-actions.pod:4132
10852 msgid "guestfs_resize2fs_size"
10856 #: ../src/guestfs-actions.pod:4134
10859 " int guestfs_resize2fs_size (guestfs_h *g,\n"
10860 "\t\tconst char *device,\n"
10861 "\t\tint64_t size);\n"
10866 #: ../src/guestfs-actions.pod:4138
10868 "This command is the same as C<guestfs_resize2fs> except that it allows you "
10869 "to specify the new size (in bytes) explicitly."
10873 #: ../src/guestfs-actions.pod:4143
10878 #: ../src/guestfs-actions.pod:4145
10881 " int guestfs_rm (guestfs_h *g,\n"
10882 "\t\tconst char *path);\n"
10887 #: ../src/guestfs-actions.pod:4148 ../fish/guestfish-actions.pod:3208
10888 msgid "Remove the single file C<path>."
10892 #: ../src/guestfs-actions.pod:4152
10893 msgid "guestfs_rm_rf"
10897 #: ../src/guestfs-actions.pod:4154
10900 " int guestfs_rm_rf (guestfs_h *g,\n"
10901 "\t\tconst char *path);\n"
10906 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:3214
10908 "Remove the file or directory C<path>, recursively removing the contents if "
10909 "its a directory. This is like the C<rm -rf> shell command."
10913 #: ../src/guestfs-actions.pod:4163
10914 msgid "guestfs_rmdir"
10918 #: ../src/guestfs-actions.pod:4165
10921 " int guestfs_rmdir (guestfs_h *g,\n"
10922 "\t\tconst char *path);\n"
10927 #: ../src/guestfs-actions.pod:4168 ../fish/guestfish-actions.pod:3222
10928 msgid "Remove the single directory C<path>."
10932 #: ../src/guestfs-actions.pod:4172
10933 msgid "guestfs_rmmountpoint"
10937 #: ../src/guestfs-actions.pod:4174
10940 " int guestfs_rmmountpoint (guestfs_h *g,\n"
10941 "\t\tconst char *exemptpath);\n"
10946 #: ../src/guestfs-actions.pod:4177
10948 "This calls removes a mountpoint that was previously created with "
10949 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
10953 #: ../src/guestfs-actions.pod:4183
10954 msgid "guestfs_scrub_device"
10958 #: ../src/guestfs-actions.pod:4185
10961 " int guestfs_scrub_device (guestfs_h *g,\n"
10962 "\t\tconst char *device);\n"
10967 #: ../src/guestfs-actions.pod:4188 ../fish/guestfish-actions.pod:3236
10969 "This command writes patterns over C<device> to make data retrieval more "
10974 #: ../src/guestfs-actions.pod:4191 ../src/guestfs-actions.pod:4209 ../src/guestfs-actions.pod:4225 ../fish/guestfish-actions.pod:3239 ../fish/guestfish-actions.pod:3254 ../fish/guestfish-actions.pod:3267
10976 "It is an interface to the L<scrub(1)> program. See that manual page for "
10981 #: ../src/guestfs-actions.pod:4199
10982 msgid "guestfs_scrub_file"
10986 #: ../src/guestfs-actions.pod:4201
10989 " int guestfs_scrub_file (guestfs_h *g,\n"
10990 "\t\tconst char *file);\n"
10995 #: ../src/guestfs-actions.pod:4204 ../fish/guestfish-actions.pod:3249
10997 "This command writes patterns over a file to make data retrieval more "
11002 #: ../src/guestfs-actions.pod:4207 ../fish/guestfish-actions.pod:3252
11003 msgid "The file is I<removed> after scrubbing."
11007 #: ../src/guestfs-actions.pod:4214
11008 msgid "guestfs_scrub_freespace"
11012 #: ../src/guestfs-actions.pod:4216
11015 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11016 "\t\tconst char *dir);\n"
11021 #: ../src/guestfs-actions.pod:4219
11023 "This command creates the directory C<dir> and then fills it with files until "
11024 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11025 "and deletes them. The intention is to scrub any free space on the partition "
11026 "containing C<dir>."
11030 #: ../src/guestfs-actions.pod:4230
11031 msgid "guestfs_set_append"
11035 #: ../src/guestfs-actions.pod:4232
11038 " int guestfs_set_append (guestfs_h *g,\n"
11039 "\t\tconst char *append);\n"
11044 #: ../src/guestfs-actions.pod:4235 ../fish/guestfish-actions.pod:3276
11046 "This function is used to add additional options to the guest kernel command "
11051 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:3279
11053 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11054 "environment variable."
11058 #: ../src/guestfs-actions.pod:4241 ../fish/guestfish-actions.pod:3282
11060 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11061 "(libguestfs always adds a few of its own)."
11065 #: ../src/guestfs-actions.pod:4246
11066 msgid "guestfs_set_autosync"
11070 #: ../src/guestfs-actions.pod:4248
11073 " int guestfs_set_autosync (guestfs_h *g,\n"
11074 "\t\tint autosync);\n"
11079 #: ../src/guestfs-actions.pod:4251
11081 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11082 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11083 "the handle is closed (also if the program exits without closing handles)."
11087 #: ../src/guestfs-actions.pod:4256 ../fish/guestfish-actions.pod:3296
11089 "This is disabled by default (except in guestfish where it is enabled by "
11094 #: ../src/guestfs-actions.pod:4261
11095 msgid "guestfs_set_direct"
11099 #: ../src/guestfs-actions.pod:4263
11102 " int guestfs_set_direct (guestfs_h *g,\n"
11103 "\t\tint direct);\n"
11108 #: ../src/guestfs-actions.pod:4266 ../fish/guestfish-actions.pod:3305
11110 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11111 "passed directly through to the appliance once it is launched."
11115 #: ../src/guestfs-actions.pod:4270
11117 "One consequence of this is that log messages aren't caught by the library "
11118 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11123 #: ../src/guestfs-actions.pod:4274 ../fish/guestfish-actions.pod:3313
11124 msgid "You probably don't want to use this unless you know what you are doing."
11128 #: ../src/guestfs-actions.pod:4277 ../fish/guestfish-actions.pod:3316
11129 msgid "The default is disabled."
11133 #: ../src/guestfs-actions.pod:4281
11134 msgid "guestfs_set_e2label"
11138 #: ../src/guestfs-actions.pod:4283
11141 " int guestfs_set_e2label (guestfs_h *g,\n"
11142 "\t\tconst char *device,\n"
11143 "\t\tconst char *label);\n"
11148 #: ../src/guestfs-actions.pod:4287 ../fish/guestfish-actions.pod:3322
11150 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11151 "C<label>. Filesystem labels are limited to 16 characters."
11155 #: ../src/guestfs-actions.pod:4291
11157 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11158 "the existing label on a filesystem."
11162 #: ../src/guestfs-actions.pod:4296
11163 msgid "guestfs_set_e2uuid"
11167 #: ../src/guestfs-actions.pod:4298
11170 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11171 "\t\tconst char *device,\n"
11172 "\t\tconst char *uuid);\n"
11177 #: ../src/guestfs-actions.pod:4302 ../fish/guestfish-actions.pod:3333
11179 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11180 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11181 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11185 #: ../src/guestfs-actions.pod:4307
11187 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11188 "the existing UUID of a filesystem."
11192 #: ../src/guestfs-actions.pod:4312
11193 msgid "guestfs_set_memsize"
11197 #: ../src/guestfs-actions.pod:4314
11200 " int guestfs_set_memsize (guestfs_h *g,\n"
11201 "\t\tint memsize);\n"
11206 #: ../src/guestfs-actions.pod:4317
11208 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11209 "This only has any effect if called before C<guestfs_launch>."
11213 #: ../src/guestfs-actions.pod:4321 ../fish/guestfish-actions.pod:3351
11215 "You can also change this by setting the environment variable "
11216 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11220 #: ../src/guestfs-actions.pod:4330
11221 msgid "guestfs_set_network"
11225 #: ../src/guestfs-actions.pod:4332
11228 " int guestfs_set_network (guestfs_h *g,\n"
11229 "\t\tint network);\n"
11234 #: ../src/guestfs-actions.pod:4335 ../fish/guestfish-actions.pod:3364
11236 "If C<network> is true, then the network is enabled in the libguestfs "
11237 "appliance. The default is false."
11241 #: ../src/guestfs-actions.pod:4338 ../fish/guestfish-actions.pod:3367
11243 "This affects whether commands are able to access the network (see "
11244 "L<guestfs(3)/RUNNING COMMANDS>)."
11248 #: ../src/guestfs-actions.pod:4341
11250 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11255 #: ../src/guestfs-actions.pod:4346
11256 msgid "guestfs_set_path"
11260 #: ../src/guestfs-actions.pod:4348
11263 " int guestfs_set_path (guestfs_h *g,\n"
11264 "\t\tconst char *searchpath);\n"
11269 #: ../src/guestfs-actions.pod:4351 ../fish/guestfish-actions.pod:3379
11270 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11274 #: ../src/guestfs-actions.pod:4353 ../fish/guestfish-actions.pod:3381
11276 "The default is C<$libdir/guestfs> unless overridden by setting "
11277 "C<LIBGUESTFS_PATH> environment variable."
11281 #: ../src/guestfs-actions.pod:4356 ../fish/guestfish-actions.pod:3384
11282 msgid "Setting C<path> to C<NULL> restores the default path."
11286 #: ../src/guestfs-actions.pod:4360
11287 msgid "guestfs_set_qemu"
11291 #: ../src/guestfs-actions.pod:4362
11294 " int guestfs_set_qemu (guestfs_h *g,\n"
11295 "\t\tconst char *qemu);\n"
11300 #: ../src/guestfs-actions.pod:4365 ../fish/guestfish-actions.pod:3392
11301 msgid "Set the qemu binary that we will use."
11305 #: ../src/guestfs-actions.pod:4367 ../fish/guestfish-actions.pod:3394
11306 msgid "The default is chosen when the library was compiled by the configure script."
11310 #: ../src/guestfs-actions.pod:4370 ../fish/guestfish-actions.pod:3397
11312 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11317 #: ../src/guestfs-actions.pod:4373 ../fish/guestfish-actions.pod:3400
11318 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11322 #: ../src/guestfs-actions.pod:4375 ../fish/guestfish-actions.pod:3402
11324 "Note that you should call this function as early as possible after creating "
11325 "the handle. This is because some pre-launch operations depend on testing "
11326 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11327 "don't retest features, and so you might see inconsistent results. Using the "
11328 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11329 "the qemu binary at the same time as the handle is created."
11333 #: ../src/guestfs-actions.pod:4385
11334 msgid "guestfs_set_recovery_proc"
11338 #: ../src/guestfs-actions.pod:4387
11341 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11342 "\t\tint recoveryproc);\n"
11347 #: ../src/guestfs-actions.pod:4390
11349 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11350 "not create a recovery process. The purpose of the recovery process is to "
11351 "stop runaway qemu processes in the case where the main program aborts "
11356 #: ../src/guestfs-actions.pod:4395
11358 "This only has any effect if called before C<guestfs_launch>, and the default "
11363 #: ../src/guestfs-actions.pod:4398 ../fish/guestfish-actions.pod:3424
11365 "About the only time when you would want to disable this is if the main "
11366 "process will fork itself into the background (\"daemonize\" itself). In "
11367 "this case the recovery process thinks that the main program has disappeared "
11368 "and so kills qemu, which is not very helpful."
11372 #: ../src/guestfs-actions.pod:4406
11373 msgid "guestfs_set_selinux"
11377 #: ../src/guestfs-actions.pod:4408
11380 " int guestfs_set_selinux (guestfs_h *g,\n"
11381 "\t\tint selinux);\n"
11386 #: ../src/guestfs-actions.pod:4411 ../fish/guestfish-actions.pod:3436
11388 "This sets the selinux flag that is passed to the appliance at boot time. "
11389 "The default is C<selinux=0> (disabled)."
11393 #: ../src/guestfs-actions.pod:4414 ../fish/guestfish-actions.pod:3439
11395 "Note that if SELinux is enabled, it is always in Permissive mode "
11396 "(C<enforcing=0>)."
11400 #: ../src/guestfs-actions.pod:4422
11401 msgid "guestfs_set_trace"
11405 #: ../src/guestfs-actions.pod:4424
11408 " int guestfs_set_trace (guestfs_h *g,\n"
11409 "\t\tint trace);\n"
11414 #: ../src/guestfs-actions.pod:4427 ../fish/guestfish-actions.pod:3451
11416 "If the command trace flag is set to 1, then commands are printed on stderr "
11417 "before they are executed in a format which is very similar to the one used "
11418 "by guestfish. In other words, you can run a program with this enabled, and "
11419 "you will get out a script which you can feed to guestfish to perform the "
11420 "same set of actions."
11424 #: ../src/guestfs-actions.pod:4434 ../fish/guestfish-actions.pod:3458
11426 "If you want to trace C API calls into libguestfs (and other libraries) then "
11427 "possibly a better way is to use the external ltrace(1) command."
11431 #: ../src/guestfs-actions.pod:4438 ../fish/guestfish-actions.pod:3462
11433 "Command traces are disabled unless the environment variable "
11434 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
11438 #: ../src/guestfs-actions.pod:4443
11439 msgid "guestfs_set_verbose"
11443 #: ../src/guestfs-actions.pod:4445
11446 " int guestfs_set_verbose (guestfs_h *g,\n"
11447 "\t\tint verbose);\n"
11452 #: ../src/guestfs-actions.pod:4448 ../fish/guestfish-actions.pod:3471
11453 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
11457 #: ../src/guestfs-actions.pod:4450 ../fish/guestfish-actions.pod:3473
11459 "Verbose messages are disabled unless the environment variable "
11460 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
11464 #: ../src/guestfs-actions.pod:4455
11465 msgid "guestfs_setcon"
11469 #: ../src/guestfs-actions.pod:4457
11472 " int guestfs_setcon (guestfs_h *g,\n"
11473 "\t\tconst char *context);\n"
11478 #: ../src/guestfs-actions.pod:4460 ../fish/guestfish-actions.pod:3480
11480 "This sets the SELinux security context of the daemon to the string "
11485 #: ../src/guestfs-actions.pod:4463 ../fish/guestfish-actions.pod:3483
11486 msgid "See the documentation about SELINUX in L<guestfs(3)>."
11490 #: ../src/guestfs-actions.pod:4467
11491 msgid "guestfs_setxattr"
11495 #: ../src/guestfs-actions.pod:4469
11498 " int guestfs_setxattr (guestfs_h *g,\n"
11499 "\t\tconst char *xattr,\n"
11500 "\t\tconst char *val,\n"
11501 "\t\tint vallen,\n"
11502 "\t\tconst char *path);\n"
11507 #: ../src/guestfs-actions.pod:4475 ../fish/guestfish-actions.pod:3489
11509 "This call sets the extended attribute named C<xattr> of the file C<path> to "
11510 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
11514 #: ../src/guestfs-actions.pod:4479
11515 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
11519 #: ../src/guestfs-actions.pod:4483
11520 msgid "guestfs_sfdisk"
11524 #: ../src/guestfs-actions.pod:4485
11527 " int guestfs_sfdisk (guestfs_h *g,\n"
11528 "\t\tconst char *device,\n"
11531 "\t\tint sectors,\n"
11532 "\t\tchar *const *lines);\n"
11537 #: ../src/guestfs-actions.pod:4492 ../fish/guestfish-actions.pod:3499
11539 "This is a direct interface to the L<sfdisk(8)> program for creating "
11540 "partitions on block devices."
11544 #: ../src/guestfs-actions.pod:4495 ../fish/guestfish-actions.pod:3502
11545 msgid "C<device> should be a block device, for example C</dev/sda>."
11549 #: ../src/guestfs-actions.pod:4497 ../fish/guestfish-actions.pod:3504
11551 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
11552 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
11553 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
11554 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
11555 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
11556 "the kernel) cannot work out the right geometry and you will need to tell it."
11560 #: ../src/guestfs-actions.pod:4505 ../fish/guestfish-actions.pod:3512
11562 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
11563 "refer to the L<sfdisk(8)> manpage."
11567 #: ../src/guestfs-actions.pod:4508 ../fish/guestfish-actions.pod:3515
11569 "To create a single partition occupying the whole disk, you would pass "
11570 "C<lines> as a single element list, when the single element being the string "
11575 #: ../src/guestfs-actions.pod:4512
11576 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
11580 #: ../src/guestfs-actions.pod:4520
11581 msgid "guestfs_sfdiskM"
11585 #: ../src/guestfs-actions.pod:4522
11588 " int guestfs_sfdiskM (guestfs_h *g,\n"
11589 "\t\tconst char *device,\n"
11590 "\t\tchar *const *lines);\n"
11595 #: ../src/guestfs-actions.pod:4526
11597 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
11598 "partition sizes are specified in megabytes only (rounded to the nearest "
11599 "cylinder) and you don't need to specify the cyls, heads and sectors "
11600 "parameters which were rarely if ever used anyway."
11604 #: ../src/guestfs-actions.pod:4532
11606 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
11607 "C<guestfs_part_disk>"
11611 #: ../src/guestfs-actions.pod:4540
11612 msgid "guestfs_sfdisk_N"
11616 #: ../src/guestfs-actions.pod:4542
11619 " int guestfs_sfdisk_N (guestfs_h *g,\n"
11620 "\t\tconst char *device,\n"
11621 "\t\tint partnum,\n"
11624 "\t\tint sectors,\n"
11625 "\t\tconst char *line);\n"
11630 #: ../src/guestfs-actions.pod:4550 ../fish/guestfish-actions.pod:3545
11632 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
11633 "(note: C<n> counts from 1)."
11637 #: ../src/guestfs-actions.pod:4553
11639 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
11640 "for the cyls/heads/sectors parameters."
11644 #: ../src/guestfs-actions.pod:4556
11645 msgid "See also: C<guestfs_part_add>"
11649 #: ../src/guestfs-actions.pod:4563
11650 msgid "guestfs_sfdisk_disk_geometry"
11654 #: ../src/guestfs-actions.pod:4565
11657 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
11658 "\t\tconst char *device);\n"
11663 #: ../src/guestfs-actions.pod:4568
11665 "This displays the disk geometry of C<device> read from the partition table. "
11666 "Especially in the case where the underlying block device has been resized, "
11667 "this can be different from the kernel's idea of the geometry (see "
11668 "C<guestfs_sfdisk_kernel_geometry>)."
11672 #: ../src/guestfs-actions.pod:4573 ../src/guestfs-actions.pod:4586 ../fish/guestfish-actions.pod:3565 ../fish/guestfish-actions.pod:3574
11673 msgid "The result is in human-readable format, and not designed to be parsed."
11677 #: ../src/guestfs-actions.pod:4579
11678 msgid "guestfs_sfdisk_kernel_geometry"
11682 #: ../src/guestfs-actions.pod:4581
11685 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
11686 "\t\tconst char *device);\n"
11691 #: ../src/guestfs-actions.pod:4584 ../fish/guestfish-actions.pod:3572
11692 msgid "This displays the kernel's idea of the geometry of C<device>."
11696 #: ../src/guestfs-actions.pod:4592
11697 msgid "guestfs_sfdisk_l"
11701 #: ../src/guestfs-actions.pod:4594
11704 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
11705 "\t\tconst char *device);\n"
11710 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3581
11712 "This displays the partition table on C<device>, in the human-readable output "
11713 "of the L<sfdisk(8)> command. It is not intended to be parsed."
11717 #: ../src/guestfs-actions.pod:4601
11718 msgid "See also: C<guestfs_part_list>"
11722 #: ../src/guestfs-actions.pod:4606
11727 #: ../src/guestfs-actions.pod:4608
11730 " char *guestfs_sh (guestfs_h *g,\n"
11731 "\t\tconst char *command);\n"
11736 #: ../src/guestfs-actions.pod:4611 ../fish/guestfish-actions.pod:3591
11738 "This call runs a command from the guest filesystem via the guest's "
11743 #: ../src/guestfs-actions.pod:4614
11744 msgid "This is like C<guestfs_command>, but passes the command to:"
11748 #: ../src/guestfs-actions.pod:4616 ../fish/guestfish-actions.pod:3596
11751 " /bin/sh -c \"command\"\n"
11756 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3598
11758 "Depending on the guest's shell, this usually results in wildcards being "
11759 "expanded, shell expressions being interpolated and so on."
11763 #: ../src/guestfs-actions.pod:4622
11764 msgid "All the provisos about C<guestfs_command> apply to this call."
11768 #: ../src/guestfs-actions.pod:4627
11769 msgid "guestfs_sh_lines"
11773 #: ../src/guestfs-actions.pod:4629
11776 " char **guestfs_sh_lines (guestfs_h *g,\n"
11777 "\t\tconst char *command);\n"
11782 #: ../src/guestfs-actions.pod:4632
11784 "This is the same as C<guestfs_sh>, but splits the result into a list of "
11789 #: ../src/guestfs-actions.pod:4635
11790 msgid "See also: C<guestfs_command_lines>"
11794 #: ../src/guestfs-actions.pod:4641
11795 msgid "guestfs_sleep"
11799 #: ../src/guestfs-actions.pod:4643
11802 " int guestfs_sleep (guestfs_h *g,\n"
11808 #: ../src/guestfs-actions.pod:4646 ../fish/guestfish-actions.pod:3617
11809 msgid "Sleep for C<secs> seconds."
11813 #: ../src/guestfs-actions.pod:4650 ../src/guestfs-structs.pod:109
11814 msgid "guestfs_stat"
11818 #: ../src/guestfs-actions.pod:4652
11821 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
11822 "\t\tconst char *path);\n"
11827 #: ../src/guestfs-actions.pod:4657 ../fish/guestfish-actions.pod:3625
11828 msgid "This is the same as the C<stat(2)> system call."
11832 #: ../src/guestfs-actions.pod:4663 ../src/guestfs-structs.pod:135
11833 msgid "guestfs_statvfs"
11837 #: ../src/guestfs-actions.pod:4665
11840 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
11841 "\t\tconst char *path);\n"
11846 #: ../src/guestfs-actions.pod:4668 ../fish/guestfish-actions.pod:3631
11848 "Returns file system statistics for any mounted file system. C<path> should "
11849 "be a file or directory in the mounted file system (typically it is the mount "
11850 "point itself, but it doesn't need to be)."
11854 #: ../src/guestfs-actions.pod:4672 ../fish/guestfish-actions.pod:3635
11855 msgid "This is the same as the C<statvfs(2)> system call."
11859 #: ../src/guestfs-actions.pod:4674
11861 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
11862 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
11866 #: ../src/guestfs-actions.pod:4678
11867 msgid "guestfs_strings"
11871 #: ../src/guestfs-actions.pod:4680
11874 " char **guestfs_strings (guestfs_h *g,\n"
11875 "\t\tconst char *path);\n"
11880 #: ../src/guestfs-actions.pod:4683 ../fish/guestfish-actions.pod:3641
11882 "This runs the L<strings(1)> command on a file and returns the list of "
11883 "printable strings found."
11887 #: ../src/guestfs-actions.pod:4693
11888 msgid "guestfs_strings_e"
11892 #: ../src/guestfs-actions.pod:4695
11895 " char **guestfs_strings_e (guestfs_h *g,\n"
11896 "\t\tconst char *encoding,\n"
11897 "\t\tconst char *path);\n"
11902 #: ../src/guestfs-actions.pod:4699
11904 "This is like the C<guestfs_strings> command, but allows you to specify the "
11905 "encoding of strings that are looked for in the source file C<path>."
11909 #: ../src/guestfs-actions.pod:4703 ../fish/guestfish-actions.pod:3655
11910 msgid "Allowed encodings are:"
11914 #: ../src/guestfs-actions.pod:4707 ../fish/guestfish-actions.pod:3659
11919 #: ../src/guestfs-actions.pod:4709
11921 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
11922 "ISO-8859-X (this is what C<guestfs_strings> uses)."
11926 #: ../src/guestfs-actions.pod:4712 ../fish/guestfish-actions.pod:3664
11931 #: ../src/guestfs-actions.pod:4714 ../fish/guestfish-actions.pod:3666
11932 msgid "Single 8-bit-byte characters."
11936 #: ../src/guestfs-actions.pod:4716 ../fish/guestfish-actions.pod:3668
11941 #: ../src/guestfs-actions.pod:4718 ../fish/guestfish-actions.pod:3670
11942 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
11946 #: ../src/guestfs-actions.pod:4721 ../fish/guestfish-actions.pod:3673
11947 msgid "l (lower case letter L)"
11951 #: ../src/guestfs-actions.pod:4723 ../fish/guestfish-actions.pod:3675
11953 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
11954 "examining binaries in Windows guests."
11958 #: ../src/guestfs-actions.pod:4726 ../fish/guestfish-actions.pod:3678
11963 #: ../src/guestfs-actions.pod:4728 ../fish/guestfish-actions.pod:3680
11964 msgid "32-bit big endian such as UCS-4BE."
11968 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3682
11973 #: ../src/guestfs-actions.pod:4732 ../fish/guestfish-actions.pod:3684
11974 msgid "32-bit little endian such as UCS-4LE."
11978 #: ../src/guestfs-actions.pod:4736 ../fish/guestfish-actions.pod:3688
11979 msgid "The returned strings are transcoded to UTF-8."
11983 #: ../src/guestfs-actions.pod:4745
11984 msgid "guestfs_swapoff_device"
11988 #: ../src/guestfs-actions.pod:4747
11991 " int guestfs_swapoff_device (guestfs_h *g,\n"
11992 "\t\tconst char *device);\n"
11997 #: ../src/guestfs-actions.pod:4750
11999 "This command disables the libguestfs appliance swap device or partition "
12000 "named C<device>. See C<guestfs_swapon_device>."
12004 #: ../src/guestfs-actions.pod:4756
12005 msgid "guestfs_swapoff_file"
12009 #: ../src/guestfs-actions.pod:4758
12012 " int guestfs_swapoff_file (guestfs_h *g,\n"
12013 "\t\tconst char *file);\n"
12018 #: ../src/guestfs-actions.pod:4761 ../fish/guestfish-actions.pod:3705
12019 msgid "This command disables the libguestfs appliance swap on file."
12023 #: ../src/guestfs-actions.pod:4765
12024 msgid "guestfs_swapoff_label"
12028 #: ../src/guestfs-actions.pod:4767
12031 " int guestfs_swapoff_label (guestfs_h *g,\n"
12032 "\t\tconst char *label);\n"
12037 #: ../src/guestfs-actions.pod:4770 ../fish/guestfish-actions.pod:3711
12039 "This command disables the libguestfs appliance swap on labeled swap "
12044 #: ../src/guestfs-actions.pod:4775
12045 msgid "guestfs_swapoff_uuid"
12049 #: ../src/guestfs-actions.pod:4777
12052 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12053 "\t\tconst char *uuid);\n"
12058 #: ../src/guestfs-actions.pod:4780 ../fish/guestfish-actions.pod:3718
12060 "This command disables the libguestfs appliance swap partition with the given "
12065 #: ../src/guestfs-actions.pod:4785
12066 msgid "guestfs_swapon_device"
12070 #: ../src/guestfs-actions.pod:4787
12073 " int guestfs_swapon_device (guestfs_h *g,\n"
12074 "\t\tconst char *device);\n"
12079 #: ../src/guestfs-actions.pod:4790
12081 "This command enables the libguestfs appliance to use the swap device or "
12082 "partition named C<device>. The increased memory is made available for all "
12083 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12087 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3730
12089 "Note that you should not swap to existing guest swap partitions unless you "
12090 "know what you are doing. They may contain hibernation information, or other "
12091 "information that the guest doesn't want you to trash. You also risk leaking "
12092 "information about the host to the guest this way. Instead, attach a new "
12093 "host device to the guest and swap on that."
12097 #: ../src/guestfs-actions.pod:4804
12098 msgid "guestfs_swapon_file"
12102 #: ../src/guestfs-actions.pod:4806
12105 " int guestfs_swapon_file (guestfs_h *g,\n"
12106 "\t\tconst char *file);\n"
12111 #: ../src/guestfs-actions.pod:4809
12113 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12118 #: ../src/guestfs-actions.pod:4814
12119 msgid "guestfs_swapon_label"
12123 #: ../src/guestfs-actions.pod:4816
12126 " int guestfs_swapon_label (guestfs_h *g,\n"
12127 "\t\tconst char *label);\n"
12132 #: ../src/guestfs-actions.pod:4819
12134 "This command enables swap to a labeled swap partition. See "
12135 "C<guestfs_swapon_device> for other notes."
12139 #: ../src/guestfs-actions.pod:4824
12140 msgid "guestfs_swapon_uuid"
12144 #: ../src/guestfs-actions.pod:4826
12147 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12148 "\t\tconst char *uuid);\n"
12153 #: ../src/guestfs-actions.pod:4829
12155 "This command enables swap to a swap partition with the given UUID. See "
12156 "C<guestfs_swapon_device> for other notes."
12160 #: ../src/guestfs-actions.pod:4834
12161 msgid "guestfs_sync"
12165 #: ../src/guestfs-actions.pod:4836
12168 " int guestfs_sync (guestfs_h *g);\n"
12173 #: ../src/guestfs-actions.pod:4838 ../fish/guestfish-actions.pod:3762
12175 "This syncs the disk, so that any writes are flushed through to the "
12176 "underlying disk image."
12180 #: ../src/guestfs-actions.pod:4841 ../fish/guestfish-actions.pod:3765
12182 "You should always call this if you have modified a disk image, before "
12183 "closing the handle."
12187 #: ../src/guestfs-actions.pod:4846
12188 msgid "guestfs_tail"
12192 #: ../src/guestfs-actions.pod:4848
12195 " char **guestfs_tail (guestfs_h *g,\n"
12196 "\t\tconst char *path);\n"
12201 #: ../src/guestfs-actions.pod:4851 ../fish/guestfish-actions.pod:3772
12202 msgid "This command returns up to the last 10 lines of a file as a list of strings."
12206 #: ../src/guestfs-actions.pod:4861
12207 msgid "guestfs_tail_n"
12211 #: ../src/guestfs-actions.pod:4863
12214 " char **guestfs_tail_n (guestfs_h *g,\n"
12215 "\t\tint nrlines,\n"
12216 "\t\tconst char *path);\n"
12221 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3782
12223 "If the parameter C<nrlines> is a positive number, this returns the last "
12224 "C<nrlines> lines of the file C<path>."
12228 #: ../src/guestfs-actions.pod:4870 ../fish/guestfish-actions.pod:3785
12230 "If the parameter C<nrlines> is a negative number, this returns lines from "
12231 "the file C<path>, starting with the C<-nrlines>th line."
12235 #: ../src/guestfs-actions.pod:4882
12236 msgid "guestfs_tar_in"
12240 #: ../src/guestfs-actions.pod:4884
12243 " int guestfs_tar_in (guestfs_h *g,\n"
12244 "\t\tconst char *tarfile,\n"
12245 "\t\tconst char *directory);\n"
12250 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3797
12252 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12253 "tar file) into C<directory>."
12257 #: ../src/guestfs-actions.pod:4891
12258 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12262 #: ../src/guestfs-actions.pod:4896
12263 msgid "guestfs_tar_out"
12267 #: ../src/guestfs-actions.pod:4898
12270 " int guestfs_tar_out (guestfs_h *g,\n"
12271 "\t\tconst char *directory,\n"
12272 "\t\tconst char *tarfile);\n"
12277 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3809
12279 "This command packs the contents of C<directory> and downloads it to local "
12284 #: ../src/guestfs-actions.pod:4905
12286 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12287 "C<guestfs_txz_out>."
12291 #: ../src/guestfs-actions.pod:4910
12292 msgid "guestfs_tgz_in"
12296 #: ../src/guestfs-actions.pod:4912
12299 " int guestfs_tgz_in (guestfs_h *g,\n"
12300 "\t\tconst char *tarball,\n"
12301 "\t\tconst char *directory);\n"
12306 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3821
12308 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12309 "tar file) into C<directory>."
12313 #: ../src/guestfs-actions.pod:4919
12314 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12318 #: ../src/guestfs-actions.pod:4923
12319 msgid "guestfs_tgz_out"
12323 #: ../src/guestfs-actions.pod:4925
12326 " int guestfs_tgz_out (guestfs_h *g,\n"
12327 "\t\tconst char *directory,\n"
12328 "\t\tconst char *tarball);\n"
12333 #: ../src/guestfs-actions.pod:4929 ../fish/guestfish-actions.pod:3832
12335 "This command packs the contents of C<directory> and downloads it to local "
12340 #: ../src/guestfs-actions.pod:4932
12341 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12345 #: ../src/guestfs-actions.pod:4936
12346 msgid "guestfs_touch"
12350 #: ../src/guestfs-actions.pod:4938
12353 " int guestfs_touch (guestfs_h *g,\n"
12354 "\t\tconst char *path);\n"
12359 #: ../src/guestfs-actions.pod:4941 ../fish/guestfish-actions.pod:3843
12361 "Touch acts like the L<touch(1)> command. It can be used to update the "
12362 "timestamps on a file, or, if the file does not exist, to create a new "
12363 "zero-length file."
12367 #: ../src/guestfs-actions.pod:4945 ../fish/guestfish-actions.pod:3847
12369 "This command only works on regular files, and will fail on other file types "
12370 "such as directories, symbolic links, block special etc."
12374 #: ../src/guestfs-actions.pod:4950
12375 msgid "guestfs_truncate"
12379 #: ../src/guestfs-actions.pod:4952
12382 " int guestfs_truncate (guestfs_h *g,\n"
12383 "\t\tconst char *path);\n"
12388 #: ../src/guestfs-actions.pod:4955 ../fish/guestfish-actions.pod:3854
12390 "This command truncates C<path> to a zero-length file. The file must exist "
12395 #: ../src/guestfs-actions.pod:4960
12396 msgid "guestfs_truncate_size"
12400 #: ../src/guestfs-actions.pod:4962
12403 " int guestfs_truncate_size (guestfs_h *g,\n"
12404 "\t\tconst char *path,\n"
12405 "\t\tint64_t size);\n"
12410 #: ../src/guestfs-actions.pod:4966 ../fish/guestfish-actions.pod:3861
12412 "This command truncates C<path> to size C<size> bytes. The file must exist "
12417 #: ../src/guestfs-actions.pod:4969
12419 "If the current file size is less than C<size> then the file is extended to "
12420 "the required size with zero bytes. This creates a sparse file (ie. disk "
12421 "blocks are not allocated for the file until you write to it). To create a "
12422 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
12426 #: ../src/guestfs-actions.pod:4977
12427 msgid "guestfs_tune2fs_l"
12431 #: ../src/guestfs-actions.pod:4979
12434 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
12435 "\t\tconst char *device);\n"
12440 #: ../src/guestfs-actions.pod:4982 ../fish/guestfish-actions.pod:3874
12442 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
12447 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3877
12449 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
12450 "for more details. The list of fields returned isn't clearly defined, and "
12451 "depends on both the version of C<tune2fs> that libguestfs was built against, "
12452 "and the filesystem itself."
12456 #: ../src/guestfs-actions.pod:4996
12457 msgid "guestfs_txz_in"
12461 #: ../src/guestfs-actions.pod:4998
12464 " int guestfs_txz_in (guestfs_h *g,\n"
12465 "\t\tconst char *tarball,\n"
12466 "\t\tconst char *directory);\n"
12471 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3886
12473 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
12474 "tar file) into C<directory>."
12478 #: ../src/guestfs-actions.pod:5007
12479 msgid "guestfs_txz_out"
12483 #: ../src/guestfs-actions.pod:5009
12486 " int guestfs_txz_out (guestfs_h *g,\n"
12487 "\t\tconst char *directory,\n"
12488 "\t\tconst char *tarball);\n"
12493 #: ../src/guestfs-actions.pod:5013 ../fish/guestfish-actions.pod:3895
12495 "This command packs the contents of C<directory> and downloads it to local "
12496 "file C<tarball> (as an xz compressed tar archive)."
12500 #: ../src/guestfs-actions.pod:5018
12501 msgid "guestfs_umask"
12505 #: ../src/guestfs-actions.pod:5020
12508 " int guestfs_umask (guestfs_h *g,\n"
12514 #: ../src/guestfs-actions.pod:5023 ../fish/guestfish-actions.pod:3904
12516 "This function sets the mask used for creating new files and device nodes to "
12521 #: ../src/guestfs-actions.pod:5026 ../fish/guestfish-actions.pod:3907
12523 "Typical umask values would be C<022> which creates new files with "
12524 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
12525 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
12529 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3912
12531 "The default umask is C<022>. This is important because it means that "
12532 "directories and device nodes will be created with C<0644> or C<0755> mode "
12533 "even if you specify C<0777>."
12537 #: ../src/guestfs-actions.pod:5035
12539 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
12540 "C<guestfs_mkdir>."
12544 #: ../src/guestfs-actions.pod:5038 ../fish/guestfish-actions.pod:3919
12545 msgid "This call returns the previous umask."
12549 #: ../src/guestfs-actions.pod:5042
12550 msgid "guestfs_umount"
12554 #: ../src/guestfs-actions.pod:5044
12557 " int guestfs_umount (guestfs_h *g,\n"
12558 "\t\tconst char *pathordevice);\n"
12563 #: ../src/guestfs-actions.pod:5047 ../fish/guestfish-actions.pod:3927
12565 "This unmounts the given filesystem. The filesystem may be specified either "
12566 "by its mountpoint (path) or the device which contains the filesystem."
12570 #: ../src/guestfs-actions.pod:5053
12571 msgid "guestfs_umount_all"
12575 #: ../src/guestfs-actions.pod:5055
12578 " int guestfs_umount_all (guestfs_h *g);\n"
12583 #: ../src/guestfs-actions.pod:5057 ../fish/guestfish-actions.pod:3937
12584 msgid "This unmounts all mounted filesystems."
12588 #: ../src/guestfs-actions.pod:5059 ../fish/guestfish-actions.pod:3939
12589 msgid "Some internal mounts are not unmounted by this call."
12593 #: ../src/guestfs-actions.pod:5063
12594 msgid "guestfs_upload"
12598 #: ../src/guestfs-actions.pod:5065
12601 " int guestfs_upload (guestfs_h *g,\n"
12602 "\t\tconst char *filename,\n"
12603 "\t\tconst char *remotefilename);\n"
12608 #: ../src/guestfs-actions.pod:5069 ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3945 ../fish/guestfish-actions.pod:3958
12609 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
12613 #: ../src/guestfs-actions.pod:5074
12614 msgid "See also C<guestfs_download>."
12618 #: ../src/guestfs-actions.pod:5078
12619 msgid "guestfs_upload_offset"
12623 #: ../src/guestfs-actions.pod:5080
12626 " int guestfs_upload_offset (guestfs_h *g,\n"
12627 "\t\tconst char *filename,\n"
12628 "\t\tconst char *remotefilename,\n"
12629 "\t\tint64_t offset);\n"
12634 #: ../src/guestfs-actions.pod:5088 ../fish/guestfish-actions.pod:3961
12636 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
12637 "The intention is to overwrite parts of existing files or devices, although "
12638 "if a non-existant file is specified then it is created with a \"hole\" "
12639 "before C<offset>. The size of the data written is implicit in the size of "
12640 "the source C<filename>."
12644 #: ../src/guestfs-actions.pod:5095
12646 "Note that there is no limit on the amount of data that can be uploaded with "
12647 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
12648 "full amount unless an error occurs."
12652 #: ../src/guestfs-actions.pod:5100
12653 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
12657 #: ../src/guestfs-actions.pod:5104
12658 msgid "guestfs_utimens"
12662 #: ../src/guestfs-actions.pod:5106
12665 " int guestfs_utimens (guestfs_h *g,\n"
12666 "\t\tconst char *path,\n"
12667 "\t\tint64_t atsecs,\n"
12668 "\t\tint64_t atnsecs,\n"
12669 "\t\tint64_t mtsecs,\n"
12670 "\t\tint64_t mtnsecs);\n"
12675 #: ../src/guestfs-actions.pod:5113 ../fish/guestfish-actions.pod:3981
12676 msgid "This command sets the timestamps of a file with nanosecond precision."
12680 #: ../src/guestfs-actions.pod:5116 ../fish/guestfish-actions.pod:3984
12682 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
12687 #: ../src/guestfs-actions.pod:5119 ../fish/guestfish-actions.pod:3987
12689 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
12690 "nanoseconds from the epoch."
12694 #: ../src/guestfs-actions.pod:5122 ../fish/guestfish-actions.pod:3990
12696 "If the C<*nsecs> field contains the special value C<-1> then the "
12697 "corresponding timestamp is set to the current time. (The C<*secs> field is "
12698 "ignored in this case)."
12702 #: ../src/guestfs-actions.pod:5126 ../fish/guestfish-actions.pod:3994
12704 "If the C<*nsecs> field contains the special value C<-2> then the "
12705 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
12710 #: ../src/guestfs-actions.pod:5132 ../src/guestfs-structs.pod:175
12711 msgid "guestfs_version"
12715 #: ../src/guestfs-actions.pod:5134
12718 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
12723 #: ../src/guestfs-actions.pod:5136 ../fish/guestfish-actions.pod:4002
12724 msgid "Return the libguestfs version number that the program is linked against."
12728 #: ../src/guestfs-actions.pod:5139 ../fish/guestfish-actions.pod:4005
12730 "Note that because of dynamic linking this is not necessarily the version of "
12731 "libguestfs that you compiled against. You can compile the program, and then "
12732 "at runtime dynamically link against a completely different C<libguestfs.so> "
12737 #: ../src/guestfs-actions.pod:5144 ../fish/guestfish-actions.pod:4010
12739 "This call was added in version C<1.0.58>. In previous versions of "
12740 "libguestfs there was no way to get the version number. From C code you can "
12741 "use dynamic linker functions to find out if this symbol exists (if it "
12742 "doesn't, then it's an earlier version)."
12746 #: ../src/guestfs-actions.pod:5150 ../fish/guestfish-actions.pod:4016
12748 "The call returns a structure with four elements. The first three (C<major>, "
12749 "C<minor> and C<release>) are numbers and correspond to the usual version "
12750 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
12751 "but may be used for distro-specific information."
12755 #: ../src/guestfs-actions.pod:5156 ../fish/guestfish-actions.pod:4022
12756 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
12760 #: ../src/guestfs-actions.pod:5159 ../fish/guestfish-actions.pod:4025
12761 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
12765 #: ../src/guestfs-actions.pod:5161
12767 "I<Note:> Don't use this call to test for availability of features. In "
12768 "enterprise distributions we backport features from later versions into "
12769 "earlier versions, making this an unreliable way to test for features. Use "
12770 "C<guestfs_available> instead."
12774 #: ../src/guestfs-actions.pod:5167
12776 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
12777 "error. I<The caller must call C<guestfs_free_version> after use>."
12781 #: ../src/guestfs-actions.pod:5171
12782 msgid "guestfs_vfs_label"
12786 #: ../src/guestfs-actions.pod:5173
12789 " char *guestfs_vfs_label (guestfs_h *g,\n"
12790 "\t\tconst char *device);\n"
12795 #: ../src/guestfs-actions.pod:5176 ../fish/guestfish-actions.pod:4037
12796 msgid "This returns the filesystem label of the filesystem on C<device>."
12800 #: ../src/guestfs-actions.pod:5179 ../fish/guestfish-actions.pod:4040
12801 msgid "If the filesystem is unlabeled, this returns the empty string."
12805 #: ../src/guestfs-actions.pod:5181
12806 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
12810 #: ../src/guestfs-actions.pod:5186
12811 msgid "guestfs_vfs_type"
12815 #: ../src/guestfs-actions.pod:5188
12818 " char *guestfs_vfs_type (guestfs_h *g,\n"
12819 "\t\tconst char *device);\n"
12824 #: ../src/guestfs-actions.pod:5191 ../fish/guestfish-actions.pod:4048
12826 "This command gets the filesystem type corresponding to the filesystem on "
12831 #: ../src/guestfs-actions.pod:5194 ../fish/guestfish-actions.pod:4051
12833 "For most filesystems, the result is the name of the Linux VFS module which "
12834 "would be used to mount this filesystem if you mounted it without specifying "
12835 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
12839 #: ../src/guestfs-actions.pod:5202
12840 msgid "guestfs_vfs_uuid"
12844 #: ../src/guestfs-actions.pod:5204
12847 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
12848 "\t\tconst char *device);\n"
12853 #: ../src/guestfs-actions.pod:5207 ../fish/guestfish-actions.pod:4060
12854 msgid "This returns the filesystem UUID of the filesystem on C<device>."
12858 #: ../src/guestfs-actions.pod:5210 ../fish/guestfish-actions.pod:4063
12859 msgid "If the filesystem does not have a UUID, this returns the empty string."
12863 #: ../src/guestfs-actions.pod:5212
12864 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
12868 #: ../src/guestfs-actions.pod:5217
12869 msgid "guestfs_vg_activate"
12873 #: ../src/guestfs-actions.pod:5219
12876 " int guestfs_vg_activate (guestfs_h *g,\n"
12877 "\t\tint activate,\n"
12878 "\t\tchar *const *volgroups);\n"
12883 #: ../src/guestfs-actions.pod:5223 ../fish/guestfish-actions.pod:4071
12885 "This command activates or (if C<activate> is false) deactivates all logical "
12886 "volumes in the listed volume groups C<volgroups>. If activated, then they "
12887 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
12888 "deactivated, then those devices disappear."
12892 #: ../src/guestfs-actions.pod:5229 ../fish/guestfish-actions.pod:4077
12893 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
12897 #: ../src/guestfs-actions.pod:5231 ../fish/guestfish-actions.pod:4079
12899 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
12900 "activated or deactivated."
12904 #: ../src/guestfs-actions.pod:5236
12905 msgid "guestfs_vg_activate_all"
12909 #: ../src/guestfs-actions.pod:5238
12912 " int guestfs_vg_activate_all (guestfs_h *g,\n"
12913 "\t\tint activate);\n"
12918 #: ../src/guestfs-actions.pod:5241 ../fish/guestfish-actions.pod:4086
12920 "This command activates or (if C<activate> is false) deactivates all logical "
12921 "volumes in all volume groups. If activated, then they are made known to the "
12922 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
12923 "those devices disappear."
12927 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:4092
12928 msgid "This command is the same as running C<vgchange -a y|n>"
12932 #: ../src/guestfs-actions.pod:5251
12933 msgid "guestfs_vgcreate"
12937 #: ../src/guestfs-actions.pod:5253
12940 " int guestfs_vgcreate (guestfs_h *g,\n"
12941 "\t\tconst char *volgroup,\n"
12942 "\t\tchar *const *physvols);\n"
12947 #: ../src/guestfs-actions.pod:5257 ../fish/guestfish-actions.pod:4098
12949 "This creates an LVM volume group called C<volgroup> from the non-empty list "
12950 "of physical volumes C<physvols>."
12954 #: ../src/guestfs-actions.pod:5262
12955 msgid "guestfs_vglvuuids"
12959 #: ../src/guestfs-actions.pod:5264
12962 " char **guestfs_vglvuuids (guestfs_h *g,\n"
12963 "\t\tconst char *vgname);\n"
12968 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:4105
12970 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
12971 "volumes created in this volume group."
12975 #: ../src/guestfs-actions.pod:5270
12977 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
12978 "associate logical volumes and volume groups."
12982 #: ../src/guestfs-actions.pod:5273
12983 msgid "See also C<guestfs_vgpvuuids>."
12987 #: ../src/guestfs-actions.pod:5279
12988 msgid "guestfs_vgpvuuids"
12992 #: ../src/guestfs-actions.pod:5281
12995 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
12996 "\t\tconst char *vgname);\n"
13001 #: ../src/guestfs-actions.pod:5284 ../fish/guestfish-actions.pod:4117
13003 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13004 "volumes that this volume group resides on."
13008 #: ../src/guestfs-actions.pod:5287
13010 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13011 "associate physical volumes and volume groups."
13015 #: ../src/guestfs-actions.pod:5290
13016 msgid "See also C<guestfs_vglvuuids>."
13020 #: ../src/guestfs-actions.pod:5296
13021 msgid "guestfs_vgremove"
13025 #: ../src/guestfs-actions.pod:5298
13028 " int guestfs_vgremove (guestfs_h *g,\n"
13029 "\t\tconst char *vgname);\n"
13034 #: ../src/guestfs-actions.pod:5301 ../fish/guestfish-actions.pod:4129
13035 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13039 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:4131
13040 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
13044 #: ../src/guestfs-actions.pod:5308
13045 msgid "guestfs_vgrename"
13049 #: ../src/guestfs-actions.pod:5310
13052 " int guestfs_vgrename (guestfs_h *g,\n"
13053 "\t\tconst char *volgroup,\n"
13054 "\t\tconst char *newvolgroup);\n"
13059 #: ../src/guestfs-actions.pod:5314 ../fish/guestfish-actions.pod:4138
13060 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
13064 #: ../src/guestfs-actions.pod:5318
13065 msgid "guestfs_vgs"
13069 #: ../src/guestfs-actions.pod:5320
13072 " char **guestfs_vgs (guestfs_h *g);\n"
13077 #: ../src/guestfs-actions.pod:5322 ../fish/guestfish-actions.pod:4144
13079 "List all the volumes groups detected. This is the equivalent of the "
13080 "L<vgs(8)> command."
13084 #: ../src/guestfs-actions.pod:5325 ../fish/guestfish-actions.pod:4147
13086 "This returns a list of just the volume group names that were detected "
13087 "(eg. C<VolGroup00>)."
13091 #: ../src/guestfs-actions.pod:5328
13092 msgid "See also C<guestfs_vgs_full>."
13096 #: ../src/guestfs-actions.pod:5334
13097 msgid "guestfs_vgs_full"
13101 #: ../src/guestfs-actions.pod:5336
13104 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13109 #: ../src/guestfs-actions.pod:5338 ../fish/guestfish-actions.pod:4156
13111 "List all the volumes groups detected. This is the equivalent of the "
13112 "L<vgs(8)> command. The \"full\" version includes all fields."
13116 #: ../src/guestfs-actions.pod:5341
13118 "This function returns a C<struct guestfs_lvm_vg_list *> (see "
13119 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
13120 "must call C<guestfs_free_lvm_vg_list> after use>."
13124 #: ../src/guestfs-actions.pod:5346
13125 msgid "guestfs_vgscan"
13129 #: ../src/guestfs-actions.pod:5348
13132 " int guestfs_vgscan (guestfs_h *g);\n"
13137 #: ../src/guestfs-actions.pod:5350 ../fish/guestfish-actions.pod:4163
13139 "This rescans all block devices and rebuilds the list of LVM physical "
13140 "volumes, volume groups and logical volumes."
13144 #: ../src/guestfs-actions.pod:5355
13145 msgid "guestfs_vguuid"
13149 #: ../src/guestfs-actions.pod:5357
13152 " char *guestfs_vguuid (guestfs_h *g,\n"
13153 "\t\tconst char *vgname);\n"
13158 #: ../src/guestfs-actions.pod:5360 ../fish/guestfish-actions.pod:4170
13159 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13163 #: ../src/guestfs-actions.pod:5365
13164 msgid "guestfs_wait_ready"
13168 #: ../src/guestfs-actions.pod:5367
13171 " int guestfs_wait_ready (guestfs_h *g);\n"
13176 #: ../src/guestfs-actions.pod:5369
13177 msgid "This function is a no op."
13181 #: ../src/guestfs-actions.pod:5371
13183 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13184 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13185 "is no longer necessary because C<guestfs_launch> now does the waiting."
13189 #: ../src/guestfs-actions.pod:5376
13191 "If you see any calls to this function in code then you can just remove them, "
13192 "unless you want to retain compatibility with older versions of the API."
13196 #: ../src/guestfs-actions.pod:5382
13197 msgid "guestfs_wc_c"
13201 #: ../src/guestfs-actions.pod:5384
13204 " int guestfs_wc_c (guestfs_h *g,\n"
13205 "\t\tconst char *path);\n"
13210 #: ../src/guestfs-actions.pod:5387 ../fish/guestfish-actions.pod:4176
13212 "This command counts the characters in a file, using the C<wc -c> external "
13217 #: ../src/guestfs-actions.pod:5392
13218 msgid "guestfs_wc_l"
13222 #: ../src/guestfs-actions.pod:5394
13225 " int guestfs_wc_l (guestfs_h *g,\n"
13226 "\t\tconst char *path);\n"
13231 #: ../src/guestfs-actions.pod:5397 ../fish/guestfish-actions.pod:4183
13233 "This command counts the lines in a file, using the C<wc -l> external "
13238 #: ../src/guestfs-actions.pod:5402
13239 msgid "guestfs_wc_w"
13243 #: ../src/guestfs-actions.pod:5404
13246 " int guestfs_wc_w (guestfs_h *g,\n"
13247 "\t\tconst char *path);\n"
13252 #: ../src/guestfs-actions.pod:5407 ../fish/guestfish-actions.pod:4190
13254 "This command counts the words in a file, using the C<wc -w> external "
13259 #: ../src/guestfs-actions.pod:5412
13260 msgid "guestfs_write"
13264 #: ../src/guestfs-actions.pod:5414
13267 " int guestfs_write (guestfs_h *g,\n"
13268 "\t\tconst char *path,\n"
13269 "\t\tconst char *content,\n"
13270 "\t\tsize_t content_size);\n"
13275 #: ../src/guestfs-actions.pod:5419 ../fish/guestfish-actions.pod:4197
13277 "This call creates a file called C<path>. The content of the file is the "
13278 "string C<content> (which can contain any 8 bit data)."
13282 #: ../src/guestfs-actions.pod:5427
13283 msgid "guestfs_write_file"
13287 #: ../src/guestfs-actions.pod:5429
13290 " int guestfs_write_file (guestfs_h *g,\n"
13291 "\t\tconst char *path,\n"
13292 "\t\tconst char *content,\n"
13298 #: ../src/guestfs-actions.pod:5434 ../fish/guestfish-actions.pod:4207
13300 "This call creates a file called C<path>. The contents of the file is the "
13301 "string C<content> (which can contain any 8 bit data), with length C<size>."
13305 #: ../src/guestfs-actions.pod:5438 ../fish/guestfish-actions.pod:4211
13307 "As a special case, if C<size> is C<0> then the length is calculated using "
13308 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13312 #: ../src/guestfs-actions.pod:5442 ../fish/guestfish-actions.pod:4215
13314 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13315 "I<not> work, even if the length is specified."
13319 #: ../src/guestfs-actions.pod:5450 ../fish/guestfish-actions.pod:4221
13320 msgid "This function is deprecated. In new code, use the C<write> call instead."
13324 #: ../src/guestfs-actions.pod:5457
13325 msgid "guestfs_zegrep"
13329 #: ../src/guestfs-actions.pod:5459
13332 " char **guestfs_zegrep (guestfs_h *g,\n"
13333 "\t\tconst char *regex,\n"
13334 "\t\tconst char *path);\n"
13339 #: ../src/guestfs-actions.pod:5463 ../fish/guestfish-actions.pod:4232
13340 msgid "This calls the external C<zegrep> program and returns the matching lines."
13344 #: ../src/guestfs-actions.pod:5473
13345 msgid "guestfs_zegrepi"
13349 #: ../src/guestfs-actions.pod:5475
13352 " char **guestfs_zegrepi (guestfs_h *g,\n"
13353 "\t\tconst char *regex,\n"
13354 "\t\tconst char *path);\n"
13359 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:4242
13360 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
13364 #: ../src/guestfs-actions.pod:5489
13365 msgid "guestfs_zero"
13369 #: ../src/guestfs-actions.pod:5491
13372 " int guestfs_zero (guestfs_h *g,\n"
13373 "\t\tconst char *device);\n"
13378 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:4252
13379 msgid "This command writes zeroes over the first few blocks of C<device>."
13383 #: ../src/guestfs-actions.pod:5496 ../fish/guestfish-actions.pod:4254
13385 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13386 "securely wipe the device). It should be sufficient to remove any partition "
13387 "tables, filesystem superblocks and so on."
13391 #: ../src/guestfs-actions.pod:5500
13392 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13396 #: ../src/guestfs-actions.pod:5509
13397 msgid "guestfs_zero_device"
13401 #: ../src/guestfs-actions.pod:5511
13404 " int guestfs_zero_device (guestfs_h *g,\n"
13405 "\t\tconst char *device);\n"
13410 #: ../src/guestfs-actions.pod:5514
13412 "This command writes zeroes over the entire C<device>. Compare with "
13413 "C<guestfs_zero> which just zeroes the first few blocks of a device."
13417 #: ../src/guestfs-actions.pod:5528
13418 msgid "guestfs_zerofree"
13422 #: ../src/guestfs-actions.pod:5530
13425 " int guestfs_zerofree (guestfs_h *g,\n"
13426 "\t\tconst char *device);\n"
13431 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:4275
13433 "This runs the I<zerofree> program on C<device>. This program claims to zero "
13434 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
13435 "possible to compress the filesystem more effectively."
13439 #: ../src/guestfs-actions.pod:5538 ../fish/guestfish-actions.pod:4280
13440 msgid "You should B<not> run this program if the filesystem is mounted."
13444 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:4283
13446 "It is possible that using this program can damage the filesystem or data on "
13451 #: ../src/guestfs-actions.pod:5546
13452 msgid "guestfs_zfgrep"
13456 #: ../src/guestfs-actions.pod:5548
13459 " char **guestfs_zfgrep (guestfs_h *g,\n"
13460 "\t\tconst char *pattern,\n"
13461 "\t\tconst char *path);\n"
13466 #: ../src/guestfs-actions.pod:5552 ../fish/guestfish-actions.pod:4290
13467 msgid "This calls the external C<zfgrep> program and returns the matching lines."
13471 #: ../src/guestfs-actions.pod:5562
13472 msgid "guestfs_zfgrepi"
13476 #: ../src/guestfs-actions.pod:5564
13479 " char **guestfs_zfgrepi (guestfs_h *g,\n"
13480 "\t\tconst char *pattern,\n"
13481 "\t\tconst char *path);\n"
13486 #: ../src/guestfs-actions.pod:5568 ../fish/guestfish-actions.pod:4300
13487 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
13491 #: ../src/guestfs-actions.pod:5578
13492 msgid "guestfs_zfile"
13496 #: ../src/guestfs-actions.pod:5580
13499 " char *guestfs_zfile (guestfs_h *g,\n"
13500 "\t\tconst char *meth,\n"
13501 "\t\tconst char *path);\n"
13506 #: ../src/guestfs-actions.pod:5584 ../fish/guestfish-actions.pod:4310
13507 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
13511 #: ../src/guestfs-actions.pod:5587 ../fish/guestfish-actions.pod:4313
13512 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
13516 #: ../src/guestfs-actions.pod:5589
13518 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
13523 #: ../src/guestfs-actions.pod:5595 ../fish/guestfish-actions.pod:4318
13524 msgid "This function is deprecated. In new code, use the C<file> call instead."
13528 #: ../src/guestfs-actions.pod:5602
13529 msgid "guestfs_zgrep"
13533 #: ../src/guestfs-actions.pod:5604
13536 " char **guestfs_zgrep (guestfs_h *g,\n"
13537 "\t\tconst char *regex,\n"
13538 "\t\tconst char *path);\n"
13543 #: ../src/guestfs-actions.pod:5608 ../fish/guestfish-actions.pod:4329
13544 msgid "This calls the external C<zgrep> program and returns the matching lines."
13548 #: ../src/guestfs-actions.pod:5618
13549 msgid "guestfs_zgrepi"
13553 #: ../src/guestfs-actions.pod:5620
13556 " char **guestfs_zgrepi (guestfs_h *g,\n"
13557 "\t\tconst char *regex,\n"
13558 "\t\tconst char *path);\n"
13563 #: ../src/guestfs-actions.pod:5624 ../fish/guestfish-actions.pod:4339
13564 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
13568 #: ../src/guestfs-availability.pod:3
13573 #: ../src/guestfs-availability.pod:5
13575 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
13576 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
13577 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
13578 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
13579 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
13583 #: ../src/guestfs-availability.pod:21
13588 #: ../src/guestfs-availability.pod:23
13590 "The following functions: L</guestfs_inotify_add_watch> "
13591 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
13592 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
13596 #: ../src/guestfs-availability.pod:31
13597 msgid "B<linuxfsuuid>"
13601 #: ../src/guestfs-availability.pod:33
13603 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
13604 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
13608 #: ../src/guestfs-availability.pod:40
13609 msgid "B<linuxmodules>"
13613 #: ../src/guestfs-availability.pod:42
13614 msgid "The following functions: L</guestfs_modprobe>"
13618 #: ../src/guestfs-availability.pod:45
13619 msgid "B<linuxxattrs>"
13623 #: ../src/guestfs-availability.pod:47
13625 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> "
13626 "L</guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> "
13627 "L</guestfs_removexattr> L</guestfs_setxattr>"
13631 #: ../src/guestfs-availability.pod:56
13636 #: ../src/guestfs-availability.pod:58
13638 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
13639 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
13640 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
13644 #: ../src/guestfs-availability.pod:67
13649 #: ../src/guestfs-availability.pod:69
13651 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
13652 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
13653 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
13654 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
13655 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
13656 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
13657 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
13658 "L</guestfs_vgs_full>"
13662 #: ../src/guestfs-availability.pod:92
13667 #: ../src/guestfs-availability.pod:94
13669 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
13670 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
13674 #: ../src/guestfs-availability.pod:100
13679 #: ../src/guestfs-availability.pod:102
13680 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
13684 #: ../src/guestfs-availability.pod:105
13685 msgid "B<ntfsprogs>"
13689 #: ../src/guestfs-availability.pod:107
13690 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
13694 #: ../src/guestfs-availability.pod:111
13695 msgid "B<realpath>"
13699 #: ../src/guestfs-availability.pod:113
13700 msgid "The following functions: L</guestfs_realpath>"
13704 #: ../src/guestfs-availability.pod:116
13709 #: ../src/guestfs-availability.pod:118
13711 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
13712 "L</guestfs_scrub_freespace>"
13716 #: ../src/guestfs-availability.pod:123
13721 #: ../src/guestfs-availability.pod:125
13722 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
13726 #: ../src/guestfs-availability.pod:129
13731 #: ../src/guestfs-availability.pod:131
13732 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
13736 #: ../src/guestfs-availability.pod:135
13737 msgid "B<zerofree>"
13741 #: ../src/guestfs-availability.pod:137
13742 msgid "The following functions: L</guestfs_zerofree>"
13746 #: ../src/guestfs-structs.pod:1
13747 msgid "guestfs_int_bool"
13751 #: ../src/guestfs-structs.pod:3
13754 " struct guestfs_int_bool {\n"
13762 #: ../src/guestfs-structs.pod:8
13765 " struct guestfs_int_bool_list {\n"
13766 " uint32_t len; /* Number of elements in list. */\n"
13767 " struct guestfs_int_bool *val; /* Elements. */\n"
13773 #: ../src/guestfs-structs.pod:13
13776 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
13777 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
13782 #: ../src/guestfs-structs.pod:16
13783 msgid "guestfs_lvm_pv"
13787 #: ../src/guestfs-structs.pod:18
13790 " struct guestfs_lvm_pv {\n"
13791 " char *pv_name;\n"
13792 " /* The next field is NOT nul-terminated, be careful when printing it: "
13794 " char pv_uuid[32];\n"
13796 " uint64_t pv_size;\n"
13797 " uint64_t dev_size;\n"
13798 " uint64_t pv_free;\n"
13799 " uint64_t pv_used;\n"
13800 " char *pv_attr;\n"
13801 " int64_t pv_pe_count;\n"
13802 " int64_t pv_pe_alloc_count;\n"
13803 " char *pv_tags;\n"
13804 " uint64_t pe_start;\n"
13805 " int64_t pv_mda_count;\n"
13806 " uint64_t pv_mda_free;\n"
13812 #: ../src/guestfs-structs.pod:36
13815 " struct guestfs_lvm_pv_list {\n"
13816 " uint32_t len; /* Number of elements in list. */\n"
13817 " struct guestfs_lvm_pv *val; /* Elements. */\n"
13823 #: ../src/guestfs-structs.pod:41
13826 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
13827 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
13832 #: ../src/guestfs-structs.pod:44
13833 msgid "guestfs_lvm_vg"
13837 #: ../src/guestfs-structs.pod:46
13840 " struct guestfs_lvm_vg {\n"
13841 " char *vg_name;\n"
13842 " /* The next field is NOT nul-terminated, be careful when printing it: "
13844 " char vg_uuid[32];\n"
13846 " char *vg_attr;\n"
13847 " uint64_t vg_size;\n"
13848 " uint64_t vg_free;\n"
13849 " char *vg_sysid;\n"
13850 " uint64_t vg_extent_size;\n"
13851 " int64_t vg_extent_count;\n"
13852 " int64_t vg_free_count;\n"
13853 " int64_t max_lv;\n"
13854 " int64_t max_pv;\n"
13855 " int64_t pv_count;\n"
13856 " int64_t lv_count;\n"
13857 " int64_t snap_count;\n"
13858 " int64_t vg_seqno;\n"
13859 " char *vg_tags;\n"
13860 " int64_t vg_mda_count;\n"
13861 " uint64_t vg_mda_free;\n"
13867 #: ../src/guestfs-structs.pod:69
13870 " struct guestfs_lvm_vg_list {\n"
13871 " uint32_t len; /* Number of elements in list. */\n"
13872 " struct guestfs_lvm_vg *val; /* Elements. */\n"
13878 #: ../src/guestfs-structs.pod:74
13881 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
13882 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
13887 #: ../src/guestfs-structs.pod:77
13888 msgid "guestfs_lvm_lv"
13892 #: ../src/guestfs-structs.pod:79
13895 " struct guestfs_lvm_lv {\n"
13896 " char *lv_name;\n"
13897 " /* The next field is NOT nul-terminated, be careful when printing it: "
13899 " char lv_uuid[32];\n"
13900 " char *lv_attr;\n"
13901 " int64_t lv_major;\n"
13902 " int64_t lv_minor;\n"
13903 " int64_t lv_kernel_major;\n"
13904 " int64_t lv_kernel_minor;\n"
13905 " uint64_t lv_size;\n"
13906 " int64_t seg_count;\n"
13908 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
13909 " float snap_percent;\n"
13910 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
13911 " float copy_percent;\n"
13912 " char *move_pv;\n"
13913 " char *lv_tags;\n"
13914 " char *mirror_log;\n"
13915 " char *modules;\n"
13921 #: ../src/guestfs-structs.pod:101
13924 " struct guestfs_lvm_lv_list {\n"
13925 " uint32_t len; /* Number of elements in list. */\n"
13926 " struct guestfs_lvm_lv *val; /* Elements. */\n"
13932 #: ../src/guestfs-structs.pod:106
13935 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
13936 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
13941 #: ../src/guestfs-structs.pod:111
13944 " struct guestfs_stat {\n"
13948 " int64_t nlink;\n"
13953 " int64_t blksize;\n"
13954 " int64_t blocks;\n"
13955 " int64_t atime;\n"
13956 " int64_t mtime;\n"
13957 " int64_t ctime;\n"
13963 #: ../src/guestfs-structs.pod:127
13966 " struct guestfs_stat_list {\n"
13967 " uint32_t len; /* Number of elements in list. */\n"
13968 " struct guestfs_stat *val; /* Elements. */\n"
13974 #: ../src/guestfs-structs.pod:132
13977 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
13978 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
13983 #: ../src/guestfs-structs.pod:137
13986 " struct guestfs_statvfs {\n"
13987 " int64_t bsize;\n"
13988 " int64_t frsize;\n"
13989 " int64_t blocks;\n"
13990 " int64_t bfree;\n"
13991 " int64_t bavail;\n"
13992 " int64_t files;\n"
13993 " int64_t ffree;\n"
13994 " int64_t favail;\n"
13997 " int64_t namemax;\n"
14003 #: ../src/guestfs-structs.pod:151
14006 " struct guestfs_statvfs_list {\n"
14007 " uint32_t len; /* Number of elements in list. */\n"
14008 " struct guestfs_statvfs *val; /* Elements. */\n"
14014 #: ../src/guestfs-structs.pod:156
14017 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14018 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14023 #: ../src/guestfs-structs.pod:159
14024 msgid "guestfs_dirent"
14028 #: ../src/guestfs-structs.pod:161
14031 " struct guestfs_dirent {\n"
14040 #: ../src/guestfs-structs.pod:167
14043 " struct guestfs_dirent_list {\n"
14044 " uint32_t len; /* Number of elements in list. */\n"
14045 " struct guestfs_dirent *val; /* Elements. */\n"
14051 #: ../src/guestfs-structs.pod:172
14054 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
14055 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
14060 #: ../src/guestfs-structs.pod:177
14063 " struct guestfs_version {\n"
14064 " int64_t major;\n"
14065 " int64_t minor;\n"
14066 " int64_t release;\n"
14073 #: ../src/guestfs-structs.pod:184
14076 " struct guestfs_version_list {\n"
14077 " uint32_t len; /* Number of elements in list. */\n"
14078 " struct guestfs_version *val; /* Elements. */\n"
14084 #: ../src/guestfs-structs.pod:189
14087 " void guestfs_free_version (struct guestfs_free_version *);\n"
14088 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14093 #: ../src/guestfs-structs.pod:192
14094 msgid "guestfs_xattr"
14098 #: ../src/guestfs-structs.pod:194
14101 " struct guestfs_xattr {\n"
14102 " char *attrname;\n"
14103 " /* The next two fields describe a byte array. */\n"
14104 " uint32_t attrval_len;\n"
14105 " char *attrval;\n"
14111 #: ../src/guestfs-structs.pod:201
14114 " struct guestfs_xattr_list {\n"
14115 " uint32_t len; /* Number of elements in list. */\n"
14116 " struct guestfs_xattr *val; /* Elements. */\n"
14122 #: ../src/guestfs-structs.pod:206
14125 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14126 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14131 #: ../src/guestfs-structs.pod:209
14132 msgid "guestfs_inotify_event"
14136 #: ../src/guestfs-structs.pod:211
14139 " struct guestfs_inotify_event {\n"
14140 " int64_t in_wd;\n"
14141 " uint32_t in_mask;\n"
14142 " uint32_t in_cookie;\n"
14143 " char *in_name;\n"
14149 #: ../src/guestfs-structs.pod:218
14152 " struct guestfs_inotify_event_list {\n"
14153 " uint32_t len; /* Number of elements in list. */\n"
14154 " struct guestfs_inotify_event *val; /* Elements. */\n"
14160 #: ../src/guestfs-structs.pod:223
14163 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14164 " void guestfs_free_inotify_event_list (struct "
14165 "guestfs_free_inotify_event_list *);\n"
14170 #: ../src/guestfs-structs.pod:226
14171 msgid "guestfs_partition"
14175 #: ../src/guestfs-structs.pod:228
14178 " struct guestfs_partition {\n"
14179 " int32_t part_num;\n"
14180 " uint64_t part_start;\n"
14181 " uint64_t part_end;\n"
14182 " uint64_t part_size;\n"
14188 #: ../src/guestfs-structs.pod:235
14191 " struct guestfs_partition_list {\n"
14192 " uint32_t len; /* Number of elements in list. */\n"
14193 " struct guestfs_partition *val; /* Elements. */\n"
14199 #: ../src/guestfs-structs.pod:240
14202 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14203 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14208 #: ../fish/guestfish.pod:5
14209 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14213 #: ../fish/guestfish.pod:9
14216 " guestfish [--options] [commands]\n"
14221 #: ../fish/guestfish.pod:11
14229 #: ../fish/guestfish.pod:13
14232 " guestfish -a disk.img\n"
14237 #: ../fish/guestfish.pod:15
14240 " guestfish -a disk.img -m dev[:mountpoint]\n"
14245 #: ../fish/guestfish.pod:17
14248 " guestfish -d libvirt-domain\n"
14253 #: ../fish/guestfish.pod:19
14256 " guestfish -a disk.img -i\n"
14261 #: ../fish/guestfish.pod:21
14264 " guestfish -d libvirt-domain -i\n"
14269 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:11 ../tools/virt-edit.pl:45 ../tools/virt-rescue.pl:41 ../tools/virt-tar.pl:60 ../tools/virt-win-reg.pl:52
14274 #: ../fish/guestfish.pod:25
14276 "Using guestfish in read/write mode on live virtual machines can be "
14277 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14278 "option to use guestfish safely if the disk image or virtual machine might be "
14283 #: ../fish/guestfish.pod:30 ../fish/guestfish.pod:736 ../fuse/guestmount.pod:35 ../tools/virt-cat.pl:51 ../tools/virt-edit.pl:59 ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:46
14288 #: ../fish/guestfish.pod:32
14289 msgid "As an interactive shell"
14293 #: ../fish/guestfish.pod:34
14301 #: ../fish/guestfish.pod:36
14304 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14305 " editing virtual machine filesystems.\n"
14310 #: ../fish/guestfish.pod:39
14313 " Type: 'help' for a list of commands\n"
14314 " 'man' to read the manual\n"
14315 " 'quit' to quit the shell\n"
14320 #: ../fish/guestfish.pod:43
14328 #: ../fish/guestfish.pod:45
14329 msgid "From shell scripts"
14333 #: ../fish/guestfish.pod:47
14334 msgid "Create a new C</etc/motd> file in a guest:"
14338 #: ../fish/guestfish.pod:49
14341 " guestfish <<_EOF_\n"
14344 " mount /dev/vg_guest/lv_root /\n"
14345 " write /etc/motd \"Welcome, new users\"\n"
14351 #: ../fish/guestfish.pod:56
14352 msgid "List the LVM logical volumes in a guest:"
14356 #: ../fish/guestfish.pod:58
14359 " guestfish -a disk.img --ro <<_EOF_\n"
14367 #: ../fish/guestfish.pod:63
14368 msgid "On one command line"
14372 #: ../fish/guestfish.pod:65
14373 msgid "Update C</etc/resolv.conf> in a guest:"
14377 #: ../fish/guestfish.pod:67
14381 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
14382 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
14387 #: ../fish/guestfish.pod:71
14388 msgid "Edit C</boot/grub/grub.conf> interactively:"
14392 #: ../fish/guestfish.pod:73
14395 " guestfish --add disk.img \\\n"
14396 " --mount /dev/vg_guest/lv_root \\\n"
14397 " --mount /dev/sda1:/boot \\\n"
14398 " edit /boot/grub/grub.conf\n"
14403 #: ../fish/guestfish.pod:78
14404 msgid "Mount disks automatically"
14408 #: ../fish/guestfish.pod:80
14410 "Use the I<-i> option to automatically mount the disks from a virtual "
14415 #: ../fish/guestfish.pod:83
14418 " guestfish --ro -a disk.img -i cat /etc/group\n"
14423 #: ../fish/guestfish.pod:85
14426 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
14431 #: ../fish/guestfish.pod:87
14432 msgid "As a script interpreter"
14436 #: ../fish/guestfish.pod:89
14437 msgid "Create a 100MB disk containing an ext2-formatted partition:"
14441 #: ../fish/guestfish.pod:91
14444 " #!/usr/bin/guestfish -f\n"
14445 " sparse test1.img 100M\n"
14447 " part-disk /dev/sda mbr\n"
14448 " mkfs ext2 /dev/sda1\n"
14453 #: ../fish/guestfish.pod:97
14454 msgid "Start with a prepared disk"
14458 #: ../fish/guestfish.pod:99
14460 "An alternate way to create a 100MB disk called C<test1.img> containing a "
14461 "single ext2-formatted partition:"
14465 #: ../fish/guestfish.pod:102
14468 " guestfish -N fs\n"
14473 #: ../fish/guestfish.pod:104
14474 msgid "To list what is available do:"
14478 #: ../fish/guestfish.pod:106 ../fish/guestfish.pod:727
14481 " guestfish -N help | less\n"
14486 #: ../fish/guestfish.pod:108
14487 msgid "Remote control"
14491 #: ../fish/guestfish.pod:110
14494 " eval `guestfish --listen --ro`\n"
14495 " guestfish --remote add disk.img\n"
14496 " guestfish --remote run\n"
14497 " guestfish --remote lvs\n"
14502 #: ../fish/guestfish.pod:117
14504 "Guestfish is a shell and command-line tool for examining and modifying "
14505 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14506 "functionality of the guestfs API, see L<guestfs(3)>."
14510 #: ../fish/guestfish.pod:121
14512 "Guestfish gives you structured access to the libguestfs API, from shell "
14513 "scripts or the command line or interactively. If you want to rescue a "
14514 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14519 #: ../fish/guestfish.pod:126 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:70 ../inspector/virt-inspector.pl:75 ../tools/virt-cat.pl:80 ../tools/virt-df.pl:71 ../tools/virt-edit.pl:73 ../tools/virt-list-filesystems.pl:50 ../tools/virt-list-partitions.pl:51 ../tools/virt-ls.pl:79 ../tools/virt-make-fs.pl:153 ../tools/virt-rescue.pl:103 ../tools/virt-resize.pl:233 ../tools/virt-tar.pl:99 ../tools/virt-win-reg.pl:172
14524 #: ../fish/guestfish.pod:130 ../fuse/guestmount.pod:94 ../inspector/virt-inspector.pl:83 ../tools/virt-cat.pl:88 ../tools/virt-df.pl:79 ../tools/virt-edit.pl:81 ../tools/virt-list-filesystems.pl:58 ../tools/virt-list-partitions.pl:59 ../tools/virt-ls.pl:87 ../tools/virt-make-fs.pl:161 ../tools/virt-rescue.pl:111 ../tools/virt-resize.pl:241 ../tools/virt-tar.pl:107 ../tools/virt-win-reg.pl:180
14529 #: ../fish/guestfish.pod:132
14530 msgid "Displays general help on options."
14534 #: ../fish/guestfish.pod:134
14535 msgid "B<-h> | B<--cmd-help>"
14539 #: ../fish/guestfish.pod:136
14540 msgid "Lists all available guestfish commands."
14544 #: ../fish/guestfish.pod:138
14545 msgid "B<-h cmd> | B<--cmd-help cmd>"
14549 #: ../fish/guestfish.pod:140
14550 msgid "Displays detailed help on a single command C<cmd>."
14554 #: ../fish/guestfish.pod:142 ../fuse/guestmount.pod:74
14555 msgid "B<-a image> | B<--add image>"
14559 #: ../fish/guestfish.pod:144
14560 msgid "Add a block device or virtual machine image to the shell."
14564 #: ../fish/guestfish.pod:146
14565 msgid "B<-c URI> | B<--connect URI>"
14569 #: ../fish/guestfish.pod:148
14571 "When used in conjunction with the I<-d> option, this specifies the libvirt "
14572 "URI to use. The default is to use the default libvirt connection."
14576 #: ../fish/guestfish.pod:152
14577 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
14581 #: ../fish/guestfish.pod:154
14583 "Add disks from the named libvirt domain. If the I<--ro> option is also "
14584 "used, then any libvirt domain can be used. However in write mode, only "
14585 "libvirt domains which are shut down can be named here."
14589 #: ../fish/guestfish.pod:158
14590 msgid "B<-D> | B<--no-dest-paths>"
14594 #: ../fish/guestfish.pod:160
14596 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
14597 "to hit the tab key to complete paths on the guest filesystem, but this "
14598 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
14599 "allow this feature to be disabled."
14603 #: ../fish/guestfish.pod:165
14604 msgid "B<--echo-keys>"
14608 #: ../fish/guestfish.pod:167
14610 "When prompting for keys and passphrases, guestfish normally turns echoing "
14611 "off so you cannot see what you are typing. If you are not worried about "
14612 "Tempest attacks and there is no one else in the room you can specify this "
14613 "flag to see what you are typing."
14617 #: ../fish/guestfish.pod:172
14618 msgid "B<-f file> | B<--file file>"
14622 #: ../fish/guestfish.pod:174
14623 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
14627 #: ../fish/guestfish.pod:177
14630 " #!/usr/bin/guestfish -f\n"
14635 #: ../fish/guestfish.pod:179
14636 msgid "B<-i> | B<--inspector>"
14640 #: ../fish/guestfish.pod:181
14642 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
14643 "system and mount filesystems as they would be mounted on the real virtual "
14648 #: ../fish/guestfish.pod:185
14649 msgid "Typical usage is either:"
14653 #: ../fish/guestfish.pod:187
14656 " guestfish -d myguest -i\n"
14661 #: ../fish/guestfish.pod:189
14662 msgid "(for an inactive libvirt domain called I<myguest>), or:"
14666 #: ../fish/guestfish.pod:191
14669 " guestfish --ro -d myguest -i\n"
14674 #: ../fish/guestfish.pod:193
14675 msgid "(for active domains, readonly), or specify the block device directly:"
14679 #: ../fish/guestfish.pod:195
14682 " guestfish -a /dev/Guests/MyGuest -i\n"
14687 #: ../fish/guestfish.pod:197
14689 "Note that the command line syntax changed slightly over older versions of "
14690 "guestfish. You can still use the old syntax:"
14694 #: ../fish/guestfish.pod:200
14697 " guestfish [--ro] -i disk.img\n"
14702 #: ../fish/guestfish.pod:202
14705 " guestfish [--ro] -i libvirt-domain\n"
14710 #: ../fish/guestfish.pod:204
14711 msgid "B<--keys-from-stdin>"
14715 #: ../fish/guestfish.pod:206
14717 "Read key or passphrase parameters from stdin. The default is to try to read "
14718 "passphrases from the user by opening C</dev/tty>."
14722 #: ../fish/guestfish.pod:209
14723 msgid "B<--listen>"
14727 #: ../fish/guestfish.pod:211
14729 "Fork into the background and listen for remote commands. See section "
14730 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
14734 #: ../fish/guestfish.pod:214
14735 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
14739 #: ../fish/guestfish.pod:216
14740 msgid "Mount the named partition or logical volume on the given mountpoint."
14744 #: ../fish/guestfish.pod:218
14745 msgid "If the mountpoint is omitted, it defaults to C</>."
14749 #: ../fish/guestfish.pod:220
14750 msgid "You have to mount something on C</> before most commands will work."
14754 #: ../fish/guestfish.pod:222
14756 "If any I<-m> or I<--mount> options are given, the guest is automatically "
14761 #: ../fish/guestfish.pod:225
14763 "If you don't know what filesystems a disk image contains, you can either run "
14764 "guestfish without this option, then list the partitions and LVs available "
14765 "(see L</list-partitions> and L</lvs> commands), or you can use the "
14766 "L<virt-list-filesystems(1)> program."
14770 #: ../fish/guestfish.pod:230 ../fuse/guestmount.pod:106
14771 msgid "B<-n> | B<--no-sync>"
14775 #: ../fish/guestfish.pod:232
14777 "Disable autosync. This is enabled by default. See the discussion of "
14778 "autosync in the L<guestfs(3)> manpage."
14782 #: ../fish/guestfish.pod:235
14783 msgid "B<-N type> | B<--new type> | B<-N help>"
14787 #: ../fish/guestfish.pod:237
14789 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
14790 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
14791 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
14796 #: ../fish/guestfish.pod:242
14797 msgid "B<--progress-bars>"
14801 #: ../fish/guestfish.pod:244
14802 msgid "Enable progress bars, even when guestfish is used non-interactively."
14806 #: ../fish/guestfish.pod:246
14808 "Progress bars are enabled by default when guestfish is used as an "
14809 "interactive shell."
14813 #: ../fish/guestfish.pod:249
14814 msgid "B<--no-progress-bars>"
14818 #: ../fish/guestfish.pod:251
14819 msgid "Disable progress bars."
14823 #: ../fish/guestfish.pod:253
14824 msgid "B<--remote[=pid]>"
14828 #: ../fish/guestfish.pod:255
14830 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
14831 "CONTROL GUESTFISH OVER A SOCKET> below."
14835 #: ../fish/guestfish.pod:258 ../fuse/guestmount.pod:148
14836 msgid "B<-r> | B<--ro>"
14840 #: ../fish/guestfish.pod:260
14842 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
14843 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
14847 #: ../fish/guestfish.pod:263 ../tools/virt-rescue.pl:162
14849 "The option must always be used if the disk image or virtual machine might be "
14850 "running, and is generally recommended in cases where you don't need write "
14851 "access to the disk."
14855 #: ../fish/guestfish.pod:267
14857 "Note that prepared disk images created with I<-N> are not affected by the "
14862 #: ../fish/guestfish.pod:270 ../fuse/guestmount.pod:158 ../tools/virt-rescue.pl:170
14863 msgid "B<--selinux>"
14867 #: ../fish/guestfish.pod:272
14868 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
14872 #: ../fish/guestfish.pod:274 ../fuse/guestmount.pod:168
14873 msgid "B<-v> | B<--verbose>"
14877 #: ../fish/guestfish.pod:276
14879 "Enable very verbose messages. This is particularly useful if you find a "
14884 #: ../fish/guestfish.pod:279 ../fuse/guestmount.pod:172
14885 msgid "B<-V> | B<--version>"
14889 #: ../fish/guestfish.pod:281
14890 msgid "Display the guestfish / libguestfs version number and exit."
14894 #: ../fish/guestfish.pod:283
14899 #: ../fish/guestfish.pod:285
14900 msgid "Echo each command before executing it."
14904 #: ../fish/guestfish.pod:289
14905 msgid "COMMANDS ON COMMAND LINE"
14909 #: ../fish/guestfish.pod:291
14910 msgid "Any additional (non-option) arguments are treated as commands to execute."
14914 #: ../fish/guestfish.pod:294
14916 "Commands to execute should be separated by a colon (C<:>), where the colon "
14917 "is a separate parameter. Thus:"
14921 #: ../fish/guestfish.pod:297
14924 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
14929 #: ../fish/guestfish.pod:299
14931 "If there are no additional arguments, then we enter a shell, either an "
14932 "interactive shell with a prompt (if the input is a terminal) or a "
14933 "non-interactive shell."
14937 #: ../fish/guestfish.pod:303
14939 "In either command line mode or non-interactive shell, the first command that "
14940 "gives an error causes the whole shell to exit. In interactive mode (with a "
14941 "prompt) if a command fails, you can continue to enter commands."
14945 #: ../fish/guestfish.pod:308
14946 msgid "USING launch (OR run)"
14950 #: ../fish/guestfish.pod:310
14952 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
14953 "then launch it, then mount any disks you need, and finally issue "
14954 "actions/commands. So the general order of the day is:"
14958 #: ../fish/guestfish.pod:318
14959 msgid "add or -a/--add"
14963 #: ../fish/guestfish.pod:322
14964 msgid "launch (aka run)"
14968 #: ../fish/guestfish.pod:326
14969 msgid "mount or -m/--mount"
14973 #: ../fish/guestfish.pod:330
14974 msgid "any other commands"
14978 #: ../fish/guestfish.pod:334
14980 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
14981 "guest before mounting or performing any other commands."
14985 #: ../fish/guestfish.pod:337
14987 "The only exception is that if the I<-m> or I<--mount> option was given, the "
14988 "guest is automatically run for you (simply because guestfish can't mount the "
14989 "disks you asked for without doing this)."
14993 #: ../fish/guestfish.pod:341
14998 #: ../fish/guestfish.pod:343
15000 "You can quote ordinary parameters using either single or double quotes. For "
15005 #: ../fish/guestfish.pod:346
15008 " add \"file with a space.img\"\n"
15013 #: ../fish/guestfish.pod:348
15016 " rm '/file name'\n"
15021 #: ../fish/guestfish.pod:350
15029 #: ../fish/guestfish.pod:352
15031 "A few commands require a list of strings to be passed. For these, use a "
15032 "whitespace-separated list, enclosed in quotes. Strings containing "
15033 "whitespace to be passed through must be enclosed in single quotes. A "
15034 "literal single quote must be escaped with a backslash."
15038 #: ../fish/guestfish.pod:357
15041 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
15042 " command \"/bin/echo 'foo bar'\"\n"
15043 " command \"/bin/echo \\'foo\\'\"\n"
15048 #: ../fish/guestfish.pod:361
15053 #: ../fish/guestfish.pod:363
15054 msgid "This section applies to all commands which can take integers as parameters."
15058 #: ../fish/guestfish.pod:366
15059 msgid "SIZE SUFFIX"
15063 #: ../fish/guestfish.pod:368
15065 "When the command takes a parameter measured in bytes, you can use one of the "
15066 "following suffixes to specify kilobytes, megabytes and larger sizes:"
15070 #: ../fish/guestfish.pod:374
15071 msgid "B<k> or B<K> or B<KiB>"
15075 #: ../fish/guestfish.pod:376
15076 msgid "The size in kilobytes (multiplied by 1024)."
15080 #: ../fish/guestfish.pod:378
15085 #: ../fish/guestfish.pod:380
15086 msgid "The size in SI 1000 byte units."
15090 #: ../fish/guestfish.pod:382
15091 msgid "B<M> or B<MiB>"
15095 #: ../fish/guestfish.pod:384
15096 msgid "The size in megabytes (multiplied by 1048576)."
15100 #: ../fish/guestfish.pod:386
15105 #: ../fish/guestfish.pod:388
15106 msgid "The size in SI 1000000 byte units."
15110 #: ../fish/guestfish.pod:390
15111 msgid "B<G> or B<GiB>"
15115 #: ../fish/guestfish.pod:392
15116 msgid "The size in gigabytes (multiplied by 2**30)."
15120 #: ../fish/guestfish.pod:394
15125 #: ../fish/guestfish.pod:396
15126 msgid "The size in SI 10**9 byte units."
15130 #: ../fish/guestfish.pod:398
15131 msgid "B<T> or B<TiB>"
15135 #: ../fish/guestfish.pod:400
15136 msgid "The size in terabytes (multiplied by 2**40)."
15140 #: ../fish/guestfish.pod:402
15145 #: ../fish/guestfish.pod:404
15146 msgid "The size in SI 10**12 byte units."
15150 #: ../fish/guestfish.pod:406
15151 msgid "B<P> or B<PiB>"
15155 #: ../fish/guestfish.pod:408
15156 msgid "The size in petabytes (multiplied by 2**50)."
15160 #: ../fish/guestfish.pod:410
15165 #: ../fish/guestfish.pod:412
15166 msgid "The size in SI 10**15 byte units."
15170 #: ../fish/guestfish.pod:414
15171 msgid "B<E> or B<EiB>"
15175 #: ../fish/guestfish.pod:416
15176 msgid "The size in exabytes (multiplied by 2**60)."
15180 #: ../fish/guestfish.pod:418
15185 #: ../fish/guestfish.pod:420
15186 msgid "The size in SI 10**18 byte units."
15190 #: ../fish/guestfish.pod:422
15191 msgid "B<Z> or B<ZiB>"
15195 #: ../fish/guestfish.pod:424
15196 msgid "The size in zettabytes (multiplied by 2**70)."
15200 #: ../fish/guestfish.pod:426
15205 #: ../fish/guestfish.pod:428
15206 msgid "The size in SI 10**21 byte units."
15210 #: ../fish/guestfish.pod:430
15211 msgid "B<Y> or B<YiB>"
15215 #: ../fish/guestfish.pod:432
15216 msgid "The size in yottabytes (multiplied by 2**80)."
15220 #: ../fish/guestfish.pod:434
15225 #: ../fish/guestfish.pod:436
15226 msgid "The size in SI 10**24 byte units."
15230 #: ../fish/guestfish.pod:440
15231 msgid "For example:"
15235 #: ../fish/guestfish.pod:442
15238 " truncate-size /file 1G\n"
15243 #: ../fish/guestfish.pod:444
15244 msgid "would truncate the file to 1 gigabyte."
15248 #: ../fish/guestfish.pod:446
15250 "Be careful because a few commands take sizes in kilobytes or megabytes "
15251 "(eg. the parameter to L</memsize> is specified in megabytes already). "
15252 "Adding a suffix will probably not do what you expect."
15256 #: ../fish/guestfish.pod:450
15257 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15261 #: ../fish/guestfish.pod:452
15263 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15264 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15268 #: ../fish/guestfish.pod:455
15271 " 1234 decimal number 1234\n"
15272 " 02322 octal number, equivalent to decimal 1234\n"
15273 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
15278 #: ../fish/guestfish.pod:459
15280 "When using the C<chmod> command, you almost always want to specify an octal "
15281 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
15282 "L<chmod(1)> program):"
15286 #: ../fish/guestfish.pod:463
15289 " chmod 0777 /public # OK\n"
15290 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
15295 #: ../fish/guestfish.pod:466
15297 "Commands that return numbers usually print them in decimal, but some "
15298 "commands print numbers in other radices (eg. C<umask> prints the mode in "
15299 "octal, preceeded by C<0>)."
15303 #: ../fish/guestfish.pod:470
15304 msgid "WILDCARDS AND GLOBBING"
15308 #: ../fish/guestfish.pod:472
15310 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
15311 "(globbing) by default. So for example the following will not do what you "
15316 #: ../fish/guestfish.pod:476
15324 #: ../fish/guestfish.pod:478
15326 "Assuming you don't have a directory literally called C</home/*> then the "
15327 "above command will return an error."
15331 #: ../fish/guestfish.pod:481
15332 msgid "To perform wildcard expansion, use the C<glob> command."
15336 #: ../fish/guestfish.pod:483
15339 " glob rm-rf /home/*\n"
15344 #: ../fish/guestfish.pod:485
15346 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
15347 "many times), equivalent to:"
15351 #: ../fish/guestfish.pod:488
15354 " rm-rf /home/jim\n"
15355 " rm-rf /home/joe\n"
15356 " rm-rf /home/mary\n"
15361 #: ../fish/guestfish.pod:492
15362 msgid "C<glob> only works on simple guest paths and not on device names."
15366 #: ../fish/guestfish.pod:494
15368 "If you have several parameters, each containing a wildcard, then glob will "
15369 "perform a cartesian product."
15373 #: ../fish/guestfish.pod:497
15378 #: ../fish/guestfish.pod:499
15380 "Any line which starts with a I<#> character is treated as a comment and "
15381 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
15382 "a command. For example:"
15386 #: ../fish/guestfish.pod:503
15389 " # this is a comment\n"
15390 " # this is a comment\n"
15391 " foo # NOT a comment\n"
15396 #: ../fish/guestfish.pod:507
15397 msgid "Blank lines are also ignored."
15401 #: ../fish/guestfish.pod:509
15402 msgid "RUNNING COMMANDS LOCALLY"
15406 #: ../fish/guestfish.pod:511
15408 "Any line which starts with a I<!> character is treated as a command sent to "
15409 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
15413 #: ../fish/guestfish.pod:515
15417 " tgz-out /remote local/remote-data.tar.gz\n"
15422 #: ../fish/guestfish.pod:518
15424 "will create a directory C<local> on the host, and then export the contents "
15425 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
15426 "(See C<tgz-out>)."
15430 #: ../fish/guestfish.pod:522
15432 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
15433 "effect, due to the way that subprocesses work in Unix."
15437 #: ../fish/guestfish.pod:525
15442 #: ../fish/guestfish.pod:527
15444 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
15445 "command (a guestfish command) to the second command (any host command). For "
15450 #: ../fish/guestfish.pod:531
15453 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
15458 #: ../fish/guestfish.pod:533
15460 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
15461 "program). The above command would list all accounts in the guest filesystem "
15462 "which have UID 0, ie. root accounts including backdoors. Other examples:"
15466 #: ../fish/guestfish.pod:538
15469 " hexdump /bin/ls | head\n"
15470 " list-devices | tail -1\n"
15471 " tgz-out / - | tar ztf -\n"
15476 #: ../fish/guestfish.pod:542
15478 "The space before the pipe symbol is required, any space after the pipe "
15479 "symbol is optional. Everything after the pipe symbol is just passed "
15480 "straight to the host shell, so it can contain redirections, globs and "
15481 "anything else that makes sense on the host side."
15485 #: ../fish/guestfish.pod:547
15487 "To use a literal argument which begins with a pipe symbol, you have to quote "
15492 #: ../fish/guestfish.pod:550
15500 #: ../fish/guestfish.pod:552
15501 msgid "HOME DIRECTORIES"
15505 #: ../fish/guestfish.pod:554
15507 "If a parameter starts with the character C<~> then the tilde may be expanded "
15508 "as a home directory path (either C<~> for the current user's home directory, "
15509 "or C<~user> for another user)."
15513 #: ../fish/guestfish.pod:558
15515 "Note that home directory expansion happens for users known I<on the host>, "
15516 "not in the guest filesystem."
15520 #: ../fish/guestfish.pod:561
15522 "To use a literal argument which begins with a tilde, you have to quote it, "
15527 #: ../fish/guestfish.pod:564
15535 #: ../fish/guestfish.pod:568
15537 "Libguestfs has some support for Linux guests encrypted according to the "
15538 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
15539 "disk encryption systems used by modern Linux guests. Currently only "
15540 "LVM-on-LUKS is supported."
15544 #: ../fish/guestfish.pod:573
15545 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
15549 #: ../fish/guestfish.pod:575
15552 " ><fs> vfs-type /dev/sda2\n"
15558 #: ../fish/guestfish.pod:578
15560 "Then open those devices using L</luks-open>. This creates a device-mapper "
15561 "device called C</dev/mapper/luksdev>."
15565 #: ../fish/guestfish.pod:581
15568 " ><fs> luks-open /dev/sda2 luksdev\n"
15569 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
15574 #: ../fish/guestfish.pod:584
15576 "Finally you have to tell LVM to scan for volume groups on the newly created "
15581 #: ../fish/guestfish.pod:587
15585 " ><fs> vg-activate-all true\n"
15590 #: ../fish/guestfish.pod:590
15591 msgid "The logical volume(s) can now be mounted in the usual way."
15595 #: ../fish/guestfish.pod:592
15597 "Before closing a LUKS device you must unmount any logical volumes on it and "
15598 "deactivate the volume groups by calling C<vg-activate false VG> on each "
15599 "one. Then you can close the mapper device:"
15603 #: ../fish/guestfish.pod:596
15606 " ><fs> vg-activate false /dev/VG\n"
15607 " ><fs> luks-close /dev/mapper/luksdev\n"
15612 #: ../fish/guestfish.pod:599
15613 msgid "WINDOWS PATHS"
15617 #: ../fish/guestfish.pod:601
15619 "If a path is prefixed with C<win:> then you can use Windows-style paths "
15620 "(with some limitations). The following commands are equivalent:"
15624 #: ../fish/guestfish.pod:604
15627 " file /WINDOWS/system32/config/system.LOG\n"
15632 #: ../fish/guestfish.pod:606
15635 " file win:/windows/system32/config/system.log\n"
15640 #: ../fish/guestfish.pod:608
15643 " file win:\\windows\\system32\\config\\system.log\n"
15648 #: ../fish/guestfish.pod:610
15651 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
15656 #: ../fish/guestfish.pod:612
15658 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
15659 "handles case insensitivity like Windows would. This only works in argument "
15660 "positions that expect a path."
15664 #: ../fish/guestfish.pod:616
15665 msgid "UPLOADING AND DOWNLOADING FILES"
15669 #: ../fish/guestfish.pod:618
15671 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
15672 "others which upload from or download to a local file, you can use the "
15673 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
15677 #: ../fish/guestfish.pod:622
15685 #: ../fish/guestfish.pod:624
15686 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
15690 #: ../fish/guestfish.pod:627
15693 " tar-out /etc - | tar tf -\n"
15698 #: ../fish/guestfish.pod:629
15700 "writes the tarball to stdout and then pipes that into the external \"tar\" "
15701 "command (see L</PIPES>)."
15705 #: ../fish/guestfish.pod:632
15707 "When using C<-> to read from stdin, the input is read up to the end of "
15708 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
15709 "some arbitrary end marker:"
15713 #: ../fish/guestfish.pod:636
15716 " upload -<<END /foo\n"
15725 #: ../fish/guestfish.pod:642
15727 "Any string of characters can be used instead of C<END>. The end marker must "
15728 "appear on a line of its own, without any preceeding or following characters "
15729 "(not even spaces)."
15733 #: ../fish/guestfish.pod:646
15735 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
15736 "upload local files (so-called \"FileIn\" parameters in the generator)."
15740 #: ../fish/guestfish.pod:649
15741 msgid "EXIT ON ERROR BEHAVIOUR"
15745 #: ../fish/guestfish.pod:651
15747 "By default, guestfish will ignore any errors when in interactive mode "
15748 "(ie. taking commands from a human over a tty), and will exit on the first "
15749 "error in non-interactive mode (scripts, commands given on the command line)."
15753 #: ../fish/guestfish.pod:656
15755 "If you prefix a command with a I<-> character, then that command will not "
15756 "cause guestfish to exit, even if that (one) command returns an error."
15760 #: ../fish/guestfish.pod:660
15761 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
15765 #: ../fish/guestfish.pod:662
15767 "Guestfish can be remote-controlled over a socket. This is useful "
15768 "particularly in shell scripts where you want to make several different "
15769 "changes to a filesystem, but you don't want the overhead of starting up a "
15770 "guestfish process each time."
15774 #: ../fish/guestfish.pod:667
15775 msgid "Start a guestfish server process using:"
15779 #: ../fish/guestfish.pod:669
15782 " eval `guestfish --listen`\n"
15787 #: ../fish/guestfish.pod:671
15788 msgid "and then send it commands by doing:"
15792 #: ../fish/guestfish.pod:673
15795 " guestfish --remote cmd [...]\n"
15800 #: ../fish/guestfish.pod:675
15801 msgid "To cause the server to exit, send it the exit command:"
15805 #: ../fish/guestfish.pod:677
15808 " guestfish --remote exit\n"
15813 #: ../fish/guestfish.pod:679
15815 "Note that the server will normally exit if there is an error in a command. "
15816 "You can change this in the usual way. See section L</EXIT ON ERROR "
15821 #: ../fish/guestfish.pod:683
15822 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
15826 #: ../fish/guestfish.pod:685
15828 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
15829 "is how the I<--remote> option knows where to send the commands. You can "
15830 "have several guestfish listener processes running using:"
15834 #: ../fish/guestfish.pod:689
15837 " eval `guestfish --listen`\n"
15838 " pid1=$GUESTFISH_PID\n"
15839 " eval `guestfish --listen`\n"
15840 " pid2=$GUESTFISH_PID\n"
15842 " guestfish --remote=$pid1 cmd\n"
15843 " guestfish --remote=$pid2 cmd\n"
15848 #: ../fish/guestfish.pod:697
15849 msgid "REMOTE CONTROL DETAILS"
15853 #: ../fish/guestfish.pod:699
15855 "Remote control happens over a Unix domain socket called "
15856 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
15857 "of the process, and C<$PID> is the process ID of the server."
15861 #: ../fish/guestfish.pod:703
15862 msgid "Guestfish client and server versions must match exactly."
15866 #: ../fish/guestfish.pod:705
15867 msgid "PREPARED DISK IMAGES"
15871 #: ../fish/guestfish.pod:707
15873 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
15874 "preformatted disk images that guestfish can make for you to save typing. "
15875 "This is particularly useful for testing purposes. This option is used "
15876 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
15877 "can be mixed with I<-a>)."
15881 #: ../fish/guestfish.pod:713
15883 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
15884 "the second and so on. Existing files in the current directory are "
15889 #: ../fish/guestfish.pod:717
15891 "The type briefly describes how the disk should be sized, partitioned, how "
15892 "filesystem(s) should be created, and how content should be added. "
15893 "Optionally the type can be followed by extra parameters, separated by C<:> "
15894 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
15895 "sparsely-allocated disk, containing a single partition, with the partition "
15896 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
15897 "on a 1GB disk instead."
15901 #: ../fish/guestfish.pod:725
15902 msgid "To list the available types and any extra parameters they take, run:"
15906 #: ../fish/guestfish.pod:729
15908 "Note that the prepared filesystem is not mounted. You would usually have to "
15909 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
15913 #: ../fish/guestfish.pod:733
15915 "If any I<-N> or I<--new> options are given, the guest is automatically "
15920 #: ../fish/guestfish.pod:738
15921 msgid "Create a 100MB disk with an ext4-formatted partition:"
15925 #: ../fish/guestfish.pod:740
15928 " guestfish -N fs:ext4\n"
15933 #: ../fish/guestfish.pod:742
15934 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
15938 #: ../fish/guestfish.pod:744
15941 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
15946 #: ../fish/guestfish.pod:746
15947 msgid "Create a blank 200MB disk:"
15951 #: ../fish/guestfish.pod:748
15954 " guestfish -N disk:200M\n"
15959 #: ../fish/guestfish.pod:750
15960 msgid "PROGRESS BARS"
15964 #: ../fish/guestfish.pod:752
15966 "Some (not all) long-running commands send progress notification messages as "
15967 "they are running. Guestfish turns these messages into progress bars."
15971 #: ../fish/guestfish.pod:756
15973 "When a command that supports progress bars takes longer than two seconds to "
15974 "run, and if progress bars are enabled, then you will see one appearing below "
15979 #: ../fish/guestfish.pod:760
15982 " ><fs> copy-size /large-file /another-file 2048M\n"
15983 " / 10% [#####-----------------------------------------] 00:30\n"
15988 #: ../fish/guestfish.pod:763
15990 "The spinner on the left hand side moves round once for every progress "
15991 "notification received from the backend. This is a (reasonably) golden "
15992 "assurance that the command is \"doing something\" even if the progress bar "
15993 "is not moving, because the command is able to send the progress "
15994 "notifications. When the bar reaches 100% and the command finishes, the "
15995 "spinner disappears."
15999 #: ../fish/guestfish.pod:770
16001 "Progress bars are enabled by default when guestfish is used interactively. "
16002 "You can enable them even for non-interactive modes using I<--progress-bars>, "
16003 "and you can disable them completely using I<--no-progress-bars>."
16007 #: ../fish/guestfish.pod:775
16008 msgid "GUESTFISH COMMANDS"
16012 #: ../fish/guestfish.pod:777
16014 "The commands in this section are guestfish convenience commands, in other "
16015 "words, they are not part of the L<guestfs(3)> API."
16019 #: ../fish/guestfish.pod:780
16024 #: ../fish/guestfish.pod:782
16033 #: ../fish/guestfish.pod:785
16035 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
16036 "this displays detailed help for a command."
16040 #: ../fish/guestfish.pod:788
16041 msgid "quit | exit"
16045 #: ../fish/guestfish.pod:790
16046 msgid "This exits guestfish. You can also use C<^D> key."
16050 #: ../fish/guestfish.pod:792
16051 msgid "@FISH_COMMANDS@"
16055 #: ../fish/guestfish.pod:794
16060 #: ../fish/guestfish.pod:798 ../test-tool/libguestfs-test-tool.pod:83
16065 #: ../fish/guestfish.pod:800
16067 "guestfish returns 0 if the commands completed without error, or 1 if there "
16072 #: ../fish/guestfish.pod:807
16077 #: ../fish/guestfish.pod:809
16079 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
16084 #: ../fish/guestfish.pod:812
16085 msgid "GUESTFISH_PID"
16089 #: ../fish/guestfish.pod:814
16091 "Used with the I<--remote> option to specify the remote guestfish process to "
16092 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16096 #: ../fish/guestfish.pod:818
16101 #: ../fish/guestfish.pod:820
16103 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
16104 "not specified, the external L<hexedit(1)> program is used."
16108 #: ../fish/guestfish.pod:824
16113 #: ../fish/guestfish.pod:826
16115 "If compiled with GNU readline support, various files in the home directory "
16116 "can be used. See L</FILES>."
16120 #: ../fish/guestfish.pod:835
16122 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16123 "effect as using the B<-v> option."
16127 #: ../fish/guestfish.pod:847
16129 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16130 "the discussion of paths in L<guestfs(3)>."
16134 #: ../fish/guestfish.pod:858
16135 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16139 #: ../fish/guestfish.pod:860
16144 #: ../fish/guestfish.pod:862
16146 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16151 #: ../fish/guestfish.pod:877 ../test-tool/libguestfs-test-tool.pod:88
16156 #: ../fish/guestfish.pod:881
16157 msgid "$HOME/.guestfish"
16161 #: ../fish/guestfish.pod:883
16163 "If compiled with GNU readline support, then the command history is saved in "
16168 #: ../fish/guestfish.pod:886
16169 msgid "$HOME/.inputrc"
16173 #: ../fish/guestfish.pod:888
16174 msgid "/etc/inputrc"
16178 #: ../fish/guestfish.pod:890
16180 "If compiled with GNU readline support, then these files can be used to "
16181 "configure readline. For further information, please see "
16182 "L<readline(3)/INITIALIZATION FILE>."
16186 #: ../fish/guestfish.pod:894
16187 msgid "To write rules which only apply to guestfish, use:"
16191 #: ../fish/guestfish.pod:896
16201 #: ../fish/guestfish.pod:900
16203 "Variables that you can set in inputrc that change the behaviour of guestfish "
16204 "in useful ways include:"
16208 #: ../fish/guestfish.pod:905
16209 msgid "completion-ignore-case (default: on)"
16213 #: ../fish/guestfish.pod:907
16215 "By default, guestfish will ignore case when tab-completing paths on the "
16220 #: ../fish/guestfish.pod:910
16223 " set completion-ignore-case off\n"
16228 #: ../fish/guestfish.pod:912
16229 msgid "to make guestfish case sensitive."
16233 #: ../fish/guestfish.pod:916
16238 #: ../fish/guestfish.pod:918
16239 msgid "test2.img (etc)"
16243 #: ../fish/guestfish.pod:920
16245 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16246 "will be created in the file C<test1.img> in the current directory. The "
16247 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16248 "the same name will be overwritten."
16252 #: ../fish/guestfish.pod:929
16254 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16255 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16256 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16257 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
16261 #: ../fish/guestfish.pod:953 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:198 ../inspector/virt-inspector.pl:865 ../tools/virt-cat.pl:181 ../tools/virt-df.pl:553 ../tools/virt-edit.pl:345 ../tools/virt-list-filesystems.pl:211 ../tools/virt-list-partitions.pl:248 ../tools/virt-ls.pl:229 ../tools/virt-make-fs.pl:560 ../tools/virt-rescue.pl:249 ../tools/virt-resize.pl:1415 ../tools/virt-tar.pl:276 ../tools/virt-win-reg.pl:495
16263 "This program is free software; you can redistribute it and/or modify it "
16264 "under the terms of the GNU General Public License as published by the Free "
16265 "Software Foundation; either version 2 of the License, or (at your option) "
16266 "any later version."
16270 #: ../fish/guestfish.pod:958 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:203 ../inspector/virt-inspector.pl:870 ../tools/virt-cat.pl:186 ../tools/virt-df.pl:558 ../tools/virt-edit.pl:350 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:253 ../tools/virt-ls.pl:234 ../tools/virt-make-fs.pl:565 ../tools/virt-rescue.pl:254 ../tools/virt-resize.pl:1420 ../tools/virt-tar.pl:281 ../tools/virt-win-reg.pl:500
16272 "This program is distributed in the hope that it will be useful, but WITHOUT "
16273 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
16274 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
16279 #: ../fish/guestfish.pod:963 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:208 ../inspector/virt-inspector.pl:875 ../tools/virt-cat.pl:191 ../tools/virt-df.pl:563 ../tools/virt-edit.pl:355 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:258 ../tools/virt-ls.pl:239 ../tools/virt-make-fs.pl:570 ../tools/virt-rescue.pl:259 ../tools/virt-resize.pl:1425 ../tools/virt-tar.pl:286 ../tools/virt-win-reg.pl:505
16281 "You should have received a copy of the GNU General Public License along with "
16282 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
16283 "Ave, Cambridge, MA 02139, USA."
16287 #: ../fish/guestfish-actions.pod:1
16292 #: ../fish/guestfish-actions.pod:3
16297 #: ../fish/guestfish-actions.pod:5
16300 " add-cdrom filename\n"
16305 #: ../fish/guestfish-actions.pod:17
16307 "This call checks for the existence of C<filename>. This stops you from "
16308 "specifying other types of drive which are supported by qemu such as C<nbd:> "
16309 "and C<http:> URLs. To specify those, use the general L</config> call "
16314 #: ../fish/guestfish-actions.pod:24
16316 "If you just want to add an ISO file (often you use this as an efficient way "
16317 "to transfer large files into the guest), then you should probably use "
16318 "L</add-drive-ro> instead."
16322 #: ../fish/guestfish-actions.pod:30
16327 #: ../fish/guestfish-actions.pod:32
16332 #: ../fish/guestfish-actions.pod:34
16335 " add-drive filename\n"
16340 #: ../fish/guestfish-actions.pod:53 ../fish/guestfish-actions.pod:81
16342 "C<if=...> is set at compile time by the configuration option C<./configure "
16343 "--with-drive-if=...>. In the rare case where you might need to change this "
16344 "at run time, use L</add-drive-with-if> or L</add-drive-ro-with-if>."
16348 #: ../fish/guestfish-actions.pod:58 ../fish/guestfish-actions.pod:86
16350 "Note that this call checks for the existence of C<filename>. This stops you "
16351 "from specifying other types of drive which are supported by qemu such as "
16352 "C<nbd:> and C<http:> URLs. To specify those, use the general L</config> "
16357 #: ../fish/guestfish-actions.pod:63
16358 msgid "add-drive-ro"
16362 #: ../fish/guestfish-actions.pod:65
16367 #: ../fish/guestfish-actions.pod:67
16370 " add-drive-ro filename\n"
16375 #: ../fish/guestfish-actions.pod:91
16376 msgid "add-drive-ro-with-if"
16380 #: ../fish/guestfish-actions.pod:93
16383 " add-drive-ro-with-if filename iface\n"
16388 #: ../fish/guestfish-actions.pod:95
16390 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
16391 "interface emulation to use at run time."
16395 #: ../fish/guestfish-actions.pod:98
16396 msgid "add-drive-with-if"
16400 #: ../fish/guestfish-actions.pod:100
16403 " add-drive-with-if filename iface\n"
16408 #: ../fish/guestfish-actions.pod:102
16410 "This is the same as L</add-drive> but it allows you to specify the QEMU "
16411 "interface emulation to use at run time."
16415 #: ../fish/guestfish-actions.pod:105
16420 #: ../fish/guestfish-actions.pod:107
16423 " aug-clear augpath\n"
16428 #: ../fish/guestfish-actions.pod:112
16433 #: ../fish/guestfish-actions.pod:114
16441 #: ../fish/guestfish-actions.pod:116
16443 "Close the current Augeas handle and free up any resources used by it. After "
16444 "calling this, you have to call L</aug-init> again before you can use any "
16445 "other Augeas functions."
16449 #: ../fish/guestfish-actions.pod:121
16450 msgid "aug-defnode"
16454 #: ../fish/guestfish-actions.pod:123
16457 " aug-defnode name expr val\n"
16462 #: ../fish/guestfish-actions.pod:128
16464 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
16465 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
16466 "containing that single node."
16470 #: ../fish/guestfish-actions.pod:136
16475 #: ../fish/guestfish-actions.pod:138
16478 " aug-defvar name expr\n"
16483 #: ../fish/guestfish-actions.pod:147
16488 #: ../fish/guestfish-actions.pod:149
16491 " aug-get augpath\n"
16496 #: ../fish/guestfish-actions.pod:154
16501 #: ../fish/guestfish-actions.pod:156
16504 " aug-init root flags\n"
16509 #: ../fish/guestfish-actions.pod:162
16510 msgid "You must call this before using any other L</aug-*> commands."
16514 #: ../fish/guestfish-actions.pod:197
16515 msgid "Do not load the tree in L</aug-init>."
16519 #: ../fish/guestfish-actions.pod:201
16520 msgid "To close the handle, you can call L</aug-close>."
16524 #: ../fish/guestfish-actions.pod:205
16529 #: ../fish/guestfish-actions.pod:207
16532 " aug-insert augpath label true|false\n"
16537 #: ../fish/guestfish-actions.pod:217
16542 #: ../fish/guestfish-actions.pod:219
16550 #: ../fish/guestfish-actions.pod:226
16555 #: ../fish/guestfish-actions.pod:228
16558 " aug-ls augpath\n"
16563 #: ../fish/guestfish-actions.pod:230
16565 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
16566 "resulting nodes into alphabetical order."
16570 #: ../fish/guestfish-actions.pod:233
16575 #: ../fish/guestfish-actions.pod:235
16578 " aug-match augpath\n"
16583 #: ../fish/guestfish-actions.pod:241
16588 #: ../fish/guestfish-actions.pod:243
16591 " aug-mv src dest\n"
16596 #: ../fish/guestfish-actions.pod:248
16601 #: ../fish/guestfish-actions.pod:250
16604 " aug-rm augpath\n"
16609 #: ../fish/guestfish-actions.pod:256
16614 #: ../fish/guestfish-actions.pod:258
16622 #: ../fish/guestfish-actions.pod:262
16624 "The flags which were passed to L</aug-init> affect exactly how files are "
16629 #: ../fish/guestfish-actions.pod:265
16634 #: ../fish/guestfish-actions.pod:267
16637 " aug-set augpath val\n"
16642 #: ../fish/guestfish-actions.pod:271
16644 "In the Augeas API, it is possible to clear a node by setting the value to "
16645 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
16646 "this call. Instead you must use the L</aug-clear> call."
16650 #: ../fish/guestfish-actions.pod:276
16655 #: ../fish/guestfish-actions.pod:278
16658 " available 'groups ...'\n"
16663 #: ../fish/guestfish-actions.pod:284
16665 "The libguestfs groups, and the functions that those groups correspond to, "
16666 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
16667 "runtime by calling L</available-all-groups>."
16671 #: ../fish/guestfish-actions.pod:308
16672 msgid "You must call L</launch> before calling this function."
16676 #: ../fish/guestfish-actions.pod:330
16678 "This call was added in version C<1.0.80>. In previous versions of "
16679 "libguestfs all you could do would be to speculatively execute a command to "
16680 "find out if the daemon implemented it. See also L</version>."
16684 #: ../fish/guestfish-actions.pod:337
16685 msgid "available-all-groups"
16689 #: ../fish/guestfish-actions.pod:339
16692 " available-all-groups\n"
16697 #: ../fish/guestfish-actions.pod:341
16699 "This command returns a list of all optional groups that this daemon knows "
16700 "about. Note this returns both supported and unsupported groups. To find "
16701 "out which ones the daemon can actually support you have to call "
16702 "L</available> on each member of the returned list."
16706 #: ../fish/guestfish-actions.pod:347
16707 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
16711 #: ../fish/guestfish-actions.pod:349
16716 #: ../fish/guestfish-actions.pod:351
16719 " base64-in (base64file|-) filename\n"
16724 #: ../fish/guestfish-actions.pod:356 ../fish/guestfish-actions.pod:365 ../fish/guestfish-actions.pod:589 ../fish/guestfish-actions.pod:736 ../fish/guestfish-actions.pod:783 ../fish/guestfish-actions.pod:802 ../fish/guestfish-actions.pod:1179 ../fish/guestfish-actions.pod:3803 ../fish/guestfish-actions.pod:3815 ../fish/guestfish-actions.pod:3826 ../fish/guestfish-actions.pod:3837 ../fish/guestfish-actions.pod:3889 ../fish/guestfish-actions.pod:3898 ../fish/guestfish-actions.pod:3952 ../fish/guestfish-actions.pod:3975
16725 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
16729 #: ../fish/guestfish-actions.pod:358
16734 #: ../fish/guestfish-actions.pod:360
16737 " base64-out filename (base64file|-)\n"
16742 #: ../fish/guestfish-actions.pod:367
16743 msgid "blockdev-flushbufs"
16747 #: ../fish/guestfish-actions.pod:369
16750 " blockdev-flushbufs device\n"
16755 #: ../fish/guestfish-actions.pod:376
16756 msgid "blockdev-getbsz"
16760 #: ../fish/guestfish-actions.pod:378
16763 " blockdev-getbsz device\n"
16768 #: ../fish/guestfish-actions.pod:387
16769 msgid "blockdev-getro"
16773 #: ../fish/guestfish-actions.pod:389
16776 " blockdev-getro device\n"
16781 #: ../fish/guestfish-actions.pod:396
16782 msgid "blockdev-getsize64"
16786 #: ../fish/guestfish-actions.pod:398
16789 " blockdev-getsize64 device\n"
16794 #: ../fish/guestfish-actions.pod:402
16795 msgid "See also L</blockdev-getsz>."
16799 #: ../fish/guestfish-actions.pod:406
16800 msgid "blockdev-getss"
16804 #: ../fish/guestfish-actions.pod:408
16807 " blockdev-getss device\n"
16812 #: ../fish/guestfish-actions.pod:413
16813 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
16817 #: ../fish/guestfish-actions.pod:418
16818 msgid "blockdev-getsz"
16822 #: ../fish/guestfish-actions.pod:420
16825 " blockdev-getsz device\n"
16830 #: ../fish/guestfish-actions.pod:425
16832 "See also L</blockdev-getss> for the real sector size of the device, and "
16833 "L</blockdev-getsize64> for the more useful I<size in bytes>."
16837 #: ../fish/guestfish-actions.pod:431
16838 msgid "blockdev-rereadpt"
16842 #: ../fish/guestfish-actions.pod:433
16845 " blockdev-rereadpt device\n"
16850 #: ../fish/guestfish-actions.pod:439
16851 msgid "blockdev-setbsz"
16855 #: ../fish/guestfish-actions.pod:441
16858 " blockdev-setbsz device blocksize\n"
16863 #: ../fish/guestfish-actions.pod:450
16864 msgid "blockdev-setro"
16868 #: ../fish/guestfish-actions.pod:452
16871 " blockdev-setro device\n"
16876 #: ../fish/guestfish-actions.pod:458
16877 msgid "blockdev-setrw"
16881 #: ../fish/guestfish-actions.pod:460
16884 " blockdev-setrw device\n"
16889 #: ../fish/guestfish-actions.pod:466
16890 msgid "case-sensitive-path"
16894 #: ../fish/guestfish-actions.pod:468
16897 " case-sensitive-path path\n"
16902 #: ../fish/guestfish-actions.pod:492
16904 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
16905 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
16906 "how the directories were originally created under Windows)."
16910 #: ../fish/guestfish-actions.pod:500
16911 msgid "See also L</realpath>."
16915 #: ../fish/guestfish-actions.pod:502
16920 #: ../fish/guestfish-actions.pod:504
16928 #: ../fish/guestfish-actions.pod:508
16930 "Note that this function cannot correctly handle binary files (specifically, "
16931 "files containing C<\\0> character which is treated as end of string). For "
16932 "those you need to use the L</read-file> or L</download> functions which have "
16933 "a more complex interface."
16937 #: ../fish/guestfish-actions.pod:516
16942 #: ../fish/guestfish-actions.pod:518
16945 " checksum csumtype path\n"
16950 #: ../fish/guestfish-actions.pod:561
16951 msgid "To get the checksum for a device, use L</checksum-device>."
16955 #: ../fish/guestfish-actions.pod:563
16956 msgid "To get the checksums for many files, use L</checksums-out>."
16960 #: ../fish/guestfish-actions.pod:565
16961 msgid "checksum-device"
16965 #: ../fish/guestfish-actions.pod:567
16968 " checksum-device csumtype device\n"
16973 #: ../fish/guestfish-actions.pod:569
16975 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
16976 "device named C<device>. For the types of checksums supported see the "
16977 "L</checksum> command."
16981 #: ../fish/guestfish-actions.pod:573
16982 msgid "checksums-out"
16986 #: ../fish/guestfish-actions.pod:575
16989 " checksums-out csumtype directory (sumsfile|-)\n"
16994 #: ../fish/guestfish-actions.pod:591
16999 #: ../fish/guestfish-actions.pod:593
17002 " chmod mode path\n"
17007 #: ../fish/guestfish-actions.pod:604
17012 #: ../fish/guestfish-actions.pod:606
17015 " chown owner group path\n"
17020 #: ../fish/guestfish-actions.pod:614
17025 #: ../fish/guestfish-actions.pod:616
17028 " command 'arguments ...'\n"
17033 #: ../fish/guestfish-actions.pod:623
17035 "The single parameter is an argv-style list of arguments. The first element "
17036 "is the name of the program to run. Subsequent elements are parameters. The "
17037 "list must be non-empty (ie. must contain a program name). Note that the "
17038 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
17042 #: ../fish/guestfish-actions.pod:651
17043 msgid "command-lines"
17047 #: ../fish/guestfish-actions.pod:653
17050 " command-lines 'arguments ...'\n"
17055 #: ../fish/guestfish-actions.pod:655
17056 msgid "This is the same as L</command>, but splits the result into a list of lines."
17060 #: ../fish/guestfish-actions.pod:658
17061 msgid "See also: L</sh-lines>"
17065 #: ../fish/guestfish-actions.pod:663
17070 #: ../fish/guestfish-actions.pod:665
17073 " config qemuparam qemuvalue\n"
17078 #: ../fish/guestfish-actions.pod:676
17083 #: ../fish/guestfish-actions.pod:678
17086 " copy-size src dest size\n"
17091 #: ../fish/guestfish-actions.pod:686
17096 #: ../fish/guestfish-actions.pod:688
17104 #: ../fish/guestfish-actions.pod:693
17109 #: ../fish/guestfish-actions.pod:695
17117 #: ../fish/guestfish-actions.pod:700
17122 #: ../fish/guestfish-actions.pod:702
17130 #: ../fish/guestfish-actions.pod:709
17132 "If the destination is a device, it must be as large or larger than the "
17133 "source file or device, otherwise the copy will fail. This command cannot do "
17134 "partial copies (see L</copy-size>)."
17138 #: ../fish/guestfish-actions.pod:713
17143 #: ../fish/guestfish-actions.pod:715
17146 " debug subcmd 'extraargs ...'\n"
17151 #: ../fish/guestfish-actions.pod:717
17153 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
17154 "daemon) that runs inside the qemu subprocess."
17158 #: ../fish/guestfish-actions.pod:725
17159 msgid "debug-upload"
17163 #: ../fish/guestfish-actions.pod:727
17166 " debug-upload (filename|-) tmpname mode\n"
17171 #: ../fish/guestfish-actions.pod:729
17172 msgid "The L</debug-upload> command uploads a file to the libguestfs appliance."
17176 #: ../fish/guestfish-actions.pod:738
17181 #: ../fish/guestfish-actions.pod:740
17189 #: ../fish/guestfish-actions.pod:748
17194 #: ../fish/guestfish-actions.pod:750
17202 #: ../fish/guestfish-actions.pod:759
17207 #: ../fish/guestfish-actions.pod:761
17215 #: ../fish/guestfish-actions.pod:767
17217 "Another way to get the same information is to enable verbose messages with "
17218 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17219 "before running the program."
17223 #: ../fish/guestfish-actions.pod:772
17228 #: ../fish/guestfish-actions.pod:774
17231 " download remotefilename (filename|-)\n"
17236 #: ../fish/guestfish-actions.pod:781
17237 msgid "See also L</upload>, L</cat>."
17241 #: ../fish/guestfish-actions.pod:785
17242 msgid "download-offset"
17246 #: ../fish/guestfish-actions.pod:787
17249 " download-offset remotefilename (filename|-) offset size\n"
17254 #: ../fish/guestfish-actions.pod:795
17256 "Note that there is no limit on the amount of data that can be downloaded "
17257 "with this call, unlike with L</pread>, and this call always reads the full "
17258 "amount unless an error occurs."
17262 #: ../fish/guestfish-actions.pod:800
17263 msgid "See also L</download>, L</pread>."
17267 #: ../fish/guestfish-actions.pod:804
17268 msgid "drop-caches"
17272 #: ../fish/guestfish-actions.pod:806
17275 " drop-caches whattodrop\n"
17280 #: ../fish/guestfish-actions.pod:818
17285 #: ../fish/guestfish-actions.pod:820
17293 #: ../fish/guestfish-actions.pod:832
17298 #: ../fish/guestfish-actions.pod:834
17301 " e2fsck-f device\n"
17306 #: ../fish/guestfish-actions.pod:840
17308 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
17309 "should use L</fsck>."
17313 #: ../fish/guestfish-actions.pod:843
17314 msgid "echo-daemon"
17318 #: ../fish/guestfish-actions.pod:845
17321 " echo-daemon 'words ...'\n"
17326 #: ../fish/guestfish-actions.pod:852
17327 msgid "See also L</ping-daemon>."
17331 #: ../fish/guestfish-actions.pod:854
17336 #: ../fish/guestfish-actions.pod:856
17339 " egrep regex path\n"
17344 #: ../fish/guestfish-actions.pod:864
17349 #: ../fish/guestfish-actions.pod:866
17352 " egrepi regex path\n"
17357 #: ../fish/guestfish-actions.pod:874
17362 #: ../fish/guestfish-actions.pod:876
17365 " equal file1 file2\n"
17370 #: ../fish/guestfish-actions.pod:883
17375 #: ../fish/guestfish-actions.pod:885
17383 #: ../fish/guestfish-actions.pod:890
17384 msgid "See also L</is-file>, L</is-dir>, L</stat>."
17388 #: ../fish/guestfish-actions.pod:892
17393 #: ../fish/guestfish-actions.pod:894
17396 " fallocate path len\n"
17401 #: ../fish/guestfish-actions.pod:911
17402 msgid "fallocate64"
17406 #: ../fish/guestfish-actions.pod:913
17409 " fallocate64 path len\n"
17414 #: ../fish/guestfish-actions.pod:919
17416 "Note that this call allocates disk blocks for the file. To create a sparse "
17417 "file use L</truncate-size> instead."
17421 #: ../fish/guestfish-actions.pod:922
17423 "The deprecated call L</fallocate> does the same, but owing to an oversight "
17424 "it only allowed 30 bit lengths to be specified, effectively limiting the "
17425 "maximum size of files created through that call to 1GB."
17429 #: ../fish/guestfish-actions.pod:931
17434 #: ../fish/guestfish-actions.pod:933
17437 " fgrep pattern path\n"
17442 #: ../fish/guestfish-actions.pod:941
17447 #: ../fish/guestfish-actions.pod:943
17450 " fgrepi pattern path\n"
17455 #: ../fish/guestfish-actions.pod:951
17460 #: ../fish/guestfish-actions.pod:953
17468 #: ../fish/guestfish-actions.pod:965
17470 "This command can also be used on C</dev/> devices (and partitions, LV "
17471 "names). You can for example use this to determine if a device contains a "
17472 "filesystem, although it's usually better to use L</vfs-type>."
17476 #: ../fish/guestfish-actions.pod:975
17477 msgid "file-architecture"
17481 #: ../fish/guestfish-actions.pod:977
17484 " file-architecture filename\n"
17489 #: ../fish/guestfish-actions.pod:1080
17494 #: ../fish/guestfish-actions.pod:1082
17502 #: ../fish/guestfish-actions.pod:1086
17504 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
17505 "L</is-file> etc. To get the size of block devices, use "
17506 "L</blockdev-getsize64>."
17510 #: ../fish/guestfish-actions.pod:1090
17515 #: ../fish/guestfish-actions.pod:1092
17518 " fill c len path\n"
17523 #: ../fish/guestfish-actions.pod:1098
17525 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
17526 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
17527 "L</fill-pattern>."
17531 #: ../fish/guestfish-actions.pod:1103
17532 msgid "fill-pattern"
17536 #: ../fish/guestfish-actions.pod:1105
17539 " fill-pattern pattern len path\n"
17544 #: ../fish/guestfish-actions.pod:1107
17546 "This function is like L</fill> except that it creates a new file of length "
17547 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
17548 "is truncated if necessary to ensure the length of the file is exactly C<len> "
17553 #: ../fish/guestfish-actions.pod:1112
17558 #: ../fish/guestfish-actions.pod:1114
17561 " find directory\n"
17566 #: ../fish/guestfish-actions.pod:1128
17567 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
17571 #: ../fish/guestfish-actions.pod:1141
17572 msgid "See also L</find0>."
17576 #: ../fish/guestfish-actions.pod:1146
17581 #: ../fish/guestfish-actions.pod:1148
17584 " find0 directory (files|-)\n"
17589 #: ../fish/guestfish-actions.pod:1154
17590 msgid "This command works the same way as L</find> with the following exceptions:"
17594 #: ../fish/guestfish-actions.pod:1181
17595 msgid "findfs-label"
17599 #: ../fish/guestfish-actions.pod:1183
17602 " findfs-label label\n"
17607 #: ../fish/guestfish-actions.pod:1189
17608 msgid "To find the label of a filesystem, use L</vfs-label>."
17612 #: ../fish/guestfish-actions.pod:1191
17613 msgid "findfs-uuid"
17617 #: ../fish/guestfish-actions.pod:1193
17620 " findfs-uuid uuid\n"
17625 #: ../fish/guestfish-actions.pod:1199
17626 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
17630 #: ../fish/guestfish-actions.pod:1201
17635 #: ../fish/guestfish-actions.pod:1203
17638 " fsck fstype device\n"
17643 #: ../fish/guestfish-actions.pod:1233
17648 #: ../fish/guestfish-actions.pod:1235
17656 #: ../fish/guestfish-actions.pod:1242
17657 msgid "get-autosync"
17661 #: ../fish/guestfish-actions.pod:1244
17669 #: ../fish/guestfish-actions.pod:1248
17674 #: ../fish/guestfish-actions.pod:1250
17682 #: ../fish/guestfish-actions.pod:1254
17683 msgid "get-e2label"
17687 #: ../fish/guestfish-actions.pod:1256
17690 " get-e2label device\n"
17695 #: ../fish/guestfish-actions.pod:1268
17700 #: ../fish/guestfish-actions.pod:1270
17703 " get-e2uuid device\n"
17708 #: ../fish/guestfish-actions.pod:1282
17709 msgid "get-memsize"
17713 #: ../fish/guestfish-actions.pod:1284
17721 #: ../fish/guestfish-actions.pod:1289
17723 "If L</set-memsize> was not called on this handle, and if "
17724 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
17725 "value for memsize."
17729 #: ../fish/guestfish-actions.pod:1296
17730 msgid "get-network"
17734 #: ../fish/guestfish-actions.pod:1298
17742 #: ../fish/guestfish-actions.pod:1302
17747 #: ../fish/guestfish-actions.pod:1304
17755 #: ../fish/guestfish-actions.pod:1311
17760 #: ../fish/guestfish-actions.pod:1313
17765 #: ../fish/guestfish-actions.pod:1315
17773 #: ../fish/guestfish-actions.pod:1322
17778 #: ../fish/guestfish-actions.pod:1324
17786 #: ../fish/guestfish-actions.pod:1331
17787 msgid "get-recovery-proc"
17791 #: ../fish/guestfish-actions.pod:1333
17794 " get-recovery-proc\n"
17799 #: ../fish/guestfish-actions.pod:1337
17800 msgid "get-selinux"
17804 #: ../fish/guestfish-actions.pod:1339
17812 #: ../fish/guestfish-actions.pod:1341
17814 "This returns the current setting of the selinux flag which is passed to the "
17815 "appliance at boot time. See L</set-selinux>."
17819 #: ../fish/guestfish-actions.pod:1347
17824 #: ../fish/guestfish-actions.pod:1349
17832 #: ../fish/guestfish-actions.pod:1356
17837 #: ../fish/guestfish-actions.pod:1358
17845 #: ../fish/guestfish-actions.pod:1362
17850 #: ../fish/guestfish-actions.pod:1364
17858 #: ../fish/guestfish-actions.pod:1366
17860 "Return the current umask. By default the umask is C<022> unless it has been "
17861 "set by calling L</umask>."
17865 #: ../fish/guestfish-actions.pod:1369
17866 msgid "get-verbose"
17870 #: ../fish/guestfish-actions.pod:1371
17878 #: ../fish/guestfish-actions.pod:1375
17883 #: ../fish/guestfish-actions.pod:1377
17891 #: ../fish/guestfish-actions.pod:1381
17892 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
17896 #: ../fish/guestfish-actions.pod:1384
17901 #: ../fish/guestfish-actions.pod:1386
17904 " getxattrs path\n"
17909 #: ../fish/guestfish-actions.pod:1394
17910 msgid "See also: L</lgetxattrs>, L<attr(5)>."
17914 #: ../fish/guestfish-actions.pod:1396
17915 msgid "glob-expand"
17919 #: ../fish/guestfish-actions.pod:1398
17922 " glob-expand pattern\n"
17927 #: ../fish/guestfish-actions.pod:1411
17932 #: ../fish/guestfish-actions.pod:1413
17935 " grep regex path\n"
17940 #: ../fish/guestfish-actions.pod:1421
17945 #: ../fish/guestfish-actions.pod:1423
17948 " grepi regex path\n"
17953 #: ../fish/guestfish-actions.pod:1431
17954 msgid "grub-install"
17958 #: ../fish/guestfish-actions.pod:1433
17961 " grub-install root device\n"
17966 #: ../fish/guestfish-actions.pod:1449
17971 #: ../fish/guestfish-actions.pod:1451
17979 #: ../fish/guestfish-actions.pod:1459
17984 #: ../fish/guestfish-actions.pod:1461
17987 " head-n nrlines path\n"
17992 #: ../fish/guestfish-actions.pod:1474
17997 #: ../fish/guestfish-actions.pod:1476
18005 #: ../fish/guestfish-actions.pod:1484
18010 #: ../fish/guestfish-actions.pod:1486
18013 " initrd-cat initrdpath filename\n"
18018 #: ../fish/guestfish-actions.pod:1498
18019 msgid "See also L</initrd-list>."
18023 #: ../fish/guestfish-actions.pod:1503
18024 msgid "initrd-list"
18028 #: ../fish/guestfish-actions.pod:1505
18031 " initrd-list path\n"
18036 #: ../fish/guestfish-actions.pod:1517
18037 msgid "inotify-add-watch"
18041 #: ../fish/guestfish-actions.pod:1519
18044 " inotify-add-watch path mask\n"
18049 #: ../fish/guestfish-actions.pod:1531
18050 msgid "inotify-close"
18054 #: ../fish/guestfish-actions.pod:1533
18062 #: ../fish/guestfish-actions.pod:1539
18063 msgid "inotify-files"
18067 #: ../fish/guestfish-actions.pod:1541
18075 #: ../fish/guestfish-actions.pod:1543
18077 "This function is a helpful wrapper around L</inotify-read> which just "
18078 "returns a list of pathnames of objects that were touched. The returned "
18079 "pathnames are sorted and deduplicated."
18083 #: ../fish/guestfish-actions.pod:1547
18084 msgid "inotify-init"
18088 #: ../fish/guestfish-actions.pod:1549
18091 " inotify-init maxevents\n"
18096 #: ../fish/guestfish-actions.pod:1555
18098 "C<maxevents> is the maximum number of events which will be queued up between "
18099 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
18100 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
18101 "default was 16384 events. Beyond this limit, the kernel throws away events, "
18102 "but records the fact that it threw them away by setting a flag "
18103 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
18107 #: ../fish/guestfish-actions.pod:1565
18109 "Before any events are generated, you have to add some watches to the "
18110 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
18111 "L</inotify-watch-all>."
18115 #: ../fish/guestfish-actions.pod:1571
18117 "Queued up events should be read periodically by calling L</inotify-read> (or "
18118 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
18119 "If you don't read the events out often enough then you risk the internal "
18120 "queue overflowing."
18124 #: ../fish/guestfish-actions.pod:1578
18126 "The handle should be closed after use by calling L</inotify-close>. This "
18127 "also removes any watches automatically."
18131 #: ../fish/guestfish-actions.pod:1587
18132 msgid "inotify-read"
18136 #: ../fish/guestfish-actions.pod:1589
18144 #: ../fish/guestfish-actions.pod:1602
18145 msgid "inotify-rm-watch"
18149 #: ../fish/guestfish-actions.pod:1604
18152 " inotify-rm-watch wd\n"
18157 #: ../fish/guestfish-actions.pod:1606
18158 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
18162 #: ../fish/guestfish-actions.pod:1609
18163 msgid "inspect-get-arch"
18167 #: ../fish/guestfish-actions.pod:1611
18170 " inspect-get-arch root\n"
18175 #: ../fish/guestfish-actions.pod:1613 ../fish/guestfish-actions.pod:1629 ../fish/guestfish-actions.pod:1675 ../fish/guestfish-actions.pod:1693 ../fish/guestfish-actions.pod:1714 ../fish/guestfish-actions.pod:1729 ../fish/guestfish-actions.pod:1752 ../fish/guestfish-actions.pod:1769
18177 "This function should only be called with a root device string as returned by "
18182 #: ../fish/guestfish-actions.pod:1616
18184 "This returns the architecture of the inspected operating system. The "
18185 "possible return values are listed under L</file-architecture>."
18189 #: ../fish/guestfish-actions.pod:1625
18190 msgid "inspect-get-distro"
18194 #: ../fish/guestfish-actions.pod:1627
18197 " inspect-get-distro root\n"
18202 #: ../fish/guestfish-actions.pod:1671
18203 msgid "inspect-get-filesystems"
18207 #: ../fish/guestfish-actions.pod:1673
18210 " inspect-get-filesystems root\n"
18215 #: ../fish/guestfish-actions.pod:1686
18217 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18218 "L</inspect-get-mountpoints>."
18222 #: ../fish/guestfish-actions.pod:1689
18223 msgid "inspect-get-major-version"
18227 #: ../fish/guestfish-actions.pod:1691
18230 " inspect-get-major-version root\n"
18235 #: ../fish/guestfish-actions.pod:1710
18236 msgid "inspect-get-minor-version"
18240 #: ../fish/guestfish-actions.pod:1712
18243 " inspect-get-minor-version root\n"
18248 #: ../fish/guestfish-actions.pod:1722
18250 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18251 "L</inspect-get-major-version>."
18255 #: ../fish/guestfish-actions.pod:1725
18256 msgid "inspect-get-mountpoints"
18260 #: ../fish/guestfish-actions.pod:1727
18263 " inspect-get-mountpoints root\n"
18268 #: ../fish/guestfish-actions.pod:1745
18270 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18271 "L</inspect-get-filesystems>."
18275 #: ../fish/guestfish-actions.pod:1748
18276 msgid "inspect-get-product-name"
18280 #: ../fish/guestfish-actions.pod:1750
18283 " inspect-get-product-name root\n"
18288 #: ../fish/guestfish-actions.pod:1765
18289 msgid "inspect-get-type"
18293 #: ../fish/guestfish-actions.pod:1767
18296 " inspect-get-type root\n"
18301 #: ../fish/guestfish-actions.pod:1796
18306 #: ../fish/guestfish-actions.pod:1798
18314 #: ../fish/guestfish-actions.pod:1813
18316 "You can pass the root string(s) returned to other L</inspect-get-*> "
18317 "functions in order to query further information about each operating system, "
18318 "such as the name and version."
18322 #: ../fish/guestfish-actions.pod:1818
18324 "This function uses other libguestfs features such as L</mount-ro> and "
18325 "L</umount-all> in order to mount and unmount filesystems and look at the "
18326 "contents. This should be called with no disks currently mounted. The "
18327 "function may also use Augeas, so any existing Augeas handle will be closed."
18331 #: ../fish/guestfish-actions.pod:1830 ../fish/guestfish-actions.pod:1986 ../fish/guestfish-actions.pod:2032
18332 msgid "See also L</list-filesystems>."
18336 #: ../fish/guestfish-actions.pod:1832
18337 msgid "is-blockdev"
18341 #: ../fish/guestfish-actions.pod:1834
18344 " is-blockdev path\n"
18349 #: ../fish/guestfish-actions.pod:1839 ../fish/guestfish-actions.pod:1857 ../fish/guestfish-actions.pod:1876 ../fish/guestfish-actions.pod:1885 ../fish/guestfish-actions.pod:1895 ../fish/guestfish-actions.pod:1929 ../fish/guestfish-actions.pod:1938
18350 msgid "See also L</stat>."
18354 #: ../fish/guestfish-actions.pod:1841
18359 #: ../fish/guestfish-actions.pod:1843
18367 #: ../fish/guestfish-actions.pod:1850
18372 #: ../fish/guestfish-actions.pod:1852
18375 " is-chardev path\n"
18380 #: ../fish/guestfish-actions.pod:1859
18385 #: ../fish/guestfish-actions.pod:1861
18393 #: ../fish/guestfish-actions.pod:1868
18398 #: ../fish/guestfish-actions.pod:1870
18406 #: ../fish/guestfish-actions.pod:1878
18411 #: ../fish/guestfish-actions.pod:1880
18419 #: ../fish/guestfish-actions.pod:1887
18424 #: ../fish/guestfish-actions.pod:1889
18432 #: ../fish/guestfish-actions.pod:1897
18433 msgid "is-launching"
18437 #: ../fish/guestfish-actions.pod:1899
18445 #: ../fish/guestfish-actions.pod:1906
18450 #: ../fish/guestfish-actions.pod:1908
18458 #: ../fish/guestfish-actions.pod:1913
18463 #: ../fish/guestfish-actions.pod:1915
18471 #: ../fish/guestfish-actions.pod:1922
18476 #: ../fish/guestfish-actions.pod:1924
18479 " is-socket path\n"
18484 #: ../fish/guestfish-actions.pod:1931
18489 #: ../fish/guestfish-actions.pod:1933
18492 " is-symlink path\n"
18497 #: ../fish/guestfish-actions.pod:1940
18498 msgid "kill-subprocess"
18502 #: ../fish/guestfish-actions.pod:1942
18505 " kill-subprocess\n"
18510 #: ../fish/guestfish-actions.pod:1946
18515 #: ../fish/guestfish-actions.pod:1948
18520 #: ../fish/guestfish-actions.pod:1950
18528 #: ../fish/guestfish-actions.pod:1958
18533 #: ../fish/guestfish-actions.pod:1960
18536 " lchown owner group path\n"
18541 #: ../fish/guestfish-actions.pod:1962
18543 "Change the file owner to C<owner> and group to C<group>. This is like "
18544 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
18549 #: ../fish/guestfish-actions.pod:1970
18554 #: ../fish/guestfish-actions.pod:1972
18557 " lgetxattrs path\n"
18562 #: ../fish/guestfish-actions.pod:1974
18564 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
18565 "it returns the extended attributes of the link itself."
18569 #: ../fish/guestfish-actions.pod:1978
18570 msgid "list-devices"
18574 #: ../fish/guestfish-actions.pod:1980
18582 #: ../fish/guestfish-actions.pod:1988
18583 msgid "list-filesystems"
18587 #: ../fish/guestfish-actions.pod:1990
18590 " list-filesystems\n"
18595 #: ../fish/guestfish-actions.pod:2009
18597 "This command runs other libguestfs commands, which might include L</mount> "
18598 "and L</umount>, and therefore you should use this soon after launch and only "
18599 "when nothing is mounted."
18603 #: ../fish/guestfish-actions.pod:2013
18605 "Not all of the filesystems returned will be mountable. In particular, swap "
18606 "partitions are returned in the list. Also this command does not check that "
18607 "each filesystem found is valid and mountable, and some filesystems might be "
18608 "mountable but require special options. Filesystems may not all belong to a "
18609 "single logical operating system (use L</inspect-os> to look for OSes)."
18613 #: ../fish/guestfish-actions.pod:2021
18614 msgid "list-partitions"
18618 #: ../fish/guestfish-actions.pod:2023
18621 " list-partitions\n"
18626 #: ../fish/guestfish-actions.pod:2029
18628 "This does not return logical volumes. For that you will need to call "
18633 #: ../fish/guestfish-actions.pod:2034
18638 #: ../fish/guestfish-actions.pod:2036
18646 #: ../fish/guestfish-actions.pod:2044
18651 #: ../fish/guestfish-actions.pod:2046
18654 " ln target linkname\n"
18659 #: ../fish/guestfish-actions.pod:2050
18664 #: ../fish/guestfish-actions.pod:2052
18667 " ln-f target linkname\n"
18672 #: ../fish/guestfish-actions.pod:2057
18677 #: ../fish/guestfish-actions.pod:2059
18680 " ln-s target linkname\n"
18685 #: ../fish/guestfish-actions.pod:2063
18690 #: ../fish/guestfish-actions.pod:2065
18693 " ln-sf target linkname\n"
18698 #: ../fish/guestfish-actions.pod:2070
18699 msgid "lremovexattr"
18703 #: ../fish/guestfish-actions.pod:2072
18706 " lremovexattr xattr path\n"
18711 #: ../fish/guestfish-actions.pod:2074
18713 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
18714 "it removes an extended attribute of the link itself."
18718 #: ../fish/guestfish-actions.pod:2078
18723 #: ../fish/guestfish-actions.pod:2080
18731 #: ../fish/guestfish-actions.pod:2086
18733 "This command is mostly useful for interactive sessions. Programs should "
18734 "probably use L</readdir> instead."
18738 #: ../fish/guestfish-actions.pod:2089
18743 #: ../fish/guestfish-actions.pod:2091
18746 " lsetxattr xattr val vallen path\n"
18751 #: ../fish/guestfish-actions.pod:2093
18753 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
18754 "sets an extended attribute of the link itself."
18758 #: ../fish/guestfish-actions.pod:2097
18763 #: ../fish/guestfish-actions.pod:2099
18771 #: ../fish/guestfish-actions.pod:2103
18773 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
18774 "the link is stat-ed, not the file it refers to."
18778 #: ../fish/guestfish-actions.pod:2109
18783 #: ../fish/guestfish-actions.pod:2111
18786 " lstatlist path 'names ...'\n"
18791 #: ../fish/guestfish-actions.pod:2113
18793 "This call allows you to perform the L</lstat> operation on multiple files, "
18794 "where all files are in the directory C<path>. C<names> is the list of files "
18795 "from this directory."
18799 #: ../fish/guestfish-actions.pod:2122
18801 "This call is intended for programs that want to efficiently list a directory "
18802 "contents without making many round-trips. See also L</lxattrlist> for a "
18803 "similarly efficient call for getting extended attributes. Very long "
18804 "directory listings might cause the protocol message size to be exceeded, "
18805 "causing this call to fail. The caller must split up such requests into "
18806 "smaller groups of names."
18810 #: ../fish/guestfish-actions.pod:2130
18811 msgid "luks-add-key"
18815 #: ../fish/guestfish-actions.pod:2132
18818 " luks-add-key device keyslot\n"
18823 #: ../fish/guestfish-actions.pod:2139
18825 "Note that if C<keyslot> already contains a key, then this command will "
18826 "fail. You have to use L</luks-kill-slot> first to remove that key."
18830 #: ../fish/guestfish-actions.pod:2143 ../fish/guestfish-actions.pod:2165 ../fish/guestfish-actions.pod:2178 ../fish/guestfish-actions.pod:2192 ../fish/guestfish-actions.pod:2215 ../fish/guestfish-actions.pod:2225
18832 "This command has one or more key or passphrase parameters. Guestfish will "
18833 "prompt for these separately."
18837 #: ../fish/guestfish-actions.pod:2146
18842 #: ../fish/guestfish-actions.pod:2148
18845 " luks-close device\n"
18850 #: ../fish/guestfish-actions.pod:2150
18852 "This closes a LUKS device that was created earlier by L</luks-open> or "
18853 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
18854 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
18855 "underlying block device."
18859 #: ../fish/guestfish-actions.pod:2156
18860 msgid "luks-format"
18864 #: ../fish/guestfish-actions.pod:2158
18867 " luks-format device keyslot\n"
18872 #: ../fish/guestfish-actions.pod:2171
18873 msgid "luks-format-cipher"
18877 #: ../fish/guestfish-actions.pod:2173
18880 " luks-format-cipher device keyslot cipher\n"
18885 #: ../fish/guestfish-actions.pod:2175
18887 "This command is the same as L</luks-format> but it also allows you to set "
18888 "the C<cipher> used."
18892 #: ../fish/guestfish-actions.pod:2184
18893 msgid "luks-kill-slot"
18897 #: ../fish/guestfish-actions.pod:2186
18900 " luks-kill-slot device keyslot\n"
18905 #: ../fish/guestfish-actions.pod:2195
18910 #: ../fish/guestfish-actions.pod:2197
18913 " luks-open device mapname\n"
18918 #: ../fish/guestfish-actions.pod:2211
18920 "If this block device contains LVM volume groups, then calling L</vgscan> "
18921 "followed by L</vg-activate-all> will make them visible."
18925 #: ../fish/guestfish-actions.pod:2218
18926 msgid "luks-open-ro"
18930 #: ../fish/guestfish-actions.pod:2220
18933 " luks-open-ro device mapname\n"
18938 #: ../fish/guestfish-actions.pod:2222
18940 "This is the same as L</luks-open> except that a read-only mapping is "
18945 #: ../fish/guestfish-actions.pod:2228
18950 #: ../fish/guestfish-actions.pod:2230
18953 " lvcreate logvol volgroup mbytes\n"
18958 #: ../fish/guestfish-actions.pod:2235
18959 msgid "lvm-clear-filter"
18963 #: ../fish/guestfish-actions.pod:2237
18966 " lvm-clear-filter\n"
18971 #: ../fish/guestfish-actions.pod:2239
18973 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
18978 #: ../fish/guestfish-actions.pod:2245
18979 msgid "lvm-remove-all"
18983 #: ../fish/guestfish-actions.pod:2247
18986 " lvm-remove-all\n"
18991 #: ../fish/guestfish-actions.pod:2255
18992 msgid "lvm-set-filter"
18996 #: ../fish/guestfish-actions.pod:2257
18999 " lvm-set-filter 'devices ...'\n"
19004 #: ../fish/guestfish-actions.pod:2282
19009 #: ../fish/guestfish-actions.pod:2284
19012 " lvremove device\n"
19017 #: ../fish/guestfish-actions.pod:2292
19022 #: ../fish/guestfish-actions.pod:2294
19025 " lvrename logvol newlogvol\n"
19030 #: ../fish/guestfish-actions.pod:2298
19035 #: ../fish/guestfish-actions.pod:2300
19038 " lvresize device mbytes\n"
19043 #: ../fish/guestfish-actions.pod:2306
19044 msgid "lvresize-free"
19048 #: ../fish/guestfish-actions.pod:2308
19051 " lvresize-free lv percent\n"
19056 #: ../fish/guestfish-actions.pod:2316
19061 #: ../fish/guestfish-actions.pod:2318
19069 #: ../fish/guestfish-actions.pod:2326
19070 msgid "See also L</lvs-full>, L</list-filesystems>."
19074 #: ../fish/guestfish-actions.pod:2328
19079 #: ../fish/guestfish-actions.pod:2330
19087 #: ../fish/guestfish-actions.pod:2335
19092 #: ../fish/guestfish-actions.pod:2337
19100 #: ../fish/guestfish-actions.pod:2341
19105 #: ../fish/guestfish-actions.pod:2343
19108 " lxattrlist path 'names ...'\n"
19113 #: ../fish/guestfish-actions.pod:2359
19115 "This call is intended for programs that want to efficiently list a directory "
19116 "contents without making many round-trips. See also L</lstatlist> for a "
19117 "similarly efficient call for getting standard stats. Very long directory "
19118 "listings might cause the protocol message size to be exceeded, causing this "
19119 "call to fail. The caller must split up such requests into smaller groups of "
19124 #: ../fish/guestfish-actions.pod:2367
19129 #: ../fish/guestfish-actions.pod:2369
19137 #: ../fish/guestfish-actions.pod:2373
19142 #: ../fish/guestfish-actions.pod:2375
19145 " mkdir-mode path mode\n"
19150 #: ../fish/guestfish-actions.pod:2384
19151 msgid "See also L</mkdir>, L</umask>"
19155 #: ../fish/guestfish-actions.pod:2386
19160 #: ../fish/guestfish-actions.pod:2388
19168 #: ../fish/guestfish-actions.pod:2393
19173 #: ../fish/guestfish-actions.pod:2395
19176 " mkdtemp template\n"
19181 #: ../fish/guestfish-actions.pod:2416
19186 #: ../fish/guestfish-actions.pod:2418
19189 " mke2fs-J fstype blocksize device journal\n"
19194 #: ../fish/guestfish-actions.pod:2426
19195 msgid "See also L</mke2journal>."
19199 #: ../fish/guestfish-actions.pod:2428
19204 #: ../fish/guestfish-actions.pod:2430
19207 " mke2fs-JL fstype blocksize device label\n"
19212 #: ../fish/guestfish-actions.pod:2435
19213 msgid "See also L</mke2journal-L>."
19217 #: ../fish/guestfish-actions.pod:2437
19222 #: ../fish/guestfish-actions.pod:2439
19225 " mke2fs-JU fstype blocksize device uuid\n"
19230 #: ../fish/guestfish-actions.pod:2444
19231 msgid "See also L</mke2journal-U>."
19235 #: ../fish/guestfish-actions.pod:2446
19236 msgid "mke2journal"
19240 #: ../fish/guestfish-actions.pod:2448
19243 " mke2journal blocksize device\n"
19248 #: ../fish/guestfish-actions.pod:2455
19249 msgid "mke2journal-L"
19253 #: ../fish/guestfish-actions.pod:2457
19256 " mke2journal-L blocksize label device\n"
19261 #: ../fish/guestfish-actions.pod:2461
19262 msgid "mke2journal-U"
19266 #: ../fish/guestfish-actions.pod:2463
19269 " mke2journal-U blocksize uuid device\n"
19274 #: ../fish/guestfish-actions.pod:2467
19279 #: ../fish/guestfish-actions.pod:2469
19282 " mkfifo mode path\n"
19287 #: ../fish/guestfish-actions.pod:2471
19289 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
19290 "is just a convenient wrapper around L</mknod>."
19294 #: ../fish/guestfish-actions.pod:2477
19299 #: ../fish/guestfish-actions.pod:2479
19302 " mkfs fstype device\n"
19307 #: ../fish/guestfish-actions.pod:2485
19312 #: ../fish/guestfish-actions.pod:2487
19315 " mkfs-b fstype blocksize device\n"
19320 #: ../fish/guestfish-actions.pod:2489
19322 "This call is similar to L</mkfs>, but it allows you to control the block "
19323 "size of the resulting filesystem. Supported block sizes depend on the "
19324 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
19328 #: ../fish/guestfish-actions.pod:2497
19329 msgid "mkmountpoint"
19333 #: ../fish/guestfish-actions.pod:2499
19336 " mkmountpoint exemptpath\n"
19341 #: ../fish/guestfish-actions.pod:2501
19343 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
19344 "to create extra mountpoints before mounting the first filesystem."
19348 #: ../fish/guestfish-actions.pod:2525
19353 #: ../fish/guestfish-actions.pod:2527
19356 " mknod mode devmajor devminor path\n"
19361 #: ../fish/guestfish-actions.pod:2537
19363 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
19364 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
19365 "regular file). These constants are available in the standard Linux header "
19366 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
19367 "wrappers around this command which bitwise OR in the appropriate constant "
19372 #: ../fish/guestfish-actions.pod:2547
19377 #: ../fish/guestfish-actions.pod:2549
19380 " mknod-b mode devmajor devminor path\n"
19385 #: ../fish/guestfish-actions.pod:2551
19387 "This call creates a block device node called C<path> with mode C<mode> and "
19388 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19389 "wrapper around L</mknod>."
19393 #: ../fish/guestfish-actions.pod:2557
19398 #: ../fish/guestfish-actions.pod:2559
19401 " mknod-c mode devmajor devminor path\n"
19406 #: ../fish/guestfish-actions.pod:2561
19408 "This call creates a char device node called C<path> with mode C<mode> and "
19409 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19410 "wrapper around L</mknod>."
19414 #: ../fish/guestfish-actions.pod:2567
19419 #: ../fish/guestfish-actions.pod:2569
19427 #: ../fish/guestfish-actions.pod:2573
19432 #: ../fish/guestfish-actions.pod:2575
19435 " mkswap-L label device\n"
19440 #: ../fish/guestfish-actions.pod:2583
19445 #: ../fish/guestfish-actions.pod:2585
19448 " mkswap-U uuid device\n"
19453 #: ../fish/guestfish-actions.pod:2589
19454 msgid "mkswap-file"
19458 #: ../fish/guestfish-actions.pod:2591
19461 " mkswap-file path\n"
19466 #: ../fish/guestfish-actions.pod:2595
19468 "This command just writes a swap file signature to an existing file. To "
19469 "create the file itself, use something like L</fallocate>."
19473 #: ../fish/guestfish-actions.pod:2598
19478 #: ../fish/guestfish-actions.pod:2600
19481 " modprobe modulename\n"
19486 #: ../fish/guestfish-actions.pod:2607
19491 #: ../fish/guestfish-actions.pod:2609
19494 " mount device mountpoint\n"
19499 #: ../fish/guestfish-actions.pod:2625
19501 "B<Important note:> When you use this call, the filesystem options C<sync> "
19502 "and C<noatime> are set implicitly. This was originally done because we "
19503 "thought it would improve reliability, but it turns out that I<-o sync> has a "
19504 "very large negative performance impact and negligible effect on "
19505 "reliability. Therefore we recommend that you avoid using L</mount> in any "
19506 "code that needs performance, and instead use L</mount-options> (use an empty "
19507 "string for the first parameter if you don't want any options)."
19511 #: ../fish/guestfish-actions.pod:2635
19516 #: ../fish/guestfish-actions.pod:2637
19519 " mount-loop file mountpoint\n"
19524 #: ../fish/guestfish-actions.pod:2643
19525 msgid "mount-options"
19529 #: ../fish/guestfish-actions.pod:2645
19532 " mount-options options device mountpoint\n"
19537 #: ../fish/guestfish-actions.pod:2647
19539 "This is the same as the L</mount> command, but it allows you to set the "
19540 "mount options as for the L<mount(8)> I<-o> flag."
19544 #: ../fish/guestfish-actions.pod:2655
19549 #: ../fish/guestfish-actions.pod:2657
19552 " mount-ro device mountpoint\n"
19557 #: ../fish/guestfish-actions.pod:2659
19559 "This is the same as the L</mount> command, but it mounts the filesystem with "
19560 "the read-only (I<-o ro>) flag."
19564 #: ../fish/guestfish-actions.pod:2662
19569 #: ../fish/guestfish-actions.pod:2664
19572 " mount-vfs options vfstype device mountpoint\n"
19577 #: ../fish/guestfish-actions.pod:2666
19579 "This is the same as the L</mount> command, but it allows you to set both the "
19580 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
19584 #: ../fish/guestfish-actions.pod:2670
19585 msgid "mountpoints"
19589 #: ../fish/guestfish-actions.pod:2672
19597 #: ../fish/guestfish-actions.pod:2674
19599 "This call is similar to L</mounts>. That call returns a list of devices. "
19600 "This one returns a hash table (map) of device name to directory where the "
19601 "device is mounted."
19605 #: ../fish/guestfish-actions.pod:2678
19610 #: ../fish/guestfish-actions.pod:2680
19618 #: ../fish/guestfish-actions.pod:2687
19619 msgid "See also: L</mountpoints>"
19623 #: ../fish/guestfish-actions.pod:2689
19628 #: ../fish/guestfish-actions.pod:2691
19636 #: ../fish/guestfish-actions.pod:2696
19637 msgid "ntfs-3g-probe"
19641 #: ../fish/guestfish-actions.pod:2698
19644 " ntfs-3g-probe true|false device\n"
19649 #: ../fish/guestfish-actions.pod:2712
19654 #: ../fish/guestfish-actions.pod:2714
19657 " ntfsresize device\n"
19662 #: ../fish/guestfish-actions.pod:2720
19663 msgid "ntfsresize-size"
19667 #: ../fish/guestfish-actions.pod:2722
19670 " ntfsresize-size device size\n"
19675 #: ../fish/guestfish-actions.pod:2724
19677 "This command is the same as L</ntfsresize> except that it allows you to "
19678 "specify the new size (in bytes) explicitly."
19682 #: ../fish/guestfish-actions.pod:2727
19687 #: ../fish/guestfish-actions.pod:2729
19690 " part-add device prlogex startsect endsect\n"
19695 #: ../fish/guestfish-actions.pod:2731
19697 "This command adds a partition to C<device>. If there is no partition table "
19698 "on the device, call L</part-init> first."
19702 #: ../fish/guestfish-actions.pod:2743
19704 "Creating a partition which covers the whole disk is not so easy. Use "
19705 "L</part-disk> to do that."
19709 #: ../fish/guestfish-actions.pod:2746
19714 #: ../fish/guestfish-actions.pod:2748
19717 " part-del device partnum\n"
19722 #: ../fish/guestfish-actions.pod:2756
19727 #: ../fish/guestfish-actions.pod:2758
19730 " part-disk device parttype\n"
19735 #: ../fish/guestfish-actions.pod:2760
19737 "This command is simply a combination of L</part-init> followed by "
19738 "L</part-add> to create a single primary partition covering the whole disk."
19742 #: ../fish/guestfish-actions.pod:2764
19744 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
19745 "possible values are described in L</part-init>."
19749 #: ../fish/guestfish-actions.pod:2770
19750 msgid "part-get-bootable"
19754 #: ../fish/guestfish-actions.pod:2772
19757 " part-get-bootable device partnum\n"
19762 #: ../fish/guestfish-actions.pod:2777
19763 msgid "See also L</part-set-bootable>."
19767 #: ../fish/guestfish-actions.pod:2779
19768 msgid "part-get-mbr-id"
19772 #: ../fish/guestfish-actions.pod:2781
19775 " part-get-mbr-id device partnum\n"
19780 #: ../fish/guestfish-actions.pod:2786 ../fish/guestfish-actions.pod:2924
19782 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
19783 "undefined results for other partition table types (see "
19784 "L</part-get-parttype>)."
19788 #: ../fish/guestfish-actions.pod:2790
19789 msgid "part-get-parttype"
19793 #: ../fish/guestfish-actions.pod:2792
19796 " part-get-parttype device\n"
19801 #: ../fish/guestfish-actions.pod:2797
19803 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
19804 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
19805 "possible, although unusual. See L</part-init> for a full list."
19809 #: ../fish/guestfish-actions.pod:2802
19814 #: ../fish/guestfish-actions.pod:2804
19817 " part-init device parttype\n"
19822 #: ../fish/guestfish-actions.pod:2810
19824 "Initially there are no partitions. Following this, you should call "
19825 "L</part-add> for each partition required."
19829 #: ../fish/guestfish-actions.pod:2873
19834 #: ../fish/guestfish-actions.pod:2875
19837 " part-list device\n"
19842 #: ../fish/guestfish-actions.pod:2890
19844 "Start of the partition I<in bytes>. To get sectors you have to divide by "
19845 "the device's sector size, see L</blockdev-getss>."
19849 #: ../fish/guestfish-actions.pod:2903
19850 msgid "part-set-bootable"
19854 #: ../fish/guestfish-actions.pod:2905
19857 " part-set-bootable device partnum true|false\n"
19862 #: ../fish/guestfish-actions.pod:2914
19863 msgid "part-set-mbr-id"
19867 #: ../fish/guestfish-actions.pod:2916
19870 " part-set-mbr-id device partnum idbyte\n"
19875 #: ../fish/guestfish-actions.pod:2928
19876 msgid "part-set-name"
19880 #: ../fish/guestfish-actions.pod:2930
19883 " part-set-name device partnum name\n"
19888 #: ../fish/guestfish-actions.pod:2938
19889 msgid "part-to-dev"
19893 #: ../fish/guestfish-actions.pod:2940
19896 " part-to-dev partition\n"
19901 #: ../fish/guestfish-actions.pod:2946
19903 "The named partition must exist, for example as a string returned from "
19904 "L</list-partitions>."
19908 #: ../fish/guestfish-actions.pod:2949
19909 msgid "ping-daemon"
19913 #: ../fish/guestfish-actions.pod:2951
19921 #: ../fish/guestfish-actions.pod:2958
19926 #: ../fish/guestfish-actions.pod:2960
19929 " pread path count offset\n"
19934 #: ../fish/guestfish-actions.pod:2968
19935 msgid "See also L</pwrite>."
19939 #: ../fish/guestfish-actions.pod:2973
19944 #: ../fish/guestfish-actions.pod:2975
19947 " pvcreate device\n"
19952 #: ../fish/guestfish-actions.pod:2981
19957 #: ../fish/guestfish-actions.pod:2983
19960 " pvremove device\n"
19965 #: ../fish/guestfish-actions.pod:2992
19970 #: ../fish/guestfish-actions.pod:2994
19973 " pvresize device\n"
19978 #: ../fish/guestfish-actions.pod:2999
19979 msgid "pvresize-size"
19983 #: ../fish/guestfish-actions.pod:3001
19986 " pvresize-size device size\n"
19991 #: ../fish/guestfish-actions.pod:3003
19993 "This command is the same as L</pvresize> except that it allows you to "
19994 "specify the new size (in bytes) explicitly."
19998 #: ../fish/guestfish-actions.pod:3006
20003 #: ../fish/guestfish-actions.pod:3008
20011 #: ../fish/guestfish-actions.pod:3016
20012 msgid "See also L</pvs-full>."
20016 #: ../fish/guestfish-actions.pod:3018
20021 #: ../fish/guestfish-actions.pod:3020
20029 #: ../fish/guestfish-actions.pod:3025
20034 #: ../fish/guestfish-actions.pod:3027
20042 #: ../fish/guestfish-actions.pod:3031
20047 #: ../fish/guestfish-actions.pod:3033
20050 " pwrite path content offset\n"
20055 #: ../fish/guestfish-actions.pod:3044
20056 msgid "See also L</pread>."
20060 #: ../fish/guestfish-actions.pod:3049
20065 #: ../fish/guestfish-actions.pod:3051
20068 " read-file path\n"
20073 #: ../fish/guestfish-actions.pod:3056
20075 "Unlike L</cat>, this function can correctly handle files that contain "
20076 "embedded ASCII NUL characters. However unlike L</download>, this function "
20077 "is limited in the total size of file that can be handled."
20081 #: ../fish/guestfish-actions.pod:3064
20086 #: ../fish/guestfish-actions.pod:3066
20089 " read-lines path\n"
20094 #: ../fish/guestfish-actions.pod:3073
20096 "Note that this function cannot correctly handle binary files (specifically, "
20097 "files containing C<\\0> character which is treated as end of line). For "
20098 "those you need to use the L</read-file> function which has a more complex "
20103 #: ../fish/guestfish-actions.pod:3078
20108 #: ../fish/guestfish-actions.pod:3080
20116 #: ../fish/guestfish-actions.pod:3132
20118 "This function is primarily intended for use by programs. To get a simple "
20119 "list of names, use L</ls>. To get a printable directory for human "
20120 "consumption, use L</ll>."
20124 #: ../fish/guestfish-actions.pod:3136
20129 #: ../fish/guestfish-actions.pod:3138
20137 #: ../fish/guestfish-actions.pod:3142
20138 msgid "readlinklist"
20142 #: ../fish/guestfish-actions.pod:3144
20145 " readlinklist path 'names ...'\n"
20150 #: ../fish/guestfish-actions.pod:3168
20155 #: ../fish/guestfish-actions.pod:3170
20163 #: ../fish/guestfish-actions.pod:3175
20164 msgid "removexattr"
20168 #: ../fish/guestfish-actions.pod:3177
20171 " removexattr xattr path\n"
20176 #: ../fish/guestfish-actions.pod:3182
20177 msgid "See also: L</lremovexattr>, L<attr(5)>."
20181 #: ../fish/guestfish-actions.pod:3184
20186 #: ../fish/guestfish-actions.pod:3186
20189 " resize2fs device\n"
20194 #: ../fish/guestfish-actions.pod:3191
20196 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
20197 "before calling this command. For unknown reasons C<resize2fs> sometimes "
20198 "gives an error about this and sometimes not. In any case, it is always safe "
20199 "to call L</e2fsck-f> before calling this function."
20203 #: ../fish/guestfish-actions.pod:3197
20204 msgid "resize2fs-size"
20208 #: ../fish/guestfish-actions.pod:3199
20211 " resize2fs-size device size\n"
20216 #: ../fish/guestfish-actions.pod:3201
20218 "This command is the same as L</resize2fs> except that it allows you to "
20219 "specify the new size (in bytes) explicitly."
20223 #: ../fish/guestfish-actions.pod:3204
20228 #: ../fish/guestfish-actions.pod:3206
20236 #: ../fish/guestfish-actions.pod:3210
20241 #: ../fish/guestfish-actions.pod:3212
20249 #: ../fish/guestfish-actions.pod:3218
20254 #: ../fish/guestfish-actions.pod:3220
20262 #: ../fish/guestfish-actions.pod:3224
20263 msgid "rmmountpoint"
20267 #: ../fish/guestfish-actions.pod:3226
20270 " rmmountpoint exemptpath\n"
20275 #: ../fish/guestfish-actions.pod:3228
20277 "This calls removes a mountpoint that was previously created with "
20278 "L</mkmountpoint>. See L</mkmountpoint> for full details."
20282 #: ../fish/guestfish-actions.pod:3232
20283 msgid "scrub-device"
20287 #: ../fish/guestfish-actions.pod:3234
20290 " scrub-device device\n"
20295 #: ../fish/guestfish-actions.pod:3245
20300 #: ../fish/guestfish-actions.pod:3247
20303 " scrub-file file\n"
20308 #: ../fish/guestfish-actions.pod:3257
20309 msgid "scrub-freespace"
20313 #: ../fish/guestfish-actions.pod:3259
20316 " scrub-freespace dir\n"
20321 #: ../fish/guestfish-actions.pod:3261
20323 "This command creates the directory C<dir> and then fills it with files until "
20324 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
20325 "deletes them. The intention is to scrub any free space on the partition "
20326 "containing C<dir>."
20330 #: ../fish/guestfish-actions.pod:3270
20335 #: ../fish/guestfish-actions.pod:3272
20340 #: ../fish/guestfish-actions.pod:3274
20343 " set-append append\n"
20348 #: ../fish/guestfish-actions.pod:3285
20349 msgid "set-autosync"
20353 #: ../fish/guestfish-actions.pod:3287
20358 #: ../fish/guestfish-actions.pod:3289
20361 " set-autosync true|false\n"
20366 #: ../fish/guestfish-actions.pod:3291
20368 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
20369 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
20370 "closed (also if the program exits without closing handles)."
20374 #: ../fish/guestfish-actions.pod:3299
20379 #: ../fish/guestfish-actions.pod:3301
20384 #: ../fish/guestfish-actions.pod:3303
20387 " set-direct true|false\n"
20392 #: ../fish/guestfish-actions.pod:3309
20394 "One consequence of this is that log messages aren't caught by the library "
20395 "and handled by L</set-log-message-callback>, but go straight to stdout."
20399 #: ../fish/guestfish-actions.pod:3318
20400 msgid "set-e2label"
20404 #: ../fish/guestfish-actions.pod:3320
20407 " set-e2label device label\n"
20412 #: ../fish/guestfish-actions.pod:3326
20414 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
20415 "label on a filesystem."
20419 #: ../fish/guestfish-actions.pod:3329
20424 #: ../fish/guestfish-actions.pod:3331
20427 " set-e2uuid device uuid\n"
20432 #: ../fish/guestfish-actions.pod:3338
20434 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
20435 "UUID of a filesystem."
20439 #: ../fish/guestfish-actions.pod:3341
20440 msgid "set-memsize"
20444 #: ../fish/guestfish-actions.pod:3343
20449 #: ../fish/guestfish-actions.pod:3345
20452 " set-memsize memsize\n"
20457 #: ../fish/guestfish-actions.pod:3347
20459 "This sets the memory size in megabytes allocated to the qemu subprocess. "
20460 "This only has any effect if called before L</launch>."
20464 #: ../fish/guestfish-actions.pod:3358
20465 msgid "set-network"
20469 #: ../fish/guestfish-actions.pod:3360
20474 #: ../fish/guestfish-actions.pod:3362
20477 " set-network true|false\n"
20482 #: ../fish/guestfish-actions.pod:3370
20483 msgid "You must call this before calling L</launch>, otherwise it has no effect."
20487 #: ../fish/guestfish-actions.pod:3373
20492 #: ../fish/guestfish-actions.pod:3375
20497 #: ../fish/guestfish-actions.pod:3377
20500 " set-path searchpath\n"
20505 #: ../fish/guestfish-actions.pod:3386
20510 #: ../fish/guestfish-actions.pod:3388
20515 #: ../fish/guestfish-actions.pod:3390
20523 #: ../fish/guestfish-actions.pod:3410
20524 msgid "set-recovery-proc"
20528 #: ../fish/guestfish-actions.pod:3412
20529 msgid "recovery-proc"
20533 #: ../fish/guestfish-actions.pod:3414
20536 " set-recovery-proc true|false\n"
20541 #: ../fish/guestfish-actions.pod:3416
20543 "If this is called with the parameter C<false> then L</launch> does not "
20544 "create a recovery process. The purpose of the recovery process is to stop "
20545 "runaway qemu processes in the case where the main program aborts abruptly."
20549 #: ../fish/guestfish-actions.pod:3421
20551 "This only has any effect if called before L</launch>, and the default is "
20556 #: ../fish/guestfish-actions.pod:3430
20557 msgid "set-selinux"
20561 #: ../fish/guestfish-actions.pod:3432
20566 #: ../fish/guestfish-actions.pod:3434
20569 " set-selinux true|false\n"
20574 #: ../fish/guestfish-actions.pod:3445
20579 #: ../fish/guestfish-actions.pod:3447
20584 #: ../fish/guestfish-actions.pod:3449
20587 " set-trace true|false\n"
20592 #: ../fish/guestfish-actions.pod:3465
20593 msgid "set-verbose"
20597 #: ../fish/guestfish-actions.pod:3467
20602 #: ../fish/guestfish-actions.pod:3469
20605 " set-verbose true|false\n"
20610 #: ../fish/guestfish-actions.pod:3476
20615 #: ../fish/guestfish-actions.pod:3478
20618 " setcon context\n"
20623 #: ../fish/guestfish-actions.pod:3485
20628 #: ../fish/guestfish-actions.pod:3487
20631 " setxattr xattr val vallen path\n"
20636 #: ../fish/guestfish-actions.pod:3493
20637 msgid "See also: L</lsetxattr>, L<attr(5)>."
20641 #: ../fish/guestfish-actions.pod:3495
20646 #: ../fish/guestfish-actions.pod:3497
20649 " sfdisk device cyls heads sectors 'lines ...'\n"
20654 #: ../fish/guestfish-actions.pod:3519
20655 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
20659 #: ../fish/guestfish-actions.pod:3525
20664 #: ../fish/guestfish-actions.pod:3527
20667 " sfdiskM device 'lines ...'\n"
20672 #: ../fish/guestfish-actions.pod:3529
20674 "This is a simplified interface to the L</sfdisk> command, where partition "
20675 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
20676 "you don't need to specify the cyls, heads and sectors parameters which were "
20677 "rarely if ever used anyway."
20681 #: ../fish/guestfish-actions.pod:3535
20682 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
20686 #: ../fish/guestfish-actions.pod:3541
20691 #: ../fish/guestfish-actions.pod:3543
20694 " sfdisk-N device partnum cyls heads sectors line\n"
20699 #: ../fish/guestfish-actions.pod:3548
20701 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
20702 "cyls/heads/sectors parameters."
20706 #: ../fish/guestfish-actions.pod:3551
20707 msgid "See also: L</part-add>"
20711 #: ../fish/guestfish-actions.pod:3556
20712 msgid "sfdisk-disk-geometry"
20716 #: ../fish/guestfish-actions.pod:3558
20719 " sfdisk-disk-geometry device\n"
20724 #: ../fish/guestfish-actions.pod:3560
20726 "This displays the disk geometry of C<device> read from the partition table. "
20727 "Especially in the case where the underlying block device has been resized, "
20728 "this can be different from the kernel's idea of the geometry (see "
20729 "L</sfdisk-kernel-geometry>)."
20733 #: ../fish/guestfish-actions.pod:3568
20734 msgid "sfdisk-kernel-geometry"
20738 #: ../fish/guestfish-actions.pod:3570
20741 " sfdisk-kernel-geometry device\n"
20746 #: ../fish/guestfish-actions.pod:3577
20751 #: ../fish/guestfish-actions.pod:3579
20754 " sfdisk-l device\n"
20759 #: ../fish/guestfish-actions.pod:3585
20760 msgid "See also: L</part-list>"
20764 #: ../fish/guestfish-actions.pod:3587
20769 #: ../fish/guestfish-actions.pod:3589
20777 #: ../fish/guestfish-actions.pod:3594
20778 msgid "This is like L</command>, but passes the command to:"
20782 #: ../fish/guestfish-actions.pod:3602
20783 msgid "All the provisos about L</command> apply to this call."
20787 #: ../fish/guestfish-actions.pod:3604
20792 #: ../fish/guestfish-actions.pod:3606
20795 " sh-lines command\n"
20800 #: ../fish/guestfish-actions.pod:3608
20801 msgid "This is the same as L</sh>, but splits the result into a list of lines."
20805 #: ../fish/guestfish-actions.pod:3611
20806 msgid "See also: L</command-lines>"
20810 #: ../fish/guestfish-actions.pod:3613
20815 #: ../fish/guestfish-actions.pod:3615
20823 #: ../fish/guestfish-actions.pod:3619
20828 #: ../fish/guestfish-actions.pod:3621
20836 #: ../fish/guestfish-actions.pod:3627
20841 #: ../fish/guestfish-actions.pod:3629
20849 #: ../fish/guestfish-actions.pod:3637
20854 #: ../fish/guestfish-actions.pod:3639
20862 #: ../fish/guestfish-actions.pod:3647
20867 #: ../fish/guestfish-actions.pod:3649
20870 " strings-e encoding path\n"
20875 #: ../fish/guestfish-actions.pod:3651
20877 "This is like the L</strings> command, but allows you to specify the encoding "
20878 "of strings that are looked for in the source file C<path>."
20882 #: ../fish/guestfish-actions.pod:3661
20884 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
20885 "ISO-8859-X (this is what L</strings> uses)."
20889 #: ../fish/guestfish-actions.pod:3693
20890 msgid "swapoff-device"
20894 #: ../fish/guestfish-actions.pod:3695
20897 " swapoff-device device\n"
20902 #: ../fish/guestfish-actions.pod:3697
20904 "This command disables the libguestfs appliance swap device or partition "
20905 "named C<device>. See L</swapon-device>."
20909 #: ../fish/guestfish-actions.pod:3701
20910 msgid "swapoff-file"
20914 #: ../fish/guestfish-actions.pod:3703
20917 " swapoff-file file\n"
20922 #: ../fish/guestfish-actions.pod:3707
20923 msgid "swapoff-label"
20927 #: ../fish/guestfish-actions.pod:3709
20930 " swapoff-label label\n"
20935 #: ../fish/guestfish-actions.pod:3714
20936 msgid "swapoff-uuid"
20940 #: ../fish/guestfish-actions.pod:3716
20943 " swapoff-uuid uuid\n"
20948 #: ../fish/guestfish-actions.pod:3721
20949 msgid "swapon-device"
20953 #: ../fish/guestfish-actions.pod:3723
20956 " swapon-device device\n"
20961 #: ../fish/guestfish-actions.pod:3725
20963 "This command enables the libguestfs appliance to use the swap device or "
20964 "partition named C<device>. The increased memory is made available for all "
20965 "commands, for example those run using L</command> or L</sh>."
20969 #: ../fish/guestfish-actions.pod:3737
20970 msgid "swapon-file"
20974 #: ../fish/guestfish-actions.pod:3739
20977 " swapon-file file\n"
20982 #: ../fish/guestfish-actions.pod:3741
20983 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
20987 #: ../fish/guestfish-actions.pod:3744
20988 msgid "swapon-label"
20992 #: ../fish/guestfish-actions.pod:3746
20995 " swapon-label label\n"
21000 #: ../fish/guestfish-actions.pod:3748
21002 "This command enables swap to a labeled swap partition. See "
21003 "L</swapon-device> for other notes."
21007 #: ../fish/guestfish-actions.pod:3751
21008 msgid "swapon-uuid"
21012 #: ../fish/guestfish-actions.pod:3753
21015 " swapon-uuid uuid\n"
21020 #: ../fish/guestfish-actions.pod:3755
21022 "This command enables swap to a swap partition with the given UUID. See "
21023 "L</swapon-device> for other notes."
21027 #: ../fish/guestfish-actions.pod:3758
21032 #: ../fish/guestfish-actions.pod:3760
21040 #: ../fish/guestfish-actions.pod:3768
21045 #: ../fish/guestfish-actions.pod:3770
21053 #: ../fish/guestfish-actions.pod:3778
21058 #: ../fish/guestfish-actions.pod:3780
21061 " tail-n nrlines path\n"
21066 #: ../fish/guestfish-actions.pod:3793
21071 #: ../fish/guestfish-actions.pod:3795
21074 " tar-in (tarfile|-) directory\n"
21079 #: ../fish/guestfish-actions.pod:3800
21080 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
21084 #: ../fish/guestfish-actions.pod:3805
21089 #: ../fish/guestfish-actions.pod:3807
21092 " tar-out directory (tarfile|-)\n"
21097 #: ../fish/guestfish-actions.pod:3812
21098 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
21102 #: ../fish/guestfish-actions.pod:3817
21107 #: ../fish/guestfish-actions.pod:3819
21110 " tgz-in (tarball|-) directory\n"
21115 #: ../fish/guestfish-actions.pod:3824
21116 msgid "To upload an uncompressed tarball, use L</tar-in>."
21120 #: ../fish/guestfish-actions.pod:3828
21125 #: ../fish/guestfish-actions.pod:3830
21128 " tgz-out directory (tarball|-)\n"
21133 #: ../fish/guestfish-actions.pod:3835
21134 msgid "To download an uncompressed tarball, use L</tar-out>."
21138 #: ../fish/guestfish-actions.pod:3839
21143 #: ../fish/guestfish-actions.pod:3841
21151 #: ../fish/guestfish-actions.pod:3850
21156 #: ../fish/guestfish-actions.pod:3852
21164 #: ../fish/guestfish-actions.pod:3857
21165 msgid "truncate-size"
21169 #: ../fish/guestfish-actions.pod:3859
21172 " truncate-size path size\n"
21177 #: ../fish/guestfish-actions.pod:3864
21179 "If the current file size is less than C<size> then the file is extended to "
21180 "the required size with zero bytes. This creates a sparse file (ie. disk "
21181 "blocks are not allocated for the file until you write to it). To create a "
21182 "non-sparse file of zeroes, use L</fallocate64> instead."
21186 #: ../fish/guestfish-actions.pod:3870
21191 #: ../fish/guestfish-actions.pod:3872
21194 " tune2fs-l device\n"
21199 #: ../fish/guestfish-actions.pod:3882
21204 #: ../fish/guestfish-actions.pod:3884
21207 " txz-in (tarball|-) directory\n"
21212 #: ../fish/guestfish-actions.pod:3891
21217 #: ../fish/guestfish-actions.pod:3893
21220 " txz-out directory (tarball|-)\n"
21225 #: ../fish/guestfish-actions.pod:3900
21230 #: ../fish/guestfish-actions.pod:3902
21238 #: ../fish/guestfish-actions.pod:3916
21239 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
21243 #: ../fish/guestfish-actions.pod:3921
21248 #: ../fish/guestfish-actions.pod:3923
21253 #: ../fish/guestfish-actions.pod:3925
21256 " umount pathordevice\n"
21261 #: ../fish/guestfish-actions.pod:3931
21266 #: ../fish/guestfish-actions.pod:3933
21267 msgid "unmount-all"
21271 #: ../fish/guestfish-actions.pod:3935
21279 #: ../fish/guestfish-actions.pod:3941
21284 #: ../fish/guestfish-actions.pod:3943
21287 " upload (filename|-) remotefilename\n"
21292 #: ../fish/guestfish-actions.pod:3950
21293 msgid "See also L</download>."
21297 #: ../fish/guestfish-actions.pod:3954
21298 msgid "upload-offset"
21302 #: ../fish/guestfish-actions.pod:3956
21305 " upload-offset (filename|-) remotefilename offset\n"
21310 #: ../fish/guestfish-actions.pod:3968
21312 "Note that there is no limit on the amount of data that can be uploaded with "
21313 "this call, unlike with L</pwrite>, and this call always writes the full "
21314 "amount unless an error occurs."
21318 #: ../fish/guestfish-actions.pod:3973
21319 msgid "See also L</upload>, L</pwrite>."
21323 #: ../fish/guestfish-actions.pod:3977
21328 #: ../fish/guestfish-actions.pod:3979
21331 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
21336 #: ../fish/guestfish-actions.pod:3998
21341 #: ../fish/guestfish-actions.pod:4000
21349 #: ../fish/guestfish-actions.pod:4027
21351 "I<Note:> Don't use this call to test for availability of features. In "
21352 "enterprise distributions we backport features from later versions into "
21353 "earlier versions, making this an unreliable way to test for features. Use "
21354 "L</available> instead."
21358 #: ../fish/guestfish-actions.pod:4033
21363 #: ../fish/guestfish-actions.pod:4035
21366 " vfs-label device\n"
21371 #: ../fish/guestfish-actions.pod:4042
21372 msgid "To find a filesystem from the label, use L</findfs-label>."
21376 #: ../fish/guestfish-actions.pod:4044
21381 #: ../fish/guestfish-actions.pod:4046
21384 " vfs-type device\n"
21389 #: ../fish/guestfish-actions.pod:4056
21394 #: ../fish/guestfish-actions.pod:4058
21397 " vfs-uuid device\n"
21402 #: ../fish/guestfish-actions.pod:4065
21403 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
21407 #: ../fish/guestfish-actions.pod:4067
21408 msgid "vg-activate"
21412 #: ../fish/guestfish-actions.pod:4069
21415 " vg-activate true|false 'volgroups ...'\n"
21420 #: ../fish/guestfish-actions.pod:4082
21421 msgid "vg-activate-all"
21425 #: ../fish/guestfish-actions.pod:4084
21428 " vg-activate-all true|false\n"
21433 #: ../fish/guestfish-actions.pod:4094
21438 #: ../fish/guestfish-actions.pod:4096
21441 " vgcreate volgroup 'physvols ...'\n"
21446 #: ../fish/guestfish-actions.pod:4101
21451 #: ../fish/guestfish-actions.pod:4103
21454 " vglvuuids vgname\n"
21459 #: ../fish/guestfish-actions.pod:4108
21461 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
21462 "logical volumes and volume groups."
21466 #: ../fish/guestfish-actions.pod:4111
21467 msgid "See also L</vgpvuuids>."
21471 #: ../fish/guestfish-actions.pod:4113
21476 #: ../fish/guestfish-actions.pod:4115
21479 " vgpvuuids vgname\n"
21484 #: ../fish/guestfish-actions.pod:4120
21486 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
21487 "physical volumes and volume groups."
21491 #: ../fish/guestfish-actions.pod:4123
21492 msgid "See also L</vglvuuids>."
21496 #: ../fish/guestfish-actions.pod:4125
21501 #: ../fish/guestfish-actions.pod:4127
21504 " vgremove vgname\n"
21509 #: ../fish/guestfish-actions.pod:4134
21514 #: ../fish/guestfish-actions.pod:4136
21517 " vgrename volgroup newvolgroup\n"
21522 #: ../fish/guestfish-actions.pod:4140
21527 #: ../fish/guestfish-actions.pod:4142
21535 #: ../fish/guestfish-actions.pod:4150
21536 msgid "See also L</vgs-full>."
21540 #: ../fish/guestfish-actions.pod:4152
21545 #: ../fish/guestfish-actions.pod:4154
21553 #: ../fish/guestfish-actions.pod:4159
21558 #: ../fish/guestfish-actions.pod:4161
21566 #: ../fish/guestfish-actions.pod:4166
21571 #: ../fish/guestfish-actions.pod:4168
21579 #: ../fish/guestfish-actions.pod:4172
21584 #: ../fish/guestfish-actions.pod:4174
21592 #: ../fish/guestfish-actions.pod:4179
21597 #: ../fish/guestfish-actions.pod:4181
21605 #: ../fish/guestfish-actions.pod:4186
21610 #: ../fish/guestfish-actions.pod:4188
21618 #: ../fish/guestfish-actions.pod:4193
21623 #: ../fish/guestfish-actions.pod:4195
21626 " write path content\n"
21631 #: ../fish/guestfish-actions.pod:4203
21636 #: ../fish/guestfish-actions.pod:4205
21639 " write-file path content size\n"
21644 #: ../fish/guestfish-actions.pod:4228
21649 #: ../fish/guestfish-actions.pod:4230
21652 " zegrep regex path\n"
21657 #: ../fish/guestfish-actions.pod:4238
21662 #: ../fish/guestfish-actions.pod:4240
21665 " zegrepi regex path\n"
21670 #: ../fish/guestfish-actions.pod:4248
21675 #: ../fish/guestfish-actions.pod:4250
21683 #: ../fish/guestfish-actions.pod:4258
21684 msgid "See also: L</zero-device>, L</scrub-device>."
21688 #: ../fish/guestfish-actions.pod:4260
21689 msgid "zero-device"
21693 #: ../fish/guestfish-actions.pod:4262
21696 " zero-device device\n"
21701 #: ../fish/guestfish-actions.pod:4264
21703 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
21704 "which just zeroes the first few blocks of a device."
21708 #: ../fish/guestfish-actions.pod:4271
21713 #: ../fish/guestfish-actions.pod:4273
21716 " zerofree device\n"
21721 #: ../fish/guestfish-actions.pod:4286
21726 #: ../fish/guestfish-actions.pod:4288
21729 " zfgrep pattern path\n"
21734 #: ../fish/guestfish-actions.pod:4296
21739 #: ../fish/guestfish-actions.pod:4298
21742 " zfgrepi pattern path\n"
21747 #: ../fish/guestfish-actions.pod:4306
21752 #: ../fish/guestfish-actions.pod:4308
21755 " zfile meth path\n"
21760 #: ../fish/guestfish-actions.pod:4315
21761 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
21765 #: ../fish/guestfish-actions.pod:4325
21770 #: ../fish/guestfish-actions.pod:4327
21773 " zgrep regex path\n"
21778 #: ../fish/guestfish-actions.pod:4335
21783 #: ../fish/guestfish-actions.pod:4337
21786 " zgrepi regex path\n"
21791 #: ../fish/guestfish-commands.pod:1
21796 #: ../fish/guestfish-commands.pod:3
21801 #: ../fish/guestfish-commands.pod:5
21804 " alloc filename size\n"
21809 #: ../fish/guestfish-commands.pod:7
21811 "This creates an empty (zeroed) file of the given size, and then adds so it "
21812 "can be further examined."
21816 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
21817 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
21821 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
21822 msgid "Size can be specified using standard suffixes, eg. C<1M>."
21826 #: ../fish/guestfish-commands.pod:14
21828 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
21829 "image, see L</PREPARED DISK IMAGES>."
21833 #: ../fish/guestfish-commands.pod:17
21838 #: ../fish/guestfish-commands.pod:19
21841 " copy-in local [local ...] /remotedir\n"
21846 #: ../fish/guestfish-commands.pod:21
21848 "C<copy-in> copies local files or directories recursively into the disk "
21849 "image, placing them in the directory called C</remotedir> (which must "
21850 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
21851 "other commands as necessary."
21855 #: ../fish/guestfish-commands.pod:26
21857 "Multiple local files and directories can be specified, but the last "
21858 "parameter must always be a remote directory. Wildcards cannot be used."
21862 #: ../fish/guestfish-commands.pod:30
21867 #: ../fish/guestfish-commands.pod:32
21870 " copy-out remote [remote ...] localdir\n"
21875 #: ../fish/guestfish-commands.pod:34
21877 "C<copy-out> copies remote files or directories recursively out of the disk "
21878 "image, placing them on the host disk in a local directory called C<localdir> "
21879 "(which must exist). This guestfish meta-command turns into a sequence of "
21880 "L</download>, L</tar-out> and other commands as necessary."
21884 #: ../fish/guestfish-commands.pod:40
21886 "Multiple remote files and directories can be specified, but the last "
21887 "parameter must always be a local directory. To download to the current "
21888 "directory, use C<.> as in:"
21892 #: ../fish/guestfish-commands.pod:44
21895 " copy-out /home .\n"
21900 #: ../fish/guestfish-commands.pod:46
21902 "Wildcards cannot be used in the ordinary command, but you can use them with "
21903 "the help of L</glob> like this:"
21907 #: ../fish/guestfish-commands.pod:49
21910 " glob copy-out /home/* .\n"
21915 #: ../fish/guestfish-commands.pod:51
21920 #: ../fish/guestfish-commands.pod:53
21923 " echo [params ...]\n"
21928 #: ../fish/guestfish-commands.pod:55
21929 msgid "This echos the parameters to the terminal."
21933 #: ../fish/guestfish-commands.pod:57
21938 #: ../fish/guestfish-commands.pod:59
21943 #: ../fish/guestfish-commands.pod:61
21948 #: ../fish/guestfish-commands.pod:63
21956 #: ../fish/guestfish-commands.pod:65
21958 "This is used to edit a file. It downloads the file, edits it locally using "
21959 "your editor, then uploads the result."
21963 #: ../fish/guestfish-commands.pod:68
21965 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
21966 "or C<emacs> you will get those corresponding editors."
21970 #: ../fish/guestfish-commands.pod:72
21975 #: ../fish/guestfish-commands.pod:74
21978 " glob command args...\n"
21983 #: ../fish/guestfish-commands.pod:76
21985 "Expand wildcards in any paths in the args list, and run C<command> "
21986 "repeatedly on each matching path."
21990 #: ../fish/guestfish-commands.pod:79
21991 msgid "See L</WILDCARDS AND GLOBBING>."
21995 #: ../fish/guestfish-commands.pod:81
22000 #: ../fish/guestfish-commands.pod:83
22003 " hexedit <filename|device>\n"
22004 " hexedit <filename|device> <max>\n"
22005 " hexedit <filename|device> <start> <max>\n"
22010 #: ../fish/guestfish-commands.pod:87
22012 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
22017 #: ../fish/guestfish-commands.pod:90
22019 "This command works by downloading potentially the whole file or device, "
22020 "editing it locally, then uploading it. If the file or device is large, you "
22021 "have to specify which part you wish to edit by using C<max> and/or C<start> "
22022 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
22023 "usual modifiers allowed such as C<1M> (1 megabyte)."
22027 #: ../fish/guestfish-commands.pod:97
22028 msgid "For example to edit the first few sectors of a disk you might do:"
22032 #: ../fish/guestfish-commands.pod:100
22035 " hexedit /dev/sda 1M\n"
22040 #: ../fish/guestfish-commands.pod:102
22042 "which would allow you to edit anywhere within the first megabyte of the "
22047 #: ../fish/guestfish-commands.pod:105
22048 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
22052 #: ../fish/guestfish-commands.pod:107
22055 " hexedit /dev/sda1 0x400 0x400\n"
22060 #: ../fish/guestfish-commands.pod:109
22061 msgid "(assuming the superblock is in the standard location)."
22065 #: ../fish/guestfish-commands.pod:111
22067 "This command requires the external L<hexedit(1)> program. You can specify "
22068 "another program to use by setting the C<HEXEDITOR> environment variable."
22072 #: ../fish/guestfish-commands.pod:115
22073 msgid "See also L</hexdump>."
22077 #: ../fish/guestfish-commands.pod:117
22082 #: ../fish/guestfish-commands.pod:119
22090 #: ../fish/guestfish-commands.pod:121
22091 msgid "Change the local directory, ie. the current directory of guestfish itself."
22095 #: ../fish/guestfish-commands.pod:124
22096 msgid "Note that C<!cd> won't do what you might expect."
22100 #: ../fish/guestfish-commands.pod:126
22105 #: ../fish/guestfish-commands.pod:128
22110 #: ../fish/guestfish-commands.pod:130
22118 #: ../fish/guestfish-commands.pod:132
22119 msgid "Opens the manual page for guestfish."
22123 #: ../fish/guestfish-commands.pod:134
22128 #: ../fish/guestfish-commands.pod:136
22133 #: ../fish/guestfish-commands.pod:138
22141 #: ../fish/guestfish-commands.pod:140
22149 #: ../fish/guestfish-commands.pod:142
22150 msgid "This is used to view a file."
22154 #: ../fish/guestfish-commands.pod:144
22156 "The default viewer is C<$PAGER>. However if you use the alternate command "
22157 "C<less> you will get the C<less> command specifically."
22161 #: ../fish/guestfish-commands.pod:147
22166 #: ../fish/guestfish-commands.pod:149
22174 #: ../fish/guestfish-commands.pod:151
22176 "Close and reopen the libguestfs handle. It is not necessary to use this "
22177 "normally, because the handle is closed properly when guestfish exits. "
22178 "However this is occasionally useful for testing."
22182 #: ../fish/guestfish-commands.pod:155
22187 #: ../fish/guestfish-commands.pod:157
22190 " sparse filename size\n"
22195 #: ../fish/guestfish-commands.pod:159
22197 "This creates an empty sparse file of the given size, and then adds so it can "
22198 "be further examined."
22202 #: ../fish/guestfish-commands.pod:162
22204 "In all respects it works the same as the L</alloc> command, except that the "
22205 "image file is allocated sparsely, which means that disk blocks are not "
22206 "assigned to the file until they are needed. Sparse disk files only use "
22207 "space when written to, but they are slower and there is a danger you could "
22208 "run out of real disk space during a write operation."
22212 #: ../fish/guestfish-commands.pod:172
22217 #: ../fish/guestfish-commands.pod:174
22225 #: ../fish/guestfish-commands.pod:176
22227 "This command returns a list of the optional groups known to the daemon, and "
22228 "indicates which ones are supported by this build of the libguestfs "
22233 #: ../fish/guestfish-commands.pod:180
22234 msgid "See also L<guestfs(3)/AVAILABILITY>."
22238 #: ../fish/guestfish-commands.pod:182
22243 #: ../fish/guestfish-commands.pod:184
22246 " time command args...\n"
22251 #: ../fish/guestfish-commands.pod:186
22253 "Run the command as usual, but print the elapsed time afterwards. This can "
22254 "be useful for benchmarking operations."
22258 #: ../test-tool/libguestfs-test-tool.pod:5
22259 msgid "libguestfs-test-tool - End user tests for libguestfs"
22263 #: ../test-tool/libguestfs-test-tool.pod:9
22266 " libguestfs-test-tool [--options]\n"
22271 #: ../test-tool/libguestfs-test-tool.pod:13
22273 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
22274 "and developers, to allow them to check basic libguestfs functionality is "
22275 "working. This is needed because libguestfs occasionally breaks for reasons "
22276 "beyond our control: usually because of changes in the underlying qemu or "
22277 "kernel packages, or the host environment."
22281 #: ../test-tool/libguestfs-test-tool.pod:20
22282 msgid "If you suspect a problem in libguestfs, then just run:"
22286 #: ../test-tool/libguestfs-test-tool.pod:22
22289 " libguestfs-test-tool\n"
22294 #: ../test-tool/libguestfs-test-tool.pod:24
22295 msgid "It will print lots of diagnostic messages."
22299 #: ../test-tool/libguestfs-test-tool.pod:26
22300 msgid "If it runs to completion successfully, you will see this near the end:"
22304 #: ../test-tool/libguestfs-test-tool.pod:28
22307 " ===== TEST FINISHED OK =====\n"
22312 #: ../test-tool/libguestfs-test-tool.pod:30
22313 msgid "and the test tool will exit with code 0."
22317 #: ../test-tool/libguestfs-test-tool.pod:32
22319 "If it fails (and/or exits with non-zero error code), please paste the "
22320 "B<complete, unedited> output of the test tool into a bug report. More "
22321 "information about reporting bugs can be found on the "
22322 "L<http://libguestfs.org/> website."
22326 #: ../test-tool/libguestfs-test-tool.pod:41
22331 #: ../test-tool/libguestfs-test-tool.pod:43
22332 msgid "Display short usage information and exit."
22336 #: ../test-tool/libguestfs-test-tool.pod:45
22337 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
22341 #: ../test-tool/libguestfs-test-tool.pod:47
22343 "Pass an alternate name for the helper program. libguestfs-test-tool will "
22344 "normally look in the C<$libexec> directory that was configured when the tool "
22349 #: ../test-tool/libguestfs-test-tool.pod:51
22350 msgid "I<--qemu qemu_binary>"
22354 #: ../test-tool/libguestfs-test-tool.pod:53
22356 "If you have downloaded another qemu binary, point this option at the full "
22357 "path of the binary to try it."
22361 #: ../test-tool/libguestfs-test-tool.pod:56
22362 msgid "I<--qemudir qemu_source_dir>"
22366 #: ../test-tool/libguestfs-test-tool.pod:58
22368 "If you have compiled qemu from source, point this option at the source "
22369 "directory to try it."
22373 #: ../test-tool/libguestfs-test-tool.pod:61
22374 msgid "I<--timeout N>"
22378 #: ../test-tool/libguestfs-test-tool.pod:63
22380 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
22381 "does not usually need to be adjusted unless your machine is very slow."
22385 #: ../test-tool/libguestfs-test-tool.pod:69
22386 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
22390 #: ../test-tool/libguestfs-test-tool.pod:71
22392 "If you have compiled another version of qemu from source and would like to "
22393 "try that, then you can use the I<--qemudir> option to point to the qemu "
22394 "source directory."
22398 #: ../test-tool/libguestfs-test-tool.pod:75
22400 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
22401 "option to point to the binary."
22405 #: ../test-tool/libguestfs-test-tool.pod:78
22407 "When using an alternate qemu with libguestfs, usually you would need to "
22408 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
22409 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
22410 "when you use either of the I<--qemudir> or I<--qemu> options."
22414 #: ../test-tool/libguestfs-test-tool.pod:85
22416 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
22417 "I<1> if there was an error."
22421 #: ../test-tool/libguestfs-test-tool.pod:92
22422 msgid "/usr/libexec/libguestfs-test-tool-helper"
22426 #: ../test-tool/libguestfs-test-tool.pod:94
22428 "This helper program is run inside the appliance and provides additional "
22433 #: ../test-tool/libguestfs-test-tool.pod:97
22434 msgid "/usr/bin/mkisofs"
22438 #: ../test-tool/libguestfs-test-tool.pod:99
22440 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
22441 "which is used as part of the tests."
22445 #: ../test-tool/libguestfs-test-tool.pod:106
22447 "For the full list of environment variables which may affect libguestfs, "
22448 "please see the L<guestfs(3)> manual page."
22452 #: ../test-tool/libguestfs-test-tool.pod:111
22453 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
22457 #: ../test-tool/libguestfs-test-tool.pod:121 ../fuse/guestmount.pod:195
22458 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
22462 #: ../fuse/guestmount.pod:5
22463 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
22467 #: ../fuse/guestmount.pod:9
22470 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
22475 #: ../fuse/guestmount.pod:13
22477 "You must I<not> use C<guestmount> in read-write mode on live virtual "
22478 "machines. If you do this, you risk disk corruption in the VM."
22482 #: ../fuse/guestmount.pod:18
22484 "The guestmount program can be used to mount virtual machine filesystems and "
22485 "other disk images on the host. It uses libguestfs for access to the guest "
22486 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
22487 "a mountable device."
22491 #: ../fuse/guestmount.pod:23
22493 "Along with other options, you have to give at least one device (I<-a> "
22494 "option) and at least one mountpoint (I<-m> option). How this works is "
22495 "better explained in the L<guestfish(1)> manual page, or you can use "
22496 "L<virt-inspector(1)> and/or the wrapper script C<guestmount-wrapper> to help "
22501 #: ../fuse/guestmount.pod:29
22503 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
22504 "by you, and the filesystem will not be visible to any other users unless you "
22505 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
22506 "the filesystem, use the C<fusermount -u> command."
22510 #: ../fuse/guestmount.pod:37
22512 "For a typical Windows guest which has its main filesystem on the first "
22517 #: ../fuse/guestmount.pod:40
22520 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
22525 #: ../fuse/guestmount.pod:42
22527 "For a typical Linux guest which has a /boot filesystem on the first "
22528 "partition, and the root filesystem on a logical volume:"
22532 #: ../fuse/guestmount.pod:45
22535 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
22540 #: ../fuse/guestmount.pod:47
22542 "To get L<virt-inspector(1)> to do the hard work of detecting guest "
22543 "mountpoints for you:"
22547 #: ../fuse/guestmount.pod:50
22550 " guestmount $(virt-inspector --ro-fish MyGuest) /mnt\n"
22555 #: ../fuse/guestmount.pod:52
22557 "(or use --fish if you don't want it to be a read only mount). The option is "
22558 "called I<--ro-fish> or I<--fish> because these parameters are compatible "
22559 "with L<guestfish(1)>."
22563 #: ../fuse/guestmount.pod:56
22565 "If you don't know what filesystems are contained in a guest or disk image, "
22566 "use L<virt-list-filesystems(1)> first:"
22570 #: ../fuse/guestmount.pod:59
22573 " virt-list-filesystems MyGuest\n"
22578 #: ../fuse/guestmount.pod:61
22580 "If you want to trace the libguestfs calls but without excessive debugging, "
22585 #: ../fuse/guestmount.pod:64
22588 " guestmount [-a ... -m ...] --trace /mnt\n"
22593 #: ../fuse/guestmount.pod:66
22594 msgid "If you want to debug the program, we recommend:"
22598 #: ../fuse/guestmount.pod:68
22601 " guestmount [-a ... -m ...] --trace --verbose /mnt\n"
22606 #: ../fuse/guestmount.pod:76
22607 msgid "Add a block device or virtual machine image."
22611 #: ../fuse/guestmount.pod:78
22612 msgid "B<--dir-cache-timeout N>"
22616 #: ../fuse/guestmount.pod:80
22618 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22619 "seconds. The readdir cache [actually, there are several semi-independent "
22620 "caches] is populated after a readdir(2) call with the stat and extended "
22621 "attributes of the files in the directory, in anticipation that they will be "
22622 "requested soon after."
22626 #: ../fuse/guestmount.pod:86
22628 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22629 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22630 "requests, only cache existing ones."
22634 #: ../fuse/guestmount.pod:90
22635 msgid "B<--fuse-help>"
22639 #: ../fuse/guestmount.pod:92
22640 msgid "Display help on special FUSE options (see I<-o> below)."
22644 #: ../fuse/guestmount.pod:96
22645 msgid "Display brief help and exit."
22649 #: ../fuse/guestmount.pod:98
22650 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
22654 #: ../fuse/guestmount.pod:100
22656 "Mount the named partition or logical volume on the given mountpoint B<in the "
22657 "guest> (this has nothing to do with mountpoints in the host)."
22661 #: ../fuse/guestmount.pod:103
22663 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22664 "something on C</>."
22668 #: ../fuse/guestmount.pod:108
22670 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22671 "unmounted. If you specify this option, then we don't attempt to sync the "
22672 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22676 #: ../fuse/guestmount.pod:113
22677 msgid "B<-o option> | B<--option option>"
22681 #: ../fuse/guestmount.pod:115
22682 msgid "Pass extra options to FUSE."
22686 #: ../fuse/guestmount.pod:117
22688 "To get a list of all the extra options supported by FUSE, use the command "
22689 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22690 "of them are a good idea."
22694 #: ../fuse/guestmount.pod:121
22697 " guestmount --fuse-help\n"
22702 #: ../fuse/guestmount.pod:123
22703 msgid "Some potentially useful FUSE options:"
22707 #: ../fuse/guestmount.pod:127
22708 msgid "B<-o allow_other>"
22712 #: ../fuse/guestmount.pod:129
22713 msgid "Allow other users to see the filesystem."
22717 #: ../fuse/guestmount.pod:131
22718 msgid "B<-o attr_timeout=N>"
22722 #: ../fuse/guestmount.pod:133
22723 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22727 #: ../fuse/guestmount.pod:135
22728 msgid "B<-o kernel_cache>"
22732 #: ../fuse/guestmount.pod:137
22734 "Allow the kernel to cache files (reduces the number of reads that have to go "
22735 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22736 "afford the extra memory usage."
22740 #: ../fuse/guestmount.pod:141
22741 msgid "B<-o uid=N> B<-o gid=N>"
22745 #: ../fuse/guestmount.pod:143
22747 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22748 "the chosen values."
22752 #: ../fuse/guestmount.pod:150
22754 "Add devices and mount everything read-only. Also disallow writes and make "
22755 "the disk appear read-only to FUSE."
22759 #: ../fuse/guestmount.pod:153
22761 "This is highly recommended if you are not going to edit the guest disk. If "
22762 "the guest is running and this option is I<not> supplied, then there is a "
22763 "strong risk of disk corruption in the guest. We try to prevent this from "
22764 "happening, but it is not always possible."
22768 #: ../fuse/guestmount.pod:160
22769 msgid "Enable SELinux support for the guest."
22773 #: ../fuse/guestmount.pod:162
22778 #: ../fuse/guestmount.pod:164
22779 msgid "Trace libguestfs calls (to stderr)."
22783 #: ../fuse/guestmount.pod:166
22784 msgid "This also stops the daemon from forking into the background."
22788 #: ../fuse/guestmount.pod:170
22789 msgid "Enable verbose messages from underlying libguestfs."
22793 #: ../fuse/guestmount.pod:174
22794 msgid "Display the program version and exit."
22798 #: ../fuse/guestmount.pod:180
22800 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22801 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
22802 "L<http://fuse.sf.net/>."
22806 #: ../inspector/virt-inspector.pl:40
22808 "virt-inspector - Display OS version, kernel, drivers, mount points, "
22809 "applications, etc. in a virtual machine"
22813 #: ../inspector/virt-inspector.pl:44
22816 " virt-inspector [--connect URI] domname\n"
22821 #: ../inspector/virt-inspector.pl:46
22824 " virt-inspector guest.img [guest.img ...]\n"
22829 #: ../inspector/virt-inspector.pl:50
22831 "B<virt-inspector> examines a virtual machine and tries to determine the "
22832 "version of the OS, the kernel version, what drivers are installed, whether "
22833 "the virtual machine is fully virtualized (FV) or para-virtualized (PV), what "
22834 "applications are installed and more."
22838 #: ../inspector/virt-inspector.pl:55
22840 "Virt-inspector can produce output in several formats, including a readable "
22841 "text report, and XML for feeding into other programs."
22845 #: ../inspector/virt-inspector.pl:58
22847 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
22848 "libvirt domain (see: C<virsh list --all>)."
22852 #: ../inspector/virt-inspector.pl:61
22854 "You can also run virt-inspector directly on disk images from a single "
22855 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
22856 "has several block devices, in which case you should list them one after "
22857 "another, with the first corresponding to the guest's C</dev/sda>, the second "
22858 "to the guest's C</dev/sdb> and so on."
22862 #: ../inspector/virt-inspector.pl:67
22864 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22865 "inspect several virtual machines, you have to run virt-inspector several "
22866 "times (for example, from a shell script for-loop)."
22870 #: ../inspector/virt-inspector.pl:72
22872 "Because virt-inspector needs direct access to guest images, it won't "
22873 "normally work over remote libvirt connections."
22877 #: ../inspector/virt-inspector.pl:85 ../tools/virt-cat.pl:90 ../tools/virt-df.pl:81 ../tools/virt-edit.pl:83 ../tools/virt-list-filesystems.pl:60 ../tools/virt-list-partitions.pl:61 ../tools/virt-ls.pl:89 ../tools/virt-make-fs.pl:163 ../tools/virt-rescue.pl:113 ../tools/virt-tar.pl:109 ../tools/virt-win-reg.pl:182
22878 msgid "Display brief help."
22882 #: ../inspector/virt-inspector.pl:91 ../tools/virt-cat.pl:96 ../tools/virt-df.pl:87 ../tools/virt-edit.pl:89 ../tools/virt-list-filesystems.pl:66 ../tools/virt-list-partitions.pl:67 ../tools/virt-ls.pl:95 ../tools/virt-make-fs.pl:169 ../tools/virt-rescue.pl:119 ../tools/virt-resize.pl:249 ../tools/virt-tar.pl:115 ../tools/virt-win-reg.pl:188
22883 msgid "B<--version>"
22887 #: ../inspector/virt-inspector.pl:93 ../tools/virt-cat.pl:98 ../tools/virt-df.pl:89 ../tools/virt-edit.pl:91 ../tools/virt-list-filesystems.pl:68 ../tools/virt-list-partitions.pl:69 ../tools/virt-ls.pl:97 ../tools/virt-make-fs.pl:171 ../tools/virt-rescue.pl:121 ../tools/virt-resize.pl:251 ../tools/virt-tar.pl:117 ../tools/virt-win-reg.pl:190
22888 msgid "Display version number and exit."
22892 #: ../inspector/virt-inspector.pl:99 ../tools/virt-cat.pl:104 ../tools/virt-df.pl:95 ../tools/virt-edit.pl:113 ../tools/virt-list-filesystems.pl:74 ../tools/virt-list-partitions.pl:75 ../tools/virt-ls.pl:103 ../tools/virt-rescue.pl:135 ../tools/virt-tar.pl:123 ../tools/virt-win-reg.pl:204
22893 msgid "B<--connect URI> | B<-c URI>"
22897 #: ../inspector/virt-inspector.pl:101 ../tools/virt-cat.pl:106 ../tools/virt-df.pl:97 ../tools/virt-edit.pl:115 ../tools/virt-list-filesystems.pl:76 ../tools/virt-list-partitions.pl:77 ../tools/virt-ls.pl:105 ../tools/virt-rescue.pl:137 ../tools/virt-tar.pl:125 ../tools/virt-win-reg.pl:206
22899 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
22900 "to the default libvirt hypervisor."
22904 #: ../inspector/virt-inspector.pl:104
22906 "Libvirt is only used if you specify a C<domname> on the command line. If "
22907 "you specify guest block devices directly, then libvirt is not used at all."
22911 #: ../inspector/virt-inspector.pl:114
22913 "The following options select the output format. Use only one of them. The "
22914 "default is a readable text report."
22918 #: ../inspector/virt-inspector.pl:119
22919 msgid "B<--text> (default)"
22923 #: ../inspector/virt-inspector.pl:121
22924 msgid "Plain text report."
22928 #: ../inspector/virt-inspector.pl:123
22933 #: ../inspector/virt-inspector.pl:125
22934 msgid "Produce no output at all."
22938 #: ../inspector/virt-inspector.pl:127
22943 #: ../inspector/virt-inspector.pl:129
22945 "If you select I<--xml> then you get XML output which can be fed to other "
22950 #: ../inspector/virt-inspector.pl:132
22955 #: ../inspector/virt-inspector.pl:134
22957 "If you select I<--yaml> then you get YAML output which can be fed to other "
22962 #: ../inspector/virt-inspector.pl:137
22967 #: ../inspector/virt-inspector.pl:139
22969 "If you select I<--perl> then you get Perl structures output which can be "
22970 "used directly in another Perl program."
22974 #: ../inspector/virt-inspector.pl:142
22979 #: ../inspector/virt-inspector.pl:144
22980 msgid "B<--ro-fish>"
22984 #: ../inspector/virt-inspector.pl:146
22986 "If you select I<--fish> then we print a L<guestfish(1)> command line which "
22987 "will automatically mount up the filesystems on the correct mount points. "
22988 "Try this for example:"
22992 #: ../inspector/virt-inspector.pl:150
22995 " guestfish $(virt-inspector --fish guest.img)\n"
23000 #: ../inspector/virt-inspector.pl:152
23002 "I<--ro-fish> is the same, but the I<--ro> option is passed to guestfish so "
23003 "that the filesystems are mounted read-only."
23007 #: ../inspector/virt-inspector.pl:155
23012 #: ../inspector/virt-inspector.pl:157
23014 "In \"query mode\" we answer common questions about the guest, such as "
23015 "whether it is fullvirt or needs a Xen hypervisor to run."
23019 #: ../inspector/virt-inspector.pl:160
23020 msgid "See section I<QUERY MODE> below."
23024 #: ../inspector/virt-inspector.pl:166
23025 msgid "B<--windows-registry>"
23029 #: ../inspector/virt-inspector.pl:168
23031 "This flag is ignored for compatibility with earlier releases of the "
23036 #: ../inspector/virt-inspector.pl:171
23038 "In this version, if L<Win::Hivex(3)> is available, then we attempt to parse "
23039 "information out of the Registry for any Windows guest."
23043 #: ../inspector/virt-inspector.pl:218
23044 msgid "OUTPUT FORMAT"
23048 #: ../inspector/virt-inspector.pl:220
23051 " Operating system(s)\n"
23052 " -------------------\n"
23053 " Linux (distro + version)\n"
23054 " Windows (version)\n"
23057 " +--- Filesystems ---------- Installed apps --- Kernel & drivers\n"
23058 " ----------- -------------- ----------------\n"
23059 " mount point => device List of apps Extra information\n"
23060 " mount point => device and versions about kernel(s)\n"
23061 " ... and drivers\n"
23062 " swap => swap device\n"
23063 " (plus lots of extra information\n"
23064 " about each filesystem)\n"
23069 #: ../inspector/virt-inspector.pl:235
23070 msgid "The output of virt-inspector is a complex two-level data structure."
23074 #: ../inspector/virt-inspector.pl:237
23076 "At the top level is a list of the operating systems installed on the guest. "
23077 "(For the vast majority of guests, only a single OS is installed.) The data "
23078 "returned for the OS includes the name (Linux, Windows), the distribution and "
23083 #: ../inspector/virt-inspector.pl:242
23084 msgid "The diagram above shows what we return for each OS."
23088 #: ../inspector/virt-inspector.pl:244
23090 "With the I<--xml> option the output is mapped into an XML document. There "
23091 "is a RELAX-NG schema for this XML in the file I<virt-inspector.rng> which "
23092 "normally ships with virt-inspector, or can be found in the source."
23096 #: ../inspector/virt-inspector.pl:249
23098 "With the I<--fish> or I<--ro-fish> option the mount points are mapped to "
23099 "L<guestfish(1)> command line parameters, so that you can go in afterwards "
23100 "and inspect the guest with everything mounted in the right place. For "
23105 #: ../inspector/virt-inspector.pl:254
23108 " guestfish $(virt-inspector --ro-fish guest.img)\n"
23109 " ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot\n"
23114 #: ../inspector/virt-inspector.pl:589
23119 #: ../inspector/virt-inspector.pl:591
23121 "When you use C<virt-inspector --query>, the output is a series of lines of "
23126 #: ../inspector/virt-inspector.pl:594
23132 " xen_pv_drivers=no\n"
23137 #: ../inspector/virt-inspector.pl:599
23139 "(each answer is usually C<yes> or C<no>, or the line is completely missing "
23140 "if we could not determine the answer at all)."
23144 #: ../inspector/virt-inspector.pl:602
23146 "If the guest is multiboot, you can get apparently conflicting answers "
23147 "(eg. C<windows=yes> and C<linux=yes>, or a guest which is both fullvirt and "
23148 "has a Xen PV kernel). This is normal, and just means that the guest can do "
23149 "both things, although it might require operator intervention such as "
23150 "selecting a boot option when the guest is booting."
23154 #: ../inspector/virt-inspector.pl:609
23155 msgid "This section describes the full range of answers possible."
23159 #: ../inspector/virt-inspector.pl:630
23160 msgid "windows=(yes|no)"
23164 #: ../inspector/virt-inspector.pl:632
23165 msgid "Answer C<yes> if Microsoft Windows is installed in the guest."
23169 #: ../inspector/virt-inspector.pl:645
23170 msgid "linux=(yes|no)"
23174 #: ../inspector/virt-inspector.pl:647
23175 msgid "Answer C<yes> if a Linux kernel is installed in the guest."
23179 #: ../inspector/virt-inspector.pl:660
23180 msgid "rhel=(yes|no)"
23184 #: ../inspector/virt-inspector.pl:662
23185 msgid "Answer C<yes> if the guest contains Red Hat Enterprise Linux."
23189 #: ../inspector/virt-inspector.pl:676
23190 msgid "fedora=(yes|no)"
23194 #: ../inspector/virt-inspector.pl:678
23195 msgid "Answer C<yes> if the guest contains the Fedora Linux distribution."
23199 #: ../inspector/virt-inspector.pl:691
23200 msgid "debian=(yes|no)"
23204 #: ../inspector/virt-inspector.pl:693
23205 msgid "Answer C<yes> if the guest contains the Debian Linux distribution."
23209 #: ../inspector/virt-inspector.pl:706
23210 msgid "fullvirt=(yes|no)"
23214 #: ../inspector/virt-inspector.pl:708
23216 "Answer C<yes> if there is at least one operating system kernel installed in "
23217 "the guest which runs fully virtualized. Such a guest would require a "
23218 "hypervisor which supports full system virtualization."
23222 #: ../inspector/virt-inspector.pl:731
23223 msgid "xen_domU_kernel=(yes|no)"
23227 #: ../inspector/virt-inspector.pl:733
23229 "Answer C<yes> if there is at least one Linux kernel installed in the guest "
23230 "which is compiled as a Xen DomU (a Xen paravirtualized guest)."
23234 #: ../inspector/virt-inspector.pl:753
23235 msgid "xen_pv_drivers=(yes|no)"
23239 #: ../inspector/virt-inspector.pl:755
23241 "Answer C<yes> if the guest has Xen paravirtualized drivers installed "
23242 "(usually the kernel itself will be fully virtualized, but the PV drivers "
23243 "have been installed by the administrator for performance reasons)."
23247 #: ../inspector/virt-inspector.pl:777
23248 msgid "virtio_drivers=(yes|no)"
23252 #: ../inspector/virt-inspector.pl:779
23254 "Answer C<yes> if the guest has virtio paravirtualized drivers installed. "
23255 "Virtio drivers are commonly used to improve the performance of KVM."
23259 #: ../inspector/virt-inspector.pl:800
23260 msgid "userspace_arch=(x86_64|...)"
23264 #: ../inspector/virt-inspector.pl:802
23265 msgid "Print the architecture of userspace."
23269 #: ../inspector/virt-inspector.pl:804 ../inspector/virt-inspector.pl:825
23270 msgid "NB. For multi-boot VMs this can print several lines."
23274 #: ../inspector/virt-inspector.pl:821
23275 msgid "kernel_arch=(x86_64|...)"
23279 #: ../inspector/virt-inspector.pl:823
23280 msgid "Print the architecture of the kernel."
23284 #: ../inspector/virt-inspector.pl:848 ../tools/virt-df.pl:538
23286 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23287 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23291 #: ../inspector/virt-inspector.pl:857 ../tools/virt-cat.pl:175 ../tools/virt-df.pl:547 ../tools/virt-edit.pl:339 ../tools/virt-list-filesystems.pl:205 ../tools/virt-list-partitions.pl:242 ../tools/virt-ls.pl:223 ../tools/virt-make-fs.pl:554 ../tools/virt-rescue.pl:243 ../tools/virt-resize.pl:1409 ../tools/virt-tar.pl:270 ../tools/virt-win-reg.pl:489
23292 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
23296 #: ../inspector/virt-inspector.pl:859
23297 msgid "Matthew Booth L<mbooth@redhat.com>"
23301 #: ../inspector/virt-inspector.pl:863 ../tools/virt-cat.pl:179 ../tools/virt-list-filesystems.pl:209 ../tools/virt-ls.pl:227 ../tools/virt-tar.pl:274
23302 msgid "Copyright (C) 2009 Red Hat Inc."
23306 #: ../tools/virt-cat.pl:34
23307 msgid "virt-cat - Display a file in a virtual machine"
23311 #: ../tools/virt-cat.pl:38
23314 " virt-cat [--options] domname file\n"
23319 #: ../tools/virt-cat.pl:40
23322 " virt-cat [--options] disk.img [disk.img ...] file\n"
23327 #: ../tools/virt-cat.pl:44
23329 "C<virt-cat> is a command line tool to display the contents of C<file> where "
23330 "C<file> exists in the named virtual machine (or disk image)."
23334 #: ../tools/virt-cat.pl:47
23336 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
23337 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
23342 #: ../tools/virt-cat.pl:53
23343 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
23347 #: ../tools/virt-cat.pl:56
23350 " virt-cat mydomain /etc/fstab\n"
23355 #: ../tools/virt-cat.pl:58
23356 msgid "List syslog messages from a VM:"
23360 #: ../tools/virt-cat.pl:60
23363 " virt-cat mydomain /var/log/messages | tail\n"
23368 #: ../tools/virt-cat.pl:62
23369 msgid "Find out what DHCP IP address a VM acquired:"
23373 #: ../tools/virt-cat.pl:64
23376 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
23381 #: ../tools/virt-cat.pl:66
23382 msgid "Find out what packages were recently installed:"
23386 #: ../tools/virt-cat.pl:68
23389 " virt-cat mydomain /var/log/yum.log | tail\n"
23394 #: ../tools/virt-cat.pl:70
23395 msgid "Find out who is logged on inside a virtual machine:"
23399 #: ../tools/virt-cat.pl:72
23402 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
23408 #: ../tools/virt-cat.pl:75
23409 msgid "or who was logged on:"
23413 #: ../tools/virt-cat.pl:77
23416 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
23417 " last -f /tmp/wtmp\n"
23422 #: ../tools/virt-cat.pl:109 ../tools/virt-df.pl:100 ../tools/virt-edit.pl:118 ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80 ../tools/virt-ls.pl:108 ../tools/virt-rescue.pl:140 ../tools/virt-tar.pl:128 ../tools/virt-win-reg.pl:209
23424 "If you specify guest block devices directly, then libvirt is not used at "
23429 #: ../tools/virt-cat.pl:165
23431 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, "
23432 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23436 #: ../tools/virt-cat.pl:173 ../tools/virt-df.pl:545 ../tools/virt-edit.pl:337 ../tools/virt-list-filesystems.pl:203 ../tools/virt-list-partitions.pl:240 ../tools/virt-ls.pl:221 ../tools/virt-make-fs.pl:552 ../tools/virt-rescue.pl:241 ../tools/virt-resize.pl:1407 ../tools/virt-tar.pl:268 ../tools/virt-win-reg.pl:487
23441 #: ../tools/virt-df.pl:36
23442 msgid "virt-df - Display free space on virtual filesystems"
23446 #: ../tools/virt-df.pl:40
23449 " virt-df [--options]\n"
23454 #: ../tools/virt-df.pl:42
23457 " virt-df [--options] domname\n"
23462 #: ../tools/virt-df.pl:44
23465 " virt-df [--options] disk.img [disk.img ...]\n"
23470 #: ../tools/virt-df.pl:48
23472 "C<virt-df> is a command line tool to display free space on virtual machine "
23473 "filesystems. Unlike other tools, it doesn't just display the amount of "
23474 "space allocated to a virtual machine, but can look inside the virtual "
23475 "machine to see how much space is really being used."
23479 #: ../tools/virt-df.pl:53
23481 "It is like the L<df(1)> command, but for virtual machines, except that it "
23482 "also works for Windows virtual machines."
23486 #: ../tools/virt-df.pl:56
23488 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
23489 "of all active and inactive guests, and performs a C<df>-type operation on "
23490 "each one in turn, printing out the results."
23494 #: ../tools/virt-df.pl:60
23496 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
23497 "either the single named libvirt domain, or on the disk image(s) listed on "
23498 "the command line (which must all belong to a single VM). In this mode (with "
23499 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
23500 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
23504 #: ../tools/virt-df.pl:67
23506 "Use the C<--csv> option to get a format which can be easily parsed by other "
23507 "programs. Other options are mostly similar to standard C<df> options. See "
23508 "below for the complete list."
23512 #: ../tools/virt-df.pl:107
23517 #: ../tools/virt-df.pl:109
23519 "Write out the results in CSV format (comma-separated values). This format "
23520 "can be imported easily into databases and spreadsheets, but read L</NOTE "
23521 "ABOUT CSV FORMAT> below."
23525 #: ../tools/virt-df.pl:117
23526 msgid "B<--human-readable> | B<-h>"
23530 #: ../tools/virt-df.pl:119
23531 msgid "Print sizes in human-readable format."
23535 #: ../tools/virt-df.pl:121
23536 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
23540 #: ../tools/virt-df.pl:127
23541 msgid "B<--inodes> | B<-i>"
23545 #: ../tools/virt-df.pl:129
23546 msgid "Print inodes instead of blocks."
23550 #: ../tools/virt-df.pl:135
23551 msgid "B<--one-per-guest>"
23555 #: ../tools/virt-df.pl:137
23557 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
23558 "disks from several guests to a single libguestfs appliance."
23562 #: ../tools/virt-df.pl:140
23563 msgid "You might use this option in the following circumstances:"
23567 #: ../tools/virt-df.pl:146
23569 "If you think an untrusted guest might actively try to exploit the libguestfs "
23570 "appliance kernel, then this prevents one guest from interfering with the "
23571 "stats printed for another guest."
23575 #: ../tools/virt-df.pl:152
23577 "If the kernel has a bug which stops it from accessing a filesystem in one "
23578 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
23579 "and report stats for further guests."
23583 #: ../tools/virt-df.pl:512
23584 msgid "NOTE ABOUT CSV FORMAT"
23588 #: ../tools/virt-df.pl:514
23590 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
23591 "should be easy to parse, but it is definitely not easy to parse."
23595 #: ../tools/virt-df.pl:517
23597 "Myth: Just split fields at commas. Reality: This does I<not> work "
23598 "reliably. This example has two columns:"
23602 #: ../tools/virt-df.pl:520
23605 " \"foo,bar\",baz\n"
23610 #: ../tools/virt-df.pl:522
23612 "Myth: Read the file one line at a time. Reality: This does I<not> work "
23613 "reliably. This example has one row:"
23617 #: ../tools/virt-df.pl:525
23626 #: ../tools/virt-df.pl:528
23628 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
23629 "packaged in major Linux distributions)."
23633 #: ../tools/virt-df.pl:531
23635 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
23636 "or Python's built-in csv library)."
23640 #: ../tools/virt-df.pl:534
23641 msgid "Most spreadsheets and databases can import CSV directly."
23645 #: ../tools/virt-df.pl:551 ../tools/virt-edit.pl:343 ../tools/virt-list-partitions.pl:246 ../tools/virt-rescue.pl:247
23646 msgid "Copyright (C) 2009-2010 Red Hat Inc."
23650 #: ../tools/virt-edit.pl:35
23651 msgid "virt-edit - Edit a file in a virtual machine"
23655 #: ../tools/virt-edit.pl:39
23658 " virt-edit [--options] domname file\n"
23663 #: ../tools/virt-edit.pl:41
23666 " virt-edit [--options] disk.img [disk.img ...] file\n"
23671 #: ../tools/virt-edit.pl:43
23674 " virt-edit [domname|disk.img] file -e 'expr'\n"
23679 #: ../tools/virt-edit.pl:47
23681 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
23682 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
23683 "doing this, but doesn't catch all cases."
23687 #: ../tools/virt-edit.pl:53
23689 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
23690 "the named virtual machine (or disk image)."
23694 #: ../tools/virt-edit.pl:56
23696 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
23697 "you should look at the L<guestfish(1)> tool."
23701 #: ../tools/virt-edit.pl:61
23702 msgid "Edit the named files interactively:"
23706 #: ../tools/virt-edit.pl:63
23709 " virt-edit mydomain /boot/grub/grub.conf\n"
23714 #: ../tools/virt-edit.pl:65
23717 " virt-edit mydomain /etc/passwd\n"
23722 #: ../tools/virt-edit.pl:67
23724 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
23725 "below). To change the init default level to 5:"
23729 #: ../tools/virt-edit.pl:71
23732 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
23737 #: ../tools/virt-edit.pl:97
23738 msgid "B<--backup extension> | B<-b extension>"
23742 #: ../tools/virt-edit.pl:99
23744 "Create a backup of the original file I<in the guest disk image>. The backup "
23745 "has the original filename with C<extension> added."
23749 #: ../tools/virt-edit.pl:102
23751 "Usually the first character of C<extension> would be a dot C<.> so you would "
23756 #: ../tools/virt-edit.pl:105
23759 " virt-edit -b .orig [etc]\n"
23764 #: ../tools/virt-edit.pl:107
23765 msgid "By default, no backup file is made."
23769 #: ../tools/virt-edit.pl:125
23770 msgid "B<--expr EXPR> | B<-e EXPR>"
23774 #: ../tools/virt-edit.pl:127
23776 "Instead of launching the external editor, non-interactively apply the Perl "
23777 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
23782 #: ../tools/virt-edit.pl:131
23784 "Be careful to properly quote the expression to prevent it from being altered "
23789 #: ../tools/virt-edit.pl:250
23790 msgid "NON-INTERACTIVE EDITING"
23794 #: ../tools/virt-edit.pl:252
23796 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
23797 "administrator can interactively edit the file."
23801 #: ../tools/virt-edit.pl:255
23803 "There are two ways also to use C<virt-edit> from scripts in order to make "
23804 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
23805 "like this, it's less error-prone to write scripts directly using the "
23806 "libguestfs API and Augeas for configuration file editing.)"
23810 #: ../tools/virt-edit.pl:261
23812 "The first method is to temporarily set C<$EDITOR> to any script or program "
23813 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
23814 "update C<tmpfile> in place however it likes."
23818 #: ../tools/virt-edit.pl:265
23820 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
23821 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
23822 "instances of C<foo> with C<bar> in a file:"
23826 #: ../tools/virt-edit.pl:269
23829 " virt-edit domname filename -e 's/foo/bar/'\n"
23834 #: ../tools/virt-edit.pl:271
23836 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
23837 "For example to delete root's password you could do:"
23841 #: ../tools/virt-edit.pl:274
23844 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
23849 #: ../tools/virt-edit.pl:276
23851 "What really happens is that the snippet is evaluated as a Perl expression "
23852 "for each line of the file. The line, including the final C<\\n>, is passed "
23853 "in C<$_> and the expression should update C<$_> or leave it unchanged."
23857 #: ../tools/virt-edit.pl:281
23859 "To delete a line, set C<$_> to the empty string. For example, to delete the "
23860 "C<apache> user account from the password file you can do:"
23864 #: ../tools/virt-edit.pl:284
23867 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
23872 #: ../tools/virt-edit.pl:286
23874 "To insert a line, prepend or append it to C<$_>. However appending lines to "
23875 "the end of the file is rather difficult this way since there is no concept "
23876 "of \"last line of the file\" - your expression just doesn't get called "
23877 "again. You might want to use the first method (setting C<$EDITOR>) if you "
23882 #: ../tools/virt-edit.pl:292
23884 "The variable C<$lineno> contains the current line number. As is "
23885 "traditional, the first line in the file is number C<1>."
23889 #: ../tools/virt-edit.pl:295
23891 "The return value from the expression is ignored, but the expression may call "
23892 "C<die> in order to abort the whole program, leaving the original file "
23897 #: ../tools/virt-edit.pl:299
23899 "Remember when matching the end of a line that C<$_> may contain the final "
23900 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
23901 "newline then neither of these. Thus to match or substitute some text at the "
23902 "end of a line, use this regular expression:"
23906 #: ../tools/virt-edit.pl:304
23909 " /some text(\\r?\\n)?$/\n"
23914 #: ../tools/virt-edit.pl:306
23916 "Alternately, use the perl C<chomp> function, being careful not to chomp "
23917 "C<$_> itself (since that would remove all newlines from the file):"
23921 #: ../tools/virt-edit.pl:310
23924 " my $m = $_; chomp $m; $m =~ /some text$/\n"
23929 #: ../tools/virt-edit.pl:316
23934 #: ../tools/virt-edit.pl:318
23936 "If set, this string is used as the editor. It may contain arguments, "
23937 "eg. C<\"emacs -nw\">"
23941 #: ../tools/virt-edit.pl:321
23942 msgid "If not set, C<vi> is used."
23946 #: ../tools/virt-edit.pl:327
23948 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
23949 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, "
23950 "L<perl(1)>, L<perlre(1)>."
23954 #: ../tools/virt-list-filesystems.pl:32
23955 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
23959 #: ../tools/virt-list-filesystems.pl:36
23962 " virt-list-filesystems [--options] domname\n"
23967 #: ../tools/virt-list-filesystems.pl:38
23970 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
23975 #: ../tools/virt-list-filesystems.pl:42
23977 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
23978 "are contained in a virtual machine or disk image."
23982 #: ../tools/virt-list-filesystems.pl:46
23984 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
23985 "functionality. For more complex cases you should look at the "
23986 "L<guestfish(1)> tool."
23990 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-list-partitions.pl:95 ../tools/virt-ls.pl:115
23991 msgid "B<-l> | B<--long>"
23995 #: ../tools/virt-list-filesystems.pl:88
23997 "With this option, C<virt-list-filesystems> displays the type of each "
23998 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
24002 #: ../tools/virt-list-filesystems.pl:95
24003 msgid "B<-a> | B<--all>"
24007 #: ../tools/virt-list-filesystems.pl:97
24009 "Normally we only show mountable filesystems. If this option is given then "
24010 "swap devices are shown too."
24014 #: ../tools/virt-list-filesystems.pl:193
24016 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
24017 "L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
24018 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24022 #: ../tools/virt-list-partitions.pl:32
24023 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
24027 #: ../tools/virt-list-partitions.pl:36
24030 " virt-list-partitions [--options] domname\n"
24035 #: ../tools/virt-list-partitions.pl:38
24038 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
24043 #: ../tools/virt-list-partitions.pl:42
24045 "C<virt-list-partitions> is a command line tool to list the partitions that "
24046 "are contained in a virtual machine or disk image. It is mainly useful as a "
24047 "first step to using L<virt-resize(1)>."
24051 #: ../tools/virt-list-partitions.pl:47
24053 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
24054 "functionality. For more complex cases you should look at the "
24055 "L<guestfish(1)> tool."
24059 #: ../tools/virt-list-partitions.pl:87
24060 msgid "B<-h> | B<--human-readable>"
24064 #: ../tools/virt-list-partitions.pl:89
24065 msgid "Show sizes in human-readable form (eg. \"1G\")."
24069 #: ../tools/virt-list-partitions.pl:97
24071 "With this option, C<virt-list-partitions> displays the type and size of each "
24072 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
24076 #: ../tools/virt-list-partitions.pl:104
24077 msgid "B<-t> | B<--total>"
24081 #: ../tools/virt-list-partitions.pl:106
24082 msgid "Display the total size of each block device (as a separate row or rows)."
24086 #: ../tools/virt-list-partitions.pl:231
24088 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, "
24089 "L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
24090 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24094 #: ../tools/virt-ls.pl:35
24095 msgid "virt-ls - List files in a virtual machine"
24099 #: ../tools/virt-ls.pl:39
24102 " virt-ls [--options] domname directory\n"
24107 #: ../tools/virt-ls.pl:41
24110 " virt-ls [--options] disk.img [disk.img ...] directory\n"
24115 #: ../tools/virt-ls.pl:45
24117 "C<virt-ls> is a command line tool to list the names of files in a directory "
24118 "inside a virtual machine or disk image."
24122 #: ../tools/virt-ls.pl:48
24124 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
24125 "For more complex cases you should look at the L<guestfish(1)> tool."
24129 #: ../tools/virt-ls.pl:52
24131 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
24132 "simple listing is like the ordinary L<ls(1)> command:"
24136 #: ../tools/virt-ls.pl:55
24139 " $ virt-ls myguest /\n"
24147 #: ../tools/virt-ls.pl:60
24148 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
24152 #: ../tools/virt-ls.pl:62
24155 " $ virt-ls -l myguest /\n"
24157 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
24158 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
24164 #: ../tools/virt-ls.pl:68
24166 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
24167 "and directories recursively:"
24171 #: ../tools/virt-ls.pl:71
24174 " $ virt-ls -R myguest /tmp\n"
24182 #: ../tools/virt-ls.pl:76
24184 "You I<cannot> combine these options. To do more complicated things, use "
24189 #: ../tools/virt-ls.pl:117
24190 msgid "B<-R> | B<--recursive>"
24194 #: ../tools/virt-ls.pl:119
24196 "Select the mode. With neither of these options, C<virt-ls> produces a "
24197 "simple, flat list of the files in the named directory."
24201 #: ../tools/virt-ls.pl:122
24203 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
24204 "like the plain C<ls -l> command)."
24208 #: ../tools/virt-ls.pl:125
24210 "C<virt-ls -R> produces a recursive list of files starting at the named "
24211 "directory. See the documentation for the C<guestfs_find> command "
24212 "L<guestfs(3)> for precise details."
24216 #: ../tools/virt-ls.pl:129
24217 msgid "You cannot combine these options."
24221 #: ../tools/virt-ls.pl:212
24223 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
24224 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
24225 "L<http://libguestfs.org/>."
24229 #: ../tools/virt-make-fs.pl:37
24230 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
24234 #: ../tools/virt-make-fs.pl:41
24237 " virt-make-fs [--options] input.tar output.img\n"
24242 #: ../tools/virt-make-fs.pl:43
24245 " virt-make-fs [--options] input.tar.gz output.img\n"
24250 #: ../tools/virt-make-fs.pl:45
24253 " virt-make-fs [--options] directory output.img\n"
24258 #: ../tools/virt-make-fs.pl:49
24260 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
24261 "archive or some files in a directory. It is similar to tools like "
24262 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
24263 "it can create common filesystem types like ext2/3 or NTFS, which can be "
24264 "useful if you want to attach these filesystems to existing virtual machines "
24265 "(eg. to import large amounts of read-only data to a VM)."
24269 #: ../tools/virt-make-fs.pl:57
24270 msgid "Basic usage is:"
24274 #: ../tools/virt-make-fs.pl:59
24277 " virt-make-fs input output\n"
24282 #: ../tools/virt-make-fs.pl:61
24284 "where C<input> is either a directory containing files that you want to add, "
24285 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
24286 "C<output> is a disk image. The input type is detected automatically. The "
24287 "output disk image defaults to a raw ext2 image unless you specify extra "
24288 "flags (see L</OPTIONS> below)."
24292 #: ../tools/virt-make-fs.pl:67
24293 msgid "EXTRA SPACE"
24297 #: ../tools/virt-make-fs.pl:69
24299 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
24300 "the files that it contains, but might have extra space. Depending on how "
24301 "you are going to use the output, you might think this extra space is wasted "
24302 "and want to minimize it, or you might want to leave space so that more files "
24303 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
24304 "but you can use the C<--size> flag to leave space in the filesystem if you "
24309 #: ../tools/virt-make-fs.pl:77
24311 "An alternative way to leave extra space but not make the output image any "
24312 "bigger is to use an alternative disk image format (instead of the default "
24313 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
24314 "image format (check your hypervisor supports this before using it). This "
24315 "allows you to choose a large C<--size> but the extra space won't actually be "
24316 "allocated in the image until you try to store something in it."
24320 #: ../tools/virt-make-fs.pl:85
24322 "Don't forget that you can also use local commands including L<resize2fs(8)> "
24323 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
24324 "virt-make-resize to build another image from scratch."
24328 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
24333 #: ../tools/virt-make-fs.pl:91
24336 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
24341 #: ../tools/virt-make-fs.pl:93
24342 msgid "FILESYSTEM TYPE"
24346 #: ../tools/virt-make-fs.pl:95
24348 "The default filesystem type is C<ext2>. Just about any filesystem type that "
24349 "libguestfs supports can be used (but I<not> read-only formats like "
24350 "ISO9660). Here are some of the more common choices:"
24354 #: ../tools/virt-make-fs.pl:101
24359 #: ../tools/virt-make-fs.pl:103
24361 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
24362 "you are not going to use the filesystem in a way that requires the journal, "
24363 "then this is just wasted overhead."
24367 #: ../tools/virt-make-fs.pl:107
24368 msgid "I<ntfs> or I<vfat>"
24372 #: ../tools/virt-make-fs.pl:109
24373 msgid "Useful if exporting data to a Windows guest."
24377 #: ../tools/virt-make-fs.pl:111
24379 "I<Note for vfat>: The tar archive or local directory must only contain files "
24380 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
24381 "program running within libguestfs is unable to change the ownership of "
24382 "non-root files, since vfat itself does not support this."
24386 #: ../tools/virt-make-fs.pl:116
24391 #: ../tools/virt-make-fs.pl:118
24393 "Lower overhead than C<ext2>, but certain limitations on filename length and "
24394 "total filesystem size."
24398 #: ../tools/virt-make-fs.pl:125
24401 " virt-make-fs --type=minix input minixfs.img\n"
24406 #: ../tools/virt-make-fs.pl:127
24407 msgid "TO PARTITION OR NOT TO PARTITION"
24411 #: ../tools/virt-make-fs.pl:129
24412 msgid "Optionally virt-make-fs can add a partition table to the output disk."
24416 #: ../tools/virt-make-fs.pl:131
24418 "Adding a partition can make the disk image more compatible with certain "
24419 "virtualized operating systems which don't expect to see a filesystem "
24420 "directly located on a block device (Linux doesn't care and will happily "
24421 "handle both types)."
24425 #: ../tools/virt-make-fs.pl:136
24427 "On the other hand, if you have a partition table then the output image is no "
24428 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
24429 "directly on a partitioned disk image. (However libguestfs tools such as "
24430 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
24434 #: ../tools/virt-make-fs.pl:144
24435 msgid "Add an MBR partition:"
24439 #: ../tools/virt-make-fs.pl:146
24442 " virt-make-fs --partition -- input disk.img\n"
24447 #: ../tools/virt-make-fs.pl:148
24449 "If the output disk image could be terabyte-sized or larger, it's better to "
24450 "use an EFI/GPT-compatible partition table:"
24454 #: ../tools/virt-make-fs.pl:151
24457 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
24462 #: ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:196
24467 #: ../tools/virt-make-fs.pl:179
24468 msgid "Enable debugging information."
24472 #: ../tools/virt-make-fs.pl:185
24473 msgid "B<--size=E<lt>NE<gt>>"
24477 #: ../tools/virt-make-fs.pl:187
24478 msgid "B<--size=+E<lt>NE<gt>>"
24482 #: ../tools/virt-make-fs.pl:189
24483 msgid "B<-s E<lt>NE<gt>>"
24487 #: ../tools/virt-make-fs.pl:191
24488 msgid "B<-s +E<lt>NE<gt>>"
24492 #: ../tools/virt-make-fs.pl:193
24493 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
24497 #: ../tools/virt-make-fs.pl:196
24499 "If this option is I<not> given, then the output image will be just large "
24500 "enough to contain all the files, with not much wasted space."
24504 #: ../tools/virt-make-fs.pl:199
24506 "To choose a fixed size output disk, specify an absolute number followed by "
24507 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24508 "Petabytes or Exabytes. This must be large enough to contain all the input "
24509 "files, else you will get an error."
24513 #: ../tools/virt-make-fs.pl:204
24515 "To leave extra space, specify C<+> (plus sign) and a number followed by "
24516 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24517 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
24518 "the input files, and (approximately) an extra 200 MB free space."
24522 #: ../tools/virt-make-fs.pl:210
24524 "Note that virt-make-fs estimates free space, and therefore will not produce "
24525 "filesystems containing precisely the free space requested. (It is much more "
24526 "expensive and time-consuming to produce a filesystem which has precisely the "
24527 "desired free space)."
24531 #: ../tools/virt-make-fs.pl:219
24532 msgid "B<--format=E<lt>fmtE<gt>>"
24536 #: ../tools/virt-make-fs.pl:221
24537 msgid "B<-F E<lt>fmtE<gt>>"
24541 #: ../tools/virt-make-fs.pl:223
24542 msgid "Choose the output disk image format."
24546 #: ../tools/virt-make-fs.pl:225
24547 msgid "The default is C<raw> (raw disk image)."
24551 #: ../tools/virt-make-fs.pl:227
24553 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
24554 "that would really make sense here is C<qcow2>."
24558 #: ../tools/virt-make-fs.pl:234
24559 msgid "B<--type=E<lt>fsE<gt>>"
24563 #: ../tools/virt-make-fs.pl:236
24564 msgid "B<-t E<lt>fsE<gt>>"
24568 #: ../tools/virt-make-fs.pl:238
24569 msgid "Choose the output filesystem type."
24573 #: ../tools/virt-make-fs.pl:240
24574 msgid "The default is C<ext2>."
24578 #: ../tools/virt-make-fs.pl:242
24579 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
24583 #: ../tools/virt-make-fs.pl:249
24584 msgid "B<--partition>"
24588 #: ../tools/virt-make-fs.pl:251
24589 msgid "B<--partition=E<lt>parttypeE<gt>>"
24593 #: ../tools/virt-make-fs.pl:253
24595 "If specified, this flag adds an MBR partition table to the output disk "
24600 #: ../tools/virt-make-fs.pl:256
24602 "You can change the partition table type, eg. C<--partition=gpt> for large "
24607 #: ../tools/virt-make-fs.pl:259
24609 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
24610 "might consider the next parameter to be the partition type. For example:"
24614 #: ../tools/virt-make-fs.pl:263
24617 " virt-make-fs --partition input.tar ...\n"
24622 #: ../tools/virt-make-fs.pl:265
24624 "would cause virt-make-fs to think you wanted to use a partition type of "
24625 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
24626 "dash) between options and the input file argument:"
24630 #: ../tools/virt-make-fs.pl:269
24633 " virt-make-fs --partition -- input.tar ...\n"
24638 #: ../tools/virt-make-fs.pl:529
24640 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
24641 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
24642 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
24646 #: ../tools/virt-make-fs.pl:543 ../tools/virt-win-reg.pl:478
24648 "When reporting bugs, please enable debugging and capture the I<complete> "
24653 #: ../tools/virt-make-fs.pl:546
24656 " export LIBGUESTFS_DEBUG=1\n"
24657 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
24662 #: ../tools/virt-make-fs.pl:549
24664 "Attach /tmp/virt-make-fs.log to a new bug report at "
24665 "L<https://bugzilla.redhat.com/>"
24669 #: ../tools/virt-make-fs.pl:558 ../tools/virt-resize.pl:1413 ../tools/virt-win-reg.pl:493
24670 msgid "Copyright (C) 2010 Red Hat Inc."
24674 #: ../tools/virt-rescue.pl:33
24675 msgid "virt-rescue - Run a rescue shell on a virtual machine"
24679 #: ../tools/virt-rescue.pl:37
24682 " virt-rescue [--options] domname\n"
24687 #: ../tools/virt-rescue.pl:39
24690 " virt-rescue [--options] disk.img [disk.img ...]\n"
24695 #: ../tools/virt-rescue.pl:43
24697 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
24698 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
24699 "you from doing this, but doesn't catch all cases."
24703 #: ../tools/virt-rescue.pl:47
24705 "However if you use the I<--ro> (read only) option, then you can attach a "
24706 "shell to a live virtual machine. The results might be strange or "
24707 "inconsistent at times but you won't get disk corruption."
24711 #: ../tools/virt-rescue.pl:53
24713 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
24714 "need for a CD. virt-rescue gives you a rescue shell and some simple "
24715 "recovery tools which you can use to examine or rescue a virtual machine or "
24720 #: ../tools/virt-rescue.pl:58
24722 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
24723 "on disk image(s):"
24727 #: ../tools/virt-rescue.pl:61
24730 " virt-rescue GuestName\n"
24735 #: ../tools/virt-rescue.pl:63
24738 " virt-rescue --ro /path/to/disk.img\n"
24743 #: ../tools/virt-rescue.pl:65
24746 " virt-rescue /dev/sdc\n"
24751 #: ../tools/virt-rescue.pl:67
24752 msgid "For live VMs you I<must> use the --ro option."
24756 #: ../tools/virt-rescue.pl:69
24758 "When you run virt-rescue on a virtual machine or disk image, you are placed "
24759 "in an interactive bash shell where you can use many ordinary Linux "
24760 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
24761 "appliance. You must mount the virtual machine's filesystems by hand. There "
24762 "is an empty directory called C</sysroot> where you can mount filesystems."
24766 #: ../tools/virt-rescue.pl:76
24768 "In the example below, we list logical volumes, then choose one to mount "
24769 "under C</sysroot>:"
24773 #: ../tools/virt-rescue.pl:79
24777 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
24778 " lv_root vg_f11x64 -wi-a- 8.83G\n"
24779 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
24780 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
24781 " ><rescue> ls /sysroot\n"
24786 #: ../tools/virt-rescue.pl:86
24788 "If you don't know what filesystems are available on the virtual machine then "
24789 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
24793 #: ../tools/virt-rescue.pl:90 ../tools/virt-resize.pl:1350
24798 #: ../tools/virt-rescue.pl:92
24800 "Virt-rescue can be used on I<any> disk image file or device, not just a "
24801 "virtual machine. For example you can use it on a blank file if you want to "
24802 "partition that file (although we would recommend using L<guestfish(1)> "
24803 "instead as it is more suitable for this purpose). You can even use "
24804 "virt-rescue on things like SD cards."
24808 #: ../tools/virt-rescue.pl:98
24810 "This tool is just designed for quick interactive hacking on a virtual "
24811 "machine. For more structured access to a virtual machine disk image, you "
24812 "should use L<guestfs(3)>. To get a structured shell that you can use to "
24813 "make scripted changes to guests, use L<guestfish(1)>."
24817 #: ../tools/virt-rescue.pl:127
24818 msgid "B<--append kernelopts>"
24822 #: ../tools/virt-rescue.pl:129
24823 msgid "Pass additional options to the rescue kernel."
24827 #: ../tools/virt-rescue.pl:147
24828 msgid "B<--memsize MB> | B<-m MB>"
24832 #: ../tools/virt-rescue.pl:149
24834 "Change the amount of memory allocated to the rescue system. The default is "
24835 "set by libguestfs and is small but adequate for running system tools. The "
24836 "occasional program might need more memory. The parameter is specified in "
24841 #: ../tools/virt-rescue.pl:158
24842 msgid "B<--ro> | B<-r>"
24846 #: ../tools/virt-rescue.pl:160
24847 msgid "Open the image read-only."
24851 #: ../tools/virt-rescue.pl:172
24853 "Enable SELinux in the rescue appliance. You should read "
24854 "L<guestfs(3)/SELINUX> before using this option."
24858 #: ../tools/virt-rescue.pl:228
24860 "Several environment variables affect virt-rescue. See "
24861 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
24865 #: ../tools/virt-rescue.pl:233
24867 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
24868 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24872 #: ../tools/virt-resize.pl:42
24873 msgid "virt-resize - Resize a virtual machine disk"
24877 #: ../tools/virt-resize.pl:46
24880 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24881 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24882 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24887 #: ../tools/virt-resize.pl:52
24889 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24890 "larger or smaller overall, and resizing or deleting any partitions contained "
24895 #: ../tools/virt-resize.pl:56
24897 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24898 "not> be used on live virtual machines - for consistent results, shut the "
24899 "virtual machine down before resizing it."
24903 #: ../tools/virt-resize.pl:60
24905 "If you are not familiar with the associated tools: "
24906 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)> and L<virt-df(1)>, "
24907 "we recommend you go and read those manual pages first."
24911 #: ../tools/virt-resize.pl:68
24913 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
24914 "fill the extra 5GB of space."
24918 #: ../tools/virt-resize.pl:71
24921 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
24922 " virt-list-partitions -lht olddisk\n"
24923 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
24924 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
24929 #: ../tools/virt-resize.pl:76
24931 "As above, but make the /boot partition 200MB bigger, while giving the "
24932 "remaining space to /dev/sda2:"
24936 #: ../tools/virt-resize.pl:79
24939 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
24944 #: ../tools/virt-resize.pl:81
24945 msgid "DETAILED USAGE"
24949 #: ../tools/virt-resize.pl:83
24950 msgid "EXPANDING A VIRTUAL MACHINE DISK"
24954 #: ../tools/virt-resize.pl:87
24955 msgid "1. Shut down the virtual machine"
24959 #: ../tools/virt-resize.pl:89
24960 msgid "2. Locate input disk image"
24964 #: ../tools/virt-resize.pl:91
24966 "Locate the input disk image (ie. the file or device on the host containing "
24967 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
24968 "dumpxml> like this to find the disk image name:"
24972 #: ../tools/virt-resize.pl:95
24975 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
24976 " Found 1 nodes:\n"
24978 " <source dev=\"/dev/vg/lv_guest\" />\n"
24983 #: ../tools/virt-resize.pl:100
24984 msgid "3. Look at current sizing"
24988 #: ../tools/virt-resize.pl:102
24989 msgid "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
24993 #: ../tools/virt-resize.pl:105
24996 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
24997 " /dev/sda1 ext3 101.9M\n"
24998 " /dev/sda2 pv 7.9G\n"
24999 " /dev/sda device 8.0G\n"
25004 #: ../tools/virt-resize.pl:110
25006 "(This example is a virtual machine with an 8 GB disk which we would like to "
25007 "expand up to 10 GB)."
25011 #: ../tools/virt-resize.pl:113
25012 msgid "4. Create output disk"
25016 #: ../tools/virt-resize.pl:115
25018 "Virt-resize cannot do in-place disk modifications. You have to have space "
25019 "to store the resized output disk."
25023 #: ../tools/virt-resize.pl:118
25024 msgid "To store the resized disk image in a file, create a file of a suitable size:"
25028 #: ../tools/virt-resize.pl:121
25031 " # rm -f outdisk\n"
25032 " # truncate -s 10G outdisk\n"
25037 #: ../tools/virt-resize.pl:124
25038 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25042 #: ../tools/virt-resize.pl:126
25045 " # lvcreate -L 10G -n lv_name vg_name\n"
25050 #: ../tools/virt-resize.pl:128
25051 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25055 #: ../tools/virt-resize.pl:130
25058 " # virsh pool-list\n"
25059 " # virsh vol-create-as poolname newvol 10G\n"
25064 #: ../tools/virt-resize.pl:133
25069 #: ../tools/virt-resize.pl:135
25071 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25072 "file) and the output disk. The output disk is the one created in the "
25077 #: ../tools/virt-resize.pl:139
25080 " # virt-resize indisk outdisk\n"
25085 #: ../tools/virt-resize.pl:141
25087 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25088 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25089 "larger, then an extra, empty partition is created at the end of the disk "
25090 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25095 #: ../tools/virt-resize.pl:147
25097 "More realistically you'd want to expand existing partitions in the disk "
25098 "image by passing extra options (for the full list see the L</OPTIONS> "
25103 #: ../tools/virt-resize.pl:151
25105 "L</--expand> is the most useful option. It expands the named partition "
25106 "within the disk to fill any extra space:"
25110 #: ../tools/virt-resize.pl:154
25113 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25118 #: ../tools/virt-resize.pl:156
25120 "(In this case, an extra partition is I<not> created at the end of the disk, "
25121 "because there will be no unused space)."
25125 #: ../tools/virt-resize.pl:159
25127 "L</--resize> is the other commonly used option. The following would "
25128 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25129 "rest of the available space:"
25133 #: ../tools/virt-resize.pl:163
25136 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25137 " indisk outdisk\n"
25142 #: ../tools/virt-resize.pl:166
25144 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25145 "if virt-resize knows how, it will resize the contents, the equivalent of "
25146 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
25147 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
25148 "filesystems, so you would have to online resize them after booting the "
25149 "guest. And virt-resize also does not resize anything inside an LVM PV, it "
25150 "just resizes the PV itself and leaves the user to resize any LVs inside that "
25155 #: ../tools/virt-resize.pl:175
25156 msgid "Other options are covered below."
25160 #: ../tools/virt-resize.pl:177
25165 #: ../tools/virt-resize.pl:179
25166 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25170 #: ../tools/virt-resize.pl:181
25171 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25175 #: ../tools/virt-resize.pl:183
25178 " # virsh edit guestname\n"
25183 #: ../tools/virt-resize.pl:185
25185 "Change E<lt>source ...E<gt>, see "
25186 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
25190 #: ../tools/virt-resize.pl:188
25191 msgid "Then start up the domain with the new, resized disk:"
25195 #: ../tools/virt-resize.pl:190
25198 " # virsh start guestname\n"
25203 #: ../tools/virt-resize.pl:192
25205 "and check that it still works. See also the L</NOTES> section below for "
25206 "additional information."
25210 #: ../tools/virt-resize.pl:195
25211 msgid "7. Resize LVs etc inside the guest"
25215 #: ../tools/virt-resize.pl:197
25216 msgid "(This can also be done offline using L<guestfish(1)>)"
25220 #: ../tools/virt-resize.pl:199
25222 "Once the guest has booted you should see the new space available, at least "
25223 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25224 "may need to resize LVs inside PVs, and also resize filesystem types that "
25225 "virt-resize does not know how to expand."
25229 #: ../tools/virt-resize.pl:206
25230 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25234 #: ../tools/virt-resize.pl:208
25236 "Shrinking is somewhat more complex than expanding, and only an overview is "
25241 #: ../tools/virt-resize.pl:211
25243 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25244 "filesystems). The user has to shrink content before passing the disk image "
25245 "to virt-resize, and virt-resize will check that the content has been shrunk "
25250 #: ../tools/virt-resize.pl:216
25251 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25255 #: ../tools/virt-resize.pl:218
25257 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25258 "steps 3 and 4 above to allocate a new disk image."
25262 #: ../tools/virt-resize.pl:221
25263 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25267 #: ../tools/virt-resize.pl:224
25268 msgid "IGNORING OR DELETING PARTITIONS"
25272 #: ../tools/virt-resize.pl:226
25274 "virt-resize also gives a convenient way to ignore or delete partitions when "
25275 "copying from the input disk to the output disk. Ignoring a partition speeds "
25276 "up the copy where you don't care about the existing contents of a "
25277 "partition. Deleting a partition removes it completely, but note that it "
25278 "also renumbers any partitions after the one which is deleted, which can "
25279 "leave some guests unbootable."
25283 #: ../tools/virt-resize.pl:243
25284 msgid "Display help."
25288 #: ../tools/virt-resize.pl:257
25289 msgid "B<--resize part=size>"
25293 #: ../tools/virt-resize.pl:259
25295 "Resize the named partition (expanding or shrinking it) so that it has the "
25300 #: ../tools/virt-resize.pl:262
25302 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25303 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25304 "Exabytes; or as a percentage of the current size; or as a relative number or "
25305 "percentage. For example:"
25309 #: ../tools/virt-resize.pl:267
25312 " --resize /dev/sda2=10G\n"
25317 #: ../tools/virt-resize.pl:269
25320 " --resize /dev/sda4=90%\n"
25325 #: ../tools/virt-resize.pl:271
25328 " --resize /dev/sda2=+1G\n"
25333 #: ../tools/virt-resize.pl:273
25336 " --resize /dev/sda2=-200M\n"
25341 #: ../tools/virt-resize.pl:275
25344 " --resize /dev/sda1=+128K\n"
25349 #: ../tools/virt-resize.pl:277
25352 " --resize /dev/sda1=+10%\n"
25357 #: ../tools/virt-resize.pl:279
25360 " --resize /dev/sda1=-10%\n"
25365 #: ../tools/virt-resize.pl:281
25367 "You can increase the size of any partition. Virt-resize will expand the "
25368 "direct content of the partition if it knows how (see C<--expand> below)."
25372 #: ../tools/virt-resize.pl:285
25374 "You can only I<decrease> the size of partitions that contain filesystems or "
25375 "PVs which have already been shrunk. Virt-resize will check this has been "
25376 "done before proceeding, or else will print an error (see also "
25377 "C<--resize-force>)."
25381 #: ../tools/virt-resize.pl:290 ../tools/virt-resize.pl:382 ../tools/virt-resize.pl:399
25382 msgid "You can give this option multiple times."
25386 #: ../tools/virt-resize.pl:296
25387 msgid "B<--resize-force part=size>"
25391 #: ../tools/virt-resize.pl:298
25393 "This is the same as C<--resize> except that it will let you decrease the "
25394 "size of any partition. Generally this means you will lose any data which "
25395 "was at the end of the partition you shrink, but you may not care about that "
25396 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25397 "as a swap partition)."
25401 #: ../tools/virt-resize.pl:304
25402 msgid "See also the C<--ignore> option."
25406 #: ../tools/virt-resize.pl:310
25407 msgid "B<--expand part>"
25411 #: ../tools/virt-resize.pl:312
25413 "Expand the named partition so it uses up all extra space (space left over "
25414 "after any other resize changes that you request have been done)."
25418 #: ../tools/virt-resize.pl:315
25420 "If virt-resize knows how, it will expand the direct content of the "
25421 "partition. For example, if the partition is an LVM PV, it will expand the "
25422 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25423 "content it doesn't know about alone."
25427 #: ../tools/virt-resize.pl:320
25428 msgid "Currently virt-resize can resize:"
25432 #: ../tools/virt-resize.pl:326
25434 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25439 #: ../tools/virt-resize.pl:331
25441 "NTFS filesystems contained directly in a partition, if libguestfs was "
25442 "compiled with support for NTFS."
25446 #: ../tools/virt-resize.pl:334
25448 "The filesystem must have been shut down consistently last time it was used. "
25449 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25450 "consistency check, so at the first boot after resizing Windows will check "
25455 #: ../tools/virt-resize.pl:341
25457 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25458 "inside the PV. The user will have to resize LVs as desired."
25462 #: ../tools/virt-resize.pl:347 ../tools/virt-resize.pl:369
25463 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25467 #: ../tools/virt-resize.pl:353
25468 msgid "B<--shrink part>"
25472 #: ../tools/virt-resize.pl:355
25474 "Shrink the named partition until the overall disk image fits in the "
25475 "destination. The named partition B<must> contain a filesystem or PV which "
25476 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25477 "online tools). Virt-resize will check this and give an error if it has not "
25482 #: ../tools/virt-resize.pl:361
25484 "The amount by which the overall disk must be shrunk (after carrying out all "
25485 "other operations requested by the user) is called the \"deficit\". For "
25486 "example, a straight copy (assume no other operations) from a 5GB disk image "
25487 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25488 "would give an error unless the user specified a partition to shrink and that "
25489 "partition had more than a gigabyte of free space."
25493 #: ../tools/virt-resize.pl:375
25494 msgid "B<--ignore part>"
25498 #: ../tools/virt-resize.pl:377
25500 "Ignore the named partition. Effectively this means the partition is "
25501 "allocated on the destination disk, but the content is not copied across from "
25502 "the source disk. The content of the partition will be blank (all zero "
25507 #: ../tools/virt-resize.pl:388
25508 msgid "B<--delete part>"
25512 #: ../tools/virt-resize.pl:390
25514 "Delete the named partition. It would be more accurate to describe this as "
25515 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25516 "the original disk image is left intact."
25520 #: ../tools/virt-resize.pl:394
25522 "Note that when you delete a partition, then anything contained in the "
25523 "partition is also deleted. Furthermore, this causes any partitions that "
25524 "come after to be I<renumbered>, which can easily make your guest unbootable."
25528 #: ../tools/virt-resize.pl:405
25529 msgid "B<--LV-expand logvol>"
25533 #: ../tools/virt-resize.pl:407
25535 "This takes the logical volume and, as a final step, expands it to fill all "
25536 "the space available in its volume group. A typical usage, assuming a Linux "
25537 "guest with a single PV C</dev/sda2> and a root device called "
25538 "C</dev/vg_guest/lv_root> would be:"
25542 #: ../tools/virt-resize.pl:412
25545 " virt-resize indisk outdisk \\\n"
25546 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25551 #: ../tools/virt-resize.pl:415
25553 "This would first expand the partition (and PV), and then expand the root "
25554 "device to fill the extra space in the PV."
25558 #: ../tools/virt-resize.pl:418
25560 "The contents of the LV are also resized if virt-resize knows how to do "
25561 "that. You can stop virt-resize from trying to expand the content by using "
25562 "the option C<--no-expand-content>."
25566 #: ../tools/virt-resize.pl:422
25567 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25571 #: ../tools/virt-resize.pl:425
25573 "You can give this option multiple times, I<but> it doesn't make sense to do "
25574 "this unless the logical volumes you specify are all in different volume "
25579 #: ../tools/virt-resize.pl:433
25580 msgid "B<--no-copy-boot-loader>"
25584 #: ../tools/virt-resize.pl:435
25586 "By default, virt-resize copies over some sectors at the start of the disk "
25587 "(up to the beginning of the first partition). Commonly these sectors "
25588 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25589 "in order for the guest to boot correctly."
25593 #: ../tools/virt-resize.pl:440
25595 "If you specify this flag, then this initial copy is not done. You may need "
25596 "to reinstall the boot loader in this case."
25600 #: ../tools/virt-resize.pl:448
25601 msgid "B<--no-extra-partition>"
25605 #: ../tools/virt-resize.pl:450
25607 "By default, virt-resize creates an extra partition if there is any extra, "
25608 "unused space after all resizing has happened. Use this option to prevent "
25609 "the extra partition from being created. If you do this then the extra space "
25610 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25611 "tool in the guest."
25615 #: ../tools/virt-resize.pl:456
25617 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25622 #: ../tools/virt-resize.pl:463
25623 msgid "B<--no-expand-content>"
25627 #: ../tools/virt-resize.pl:465
25629 "By default, virt-resize will try to expand the direct contents of "
25630 "partitions, if it knows how (see C<--expand> option above)."
25634 #: ../tools/virt-resize.pl:468
25636 "If you give the C<--no-expand-content> option then virt-resize will not "
25641 #: ../tools/virt-resize.pl:475
25642 msgid "B<-d> | B<--debug>"
25646 #: ../tools/virt-resize.pl:477 ../tools/virt-win-reg.pl:198
25647 msgid "Enable debugging messages."
25651 #: ../tools/virt-resize.pl:483
25652 msgid "B<-n> | B<--dryrun>"
25656 #: ../tools/virt-resize.pl:485
25657 msgid "Print a summary of what would be done, but don't do anything."
25661 #: ../tools/virt-resize.pl:491
25662 msgid "B<-q> | B<--quiet>"
25666 #: ../tools/virt-resize.pl:493
25667 msgid "Don't print the summary."
25671 #: ../tools/virt-resize.pl:1352
25672 msgid "\"Partition 1 does not end on cylinder boundary.\""
25676 #: ../tools/virt-resize.pl:1354
25678 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25679 "means the partitions will not be aligned to the ancient CHS geometry. "
25680 "However CHS geometry is meaningless for disks manufactured since the early "
25681 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25682 "cylinders is not required by any modern operating system."
25686 #: ../tools/virt-resize.pl:1361
25687 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25691 #: ../tools/virt-resize.pl:1363
25693 "In Windows Vista and later versions, Microsoft switched to using a separate "
25694 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25695 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
25696 "the boot partition. Doing so seems to break the guest completely. However "
25697 "expanding the second partition (ie. C: drive) should work."
25701 #: ../tools/virt-resize.pl:1370
25703 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25704 "NTFS partitions have been expanded. This is just a safety check and (unless "
25705 "it find errors) is nothing to worry about."
25709 #: ../tools/virt-resize.pl:1374
25710 msgid "ALTERNATIVE TOOLS"
25714 #: ../tools/virt-resize.pl:1376
25716 "There are several proprietary tools for resizing partitions. We won't "
25717 "mention any here."
25721 #: ../tools/virt-resize.pl:1379
25723 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25724 "operations on disk images. They can resize and move partitions, but I don't "
25725 "think they can do anything with the contents, and they certainly don't "
25730 #: ../tools/virt-resize.pl:1384
25732 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25733 "but at a much lower level. You will probably end up hand-calculating sector "
25734 "offsets, which is something that virt-resize was designed to avoid. If you "
25735 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25740 #: ../tools/virt-resize.pl:1392
25742 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
25743 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
25744 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, "
25745 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
25749 #: ../tools/virt-tar.pl:34
25750 msgid "virt-tar - Extract or upload files to a virtual machine"
25754 #: ../tools/virt-tar.pl:38
25757 " virt-tar [--options] -x domname directory tarball\n"
25762 #: ../tools/virt-tar.pl:40
25765 " virt-tar [--options] -u domname tarball directory\n"
25770 #: ../tools/virt-tar.pl:42
25773 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
25778 #: ../tools/virt-tar.pl:44
25781 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
25786 #: ../tools/virt-tar.pl:48
25787 msgid "Download C</home> from the VM into a local tarball:"
25791 #: ../tools/virt-tar.pl:50
25794 " virt-tar -x domname /home home.tar\n"
25799 #: ../tools/virt-tar.pl:52
25802 " virt-tar -zx domname /home home.tar.gz\n"
25807 #: ../tools/virt-tar.pl:54
25808 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
25812 #: ../tools/virt-tar.pl:56
25815 " virt-tar -u domname uploadstuff.tar /tmp\n"
25820 #: ../tools/virt-tar.pl:58
25823 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
25828 #: ../tools/virt-tar.pl:62
25830 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
25831 "virtual machines. If you do this, you risk disk corruption in the VM. "
25832 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
25836 #: ../tools/virt-tar.pl:67
25838 "You can use C<-x> (extract) on live virtual machines, but you might get "
25839 "inconsistent results or errors if there is filesystem activity inside the "
25840 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
25841 "work, but the only way to guarantee consistent results is if the virtual "
25842 "machine is shut down."
25846 #: ../tools/virt-tar.pl:75
25848 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
25849 "parts of a guest filesystem. There are many possibilities: making backups, "
25850 "uploading data files, snooping on guest activity, fixing or customizing "
25855 #: ../tools/virt-tar.pl:80
25857 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
25858 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
25859 "should look at the L<guestfish(1)> tool."
25863 #: ../tools/virt-tar.pl:84
25865 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
25866 "its contents (recursively) from the virtual machine into a local tarball. "
25867 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
25868 "virtual machine. You cannot use these two options together."
25872 #: ../tools/virt-tar.pl:90
25874 "In addition, you may need to use the C<-z> (gZip) option to enable "
25875 "compression. When uploading, you have to specify C<-z> if the upload file "
25876 "is compressed because virt-tar won't detect this on its own."
25880 #: ../tools/virt-tar.pl:94
25882 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
25883 "example it cannot do PKZip files or bzip2 compression. If you want that "
25884 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
25885 "the L<libguestfs(3)> API)."
25889 #: ../tools/virt-tar.pl:135
25890 msgid "B<-x> | B<--extract> | B<--download>"
25894 #: ../tools/virt-tar.pl:137
25895 msgid "B<-u> | B<--upload>"
25899 #: ../tools/virt-tar.pl:139
25901 "Use C<-x> to extract (download) a directory from a virtual machine to a "
25906 #: ../tools/virt-tar.pl:142
25908 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
25909 "Please read the L</WARNING> section above before using this option."
25913 #: ../tools/virt-tar.pl:146
25914 msgid "You must specify exactly one of these options."
25918 #: ../tools/virt-tar.pl:152
25919 msgid "B<-z> | B<--gzip>"
25923 #: ../tools/virt-tar.pl:154
25924 msgid "Specify that the input or output tarball is gzip-compressed."
25928 #: ../tools/virt-tar.pl:259
25930 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
25931 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
25932 "L<http://libguestfs.org/>."
25936 #: ../tools/virt-win-reg.pl:38
25938 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
25943 #: ../tools/virt-win-reg.pl:42
25946 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
25951 #: ../tools/virt-win-reg.pl:44
25954 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
25959 #: ../tools/virt-win-reg.pl:46
25962 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
25967 #: ../tools/virt-win-reg.pl:48
25970 " virt-win-reg --merge domname [input.reg ...]\n"
25975 #: ../tools/virt-win-reg.pl:50
25978 " virt-win-reg [--options] disk.img ... # instead of domname\n"
25983 #: ../tools/virt-win-reg.pl:54
25985 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
25986 "virtual machines. If you do this, you I<will> get irreversible disk "
25987 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
25988 "but doesn't catch all cases."
25992 #: ../tools/virt-win-reg.pl:59
25994 "Modifying the Windows Registry is an inherently risky operation. The format "
25995 "is deliberately obscure and undocumented, and Registry changes can leave the "
25996 "system unbootable. Therefore when using the C<--merge> option, make sure "
25997 "you have a reliable backup first."
26001 #: ../tools/virt-win-reg.pl:66
26003 "This program can export and merge Windows Registry entries from a Windows "
26008 #: ../tools/virt-win-reg.pl:69
26010 "The first parameter is the libvirt guest name or the raw disk image of a "
26015 #: ../tools/virt-win-reg.pl:72
26017 "If C<--merge> is I<not> specified, then the chosen registry key is "
26018 "displayed/exported (recursively). For example:"
26022 #: ../tools/virt-win-reg.pl:75
26025 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26030 #: ../tools/virt-win-reg.pl:77
26031 msgid "You can also display single values from within registry keys, for example:"
26035 #: ../tools/virt-win-reg.pl:80
26038 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26039 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26040 " Windows 7 Enterprise\n"
26045 #: ../tools/virt-win-reg.pl:84
26047 "With C<--merge>, you can merge a textual regedit file into the Windows "
26052 #: ../tools/virt-win-reg.pl:87
26055 " $ virt-win-reg --merge Windows7 changes.reg\n"
26060 #: ../tools/virt-win-reg.pl:89
26061 msgid "SUPPORTED SYSTEMS"
26065 #: ../tools/virt-win-reg.pl:91
26067 "The program currently supports Windows NT-derived guests starting with "
26068 "Windows XP through to at least Windows 7."
26072 #: ../tools/virt-win-reg.pl:94
26074 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
26075 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
26076 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
26080 #: ../tools/virt-win-reg.pl:98
26082 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26087 #: ../tools/virt-win-reg.pl:101
26089 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26094 #: ../tools/virt-win-reg.pl:104
26099 #: ../tools/virt-win-reg.pl:106
26101 "This program is only meant for simple access to the registry. If you want "
26102 "to do complicated things with the registry, we suggest you download the "
26103 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26104 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26105 "L<hivexregedit(1)>."
26109 #: ../tools/virt-win-reg.pl:112
26114 #: ../tools/virt-win-reg.pl:114
26116 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26117 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
26118 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
26119 "with Windows-style line endings, you may need to reencode the whole file "
26120 "before or after processing."
26124 #: ../tools/virt-win-reg.pl:120
26126 "To reencode a file from Windows format to Linux (before processing it with "
26127 "the C<--merge> option), you would do something like this:"
26131 #: ../tools/virt-win-reg.pl:123
26134 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26139 #: ../tools/virt-win-reg.pl:125
26141 "To go in the opposite direction, after exporting and before sending the file "
26142 "to a Windows user, do something like this:"
26146 #: ../tools/virt-win-reg.pl:128
26149 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26154 #: ../tools/virt-win-reg.pl:130
26155 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26159 #: ../tools/virt-win-reg.pl:132
26161 "If you are unsure about the current encoding, use the L<file(1)> command. "
26162 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
26163 "Windows-style (CRLF) line endings, like this:"
26167 #: ../tools/virt-win-reg.pl:136
26170 " $ file software.reg\n"
26171 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26172 " with CRLF line terminators\n"
26177 #: ../tools/virt-win-reg.pl:140
26178 msgid "This file would need conversion before you could C<--merge> it."
26182 #: ../tools/virt-win-reg.pl:142
26183 msgid "SHELL QUOTING"
26187 #: ../tools/virt-win-reg.pl:144
26189 "Be careful when passing parameters containing C<\\> (backslash) in the "
26190 "shell. Usually you will have to use 'single quotes' or double backslashes "
26191 "(but not both) to protect them from the shell."
26195 #: ../tools/virt-win-reg.pl:148
26196 msgid "Paths and value names are case-insensitive."
26200 #: ../tools/virt-win-reg.pl:150
26201 msgid "CurrentControlSet etc."
26205 #: ../tools/virt-win-reg.pl:152
26207 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26208 "Registry at the level of the hive file, and therefore you cannot modify "
26213 #: ../tools/virt-win-reg.pl:156
26215 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26216 "circumstances it might refer to another control set. The way to find out is "
26217 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26221 #: ../tools/virt-win-reg.pl:160
26224 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26225 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26226 " \"Current\"=dword:00000001\n"
26227 " \"Default\"=dword:00000001\n"
26228 " \"Failed\"=dword:00000000\n"
26229 " \"LastKnownGood\"=dword:00000002\n"
26234 #: ../tools/virt-win-reg.pl:167
26235 msgid "\"Default\" is the one which Windows will choose when it boots."
26239 #: ../tools/virt-win-reg.pl:169
26240 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
26244 #: ../tools/virt-win-reg.pl:216
26249 #: ../tools/virt-win-reg.pl:218
26251 "In merge mode, this merges a textual regedit file into the Windows Registry "
26252 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26253 "displays or exports Registry entries instead."
26257 #: ../tools/virt-win-reg.pl:222
26259 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26260 "result in disk corruption. However exporting (without this flag) is always "
26265 #: ../tools/virt-win-reg.pl:230
26266 msgid "B<--encoding> UTF-16LE|ASCII"
26270 #: ../tools/virt-win-reg.pl:232
26272 "When merging (only), you may need to specify the encoding for strings to be "
26273 "used in the hive file. This is explained in detail in "
26274 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
26278 #: ../tools/virt-win-reg.pl:236
26280 "The default is to use UTF-16LE, which should work with recent versions of "
26285 #: ../tools/virt-win-reg.pl:463
26287 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
26288 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
26289 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
26290 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26294 #: ../tools/virt-win-reg.pl:481
26297 " export LIBGUESTFS_DEBUG=1\n"
26298 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26303 #: ../tools/virt-win-reg.pl:484
26305 "Attach /tmp/virt-win-reg.log to a new bug report at "
26306 "L<https://bugzilla.redhat.com/>"